Information for EMCAL PID (electrons) added. (Jennifer Klay)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Jun 2009 12:06:25 +0000 (12:06 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Jun 2009 12:06:25 +0000 (12:06 +0000)
ANALYSIS/AliAnalysisTaskESDfilter.cxx
ANALYSIS/AliAnalysisTaskESDfilter.h
STEER/AliAODPid.cxx
STEER/AliAODPid.h

index 506be78..cb51a3d 100644 (file)
@@ -396,7 +396,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
            if (esdCascadeBach->GetSign() > 0) nPosTracks++;
            aodTrack->ConvertAliPIDtoAODPID();
            aodTrack->SetFlags(esdCascadeBach->GetStatus());
-            SetAODPID(esdCascadeBach,aodTrack,detpid,timezero);
+            SetAODPID(esdCascadeBach,aodTrack,detpid,timezero,esd->GetMagneticField());
        }
        else {
            aodTrack = dynamic_cast<AliAODTrack*>( aodTrackRefs->At(idxBachFromCascade) );
@@ -475,7 +475,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
                if (esdCascadePos->GetSign() > 0) nPosTracks++;
                aodTrack->ConvertAliPIDtoAODPID();
                aodTrack->SetFlags(esdCascadePos->GetStatus());
-               SetAODPID(esdCascadePos,aodTrack,detpid,timezero);
+               SetAODPID(esdCascadePos,aodTrack,detpid,timezero,esd->GetMagneticField());
                }
                else {
                        aodTrack = dynamic_cast<AliAODTrack*>(aodTrackRefs->At(idxPosFromV0Dghter));
@@ -518,7 +518,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
                if (esdCascadeNeg->GetSign() > 0) nPosTracks++;
                aodTrack->ConvertAliPIDtoAODPID();
                aodTrack->SetFlags(esdCascadeNeg->GetStatus());
-               SetAODPID(esdCascadeNeg,aodTrack,detpid,timezero);
+               SetAODPID(esdCascadeNeg,aodTrack,detpid,timezero,esd->GetMagneticField());
                }
                else {
                        aodTrack = dynamic_cast<AliAODTrack*>(aodTrackRefs->At(idxNegFromV0Dghter));
@@ -732,7 +732,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
            if (esdV0Pos->GetSign() > 0) nPosTracks++;
            aodTrack->ConvertAliPIDtoAODPID();
            aodTrack->SetFlags(esdV0Pos->GetStatus());
-            SetAODPID(esdV0Pos,aodTrack,detpid,timezero);
+            SetAODPID(esdV0Pos,aodTrack,detpid,timezero,esd->GetMagneticField());
        }
        else {
            aodTrack = dynamic_cast<AliAODTrack*>(aodTrackRefs->At(posFromV0));
@@ -773,7 +773,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
            if (esdV0Neg->GetSign() > 0) nPosTracks++;
            aodTrack->ConvertAliPIDtoAODPID();
            aodTrack->SetFlags(esdV0Neg->GetStatus());
-            SetAODPID(esdV0Neg,aodTrack,detpid,timezero);
+            SetAODPID(esdV0Neg,aodTrack,detpid,timezero,esd->GetMagneticField());
        }
        else {
            aodTrack = dynamic_cast<AliAODTrack*>(aodTrackRefs->At(negFromV0));
@@ -905,7 +905,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
                        mother->ConvertAliPIDtoAODPID();
                        primary->AddDaughter(mother);
                        mother->ConvertAliPIDtoAODPID();
-                        SetAODPID(esdTrackM,mother,detpid,timezero);
+                        SetAODPID(esdTrackM,mother,detpid,timezero,esd->GetMagneticField());
                    }
                    else {
 //                     cerr << "Error: event " << esd->GetEventNumberInFile() << " kink " << TMath::Abs(ikink)-1
@@ -962,7 +962,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
                        daughter->ConvertAliPIDtoAODPID();
                        vkink->AddDaughter(daughter);
                        daughter->ConvertAliPIDtoAODPID();
-                       SetAODPID(esdTrackD,daughter,detpid,timezero);
+                       SetAODPID(esdTrackD,daughter,detpid,timezero,esd->GetMagneticField());
                    }
                    else {
 //                     cerr << "Error: event " << esd->GetEventNumberInFile() << " kink " << TMath::Abs(ikink)-1
@@ -1020,7 +1020,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
        if (esdTrack->GetSign() > 0) nPosTracks++;
        aodTrack->SetFlags(esdTrack->GetStatus());
        aodTrack->ConvertAliPIDtoAODPID();
-       SetAODPID(esdTrack,aodTrack,detpid,timezero);
+       SetAODPID(esdTrack,aodTrack,detpid,timezero,esd->GetMagneticField());
     } // end of loop on tracks
     
     // Update number of AOD tracks in header at the end of track loop (M.G.)
