5 |
|
|
6 |
#include <TrkParams.h> |
#include <TrkParams.h> |
7 |
#include <iostream> |
#include <iostream> |
8 |
|
#include <iomanip> |
9 |
using namespace std; |
using namespace std; |
10 |
|
|
11 |
|
|
52 |
return ret1; |
return ret1; |
53 |
} |
} |
54 |
/** |
/** |
55 |
* Static method to set the calibration to be loaded. |
* \brief Static method to set the calibration to be loaded. |
56 |
|
|
57 |
* It retrieves the calibration associated to a given run, from |
* It retrieves the calibration associated to a given run, from |
58 |
* a given DB. It fills the F77 common. |
* a given DB. It fills the F77 common. |
70 |
glrun->RUNHEADER_TIME > calib.TO_TIME || |
glrun->RUNHEADER_TIME > calib.TO_TIME || |
71 |
false ){ |
false ){ |
72 |
|
|
73 |
|
// cout <<">>> isloaded? "<< CalibIsLoaded() << endl; |
74 |
|
// cout <<">>> trk_calib_used "<< glrun->TRK_CALIB_USED<<endl; |
75 |
|
// cout <<">>> 104 loaded? "<< calib104 <<endl; |
76 |
|
// cout <<">>> from time "<< calib.FROM_TIME<<endl; |
77 |
|
// cout <<">>> to time "<< calib.TO_TIME<<endl; |
78 |
|
// if( !dbc || (dbc && !dbc->IsConnected()) ){ |
79 |
|
|
80 |
|
// if(TrkParams::WarningMode())cout <<" Missing DB connection -- check PAMELA environment variables "<<endl; |
81 |
|
// TString host = "mysql://localhost/pamelaprod"; |
82 |
|
// TString user = "anonymous"; |
83 |
|
// TString psw = ""; |
84 |
|
// const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); |
85 |
|
// const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); |
86 |
|
// const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW"); |
87 |
|
// if ( !pamdbhost ) pamdbhost = ""; |
88 |
|
// if ( !pamdbuser ) pamdbuser = ""; |
89 |
|
// if ( !pamdbpsw ) pamdbpsw = ""; |
90 |
|
// if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
91 |
|
// if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
92 |
|
// if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; |
93 |
|
// if(TrkParams::VerboseMode()){ |
94 |
|
// cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
95 |
|
// cout<<"Connecting to DB"<<endl; |
96 |
|
// cout<<"HOST "<<host<<endl; |
97 |
|
// cout<<"USER "<<user<<endl; |
98 |
|
// cout<<"PSW "<<psw<<endl; |
99 |
|
// } |
100 |
|
// dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
101 |
|
// if( !dbc )return false; |
102 |
|
// if( !dbc->IsConnected() )return false; |
103 |
|
// if(TrkParams::VerboseMode()){ |
104 |
|
// cout << " ...done"<<endl; |
105 |
|
// cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
106 |
|
// } |
107 |
|
// } |
108 |
|
|
109 |
GL_TRK_CALIB q2; |
GL_TRK_CALIB q2; |
110 |
GL_ROOT q3; |
GL_ROOT q3; |
111 |
GL_PARAM q4; |
GL_PARAM q4; |
149 |
*/ |
*/ |
150 |
UInt_t TrkParams::ValidateTrkCalib( CalibTrk1Event* caltrk){ |
UInt_t TrkParams::ValidateTrkCalib( CalibTrk1Event* caltrk){ |
151 |
|
|
152 |
|
UInt_t validate = 1; |
153 |
Int_t vorder[]={5,5,3,3,4,4,2,2,1,1,0,0}; |
Int_t vorder[]={5,5,3,3,4,4,2,2,1,1,0,0}; |
154 |
// UInt_t timeaftercalib=120000; //2000; |
// UInt_t timeaftercalib=120000; //2000; |
155 |
TString classname = caltrk->GetName(); |
TString classname = caltrk->GetName(); |
164 |
if(TrkParams::WarningMode())cout<<"(CRC Header)"; |
if(TrkParams::WarningMode())cout<<"(CRC Header)"; |
165 |
// if(TrkParams::WarningMode())cout << "ValidateTrkCalib: "<<classname<<" --WARNING-- CRC error in calibration header: pkt "<<ipkt<<endl; |
// if(TrkParams::WarningMode())cout << "ValidateTrkCalib: "<<classname<<" --WARNING-- CRC error in calibration header: pkt "<<ipkt<<endl; |
166 |
// return 0; // :-( |
// return 0; // :-( |
167 |
|
validate = 0; |
168 |
} |
} |
169 |
for(Int_t ilad=0; ilad<3; ilad++)if( caltrk->crc_cal[ipkt][ilad] ){ |
for(Int_t ilad=0; ilad<3; ilad++)if( caltrk->crc_cal[ipkt][ilad] ){ |
170 |
if(TrkParams::WarningMode())cout<<"(CRC Pkt-"<<ilad<<")"; |
if(TrkParams::WarningMode())cout<<"(CRC Pkt-"<<ilad<<")"; |
171 |
// if(TrkParams::WarningMode())cout << "ValidateTrkCalib: "<<classname<<" --WARNING-- CRC error in calibration packet: pkt "<<ipkt<<endl; |
// if(TrkParams::WarningMode())cout << "ValidateTrkCalib: "<<classname<<" --WARNING-- CRC error in calibration packet: pkt "<<ipkt<<endl; |
172 |
// return 0; // :-( |
// return 0; // :-( |
173 |
|
validate = 0; |
174 |
} |
} |
175 |
} |
} |
176 |
} |
} |
220 |
build = build | ( 1<<(base+vorder[caltrk->DSPnumber[ipkt]-1]) ); |
build = build | ( 1<<(base+vorder[caltrk->DSPnumber[ipkt]-1]) ); |
221 |
}; |
}; |
222 |
} |
} |
223 |
if( npkts==6 )return 1; // :-) |
if( npkts==6 ){}//return 1; // :-) |
224 |
else { |
else { |
225 |
if(TrkParams::WarningMode())cout << "ValidateTrkCalib: "<<classname<<" --WARNING-- there might be some missing packets :-( ( "<<npkts<<" instead of 6 ) --> "<<endl; |
if(TrkParams::WarningMode())cout << "ValidateTrkCalib: "<<classname<<" --WARNING-- there might be some missing packets :-( ( "<<npkts<<" instead of 6 ) --> "<<endl; |
226 |
|
validate = 0; |
227 |
} |
} |
228 |
// cout << classname << " "<<eh->GetPscuHeader()->GetOrbitalTime()<<endl; |
// cout << classname << " "<<eh->GetPscuHeader()->GetOrbitalTime()<<endl; |
229 |
|
|
273 |
// if ( IsDebug() ) cout << "ValidateTrkCalib: (MISSING VIEW) ACQ_BUILD_INFO= >>> "<<hex << (run->ACQ_BUILD_INFO&mask) << " != "<< build << dec<<endl; |
// if ( IsDebug() ) cout << "ValidateTrkCalib: (MISSING VIEW) ACQ_BUILD_INFO= >>> "<<hex << (run->ACQ_BUILD_INFO&mask) << " != "<< build << dec<<endl; |
274 |
// return 0; // :-( |
// return 0; // :-( |
275 |
// } |
// } |
276 |
return 1; // :-) |
|
277 |
|
// return 1; // :-) |
278 |
|
|
279 |
|
// cout << validate << endl; |
280 |
|
return validate; |
281 |
|
|
282 |
} |
} |
283 |
/** |
/** |
286 |
void TrkParams::FillACalibFrom(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
void TrkParams::FillACalibFrom(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
287 |
|
|
288 |
cTrkCalib *ca = &pedsigbad_; |
cTrkCalib *ca = &pedsigbad_; |
289 |
|
ca->Reset(); |
290 |
|
|
291 |
TTree *tr1 = (TTree*)f0->Get("CalibTrk1"); |
TTree *tr1 = (TTree*)f0->Get("CalibTrk1"); |
292 |
TTree *tr2 = (TTree*)f0->Get("CalibTrk2"); |
TTree *tr2 = (TTree*)f0->Get("CalibTrk2"); |
300 |
Int_t dspn1(0),dspn2(0); |
Int_t dspn1(0),dspn2(0); |
301 |
|
|
302 |
// --- TEST TEST TEST TEST --- // |
// --- TEST TEST TEST TEST --- // |
303 |
TrkParams::ValidateTrkCalib(calibdata1); |
// TrkParams::ValidateTrkCalib(calibdata1); |
304 |
TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
// TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
305 |
|
|
306 |
|
UInt_t test1 = TrkParams::ValidateTrkCalib(calibdata1); |
307 |
|
UInt_t test2 = TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
308 |
|
if( !test1 || !test2 ){ |
309 |
|
if(TrkParams::calib.VALIDATION==1)cout << "--> modify DB info "<<endl; |
310 |
|
TrkParams::calib.VALIDATION = 0; |
311 |
|
} |
312 |
|
if(TrkParams::calib.VALIDATION==0)cout << " ** WARNING ** Calibration not validated "<<endl; |
313 |
|
|
314 |
for(Int_t i=0;i<6;i++){ |
for(Int_t i=0;i<6;i++){ |
315 |
dspn1=calibdata1->DSPnumber[i]-1; |
dspn1=calibdata1->DSPnumber[i]-1; |
316 |
dspn2=calibdata2->DSPnumber[i]-1; |
dspn2=calibdata2->DSPnumber[i]-1; |
317 |
/* cout<<"dspn1= "<<dspn1<<" dspn2= "<<dspn2<<endl; */ |
// cout<<"dspn1= "<<dspn1<<" dspn2= "<<dspn2<<endl; |
318 |
for(Int_t ii=0;ii<3072;ii++){ |
for(Int_t ii=0;ii<3072;ii++){ |
319 |
Int_t j=(ii/128); |
Int_t j=(ii/128); |
320 |
Int_t jj=ii-j*128; |
Int_t jj=ii-j*128; |
321 |
ca->pedestal[jj][j][dspn1]=calibdata1->DSPped_par[i][ii]; |
if(dspn1>=0 && dspn1<12){ |
322 |
ca->pedestal[jj][j][dspn2]=calibdata2->DSPped_par[i][ii]; |
ca->pedestal[jj][j][dspn1]=calibdata1->DSPped_par[i][ii]; |
323 |
ca->pedestal_t[jj][j][dspn1]=aint(calibdata1->DSPped_par[i][ii]); |
ca->pedestal_t[jj][j][dspn1]=aint(calibdata1->DSPped_par[i][ii]); |
324 |
ca->pedestal_t[jj][j][dspn2]=aint(calibdata2->DSPped_par[i][ii]); |
ca->sigma[jj][j][dspn1]=calibdata1->DSPsig_par[i][ii]; |
325 |
ca->sigma[jj][j][dspn1]=calibdata1->DSPsig_par[i][ii]; |
ca->sigma_t[jj][j][dspn1]=anint(calibdata1->DSPsig_par[i][ii]); |
326 |
ca->sigma[jj][j][dspn2]=calibdata2->DSPsig_par[i][ii]; |
if(calibdata1->DSPbad_par[i][ii]==0) |
327 |
ca->sigma_t[jj][j][dspn1]=anint(calibdata1->DSPsig_par[i][ii]); |
ca->bad[jj][j][dspn1]=1; |
328 |
ca->sigma_t[jj][j][dspn2]=anint(calibdata2->DSPsig_par[i][ii]); |
else if(calibdata1->DSPbad_par[i][ii]==1) |
329 |
// cout<<"sigma trk1= "<<sigma[jj][j][dspn1]<<endl; |
ca->bad[jj][j][dspn1]=0; |
330 |
// cout<<"sigma_t trk1= "<<sigma_t[jj][j][dspn1]<<endl; |
// cout<<"sigma trk1= "<<sigma[jj][j][dspn1]<<endl; |
331 |
// cout<<"sigma trk2= "<<sigma[jj][j][dspn2]<<endl; |
// cout<<"sigma_t trk1= "<<sigma_t[jj][j][dspn1]<<endl; |
332 |
// cout<<"sigma_t trk2= "<<sigma_t[jj][j][dspn2]<<endl; |
} |
333 |
|
|
334 |
// |
if(dspn2>=0 && dspn2<12){ |
335 |
// invert the bad |
ca->pedestal[jj][j][dspn2]=calibdata2->DSPped_par[i][ii]; |
336 |
// |
ca->pedestal_t[jj][j][dspn2]=aint(calibdata2->DSPped_par[i][ii]); |
337 |
if(calibdata1->DSPbad_par[i][ii]==0) |
ca->sigma[jj][j][dspn2]=calibdata2->DSPsig_par[i][ii]; |
338 |
ca->bad[jj][j][dspn1]=1; |
ca->sigma_t[jj][j][dspn2]=anint(calibdata2->DSPsig_par[i][ii]); |
339 |
else if(calibdata1->DSPbad_par[i][ii]==1) |
if(calibdata2->DSPbad_par[i][ii]==0) |
340 |
ca->bad[jj][j][dspn1]=0; |
ca->bad[jj][j][dspn2]=1; |
341 |
if(calibdata2->DSPbad_par[i][ii]==0) |
else if(calibdata2->DSPbad_par[i][ii]==1) |
342 |
ca->bad[jj][j][dspn2]=1; |
ca->bad[jj][j][dspn2]=0; |
343 |
else if(calibdata2->DSPbad_par[i][ii]==1) |
// cout<<"sigma trk2= "<<sigma[jj][j][dspn2]<<endl; |
344 |
ca->bad[jj][j][dspn2]=0; |
// cout<<"sigma_t trk2= "<<sigma_t[jj][j][dspn2]<<endl; |
345 |
|
} |
346 |
}; |
}; |
347 |
}; |
}; |
348 |
|
|
355 |
void TrkParams::FillFCalibFrom(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
void TrkParams::FillFCalibFrom(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
356 |
|
|
357 |
cTrkCalib *ca = &pedsigbad_; |
cTrkCalib *ca = &pedsigbad_; |
358 |
|
// ca->Reset(); |
359 |
|
|
360 |
TTree *tr1 = (TTree*)f0->Get("CalibTrk1"); |
TTree *tr1 = (TTree*)f0->Get("CalibTrk1"); |
361 |
TTree *tr2 = (TTree*)f0->Get("CalibTrk2"); |
TTree *tr2 = (TTree*)f0->Get("CalibTrk2"); |
369 |
Int_t dspn1(0),dspn2(0); |
Int_t dspn1(0),dspn2(0); |
370 |
|
|
371 |
// --- TEST TEST TEST TEST --- // |
// --- TEST TEST TEST TEST --- // |
372 |
TrkParams::ValidateTrkCalib(calibdata1); |
// TrkParams::ValidateTrkCalib(calibdata1); |
373 |
TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
// TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
374 |
|
UInt_t test1 = TrkParams::ValidateTrkCalib(calibdata1); |
375 |
|
UInt_t test2 = TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
376 |
|
if( !test1 || !test2 ){ |
377 |
|
if(TrkParams::calib.VALIDATION==1)cout << "--> modify DB info "<<endl; |
378 |
|
TrkParams::calib.VALIDATION = 0; |
379 |
|
} |
380 |
|
if(TrkParams::calib.VALIDATION==0)cout << " ** WARNING ** Calibration not validated "<<endl; |
381 |
|
|
382 |
for(Int_t i=0;i<6;i++){ |
for(Int_t i=0;i<6;i++){ |
383 |
dspn1=calibdata1->DSPnumber[i]-1; |
dspn1=calibdata1->DSPnumber[i]-1; |
386 |
for(Int_t ii=0;ii<3072;ii++){ |
for(Int_t ii=0;ii<3072;ii++){ |
387 |
Int_t j=(ii/128); |
Int_t j=(ii/128); |
388 |
Int_t jj=ii-j*128; |
Int_t jj=ii-j*128; |
389 |
ca->pedestal[jj][j][dspn1]=calibdata1->DSPped_par[i][ii]; |
if(dspn1>=0 && dspn1<12){ |
390 |
ca->pedestal[jj][j][dspn2]=calibdata2->DSPped_par[i][ii]; |
ca->pedestal[jj][j][dspn1]=calibdata1->DSPped_par[i][ii]; |
391 |
ca->sigma[jj][j][dspn1]=calibdata1->DSPsig_par[i][ii]; |
ca->sigma[jj][j][dspn1]=calibdata1->DSPsig_par[i][ii]; |
392 |
ca->sigma[jj][j][dspn2]=calibdata2->DSPsig_par[i][ii]; |
if(calibdata1->DSPbad_par[i][ii]==0) |
393 |
// cout<<"sigma trk1= "<<sigma[jj][j][dspn1]<<endl; |
ca->bad[jj][j][dspn1]=1; |
394 |
// cout<<"sigma_t trk1= "<<sigma_t[jj][j][dspn1]<<endl; |
else if(calibdata1->DSPbad_par[i][ii]==1) |
395 |
// cout<<"sigma trk2= "<<sigma[jj][j][dspn2]<<endl; |
ca->bad[jj][j][dspn1]=0; |
396 |
// cout<<"sigma_t trk2= "<<sigma_t[jj][j][dspn2]<<endl; |
// cout<<"sigma trk1= "<<sigma[jj][j][dspn1]<<endl; |
397 |
|
// cout<<"sigma_t trk1= "<<sigma_t[jj][j][dspn1]<<endl; |
398 |
// |
} |
399 |
// invert the bad |
if(dspn2>=0 && dspn2<12){ |
400 |
// |
ca->pedestal[jj][j][dspn2]=calibdata2->DSPped_par[i][ii]; |
401 |
if(calibdata1->DSPbad_par[i][ii]==0) |
ca->sigma[jj][j][dspn2]=calibdata2->DSPsig_par[i][ii]; |
402 |
ca->bad[jj][j][dspn1]=1; |
if(calibdata2->DSPbad_par[i][ii]==0) |
403 |
else if(calibdata1->DSPbad_par[i][ii]==1) |
ca->bad[jj][j][dspn2]=1; |
404 |
ca->bad[jj][j][dspn1]=0; |
else if(calibdata2->DSPbad_par[i][ii]==1) |
405 |
if(calibdata2->DSPbad_par[i][ii]==0) |
ca->bad[jj][j][dspn2]=0; |
406 |
ca->bad[jj][j][dspn2]=1; |
// cout<<"sigma trk2= "<<sigma[jj][j][dspn2]<<endl; |
407 |
else if(calibdata2->DSPbad_par[i][ii]==1) |
// cout<<"sigma_t trk2= "<<sigma_t[jj][j][dspn2]<<endl; |
408 |
ca->bad[jj][j][dspn2]=0; |
} |
409 |
}; |
}; |
410 |
}; |
}; |
411 |
|
|
418 |
void TrkParams::FillTCalibFrom(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
void TrkParams::FillTCalibFrom(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
419 |
|
|
420 |
cTrkCalib *ca = &pedsigbad_; |
cTrkCalib *ca = &pedsigbad_; |
421 |
|
// ca->Reset(); |
422 |
|
|
423 |
TTree *tr1 = (TTree*)f0->Get("CalibTrk1"); |
TTree *tr1 = (TTree*)f0->Get("CalibTrk1"); |
424 |
TTree *tr2 = (TTree*)f0->Get("CalibTrk2"); |
TTree *tr2 = (TTree*)f0->Get("CalibTrk2"); |
432 |
Int_t dspn1(0),dspn2(0); |
Int_t dspn1(0),dspn2(0); |
433 |
|
|
434 |
// --- TEST TEST TEST TEST --- // |
// --- TEST TEST TEST TEST --- // |
435 |
TrkParams::ValidateTrkCalib(calibdata1); |
// TrkParams::ValidateTrkCalib(calibdata1); |
436 |
TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
// TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
437 |
|
UInt_t test1 = TrkParams::ValidateTrkCalib(calibdata1); |
438 |
|
UInt_t test2 = TrkParams::ValidateTrkCalib((CalibTrk1Event*)calibdata2); |
439 |
|
if( !test1 || !test2 ){ |
440 |
|
if(TrkParams::calib.VALIDATION==1)cout << "--> modify DB info "<<endl; |
441 |
|
TrkParams::calib.VALIDATION = 0; |
442 |
|
} |
443 |
|
if(TrkParams::calib.VALIDATION==0)cout << " ** WARNING ** Calibration not validated "<<endl; |
444 |
|
|
445 |
for(Int_t i=0;i<6;i++){ |
for(Int_t i=0;i<6;i++){ |
446 |
dspn1=calibdata1->DSPnumber[i]-1; |
dspn1=calibdata1->DSPnumber[i]-1; |
449 |
for(Int_t ii=0;ii<3072;ii++){ |
for(Int_t ii=0;ii<3072;ii++){ |
450 |
Int_t j=(ii/128); |
Int_t j=(ii/128); |
451 |
Int_t jj=ii-j*128; |
Int_t jj=ii-j*128; |
452 |
ca->pedestal_t[jj][j][dspn1]=aint(calibdata1->DSPped_par[i][ii]); |
if(dspn1>=0 && dspn1<12){ |
453 |
ca->pedestal_t[jj][j][dspn2]=aint(calibdata2->DSPped_par[i][ii]); |
ca->pedestal_t[jj][j][dspn1]=aint(calibdata1->DSPped_par[i][ii]); |
454 |
ca->sigma_t[jj][j][dspn1]=anint(calibdata1->DSPsig_par[i][ii]); |
ca->sigma_t[jj][j][dspn1]=anint(calibdata1->DSPsig_par[i][ii]); |
455 |
ca->sigma_t[jj][j][dspn2]=anint(calibdata2->DSPsig_par[i][ii]); |
} |
456 |
|
if(dspn2>=0 && dspn2<12){ |
457 |
|
ca->pedestal_t[jj][j][dspn2]=aint(calibdata2->DSPped_par[i][ii]); |
458 |
|
ca->sigma_t[jj][j][dspn2]=anint(calibdata2->DSPsig_par[i][ii]); |
459 |
|
} |
460 |
}; |
}; |
461 |
}; |
}; |
462 |
|
|
479 |
void TrkParams::FillMask(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
void TrkParams::FillMask(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
480 |
|
|
481 |
cTrkMask *ma = &mask_; |
cTrkMask *ma = &mask_; |
482 |
|
ma->Reset(); |
483 |
|
|
484 |
TrkCalib *calib = new TrkCalib(); |
TrkCalib *calib = new TrkCalib(); |
485 |
|
|
502 |
tr->GetEntry(ev_reg2); |
tr->GetEntry(ev_reg2); |
503 |
} |
} |
504 |
for(Int_t ipkt=0; ipkt<NPLANE; ipkt++){ |
for(Int_t ipkt=0; ipkt<NPLANE; ipkt++){ |
505 |
for(Int_t ivk=0; ivk<NVK; ivk++){ |
Int_t view = calib->GetView(ipkt); |
506 |
Int_t view = calib->GetView(ipkt); |
if( (view-1)>= 0 && (view-1)<12 ){ |
507 |
Float_t sigm = calib->GetMean("SIG-BAD",ipkt,ivk+1); |
for(Int_t ivk=0; ivk<NVK; ivk++){ |
508 |
Float_t sigmin = 0.; |
Float_t sigm = calib->GetMean("SIG-BAD",ipkt,ivk+1); |
509 |
if(view%2)sigmin = 6.5; |
Float_t sigmin = 0.; |
510 |
else sigmin = 2.5; |
if(view%2)sigmin = 6.5; |
511 |
Int_t mask = 1; |
else sigmin = 2.5; |
512 |
if( sigm<sigmin )mask = 0; |
Int_t mask = 1; |
513 |
|
if( sigm<sigmin )mask = 0; |
514 |
ma->mask_vk_run[ivk][view-1] = mask; |
ma->mask_vk_run[ivk][view-1] = mask; |
515 |
|
} |
516 |
// if(mask==0)cout<< " VIEW "<<view<<" VK "<<ivk+1<<" -- <SIG> "<<sigm<<" ---> MASKED!"<<endl; |
} |
|
} |
|
517 |
} |
} |
518 |
if(tr)tr->Delete(); |
if(tr)tr->Delete(); |
519 |
} |
} |
520 |
|
|
521 |
|
if(TrkParams::VerboseMode()){ |
522 |
|
for(Int_t iv=0; iv<NVIEW; iv++){ |
523 |
|
cout<<"view "<<setw(3)<<iv<<": "; |
524 |
|
for(Int_t ivk=0; ivk<NVK; ivk++)cout<<ma->mask_vk_run[ivk][iv]; |
525 |
|
cout << endl; |
526 |
|
} |
527 |
|
} |
528 |
|
|
529 |
if(calib)calib->Delete(); |
if(calib)calib->Delete(); |
530 |
|
|
531 |
}; |
}; |
538 |
|
|
539 |
|
|
540 |
/** |
/** |
541 |
* Static method to load calibration. |
* \brief Static method to load calibration. |
542 |
* Calibration is loaded ONLY IF TrkParams::CalibLoaded()==kTRUE, which appens the |
* Calibration is loaded ONLY IF TrkParams::CalibLoaded()==kTRUE, which appens after the method TrkParams::SetCalib(***) is called. |
|
* first time the method is called (but it does not work becouse I didn't set any |
|
|
* default calibration for the moment) or after the method TrkParams::SetCalib(***) is called. |
|
543 |
*/ |
*/ |
544 |
Bool_t TrkParams::LoadCalib( ){ |
Bool_t TrkParams::LoadCalib( ){ |
545 |
|
|
934 |
return b[2]/10.; |
return b[2]/10.; |
935 |
} |
} |
936 |
|
|
937 |
|
|
938 |
|
|
939 |
/** |
/** |
940 |
* \brief Set tracking mode (0=standard. 1=???) |
* \brief Set tracking mode (0=standard. 1=???) |
941 |
*/ |
*/ |
962 |
* \brief Set p.f.a. |
* \brief Set p.f.a. |
963 |
* |
* |
964 |
* Implemented algorythms: |
* Implemented algorythms: |
965 |
* 0 ETA (default) |
* 0 ETA |
966 |
* 1 --- |
* 1 --- |
967 |
* 2 ETA2 |
* 2 ETA2 |
968 |
* 3 ETA3 |
* 3 ETA3 |
969 |
* 4 ETA4 |
* 4 ETA4 |
970 |
|
* 5 ETAL ==> ETA+LANDI |
971 |
* 10 COG |
* 10 COG |
972 |
* 11 COG1 |
* 11 COG1 |
973 |
* 12 COG2 |
* 12 COG2 |
976 |
*/ |
*/ |
977 |
void TrkParams::SetPFA(int pfaid){ |
void TrkParams::SetPFA(int pfaid){ |
978 |
init__pfa = pfaid; |
init__pfa = pfaid; |
979 |
SetStepMin(); |
SetPFA(); |
980 |
}; |
}; |
981 |
|
/** |
982 |
|
* \brief Get spatial resolution. |
983 |
|
* |
984 |
|
* Method to retrieve the spatial resolution associated with the |
985 |
|
* adopted p.f.a. |
986 |
|
* @param view Tracker view (1-12) |
987 |
|
* @param angle Track projected angle |
988 |
|
* |
989 |
|
* In order to change p.f.a. use the SetPFA(int pfaid) method, eg.: |
990 |
|
* |
991 |
|
* TrkParams::SetPFA(0) // ETA |
992 |
|
* |
993 |
|
*/ |
994 |
|
float TrkParams::GetResolution(int view, float angle){ |
995 |
|
float res = 1000; |
996 |
|
if( init__pfa == 0 )res = riseta_(&view,&angle); |
997 |
|
else cout << "float TrkParams::GetResolution(int view, float angle) -- PFA "<<init__pfa<<" not yet implemented"<<endl; |
998 |
|
return res; |
999 |
|
} |
1000 |
|
|
1001 |
|
|
1002 |
|
|