2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveHOMERSourceMapByType.h"
11 #include <AliHLTHOMERSourceDesc.h>
15 //______________________________________________________________________
17 // AliEveHOMERSourceMap is an abstract container for HLT HOMER sources,
18 // see AliHLTHOMERSourceDesc.
20 // The concrete implementations AliEveHOMERSourceMapByDet and
21 // AliEveHOMERSourceMapByType allow retrieval of HOMER sources in proper
22 // order as required for their display in EVE object browser.
25 AliEveHOMERSourceMapByType::AliEveHOMERSourceMapByType(ESourceGrouping_e grouping) :
26 AliEveHOMERSourceMap(grouping),
32 TString AliEveHOMERSourceMapByType::iterator_imp::description() const
34 // Return identifier string for current entry.
36 const AliEveHOMERSource::SourceId& sid = id();
38 if ( ! sid.fSSDet.IsNull()) return sid.fSSDet;
39 if ( ! sid.fSDet.IsNull()) return sid.fSDet;
40 if ( ! sid.fDet.IsNull()) return sid.fDet;
41 if ( ! sid.fType.IsNull()) return sid.fType;
45 void AliEveHOMERSourceMapByType::insert(AliEveHOMERSource::SourceId& sid,
46 AliEveHOMERSource::SourceState& sst,
49 // Insert source-state for given source-id.
50 // Does nothing if the entry already exists.
52 Map_i i = fMap.find(sid);
55 // Check wildcard, else
56 sst.fState = def_state;
57 fMap.insert(std::make_pair(sid, sst));
61 void AliEveHOMERSourceMapByType::FillMap(const TList* handles, Bool_t def_state)
63 // Fill the map from the list of HOMER source handles.
66 AliHLTHOMERSourceDesc* h;
67 while ((h = (AliHLTHOMERSourceDesc*) next()))
69 AliEveHOMERSource::SourceId srcid;
70 AliEveHOMERSource::SourceState srcst;
72 srcid.fType = h->GetDataType();
73 insert(srcid, srcst, def_state);
75 srcid.fDet = h->GetDetector();
76 if (h->GetSubDetector() == 0)
79 insert(srcid, srcst, def_state);
82 insert(srcid, srcst, def_state);
84 srcid.fSDet = h->GetSubDetector();
85 if (h->GetSubSubDetector() == 0)
88 insert(srcid, srcst, def_state);
91 insert(srcid, srcst, def_state);
93 srcid.fSSDet = h->GetSubSubDetector();
95 insert(srcid, srcst, def_state);