@@ -1170,7 +1170,7 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
 }
 
 
-void AliAnalysisTaskESDfilter::SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aodtrack, AliAODPid *detpid, Double_t timezero)
+void AliAnalysisTaskESDfilter::SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aodtrack, AliAODPid *detpid, Double_t timezero, Double_t bfield)
 {
   //
   // Setter for the raw PID detector signals
@@ -1178,7 +1178,7 @@ void AliAnalysisTaskESDfilter::SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aod
 
   if(esdtrack->Pt()>fHighPthreshold) {
     detpid = new AliAODPid();
-    SetDetectorRawSignals(detpid,esdtrack,timezero);
+    SetDetectorRawSignals(detpid,esdtrack,timezero, bfield);
     aodtrack->SetDetPID(detpid);
   } else {
     if(fPtshape){
@@ -1186,7 +1186,7 @@ void AliAnalysisTaskESDfilter::SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aod
        Double_t y = fPtshape->Eval(esdtrack->Pt())/fPtshape->Eval(fHighPthreshold);
        if(gRandom->Rndm(0)<1./y){
          detpid = new AliAODPid();
-         SetDetectorRawSignals(detpid,esdtrack,timezero);
+         SetDetectorRawSignals(detpid,esdtrack,timezero, bfield);
          aodtrack->SetDetPID(detpid);
        }//end rndm
       }//end if p < pmin
@@ -1194,7 +1194,7 @@ void AliAnalysisTaskESDfilter::SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aod
   }// end else
 }
 
-void AliAnalysisTaskESDfilter::SetDetectorRawSignals(AliAODPid *aodpid, AliESDtrack *track, Double_t timezero)
+void AliAnalysisTaskESDfilter::SetDetectorRawSignals(AliAODPid *aodpid, AliESDtrack *track, Double_t timezero, Double_t bfield)
 {
 //
 //assignment of the detector signals (AliXXXesdPID inspired)
@@ -1222,6 +1222,25 @@ void AliAnalysisTaskESDfilter::SetDetectorRawSignals(AliAODPid *aodpid, AliESDtr
  aodpid->SetTOFsignal(track->GetTOFsignal()-timezero); // to be fixed
  aodpid->SetHMPIDsignal(track->GetHMPIDsignal());
 
+ //Extrapolate track to EMCAL surface for AOD-level track-cluster matching
+ Double_t emcpos[3] = {0.,0.,0.};
+ Double_t emcmom[3] = {0.,0.,0.};
+ aodpid->SetEMCALPosition(emcpos);
+ aodpid->SetEMCALMomentum(emcmom);
+
+ AliExternalTrackParam *outerparam = (AliExternalTrackParam*)track->GetOuterParam();
+ if(!outerparam) return;
+
+ //To be replaced by call to AliEMCALGeoUtils when the class becomes available
+ Double_t radius = 441.0; //[cm] EMCAL radius +13cm
+
+ Bool_t okpos = outerparam->GetXYZAt(radius,bfield,emcpos);
+ Bool_t okmom = outerparam->GetPxPyPzAt(radius,bfield,emcmom);
+ if(!(okpos && okmom)) return;
+
+ aodpid->SetEMCALPosition(emcpos);
+ aodpid->SetEMCALMomentum(emcmom);
+
 }
 
 void AliAnalysisTaskESDfilter::Terminate(Option_t */*option*/)
index ccde3ad..58b79c0 100644 (file)
@@ -39,8 +39,8 @@ class AliAnalysisTaskESDfilter : public AliAnalysisTaskSE
     virtual void SetPthreshold    (Double_t p)                  {fHighPthreshold =        p;}
     virtual void SetPshape        (TF1 *func)                   {fPtshape        =     func;}
 
-    virtual void SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aodtrack, AliAODPid *detpid, Double_t timezero);
-    void SetDetectorRawSignals(AliAODPid *aodpid, AliESDtrack *track, Double_t timezero);
+    virtual void SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aodtrack, AliAODPid *detpid, Double_t timezero, Double_t bfield);
+    void SetDetectorRawSignals(AliAODPid *aodpid, AliESDtrack *track, Double_t timezero, Double_t bfield);
 
  private:
     AliAnalysisTaskESDfilter(const AliAnalysisTaskESDfilter&);
