]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
o Add temporary fix for the geometry problem in 10d (Pietro)
authorwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 11:54:01 +0000 (11:54 +0000)
committerwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 11:54:01 +0000 (11:54 +0000)
ANALYSIS/TenderSupplies/AliTOFTenderSupply.cxx
ANALYSIS/TenderSupplies/AliTOFTenderSupply.h

index d2de04aeda1a7954858bb1f0be3d76143473634e..d0b8b8ca88a54df182873681768920cd29eb91e5 100644 (file)
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-// TOF tender: reapply TOF pid on the fly                                    //
+// TOF tender: 
+//             load updated calibration if needed
+//             reapply TOF pid on the fly                                    //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 #include <AliLog.h>
 #include <AliESDEvent.h>
+#include <AliESDtrack.h>
 #include <AliESDInputHandler.h>
 #include <AliAnalysisManager.h>
 #include <AliESDpid.h>
@@ -42,6 +45,7 @@ AliTOFTenderSupply::AliTOFTenderSupply() :
   fApplyT0(kFALSE),
   fTimeZeroType(3),
   fCorrectExpTimes(kTRUE),
+  fLHC10dPatch(kFALSE),
   fTOFCalib(0x0),
   fTOFT0maker(0x0),
   fTOFres(100.)
@@ -66,6 +70,7 @@ AliTOFTenderSupply::AliTOFTenderSupply(const char *name, const AliTender *tender
   fApplyT0(kFALSE),
   fTimeZeroType(3),
   fCorrectExpTimes(kTRUE),
+  fLHC10dPatch(kFALSE),
   fTOFCalib(0x0),
   fTOFT0maker(0x0),
   fTOFres(100.) 
@@ -157,7 +162,9 @@ void AliTOFTenderSupply::ProcessEvent()
     }
   }
   fTOFCalib->CalibrateESD(event);
-  
+
+  if (fLHC10dPatch) RecomputeTExp(event);
+
   if(fIsMC){
     Float_t t0true = fTOFT0maker->TuneForMC(event);
     
@@ -207,4 +214,52 @@ void AliTOFTenderSupply::ProcessEvent()
 }
 
 
+//_____________________________________________________
+void AliTOFTenderSupply::RecomputeTExp(AliESDEvent *event) const
+{
+  /*
+   * calibrate TExp
+   */
+
+  
+  /* loop over tracks */
+  AliESDtrack *track = NULL;
+  for (Int_t itrk = 0; itrk < event->GetNumberOfTracks(); itrk++) {
+    /* get track and calibrate */
+    track = event->GetTrack(itrk);
+    RecomputeTExp(track);
+  }
+  
+}
+
+//_____________________________________________________
+void AliTOFTenderSupply::RecomputeTExp(AliESDtrack *track) const
+{
+  /*** 
+       THIS METHOD IS BASED ON THEORETICAL EXPECTED TIME COMPUTED
+       USING AVERAGE MOMENTUM BETWEEN INNER/OUTER TRACK PARAMS 
+       IT IS A ROUGH APPROXIMATION APPLIED TO FIX LHC10d-pass2 DATA
+       WHERE A WRONG GEOMETRY (FULL TRD) WAS INSERTED
+  ***/
+
+  Double_t texp[AliPID::kSPECIES];
+  if (!track || !(track->GetStatus() & AliESDtrack::kTOFout)) return;
 
+
+  /* get track params */
+  Float_t l = track->GetIntegratedLength();
+  Float_t p = track->P();
+  if (track->GetInnerParam() && track->GetOuterParam()) {
+    Float_t pin = track->GetInnerParam()->P();
+    Float_t pout = track->GetOuterParam()->P();
+    p = 0.5 * (pin + pout);
+  }
+  /* loop over particle types and compute expected time */
+  for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++)
+    texp[ipart] = GetExpTimeTh(AliPID::ParticleMass(ipart), p, l) - 37.; 
+  // 37 is a final semiempirical offset to further adjust (calibrations were
+  // done with "standard" integratedTimes)
+  /* set integrated times */
+  track->SetIntegratedTimes(texp);
+
+}
index 0fb1f17f9d638c7a9b5f7022ce6a9e53942f44bc..efff44a646ed1e8864023beec75d56dda3848440 100644 (file)
@@ -6,7 +6,7 @@
 
 ////////////////////////////////////////////////////////////////////////
 //                                                                    //
-//  TPC tender, reapply pid on the fly                                //
+//  TOF tender, reapply pid on the fly                                //
 //                                                                    //
 ////////////////////////////////////////////////////////////////////////
 
@@ -16,7 +16,8 @@
 class AliESDpid;
 class AliTOFcalib;
 class AliTOFT0maker;
-
+class AliESDEevent;
+class AliESDtrack;
 class AliTOFTenderSupply: public AliTenderSupply {
 
 public:
@@ -30,11 +31,25 @@ public:
 
   // TOF method
   void SetTOFres(Float_t res){fTOFres=res;}
-  void SetApplyT0(Bool_t flag=kTRUE){fApplyT0=flag;};
-  void SetCorrectExpTimes(Bool_t flag=kTRUE){fCorrectExpTimes=flag;};
+  void SetApplyT0(Bool_t flag=kTRUE){fApplyT0=flag;}
+  void SetCorrectExpTimes(Bool_t flag=kTRUE){fCorrectExpTimes=flag;}
+  void SetLHC10dPatch(Bool_t flag=kFALSE){ 
+    if (flag == kTRUE) {
+      Print(" **** TOF Tender: special setting LHC10d patch is ON");
+      Print(" **** TOF Tender: this setting is valid only on LHC10d pass2");
+    }
+    fLHC10dPatch=flag;
+    return;
+  }
   
   virtual void SetTimeZeroType(AliESDpid::EStartTimeType_t tofTimeZeroType) {fTimeZeroType = tofTimeZeroType;}
 
+  /* theoretical expected time related stuff for LHC10d patch */
+  static Float_t GetBetaTh(Float_t m, Float_t p) {return TMath::Sqrt(1. / (1. + m * m / (p * p)));}; // get beta th
+  static Float_t GetExpTimeTh(Float_t m, Float_t p, Float_t L) {return L / 2.99792457999999984e-02 / GetBetaTh(m, p);}; // get exp time th
+  void RecomputeTExp(AliESDEvent *event) const;
+  void RecomputeTExp(AliESDtrack *track) const;
+
 private:
   AliESDpid          *fESDpid;         //! ESD pid object
 
@@ -42,6 +57,7 @@ private:
   Bool_t fApplyT0;           // flag to subtract the T0-TOF (deprecated)
   Int_t  fTimeZeroType;      // flag to discriminate the time zero type 
   Bool_t fCorrectExpTimes;   // flag to apply Expected Time correction 
+  Bool_t fLHC10dPatch;       // flag to apply special patch for LHC10d (reconstructed with wrong geometry)
 
   // variables for TOF calibrations
   AliTOFcalib     *fTOFCalib;    //! recalibrate TOF signal with OCDB
@@ -53,9 +69,8 @@ private:
   AliTOFTenderSupply(const AliTOFTenderSupply&c);
   AliTOFTenderSupply& operator= (const AliTOFTenderSupply&c);
 
-  ClassDef(AliTOFTenderSupply, 2);
+  ClassDef(AliTOFTenderSupply, 3);
 };
 
 
 #endif 
-