67 |
//=============================================================== |
//=============================================================== |
68 |
// Get ToF dE/dx |
// Get ToF dE/dx |
69 |
//=============================================================== |
//=============================================================== |
70 |
Float_t GetdEdx( PamTrack *trk ){ |
// Float_t GetdEdx( PamTrack *trk ){ |
71 |
Float_t dedx = 0.; |
// Float_t dedx = 0.; |
72 |
Int_t nval=0; |
// Int_t nval=0; |
73 |
Bool_t ISNULL = false; |
// Bool_t ISNULL = false; |
74 |
for (Int_t i=0; i<trk->npmtadc; i++){ |
// for (Int_t i=0; i<trk->GetToFTrack()->npmtadc; i++){ |
75 |
if(trk->dedx[i] == 0)ISNULL=true; |
// if(trk->GetToFTrack()->dedx[i] == 0)ISNULL=true; |
76 |
dedx += (trk->dedx).At(i)*(Int_t)(!ISNULL); |
// dedx += (trk->GetToFTrack()->dedx).At(i)*(Int_t)(!ISNULL); |
77 |
nval += (Int_t)(!ISNULL); |
// nval += (Int_t)(!ISNULL); |
78 |
}; |
// }; |
79 |
// |
// // |
80 |
if(nval)dedx=dedx/nval; |
// if(nval)dedx=dedx/nval; |
81 |
// cout <<" -- dedx "<<dedx<<endl; |
// // cout <<" -- dedx "<<dedx<<endl; |
82 |
return(dedx); |
// return(dedx); |
83 |
} |
// } |
84 |
float GetZ(float beta, float dedx){ |
|
85 |
|
// float GetZ(float beta, float dedx){ |
86 |
|
|
87 |
|
// int nspec=2; |
88 |
|
// float p0[]={0.904,3.373}; |
89 |
|
// float p1[]={0.295,2.756}; |
90 |
|
// float zz[]={1.,4.}; |
91 |
|
|
92 |
|
// if(beta>1)beta=1; |
93 |
|
// float f0 = p0[0]/beta+p1[0]; |
94 |
|
// float f1 = p0[1]/beta+p1[1]; |
95 |
|
// float z0 = zz[0]; |
96 |
|
// float z1 = zz[1]; |
97 |
|
// float aa = (z0-z1)/(f0-f1); |
98 |
|
// float bb = -aa*f0+z0; |
99 |
|
// if( (bb+aa*dedx)==0 )return 0; |
100 |
|
// return sqrt(bb+aa*dedx); |
101 |
|
|
102 |
int nspec=2; |
// } |
|
float p0[]={0.904,3.373}; |
|
|
float p1[]={0.295,2.756}; |
|
|
float zz[]={1.,4.}; |
|
|
|
|
|
if(beta>1)beta=1; |
|
|
float f0 = p0[0]/beta+p1[0]; |
|
|
float f1 = p0[1]/beta+p1[1]; |
|
|
float z0 = zz[0]; |
|
|
float z1 = zz[1]; |
|
|
float aa = (z0-z1)/(f0-f1); |
|
|
float bb = -aa*f0+z0; |
|
|
if( (bb+aa*dedx)==0 )return 0; |
|
|
return sqrt(bb+aa*dedx); |
|
|
|
|
|
} |
|
103 |
|
|
104 |
|
|
105 |
//=============================================================== |
//=============================================================== |
210 |
|
|
211 |
tot++; |
tot++; |
212 |
|
|
213 |
if( event->GetNTracks()==0 ) return; |
if( event->GetTrkLevel2()->GetNTracks()==0 ) return; |
214 |
PamTrack *track = event->GetTrack(0); |
PamTrack *track = event->GetTrack(0); |
215 |
//------------------------------ |
//------------------------------ |
216 |
// track selection |
// track selection |
228 |
//------------------- |
//------------------- |
229 |
// ToF variables |
// ToF variables |
230 |
//------------------- |
//------------------- |
231 |
beta = track->beta[12]; |
beta = track->GetToFTrack()->beta[12]; |
232 |
// dedxtof = GetdEdx(track); |
// dedxtof = GetdEdx(track); |
233 |
|
|
234 |
//------------------- |
//------------------- |
235 |
// tracker variables |
// tracker variables |
236 |
//------------------- |
//------------------- |
237 |
dedxtrk = track->GetDEDX()/1.3; //<<<ATTENZIONE TEMPORANEO!!!! |
dedxtrk = track->GetTrkTrack()->GetDEDX()/1.3; //<<<ATTENZIONE TEMPORANEO!!!! |
238 |
rigidity = track->GetRigidity(); |
rigidity = track->GetTrkTrack()->GetRigidity(); |
239 |
deflection = track->GetDeflection(); |
deflection = track->GetTrkTrack()->GetDeflection(); |
240 |
chi2 = track->chi2; |
chi2 = track->GetTrkTrack()->chi2; |
241 |
errdef = sqrt(track->coval[4][4]); |
errdef = sqrt(track->GetTrkTrack()->coval[4][4]); |
242 |
for(Int_t ip=0; ip<6; ip++){ |
for(Int_t ip=0; ip<6; ip++){ |
243 |
if(track->XGood(ip))errx[ip]=track->resx[ip]; |
if(track->GetTrkTrack()->XGood(ip))errx[ip]=track->GetTrkTrack()->resx[ip]; |
244 |
if(track->YGood(ip))erry[ip]=track->resy[ip]; |
if(track->GetTrkTrack()->YGood(ip))erry[ip]=track->GetTrkTrack()->resy[ip]; |
245 |
} |
} |
246 |
|
|
247 |
//------------------- |
//------------------- |
295 |
//------------------------ |
//------------------------ |
296 |
// 6-planes lever-arm |
// 6-planes lever-arm |
297 |
//------------------------ |
//------------------------ |
298 |
if( !(track->XGood(0) && track->XGood(5)) )return; |
if( !(track->GetTrkTrack()->XGood(0) && track->GetTrkTrack()->XGood(5)) )return; |
299 |
sel[3]++; |
sel[3]++; |
300 |
|
|
301 |
for(Int_t ip=0; ip<6; ip++)herrx[ip]->Fill(errx[ip]); |
for(Int_t ip=0; ip<6; ip++)herrx[ip]->Fill(errx[ip]); |
313 |
hdef->Fill(deflection); |
hdef->Fill(deflection); |
314 |
} |
} |
315 |
|
|
316 |
delete track; |
// delete track; |
317 |
|
|
318 |
|
|
319 |
} |
} |