index 7179247..c5eb933 100644 (file)
@@ -38,6 +38,7 @@ AliAODPid::AliAODPid():
 {
   // default constructor
     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=0; 
+    for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.;
   
 }
 
@@ -64,6 +65,7 @@ AliAODPid::AliAODPid(const AliAODPid& pid) :
     fTRDslices = new Double32_t[fTRDnSlices];
     for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
+    for(Int_t i=0; i<3; i++) fEMCALPosition[i]=pid.fEMCALPosition[i];
 }
 
 //______________________________________________________________________________
@@ -87,6 +89,7 @@ AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
     fTOFesdsignal=pid.fTOFesdsignal;
     fHMPIDsignal=pid.fHMPIDsignal;
     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
+    for(Int_t i=0; i<3; i++) fEMCALPosition[i]=pid.fEMCALPosition[i];
   }
 
   return *this;
@@ -103,3 +106,27 @@ void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
  // Returns the array with integrated times for each particle hypothesis
 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
 }
+//_______________________________________________________________________________
+void AliAODPid::GetEMCALPosition(Double_t emcalpos[3])
+{
+ // Returns the array with extrapolated track position at the EMCAL surface
+  for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
+}
+//_______________________________________________________________________________
+void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
+{
+ // Sets the array with extrapolated track position at the EMCAL surface
+  for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
+}
+//_______________________________________________________________________________
+void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3])
+{
+ // Returns the array with extrapolated track momentum at the EMCAL surface
+  for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
+}
+//_______________________________________________________________________________
+void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
+{
+ // Sets the array with extrapolated track momentum at the EMCAL surface
+  for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];
+}
index 9da0d34..cf8768f 100644 (file)
@@ -29,7 +29,8 @@ class AliAODPid : public TObject {
   void      SetTOFsignal(Double_t tof)                         {fTOFesdsignal=tof;}
   void      SetIntegratedTimes(Double_t timeint[5]);
   void      SetHMPIDsignal(Double_t hmpid)                     {fHMPIDsignal=hmpid;}
-
+  void      SetEMCALPosition(Double_t emcalpos[3]);
+  void      SetEMCALMomentum(Double_t emcalmom[3]);
 
   Double_t  GetITSsignal()       {return  fITSsignal;}
   Double_t  GetTPCsignal()       {return  fTPCsignal;}
@@ -38,17 +39,23 @@ class AliAODPid : public TObject {
   Double_t  GetTOFsignal()       {return  fTOFesdsignal;} 
   void      GetIntegratedTimes(Double_t timeint[5]); 
   Double_t  GetHMPIDsignal()     {return  fHMPIDsignal;}
+  void      GetEMCALPosition(Double_t emcalpos[3]);
+  void      GetEMCALMomentum(Double_t emcalmom[3]);
 
  private :
-  Double32_t fITSsignal;      //[0.,0.,10] detector raw signal
-  Double32_t fTPCsignal;      //[0.,0.,10] detector raw signal
-  Int_t      fTRDnSlices;     //N slices used for PID in the TRD
-  Double32_t* fTRDslices;     //[fTRDnSlices]
-  Double32_t fTOFesdsignal;   //TOF signal - t0 (T0 interaction time)
-  Double32_t fIntTime[5];     //track time hypothesis
-  Double32_t fHMPIDsignal;    //detector raw signal
-
-  ClassDef(AliAODPid,1);
+  Double32_t fITSsignal;        //[0.,0.,10] detector raw signal
+  Double32_t fTPCsignal;        //[0.,0.,10] detector raw signal
+  Int_t      fTRDnSlices;       //N slices used for PID in the TRD
+  Double32_t* fTRDslices;       //[fTRDnSlices]
+  Double32_t fTOFesdsignal;     //TOF signal - t0 (T0 interaction time)
+  Double32_t fIntTime[5];       //track time hypothesis
+  Double32_t fHMPIDsignal;      //detector raw signal
+  Double32_t fEMCALPosition[3]; //global position of track
+                               //extrapolated to EMCAL surface
+  Double32_t fEMCALMomentum[3]; //momentum of track
+                               //extrapolated to EMCAL surface
+
+  ClassDef(AliAODPid,2);
 };
 
 #endif