HMPID related updates
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 27 Aug 2012 09:49:15 +0000 (09:49 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 27 Aug 2012 09:49:15 +0000 (09:49 +0000)
Levente Molnar
https://savannah.cern.ch/bugs/index.php?96201

ANALYSIS/AliAnalysisTaskSE.cxx
ANALYSIS/AliAnalysisTaskSE.h
STEER/AOD/AliAODEvent.cxx
STEER/AOD/AliAODEvent.h
STEER/AOD/AliAODHandler.cxx
STEER/AOD/AliAODHandler.h

index 95b1c57..cfd69a4 100644 (file)
@@ -68,6 +68,7 @@ AliAODCaloCells* AliAnalysisTaskSE::fgAODPhosCells      = NULL;
 AliAODCaloTrigger* AliAnalysisTaskSE::fgAODEMCALTrigger = NULL;
 AliAODCaloTrigger* AliAnalysisTaskSE::fgAODPHOSTrigger  = NULL;
 TClonesArray*    AliAnalysisTaskSE::fgAODDimuons        = NULL;
+TClonesArray*    AliAnalysisTaskSE::fgAODHmpidRings     = NULL;
 
 AliAnalysisTaskSE::AliAnalysisTaskSE():
     AliAnalysisTask(),
@@ -294,13 +295,21 @@ void AliAnalysisTaskSE::CreateOutputObjects()
                fgAODMCParticles->SetName("mcparticles");
                handler->AddBranch("TClonesArray", &fgAODMCParticles);
            }
-           if ((handler->NeedsDimuonsBranchReplication() || merging) && !(fgAODDimuons))      
+            if ((handler->NeedsDimuonsBranchReplication() || merging) && !(fgAODDimuons))      
            {   
                if (fDebug > 1) AliInfo("Replicating dimuon branch\n");
                fgAODDimuons = new TClonesArray("AliAODDimuon",0);
                fgAODDimuons->SetName("dimuons");
                handler->AddBranch("TClonesArray", &fgAODDimuons);
            }    
+           if ((handler->NeedsHMPIDBranchReplication() || merging) && !(fgAODHmpidRings))      
+           {   
+               if (fDebug > 1) AliInfo("Replicating HMPID branch\n");
+               fgAODHmpidRings = new TClonesArray("AliAODHMPIDrings",0);
+               fgAODHmpidRings->SetName("hmpidRings");
+               handler->AddBranch("TClonesArray", &fgAODHmpidRings);
+           }
+                
 
            // cache the pointerd in the AODEvent
            fOutputAOD->GetStdContent();
@@ -469,6 +478,14 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
                    }    
                }
            }
