coverity & pass2 preparation
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Apr 2011 10:13:25 +0000 (10:13 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Apr 2011 10:13:25 +0000 (10:13 +0000)
T0/AliT0CalibTimeEq.cxx
T0/AliT0Calibrator.cxx
T0/AliT0PreprocessorOffline.cxx
T0/MakeT0RecoParam.C

index 30bd757..98d3807 100644 (file)
@@ -262,8 +262,7 @@ Bool_t AliT0CalibTimeEq::ComputeOfflineParams(const char* filePhys, Float_t *tim
          }
          SetTimeEq(i,timecdb[i] + meandiff);
          SetTimeEqRms(i,sigmadiff);
-         SetCFDvalue(i,0,cfdvalue[i] + meancfdtime );
-         //SetCFDvalue(i,0,cfdvalue[i] );
+         SetCFDvalue(i,0,cfdvalue[i] );
          if (cfddiff) delete cfddiff;
          if (cfdtime) delete cfdtime;
          } //bad pmt
index d5094b1..4599b49 100644 (file)
@@ -107,9 +107,8 @@ Int_t  AliT0Calibrator::WalkCorrection(Int_t refAmp,  Int_t ipmt, Int_t qt, Int_
   }
   
   timeWalk = time - walk   ;
-  timeEq =timeWalk - refAmp ; //- fTimeDelayCFD[ipmt]; //in refAmp - mean CFD position
+  timeEq =timeWalk - fTimeDelayCFD[ipmt]; //in refAmp - mean CFD position
  
