6 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.C");
10 gSystem->Load(
"libRho");
12 TCanvas *
c1=
new TCanvas(
"c1",
"c1",900,600);
17 TFile*
f =
new TFile(fname.Data());
18 TTree *
t=f->Get(
"pndsim") ;
22 TClonesArray *
fCands=
new TClonesArray(
"TCandidate");
24 t->SetBranchAddress(
"PndCandidates",&fCands);
30 TH1F *phimass =
new TH1F(
"phimass",
"phi cands",100,0.95,1.1);
31 TH1F *pi0mass =
new TH1F(
"pi0mass",
"pi0 cands",100,0.135-0.03,0.135+0.03);
32 TH1F *dsmass =
new TH1F(
"dsmass",
"Ds cands",100,1.968-0.03,1.968+0.03);
33 TH1F *ds0mass =
new TH1F(
"ds0mass",
"Ds0 cands",100,2.317-0.05,2.317+0.05);
34 TH1F *ppmass =
new TH1F(
"ppmass",
"pbarp cands",100,4.306-0.1,4.306+0.1);
36 TH1F *nmult=
new TH1F(
"nmult",
"# neutrals",15,0,15);
38 phimass->SetMinimum(0);
39 pi0mass->SetMinimum(0);
40 dsmass->SetMinimum(0);
41 ds0mass->SetMinimum(0);
42 ppmass->SetMinimum(0);
44 if (
num==0)
num= t->GetEntriesFast();
45 cout <<
"\n####### Processing "<<
num <<
" events...\n"<<endl;
49 TCandList allCands,neutralCands,chargedCands, plusCands,minusCands;
51 TCandList kpCands,kmCands,piCands;
53 TCandList phiCands,pi0Cands,dsCands,ds0Cands,ppCands;
57 TPidChargedSelector *chargedSel =
new TPidChargedSelector;
58 TPidNeutralSelector *neutralSel =
new TPidNeutralSelector;
59 TPidPlusSelector *plusSel =
new TPidPlusSelector;
60 TPidMinusSelector *minusSel =
new TPidMinusSelector;
64 TPidMassSelector *phiMSel =
new TPidMassSelector(
"phiSelector" , 1.0195 , 0.01);
65 TPidMassSelector *pi0MSel =
new TPidMassSelector(
"pi0Selector" , 0.135 , 0.005);
66 TPidMassSelector *dsMSel =
new TPidMassSelector(
"dsSelector" , 1.9685 , 0.01);
68 TPidSimpleKaonSelector *kSel =
new TPidSimpleKaonSelector();
69 kSel->SetCriterion(
"tight");
70 TPidSimplePionSelector *piSel =
new TPidSimplePionSelector();
71 piSel->SetCriterion(
"loose");
77 for (Int_t j=0; j<
num;j++){
80 TFactory::Instance()->Reset();
85 for (Int_t i1=0; i1<fCands->GetEntriesFast(); i1++){
86 tc = (TCandidate *)fCands->At(i1);
92 chargedCands.Select(allCands, chargedSel);
93 neutralCands.Select(allCands, neutralSel);
95 nmult->Fill(neutralCands.GetLength());
97 plusCands.Select(chargedCands ,plusSel);
98 minusCands.Select(chargedCands ,minusSel);
102 kpCands.Select(plusCands ,kSel);
103 kmCands.Select(minusCands ,kSel);
104 piCands.Select(chargedCands ,piSel);
109 phiCands.Combine(kpCands,kmCands);
111 TCandListIterator iterPhi(phiCands);
112 while (tc=iterPhi.Next()) phimass->Fill(tc->M());
113 phiCands.Select(phiMSel);
115 dsCands.Combine(phiCands,piCands);
117 TCandListIterator iterDs(dsCands);
118 while (tc=iterDs.Next()) dsmass->Fill(tc->M());
119 dsCands.Select(dsMSel);
121 pi0Cands.Combine(neutralCands,neutralCands);
123 TCandListIterator iterPi0(pi0Cands);
124 while (tc=iterPi0.Next()) pi0mass->Fill(tc->M());
125 pi0Cands.Select(pi0MSel);
127 ds0Cands.Combine(dsCands,pi0Cands);
129 TCandListIterator iterDs0(ds0Cands);
130 while (tc=iterDs0.Next()) ds0mass->Fill(tc->M());
132 ppCands.Combine(ds0Cands,dsCands);
134 ppCands.Select(neutralSel);
138 ppCands.RemoveClones();
140 TCandListIterator iterPp(ppCands);
141 while (tc=iterPp.Next())
143 ppmass->Fill(tc->M());
148 int nch=chargedCands.GetLength();
149 int nn=neutralCands.GetLength();
150 int nphi=phiCands.GetLength();
151 int nds=dsCands.GetLength();
152 int nds0=ds0Cands.GetLength();
153 int npp=ppCands.GetLength();
155 if (npp) cout <<
"pp :"<<ppCands[0].GetCharge()<<endl;
159 cout <<
"evt:"<<j<<endl;
160 if (nch) cout <<
"ch :"<<chargedCands[0].GetCharge()<<endl;
161 if (nn) cout <<
"ne :"<<neutralCands[0].GetCharge()<<endl;
162 if (nphi) cout <<
"phi:"<<phiCands[0].GetCharge()<<endl;
163 if (nds) cout <<
"ds :"<<dsCands[0].GetCharge()<<endl;
164 if (nds0) cout <<
"ds0:"<<ds0Cands[0].GetCharge()<<endl;
165 if (npp) cout <<
"pp :"<<ppCands[0].GetCharge()<<endl;
166 if (nds>0 && nds0>0 &&dsCands[0].GetCharge()!=ds0Cands[0].GetCharge()) cout <<
"****"<<endl;
190 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
int printRecursive(TCandidate *tc, int level=0)