bug #98442: commit to trunk changes to STEERBase/AOD/ESD: T0spreads
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Oct 2012 11:59:06 +0000 (11:59 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Oct 2012 11:59:06 +0000 (11:59 +0000)
Pietro Antonioli <antoniol>

STEER/AOD/AliAODEvent.h
STEER/ESD/AliESDEvent.h
STEER/STEERBase/AliPIDResponse.cxx
STEER/STEERBase/AliPIDResponse.h
STEER/STEERBase/AliVEvent.h

index c1834af..6cfed74 100644 (file)
@@ -135,6 +135,7 @@ class AliAODEvent : public AliVEvent {
   const AliTOFHeader *GetTOFHeader() const {return fTOFHeader;}
   Float_t GetEventTimeSpread() const {if (fTOFHeader) return fTOFHeader->GetT0spread(); else return 0.;}
   Float_t GetTOFTimeResolution() const {if (fTOFHeader) return fTOFHeader->GetTOFResolution(); else return 0.;}
+  Float_t GetT0spread(Int_t i) const {return fHeader->GetT0spread(i);}
 
 
   // -- Tracks
index b920294..e9b62a1 100644 (file)
@@ -171,7 +171,8 @@ public:
   Bool_t      IsUniformBMap()                     const  {return fESDRun?fESDRun->TestBit(AliESDRun::kUniformBMap):kFALSE;}
   //
   Bool_t      InitMagneticField()                 const  {return fESDRun?fESDRun->InitMagneticField():kFALSE;} 
-  void      SetT0spread(Float_t *t)               const  {if(fESDRun) fESDRun->SetT0spread(t);} 
+  void        SetT0spread(Float_t *t)             const  {if(fESDRun) fESDRun->SetT0spread(t);} 
+  Float_t     GetT0spread(Int_t i)                const  {return fESDRun?fESDRun->GetT0spread(i):0;}
   virtual void      SetVZEROEqFactors(Float_t factors[64]) const {if(fESDRun) fESDRun->SetVZEROEqFactors(factors);}
   // HEADER
   AliESDHeader* GetHeader() const {return fHeader;}
index becd291..2b18810 100644 (file)
@@ -68,6 +68,9 @@ fRecoPass(0),
 fRecoPassUser(-1),
 fRun(0),
 fOldRun(0),
+fResT0A(75.),
+fResT0C(65.),
+fResT0AC(55.),
 fArrPidResponseMaster(NULL),
 fResolutionCorrection(NULL),
 fOADBvoltageMaps(NULL),
@@ -121,6 +124,9 @@ fRecoPass(0),
 fRecoPassUser(other.fRecoPassUser),
 fRun(0),
 fOldRun(0),
+fResT0A(75.),
+fResT0C(65.),
+fResT0AC(55.),
 fArrPidResponseMaster(NULL),
 fResolutionCorrection(NULL),
 fOADBvoltageMaps(NULL),
@@ -165,6 +171,9 @@ AliPIDResponse& AliPIDResponse::operator=(const AliPIDResponse &other)
     fRecoPassUser=other.fRecoPassUser;
     fRun=0;
     fOldRun=0;
+    fResT0A=75.;
+    fResT0C=65.;
+    fResT0AC=55.;
     fArrPidResponseMaster=NULL;
     fResolutionCorrection=NULL;
     fOADBvoltageMaps=NULL;
@@ -713,6 +722,7 @@ void AliPIDResponse::InitialiseEvent(AliVEvent *event, Int_t pass, Int_t run)
   //
   fRecoPass=pass;
   
+
   fCurrentEvent=NULL;
   if (!event) return;
   fCurrentEvent=event;
@@ -1165,6 +1175,24 @@ void AliPIDResponse::InitializeTOFResponse(){
   }
   fTOFResponse.SetTimeResolution(fTOFPIDParams->GetTOFresolution());
 
+  AliInfo("TZERO resolution loaded from ESDrun/AODheader");
+  Float_t t0Spread[4];
+  for (Int_t i=0;i<4;i++) t0Spread[i]=fCurrentEvent->GetT0spread(i);
+  AliInfo(Form("  TZERO spreads from data: (A+C)/2 %f A %f C %f (A'-C')/2: %f",t0Spread[0],t0Spread[1],t0Spread[2],t0Spread[3]));
+  Float_t a = t0Spread[1]*t0Spread[1]-t0Spread[0]*t0Spread[0]+t0Spread[3]*t0Spread[3];
+  Float_t c = t0Spread[2]*t0Spread[2]-t0Spread[0]*t0Spread[0]+t0Spread[3]*t0Spread[3];
+  if ( (t0Spread[0] > 50. && t0Spread[0] < 400.) && (a > 0.) && (c>0.)) {
+    fResT0AC=t0Spread[3];
+    fResT0A=TMath::Sqrt(a);
+    fResT0C=TMath::Sqrt(c);
+  } else {
+    AliInfo("  TZERO spreads not present or inconsistent, loading default");
+    fResT0A=75.;
+    fResT0C=65.;
+    fResT0AC=55.;
+  }
+  AliInfo(Form("  TZERO resolution set to: T0A: %f [ps] T0C: %f [ps] T0AC %f [ps]",fResT0A,fResT0C,fResT0AC));
+
 }
 
 
@@ -1298,7 +1326,9 @@ void AliPIDResponse::SetTOFResponse(AliVEvent *vevent,EStartTimeType_t option){
       startTimeMask[i] = 0;
     }
 
-    Float_t resT0A=75,resT0C=65,resT0AC=55;
+    Float_t resT0A=fResT0A;
+    Float_t resT0C=fResT0C;
+    Float_t resT0AC=fResT0AC;
     if(vevent->GetT0TOF()){ // check if T0 detector information is available
        flagT0T0=kTRUE;
     }
index f0fadd3..13b45cf 100644 (file)
@@ -156,6 +156,9 @@ private:
   Int_t   fRecoPassUser;               //  reconstruction pass explicitly set by the user
   Int_t   fRun;                        //! current run number
   Int_t   fOldRun;                     //! current run number
+  Float_t fResT0A;                     //! T0A resolution in current run
+  Float_t fResT0C;                     //! T0C resolution in current run
+  Float_t fResT0AC;                    //! T0A.and.T0C resolution in current run
   
   TObjArray *fArrPidResponseMaster;    //!  TPC pid splines
   TF1       *fResolutionCorrection;    //! TPC resolution correction
@@ -204,7 +207,7 @@ private:
   //
   void SetRecoInfo();
   
-  ClassDef(AliPIDResponse, 9);  //PID response handling
+  ClassDef(AliPIDResponse, 10);  //PID response handling
 };
 
 #endif
index f7dfc19..6692917 100644 (file)
@@ -148,6 +148,7 @@ public:
   virtual Float_t GetTOFTimeResolution() const {return 0.;}
   virtual Double32_t GetT0TOF(Int_t icase) const {return 0.0*icase;}
   virtual const Double32_t * GetT0TOF() const {return NULL;}
+  virtual Float_t GetT0spread(Int_t /*i*/) const {return 0.;}
 
   // Calorimeter Clusters/Cells
   virtual AliVCluster *GetCaloCluster(Int_t)   const {return 0;}