FairRoot/PandaRoot
Public Member Functions | List of all members
PndMagnet Class Reference

#include <PndMagnet.h>

Inheritance diagram for PndMagnet:

Public Member Functions

 PndMagnet (const char *name, const char *Title="PND Magnet")
 
 PndMagnet ()
 
virtual ~PndMagnet ()
 
void ConstructGeometry ()
 
void ConstructASCIIGeometry ()
 
Bool_t CheckIfSensitive (std::string name)
 

Detailed Description

Definition at line 11 of file PndMagnet.h.

Constructor & Destructor Documentation

PndMagnet::PndMagnet ( const char *  name,
const char *  Title = "PND Magnet" 
)

Definition at line 22 of file PndMagnet.cxx.

23  : FairModule(name ,Title)
24 {
25 }
TString name
PndMagnet::PndMagnet ( )

Definition at line 18 of file PndMagnet.cxx.

19 {
20 }
PndMagnet::~PndMagnet ( )
virtual

Definition at line 15 of file PndMagnet.cxx.

16 {
17 }

Member Function Documentation

Bool_t PndMagnet::CheckIfSensitive ( std::string  name)

Definition at line 39 of file PndMagnet.cxx.

39  {
40  // just to get rid of the warrning during run, not need this is a passive element!
41  (void)name; // get rid of "unused" warning
42  return kFALSE;
43 }
TString name
void PndMagnet::ConstructASCIIGeometry ( )

Definition at line 45 of file PndMagnet.cxx.

References Bool_t, fRun, PndGeoPassivePar::GetGeoPassiveNodes(), PndGeoPassivePar::GetGeoSensitiveNodes(), par, and rtdb.

Referenced by ConstructGeometry().

45  {
46  FairGeoLoader *loader=FairGeoLoader::Instance();
47  FairGeoInterface *GeoInterface =loader->getGeoInterface();
48  PndGeoMagnet *MGeo=new PndGeoMagnet();
49  MGeo->setGeomFile(GetGeometryFileName());
50  GeoInterface->addGeoModule(MGeo);
51  Bool_t rc = GeoInterface->readSet(MGeo);
52  if ( rc ) MGeo->create(loader->getGeoBuilder());
53 
54  TList* volList = MGeo->getListOfVolumes();
55  // store geo parameter
56  FairRun *fRun = FairRun::Instance();
57  FairRuntimeDb *rtdb= FairRun::Instance()->GetRuntimeDb();
58  PndGeoPassivePar* par=(PndGeoPassivePar*)(rtdb->getContainer("PndGeoPassivePar"));
59  TObjArray *fSensNodes = par->GetGeoSensitiveNodes();
60  TObjArray *fPassNodes = par->GetGeoPassiveNodes();
61 
62  TListIter iter(volList);
63  FairGeoNode* node = NULL;
64  FairGeoVolume *aVol=NULL;
65 
66  while( (node = (FairGeoNode*)iter.Next()) ) {
67  aVol = dynamic_cast<FairGeoVolume*> ( node );
68  if ( node->isSensitive() ) {
69  fSensNodes->AddLast( aVol );
70  }else{
71  fPassNodes->AddLast( aVol );
72  }
73  }
74  ProcessNodes( volList );
75  par->setChanged();
76  par->setInputVersion(fRun->GetRunId(),1);
77 }
TObjArray * GetGeoPassiveNodes()
Double_t par[3]
FairRunAna * fRun
Definition: hit_dirc.C:58
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
TObjArray * GetGeoSensitiveNodes()
void PndMagnet::ConstructGeometry ( )

Definition at line 27 of file PndMagnet.cxx.

References ConstructASCIIGeometry(), and TString.

27  {
28 
29  TString fileName=GetGeometryFileName();
30  if (fileName.EndsWith(".geo")) {
32  } else if(fileName.EndsWith(".root")) {
33  ConstructRootGeometry();
34  } else {
35  std::cout<< "Geometry format not supported " <<std::endl;
36  }
37 }
void ConstructASCIIGeometry()
Definition: PndMagnet.cxx:45

The documentation for this class was generated from the following files: