/[PAMELA software]/DarthVader/TrackerLevel2/src/TrkParams.cpp
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/TrkParams.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pam-fi, Thu Mar 15 12:17:10 2007 UTC revision 1.3 by pam-fi, Fri Mar 16 20:26:33 2007 UTC
# Line 49  float anint(float f){ Line 49  float anint(float f){
49   */   */
50  Bool_t TrkParams::SetCalib( GL_RUN *glrun, TSQLServer* dbc ){  Bool_t TrkParams::SetCalib( GL_RUN *glrun, TSQLServer* dbc ){
51    
52      GL_TRK_CALIB q2;      if( !CalibIsLoaded()                          ||
53      GL_ROOT q3;          (glrun->TRK_CALIB_USED==104 && !calib104) ||
54      GL_PARAM q4;          (glrun->TRK_CALIB_USED!=104 && calib104)  ||
55            glrun->RUNHEADER_TIME < calib.FROM_TIME   ||
56      if( q2.Query_GL_TRK_CALIB(glrun->RUNHEADER_TIME,dbc) )return false;          glrun->RUNHEADER_TIME > calib.TO_TIME     ||
57      if(q2.EV_ROOT_CALIBTRK1 != q2.EV_ROOT_CALIBTRK2)          false ){
58          printf("WARNING!! ---> EV_ROOT_CALIBTRK1=%d it's different from EV_ROOT_CALIBTRK2=%d \n\n",q2.EV_ROOT_CALIBTRK1,q2.EV_ROOT_CALIBTRK2);    
59      if( q3.Query_GL_ROOT(q2.ID_ROOT_L0,dbc) )return false;          GL_TRK_CALIB q2;
60            GL_ROOT q3;
61      calib      = q2;          GL_PARAM q4;
62      calibpathf = q3.PATH + q3.NAME;          
63      calib104   = (glrun->TRK_CALIB_USED==104);          cout << " UPDATING calibration -- run-header time "<< glrun->RUNHEADER_TIME <<endl;
64      calibload  = kFALSE;          if( q2.Query_GL_TRK_CALIB(glrun->RUNHEADER_TIME,dbc) ){
65      if(calib104){              cout << "Bool_t TrkParams::SetCalib( GL_RUN* , TSQLServer* ) -- ERROR -- failed query to GL_TRK_CALIB "<<endl;
66          if (q4.Query_GL_PARAM(glrun->RUNHEADER_TIME,7,dbc) )return false;              return false;
67          calibpatht = q4.PATH + q4.NAME;          }
68      }          if( q2.EV_ROOT_CALIBTRK1 != q2.EV_ROOT_CALIBTRK2 )
69                printf("WARNING!! ---> EV_ROOT_CALIBTRK1=%d it's different from EV_ROOT_CALIBTRK2=%d \n\n",q2.EV_ROOT_CALIBTRK1,q2.EV_ROOT_CALIBTRK2);      
70            if( q3.Query_GL_ROOT(q2.ID_ROOT_L0,dbc) ){
71                cout << "Bool_t TrkParams::SetCalib( GL_RUN* , TSQLServer* ) -- ERROR -- failed query to GL_ROOT "<<endl;
72                return false;
73            }
74    
75    //      cout << "selected "<<q2.ID<<" from_time "<<q2.FROM_TIME<<" to time "<<q2.TO_TIME<<endl;
76            calib      = q2;
77            calibpathf = q3.PATH + q3.NAME;
78            calib104   = (glrun->TRK_CALIB_USED==104);
79            calibload  = kFALSE;
80            if(calib104){
81                if (q4.Query_GL_PARAM(glrun->RUNHEADER_TIME,7,dbc) )return false;
82                calibpatht = q4.PATH + q4.NAME;
83            }
84            
85    
86  //    return TrkParams::LoadCalib();  //    return TrkParams::LoadCalib();
87      return true;          return true;
88        }
89    
90        return false;
91  };  };
92    
93  /**  /**
# Line 272  void TrkParams::FillMask(TFile* f0, Int_ Line 290  void TrkParams::FillMask(TFile* f0, Int_
290    
291  };  };
292    
293    // Bool_t TrkParams::CalibIsLoaded(UInt_t time){
294    
295    //     if( !calibload ) return false;
296    
297    // };
298    
299    
300  /**  /**
301   * Static method to load calibration.   * Static method to load calibration.
302   * Calibration is loaded ONLY IF TrkParams::CalibLoaded()==kTRUE, which appens the   * Calibration is loaded ONLY IF TrkParams::CalibLoaded()==kTRUE, which appens the
# Line 331  Bool_t TrkParams::LoadCalib( ){ Line 356  Bool_t TrkParams::LoadCalib( ){
356  //      ca->FillTCalibFrom(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);  //      ca->FillTCalibFrom(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);
357          TrkParams::FillTCalibFrom(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);          TrkParams::FillTCalibFrom(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);
358      };      };
359      for(int i=0; i<12; i++) cout << " DSP "<< i << " "<< pedsigbad_.pedestal_t[64][12][i] << endl;  //    for(int i=0; i<12; i++) cout << " DSP "<< i << " "<< pedsigbad_.pedestal_t[64][12][i] << endl;
360      f0_c->Close();      f0_c->Close();
361  //    delete f0_c;  //    delete f0_c;
362      cout << "--------------------------------------"<<endl;      cout << "--------------------------------------"<<endl;
# Line 520  Bool_t  TrkParams::Set( ){ Line 545  Bool_t  TrkParams::Set( ){
545          if ( !TrkParams::Set(0,dbc) )return false;          if ( !TrkParams::Set(0,dbc) )return false;
546          dbc->Close();          dbc->Close();
547      }else for(Int_t i=0; i<NTYPES; i++)if ( !TrkParams::Set(trkparamtype[i])) return false;      }else for(Int_t i=0; i<NTYPES; i++)if ( !TrkParams::Set(trkparamtype[i])) return false;
548    
549        return true;
550  }  }
551    
552  /**  /**

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23