1 #include "ERNeuRadHitFinderMF.h" 8 #include "TGeoMatrix.h" 10 #include "FairRootManager.h" 11 #include "FairRunAna.h" 12 #include "FairRuntimeDb.h" 14 #include "ERDetectorList.h" 15 #include "ERNeuRadDigi.h" 16 #include "ERNeuRadSetup.h" 18 Int_t ERNeuRadHitFinderMF::fEvent = 0;
22 : fPixelThreshold(2.),
27 FairTask(
"ER muSi hit producing scheme")
34 : fPixelThreshold(2.),
39 FairTask(
"ER muSi hit producing scheme ", verbose)
51 void ERNeuRadHitFinderMF::SetParContainers()
54 FairRunAna* run = FairRunAna::Instance();
55 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
57 FairRuntimeDb* rtdb = run->GetRuntimeDb();
58 if ( ! rtdb ) Fatal(
"SetParContainers",
"No runtime database");
61 (rtdb->getContainer(
"ERNeuRadDigiPar"));
69 FairRootManager* ioman = FairRootManager::Instance();
70 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
72 fNeuRadDigis = (TClonesArray*) ioman->GetObject(
"NeuRadDigi");
76 fNeuRadHits =
new TClonesArray(
"ERNeuRadHit",1000);
78 ioman->Register(
"NeuRadHit",
"NeuRad hits", fNeuRadHits, kTRUE);
90 std::cout << std::endl;
91 std::cout <<
"####### EVENT " << fEvent++ <<
" #####" << std::endl;
92 std::cout << std::endl;
93 std::cout <<
"ERNeuRadHitFinderMF: "<< std::endl;
95 Float_t fOnePEInteg = 4.8;
100 Float_t* SumModuleSignals =
new Float_t[setup->NofModules()];
101 for (Int_t iModule=0; iModule < setup->NofModules(); iModule++)
102 SumModuleSignals[iModule] =0.;
103 for (Int_t iDigi=0; iDigi <
fNeuRadDigis->GetEntriesFast(); iDigi++){
105 SumModuleSignals[digi->ModuleIndex()]+=digi->QDC();
108 Int_t nofModules = 0;
109 for (Int_t iModule=0; iModule < setup->NofModules(); iModule++){
110 if (SumModuleSignals[iModule] > fModuleThreshold*fOnePEInteg)
115 for (Int_t iDigi=0; iDigi <
fNeuRadDigis->GetEntriesFast(); iDigi++){
117 if (digi->Side()==0 && digi->QDC() > fPixelThreshold*fOnePEInteg && SumModuleSignals[digi->ModuleIndex()] > fModuleThreshold*fOnePEInteg){
118 TVector3 pos(setup->FiberX(digi->ModuleIndex(), digi->FiberIndex()),
119 setup->FiberY(digi->ModuleIndex(), digi->FiberIndex()),
120 setup->Z()-setup->FiberLength());
121 TVector3 dpos(0,0,0);
122 AddHit(kNEURAD,pos, dpos,digi->ModuleIndex(),digi->FiberIndex(),digi->FrontTDC());
126 delete [] SumModuleSignals;
127 std::cout <<
"Hits count: " << fNeuRadHits->GetEntriesFast() << std::endl;
135 fNeuRadHits->Delete();
147 ERNeuRadHit* ERNeuRadHitFinderMF::AddHit(Int_t detID, TVector3& pos, TVector3& dpos,
148 Int_t ModuleIndex, Int_t FiberIndex, Float_t time)
150 ERNeuRadHit *hit =
new((*fNeuRadHits)[fNeuRadHits->GetEntriesFast()])
151 ERNeuRadHit(fNeuRadHits->GetEntriesFast(),detID, pos, dpos,-1, ModuleIndex, FiberIndex, time);
TClonesArray * fNeuRadDigis
virtual void Exec(Option_t *opt)
virtual InitStatus Init()