1 #include "ERNeuRadHitFinder.h" 8 #include "TGeoMatrix.h" 10 #include "FairRootManager.h" 11 #include "FairRunAna.h" 12 #include "FairRuntimeDb.h" 14 #include "ERDetectorList.h" 15 #include "ERNeuRadPixelSignal.h" 16 #include "ERNeuRadSetup.h" 18 Int_t ERNeuRadHitFinder::fEvent = 0;
22 : FairTask(
"ER muSi hit producing scheme")
29 : FairTask(
"ER muSi hit producing scheme ", verbose)
41 void ERNeuRadHitFinder::SetParContainers()
44 FairRunAna* run = FairRunAna::Instance();
45 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
47 FairRuntimeDb* rtdb = run->GetRuntimeDb();
48 if ( ! rtdb ) Fatal(
"SetParContainers",
"No runtime database");
51 (rtdb->getContainer(
"ERNeuRadDigiPar"));
59 FairRootManager* ioman = FairRootManager::Instance();
60 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
66 fNeuRadHits =
new TClonesArray(
"ERNeuRadHit",1000);
68 ioman->Register(
"NeuRadHit",
"NeuRad hits", fNeuRadHits, kTRUE);
80 std::cout << std::endl;
81 std::cout <<
"####### EVENT " << fEvent++ <<
" #####" << std::endl;
82 std::cout << std::endl;
83 std::cout <<
"ERNeuRadHitFinder: "<< std::endl;
85 Float_t fOnePEInteg = 4.8;
92 std::cerr <<
"0" << std::endl;
93 if (signal->Side()==0){
95 std::cerr <<
"1" << std::endl;
96 Bool_t founded=kFALSE;
97 Int_t jBackSignal = -1;
100 if (signalBack->Side() == 1 && signalBack->ModuleNb()==signal->ModuleNb() && signalBack->PixelNb()==signal->PixelNb()){
102 jBackSignal = jSignal;
109 std::cerr << signal->FullInteg() <<
" " << fPixelThreshold*signal->OnePEIntegral()<<
" " <<signalBack->FullInteg()<< std::endl;
110 if (signal->FullInteg() > fPixelThreshold*signal->OnePEIntegral() && signalBack->FullInteg() > fPixelThreshold*signal->OnePEIntegral()){
111 targetHitSignal = signal;
120 TVector3 pos(setup->FiberX(targetHitSignal->ModuleNb(), targetHitSignal->PixelNb()),
121 setup->FiberY(targetHitSignal->ModuleNb(), targetHitSignal->PixelNb()),
122 setup->Z()-setup->FiberLength());
123 TVector3 dpos(0,0,0);
124 AddHit(kNEURAD,pos, dpos,targetHitSignal->ModuleNb(),targetHitSignal->PixelNb(),targetHitSignal->FullInteg());
126 std::cout <<
"Hits count: " << fNeuRadHits->GetEntriesFast() << std::endl;
134 fNeuRadHits->Delete();
146 ERNeuRadHit* ERNeuRadHitFinder::AddHit(Int_t detID, TVector3& pos, TVector3& dpos,
147 Int_t ModuleNb, Int_t PixelNb, Float_t time)
149 ERNeuRadHit *hit =
new((*fNeuRadHits)[fNeuRadHits->GetEntriesFast()])
150 ERNeuRadHit(fNeuRadHits->GetEntriesFast(),detID, pos, dpos,-1, ModuleNb, PixelNb, time);
virtual void Exec(Option_t *opt)
TClonesArray * fNeuRadPMTSignals
virtual InitStatus Init()