4 |
* \date |
* \date |
5 |
*/ |
*/ |
6 |
#include <TrkStruct.h> |
#include <TrkStruct.h> |
7 |
|
//#include <TrkCalib.h> |
|
#include <TTree.h> |
|
|
#include <CalibTrk1Event.h> |
|
|
#include <CalibTrk2Event.h> |
|
|
#include <fstream> |
|
|
#include <iostream> |
|
8 |
|
|
9 |
using namespace pamela; |
using namespace pamela; |
10 |
using namespace std; |
using namespace std; |
20 |
int ret = (int)(f+0.5); |
int ret = (int)(f+0.5); |
21 |
float ret1 = 0; |
float ret1 = 0; |
22 |
ret1=(float)ret; |
ret1=(float)ret; |
23 |
return ret1; |
return ret1; |
24 |
} |
} |
|
/** |
|
|
* Method to fill the tracker calibration-parameter struct from on-line calibrations |
|
|
*/ |
|
|
void cTrkCalib::FillFrom(TFile* f0, Int_t ev_reg1, Int_t ev_reg2){ |
|
|
|
|
|
TTree *tr1 = (TTree*)f0->Get("CalibTrk1"); |
|
|
TTree *tr2 = (TTree*)f0->Get("CalibTrk2"); |
|
|
|
|
|
CalibTrk1Event *calibdata1 = 0; |
|
|
CalibTrk2Event *calibdata2 = 0; |
|
|
tr1->SetBranchAddress("CalibTrk1",&calibdata1); |
|
|
tr2->SetBranchAddress("CalibTrk2",&calibdata2); |
|
|
tr1->GetEntry(ev_reg1); |
|
|
tr2->GetEntry(ev_reg2); |
|
|
Int_t dspn1(0),dspn2(0); |
|
|
|
|
|
for(Int_t i=0;i<6;i++){ |
|
|
dspn1=calibdata1->DSPnumber[i]-1; |
|
|
dspn2=calibdata2->DSPnumber[i]-1; |
|
|
/* cout<<"dspn1= "<<dspn1<<" dspn2= "<<dspn2<<endl; */ |
|
|
for(Int_t ii=0;ii<3072;ii++){ |
|
|
Int_t j=(ii/128); |
|
|
Int_t jj=ii-j*128; |
|
|
pedestal[jj][j][dspn1]=calibdata1->DSPped_par[i][ii]; |
|
|
pedestal[jj][j][dspn2]=calibdata2->DSPped_par[i][ii]; |
|
|
pedestal_t[jj][j][dspn1]=aint(calibdata1->DSPped_par[i][ii]); |
|
|
pedestal_t[jj][j][dspn2]=aint(calibdata2->DSPped_par[i][ii]); |
|
|
sigma[jj][j][dspn1]=calibdata1->DSPsig_par[i][ii]; |
|
|
sigma[jj][j][dspn2]=calibdata2->DSPsig_par[i][ii]; |
|
|
sigma_t[jj][j][dspn1]=anint(calibdata1->DSPsig_par[i][ii]); |
|
|
sigma_t[jj][j][dspn2]=anint(calibdata2->DSPsig_par[i][ii]); |
|
|
// cout<<"sigma trk1= "<<sigma[jj][j][dspn1]<<endl; |
|
|
// cout<<"sigma_t trk1= "<<sigma_t[jj][j][dspn1]<<endl; |
|
|
// cout<<"sigma trk2= "<<sigma[jj][j][dspn2]<<endl; |
|
|
// cout<<"sigma_t trk2= "<<sigma_t[jj][j][dspn2]<<endl; |
|
|
|
|
|
// |
|
|
// invert the bad |
|
|
// |
|
|
if(calibdata1->DSPbad_par[i][ii]==0) |
|
|
bad[jj][j][dspn1]=1; |
|
|
else if(calibdata1->DSPbad_par[i][ii]==1) |
|
|
bad[jj][j][dspn1]=0; |
|
|
if(calibdata2->DSPbad_par[i][ii]==0) |
|
|
bad[jj][j][dspn2]=1; |
|
|
else if(calibdata2->DSPbad_par[i][ii]==1) |
|
|
bad[jj][j][dspn2]=0; |
|
|
}; |
|
|
}; |
|
|
|
|
|
tr1->Delete(); |
|
|
tr2->Delete(); |
|
|
}; |
|