+            if ((handler->NeedsHMPIDBranchReplication()) && (fgAODHmpidRings))
+           {
+               TClonesArray* hmpidRings = aod->GetHMPIDrings();
+               new (fgAODHmpidRings) TClonesArray(*hmpidRings);
+           }
+            
+            
+            
            // Additional merging if needed
            if (merging) {
              Int_t nc;
index 31d34c1..7f2d2b5 100644 (file)
@@ -100,7 +100,8 @@ class AliAnalysisTaskSE : public AliAnalysisTask
     static AliAODTracklets* fgAODTracklets;     //! Tracklets for replication
     static AliAODCaloCells* fgAODEmcalCells;    //! Emcal Cell replication
     static AliAODCaloCells* fgAODPhosCells;     //! Phos  Cell replication
-       static TClonesArray*    fgAODDimuons;       //! Dimuons replication
+    static TClonesArray*    fgAODDimuons;       //! Dimuons replication
+    static TClonesArray*    fgAODHmpidRings;    //! HMPID replication
     // Event Selection
     UInt_t fOfflineTriggerMask;   //  Task processes collision candidates only
     // Event Mixing
index ebc154d..df9ca0e 100644 (file)
@@ -407,7 +407,7 @@ void AliAODEvent::GetStdContent()
   fPHOSTrigger   = (AliAODCaloTrigger*)fAODObjects->FindObject("phosTrigger");
   fFmdClusters   = (TClonesArray*)fAODObjects->FindObject("fmdClusters");
   fPmdClusters   = (TClonesArray*)fAODObjects->FindObject("pmdClusters");
-  fHMPIDrings    = (TClonesArray*)fAODObjects->FindObject("hmpidRings");
+  fHMPIDrings    = (TClonesArray*)fAODObjects->FindObject("hmpidRings");  
   fDimuons       = (TClonesArray*)fAODObjects->FindObject("dimuons");
   fAODTZERO      = (AliAODTZERO*)fAODObjects->FindObject("AliAODTZERO");
   fAODVZERO      = (AliAODVZERO*)fAODObjects->FindObject("AliAODVZERO");
@@ -473,7 +473,7 @@ void AliAODEvent::ResetStd(Int_t trkArrSize,
       fPmdClusters->Expand(pmdClusSize);
   }
   if (fHMPIDrings) {
-       fHMPIDrings->Delete();
+     fHMPIDrings->Delete();
     if (hmpidRingsSize > fHMPIDrings->GetSize()) 
       fHMPIDrings->Expand(hmpidRingsSize);
   }
@@ -522,9 +522,9 @@ void AliAODEvent::ClearStd()
   if (fFmdClusters)
     fFmdClusters   ->Clear();
   if (fPmdClusters)
-    fPmdClusters   ->Clear();
-  if (fHMPIDrings)
-    fHMPIDrings   ->Delete();
+    fPmdClusters   ->Clear();  
+  if (fHMPIDrings) 
+     fHMPIDrings   ->Clear();    
   if (fDimuons)
     fDimuons       ->Clear();
        
index 1ddc7a2..c1834af 100644 (file)
@@ -213,7 +213,7 @@ class AliAODEvent : public AliVEvent {
   {new((*fPmdClusters)[fPmdClusters->GetEntriesFast()]) AliAODPmdCluster(*clus); return fPmdClusters->GetEntriesFast()-1;}
 
   // -- HMPID objects 
-  TClonesArray *GetHMPIDrings()       const { return fHMPIDrings; } 
+  TClonesArray *GetHMPIDrings()       const {return fHMPIDrings; } 
   Int_t         GetNHMPIDrings();
   AliAODHMPIDrings *GetHMPIDring(Int_t nRings);
   Int_t         AddHMPIDrings(const  AliAODHMPIDrings* ring) 
index dbd0d2b..0434a82 100644 (file)
@@ -71,6 +71,7 @@ AliAODHandler::AliAODHandler() :
        fNeedsCaloTriggerBranchReplication(kFALSE),
     fNeedsMCParticlesBranchReplication(kFALSE),
     fNeedsDimuonsBranchReplication(kFALSE),
+    fNeedsHMPIDBranchReplication(kFALSE),
     fAODIsReplicated(kFALSE),
     fAODEvent(NULL),
     fMCEventH(NULL),
@@ -100,9 +101,10 @@ AliAODHandler::AliAODHandler(const char* name, const char* title):
     fNeedsJetsBranchReplication(kFALSE),
     fNeedsFMDClustersBranchReplication(kFALSE),
     fNeedsCaloClustersBranchReplication(kFALSE),
-       fNeedsCaloTriggerBranchReplication(kFALSE),
+    fNeedsCaloTriggerBranchReplication(kFALSE),
     fNeedsMCParticlesBranchReplication(kFALSE),
     fNeedsDimuonsBranchReplication(kFALSE),
+    fNeedsHMPIDBranchReplication(kFALSE),
     fAODIsReplicated(kFALSE),
     fAODEvent(NULL),
     fMCEventH(NULL),
index 1a9224b..268f724 100644 (file)
@@ -61,6 +61,7 @@ class AliAODHandler : public AliVEventHandler {
     virtual void         SetNeedsCaloTriggerBranchReplication()  {fNeedsCaloTriggerBranchReplication  = kTRUE;}
     virtual void         SetNeedsMCParticlesBranchReplication()  {fNeedsMCParticlesBranchReplication  = kTRUE;}
     virtual void         SetNeedsDimuonsBranchReplication()      {fNeedsDimuonsBranchReplication      = kTRUE;}
+    virtual void         SetNeedsHMPIDBranchReplication()        {fNeedsHMPIDBranchReplication        = kTRUE;}
     virtual void         SetAODIsReplicated()                    {Changed(); fAODIsReplicated = kTRUE;}
     virtual void         SetAODExtensionMode()                   {Changed(); fIsStandard=kFALSE; fFillAOD=kFALSE; fFillAODRun=kFALSE; fFillExtension=kTRUE;}
     //
@@ -93,6 +94,7 @@ class AliAODHandler : public AliVEventHandler {
     Bool_t               NeedsCaloTriggerBranchReplication()  const {return  fNeedsCaloTriggerBranchReplication;}
     Bool_t               NeedsMCParticlesBranchReplication()  const {return  fNeedsMCParticlesBranchReplication;}
     Bool_t               NeedsDimuonsBranchReplication()      const {return  fNeedsDimuonsBranchReplication;}
+    Bool_t               NeedsHMPIDBranchReplication()        const {return  fNeedsHMPIDBranchReplication;}
     Bool_t               AODIsReplicated()                    const {return  fAODIsReplicated;}
     //
     void                 SetInputTree(TTree* /*tree*/) {;}
@@ -127,6 +129,7 @@ class AliAODHandler : public AliVEventHandler {
     Bool_t                   fNeedsCaloTriggerBranchReplication;  // Flag for Calo Trigger replication
     Bool_t                   fNeedsMCParticlesBranchReplication;  // Flag for MCParticles replication
     Bool_t                   fNeedsDimuonsBranchReplication;      // Flag for Dimuons replication
+    Bool_t                   fNeedsHMPIDBranchReplication;        // Flag for HMPID replication
     Bool_t                   fAODIsReplicated;                    // Flag true if replication as been executed
     AliAODEvent             *fAODEvent;               //! Pointer to the AOD event
     AliMCEventHandler       *fMCEventH;               //! Pointer to mc event handler needed not to depend on the manager