///////////////////////////////////////////////////////////////////////////////
// //
-// 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>
fApplyT0(kFALSE),
fTimeZeroType(3),
fCorrectExpTimes(kTRUE),
+ fLHC10dPatch(kFALSE),
fTOFCalib(0x0),
fTOFT0maker(0x0),
fTOFres(100.)
fApplyT0(kFALSE),
fTimeZeroType(3),
fCorrectExpTimes(kTRUE),
+ fLHC10dPatch(kFALSE),
fTOFCalib(0x0),
fTOFT0maker(0x0),
fTOFres(100.)
}
}
fTOFCalib->CalibrateESD(event);
-
+
+ if (fLHC10dPatch) RecomputeTExp(event);
+
if(fIsMC){
Float_t t0true = fTOFT0maker->TuneForMC(event);
}
+//_____________________________________________________
+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);
+
+}
////////////////////////////////////////////////////////////////////////
// //
-// TPC tender, reapply pid on the fly //
+// TOF tender, reapply pid on the fly //
// //
////////////////////////////////////////////////////////////////////////
class AliESDpid;
class AliTOFcalib;
class AliTOFT0maker;
-
+class AliESDEevent;
+class AliESDtrack;
class AliTOFTenderSupply: public AliTenderSupply {
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
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
AliTOFTenderSupply(const AliTOFTenderSupply&c);
AliTOFTenderSupply& operator= (const AliTOFTenderSupply&c);
- ClassDef(AliTOFTenderSupply, 2);
+ ClassDef(AliTOFTenderSupply, 3);
};
#endif
-