71 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.C");
75 gSystem->Load(
"libRho");
77 TCanvas *
c1=
new TCanvas(
"c1",
"c1",600,600);
81 TFile*
f =
new TFile(fname.Data());
82 TTree *
t=f->Get(
"pndsim") ;
86 TClonesArray *fChrgCands=
new TClonesArray(
"TCandidate");
90 t->SetBranchAddress(
"PndChargedCandidates",&fChrgCands);
98 TH1F *ppimass =
new TH1F(
"ppimass",
"p pi cands",100,1.115-0.2,1.115+0.2);
100 ppimass->SetMinimum(0);
102 if (
num==0)
num= t->GetEntriesFast();
103 cout <<
"\n####### Processing "<<
num <<
" events...\n"<<endl;
109 TCandList allCands,chargedCands, minusCands, plusCands, pplusCands, pminusCands, piplusCands, piminusCands;
115 TPidChargedSelector *chargedSel =
new TPidChargedSelector;
116 TPidNeutralSelector *neutralSel =
new TPidNeutralSelector;
118 TPidPlusSelector *plusSel =
new TPidPlusSelector;
119 TPidMinusSelector *minusSel =
new TPidMinusSelector;
123 TPidSimplePionSelector *piSel =
new TPidSimplePionSelector();
124 piSel->SetCriterion(
"veryLoose");
125 TPidSimpleProtonSelector *pSel =
new TPidSimpleProtonSelector();
126 pSel->SetCriterion(
"veryLoose");
132 for (Int_t j=0; j<
num;j++)
134 if ((j%100)==0) cout <<
"evt "<<j<<endl;
137 TFactory::Instance()->Reset();
139 chargedCands.Cleanup();
144 for (i1=0; i1<fChrgCands->GetEntriesFast(); i1++){
145 tc = (TCandidate *)fChrgCands->At(i1);
147 TLorentzVector l=tc->P4();
148 TVector3
p=tc->Pos();
154 chargedCands.Add(*tc);
158 plusCands.Select(chargedCands, plusSel);
159 minusCands.Select(chargedCands, minusSel);
161 pplusCands.Select(plusCands,pSel);
162 pminusCands.Select(minusCands,pSel);
164 piplusCands.Select(plusCands,piSel);
165 piminusCands.Select(minusCands,piSel);
167 cout <<
"chrg:"<<chargedCands.GetLength()<<
" ";
168 cout <<
"plus:"<<plusCands.GetLength()<<
" ";
169 cout <<
"minus:"<<minusCands.GetLength()<<
" ";
170 cout <<
"p+:"<<pplusCands.GetLength()<<
" ";
171 cout <<
"p-:"<<pminusCands.GetLength()<<
" ";
172 cout <<
"pi+:"<<piplusCands.GetLength()<<
" ";
173 cout <<
"pi-:"<<piminusCands.GetLength()<<endl;
181 ppiCands.Combine(pplusCands,piminusCands);
182 ppiCands.CombineAndAppend(pminusCands,piplusCands);
184 TCandListIterator iterP(ppiCands);
185 while (tc=iterP.Next()) ppimass->Fill(tc->M());
197 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void propagate(TLorentzVector &l, TVector3 &p, float charge, TH2F *hpro=0)