/[PAMELA software]/DarthVader/CalorimeterLevel2/src/CaloLevel0.cpp
ViewVC logotype

Diff of /DarthVader/CalorimeterLevel2/src/CaloLevel0.cpp

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

revision 1.1 by mocchiut, Sun Mar 18 20:22:54 2007 UTC revision 1.2 by mocchiut, Mon Mar 26 14:02:06 2007 UTC
# Line 181  Int_t CaloLevel0::ChkCalib(TSQLServer *d Line 181  Int_t CaloLevel0::ChkCalib(TSQLServer *d
181    return(sgnl);    return(sgnl);
182  }  }
183    
184  Int_t CaloLevel0::ChkParam(TSQLServer *dbc, UInt_t runheader){  Int_t CaloLevel0::ChkParam(TSQLServer *dbc, UInt_t runheader, Bool_t mechal){
185    stringstream calfile;    stringstream calfile;
186    stringstream bmfile;    stringstream bmfile;
187    stringstream aligfile;    stringstream aligfile;
# Line 191  Int_t CaloLevel0::ChkParam(TSQLServer *d Line 191  Int_t CaloLevel0::ChkParam(TSQLServer *d
191    GL_PARAM *glparam = new GL_PARAM();    GL_PARAM *glparam = new GL_PARAM();
192    //    //
193    if ( calopar1 || ( ttcalopar1 != 0 && ttcalopar1 < runheader ) ){    if ( calopar1 || ( ttcalopar1 != 0 && ttcalopar1 < runheader ) ){
194        //
195        //
196        //
197        if ( debug ) printf(" calopar1 %i ftcalopar1 %u ttcalopar1 %u runheader %u \n",calopar1,ftcalopar1,ttcalopar1,runheader);
198        //
199      calopar1 = false;      calopar1 = false;
200      //      //
201      // determine where I can find calorimeter ADC to MIP conversion file        // determine where I can find calorimeter ADC to MIP conversion file  
# Line 225  Int_t CaloLevel0::ChkParam(TSQLServer *d Line 230  Int_t CaloLevel0::ChkParam(TSQLServer *d
230    };    };
231    //    //
232    if ( calopar2 || ( ttcalopar2 != 0 && ttcalopar2 < runheader ) ){    if ( calopar2 || ( ttcalopar2 != 0 && ttcalopar2 < runheader ) ){
233        if ( debug ) printf(" calopar2 %i ftcalopar2 %u ttcalopar2 %u runheader %u \n",calopar2,ftcalopar2,ttcalopar2,runheader);
234      calopar2 = false;      calopar2 = false;
235      //      //
236      // determine where I can find calorimeter alignment file        // determine where I can find calorimeter alignment file  
# Line 240  Int_t CaloLevel0::ChkParam(TSQLServer *d Line 246  Int_t CaloLevel0::ChkParam(TSQLServer *d
246      ftcalopar2 = glparam->FROM_TIME;      ftcalopar2 = glparam->FROM_TIME;
247      ttcalopar2 = glparam->TO_TIME;      ttcalopar2 = glparam->TO_TIME;
248      //      //
249      if ( verbose ) printf("\n Using alignment file: \n %s \n",aligfile.str().c_str());      if ( verbose ) printf("\n Using parameter file: \n %s \n",aligfile.str().c_str());
250      f = fopen(aligfile.str().c_str(),"rb");      f = fopen(aligfile.str().c_str(),"rb");
251      if ( !f ){      if ( !f ){
252        if ( verbose ) printf(" CALORIMETER - ERROR: no alignement file!\n");        if ( verbose ) printf(" CALORIMETER - ERROR: no parameter file!\n");
253        return(-106);        return(-106);
254      };      };
255      //      //
256      fread(&clevel1->xalig,sizeof(clevel1->xalig),1,f);      if ( !mechal ){
257      if ( debug ) printf(" xalig = %f \n",clevel1->xalig);        //
258      fread(&clevel1->yalig,sizeof(clevel1->yalig),1,f);        fread(&clevel1->xalig,sizeof(clevel1->xalig),1,f);
259      if ( debug ) printf(" yalig = %f \n",clevel1->yalig);        if ( debug ) printf(" xalig = %f \n",clevel1->xalig);
260      fread(&clevel1->zalig,sizeof(clevel1->zalig),1,f);        fread(&clevel1->yalig,sizeof(clevel1->yalig),1,f);
261      if ( debug ) printf(" zalig = %f \n",clevel1->zalig);        if ( debug ) printf(" yalig = %f \n",clevel1->yalig);
262          fread(&clevel1->zalig,sizeof(clevel1->zalig),1,f);
263          if ( debug ) printf(" zalig = %f \n",clevel1->zalig);
264        } else {
265          if ( verbose ) printf("\n Using MECHANICAL alignement parameters \n");
266          //
267          CaloStrip cs = CaloStrip();
268          cs.UseMechanicalAlig();
269          clevel1->xalig = cs.GetXalig();
270          if ( debug ) printf(" xalig = %f \n",clevel1->xalig);
271          clevel1->yalig = cs.GetYalig();
272          if ( debug ) printf(" yalig = %f \n",clevel1->yalig);
273          clevel1->zalig = cs.GetZalig();
274          if ( debug ) printf(" zalig = %f \n",clevel1->zalig);
275          //
276          Float_t tmp = 0;
277          fread(&tmp,sizeof(clevel1->xalig),1,f);
278          fread(&tmp,sizeof(clevel1->yalig),1,f);
279          fread(&tmp,sizeof(clevel1->zalig),1,f);
280          //    
281        };
282      fread(&clevel1->emin,sizeof(clevel1->emin),1,f);        fread(&clevel1->emin,sizeof(clevel1->emin),1,f);  
283      if ( debug ) printf(" signal threshold = %f \n",clevel1->emin);      if ( debug ) printf(" signal threshold = %f \n",clevel1->emin);
284      //      //
# Line 262  Int_t CaloLevel0::ChkParam(TSQLServer *d Line 288  Int_t CaloLevel0::ChkParam(TSQLServer *d
288    // Load offline bad strip mask    // Load offline bad strip mask
289    //    //
290    if ( calopar3 || ( ttcalopar3 != 0 && ttcalopar3 < runheader ) ){    if ( calopar3 || ( ttcalopar3 != 0 && ttcalopar3 < runheader ) ){
291        if ( debug ) printf(" calopar3 %i ftcalopar3 %u ttcalopar3 %u runheader %u \n",calopar3,ftcalopar3,ttcalopar3,runheader);
292      calopar3 = false;      calopar3 = false;
293      //      //
294      // determine where I can find calorimeter alignment file        // determine where I can find calorimeter alignment file  
# Line 432  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 459  Int_t CaloLevel0::Calibrate(Int_t ei){
459    for (Int_t l = 0; l < 2; l++){    for (Int_t l = 0; l < 2; l++){
460      for (Int_t m = 0; m < 22; m++){      for (Int_t m = 0; m < 22; m++){
461        //        //
462        // determine the section number        // determine the section number  
463        //        //
464        se = 5;        se = 5;
465        if (l == 0 && m%2 == 0) se = 3;        if (l == 0 && m%2 == 0) se = 3;
466        if (l == 0 && m%2 != 0) se = 2;        if (l == 0 && m%2 != 0) se = 2;
467        if (l == 1 && m%2 == 0) se = 1;        if (l == 1 && m%2 != 0) se = 1;
468        if (l == 1 && m%2 != 0) se = 0;                  if (l == 1 && m%2 == 0) se = 0;          
469        //        //
470        // determine what kind of event we are going to analyze        // determine what kind of event we are going to analyze
471        //        //

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

  ViewVC Help
Powered by ViewVC 1.1.23