#include #include "TClonesArray.h" #include "TLorentzVector.h" #include "TMath.h" #include "TFile.h" #include "TTree.h" #include "TParticle.h" #include "TGeoMaterial.h" #include "TGeoMedium.h" #include "TGeoArb8.h" #include "TGeoTrd2.h" #include "TGeoMatrix.h" #include "TGeoManager.h" #include "TVirtualMC.h" #include "FairVolume.h" // add on for debug #include "FairRuntimeDb.h" #include "FairRun.h" #include "FairModule.h" #include "PndMdt.h" using namespace std; Int_t PndMdt::fTrkIn = 0; TLorentzVector PndMdt::fPos_In; TLorentzVector PndMdt::fMom_In; // ----- Default constructor ------------------------------------------- PndMdt::PndMdt() { fMdtCollection = new TClonesArray("PndMdtPoint"); fPosIndex = 0; ResetParameters(); SetVerbosity(kFALSE); } // ------------------------------------------------------------------------- // ----- Inherited constructor ----------------------------------------- PndMdt::PndMdt(const char* name, Bool_t active) : FairDetector(name,active) { fMdtCollection = new TClonesArray("PndMdtPoint"); fPosIndex = 0; ResetParameters(); SetVerbosity(kFALSE); } // ------------------------------------------------------------------------- // ----- Destructor ---------------------------------------------------- PndMdt::~PndMdt() { if (fMdtCollection) { fMdtCollection->Delete(); delete fMdtCollection; }; } // ------------------------------------------------------------------------- // ----- Public method Print ---------------------------------------------- void PndMdt::Print() const { Int_t nHits = fMdtCollection->GetEntriesFast(); for (Int_t i=0; iPrint(); } // ---------------------------------------------------------------------------- // ----- Public method Reset ---------------------------------------------- void PndMdt::Reset() { fMdtCollection->Delete(); fPosIndex = 0; } // ---------------------------------------------------------------------------- // ----- Public method CopyClones ----------------------------------------- void PndMdt::CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset ) { /* Int_t nEntries = cl1->GetEntriesFast(); TClonesArray& clref = *cl2; PndMdtPoint* oldpoint = NULL; for (Int_t i=0; iAt(i); Int_t index = oldpoint->GetTrackID() + offset; oldpoint->SetTrackID(index); new (clref[fPosIndex]) PndMdtPoint(*oldpoint); fPosIndex++; } cout << " -I- PndMdt: " << cl2->GetEntriesFast() << " merged entries." << endl; */ } // ---------------------------------------------------------------------------- // ----- Public method ResetParameters ------------------------------------ void PndMdt::ResetParameters() { /* fEventID = -999; fTrackID = -999; fTrackParentID = -999; fDetectorID = -999; fPDG = -999; */ fPos.SetXYZT(0., 0., 0., 0.); fMom.SetXYZT(0., 0., 0., 0.) ; } // ---------------------------------------------------------------------------- // ----- Public method SetParFile -------------------------------------- void PndMdt::SetParFile(TString filename) { ffn = filename; } // ------------------------------------------------------------------------- // ----- Public method SetMdtVersion ----------------------------------- void PndMdt::SetMdtVersion(TString location) { version = location; cout<GetRuntimeDb(); par=(PndGeoMdtPar*)(rtdb->getContainer("PndGeoMdtPar")); TObjArray *fSensNodes = par->GetSensitiveNodes(); } // ------------------------------------------------------------------------- // ----- Public method BeginEvent -------------------------------------- void PndMdt::BeginEvent() { } // ------------------------------------------------------------------------- // ----- Public method ProcessHits -------------------------------------- Bool_t PndMdt::ProcessHits(FairVolume* vol) { Bool_t ph = kFALSE; if(version=="torino" || version=="Torino") ph = ProcessHitsTo(vol); else if(version=="dubna" || version=="Dubna") ph = ProcessHitsDu(vol); else {cout<<"Error in PndMdt::ConstructGeometry: Specify the version and run again!"<