![]() |
AliRoot Core
edcc906 (edcc906)
|
#include <AliMergeableCollection.h>
Public Member Functions | |
AliMergeableCollection (const char *name="", const char *title="") | |
virtual | ~AliMergeableCollection () |
virtual AliMergeableCollection * | Clone (const char *name="") const |
Bool_t | Attach (AliMergeableCollection *mc, const char *identifier, Bool_t pruneFirstIfAlreadyExists=kFALSE) |
Bool_t | Adopt (TObject *obj) |
Bool_t | Adopt (const char *identifier, TObject *obj) |
virtual void | Browse (TBrowser *b) |
virtual void | Clear (Option_t *option="") |
virtual TObject * | FindObject (const char *fullIdentifier) const |
virtual TObject * | FindObject (const TObject *object) const |
virtual void | Delete (Option_t *option="") |
virtual Int_t | NumberOfObjects () const |
virtual Int_t | NumberOfKeys () const |
TObject * | GetObject (const char *fullIdentifier) const |
TObject * | GetObject (const char *identifier, const char *objectName) const |
TH1 * | Histo (const char *fullIdentifier) const |
TH1 * | Histo (const char *identifier, const char *objectName) const |
TH1 * | H1 (const char *fullIdentifier) const |
TH1 * | H1 (const char *identifier, const char *objectName) const |
TH2 * | H2 (const char *fullIdentifier) const |
TH2 * | H2 (const char *identifier, const char *objectName) const |
TProfile * | Prof (const char *fullIdentifier) const |
TProfile * | Prof (const char *identifier, const char *objectName) const |
virtual AliMergeableCollectionProxy * | CreateProxy (const char *identifier, Bool_t createIfNeeded=kFALSE) |
virtual TIterator * | CreateIterator (Bool_t dir=kIterForward) const |
virtual TList * | CreateListOfKeys (Int_t index) const |
virtual TList * | CreateListOfObjectNames (const char *identifier) const |
virtual TObject * | Remove (const char *fullIdentifier) |
Int_t | RemoveByType (const char *typeName) |
TString | GetKey (const char *identifier, Int_t index, Bool_t idContainsObjName=kFALSE) const |
TString | GetIdentifier (const char *fullIdentifier) const |
TString | GetObjectName (const char *fullIdentifier) const |
void | Print (Option_t *option="") const |
void | ClearMessages () |
void | PrintMessages (const char *prefix="") const |
Long64_t | Merge (TCollection *list) |
AliMergeableCollection * | Project (const char *identifier) const |
UInt_t | EstimateSize (Bool_t show=kFALSE) const |
void | ShowEmptyObjects (Bool_t show=kTRUE) |
Turn on the display of empty objects for the Print method. More... | |
void | PruneEmptyObjects () |
Int_t | Prune (const char *identifier) |
TObject * | GetSum (const char *idPattern) const |
Bool_t | IsEmptyObject (TObject *obj) const |
TObjArray * | SortAllIdentifiers () const |
TString | NormalizeName (const char *identifier, const char *action) const |
TMap * | Map () const |
Static Public Member Functions | |
static Bool_t | MergeObject (TObject *baseObject, TObject *objToAdd) |
static void | CorrectIdentifier (TString &sidentifier) |
Private Member Functions | |
AliMergeableCollection (const AliMergeableCollection &rhs) | |
AliMergeableCollection & | operator= (const AliMergeableCollection &rhs) |
TH1 * | HistoWithAction (const char *identifier, TObject *o, const TString &action) const |
Bool_t | InternalAdopt (const char *identifier, TObject *obj) |
TString | InternalDecode (const char *fullIdentifier, Int_t index) const |
TObject * | InternalObject (const char *identifier, const char *objectName) const |
Private Attributes | |
TMap * | fMap |
Bool_t | fMustShowEmptyObject |
map of TMap of THashList* of TObject*... More... | |
Int_t | fMapVersion |
Whether or not to show empty objects with the Print method. More... | |
std::map< std::string, int > | fMessages |
internal version of map (to avoid custom streamer...) More... | |
Friends | |
class | AliMergeableCollectionIterator |
class | AliMergeableCollectionProxy |
Definition at line 37 of file AliMergeableCollection.h.
AliMergeableCollection::AliMergeableCollection | ( | const char * | name = "" , |
const char * | title = "" |
||
) |
Ctor
Definition at line 57 of file AliMergeableCollection.cxx.
Referenced by Clone(), Project(), and ShowEmptyObjects().
|
virtual |
dtor. Note that the map is owner
Definition at line 64 of file AliMergeableCollection.cxx.
|
private |
Bool_t AliMergeableCollection::Adopt | ( | TObject * | obj | ) |
Adopt a given object at top level (i.e. no key)
Definition at line 72 of file AliMergeableCollection.cxx.
Referenced by AliMergeableCollectionProxy::Adopt(), AssertHistogramsRange(), FillCollection(), AliMUONBusPatchEvolution::FillNumberOfPads(), AliMUONBusPatchEvolution::GroupByChamber(), AliMUONBusPatchEvolution::GroupByDDL(), AliMUONBusPatchEvolution::GroupByDE(), AliMUONBusPatchEvolution::GroupByStation(), AliMergeableCollectionProxy::H1(), AliMUONCDB::MakeBusPatchEvolution(), Merge(), and AliMUONBusPatchEvolution::Normalize().
Bool_t AliMergeableCollection::Adopt | ( | const char * | identifier, |
TObject * | obj | ||
) |
Adopt a given object, and associate it with pair key
Definition at line 94 of file AliMergeableCollection.cxx.
Bool_t AliMergeableCollection::Attach | ( | AliMergeableCollection * | mc, |
const char * | identifier, | ||
Bool_t | pruneFirstIfAlreadyExists = kFALSE |
||
) |
Attach an already existing mergeable collection to this one. It is attached at level identifier/ We take ownership of mc If identifier is already existing we kill it if pruneFirstIfAlreadyExists is kTRUE (and attach mc) otherwise we return kFALSE (and do not attach mc)
Definition at line 105 of file AliMergeableCollection.cxx.
|
virtual |
Create a TFolder structure pointing to our objects, so we can be "browsed"
Definition at line 148 of file AliMergeableCollection.cxx.
|
inlinevirtual |
Definition at line 56 of file AliMergeableCollection.h.
void AliMergeableCollection::ClearMessages | ( | ) |
clear pending messages
Definition at line 211 of file AliMergeableCollection.cxx.
Referenced by H1().
|
virtual |
Clone this collection. We loose the messages.
Definition at line 256 of file AliMergeableCollection.cxx.
Referenced by AliMUONBusPatchEvolutionSubprocessor::ReadFile().
|
static |
Insure identifier has the right number of slashes...
Definition at line 80 of file AliMergeableCollection.cxx.
Referenced by Adopt(), CreateProxy(), and ShowEmptyObjects().
|
virtual |
Create an iterator (must be deleted by the client)
Definition at line 219 of file AliMergeableCollection.cxx.
Referenced by EstimateSize(), FindObject(), AliMUONBusPatchEvolution::GetTimeResolutions(), H1(), AliMergeableCollectionProxy::H1(), NumberOfObjects(), and AliMUONBusPatchEvolution::ShrinkTimeAxis().
|
virtual |
Create the list of keys at level index
Definition at line 310 of file AliMergeableCollection.cxx.
|
virtual |
Create list of object names for /key1/key2/key... Returned list must be deleted by client
Definition at line 336 of file AliMergeableCollection.cxx.
Referenced by Browse(), H1(), and AliMUONBusPatchEvolution::Normalize().
|
virtual |
Create a proxy starting at identifier. If createIfNeeded is true, then the identifier is inserted into the collection if it does not exist yet (in which case this method always returns a non null proxy)
Definition at line 227 of file AliMergeableCollection.cxx.
Referenced by H1().
|
virtual |
Delete all the objects
Definition at line 272 of file AliMergeableCollection.cxx.
Referenced by Clear().
UInt_t AliMergeableCollection::EstimateSize | ( | Bool_t | show = kFALSE | ) | const |
Estimate the memory (in kilobytes) used by some objects
Definition at line 1204 of file AliMergeableCollection.cxx.
Referenced by H1(), and AliMUONBusPatchEvolutionSubprocessor::Initialize().
|
virtual |
Find an object by its full identifier.
Definition at line 285 of file AliMergeableCollection.cxx.
Referenced by Clear().
|
virtual |
Find an object
Definition at line 294 of file AliMergeableCollection.cxx.
TString AliMergeableCollection::GetIdentifier | ( | const char * | fullIdentifier | ) | const |
Extract the identifier from the fullIdentifier
Definition at line 369 of file AliMergeableCollection.cxx.
Referenced by AssertHistogramsRange(), GetObject(), H1(), Histo(), and Remove().
TString AliMergeableCollection::GetKey | ( | const char * | identifier, |
Int_t | index, | ||
Bool_t | idContainsObjName = kFALSE |
||
) | const |
Extract the index element of the key pair from the fullIdentifier
Definition at line 388 of file AliMergeableCollection.cxx.
Referenced by CreateListOfKeys(), GetSum(), H1(), and Print().
TObject * AliMergeableCollection::GetObject | ( | const char * | fullIdentifier | ) | const |
TObject * AliMergeableCollection::GetObject | ( | const char * | identifier, |
const char * | objectName | ||
) | const |
Get object for (identifier,objectName) triplet
Definition at line 626 of file AliMergeableCollection.cxx.
TString AliMergeableCollection::GetObjectName | ( | const char * | fullIdentifier | ) | const |
Extract the object name from an identifier
Definition at line 404 of file AliMergeableCollection.cxx.
Referenced by GetObject(), H1(), and Histo().
TObject * AliMergeableCollection::GetSum | ( | const char * | idPattern | ) | const |
Sum objects The pattern must be in the form: /key1_1,key1_2,.../key2_1,key2_2,.../.../objectName_1,objectName_2... The logical or between patterns separated by commas is taken Exact match is required for keys and objectNames
Definition at line 640 of file AliMergeableCollection.cxx.
Referenced by ShowEmptyObjects().
|
inline |
Definition at line 74 of file AliMergeableCollection.h.
|
inline |
Definition at line 75 of file AliMergeableCollection.h.
TH2 * AliMergeableCollection::H2 | ( | const char * | fullIdentifier | ) | const |
Short-cut method to grab a 2D histogram Will return 0x0 if the object if not a TH2xxx
Definition at line 538 of file AliMergeableCollection.cxx.
Referenced by H1(), and AliMergeableCollectionProxy::H1().
TH2 * AliMergeableCollection::H2 | ( | const char * | identifier, |
const char * | objectName | ||
) | const |
Short-cut method to grab a 2D histogram Will return 0x0 if the object if not a TH2xxx
Definition at line 554 of file AliMergeableCollection.cxx.
TH1 * AliMergeableCollection::Histo | ( | const char * | fullIdentifier | ) | const |
Get histogram key1/key2/.../objectName:action action is used for 2D histograms : might be px for projection along x-axis py for projection along y-axis pfx for profile along x-axis pfy for profile along y-axis
Definition at line 413 of file AliMergeableCollection.cxx.
Referenced by AssertHistogramsRange(), Clear(), AliMUONBusPatchEvolution::FillNumberOfPads(), AliMUONBusPatchEvolution::GetFaultyBusPatches(), AliMUONBusPatchEvolution::GroupByChamber(), AliMUONBusPatchEvolution::GroupByDDL(), AliMUONBusPatchEvolution::GroupByDE(), AliMUONBusPatchEvolution::GroupByStation(), H1(), AliMergeableCollectionProxy::H1(), AliMUONBusPatchEvolution::Normalize(), PlotBusPatchOccupancies(), PlotChamberOccupancies(), PlotDDLOccupancies(), PlotDEOccupancies(), and PlotStationOccupancies().
TH1 * AliMergeableCollection::Histo | ( | const char * | identifier, |
const char * | objectName | ||
) | const |
Get histogram key1/key2/.../objectName:action action is used for 2D histograms : might be px for projection along x-axis py for projection along y-axis pfx for profile along x-axis pfy for profile along y-axis
Definition at line 460 of file AliMergeableCollection.cxx.
|
private |
Convert o to an histogram if possible, applying a given action if there
Definition at line 499 of file AliMergeableCollection.cxx.
Referenced by Histo(), AliMergeableCollectionProxy::Histo(), and ShowEmptyObjects().
|
private |
Adopt an obj
Definition at line 729 of file AliMergeableCollection.cxx.
Referenced by Adopt(), Project(), and ShowEmptyObjects().
|
private |
Extract the index-th element of the identifier (/key1/key2/.../keyN/objectName) object is index=-1 (i.e. last)
Definition at line 774 of file AliMergeableCollection.cxx.
Referenced by GetIdentifier(), GetKey(), GetObjectName(), and ShowEmptyObjects().
|
private |
Get object for (identifier,objectName)
Definition at line 816 of file AliMergeableCollection.cxx.
Referenced by GetObject(), and ShowEmptyObjects().
Bool_t AliMergeableCollection::IsEmptyObject | ( | TObject * | obj | ) | const |
Check if object is empty (done only for TH1, so far)
Definition at line 845 of file AliMergeableCollection.cxx.
Referenced by Print(), PruneEmptyObjects(), and ShowEmptyObjects().
TMap * AliMergeableCollection::Map | ( | ) | const |
Wrapper to insure proper key formats (i.e. new vs old)
Definition at line 861 of file AliMergeableCollection.cxx.
Referenced by Attach(), CreateListOfObjectNames(), CreateProxy(), GetSum(), InternalAdopt(), InternalObject(), Merge(), AliMergeableCollectionIterator::Next(), Print(), Project(), Prune(), PruneEmptyObjects(), Remove(), RemoveByType(), ShowEmptyObjects(), and SortAllIdentifiers().
Long64_t AliMergeableCollection::Merge | ( | TCollection * | list | ) |
Definition at line 912 of file AliMergeableCollection.cxx.
Referenced by H1().
|
static |
Add objToAdd to baseObject
Definition at line 976 of file AliMergeableCollection.cxx.
Referenced by GetSum(), Merge(), and ShowEmptyObjects().
TString AliMergeableCollection::NormalizeName | ( | const char * | identifier, |
const char * | action | ||
) | const |
Replace / by _ to build a root-compliant histo name
Definition at line 1001 of file AliMergeableCollection.cxx.
Referenced by HistoWithAction(), and ShowEmptyObjects().
|
virtual |
Get the number of keys we have
Definition at line 1028 of file AliMergeableCollection.cxx.
|
virtual |
Get the number of objects we hold
Definition at line 1017 of file AliMergeableCollection.cxx.
Referenced by Clear(), Print(), and AliMUONBusPatchEvolutionSubprocessor::Process().
|
private |
Referenced by AliMergeableCollectionIterator::AliMergeableCollectionIterator(), and ShowEmptyObjects().
void AliMergeableCollection::Print | ( | Option_t * | option = "" | ) | const |
Print all the objects we hold, in a hopefully visually pleasing way.
Option can be used to select given part only, using the schema : /*/*/*/*/* Where the stars are wilcards for /key1/key2/.../objectName
if * is used it is assumed to be a wildcard for objectName
For other selections the full syntax /*/*/*/*/* must be used.
Use "-" as objectName to disable object's name output
One might also use /*/*/*/*/:classname syntax to restrict output to only those objects matching a given classname pattern
Definition at line 1036 of file AliMergeableCollection.cxx.
Referenced by H1(), AliMergeableCollectionProxy::H1(), and AliMUONBusPatchEvolutionSubprocessor::Print().
void AliMergeableCollection::PrintMessages | ( | const char * | prefix = "" | ) | const |
Print pending messages
Definition at line 1189 of file AliMergeableCollection.cxx.
Referenced by H1().
TProfile * AliMergeableCollection::Prof | ( | const char * | fullIdentifier | ) | const |
Short-cut method to grab a TProfile histogram Will return 0x0 if the object if not a TProfile
Definition at line 571 of file AliMergeableCollection.cxx.
Referenced by H1(), and AliMergeableCollectionProxy::H1().
TProfile * AliMergeableCollection::Prof | ( | const char * | identifier, |
const char * | objectName | ||
) | const |
Short-cut method to grab a TProfile histogram Will return 0x0 if the object if not a TProfile
Definition at line 587 of file AliMergeableCollection.cxx.
AliMergeableCollection * AliMergeableCollection::Project | ( | const char * | identifier | ) | const |
To be implemented : would create a new collection starting at /key1/key2/...
Definition at line 1355 of file AliMergeableCollection.cxx.
Referenced by H1().
Int_t AliMergeableCollection::Prune | ( | const char * | identifier | ) |
Definition at line 1299 of file AliMergeableCollection.cxx.
Referenced by Attach(), and ShowEmptyObjects().
void AliMergeableCollection::PruneEmptyObjects | ( | ) |
Delete the empty objects (Implemented for TH1 only)
Definition at line 1323 of file AliMergeableCollection.cxx.
Referenced by ShowEmptyObjects().
|
virtual |
Remove a given object (given its fullIdentifier=/key1/key2/.../objectName)
Note that we do not remove the /key1/key2/... entry even if there's no more object for this triplet.
Not very efficient. Could be improved ?
Definition at line 1395 of file AliMergeableCollection.cxx.
Referenced by AssertHistogramsRange(), H1(), and PruneEmptyObjects().
Int_t AliMergeableCollection::RemoveByType | ( | const char * | typeName | ) |
Remove all the objects in this collection that are of a given type
Definition at line 1434 of file AliMergeableCollection.cxx.
Referenced by H1().
|
inline |
Turn on the display of empty objects for the Print method.
Definition at line 113 of file AliMergeableCollection.h.
TObjArray * AliMergeableCollection::SortAllIdentifiers | ( | ) | const |
Sort our internal identifiers. Returned array must be deleted.
Definition at line 1462 of file AliMergeableCollection.cxx.
Referenced by Browse(), CreateListOfKeys(), AliMUONBusPatchEvolution::Normalize(), Print(), and ShowEmptyObjects().
|
friend |
Definition at line 39 of file AliMergeableCollection.h.
Referenced by AliMergeableCollectionIterator::AliMergeableCollectionIterator(), and CreateIterator().
|
friend |
Definition at line 40 of file AliMergeableCollection.h.
Referenced by CreateProxy().
|
mutableprivate |
Definition at line 151 of file AliMergeableCollection.h.
Referenced by Attach(), Clone(), CreateIterator(), Delete(), InternalObject(), Map(), Merge(), AliMergeableCollectionIterator::Next(), NumberOfKeys(), Project(), and ~AliMergeableCollection().
|
mutableprivate |
Whether or not to show empty objects with the Print method.
Definition at line 153 of file AliMergeableCollection.h.
|
mutableprivate |
internal version of map (to avoid custom streamer...)
Definition at line 154 of file AliMergeableCollection.h.
Referenced by ClearMessages(), InternalObject(), and PrintMessages().
|
private |
map of TMap of THashList* of TObject*...
Definition at line 152 of file AliMergeableCollection.h.
Referenced by Clone(), Print(), and ShowEmptyObjects().