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",800,800);
82 TFile*
f =
new TFile(fname.Data());
83 TTree *
t=f->Get(
"pndsim") ;
87 TClonesArray *fChrgCands=
new TClonesArray(
"TCandidate");
91 t->SetBranchAddress(
"PndChargedCandidates",&fChrgCands);
99 TH1F *ppimass =
new TH1F(
"ppimass",
"p pi cands",100,1.05,1.2);
100 TH1F *ppi2mass =
new TH1F(
"ppi2mass",
"p pi cands",100,1.05,1.2);
101 ppi2mass->SetFillColor(2);
102 ppi2mass->SetLineColor(2);
103 ppi2mass->SetLineWidth(1);
105 TH2F *hvtx=
new TH2F(
"hvtx",
"vertex positions (x,y)",100,-10,10,100,-10,10);
106 TH2F *hvtx2=
new TH2F(
"hvtx2",
"vertex positions (x,z)",100,-10,10,100,-10,10);
108 TH1F *hdist=
new TH1F(
"hdist",
"vtx distance to (0,0,0)",100,0,15);
110 ppimass->SetMinimum(0);
112 if (
num==0)
num= t->GetEntriesFast();
113 cout <<
"\n####### Processing "<<
num <<
" events...\n"<<endl;
119 TCandList allCands,chargedCands, minusCands, plusCands, pplusCands, pminusCands, piplusCands, piminusCands;
125 TPidChargedSelector *chargedSel =
new TPidChargedSelector;
126 TPidNeutralSelector *neutralSel =
new TPidNeutralSelector;
128 TPidPlusSelector *plusSel =
new TPidPlusSelector;
129 TPidMinusSelector *minusSel =
new TPidMinusSelector;
133 TPidSimplePionSelector *piSel =
new TPidSimplePionSelector();
134 piSel->SetCriterion(
"veryLoose");
135 TPidSimpleProtonSelector *pSel =
new TPidSimpleProtonSelector();
136 pSel->SetCriterion(
"veryLoose");
142 for (Int_t j=0; j<
num;j++)
144 TFactory::Instance()->Reset();
146 chargedCands.Cleanup();
154 cout <<
"evt "<<j<<endl;
156 if (ppi2mass->GetMaximum()<ppimass->GetMaximum()) ppi2mass->SetMaximum(ppimass->GetMaximum()*1.05);
159 ppimass->Draw(
"same");
174 for (i1=0; i1<fChrgCands->GetEntriesFast(); i1++){
175 tc = (TCandidate *)fChrgCands->At(i1);
180 TLorentzVector l=tc->P4();
181 TVector3
p=tc->Pos();
190 chargedCands.Add(*tc);
197 plusCands.Select(chargedCands, plusSel);
198 minusCands.Select(chargedCands, minusSel);
200 pplusCands.Select(plusCands,pSel);
201 pminusCands.Select(minusCands,pSel);
203 piplusCands.Select(plusCands,piSel);
204 piminusCands.Select(minusCands,piSel);
206 cout <<endl<<
"---------------------"<<endl;
207 cout <<
"chrg:"<<chargedCands.GetLength()<<
" ";
208 cout <<
"plus:"<<plusCands.GetLength()<<
" ";
209 cout <<
"minus:"<<minusCands.GetLength()<<
" ";
210 cout <<
"p+:"<<pplusCands.GetLength()<<
" ";
211 cout <<
"p-:"<<pminusCands.GetLength()<<
" ";
212 cout <<
"pi+:"<<piplusCands.GetLength()<<
" ";
213 cout <<
"pi-:"<<piminusCands.GetLength()<<endl;
221 ppiCands.Combine(piminusCands,pplusCands);
224 TCandListIterator iterP(ppiCands);
225 while (tc=iterP.Next())
227 ppimass->Fill(tc->Mass());
228 PndVtxFitter vtxf(*tc);
230 TCandidate *fitted=vtxf.FittedCand(*tc);
231 cout <<
"unfitted="<<(*tc)<<endl;
234 double d=fitted->Pos().Mag();
236 cout <<
"fitted = "<<(*fitted)<<endl;
237 ppi2mass->Fill(fitted->Mass());
238 hvtx->Fill(fitted->Pos().X(),fitted->Pos().Y());
239 hvtx2->Fill(fitted->Pos().X(),fitted->Pos().Z());
240 hdist->Fill(fitted->Pos().Mag());
293 if (ppi2mass->GetMaximum()<ppimass->GetMaximum()) ppi2mass->SetMaximum(ppimass->GetMaximum()*1.05);
296 ppimass->Draw(
"same");
310 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)
void propagate(TLorentzVector &l, TVector3 &p, float charge, TH2F *hpro=0)
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")
int ana_Lambda_fit2(TString fname="Lambda.full_2000ev.root", int num=0)