//______________________________________________________________________
// AliEveHOMERSourceMap
//
+// AliEveHOMERSourceMap is an abstract container for HLT HOMER sources,
+// see AliHLTHOMERSourceDesc.
+//
+// The concrete implementations AliEveHOMERSourceMapByDet and
+// AliEveHOMERSourceMapByType allow retrieval of HOMER sources in proper
+// order as required for their display in EVE object browser.
+//
ClassImp(AliEveHOMERSourceMap)
AliEveHOMERSourceMap::AliEveHOMERSourceMap(ESourceGrouping_e grouping) :
fGrouping(grouping)
{
-
+ // Constructor.
}
AliEveHOMERSourceMap* AliEveHOMERSourceMap::Create(ESourceGrouping_e grouping)
{
+ // Static constructor - instantiates appropriate sub-class.
+
switch (grouping)
{
case kSG_ByDet: return new AliEveHOMERSourceMapByDet(grouping);
Int_t AliEveHOMERSourceMap::iterator::level()
{
+ // Returns the depth in iteration:
+ // Det / Sub-Det / Sub-Sub-Det / Data-Type.
+
const AliEveHOMERSource::SourceId& sid = id();
Int_t lvl = 0;
void AliEveHOMERSourceMap::PrintXXX()
{
+ // Print entries in the map.
+
for (iterator i = begin(); i != end(); ++i)
{
printf("%*s%s [state=%d, handle=0x%lx] {ssdet='%s'}\n", 4*i.level(), "",
TString AliEveHOMERSourceMapByDet::iterator_imp::description() const
{
+ // Return identifier string for current entry.
+
const AliEveHOMERSource::SourceId& sid = id();
if ( ! sid.fType.IsNull()) return sid.fType;
AliEveHOMERSource::SourceState& sst,
Bool_t def_state)
{
+ // Insert source-state for given source-id.
+ // Does nothing if the entry already exists.
+
Map_i i = fMap.find(sid);
if (i == fMap.end())
{
}
}
-void AliEveHOMERSourceMapByDet::FillMap(TList* handles, Bool_t def_state)
+void AliEveHOMERSourceMapByDet::FillMap(const TList* handles, Bool_t def_state)
{
+ // Fill the map from the list of HOMER source handles.
+
TIter next(handles);
AliHLTHOMERSourceDesc* h;
while ((h = (AliHLTHOMERSourceDesc*) next()))
AliEveHOMERSourceMapByType::AliEveHOMERSourceMapByType(ESourceGrouping_e grouping) :
AliEveHOMERSourceMap(grouping),
fMap()
-{}
+{
+ // Constructor.
+}
TString AliEveHOMERSourceMapByType::iterator_imp::description() const
{
+ // Return identifier string for current entry.
+
const AliEveHOMERSource::SourceId& sid = id();
if ( ! sid.fSSDet.IsNull()) return sid.fSSDet;
AliEveHOMERSource::SourceState& sst,
Bool_t def_state)
{
+ // Insert source-state for given source-id.
+ // Does nothing if the entry already exists.
+
Map_i i = fMap.find(sid);
if (i == fMap.end())
{
}
}
-void AliEveHOMERSourceMapByType::FillMap(TList* handles, Bool_t def_state)
+void AliEveHOMERSourceMapByType::FillMap(const TList* handles, Bool_t def_state)
{
+ // Fill the map from the list of HOMER source handles.
+
TIter next(handles);
AliHLTHOMERSourceDesc* h;
while ((h = (AliHLTHOMERSourceDesc*) next()))
#include <map>
+//______________________________________________________________________________
+//
+// AliEveHOMERSourceMap is an abstract container for HLT HOMER sources.
+// The concrete implementations AliEveHOMERSourceMapByDet and
+// AliEveHOMERSourceMapByType allow retrieval of HOMER sources in proper
+// order as required for their display in EVE object browser.
+
+
class AliEveHOMERSourceMap : public TNamed
{
protected:
static AliEveHOMERSourceMap* Create(ESourceGrouping_e grouping);
- virtual void FillMap(TList* handles, Bool_t def_state) = 0;
+ virtual void FillMap(const TList* handles, Bool_t def_state) = 0;
void PrintXXX();
AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping);
virtual ~AliEveHOMERSourceMapByDet() {}
- virtual void FillMap(TList* handles, Bool_t def_state);
+ virtual void FillMap(const TList* handles, Bool_t def_state);
protected:
typedef std::map<AliEveHOMERSource::SourceId,
AliEveHOMERSourceMapByType(ESourceGrouping_e grouping);
virtual ~AliEveHOMERSourceMapByType() {}
- virtual void FillMap(TList* handles, Bool_t def_state);
+ virtual void FillMap(const TList* handles, Bool_t def_state);
protected:
typedef std::map<AliEveHOMERSource::SourceId,