]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Jan 2013 14:00:29 +0000 (14:00 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Jan 2013 14:00:29 +0000 (14:00 +0000)
PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.cxx
PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.h

index f52ddf7eaf05f4f6eb1e22019be43c22c769ef3e..01a1832fe6036e2a14d26714d6a0f6ab47ea658f 100644 (file)
@@ -87,6 +87,7 @@ AliAnalysisTaskEMCALClusterize::AliAnalysisTaskEMCALClusterize(const char *name)
 , fOADBSet(kFALSE),       fAccessOADB(kTRUE),         fOADBFilePath("")
 , fCentralityClass(""),   fSelectEMCALEvent(0)
 , fEMCALEnergyCut(0.),    fEMCALNcellsCut (0)
+, fSetCellMCLabelFromCluster(kFALSE)
 {
   // Constructor
   
@@ -129,6 +130,7 @@ AliAnalysisTaskEMCALClusterize::AliAnalysisTaskEMCALClusterize()
 , fOADBSet(kFALSE),         fAccessOADB(kTRUE),        fOADBFilePath("")
 , fCentralityClass(""),     fSelectEMCALEvent(0)
 , fEMCALEnergyCut(0.),      fEMCALNcellsCut (0)
+, fSetCellMCLabelFromCluster(kFALSE)
 {
   // Constructor
   
@@ -663,8 +665,14 @@ void AliAnalysisTaskEMCALClusterize::ClusterizeCells()
       continue;
     }
     
-    //Create the digit, put a fake primary deposited energy to trick the clusterizer when checking the most likely primary
-    new((*fDigitsArr)[idigit]) AliEMCALDigit( fCellLabels[id], fCellLabels[id],id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, 1); 
+    Int_t mcLabel = cells->GetMCLabel(icell);
+    //if(fCellLabels[id]!=mcLabel)printf("mcLabel %d - %d\n",mcLabel,fCellLabels[id]);
+    if(fSetCellMCLabelFromCluster) mcLabel = fCellLabels[id]; // Older aliroot MC productions
+    
+    // Create the digit, put a fake primary deposited energy to trick the clusterizer
+    // when checking the most likely primary
+    
+    new((*fDigitsArr)[idigit]) AliEMCALDigit( mcLabel, mcLabel, id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, 1);
     
     fCellLabels[id] =-1; //reset the entry in the array for next event
     
index 571a2d47e4f67516974ac273a238b22e4d13fa95..eca59cf34c7f24cbbced3eae89685b908b807462 100644 (file)
@@ -129,6 +129,10 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   Float_t       GetCentralityBin(Int_t i)                 const { if(i < 0 || i > 1) return -1 ; 
                                                                   else               return fCentralityBin[i]   ; }
   
+  void          SwitchOnUseClusterMCLabelForCell()              { fSetCellMCLabelFromCluster = kTRUE  ;}
+  void          SwitchOffUseClusterMCLabelForCell()             { fSetCellMCLabelFromCluster = kFALSE ;}
+
+  
  private:
     
   virtual void   FillCaloClusterInEvent();
@@ -209,10 +213,13 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   Float_t                fEMCALEnergyCut;         //  At least an EMCAL cluster with this energy in the event
   Int_t                  fEMCALNcellsCut;         //  At least an EMCAL cluster with fNCellsCut cells over fEnergyCut
 
+  Bool_t                 fSetCellMCLabelFromCluster; // Use cluster MC label as cell label
+
+  
   AliAnalysisTaskEMCALClusterize(           const AliAnalysisTaskEMCALClusterize&); // not implemented
   AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
 
-  ClassDef(AliAnalysisTaskEMCALClusterize, 24);
+  ClassDef(AliAnalysisTaskEMCALClusterize, 25);
 
 };