small improvement on class AliTOFcalibHisto, which adds further external flexibility...
authorrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Sep 2009 12:52:07 +0000 (12:52 +0000)
committerrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Sep 2009 12:52:07 +0000 (12:52 +0000)
TOF/AliTOFPreprocessor.cxx
TOF/AliTOFcalibHisto.cxx
TOF/AliTOFcalibHisto.h

index 2b841a2..5a6387f 100644 (file)
@@ -1171,12 +1171,11 @@ AliTOFPreprocessor::FillWithCosmicCalibration(AliTOFChannelOnlineArray *cal)
   
   /* loop over channel index */
   for (Int_t iIndex = 0; iIndex < fNChannels; iIndex++) {
-    cal->SetDelay(iIndex, calibHisto.GetNominalCorrection(iIndex));
+    cal->SetDelay(iIndex, calibHisto.GetFullCorrection(iIndex));
   }
   
 }
 
-
 //_____________________________________________________________________________
 
 void
index 06e8574..2c4cd36 100644 (file)
@@ -168,6 +168,36 @@ const Float_t AliTOFcalibHisto::fgkInterfaceCardLength[48] = {
 
 //__________________________________________________________________________
 
+Bool_t AliTOFcalibHisto::fgCableCorrectionFlag[kNcorrections] = {
+  kFALSE, // kDDLBCcorr
+  kTRUE, // kAmphenolCableCorr
+  kTRUE, // kFlatCableCorr
+  kTRUE, // kInterfaceCardCorr
+  kFALSE, // kDDLdelayCorr
+  kFALSE, // kHPTDCdelayCorr
+  kFALSE, // kFEAchDelayCorr
+  kFALSE, // kFEAdelayCorr
+  kFALSE, // kTRMdelayCorr
+  kFALSE, // kTimeSlewingCorr
+};
+
+//__________________________________________________________________________
+
+Bool_t AliTOFcalibHisto::fgFullCorrectionFlag[kNcorrections] = {
+  kFALSE, // kDDLBCcorr
+  kTRUE, // kAmphenolCableCorr
+  kTRUE, // kFlatCableCorr
+  kTRUE, // kInterfaceCardCorr
+  kTRUE, // kDDLdelayCorr
+  kTRUE, // kHPTDCdelayCorr
+  kTRUE, // kFEAchDelayCorr
+  kTRUE, // kFEAdelayCorr
+  kTRUE, // kTRMdelayCorr
+  kFALSE, // kTimeSlewingCorr
+};
+
+//__________________________________________________________________________
+
 AliTOFcalibHisto::AliTOFcalibHisto() :
   TObject(),
   fCalibConst(),
@@ -495,3 +525,29 @@ AliTOFcalibHisto::ApplyNominalCorrection(AliESDtrack *track)
   track->SetTOFsignal(time);
 }
 
+//__________________________________________________________________________
+
+Float_t
+AliTOFcalibHisto::GetCableCorrection(Int_t index)
+{
+  /* get cable correction */
+  Float_t corr = 0;
+  for (Int_t iCorr = 0; iCorr < kNcorrections; iCorr++)
+    if (fgCableCorrectionFlag[iCorr])
+      corr += GetCorrection(iCorr, index);
+  return corr;
+}
+
+//__________________________________________________________________________
+
+Float_t
+AliTOFcalibHisto::GetFullCorrection(Int_t index)
+{
+  /* get full correction */
+  Float_t corr = 0;
+  for (Int_t iCorr = 0; iCorr < kNcorrections; iCorr++)
+    if (fgFullCorrectionFlag[iCorr])
+      corr += GetCorrection(iCorr, index);
+  return corr;
+}
+
index b49fb5b..5ad6491 100644 (file)
@@ -109,6 +109,9 @@ public TObject
   static const Float_t fgkFlatCableLength[91]; /* strip flat-cable length */
   static const Float_t fgkInterfaceCardLength[48]; /* interface card length */
 
+  static Bool_t fgCableCorrectionFlag[kNcorrections]; // cable correction flag
+  static Bool_t fgFullCorrectionFlag[kNcorrections]; // full correction flag
+
   TH1F *fCalibConst[kNcalibConsts]; // calib const array
   TH1F *fCalibMap[kNcalibMaps]; // calib map array
   TH1F *fCalibPar[kNcalibPars]; // calib par array
@@ -135,6 +138,8 @@ public TObject
   /* setters */
   static void SetCalibHistoFileName(const Char_t *value) {fgCalibHistoFileName = value;}; /* set calib histo file name */
   static void SetCalibParFileName(const Char_t *value) {fgCalibParFileName = value;}; /* set calib par file name */
+  static void SetCableCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgCableCorrectionFlag[i] = flag;}; // set cable correction flag
+  static void SetFullCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgFullCorrectionFlag[i] = flag;}; // set full correction flag
 
   /* methods */
   static Int_t GetIndexEO(Int_t ddl, Int_t trm, Int_t chain, Int_t tdc, Int_t channel) {return (channel + 8 * tdc + 120 * chain + 240 * trm + 2400 * ddl);}; /* get index EO */
@@ -147,6 +152,9 @@ public TObject
   Float_t GetCorrection(Int_t corr, Int_t index, Float_t tot = 0.); /* get correction */
   Float_t GetNominalCorrection(Int_t index); /* get nominal correction */
   void ApplyNominalCorrection(AliESDtrack *track); /* apply nominal corrections */
+
+  Float_t GetCableCorrection(Int_t index); /* get cable correction */
+  Float_t GetFullCorrection(Int_t index); /* get full correction */
   
   ClassDef(AliTOFcalibHisto, 1);