/[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.1 by pam-fi, Fri Feb 16 14:56:01 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 308  Bool_t TrkParams::LoadCalib( ){ Line 333  Bool_t TrkParams::LoadCalib( ){
333      TrkParams::FillACalibFrom(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);      TrkParams::FillACalibFrom(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);
334      TrkParams::FillMask(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);      TrkParams::FillMask(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);
335  //    mask_.Set(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);  //    mask_.Set(f0_c,calib.EV_ROOT_CALIBTRK1,calib.EV_ROOT_CALIBTRK2);
336    //    for(int i=0; i<12; i++) cout << " DSP "<< i << " "<< pedsigbad_.pedestal[64][12][i] << endl;
337    
338  //    };  //    };
339      // =============================================================      // =============================================================
# Line 330  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;
360      f0_c->Close();      f0_c->Close();
361  //    delete f0_c;  //    delete f0_c;
362      cout << "--------------------------------------"<<endl;      cout << "--------------------------------------"<<endl;
# Line 399  Bool_t TrkParams::Set( GL_RUN* glrun , T Line 426  Bool_t TrkParams::Set( GL_RUN* glrun , T
426      gl[index]     = q4;      gl[index]     = q4;
427      glpath[index] = q4.PATH+q4.NAME;      glpath[index] = q4.PATH+q4.NAME;
428      glload[index] = false;      glload[index] = false;
429      cout << "<< set TrkParams type "<<type<<" >>"<<endl;      cout << "<< set TrkParams type "<<type<<" >> (from DB) "<<endl;
430      return true;      return true;
431  //    return TrkParams::Load(type);  //    return TrkParams::Load(type);
432    
433  };  };
434  /**  /**
435   * Set tracker parameters proper for the run, from the from input.   * Set tracker parameters proper for the run, from input.
436   * @param path  Path to parameters directory   * @param path  Path to parameters directory
437   * @param type  Parameter type   * @param type  Parameter type
438   * @return FALSE if parameter set fails.   * @return FALSE if parameter set fails.
# Line 417  Bool_t TrkParams::Set( TString path , UI Line 444  Bool_t TrkParams::Set( TString path , UI
444    
445      gl[index].TYPE= type;      gl[index].TYPE= type;
446      glpath[index] = path;      glpath[index] = path;
447      cout << "<< set TrkParams type "<<type<<" >>"<<endl;      cout << "<< set TrkParams type "<<type<<" >> (from input) "<<endl;
448      glload[index] = false;      glload[index] = false;
449    
450  //    return TrkParams::Load(type);  //    return TrkParams::Load(type);
# Line 476  Bool_t TrkParams::Set(UInt_t type){ Line 503  Bool_t TrkParams::Set(UInt_t type){
503                    
504      }      }
505    
506      cout << "<< set TrkParams type "<<type<<" >>"<<endl;      cout << "<< set TrkParams type "<<type<<" (from env var PAM_CALIB) >>"<<endl;
507  //    return TrkParams::Load(type);  //    return TrkParams::Load(type);
508      return true;      return true;
509    
# Line 518  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.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23