30 #include "TClonesArray.h"
32 #include "TLorentzVector.h"
47 :
FairTask(
"PrimSelector"), _persistence(kFALSE), _trackBranchName(
"TrackPreFit")
63 Error(
"PrimSelector::Init",
"RootManager not instantiated!");
72 Error(
"PrimSelector::Init",
"Track-array not found!");
100 std::cout <<
"PrimSelector::Exec" << std::endl;
103 if(
_pocaArray==0) Fatal(
"PrimSelector::Exec)",
"No pocaArray");
105 if(
_chargeArray==0) Fatal(
"PrimSelector::Exec)",
"No chargeArray");
107 if(
_primArray==0) Fatal(
"PrimSelector::Exec)",
"No primArray");
111 map<unsigned int, int> trackIds;
114 for(
int itrk=0;itrk<ntrks;++itrk){
116 if(trk->
getMom().Mag()<0.1)
continue;
119 TVector3 poca, dirInPoca;
140 new((*_pocaArray)[size]) TVector3(poca);
143 TVector3 p3=rep->
getMom();
146 pion.SetXYZM(p3.X(),p3.Y(),p3.Z(),0.13957018);
149 new((*_primArray)[size2]) TLorentzVector(pion);
162 file->mkdir(
"PrimSelector");
163 file->cd(
"PrimSelector");
169 TH1D*
h=
new TH1D(
"hEffPrim",
"Prim: nbkg nphys nfullevents nevent",4,0,4);
173 h->Fill(3.5,fEventCounter);
176 std::cout <<
"PrimSelector::FinishTask \n"
177 <<
" SingleTrackEfficiency: " << singleTrackEff << std::endl
178 <<
" SingleTrackPurity: " << singleTrackPurity<< std::endl
179 <<
" FullEventEfficiency: " << fullEvtEff<< std::endl;
181 TGraph* gresults=
new TGraph(3);
182 gresults->SetName(
"hPrimMC");
183 gresults->SetTitle(
"Efficiency Statistics by PrimSelector");
185 gresults->SetPoint(0,0,singleTrackEff);
186 gresults->SetPoint(1,1,singleTrackPurity);
187 gresults->SetPoint(2,2,fullEvtEff);