- //  timeEq= timeWalk - fTimeDelayCFD[ipmt];
   //   printf(" ipmt %i time before %i timeWalk %i , walk %i  qt %i fTimeDelayCFD[ipmt] %i timeEq %i \n ",
   //    ipmt, time,timeWalk, walk, qt,fTimeDelayCFD[ipmt], timeEq );
      AliDebug(10,Form(" ipmt %i time before %i timeWalk %i , walk %i  qt %i timeEq %i \n ",
index 0a7d935..a2360c8 100644 (file)
@@ -96,10 +96,13 @@ void AliT0PreprocessorOffline::CalibOffsetChannels(TString filePhysName, Int_t u
   if (!entry4) AliFatal("LHC clock-phase shift is not found in OCDB !");
   AliLHCClockPhase *phase = (AliLHCClockPhase*)entry4->GetObject();
   Float_t fGRPdelays = l1Delay - phase->GetMeanPhase();
+
   AliCDBEntry *entryL = AliCDBManager::Instance()->Get("T0/Calib/Latency");
+  if (!entryL) AliFatal(" T0 Latency is not found in OCDB !");
   AliT0CalibLatency *lat = (AliT0CalibLatency*)entryL->GetObject();
   Float_t fLatencyHPTDC = lat->GetLatencyHPTDC();
   Float_t fLatencyL1 = lat->GetLatencyL1();
+
   AliCDBEntry *entryCalib = AliCDBManager::Instance()->Get("T0/Calib/TimeDelay");
   if(!entryCalib) {
     AliWarning(Form("Cannot find any AliCDBEntry for [Calib, TimeDelay]!"));
index d3148e9..92250e3 100644 (file)
@@ -1,38 +1,81 @@
 void MakeT0RecoParam(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity(), AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kHighMult)
+//void MakeT0RecoParam(Int_t startRun = 122000, Int_t endRun = 126437, AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kHighMult)
 {
   // Create T0 Calibration Object for Ideal calibration and
   // write it on CDB
   AliCDBManager *man = AliCDBManager::Instance();
-  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  //  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+   man->SetDefaultStorage("local:///home/alla/alice/Feb11/TestCDB");
   man->SetRun(startRun);
-
+  
   TObjArray *recoParamArray = new TObjArray();
   AliT0RecoParam* t0RecoParam;
 
   t0RecoParam = AliT0RecoParam::GetHighFluxParam();
   t0RecoParam->SetEventSpecie(AliRecoParam::kHighMult);
-  // t0RecoParam->Dump();
-  cout<<" t0RecoParam->GetEventSpecie "<< t0RecoParam->GetEventSpecie()<<endl;
-  //  t0RecoParam->Dump();
+   Float_t low[500] , high[500] ;
+   Float_t pos[24] = {2472, 2492, 2501, 2540, 2526, 2525, 2501, 2461, 2556, 2544, 2533, 2487, 
+                     2485, 2502, 2453, 2470, 2520, 2486, 2512, 2523, 2505, 2562, 2533, 2481}; 
+    for (Int_t i=0; i<107; i++)
+      {
+       low[i] = 500;
+       high[i]=50000;
+       if(i>0  && i<13) { low[i] = pos[i-1] - 200; high[i] = pos[i-1] + 200;}
+       if(i>56 && i<69) { low[i] = pos[i-57] - 200.; high[i]=pos[i-57] + 200;}
+       //      if(i<13) { low[i]=pos[i]-500.;high[i]=pos[i]+500.;}
+       //      if(i>56 && i<69) { low[i]=pos[i+13-57]-500.;high[i]=pos[i-57+13]+500.;}
+  }
+
+  // bad PMT
+  t0RecoParam->SetRefPoint(-1);
+  // amplitude range for recontruction
+  low[200]=0.5;
+  high[200]=80;
+  for (Int_t i=0; i<24; i++) t0RecoParam-> SetBadChannels(i,0);
+  
+  for (Int_t i=0; i<500; i++) {
+    t0RecoParam->SetLow(i,low[i]);
+    t0RecoParam->SetHigh(i,high[i]);
+  }
   t0RecoParam->PrintParameters();
   recoParamArray->AddLast(t0RecoParam);
-
-
+  
+  //-----------------------------------------
 
   t0RecoParam = AliT0RecoParam::GetLowFluxParam();
   t0RecoParam->SetEventSpecie(AliRecoParam::kLowMult);
-  cout<<" t0RecoParam->GetEventSpecie "<< t0RecoParam->GetEventSpecie()<<endl;
-  t0RecoParam->SetLow(10,-1000);
+    Float_t low[500], high[500] ;
+    for (Int_t i=0; i<500; i++)
+      {
+       low[i] = 500;
+       high[i]=50000;
+       if(i>0  && i<13) { low[i] = pos[i-1] - 200; high[i] = pos[i-1] + 200;}
+       if(i>56 && i<69) { low[i] = pos[i-57] - 200.; high[i]=pos[i-57] + 200;}
+       //      if(i<13) { low[i]=pos[i]-500.;high[i]=pos[i]+500.;}
+       //      if(i>56 && i<69) { low[i]=pos[i+13-57]-500.;high[i]=pos[i-57+13]+500.;}
+    }
+
+  // bad PMT
+    //  t0RecoParam->SetRefPoint(-1);
+    for (Int_t i=0; i<24; i++) t0RecoParam->SetBadChannels(i,0);
+  t0RecoParam->SetRefPoint(-1);
+  // amplitude range for recontruction
+  low[200]=0.8;
+  high[200]=80;
+  for (Int_t i=0; i<500; i++) {
+    t0RecoParam->SetLow(i,low[i]);
+    t0RecoParam->SetHigh(i,high[i]);
+  }
   t0RecoParam->PrintParameters();
   recoParamArray->AddLast(t0RecoParam);
-
+  //--------------------------------------
   t0RecoParam = AliT0RecoParam::GetLaserTestParam();
   t0RecoParam->SetEventSpecie(AliRecoParam::kCalib);
   // t0RecoParam->Dump();
   cout<<" t0RecoParam->GetEventSpecie "<< t0RecoParam->GetEventSpecie()<<endl;
-  for (Int_t i=98; i<149; i++) {
-    t0RecoParam->SetLow(i,-1000);
-    t0RecoParam->SetHigh(i,1000);
+  for (Int_t i=0; i<107; i++) {
+    t0RecoParam->SetLow(i, 0);
+    t0RecoParam->SetHigh(i, 50000);
   }
   //  t0RecoParam->Dump();
   t0RecoParam->SetRefPoint(1);