Add option to select tracks with hits in SPD layers
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Nov 2012 09:24:07 +0000 (09:24 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Nov 2012 09:24:07 +0000 (09:24 +0000)
PWG/CaloTrackCorrBase/AliCaloTrackReader.cxx
PWG/CaloTrackCorrBase/AliCaloTrackReader.h

index d150cc3..d275383 100755 (executable)
@@ -77,7 +77,8 @@ fFillCTS(0),                 fFillEMCAL(0),                   fFillPHOS(0),
 fFillEMCALCells(0),          fFillPHOSCells(0), 
 fRecalculateClusters(kFALSE),fSelectEmbeddedClusters(kFALSE),
 fTrackStatus(0),             fTrackFilterMask(0),             
-fESDtrackCuts(0),            fConstrainTrack(kFALSE),         fSelectHybridTracks(0),
+fESDtrackCuts(0),            fConstrainTrack(kFALSE),
+fSelectHybridTracks(0),      fSelectSPDHitTracks(kFALSE),
 fTrackMult(0),               fTrackMultEtaCut(0.8),
 fReadStack(kFALSE),          fReadAODMCParticles(kFALSE), 
 fDeltaAODFileName(""),       fFiredTriggerClassName(""),      
@@ -551,7 +552,7 @@ void AliCaloTrackReader::Print(const Option_t * opt) const
   printf("Use EMCAL Cells =     %d\n",     fFillEMCALCells) ;
   printf("Use PHOS  Cells =     %d\n",     fFillPHOSCells) ;
   printf("Track status    =     %d\n", (Int_t) fTrackStatus) ;
-  printf("AODs Track filter mask  =  %d or hybrid %d\n", (Int_t) fTrackFilterMask,fSelectHybridTracks) ;
+  printf("AODs Track filter mask  =  %d or hybrid %d, SPD hit %d\n", (Int_t) fTrackFilterMask,fSelectHybridTracks,fSelectSPDHitTracks) ;
   printf("Track Mult Eta Cut =  %d\n", (Int_t) fTrackMultEtaCut) ;
   printf("Write delta AOD =     %d\n",     fWriteOutputDeltaAOD) ;
   printf("Recalculate Clusters = %d\n",    fRecalculateClusters) ;
@@ -1054,6 +1055,10 @@ void AliCaloTrackReader::FillInputCTS()
           
         } // use constrained tracks
         
+        if(fSelectSPDHitTracks)
+        {//Not much sense to use with TPC only or Hybrid tracks
+          if(!esdTrack->HasPointOnITSLayer(0) && !esdTrack->HasPointOnITSLayer(1)) continue ;
+        }
       }
       else continue;
       
@@ -1078,6 +1083,11 @@ void AliCaloTrackReader::FillInputCTS()
           if ( aodtrack->TestFilterBit(fTrackFilterMask)==kFALSE) continue ;
         }
         
+        if(fSelectSPDHitTracks)
+        {//Not much sense to use with TPC only or Hybrid tracks
+          if(!aodtrack->HasPointOnITSLayer(0) && !aodtrack->HasPointOnITSLayer(1)) continue ;
+        }
+        
         if (aodtrack->GetType()!= AliAODTrack::kPrimary)          continue ;
         
         if (fDebug > 2 ) printf("AliCaloTrackReader::FillInputCTS(): \t accepted track! \n");
index 80f142e..9e11d56 100755 (executable)
@@ -253,42 +253,45 @@ public:
   Bool_t           IsPileUpFromNotSPDAndNotEMCal() const ;
 
   void             SetPileUpParamForSPD  (Int_t i, Double_t param)
-                                                           { fPileUpParamSPD[i]  = param ; }
-  void             SetPileUpParamForEMCal(Int_t param)     { fNPileUpClustersCut = param ; }
+                                                           { fPileUpParamSPD[i]  = param  ; }
+  void             SetPileUpParamForEMCal(Int_t param)     { fNPileUpClustersCut = param  ; }
   
-  Int_t            GetNPileUpClusters()                    { return  fNPileUpClusters    ; }
-  Int_t            GetNNonPileUpClusters()                 { return  fNNonPileUpClusters ; }
+  Int_t            GetNPileUpClusters()                    { return  fNPileUpClusters     ; }
+  Int_t            GetNNonPileUpClusters()                 { return  fNNonPileUpClusters  ; }
 
   // Track selection
