/** * \file TrkStruct.h * \author Elena Vannuccini * \date */ #include using namespace pamela; using namespace std; float aint(float f){ int ret = (int)f; float ret1 = 0; ret1=(float)ret; return ret1; } float anint(float f){ int ret = (int)(f+0.5); float ret1 = 0; ret1=(float)ret; return ret1; } /** * Method to fill the tracker calibration-parameter struct from on-line calibrations */ void cTrkCalib::FillACalibFrom(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= "<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= "<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= "<SetBranchAddress("CalibTrk1",calib->GetPointerTo()); tr->GetEntry(ev_reg1); } if(i==1){ //------------------------- //read calibration packet 2 //------------------------- tr = (TTree*)f0->Get("CalibTrk2"); tr->SetBranchAddress("CalibTrk2",calib->GetPointerTo()); tr->GetEntry(ev_reg2); } for(Int_t ipkt=0; ipktGetView(ipkt); Float_t sigm = calib->GetMean("SIG-BAD",ipkt,ivk+1); Float_t sigmin = 0.; if(view%2)sigmin = 6.5; else sigmin = 2.5; Int_t mask = 1; if( sigm "< MASKED!"<Delete(); } if(calib)calib->Delete(); };