5 #include "TStopwatch.h"
14 h->GetXaxis()->SetTitleOffset(1.3);
15 h->GetXaxis()->SetTitleColor(1);
16 h->GetXaxis()->SetLabelSize(0.05);
17 h->GetXaxis()->SetTitleSize(0.05);
18 h->GetXaxis()->SetNdivisions(505);
20 h->GetYaxis()->SetTitleOffset(offy);
21 h->GetYaxis()->SetTitleFont(42);
22 h->GetYaxis()->SetLabelSize(0.05);
23 h->GetYaxis()->SetTitleSize(0.05);
38 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.C");
42 gSystem->Load(
"libRho");
57 TFile*
f =
new TFile(fname.Data());
58 TTree *
t=f->Get(
"pndsim") ;
61 TClonesArray *
fCands=
new TClonesArray(
"TCandidate");
65 t->SetBranchStatus(
"*",0);
66 t->SetBranchStatus(
"PndChargedCandidates*",1);
67 t->SetBranchAddress(
"PndChargedCandidates",&fCands);
74 TH1F *hmom=
new TH1F(
"hmom",
"momentum charged tracks",100,0,6);
75 TH1F *htht=
new TH1F(
"htht",
"theta charged tracks",100,0,180);
77 TH2F *thtcbar =
new TH2F(
"thtcbar",
"#theta_{c} DrcBarrel",200,0,8,200,0.,0.9);
78 thtcbar->SetMarkerSize(0.1);
80 TH2F *thtcdsc =
new TH2F(
"thtcdsc",
"#theta_{c} DrcDisc",200,0,8,200,0.0,0.9);
81 thtcdsc->SetMarkerSize(0.1);
83 TH2F *thtcrch =
new TH2F(
"thtcrch",
"#theta_{c} Rich",200,0.,8,200,0.,0.35);
84 thtcrch->SetMarkerSize(0.1);
86 TH2F *m2tof =
new TH2F(
"m2tof",
"m^{2} Tof",100,0,1.5,100,0.,1.2);
87 m2tof->SetMarkerSize(0.1);
89 TH2F *dedxmvd =
new TH2F(
"dedxmvd",
"dE/dx Mvd",100,0,1.5,100,0.,20);
90 dedxmvd->SetMarkerSize(0.1);
92 TH2F *dedxstt =
new TH2F(
"dedxstt",
"dE/dx Stt",100,0,1.5,100,0.,20);
93 dedxstt->SetMarkerSize(0.1);
95 TH1F *thtcB[5], *thtcD[5], *thtcR[5];
96 TH1F *m2T[5], *dedxM[5],*dedxS[5];
98 TH1F *LHe[5],*LHmu[5],*LHpi[5],*LHk[5],*LHp[5];
100 int colors[5]={1,2,4,6,8};
107 thtcB[
i]=
new TH1F((
"h1"+nums).Data(),(
"h1"+nums).Data(),100,0,0.85);
108 thtcD[
i]=
new TH1F((
"h2"+nums).Data(),(
"h2"+nums).Data(),100,0,0.85);
109 thtcR[
i]=
new TH1F((
"h3"+nums).Data(),(
"h3"+nums).Data(),100,0,0.85);
111 m2T[
i]=
new TH1F((
"h4"+nums).Data(),(
"h4"+nums).Data(),100,0,1.4);
112 dedxM[
i]=
new TH1F((
"h5"+nums).Data(),(
"h5"+nums).Data(),100,0,40);
113 dedxS[
i]=
new TH1F((
"h6"+nums).Data(),(
"h6"+nums).Data(),100,0,40);
115 LHe[
i]=
new TH1F((
"LHe"+nums).Data(),(
"LH for being electron"+nums).Data(),50,0,1);
116 LHmu[
i]=
new TH1F((
"LHmu"+nums).Data(),(
"LH for being muons"+nums).Data(),50,0,1);
117 LHpi[
i]=
new TH1F((
"LHpi"+nums).Data(),(
"LH for being pions"+nums).Data(),50,0,1);
118 LHk[
i]=
new TH1F((
"LHk"+nums).Data(),(
"LH for being kaons"+nums).Data(),50,0,1);
119 LHp[
i]=
new TH1F((
"LHp"+nums).Data(),(
"LH for being protons"+nums).Data(),50,0,1);
121 LHe[
i]->SetFillColor(colors[0]);
122 LHmu[
i]->SetFillColor(colors[1]);
123 LHpi[
i]->SetFillColor(colors[2]);
124 LHk[
i]->SetFillColor(colors[3]);
125 LHp[
i]->SetFillColor(colors[4]);
127 thtcB[
i]->SetLineColor(colors[i]);
128 thtcR[
i]->SetLineColor(colors[i]);
129 thtcD[
i]->SetLineColor(colors[i]);
130 m2T[
i]->SetLineColor(colors[i]);
131 dedxM[
i]->SetLineColor(colors[i]);
132 dedxS[
i]->SetLineColor(colors[i]);
135 if (
num==0)
num= t->GetEntriesFast();
136 cout <<
"\n####### Processing "<<
num <<
" events...\n"<<endl;
138 TCandList allCands,neutralCands,chargedCands, plusCands,minusCands;
140 TCandList kpCands,kmCands,piCands;
142 TPidChargedSelector *chargedSel =
new TPidChargedSelector;
158 TFile *tf =
new TFile(fname+
"_ana.root",
"RECREATE");
159 TNtuple *ntp=
new TNtuple(
"ntp",
"ntp",
"pid:px:py:pz:e:p:pt:tht:ctht:le:lmu:lpi:lk:lp:tcb:tcd:tcr:mt:dem:des:det:tcbr:tcdr:tcrr:mtr:demr:desr:detr");
162 for (Int_t j=0; j<
num;j++)
165 if (!(j%100)) cout <<
"evt:"<<j<<endl;
170 for (Int_t i1=0; i1<fCands->GetEntriesFast(); i1++)
172 tc = (TCandidate *)fCands->At(i1);
183 double thtmin=0./180.*3.1415;
184 double thtmax=180./180.*3.1415;
188 double *
pi=tc->GetPidInfo();
190 double tht=tc->GetVect().Theta();
192 double pt = p*
sin(tht);
193 int pid=abs((
int)pi[29]);
194 int hypo=pidhypo[
pid];
197 valvect[0]=(float)hypo;
199 valvect[2]=(float)tc->Px() ;
200 valvect[3]=(float)tc->Py() ;
201 valvect[4]=(float)tc->Pz() ;
202 valvect[5]=(float)tc->E() ;
203 valvect[6]=(float)tc->Pt() ;
204 valvect[7]=(float)tht ;
205 valvect[8]=(float)
cos(tht) ;
207 valvect[9]=(float)pi[0] ;
208 valvect[10]=(float)pi[1] ;
209 valvect[11]=(float)pi[2] ;
210 valvect[12]=(float)pi[3] ;
211 valvect[13]=(float)pi[4] ;
213 valvect[14]=(float)pi[5] ;
214 valvect[15]=(float)pi[6] ;
215 valvect[16]=(float)pi[7] ;
216 valvect[17]=(float)pi[8] ;
217 valvect[18]=(float)pi[9] ;
218 valvect[19]=(float)pi[10] ;
219 valvect[20]=(float)pi[11] ;
221 valvect[21]=(float)pi[12] ;
222 valvect[22]=(float)pi[13] ;
223 valvect[23]=(float)pi[14] ;
224 valvect[24]=(float)pi[15] ;
225 valvect[25]=(float)pi[16] ;
226 valvect[26]=(float)pi[17] ;
227 valvect[27]=(float)pi[18] ;
242 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
int ana_pid(TString fname="dsdsj_10k.root", int num=0)
TString pt(TString pts, TString exts="px py pz")
void config_histo(TH1 *h, TString tx, TString ty)
TString tht(TString pts, TString exts="px py pz")