Corrected recommit of rev. 63120
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Jun 2013 21:21:15 +0000 (21:21 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Jun 2013 21:21:15 +0000 (21:21 +0000)
15 files changed:
ANALYSIS/AliAnalysisTaskESDfilter.cxx
OADB/COMMON/PID/data/TPCPIDResponse.root
STEER/AOD/AliAODEvent.h
STEER/AOD/AliAODHeader.cxx
STEER/AOD/AliAODHeader.h
STEER/AOD/AliAODPid.cxx
STEER/AOD/AliAODPid.h
STEER/AOD/AliAODTrack.h
STEER/ESD/AliESDEvent.h
STEER/ESD/AliESDtrack.h
STEER/STEERBase/AliPIDResponse.cxx
STEER/STEERBase/AliTPCPIDResponse.cxx
STEER/STEERBase/AliTPCPIDResponse.h
STEER/STEERBase/AliVEvent.h
STEER/STEERBase/AliVTrack.h

index 803336c..20515a1 100644 (file)
@@ -353,6 +353,7 @@ AliAODHeader* AliAnalysisTaskESDfilter::ConvertHeader(const AliESDEvent& esd)
   
   header->SetRunNumber(esd.GetRunNumber());
   header->SetOfflineTrigger(fInputHandler->IsEventSelected()); // propagate the decision of the physics selection
+  header->SetNumberOfESDTracks(esd.GetNumberOfTracks());
 
   TTree* tree = fInputHandler->GetTree();
   if (tree) {
@@ -2402,12 +2403,14 @@ void AliAnalysisTaskESDfilter::SetDetectorRawSignals(AliAODPid *aodpid, AliESDtr
  return;
  }
  // TPC momentum
- const AliExternalTrackParam *in=track->GetInnerParam();
- if (in) {
-   aodpid->SetTPCmomentum(in->GetP());
- }else{
-   aodpid->SetTPCmomentum(-1.);
- }
+ aodpid->SetTPCmomentum(track->GetTPCmomentum());
+ aodpid->SetTPCTgl(track->GetTPCTgl());
+//  const AliExternalTrackParam *in=track->GetInnerParam();
+//  if (in) {
+//    aodpid->SetTPCmomentum(in->GetP());
+//  }else{
+//    aodpid->SetTPCmomentum(-1.);
+//  }
 
 
  aodpid->SetITSsignal(track->GetITSsignal());
index 4fb42cc..2887788 100644 (file)
Binary files a/OADB/COMMON/PID/data/TPCPIDResponse.root and b/OADB/COMMON/PID/data/TPCPIDResponse.root differ
index a59d0e3..1a867ab 100644 (file)
@@ -132,7 +132,8 @@ class AliAODEvent : public AliVEvent {
   Double_t  GetZDCN2Energy()        const { return fHeader ? fHeader->GetZDCN2Energy() : -999.; }
   Double_t  GetZDCP2Energy()        const { return fHeader ? fHeader->GetZDCP2Energy() : -999.; }
   Double_t  GetZDCEMEnergy(Int_t i) const { return fHeader ? fHeader->GetZDCEMEnergy(i) : -999.; }
-
+  Int_t     GetNumberOfESDTracks()  const { return fHeader ? fHeader->GetNumberOfESDTracks() : 0; }
+  
   void SetTOFHeader(const AliTOFHeader * tofEventTime);
   const AliTOFHeader *GetTOFHeader() const {return fTOFHeader;}
   Float_t GetEventTimeSpread() const {if (fTOFHeader) return fTOFHeader->GetT0spread(); else return 0.;}
index 1c26d0a..ef8bbb3 100644 (file)
@@ -64,6 +64,7 @@ AliAODHeader::AliAODHeader() :
   fOfflineTrigger(0),
   fESDFileName(""),
   fEventNumberESDFile(-1),
+  fNumberESDTracks(-1),
   fL0TriggerInputs(0),
   fL1TriggerInputs(0),
   fL2TriggerInputs(0),
@@ -127,6 +128,7 @@ AliAODHeader::AliAODHeader(Int_t nRun,
   fOfflineTrigger(0),
   fESDFileName(""),
   fEventNumberESDFile(-1),
+  fNumberESDTracks(-1),
   fL0TriggerInputs(0),
   fL1TriggerInputs(0),
   fL2TriggerInputs(0),
@@ -210,6 +212,7 @@ AliAODHeader::AliAODHeader(Int_t nRun,
   fOfflineTrigger(0),
   fESDFileName(""),
   fEventNumberESDFile(-1),
+  fNumberESDTracks(-1),
   fL0TriggerInputs(0),
   fL1TriggerInputs(0),
   fL2TriggerInputs(0),
@@ -279,6 +282,7 @@ AliAODHeader::AliAODHeader(const AliAODHeader& hdr) :
   fOfflineTrigger(hdr.fOfflineTrigger),
   fESDFileName(hdr.fESDFileName),
   fEventNumberESDFile(hdr.fEventNumberESDFile),
+  fNumberESDTracks(hdr.fNumberESDTracks),
   fL0TriggerInputs(hdr.fL0TriggerInputs),
   fL1TriggerInputs(hdr.fL1TriggerInputs),
   fL2TriggerInputs(hdr.fL2TriggerInputs),
@@ -357,6 +361,7 @@ AliAODHeader& AliAODHeader::operator=(const AliAODHeader& hdr)
     fOfflineTrigger   = hdr.fOfflineTrigger;
     fESDFileName      = hdr.fESDFileName;
     fEventNumberESDFile = hdr.fEventNumberESDFile;
+    fNumberESDTracks    = hdr.fNumberESDTracks;
     fL0TriggerInputs    = hdr.fL0TriggerInputs;
     fL1TriggerInputs    = hdr.fL1TriggerInputs;
     fL2TriggerInputs    = hdr.fL2TriggerInputs;
index 99e4f16..90e58e6 100644 (file)
@@ -61,6 +61,7 @@ class AliAODHeader : public AliVHeader {
 
   Int_t     GetRunNumber()          const { return fRunNumber;}
   Int_t     GetEventNumberESDFile() const { return fEventNumberESDFile;}
+  Int_t     GetNumberOfESDTracks()    const { return fNumberESDTracks;}
   UShort_t  GetBunchCrossNumber()   const { return fBunchCrossNumber; }
   UInt_t    GetOrbitNumber()        const { return fOrbitNumber; }
   UInt_t    GetPeriodNumber()       const { return fPeriodNumber; }
@@ -110,6 +111,7 @@ class AliAODHeader : public AliVHeader {
   
   void SetRunNumber(Int_t nRun)                { fRunNumber = nRun; }
   void SetEventNumberESDFile(Int_t n)          { fEventNumberESDFile=n; }
+  void SetNumberOfESDTracks(Int_t n)           { fNumberESDTracks=n; }
   void SetBunchCrossNumber(UShort_t nBx)       { fBunchCrossNumber = nBx; }
   void SetOrbitNumber(UInt_t nOr)              { fOrbitNumber = nOr; }
   void SetPeriodNumber(UInt_t nPer)            { fPeriodNumber = nPer; }
@@ -239,6 +241,7 @@ class AliAODHeader : public AliVHeader {
   UInt_t      fOfflineTrigger;      // fired offline triggers for this event
   TString     fESDFileName;         // ESD file name to which this event belongs
   Int_t       fEventNumberESDFile;  // Event number in ESD file
+  Int_t       fNumberESDTracks;     // Number of tracks in origingal ESD event
   UInt_t      fL0TriggerInputs;     // L0 Trigger Inputs (mask)
   UInt_t      fL1TriggerInputs;     // L1 Trigger Inputs (mask)
   UShort_t    fL2TriggerInputs;     // L2 Trigger Inputs (mask)
@@ -250,7 +253,7 @@ class AliAODHeader : public AliVHeader {
   Float_t     fT0spread[kT0SpreadSize]; // spread of time distributions: (TOA+T0C/2), T0A, T0C, (T0A-T0C)/2
   TBits   fIRInt2InteractionsMap;  // map of the Int2 events (normally 0TVX) near the event, that's Int2Id-EventId in a -90 to 90 window
   TBits   fIRInt1InteractionsMap;  // map of the Int1 events (normally V0A&V0C) near the event, that's Int1Id-EventId in a -90 to 90 window
-  ClassDef(AliAODHeader, 22);
+  ClassDef(AliAODHeader, 23);
 };
 inline
 void AliAODHeader::SetCentrality(const AliCentrality* cent)      { 
index de53e88..0b9d8e1 100644 (file)
@@ -35,6 +35,7 @@ AliAODPid::AliAODPid():
     fTPCsignal(0),
     fTPCsignalN(0),
     fTPCmomentum(0),
+    fTPCTgl(0),
     fTRDnSlices(0),
     fTRDntls(0),
     fTRDslices(0x0),
@@ -70,6 +71,7 @@ AliAODPid::AliAODPid(const AliAODPid& pid) :
   fTPCsignal(pid.fTPCsignal),
   fTPCsignalN(pid.fTPCsignalN),
   fTPCmomentum(pid.fTPCmomentum),
+  fTPCTgl(pid.fTPCTgl),
   fTRDnSlices(pid.fTRDnSlices),
   fTRDntls(pid.fTRDntls),
   fTRDslices(0x0),
@@ -107,6 +109,7 @@ AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
     fTPCsignal   = pid.fTPCsignal;
     fTPCsignalN  = pid.fTPCsignalN;
     fTPCmomentum = pid.fTPCmomentum;
+    fTPCTgl      = pid.fTPCTgl;
 
     fTRDsignal = pid.fTRDsignal;
     if(fTRDnSlices != pid.fTRDnSlices) {
index a167728..9bf4195 100644 (file)
@@ -30,6 +30,7 @@ class AliAODPid : public TObject {
   void      SetTPCsignal(Double_t tpc)                         {fTPCsignal=tpc;}
   void      SetTPCsignalN(UShort_t tpcN)                       {fTPCsignalN=(UChar_t)((tpcN<160)?tpcN:160);}
   void      SetTPCmomentum(Double_t tpcMom)                    {fTPCmomentum=tpcMom;}
+  void      SetTPCTgl(Double_t tpcTgl)                         {fTPCTgl=tpcTgl;}
   void      SetTPCdEdxInfo(AliTPCdEdxInfo * dEdxInfo);
   void      SetTRDslices(Int_t nslices, const Double_t * const trdslices);  
   void      SetTRDsignal(Double_t sig)                         {fTRDsignal = sig;}
@@ -52,6 +53,7 @@ class AliAODPid : public TObject {
   AliTPCdEdxInfo * GetTPCdEdxInfo()const{return fTPCdEdxInfo;}
 
   Double_t  GetTPCmomentum()     const {return  fTPCmomentum;}
+  Double_t  GetTPCTgl()          const {return  fTPCTgl;}
   Int_t     GetTRDnSlices()      const {return  fTRDnSlices/6;}
   Double_t  GetTRDsignal()       const {return  fTRDsignal;}
   Double_t* GetTRDslices()       const {return  fTRDslices;}
@@ -72,7 +74,8 @@ class AliAODPid : public TObject {
   Double32_t  fTPCsignal;        //[0.,0.,10] detector raw signal
   UChar_t     fTPCsignalN;       // number of points used for TPC dE/dx
   Double32_t  fTPCmomentum;      //[0.,0.,20] momentum at the inner wall of TPC;
-
+  Double32_t  fTPCTgl;           //[0.,0.,10] track momentum dip angle at the inner wall of TPC;
+  
   Int_t       fTRDnSlices;       // N slices used for PID in the TRD (as number of slices per tracklet * number of layers)
   UChar_t     fTRDntls;          // number of tracklets used for PID calculation
   UChar_t     fTRDncls[6];       // number of clusters used for dE/dx calculation
@@ -87,7 +90,7 @@ class AliAODPid : public TObject {
  
   AliTPCdEdxInfo * fTPCdEdxInfo; // object containing dE/dx information for different pad regions
 
-  ClassDef(AliAODPid, 14);
+  ClassDef(AliAODPid, 15);
 };
 
 //_____________________________________________________________
index ee210fc..4e99a43 100644 (file)
@@ -296,6 +296,7 @@ class AliAODTrack : public AliVTrack {
   UShort_t  GetTPCsignalN()      const { return fDetPid?fDetPid->GetTPCsignalN():0;    }
   virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;}
   Double_t  GetTPCmomentum()     const { return fDetPid?fDetPid->GetTPCmomentum():0.;  }
+  Double_t  GetTPCTgl()          const { return fDetPid?fDetPid->GetTPCTgl():0.;  }
   Double_t  GetTOFsignal()       const { return fDetPid?fDetPid->GetTOFsignal():0.;    }
   Double_t  GetIntegratedLength() const { return fTrackLength;}
   void      SetIntegratedLength(Double_t l) {fTrackLength = l;}
index ca7557f..68b359f 100644 (file)
@@ -448,6 +448,7 @@ public:
     return (fTrkPileupVertices?fTrkPileupVertices->GetEntriesFast():0);
   }
   Int_t GetNumberOfTracks()     const {return fTracks?fTracks->GetEntriesFast():0;}
+  Int_t GetNumberOfESDTracks()  const { return GetNumberOfTracks(); }
   Int_t GetNumberOfHLTConfMapTracks()     const {return 0;} 
   // fHLTConfMapTracks->GetEntriesFast();}
   Int_t GetNumberOfHLTHoughTracks()     const {return  0;  }
index ab14d4c..147785d 100644 (file)
@@ -231,6 +231,7 @@ public:
   Double_t GetTPCsignalSigma() const {return fTPCsignalS;}
   UShort_t GetTPCsignalN() const {return fTPCsignalN;}
   Double_t GetTPCmomentum() const {return fIp?fIp->GetP():GetP();}
+  Double_t GetTPCTgl()      const {return fIp?fIp->GetTgl():GetTgl();}
   Double_t GetTPCchi2() const {return fTPCchi2;}
   Double_t GetTPCchi2Iter1() const {return fTPCchi2Iter1;}
   UShort_t GetTPCclusters(Int_t *idx) const;
index c380253..15892ae 100644 (file)
@@ -661,6 +661,8 @@ void AliPIDResponse::SetRecoInfo()
     fLHCperiod="LHC10H";
     fMCperiodTPC="LHC10H8";
     if (reg.MatchB(fCurrentFile)) fMCperiodTPC="LHC11A10";
+    // exception for 13d2 and later
+    if (fCurrentAliRootRev >= 62714) fMCperiodTPC="LHC13D2";
     fBeamType="PBPB";
   }
   else if (fRun>=139847&&fRun<=146974) { fLHCperiod="LHC11A"; fMCperiodTPC="LHC10F6A"; }
@@ -1274,10 +1276,11 @@ void AliPIDResponse::SetTPCParametrisation()
   //
   // Setup multiplicity correction
   //
-  if (fUseTPCMultiplicityCorrection && (fBeamType.CompareTo("PBPB") == 0 || fBeamType.CompareTo("AA") == 0)) {
+  if (fUseTPCMultiplicityCorrection && !(fBeamType.CompareTo("PP") == 0)) {
     AliInfo("Multiplicity correction enabled!");
     
     //TODO After testing, load parameters from outside       
+    /*TODO now correction for MC
     if (period.Contains("LHC11A10"))  {//LHC11A10A
       AliInfo("Using multiplicity correction parameters for 11a10!");
       fTPCResponse.SetParameterMultiplicityCorrection(0, 6.90133e-06);
@@ -1295,6 +1298,42 @@ void AliPIDResponse::SetTPCParametrisation()
       fTPCResponse.SetParameterMultiplicitySigmaCorrection(2, -6.36337e-01);
       fTPCResponse.SetParameterMultiplicitySigmaCorrection(3, 1.13479e-02);
     }
+    else*/ if (period.Contains("LHC13B") || period.Contains("LHC13C") || period.Contains("LHC13D") || period.Contains("LHC13E") || 
+             period.Contains("LHC13F"))  {// 2013 pPb data taking
+      AliInfo("Using multiplicity correction parameters for 13b.pass2!");
+      
+      fTPCResponse.SetParameterMultiplicityCorrection(0, -5.906e-06);
+      fTPCResponse.SetParameterMultiplicityCorrection(1, -5.064e-04);
+      fTPCResponse.SetParameterMultiplicityCorrection(2, -3.521e-02);
+      fTPCResponse.SetParameterMultiplicityCorrection(3, 2.469e-02);
+      fTPCResponse.SetParameterMultiplicityCorrection(4, 0);
+      
+      fTPCResponse.SetParameterMultiplicityCorrectionTanTheta(0, -5.32e-06);
+      fTPCResponse.SetParameterMultiplicityCorrectionTanTheta(1, 1.177e-05);
+      fTPCResponse.SetParameterMultiplicityCorrectionTanTheta(2, -0.5);
+      
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(0, 0.);
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(1, 0.);
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(2, 0.);
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(3, 0.);
+      
+      /* Not too bad, but far from perfect in the details
+      fTPCResponse.SetParameterMultiplicityCorrection(0, -6.27187e-06);
+      fTPCResponse.SetParameterMultiplicityCorrection(1, -4.60649e-04);
+      fTPCResponse.SetParameterMultiplicityCorrection(2, -4.26450e-02);
+      fTPCResponse.SetParameterMultiplicityCorrection(3, 2.40590e-02);
+      fTPCResponse.SetParameterMultiplicityCorrection(4, 0);
+      
+      fTPCResponse.SetParameterMultiplicityCorrectionTanTheta(0, -5.338e-06);
+      fTPCResponse.SetParameterMultiplicityCorrectionTanTheta(1, 1.220e-05);
+      fTPCResponse.SetParameterMultiplicityCorrectionTanTheta(2, -0.5);
+      
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(0, 7.89237e-05);
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(1, -1.30662e-02);
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(2, 8.91548e-01);
+      fTPCResponse.SetParameterMultiplicitySigmaCorrection(3, 1.47931e-02);
+      */
+    }
     else if (period.Contains("LHC10H") && recopass == 2) {    
       AliInfo("Using multiplicity correction parameters for 10h.pass2!");
       fTPCResponse.SetParameterMultiplicityCorrection(0, 3.21636e-07);
@@ -1327,7 +1366,7 @@ void AliPIDResponse::SetTPCParametrisation()
     // the multiplicity correction is explicitely enabled in such expert calls.
     
     AliInfo(Form("Multiplicity correction %sdisabled (%s)!", fUseTPCMultiplicityCorrection ? "automatically " : "",
-                 fUseTPCMultiplicityCorrection ? "no PbPb or AA" : "requested by user"));
+                 fUseTPCMultiplicityCorrection ? "pp collisions" : "requested by user"));
     
     fUseTPCMultiplicityCorrection = kFALSE;
     fTPCResponse.ResetMultiplicityCorrectionFunctions();
index 367d8cc..988752e 100644 (file)
@@ -414,13 +414,13 @@ Double_t AliTPCPIDResponse::GetExpectedSignal(const AliVTrack* track,
   Double_t corrFactorMultiplicity = 1.0;
   
   if (correctEta) {
-    corrFactorEta = GetEtaCorrection(track, dEdxSplines);
+    corrFactorEta = GetEtaCorrectionFast(track, dEdxSplines);
     //TODO Alternatively take current track dEdx
-    //corrFactorEta = GetEtaCorrection(track, dEdx);
+    //corrFactorEta = GetEtaCorrectionFast(track, dEdx);
   }
   
   if (correctMultiplicity)
-    corrFactorMultiplicity = GetMultiplicityCorrection(track, dEdxSplines * corrFactorEta, fCurrentEventMultiplicity);
+    corrFactorMultiplicity = GetMultiplicityCorrectionFast(track, dEdxSplines * corrFactorEta, fCurrentEventMultiplicity);
 
   return dEdxSplines * corrFactorEta * corrFactorMultiplicity;
 }
@@ -547,15 +547,15 @@ Double_t AliTPCPIDResponse::GetExpectedSigma(const AliVTrack* track,
     
   if (nPoints > 0) {
     // Use eta correction (+ eta-dependent sigma)
-    Double_t sigmaPar1 = GetSigmaPar1(track, species, dEdx, responseFunction);
+    Double_t sigmaPar1 = GetSigmaPar1Fast(track, species, dEdx, responseFunction);
     
     if (correctMultiplicity) {
       // In addition, take into account multiplicity dependence of mean and sigma of dEdx
       Double_t dEdxExpectedEtaCorrected = GetExpectedSignal(track, species, dEdx, responseFunction, kTRUE, kFALSE);
       
       // GetMultiplicityCorrection and GetMultiplicitySigmaCorrection both need the eta corrected dEdxExpected
-      Double_t multiplicityCorrFactor = GetMultiplicityCorrection(track, dEdxExpectedEtaCorrected, fCurrentEventMultiplicity);
-      Double_t multiplicitySigmaCorrFactor = GetMultiplicitySigmaCorrection(dEdxExpectedEtaCorrected, fCurrentEventMultiplicity);
+      Double_t multiplicityCorrFactor = GetMultiplicityCorrectionFast(track, dEdxExpectedEtaCorrected, fCurrentEventMultiplicity);
+      Double_t multiplicitySigmaCorrFactor = GetMultiplicitySigmaCorrectionFast(dEdxExpectedEtaCorrected, fCurrentEventMultiplicity);
       
       // multiplicityCorrFactor to correct dEdxExpected for multiplicity. In addition: Correction factor for sigma
       return (dEdxExpectedEtaCorrected * multiplicityCorrFactor) 
@@ -757,8 +757,9 @@ Bool_t AliTPCPIDResponse::ResponseFunctiondEdxN( const AliVTrack* track,
 
 
 //_________________________________________________________________________
-Double_t AliTPCPIDResponse::GetEtaCorrection(const AliVTrack *track, Double_t dEdxSplines) const
+Double_t AliTPCPIDResponse::GetEtaCorrectionFast(const AliVTrack *track, Double_t dEdxSplines) const
 {
+  // NOTE: For expert use only -> Non-experts are advised to use the function without the "Fast" suffix or stick to AliPIDResponse directly.
   //
   // Get eta correction for the given parameters.
   //
@@ -811,9 +812,9 @@ Double_t AliTPCPIDResponse::GetEtaCorrection(const AliVTrack *track, AliPID::EPa
   Double_t dEdxSplines = GetExpectedSignal(track, species, dEdx, responseFunction, kFALSE, kFALSE);
   
   //TODO Alternatively take current track dEdx
-  //return GetEtaCorrection(track, dEdx);
+  //return GetEtaCorrectionFast(track, dEdx);
   
-  return GetEtaCorrection(track, dEdxSplines);
+  return GetEtaCorrectionFast(track, dEdxSplines);
 }
 
 
@@ -848,10 +849,10 @@ Double_t AliTPCPIDResponse::GetEtaCorrectedTrackdEdx(const AliVTrack *track, Ali
   if (species < AliPID::kUnknown) {
     // For the eta correction, do NOT take the multiplicity corrected value of dEdx
     Double_t dEdxSplines = GetExpectedSignal(track, species, dEdx, responseFunction, kFALSE, kFALSE);
-    etaCorr = GetEtaCorrection(track, dEdxSplines);
+    etaCorr = GetEtaCorrectionFast(track, dEdxSplines);
   }
   else {
-    etaCorr = GetEtaCorrection(track, dEdx);
+    etaCorr = GetEtaCorrectionFast(track, dEdx);
   }
     
   if (etaCorr <= 0)
@@ -862,8 +863,10 @@ Double_t AliTPCPIDResponse::GetEtaCorrectedTrackdEdx(const AliVTrack *track, Ali
 
 
 //_________________________________________________________________________
-Double_t AliTPCPIDResponse::GetSigmaPar1(const AliVTrack *track, AliPID::EParticleType species, Double_t dEdx, const TSpline3* responseFunction) const
+Double_t AliTPCPIDResponse::GetSigmaPar1Fast(const AliVTrack *track, AliPID::EParticleType species, Double_t dEdx,
+                                             const TSpline3* responseFunction) const
 {
+  // NOTE: For expert use only -> Non-experts are advised to use the function without the "Fast" suffix or stick to AliPIDResponse directly.
   //
   // Get parameter 1 of sigma parametrisation of TPC dEdx from the histogram for the given track.
   //
@@ -888,12 +891,7 @@ Double_t AliTPCPIDResponse::GetSigmaPar1(const AliVTrack *track, AliPID::EPartic
   if (dEdxExpected < 1.)
     return 999;
   
-  // For ESD tracks, the local tanTheta could be used (esdTrack->GetInnerParam()->GetTgl()).
-  // However, this value is not available for AODs and, thus, not or AliVTrack.
-  // Fortunately, the following formula allows to approximate the local tanTheta with the 
-  // global theta angle -> This is for by far most of the tracks the same, but gives at
-  // maybe the percent level differences within +- 0.2 in tanTheta -> Which is still ok.
-  Double_t tanTheta = TMath::Tan(-track->Theta() + TMath::Pi() / 2.0);
+  Double_t tanTheta = GetTrackTanTheta(track);
   Int_t binX = fhEtaSigmaPar1->GetXaxis()->FindBin(tanTheta);
   Int_t binY = fhEtaSigmaPar1->GetYaxis()->FindBin(1. / dEdxExpected);
     
@@ -929,7 +927,7 @@ Double_t AliTPCPIDResponse::GetSigmaPar1(const AliVTrack *track, AliPID::EPartic
   if (!ResponseFunctiondEdxN(track, species, dedxSource, dEdx, nPoints, gainScenario, &responseFunction))
     return 999; 
   
-  return GetSigmaPar1(track, species, dEdx, responseFunction);
+  return GetSigmaPar1Fast(track, species, dEdx, responseFunction);
 }
 
 
@@ -996,21 +994,65 @@ Double_t AliTPCPIDResponse::GetTrackTanTheta(const AliVTrack *track) const
   // global theta angle -> This is for by far most of the tracks the same, but gives at
   // maybe the percent level differences within +- 0.2 in tanTheta -> Which is still ok.
   
+  /*
+  const AliExternalTrackParam* innerParam = track->GetInnerParam();
+  Double_t tanTheta = 0;
+  if (innerParam) 
+    tanTheta = innerParam->GetTgl();
+  else
+    tanTheta = TMath::Tan(-track->Theta() + TMath::Pi() / 2.0);
+  
+  // Constant in formula for B in kGauss (factor 0.1 to convert B from Tesla to kGauss),
+  // pT in GeV/c (factor c*1e-9 to arrive at GeV/c) and curvature in 1/cm (factor 0.01 to get from m to cm)
+  const Double_t constant = TMath::C()* 1e-9 * 0.1 * 0.01; 
+  const Double_t curvature = fMagField * constant / track->Pt(); // in 1./cm
+  
+  Double_t averageddzdr = 0.;
+  Int_t nParts = 0;
+
+  for (Double_t r = 85; r < 245; r++) {
+    Double_t sinPhiLocal = TMath::Abs(r*curvature*0.5);
+    
+    // Cut on |sin(phi)| as during reco
+    if (TMath::Abs(sinPhiLocal) <= 0.95) {
+      const Double_t phiLocal = TMath::ASin(sinPhiLocal);
+      const Double_t tanPhiLocal = TMath::Tan(phiLocal);
+      
+      averageddzdr += tanTheta * TMath::Sqrt(1. + tanPhiLocal * tanPhiLocal); 
+      nParts++;
+    }
+  }
+  
+  if (nParts > 0)
+    averageddzdr /= nParts; 
+  else {
+    AliError("Problems during determination of dz/dr. Returning pure tanTheta as best estimate!");
+    return tanTheta;
+  }
+  
+  //printf("pT: %f\nFactor/magField(kGs)/curvature^-1: %f / %f /%f\ntanThetaGlobalFromTheta/tanTheta/Averageddzdr: %f / %f / %f\n\n",
+  //          track->Pt(), constant, fMagField, 1./curvature, TMath::Tan(-track->Theta() + TMath::Pi() / 2.0), tanTheta, averageddzdr);
+  
+  return averageddzdr;
+  */
+  
   
   // Alternatively (in average, the effect is found to be negligable!):
   // Take local tanTheta from TPC inner wall, if available (currently only for ESDs available)
-  /*const AliExternalTrackParam* innerParam = track->GetInnerParam();
-  if (innerParam) {
-    return innerParam->GetTgl();
-  }*/
+  //const AliExternalTrackParam* innerParam = track->GetInnerParam();
+  //if (innerParam) {
+  //  return innerParam->GetTgl();
+  //}
   
   return TMath::Tan(-track->Theta() + TMath::Pi() / 2.0);
 }
 
 
 //_________________________________________________________________________
-Double_t AliTPCPIDResponse::GetMultiplicityCorrection(const AliVTrack *track, const Double_t dEdxExpected, const Int_t multiplicity) const
+Double_t AliTPCPIDResponse::GetMultiplicityCorrectionFast(const AliVTrack *track, const Double_t dEdxExpected, const Int_t multiplicity) const
 {
+  // NOTE: For expert use only -> Non-experts are advised to use the function without the "Fast" suffix or stick to AliPIDResponse directly.
+  //
   // Calculate the multiplicity correction factor for this track for the given multiplicity.
   // The parameter dEdxExpected should take into account the eta correction already!
   
@@ -1055,7 +1097,7 @@ Double_t AliTPCPIDResponse::GetMultiplicityCorrection(const AliVTrack *track, Al
   // To get the expected signal to determine the multiplicity correction, do NOT ask for the multiplicity corrected value (of course)
   Double_t dEdxExpected = GetExpectedSignal(track, species, dEdx, responseFunction, kTRUE, kFALSE);
   
-  return GetMultiplicityCorrection(track, dEdxExpected, fCurrentEventMultiplicity);
+  return GetMultiplicityCorrectionFast(track, dEdxExpected, fCurrentEventMultiplicity);
 }
 
 
@@ -1099,12 +1141,12 @@ Double_t AliTPCPIDResponse::GetMultiplicityCorrectedTrackdEdx(const AliVTrack *t
     // To get the expected signal to determine the multiplicity correction, do NOT ask for the multiplicity corrected value (of course).
     // However, one needs the eta corrected value!
     Double_t dEdxSplines = GetExpectedSignal(track, species, dEdx, responseFunction, kTRUE, kFALSE);
-    multiplicityCorr = GetMultiplicityCorrection(track, dEdxSplines, fCurrentEventMultiplicity);
+    multiplicityCorr = GetMultiplicityCorrectionFast(track, dEdxSplines, fCurrentEventMultiplicity);
   }
   else {
     // One needs the eta corrected value to determine the multiplicity correction factor!
-    Double_t etaCorr = GetEtaCorrection(track, dEdx);
-    multiplicityCorr = GetMultiplicityCorrection(track, dEdx * etaCorr, fCurrentEventMultiplicity);
+    Double_t etaCorr = GetEtaCorrectionFast(track, dEdx);
+    multiplicityCorr = GetMultiplicityCorrectionFast(track, dEdx * etaCorr, fCurrentEventMultiplicity);
   }
     
   if (multiplicityCorr <= 0)
@@ -1147,12 +1189,12 @@ Double_t AliTPCPIDResponse::GetEtaAndMultiplicityCorrectedTrackdEdx(const AliVTr
   if (species < AliPID::kUnknown) {
     // To get the expected signal to determine the multiplicity correction, do NOT ask for the multiplicity corrected value (of course)
     Double_t dEdxSplines = GetExpectedSignal(track, species, dEdx, responseFunction, kFALSE, kFALSE);
-    etaCorr = GetEtaCorrection(track, dEdxSplines);
-    multiplicityCorr = GetMultiplicityCorrection(track, dEdxSplines * etaCorr, fCurrentEventMultiplicity);
+    etaCorr = GetEtaCorrectionFast(track, dEdxSplines);
+    multiplicityCorr = GetMultiplicityCorrectionFast(track, dEdxSplines * etaCorr, fCurrentEventMultiplicity);
   }
   else {
-    etaCorr = GetEtaCorrection(track, dEdx);
-    multiplicityCorr = GetMultiplicityCorrection(track, dEdx * etaCorr, fCurrentEventMultiplicity);
+    etaCorr = GetEtaCorrectionFast(track, dEdx);
+    multiplicityCorr = GetMultiplicityCorrectionFast(track, dEdx * etaCorr, fCurrentEventMultiplicity);
   }
     
   if (multiplicityCorr <= 0 || etaCorr <= 0)
@@ -1163,8 +1205,10 @@ Double_t AliTPCPIDResponse::GetEtaAndMultiplicityCorrectedTrackdEdx(const AliVTr
 
 
 //_________________________________________________________________________
-Double_t AliTPCPIDResponse::GetMultiplicitySigmaCorrection(const Double_t dEdxExpected, const Int_t multiplicity) const
+Double_t AliTPCPIDResponse::GetMultiplicitySigmaCorrectionFast(const Double_t dEdxExpected, const Int_t multiplicity) const
 {
+  // NOTE: For expert use only -> Non-experts are advised to use the function without the "Fast" suffix or stick to AliPIDResponse directly.
+  //
   // Calculate the multiplicity sigma correction factor for the corresponding expected dEdx and for the given multiplicity.
   // The parameter dEdxExpected should take into account the eta correction already!
   
@@ -1206,7 +1250,7 @@ Double_t AliTPCPIDResponse::GetMultiplicitySigmaCorrection(const AliVTrack *trac
   // To get the expected signal to determine the multiplicity correction, do NOT ask for the multiplicity corrected value (of course)
   Double_t dEdxExpected = GetExpectedSignal(track, species, dEdx, responseFunction, kTRUE, kFALSE);
   
-  return GetMultiplicitySigmaCorrection(dEdxExpected, fCurrentEventMultiplicity);
+  return GetMultiplicitySigmaCorrectionFast(dEdxExpected, fCurrentEventMultiplicity);
 }
 
 
index 9bf2639..a03acc1 100644 (file)
@@ -120,14 +120,25 @@ public:
   void SetCurrentEventMultiplicity(Int_t value) { fCurrentEventMultiplicity = value;  };
   Int_t GetCurrentEventMultiplicity() const { return fCurrentEventMultiplicity; };
 
-  Double_t GetMultiplicityCorrection(const AliVTrack *track, AliPID::EParticleType species, ETPCdEdxSource dedxSource) const;
+  Double_t GetMultiplicityCorrection(const AliVTrack *track, AliPID::EParticleType species, ETPCdEdxSource dedxSource = kdEdxDefault) const;
   
-  Double_t GetMultiplicitySigmaCorrection(const AliVTrack *track, AliPID::EParticleType species, ETPCdEdxSource dedxSource) const;
+  Double_t GetMultiplicitySigmaCorrection(const AliVTrack *track, AliPID::EParticleType species, ETPCdEdxSource dedxSource = kdEdxDefault) const;
 
   Double_t GetMultiplicityCorrectedTrackdEdx(const AliVTrack *track, AliPID::EParticleType species, ETPCdEdxSource dedxSource = kdEdxDefault) const;
   
   Double_t GetEtaAndMultiplicityCorrectedTrackdEdx(const AliVTrack *track, AliPID::EParticleType species,
                                                    ETPCdEdxSource dedxSource = kdEdxDefault) const;
+  
+  // Fast functions for expert use only
+  Double_t GetEtaCorrectionFast(const AliVTrack *track, Double_t dEdxSplines) const;
+  
+  Double_t GetMultiplicityCorrectionFast(const AliVTrack *track, const Double_t dEdxExpected, const Int_t multiplicity) const;
+  
+  Double_t GetMultiplicitySigmaCorrectionFast(const Double_t dEdxExpected, const Int_t multiplicity) const;
+  
+  Double_t GetSigmaPar1Fast(const AliVTrack *track, AliPID::EParticleType species,
+                            Double_t dEdx, const TSpline3* responseFunction) const;
+  
   //NEW
   void SetSigma(Float_t res0, Float_t resN2, ETPCgainScenario gainScenario );
   Double_t GetExpectedSignal( const AliVTrack* track,
@@ -221,15 +232,6 @@ protected:
                             const TSpline3* responseFunction,
                             Bool_t correctEta,
                             Bool_t correctMultiplicity) const;
-                             
-  Double_t GetEtaCorrection(const AliVTrack *track, Double_t dEdxSplines) const;
-  
-  Double_t GetMultiplicityCorrection(const AliVTrack *track, const Double_t dEdxExpected, const Int_t multiplicity) const;
-  
-  Double_t GetMultiplicitySigmaCorrection(const Double_t dEdxExpected, const Int_t multiplicity) const;
-  
-  Double_t GetSigmaPar1(const AliVTrack *track, AliPID::EParticleType species,
-                        Double_t dEdx, const TSpline3* responseFunction) const;
   
 private:
   Float_t fMIP;          // dEdx for MIP
index fa14f83..0cfe3fc 100644 (file)
@@ -194,6 +194,8 @@ public:
   virtual Int_t GetNumberOfTrdTracks() const { return 0; }
   virtual AliVTrdTrack* GetTrdTrack(Int_t /* iTrack */) const { return 0x0; }
 
+  virtual Int_t     GetNumberOfESDTracks()  const { return 0; }
+
   ClassDef(AliVEvent,2)  // base class for AliEvent data
 };
 #endif 
index e654f92..79ead13 100644 (file)
@@ -108,6 +108,7 @@ public:
   virtual Double_t  GetTPCsignalTunedOnData() const {return 0.;}
   virtual UShort_t  GetTPCsignalN()      const {return 0 ;}
   virtual Double_t  GetTPCmomentum()     const {return 0.;}
+  virtual Double_t  GetTPCTgl()          const {return 0.;}
   virtual Double_t  GetTOFsignal()       const {return 0.;}
   virtual Double_t  GetTOFsignalTunedOnData() const {return 0.;}
   virtual Double_t  GetHMPIDsignal()     const {return 0.;}