1 #include "ERLi10Reconstructor.h" 6 #include "TGeoMatrix.h" 9 #include "TDatabasePDG.h" 11 #include "FairRootManager.h" 12 #include "FairRunAna.h" 13 #include "FairRuntimeDb.h" 17 #include "ERDetectorList.h" 19 #include "ERRTelescopeHit.h" 20 #include "ERLi10EventHeader.h" 25 : FairTask(
"ER Li10 reconstruction scheme")
26 ,fRTelescopeHits(NULL)
34 : FairTask(
"ER Li10 reconstruction scheme", verbose)
35 ,fRTelescopeHits(NULL)
48 void ERLi10Reconstructor::SetParContainers()
51 FairRunAna* run = FairRunAna::Instance();
52 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
54 FairRuntimeDb* rtdb = run->GetRuntimeDb();
55 if ( ! rtdb ) Fatal(
"SetParContainers",
"No runtime database");
63 FairRootManager* ioman = FairRootManager::Instance();
64 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
66 fNDHits = (TClonesArray*) ioman->GetObject(
"NDHit");
68 Fatal(
"Init",
"Can`t find collection NDHit!");
70 fRTelescopeHits = (TClonesArray*) ioman->GetObject(
"RTelescopeHit");
72 Fatal(
"Init",
"Can`t find collection NDHit!");
77 Fatal(
"Init",
"Can`t find MCEventHeader!");
86 std::cout <<
"ERLi10Reconstructor: "<< std::endl;
87 std::cout <<
"RTelescope Hits: "<< std::endl;
88 for (Int_t iHit = 0; iHit < fRTelescopeHits->GetEntriesFast(); iHit++){
89 ERRTelescopeHit* hit = (ERRTelescopeHit*)fRTelescopeHits->At(iHit);
90 std::cout << iHit <<
" Eloss:" << hit->Eloss() <<
" time:" << hit->Time() << std::endl;
92 std::cout <<
"ND Hits: "<< std::endl;
96 for (Int_t iHit = 0; iHit <
fNDHits->GetEntriesFast(); iHit++){
98 if (hit->NeutronProb() > 0){
102 std::cout << iHit <<
" Eloss:" << hit->
LightYield() <<
" time:" << hit->Time() <<
" NeutronProb:"<< hit->NeutronProb() << std::endl;
105 FairRunAna* run = FairRunAna::Instance();
107 Fatal(
"SetParContainers",
"No analysis run");
124 hit->Position(hitPos);
125 TVector3 reactionPos(0.,0.,fMCHeader->ReactionPos());
126 Float_t L = (hitPos-reactionPos).Mag();
127 Float_t Vn = L/(hit->Time()-fMCHeader->ReactionTime());
128 Float_t Mn = TDatabasePDG::Instance()->GetParticle(
"neutron")->Mass();
129 Float_t beta = Vn/TMath::C();
130 Float_t gamma = 1./TMath::Sqrt(1-beta*beta);
131 Float_t NEnergy = Mn*gamma;
134 header->SetNEnergy(-1);
143 if (fRTelescopeHits->GetEntriesFast() == 1){
144 ERRTelescopeHit* hit = (ERRTelescopeHit*)fRTelescopeHits->At(0);
145 header->SetPEnergy(hit->Eloss());
148 header->SetPEnergy(-1);
159 if (fRTelescopeHits) {
160 fRTelescopeHits->Delete();
virtual void Exec(Option_t *opt)
virtual InitStatus Init()