]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Overload second find method from TObject
authormfasel <mfasel@lbl.gov>
Tue, 26 Aug 2014 09:01:44 +0000 (11:01 +0200)
committermverweij <marta.verweij@cern.ch>
Tue, 26 Aug 2014 09:08:47 +0000 (11:08 +0200)
PWGJE/EMCALJetTasks/UserTasks/AliEMCalHistoContainer.cxx
PWGJE/EMCALJetTasks/UserTasks/AliEMCalHistoContainer.h

index 6ec3496eb18fafd005bb0ff029529c3effc110a0..6f4da4e7b4e8f05457a4aecafdf0f4e54d464254 100644 (file)
@@ -517,7 +517,22 @@ namespace EMCalTriggerPtAnalysis {
                TString dirname(basename(name)), hname(histname(name));
                THashList *parent(FindGroup(dirname.Data()));
                if(!parent) return NULL;
-               return parent->FindObject(name);
+               return parent->FindObject(hname);
+       }
+
+       //______________________________________________________________________________
+       TObject* AliEMCalHistoContainer::FindObject(const TObject* obj) const {
+               /*
+                * Find and object inside the container. The object name is expected to contain the
+                * full path of the histogram object, including parent groups
+                *
+                * @param obj: the object to find
+                * @return: pointer to the object (NULL if not found)
+                */
+               TString dirname(basename(obj->GetName())), hname(histname(obj->GetName()));
+               THashList *parent(FindGroup(dirname.Data()));
+               if(!parent) return NULL;
+               return parent->FindObject(hname);
        }
 
        //______________________________________________________________________________
index 302c29e1a644b62a759f31b2a43aa9659ac9145c..233cbac682a5deb0b2c73ec3a3956314d41ff168 100644 (file)
@@ -114,6 +114,7 @@ public:
 
        THashList *GetListOfHistograms() { return fHistos; }
        virtual TObject *FindObject(const char *name) const;
+       virtual TObject *FindObject(const TObject *obj) const;
 
 private:
        AliEMCalHistoContainer(const AliEMCalHistoContainer &);