ESD dependence in copying the pid information removed. (A. Mastroserio)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jul 2008 07:15:31 +0000 (07:15 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jul 2008 07:15:31 +0000 (07:15 +0000)
ANALYSIS/AliAnalysisTaskESDfilter.cxx
ANALYSIS/AliAnalysisTaskESDfilter.h
STEER/AliAODPid.cxx
STEER/AliAODPid.h

index 0556bbd..1324454 100644 (file)
@@ -942,7 +942,7 @@ void AliAnalysisTaskESDfilter::SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aod
 
   if(esdtrack->Pt()>fHighPthreshold) {
     detpid = new AliAODPid();
-    detpid->SetDetectorRawSignals(esdtrack,timezero);
+    SetDetectorRawSignals(detpid,esdtrack,timezero);
     aodtrack->SetDetPID(detpid);
   } else {
     if(fPtshape){
@@ -950,7 +950,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();
-         detpid->SetDetectorRawSignals(esdtrack,timezero);
+         SetDetectorRawSignals(detpid,esdtrack,timezero);
          aodtrack->SetDetPID(detpid);
        }//end rndm
       }//end if p < pmin
@@ -958,7 +958,35 @@ void AliAnalysisTaskESDfilter::SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aod
   }// end else
 }
 
+void AliAnalysisTaskESDfilter::SetDetectorRawSignals(AliAODPid *aodpid, AliESDtrack *track, Double_t timezero)
+{
+//
+//assignment of the detector signals (AliXXXesdPID inspired)
+//
+ if(!track){
+ AliInfo("no ESD track found. .....exiting");
+ return;
+ }
+
+ aodpid->SetITSsignal(track->GetITSsignal());
+ aodpid->SetTPCsignal(track->GetTPCsignal());
+ //n TRD planes = 6
+
+ Int_t nslices = track->GetNumberOfTRDslices()*6;
+ Double_t *trdslices = new Double_t[nslices];
+ for(Int_t iSl =0; iSl < track->GetNumberOfTRDslices(); iSl++) {
+     for(Int_t iPl =0; iPl<6; iPl++) trdslices[iPl*track->GetNumberOfTRDslices()+iSl] = track->GetTRDslice(iPl,iSl);
+    }
 
+
+ aodpid->SetTRDsignal(track->GetNumberOfTRDslices()*6,trdslices);
+ Double_t times[AliAODPid::kSPECIES]; track->GetIntegratedTimes(times);
+ aodpid->SetIntegratedTimes(times);
+
+ aodpid->SetTOFsignal(track->GetTOFsignal()-timezero); // to be fixed
+ aodpid->SetHMPIDsignal(track->GetHMPIDsignal());
+
+}
 void AliAnalysisTaskESDfilter::Terminate(Option_t */*option*/)
 {
 // Terminate analysis
index 7d41988..a55f0ed 100644 (file)
@@ -37,7 +37,7 @@ class AliAnalysisTaskESDfilter : public AliAnalysisTaskSE
     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);
 
  private:
     AliAnalysisTaskESDfilter(const AliAnalysisTaskESDfilter&);
index bf1375a..f3e817c 100644 (file)
@@ -38,6 +38,7 @@ AliAODPid::AliAODPid():
 {
   // default constructor
     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=0; 
+  
 }
 
 //______________________________________________________________________________
@@ -81,31 +82,14 @@ AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
   return *this;
 }
 //_______________________________________________________________________________
-void AliAODPid::SetDetectorRawSignals(AliESDtrack *track, Double_t timezero)
+void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES])
 {
-//
-//assignment of the detector signals (AliXXXesdPID inspired)
-//
- if(!track){
- AliInfo("no ESD track found. .....exiting");
- return;
- }
-
- fITSsignal=track->GetITSsignal();
- fTPCsignal=track->GetTPCsignal();
- fTRDnSlices=track->GetNumberOfTRDslices()*kTRDnPlanes;
- track->GetIntegratedTimes(fIntTime);
- fTOFesdsignal=track->GetTOFsignal()-timezero; //TO BE FIXED 
- fHMPIDsignal=track->GetHMPIDsignal();
-
- fTRDslices=new Double32_t[fTRDnSlices];  
- for(Int_t iSl =0; iSl < track->GetNumberOfTRDslices(); iSl++) {
-     for(Int_t iPl =0; iPl<kTRDnPlanes; iPl++) fTRDslices[iPl*track->GetNumberOfTRDslices()+iSl] = track->GetTRDslice(iPl,iSl);
-    } 
+ // Returns the array with integrated times for each particle hypothesis
+for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
 }
-//________________________________________________________________________________
-void AliAODPid::GetIntegratedTimes(Double_t timeint[5])
+//_______________________________________________________________________________
+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++) timeint[i]=fIntTime[i];
+for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
 }
index ac420fe..9da0d34 100644 (file)
@@ -11,7 +11,6 @@
 //-------------------------------------------------------------------------
 
 #include <TObject.h>
-class AliESDtrack;
 
 class AliAODPid : public TObject {
 
@@ -23,7 +22,14 @@ class AliAODPid : public TObject {
   
   enum{kSPECIES=5, kTRDnPlanes=6};
 
-  void SetDetectorRawSignals(AliESDtrack *track, Double_t timezero); 
+ //setters
+  void      SetITSsignal(Double_t its)                         {fITSsignal=its;}
+  void      SetTPCsignal(Double_t tpc)                         {fTPCsignal=tpc;}
+  void      SetTRDsignal(Int_t nslices, Double_t* trdslices)   {fTRDnSlices = nslices; fTRDslices=trdslices;}
+  void      SetTOFsignal(Double_t tof)                         {fTOFesdsignal=tof;}
+  void      SetIntegratedTimes(Double_t timeint[5]);
+  void      SetHMPIDsignal(Double_t hmpid)                     {fHMPIDsignal=hmpid;}
+
 
   Double_t  GetITSsignal()       {return  fITSsignal;}
   Double_t  GetTPCsignal()       {return  fTPCsignal;}