121 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.C");
125 gSystem->Load(
"libRho");
127 TCanvas *
c1=
new TCanvas(
"c1",
"c1",1000,700);
132 TFile*
f =
new TFile(fname.Data());
133 TTree *
t=(TTree*)f->Get(
"pndsim") ;
137 TClonesArray *fChrgCands=
new TClonesArray(
"TCandidate");
138 TClonesArray *fNeutCands=
new TClonesArray(
"TCandidate");
139 TClonesArray *
fMcCands=
new TClonesArray(
"TCandidate");
141 t->SetBranchAddress(
"PndChargedCandidates",&fChrgCands);
142 t->SetBranchAddress(
"PndNeutralCandidates",&fNeutCands);
143 t->SetBranchAddress(
"PndMcTracks",&fMcCands);
149 TH1F *phimass =
new TH1F(
"phimass",
"phi cands",100,0.98,1.1);
150 TH1F *pi0mass =
new TH1F(
"pi0mass",
"pi0 cands",100,0.130-0.05,0.130+0.05);
151 TH1F *dsmass =
new TH1F(
"dsmass",
"Ds cands",100,1.968-0.06,1.968+0.06);
152 TH1F *ds0mass =
new TH1F(
"ds0mass",
"Ds0 cands",100,2.317-0.1,2.317+0.1);
153 TH1F *ppmass =
new TH1F(
"ppmass",
"pbarp cands",100,4.291-0.1,4.291+0.1);
154 TH1F *pp2mass =
new TH1F(
"pp2mass",
"sum m_{miss}+m_{Ds}",100,4.2855-0.02,4.2855+0.02);
156 TH1F *nmult=
new TH1F(
"nmult",
"# neutrals",15,0,15);
158 TH1F *pdiff=
new TH1F(
"pdiff",
"momentum difference",100,0,2);
159 TH2F *pdiff2=
new TH2F(
"pdiff2",
"gamma corr",50,0,2.5,50,0,2.5);
161 config_histo(phimass,
"m(K^{+} K^{-}) [GeV/c^{2}]",
"entries");
162 config_histo(pi0mass,
"m(#gamma#gamma) [GeV/c^{2}]",
"entries");
163 config_histo(dsmass,
"m(#phi#pi^{#pm}) [GeV/c^{2}]",
"entries");
164 config_histo(ds0mass,
"m(D_{s}#pi^{0}) [GeV/c^{2}]",
"entries");
165 config_histo(ppmass,
"m(D_{s} D_{s0}*) [GeV/c^{2}]",
"entries");
166 config_histo(pp2mass,
"m_{miss}+m_{D_{s}} [GeV/c^{2}]",
"entries");
174 if (
num==0)
num= t->GetEntriesFast();
175 cout <<
"\n####### Processing "<<
num <<
" events...\n"<<endl;
181 TCandList allCands,neutralCands,chargedCands,chargedCands2, plusCands,minusCands;
183 TCandList kpCands,kmCands,piCands;
185 TCandList phiCands,pi0Cands,dsCands,ds0Cands,ppCands;
189 TPidChargedSelector *chargedSel =
new TPidChargedSelector;
190 TPidNeutralSelector *neutralSel =
new TPidNeutralSelector;
191 TPidPlusSelector *plusSel =
new TPidPlusSelector;
192 TPidMinusSelector *minusSel =
new TPidMinusSelector;
196 TPidMassSelector *phiMSel =
new TPidMassSelector(
"phiSelector" , 1.0195 , 0.04);
197 TPidMassSelector *pi0MSel =
new TPidMassSelector(
"pi0Selector" , 0.130 , 0.02);
198 TPidMassSelector *dsMSel =
new TPidMassSelector(
"dsSelector" , 1.9685 , 0.02);
200 TPidSimpleKaonSelector *kSel =
new TPidSimpleKaonSelector();
201 kSel->SetCriterion(
"veryLoose");
202 TPidSimplePionSelector *piSel =
new TPidSimplePionSelector();
203 piSel->SetCriterion(
"veryLoose");
205 TH2F *hpro=
new TH2F(
"hpro",
"",300,-1,1,300,-1,1);
212 for (Int_t j=0; j<
num;j++)
214 if ((j%100)==0) cout <<
"evt "<<j<<endl;
216 if (
pr) cout <<endl<<
"************** evt "<<j<<endl;
219 TFactory::Instance()->Reset();
222 chargedCands.Cleanup();
223 chargedCands2.Cleanup();
224 neutralCands.Cleanup();
229 for (i1=0; i1<fChrgCands->GetEntriesFast(); i1++){
230 tc = (TCandidate *)fChrgCands->At(i1);
232 TLorentzVector l=tc->P4();
233 TVector3
p=tc->Pos();
238 cout <<
"c("<<tc->Charge()<<
") vtx("<<p.X()<<
"/"<<p.Y()<<
"/"<<p.Z()<<
") p4("<<l.Px()<<
"/"<<l.Py()<<
"/"<<l.Pz()<<
")="<<l.Vect().Mag()<<endl;
242 chargedCands.Add(*tc);
258 cout <<
"c("<<tc->Charge()<<
") vtx("<<p.X()<<
"/"<<p.Y()<<
"/"<<p.Z()<<
") p4("<<l.Px()<<
"/"<<l.Py()<<
"/"<<l.Pz()<<
")="<<l.Vect().Mag()<<endl;
268 chargedCands2.Add(*tc);
271 for (i1=0; i1<fNeutCands->GetEntriesFast(); i1++){
272 tc = (TCandidate *)fNeutCands->At(i1);
276 for (i2=0;i2<chargedCands.GetLength();i2++)
278 TVector3
gam=tc->P3();
279 TVector3 chrg=chargedCands[i2].Pos();
281 double ang=gam.Angle(chrg);
284 if (minang>ang) minang=ang;
287 pdiff2->Fill(minang, tc->P4().E());
288 pdiff->Fill(tc->P4().E());
291 neutralCands.Add(*tc);
294 for (i1=0; i1<fMcCands->GetEntriesFast(); i1++){
295 tc = (TCandidate *)fMcCands->At(i1);
303 cout <<
"c:"<<chargedCands.GetLength()<<
" n:"<<neutralCands.GetLength()<<endl;
305 nmult->Fill(neutralCands.GetLength());
307 plusCands.Select(chargedCands2 ,plusSel);
308 minusCands.Select(chargedCands2 ,minusSel);
312 kpCands.Select(plusCands ,kSel);
313 kmCands.Select(minusCands ,kSel);
314 piCands.Select(chargedCands2 ,piSel);
316 cout <<
"chrg:"<<chargedCands.GetLength()<<
" ";
317 cout <<
"plus:"<<plusCands.GetLength()<<
" ";
318 cout <<
"minus:"<<minusCands.GetLength()<<
" ";
319 cout <<
"K+:"<<kpCands.GetLength()<<
" ";
320 cout <<
"K-:"<<kmCands.GetLength()<<
" ";
321 cout <<
"pi+-:"<<piCands.GetLength()<<
" ";
327 phiCands.Combine(kpCands,kmCands);
330 TCandListIterator iterPhi(phiCands);
331 while (tc=iterPhi.Next()) phimass->Fill(tc->M());
332 phiCands.Select(phiMSel);
333 cout <<
"phi:"<<phiCands.GetLength()<<
" "<<endl;
334 dsCands.Combine(phiCands,piCands);
336 TCandListIterator iterDs(dsCands);
337 while (tc=iterDs.Next())
339 dsmass->Fill(tc->M());
341 TLorentzVector lds=tc->P4();
342 TLorentzVector ini(0,0,8.824,9.812);
344 TLorentzVector miss=ini-lds;
347 pp2mass->Fill(miss.M()+lds.M());
350 dsCands.Select(dsMSel);
352 pi0Cands.Combine(neutralCands,neutralCands);
354 TCandListIterator iterPi0(pi0Cands);
355 while (tc=iterPi0.Next()) pi0mass->Fill(tc->M());
356 pi0Cands.Select(pi0MSel);
358 ds0Cands.Combine(dsCands,pi0Cands);
360 TCandListIterator iterDs0(ds0Cands);
361 while (tc=iterDs0.Next()) ds0mass->Fill(tc->M());
363 ppCands.Combine(ds0Cands,dsCands);
371 TCandListIterator iterPp(ppCands);
373 while (tc=iterPp.Next())
375 ppmass->Fill(tc->M());
379 TCandListIterator iterChrg(chargedCands);
380 while(tc=iterChrg.Next())
382 int idx=tc->GetMcIdx();
void propagate(TLorentzVector &l, TVector3 &p, float charge, TH2F *hpro=0)
void config_histo(TH1 *h, TString tx, TString ty)