1 #include "ERNeuRadMatcher.h" 8 #include "TGeoMatrix.h" 10 #include "FairRootManager.h" 11 #include "FairRunAna.h" 12 #include "FairRuntimeDb.h" 14 #include "ERNeuRadHit.h" 15 #include "ERNeuRadStep.h" 20 fNeuRadFirstSteps(NULL),
27 FairTask(
"ER muSi hit producing scheme")
35 fNeuRadFirstSteps(NULL),
42 FairTask(
"ER muSi hit producing scheme ", verbose)
54 void ERNeuRadMatcher::SetParContainers()
57 FairRunAna* run = FairRunAna::Instance();
58 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
60 FairRuntimeDb* rtdb = run->GetRuntimeDb();
61 if ( ! rtdb ) Fatal(
"SetParContainers",
"No runtime database");
69 FairRootManager* ioman = FairRootManager::Instance();
70 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
72 fNeuRadHits = (TClonesArray*) ioman->GetObject(
"NeuRadHit");
73 fNeuRadFirstSteps = (TClonesArray*) ioman->GetObject(
"NeuRadFirstStep");
76 fHdxy =
new TH1F(
"fHdxy",
"XY distance",4000,0.,4.);
77 fHdxy->GetXaxis()->SetTitle(
"XY disance [cm]");
79 fHdxyLess6 =
new TH1F(
"fHdxyLess6",
"XY distance less 6mm",100.,0.,1.);
80 fHdxyLess6->GetXaxis()->SetTitle(
"XY disance [cm]");
82 fHdxyOF =
new TH1F(
"fHdxyOF",
"XY distance, One fiber mode",4000,0.,4.);
83 fHdxyOF->GetXaxis()->SetTitle(
"XY disance [cm]");
85 fHdxyLess6OF =
new TH1F(
"fHdxyLess6OF",
"XY distance less 6mm, One fibre mode",100.,0.,1.);
86 fHdxyLess6OF->GetXaxis()->SetTitle(
"XY disance [cm]");
88 fHdxyTF =
new TH1F(
"fHdxyTF",
"XY distance, Two fiber mode",4000,0.,4.);
89 fHdxyTF->GetXaxis()->SetTitle(
"XY disance [cm]");
91 fHdxyLess6TF =
new TH1F(
"fHdxyLess6TF",
"XY distance less 6mm, Two fibre mode",100.,0.,1.);
92 fHdxyLess6TF->GetXaxis()->SetTitle(
"XY disance [cm]");
106 Double_t dist = TMath::Sqrt((hit->GetX()-step->GetX())*(hit->GetX()-step->GetX()) +
107 (hit->GetY()-step->GetY())*(hit->GetY()-step->GetY()));
108 std::cerr << dist << std::endl;
111 fHdxyLess6OF->Fill(dist);
120 if (hit1->Time() < hit2->Time()) {
121 dist = TMath::Sqrt((hit1->GetX()-step->GetX())*(hit1->GetX()-step->GetX()) +
122 (hit1->GetY()-step->GetY())*(hit1->GetY()-step->GetY()));
124 dist = TMath::Sqrt((hit2->GetX()-step->GetX())*(hit2->GetX()-step->GetX()) +
125 (hit2->GetY()-step->GetY())*(hit2->GetY()-step->GetY()));
130 fHdxyLess6TF->Fill(dist);
138 Float_t minTime = 999999999.;
139 for(Int_t iHit = 0; iHit <
fNeuRadHits->GetEntriesFast(); iHit++) {
141 if (hit->Time() < minTime){
142 minTime = hit->Time();
146 Double_t dist = TMath::Sqrt((firstHit->GetX()-step->GetX())*(firstHit->GetX()-step->GetX()) +
147 (firstHit->GetY()-step->GetY())*(firstHit->GetY()-step->GetY()));
150 fHdxyLess6->Fill(dist);
167 fHdxyLess6OF->Write();
169 fHdxyLess6TF->Write();
virtual InitStatus Init()
TClonesArray * fNeuRadHits
virtual void Exec(Option_t *opt)