1 void propagate(TLorentzVector &l, TVector3 &
p,
float charge, TH2F* hpro=0)
13 double pt=
sqrt(px0*px0+py0*py0);
16 double a=-0.2998*B*charge/3;
25 for (
int i=0;
i<steps;
i++)
28 double s_tt=(
i+1)*dz/lambda;
29 double cosrst=
cos(rho*s_tt);
30 double sinrst=
sin(rho*s_tt);
32 double px = px0*cosrst + py0*sinrst;
33 double py = py0*cosrst - px0*sinrst;
36 double xt=x0 - px/a*sinrst + py/a*(1-cosrst);
37 double yt=y0 - py/a*sinrst - px/a*(1-cosrst);
46 double cosrs=
cos(rho*s_t);
47 double sinrs=
sin(rho*s_t);
49 double px = px0*cosrs + py0*sinrs;
50 double py = py0*cosrs - px0*sinrs;
53 double x=x0 - px/a*sinrs + py/a*(1-cosrs);
54 double y=y0 - py/a*sinrs - px/a*(1-cosrs);
55 double z=z0 - lambda*s_t;
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)
friend F32vec4 cos(const F32vec4 &a)
Double_t lambda(Double_t x, Double_t y, Double_t z)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
TString pt(TString pts, TString exts="px py pz")
void propagate(TLorentzVector &l, TVector3 &p, float charge, TH2F *hpro=0)
int ana_Lambda(TString fname="tmp.root", int num=0)