-  ULong_t          GetTrackStatus()                  const { return fTrackStatus       ; }
-  void             SetTrackStatus(ULong_t bit)             { fTrackStatus = bit        ; }             
+  ULong_t          GetTrackStatus()                  const { return fTrackStatus          ; }
+  void             SetTrackStatus(ULong_t bit)             { fTrackStatus = bit           ; }          
 
-  ULong_t          GetTrackFilterMask()              const {return fTrackFilterMask    ; }
-  void             SetTrackFilterMask(ULong_t bit)         { fTrackFilterMask = bit    ; }             
+  ULong_t          GetTrackFilterMask()              const {return fTrackFilterMask       ; }
+  void             SetTrackFilterMask(ULong_t bit)         { fTrackFilterMask = bit       ; }          
   
-  AliESDtrackCuts* GetTrackCuts()                    const { return fESDtrackCuts      ; }
+  AliESDtrackCuts* GetTrackCuts()                    const { return fESDtrackCuts         ; }
   void             SetTrackCuts(AliESDtrackCuts * cuts)    ;
 
-  void             SwitchOnConstrainTrackToVertex()        { fConstrainTrack = kTRUE   ; } 
-  void             SwitchOffConstrainTrackToVertex()       { fConstrainTrack = kFALSE  ; }      
+  void             SwitchOnConstrainTrackToVertex()        { fConstrainTrack     = kTRUE  ; } 
+  void             SwitchOffConstrainTrackToVertex()       { fConstrainTrack     = kFALSE ; }      
   
   void             SwitchOnAODHybridTrackSelection()       { fSelectHybridTracks = kTRUE  ; } 
   void             SwitchOffAODHybridTrackSelection()      { fSelectHybridTracks = kFALSE ; }      
   
-  Int_t            GetTrackMultiplicity()            const { return fTrackMult         ; }
-  Float_t          GetTrackMultiplicityEtaCut()      const { return fTrackMultEtaCut   ; }
-  void             SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta    ; }             
+  void             SwitchOnTrackHitSPDSelection()          { fSelectSPDHitTracks = kTRUE  ; }
+  void             SwitchOffTrackHitSPDSelection()         { fSelectSPDHitTracks = kFALSE ; }
+  
+  Int_t            GetTrackMultiplicity()            const { return fTrackMult            ; }
+  Float_t          GetTrackMultiplicityEtaCut()      const { return fTrackMultEtaCut      ; }
+  void             SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta       ; }          
   
   // Calorimeter specific and patches
-  void             AnalyzeOnlyLED()                        { fAnaLED = kTRUE           ; }
-  void             AnalyzeOnlyPhysics()                    { fAnaLED = kFALSE          ; }
+  void             AnalyzeOnlyLED()                        { fAnaLED             = kTRUE  ; }
+  void             AnalyzeOnlyPhysics()                    { fAnaLED             = kFALSE ; }
   
-  void             SwitchOnCaloFilterPatch()               { fCaloFilterPatch = kTRUE  ; 
-                                                             fFillCTS = kFALSE         ; }
-  void             SwitchOffCaloFilterPatch()              { fCaloFilterPatch = kFALSE ; }
+  void             SwitchOnCaloFilterPatch()               { fCaloFilterPatch    = kTRUE  ; 
+                                                             fFillCTS            = kFALSE ; }
+  void             SwitchOffCaloFilterPatch()              { fCaloFilterPatch    = kFALSE ; }
   Bool_t           IsCaloFilterPatchOn()             const { 
                     if(fDataType == kAOD) { return fCaloFilterPatch ; } 
-                    else                  { return kFALSE           ; }                  }
+                    else                  { return kFALSE           ; }                     }
        
   //-------------------------------
   //Vertex methods
@@ -472,6 +475,7 @@ public:
   AliESDtrackCuts *fESDtrackCuts       ;    // Track cut 
   Bool_t           fConstrainTrack     ;    // Constrain Track to vertex
   Bool_t           fSelectHybridTracks ;    // Select CTS tracks of type hybrid (only for AODs)
+  Bool_t           fSelectSPDHitTracks ;    // Ensure that track hits SPD layers
   Int_t            fTrackMult          ;    // Track multiplicity
   Float_t          fTrackMultEtaCut    ;    // Track multiplicity eta cut
   Bool_t           fReadStack          ;    // Access kine information from stack
@@ -539,7 +543,7 @@ public:
   AliCaloTrackReader(              const AliCaloTrackReader & r) ; // cpy ctor
   AliCaloTrackReader & operator = (const AliCaloTrackReader & r) ; // cpy assignment
   
-  ClassDef(AliCaloTrackReader,46)
+  ClassDef(AliCaloTrackReader,47)
   
 } ;