including option to select files to be analysed
authormcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2012 10:38:58 +0000 (10:38 +0000)
committermcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2012 10:38:58 +0000 (10:38 +0000)
PWGGA/EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.cxx
PWGGA/EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.h
PWGGA/EMCALTasks/macros/AddTaskEMCALIsoPhoton.C

index 2a1eac7..bcc1f38 100644 (file)
@@ -47,6 +47,7 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton() :
   fIsTrain(0),
   fIsMc(0),
   fDebug(0),
+  fPathStrOpt("/"),
   fExoticCut(0.97),
   fIsoConeR(0.4),
   fNDimensions(7),
@@ -83,6 +84,7 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton(const char *name) :
   fIsTrain(0),
   fIsMc(0),
   fDebug(0),
+  fPathStrOpt("/"),
   fExoticCut(0.97),
   fIsoConeR(0.4),
   fNDimensions(7),
@@ -187,7 +189,13 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
     printf("isSelected = %d, fIsMC=%d\n", isSelected, fIsMc);
   if(!isSelected )
         return; 
-
+  if(fIsMc){
+    TTree *tree = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetTree();
+    TFile *file = (TFile*)tree->GetCurrentFile();
+    TString filename = file->GetName();
+    if(!filename.Contains(fPathStrOpt.Data()))
+      return;
+  }
   fESD = dynamic_cast<AliESDEvent*>(InputEvent());
   if (!fESD) {
     printf("ERROR: fESD not available\n");
index d30be8c..9df1309 100644 (file)
@@ -46,6 +46,7 @@ class AliAnalysisTaskEMCALIsoPhoton : public AliAnalysisTaskSE {
   void                   SetTrainMode(Bool_t t)                 { fIsTrain            = t;       }
   void                   SetMcMode(Bool_t mc)                   { fIsMc               = mc;      }
   void                   SetDebugOn(Bool_t d)                   { fDebug              = d;       }
+  void                   SetPathStringSelect(char *p)           { fPathStrOpt         = p;       }
   
  protected:
   TRefArray             *fCaloClusters;          //!pointer to EMCal clusters
@@ -60,6 +61,7 @@ class AliAnalysisTaskEMCALIsoPhoton : public AliAnalysisTaskSE {
   Bool_t                 fIsTrain;               // variable to set train mode
   Bool_t                 fIsMc;                  // variable to set mc mode
   Bool_t                 fDebug;                 // variable to set on/off debugging printouts
+  TString                fPathStrOpt;            // variable to set the name of files to be analyzed (MC only)
   Double_t               fExoticCut;             // variable to set the cut on exotic clusters
   Double_t               fIsoConeR;              // variable to set the isolation cone radius
   Int_t                  fNDimensions;           // variable to set the number of dimensions of n-sparse
index 17a3dff..2cceb1c 100644 (file)
@@ -2,7 +2,8 @@
 
 AliAnalysisTaskEMCALIsoPhoton *AddTaskEMCALIsoPhoton(
                                                     TString period = "LHC11d",
-                                                    TString trigbitname = "kEMC7"
+                                                    TString trigbitname = "kEMC7",
+                                                    TString pathstrsel = "/"
                                                     )
 {
   // Get the pointer to the existing analysis manager via the static access method.