Added possibility to set on/off cut on off-vertex photons.
authorpolicheh <Boris.Polishchuk@cern.ch>
Sun, 12 Oct 2014 10:42:56 +0000 (14:42 +0400)
committerpolicheh <Boris.Polishchuk@cern.ch>
Sun, 12 Oct 2014 10:44:48 +0000 (14:44 +0400)
PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0FlowMCAOD.cxx
PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0FlowMCAOD.h

index cff76d9..a857aaf 100644 (file)
@@ -66,7 +66,7 @@ ClassImp(AliAnalysisTaskPi0FlowMCAOD);
 const Double_t AliAnalysisTaskPi0FlowMCAOD::kRCut = 1.;
 
 AliAnalysisTaskPi0FlowMCAOD::AliAnalysisTaskPi0FlowMCAOD(const char* name, AliAnalysisTaskPi0Flow::Period period)
-: AliAnalysisTaskPi0Flow(name, period),fMcArray(0x0)
+: AliAnalysisTaskPi0Flow(name, period),fMcArray(0x0),kOffVertexCutSet(kTRUE)
 {
 }
 
@@ -255,15 +255,17 @@ void AliAnalysisTaskPi0FlowMCAOD::SelectPhotonClusters()
     photon->SetWeight(PrimaryWeight(primary)) ;
   }
 
-  for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
-    AliCaloPhoton * photon = (AliCaloPhoton*)fCaloPhotonsPHOS->At(i1);
-    Int_t primary = photon->GetPrimary();
-    AliAODMCParticle* p = GetParticle(primary);
-    if(R(p) >kRCut) {
-      if(p->PdgCode()==11 || p->PdgCode()==-11) continue;
-      else { fCaloPhotonsPHOS->Remove(photon); fCaloPhotonsPHOS->Compress(); }
+    if(kOffVertexCutSet) {
+        for (Int_t i1=0; i1<fCaloPhotonsPHOS->GetEntriesFast(); i1++) {
+            AliCaloPhoton * photon = (AliCaloPhoton*)fCaloPhotonsPHOS->At(i1);
+            Int_t primary = photon->GetPrimary();
+            AliAODMCParticle* p = GetParticle(primary);
+            if(R(p) >kRCut) {
+                if(p->PdgCode()==11 || p->PdgCode()==-11) continue;
+                else { fCaloPhotonsPHOS->Remove(photon); fCaloPhotonsPHOS->Compress(); }
+            }
+        }
     }
-  }
     
 }
 
index 5320a1f..0f6e138 100644 (file)
@@ -19,7 +19,9 @@ class AliAnalysisTaskPi0FlowMCAOD : public AliAnalysisTaskPi0Flow
 public:
   AliAnalysisTaskPi0FlowMCAOD(const char* name = "AliAnalysisTaskPi0Flow", Period period = kUndefinedPeriod);
   virtual ~AliAnalysisTaskPi0FlowMCAOD();
-
+    
+  void SetOffVertexPhotonCut(Bool_t setCut=kTRUE) { kOffVertexCutSet=setCut; }
+    
 protected: // Override:
   virtual void UserCreateOutputObjects();
   virtual void UserExec(Option_t *option);
@@ -38,8 +40,9 @@ protected: // member functions:
   AliAODMCParticle* GetParticle(Int_t); //Returns particle at given position for AOD
 
 protected: // member variables:
-  TClonesArray* fMcArray; //mcArray for AOD MC particles 
-  
+  TClonesArray* fMcArray; //mcArray for AOD MC particles
+  Bool_t kOffVertexCutSet;
+    
   void FillMCHist();
   Double32_t R(AliAODMCParticle* p);