Move sub-classes AliEveHOMERSourceMapByDet and
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Mar 2010 10:40:24 +0000 (10:40 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Mar 2010 10:40:24 +0000 (10:40 +0000)
AliEveHOMERSourceMapByType to their own h/cxx files.

EVE/EveHLT/AliEveHOMERSourceMap.cxx
EVE/EveHLT/AliEveHOMERSourceMap.h
EVE/EveHLT/AliEveHOMERSourceMapByDet.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveHOMERSourceMapByDet.h [new file with mode: 0644]
EVE/EveHLT/AliEveHOMERSourceMapByType.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveHOMERSourceMapByType.h [new file with mode: 0644]

index c488221..ad92fed 100644 (file)
@@ -8,12 +8,8 @@
  **************************************************************************/
 
 #include "AliEveHOMERSourceMap.h"
-#include <AliHLTHOMERSourceDesc.h>
-
-#include <TList.h>
 
 //______________________________________________________________________
-// AliEveHOMERSourceMap
 //
 // AliEveHOMERSourceMap is an abstract container for HLT HOMER sources,
 // see AliHLTHOMERSourceDesc.
@@ -70,146 +66,3 @@ void AliEveHOMERSourceMap::PrintXXX()
           i.id().fSSDet.Data());
   }
 }
-
-/******************************************************************************/
-// AliEveHOMERSourceMapByDet
-/******************************************************************************/
-
-AliEveHOMERSourceMapByDet::AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping) :
-  AliEveHOMERSourceMap(grouping),
-  fMap()
-{}
-
-TString AliEveHOMERSourceMapByDet::iterator_imp::description() const
-{
-  // Return identifier string for current entry.
-
-  const AliEveHOMERSource::SourceId& sid = id();
-
-  if ( ! sid.fType.IsNull())  return sid.fType;
-  if ( ! sid.fSSDet.IsNull()) return sid.fSSDet;
-  if ( ! sid.fSDet.IsNull())  return sid.fSDet;
-  if ( ! sid.fDet.IsNull())   return sid.fDet;
-  return "<empty>";
-}
-
-void AliEveHOMERSourceMapByDet::insert(AliEveHOMERSource::SourceId& sid,
-                                      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())
-  {
-    // Check wildcard, else
-    sst.fState = def_state;
-    fMap.insert(std::make_pair(sid, sst));
-  }
-}
-
-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()))
-  {
-    AliEveHOMERSource::SourceId    srcid;
-    AliEveHOMERSource::SourceState srcst;
-
-    srcid.fDet = h->GetDetector();
-    insert(srcid, srcst, def_state);
-
-    srcid.fSDet = h->GetSubDetector();
-    if ( ! srcid.fSDet.IsNull())  insert(srcid, srcst, def_state);
-
-    srcid.fSSDet = h->GetSubSubDetector();
-    if ( ! srcid.fSSDet.IsNull()) insert(srcid, srcst, def_state);
-
-    srcid.fType   = h->GetDataType();
-    srcst.fHandle = h;
-    insert(srcid, srcst, def_state);
-  }
-}
-
-
-/******************************************************************************/
-// AliEveHOMERSourceMapByType
-/******************************************************************************/
-
-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;
-  if ( ! sid.fSDet.IsNull())  return sid.fSDet;
-  if ( ! sid.fDet.IsNull())   return sid.fDet;
-  if ( ! sid.fType.IsNull())  return sid.fType;
-  return "<empty>";
-}
-
-void AliEveHOMERSourceMapByType::insert(AliEveHOMERSource::SourceId& sid,
-                                       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())
-  {
-    // Check wildcard, else
-    sst.fState = def_state;
-    fMap.insert(std::make_pair(sid, sst));
-  }
-}
-
-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()))
-  {
-    AliEveHOMERSource::SourceId    srcid;
-    AliEveHOMERSource::SourceState srcst;
-
-    srcid.fType   = h->GetDataType();
-    insert(srcid, srcst, def_state);
-
-    srcid.fDet = h->GetDetector();
-    if (h->GetSubDetector() == 0)
-    {
-      srcst.fHandle = h;
-      insert(srcid, srcst, def_state);
-      continue;
-    }
-    insert(srcid, srcst, def_state);
-
-    srcid.fSDet = h->GetSubDetector();
-    if (h->GetSubSubDetector() == 0)
-    {
-      srcst.fHandle = h;
-      insert(srcid, srcst, def_state);
-      continue;
-    }
-    insert(srcid, srcst, def_state);
-
-    srcid.fSSDet  = h->GetSubSubDetector();
-    srcst.fHandle = h;
-    insert(srcid, srcst, def_state);
-  }
-}
index 325be61..5acfba7 100644 (file)
@@ -102,105 +102,11 @@ protected:
   ClassDef(AliEveHOMERSourceMap, 0); // A map of HOMER sources.
 };
 
-/******************************************************************************/
 
-class AliEveHOMERSourceMapByDet : public AliEveHOMERSourceMap
-{
-public:
-  AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping);
-  virtual ~AliEveHOMERSourceMapByDet() {}
-
-  virtual void FillMap(const TList* handles, Bool_t def_state);
-
-protected:
-  typedef std::map<AliEveHOMERSource::SourceId,
-                  AliEveHOMERSource::SourceState,
-                  AliEveHOMERSource::SourceId::CmpByDet>  Map_t;
-  typedef Map_t::iterator                                  Map_i;
-
-  Map_t fMap;
-
-  struct iterator_imp : public iterator_imp_base,
-                       public Map_i
-  {
-    iterator_imp()         : Map_i()   {}
-    iterator_imp(Map_i mi) : Map_i(mi) {}
-    virtual ~iterator_imp() {}
-
-    virtual const AliEveHOMERSource::SourceId&    id()    const { return Map_i::operator*().first; }
-    virtual const AliEveHOMERSource::SourceState& state() const { return Map_i::operator*().second; }
-    virtual       AliEveHOMERSource::SourceState& state() { return Map_i::operator*().second; }
-
-    virtual iterator_imp* clone() const
-    { return new iterator_imp(*this); }
-
-    virtual iterator_imp& operator++()
-    { Map_i::operator++(); return *this; }
-
-    virtual bool operator!=(const iterator_imp_base& rhs) const
-    { const Map_i &lhs = *this; return lhs != dynamic_cast<const Map_i&>(rhs); }
-
-    virtual TString description() const;
-  };
-
-  void insert(AliEveHOMERSource::SourceId& sid, AliEveHOMERSource::SourceState& sst, Bool_t def_state);
-
-  virtual iterator_imp_base* iterator_imp_new()   { return new iterator_imp; }
-  virtual iterator_imp_base* iterator_imp_begin() { return new iterator_imp(fMap.begin()); }
-  virtual iterator_imp_base* iterator_imp_end()   { return new iterator_imp(fMap.end());   }
-
-
-  // ClassDef(AliEveHOMERSourceMapByDet, 0);
-};
+// Include concrete implementations (used to be in the same file).
 
-/******************************************************************************/
+#include "AliEveHOMERSourceMapByDet.h"
+#include "AliEveHOMERSourceMapByType.h"
 
-class AliEveHOMERSourceMapByType : public AliEveHOMERSourceMap
-{
-public:
-  AliEveHOMERSourceMapByType(ESourceGrouping_e grouping);
-  virtual ~AliEveHOMERSourceMapByType() {}
-
-  virtual void FillMap(const TList* handles, Bool_t def_state);
-
-protected:
-  typedef std::map<AliEveHOMERSource::SourceId,
-                  AliEveHOMERSource::SourceState,
-                  AliEveHOMERSource::SourceId::CmpByType> Map_t;
-  typedef Map_t::iterator                                  Map_i;
-
-  Map_t fMap;
-
-  struct iterator_imp : public iterator_imp_base,
-                       public Map_i
-  {
-    iterator_imp()         : Map_i()   {}
-    iterator_imp(Map_i mi) : Map_i(mi) {}
-    virtual ~iterator_imp() {}
-
-    virtual const AliEveHOMERSource::SourceId&    id()    const { return Map_i::operator*().first; }
-    virtual const AliEveHOMERSource::SourceState& state() const { return Map_i::operator*().second; }
-    virtual       AliEveHOMERSource::SourceState& state() { return Map_i::operator*().second; }
-
-    virtual iterator_imp* clone() const
-    { return new iterator_imp(*this); }
-
-    virtual iterator_imp& operator++()
-    { Map_i::operator++(); return *this; }
-
-    virtual bool operator!=(const iterator_imp_base& rhs) const
-    { const Map_i &lhs = *this; return lhs != dynamic_cast<const Map_i&>(rhs); }
-
-    virtual TString description() const;
-  };
-
-  void insert(AliEveHOMERSource::SourceId& sid, AliEveHOMERSource::SourceState& sst, Bool_t def_state);
-
-  virtual iterator_imp_base* iterator_imp_new()   { return new iterator_imp; }
-  virtual iterator_imp_base* iterator_imp_begin() { return new iterator_imp(fMap.begin()); }
-  virtual iterator_imp_base* iterator_imp_end()   { return new iterator_imp(fMap.end());   }
-
-  // ClassDef(AliEveHOMERSourceMapByType, 0);
-};
 
 #endif
diff --git a/EVE/EveHLT/AliEveHOMERSourceMapByDet.cxx b/EVE/EveHLT/AliEveHOMERSourceMapByDet.cxx
new file mode 100644 (file)
index 0000000..8a485a6
--- /dev/null
@@ -0,0 +1,83 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#include "AliEveHOMERSourceMapByDet.h"
+#include <AliHLTHOMERSourceDesc.h>
+
+#include <TList.h>
+
+//______________________________________________________________________
+//
+// 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.
+// 
+
+AliEveHOMERSourceMapByDet::AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping) :
+  AliEveHOMERSourceMap(grouping),
+  fMap()
+{}
+
+TString AliEveHOMERSourceMapByDet::iterator_imp::description() const
+{
+  // Return identifier string for current entry.
+
+  const AliEveHOMERSource::SourceId& sid = id();
+
+  if ( ! sid.fType.IsNull())  return sid.fType;
+  if ( ! sid.fSSDet.IsNull()) return sid.fSSDet;
+  if ( ! sid.fSDet.IsNull())  return sid.fSDet;
+  if ( ! sid.fDet.IsNull())   return sid.fDet;
+  return "<empty>";
+}
+
+void AliEveHOMERSourceMapByDet::insert(AliEveHOMERSource::SourceId& sid,
+                                      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())
+  {
+    // Check wildcard, else
+    sst.fState = def_state;
+    fMap.insert(std::make_pair(sid, sst));
+  }
+}
+
+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()))
+  {
+    AliEveHOMERSource::SourceId    srcid;
+    AliEveHOMERSource::SourceState srcst;
+
+    srcid.fDet = h->GetDetector();
+    insert(srcid, srcst, def_state);
+
+    srcid.fSDet = h->GetSubDetector();
+    if ( ! srcid.fSDet.IsNull())  insert(srcid, srcst, def_state);
+
+    srcid.fSSDet = h->GetSubSubDetector();
+    if ( ! srcid.fSSDet.IsNull()) insert(srcid, srcst, def_state);
+
+    srcid.fType   = h->GetDataType();
+    srcst.fHandle = h;
+    insert(srcid, srcst, def_state);
+  }
+}
diff --git a/EVE/EveHLT/AliEveHOMERSourceMapByDet.h b/EVE/EveHLT/AliEveHOMERSourceMapByDet.h
new file mode 100644 (file)
index 0000000..fc2bdbf
--- /dev/null
@@ -0,0 +1,71 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifndef AliEveAliEveHOMERSourceMapByDet_H
+#define AliEveAliEveHOMERSourceMapByDet_H
+
+#include "AliEveHOMERSourceMap.h"
+
+//______________________________________________________________________________
+//
+// 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 AliEveHOMERSourceMapByDet : public AliEveHOMERSourceMap
+{
+public:
+  AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping);
+  virtual ~AliEveHOMERSourceMapByDet() {}
+
+  virtual void FillMap(const TList* handles, Bool_t def_state);
+
+protected:
+  typedef std::map<AliEveHOMERSource::SourceId,
+                  AliEveHOMERSource::SourceState,
+                  AliEveHOMERSource::SourceId::CmpByDet>  Map_t;
+  typedef Map_t::iterator                                  Map_i;
+
+  Map_t fMap;
+
+  struct iterator_imp : public iterator_imp_base,
+                       public Map_i
+  {
+    iterator_imp()         : Map_i()   {}
+    iterator_imp(Map_i mi) : Map_i(mi) {}
+    virtual ~iterator_imp() {}
+
+    virtual const AliEveHOMERSource::SourceId&    id()    const { return Map_i::operator*().first; }
+    virtual const AliEveHOMERSource::SourceState& state() const { return Map_i::operator*().second; }
+    virtual       AliEveHOMERSource::SourceState& state() { return Map_i::operator*().second; }
+
+    virtual iterator_imp* clone() const
+    { return new iterator_imp(*this); }
+
+    virtual iterator_imp& operator++()
+    { Map_i::operator++(); return *this; }
+
+    virtual bool operator!=(const iterator_imp_base& rhs) const
+    { const Map_i &lhs = *this; return lhs != dynamic_cast<const Map_i&>(rhs); }
+
+    virtual TString description() const;
+  };
+
+  void insert(AliEveHOMERSource::SourceId& sid, AliEveHOMERSource::SourceState& sst, Bool_t def_state);
+
+  virtual iterator_imp_base* iterator_imp_new()   { return new iterator_imp; }
+  virtual iterator_imp_base* iterator_imp_begin() { return new iterator_imp(fMap.begin()); }
+  virtual iterator_imp_base* iterator_imp_end()   { return new iterator_imp(fMap.end());   }
+
+
+  // ClassDef(AliEveHOMERSourceMapByDet, 0);
+};
+
+#endif
diff --git a/EVE/EveHLT/AliEveHOMERSourceMapByType.cxx b/EVE/EveHLT/AliEveHOMERSourceMapByType.cxx
new file mode 100644 (file)
index 0000000..3e8d4b6
--- /dev/null
@@ -0,0 +1,97 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#include "AliEveHOMERSourceMapByType.h"
+#include <AliHLTHOMERSourceDesc.h>
+
+#include <TList.h>
+
+//______________________________________________________________________
+//
+// 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.
+// 
+
+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;
+  if ( ! sid.fSDet.IsNull())  return sid.fSDet;
+  if ( ! sid.fDet.IsNull())   return sid.fDet;
+  if ( ! sid.fType.IsNull())  return sid.fType;
+  return "<empty>";
+}
+
+void AliEveHOMERSourceMapByType::insert(AliEveHOMERSource::SourceId& sid,
+                                       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())
+  {
+    // Check wildcard, else
+    sst.fState = def_state;
+    fMap.insert(std::make_pair(sid, sst));
+  }
+}
+
+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()))
+  {
+    AliEveHOMERSource::SourceId    srcid;
+    AliEveHOMERSource::SourceState srcst;
+
+    srcid.fType   = h->GetDataType();
+    insert(srcid, srcst, def_state);
+
+    srcid.fDet = h->GetDetector();
+    if (h->GetSubDetector() == 0)
+    {
+      srcst.fHandle = h;
+      insert(srcid, srcst, def_state);
+      continue;
+    }
+    insert(srcid, srcst, def_state);
+
+    srcid.fSDet = h->GetSubDetector();
+    if (h->GetSubSubDetector() == 0)
+    {
+      srcst.fHandle = h;
+      insert(srcid, srcst, def_state);
+      continue;
+    }
+    insert(srcid, srcst, def_state);
+
+    srcid.fSSDet  = h->GetSubSubDetector();
+    srcst.fHandle = h;
+    insert(srcid, srcst, def_state);
+  }
+}
diff --git a/EVE/EveHLT/AliEveHOMERSourceMapByType.h b/EVE/EveHLT/AliEveHOMERSourceMapByType.h
new file mode 100644 (file)
index 0000000..38cc4e2
--- /dev/null
@@ -0,0 +1,70 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifndef AliEveAliEveHOMERSourceMapByType_H
+#define AliEveAliEveHOMERSourceMapByType_H
+
+#include "AliEveHOMERSourceMap.h"
+
+//______________________________________________________________________________
+//
+// 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 AliEveHOMERSourceMapByType : public AliEveHOMERSourceMap
+{
+public:
+  AliEveHOMERSourceMapByType(ESourceGrouping_e grouping);
+  virtual ~AliEveHOMERSourceMapByType() {}
+
+  virtual void FillMap(const TList* handles, Bool_t def_state);
+
+protected:
+  typedef std::map<AliEveHOMERSource::SourceId,
+                  AliEveHOMERSource::SourceState,
+                  AliEveHOMERSource::SourceId::CmpByType> Map_t;
+  typedef Map_t::iterator                                  Map_i;
+
+  Map_t fMap;
+
+  struct iterator_imp : public iterator_imp_base,
+                       public Map_i
+  {
+    iterator_imp()         : Map_i()   {}
+    iterator_imp(Map_i mi) : Map_i(mi) {}
+    virtual ~iterator_imp() {}
+
+    virtual const AliEveHOMERSource::SourceId&    id()    const { return Map_i::operator*().first; }
+    virtual const AliEveHOMERSource::SourceState& state() const { return Map_i::operator*().second; }
+    virtual       AliEveHOMERSource::SourceState& state() { return Map_i::operator*().second; }
+
+    virtual iterator_imp* clone() const
+    { return new iterator_imp(*this); }
+
+    virtual iterator_imp& operator++()
+    { Map_i::operator++(); return *this; }
+
+    virtual bool operator!=(const iterator_imp_base& rhs) const
+    { const Map_i &lhs = *this; return lhs != dynamic_cast<const Map_i&>(rhs); }
+
+    virtual TString description() const;
+  };
+
+  void insert(AliEveHOMERSource::SourceId& sid, AliEveHOMERSource::SourceState& sst, Bool_t def_state);
+
+  virtual iterator_imp_base* iterator_imp_new()   { return new iterator_imp; }
+  virtual iterator_imp_base* iterator_imp_begin() { return new iterator_imp(fMap.begin()); }
+  virtual iterator_imp_base* iterator_imp_end()   { return new iterator_imp(fMap.end());   }
+
+  // ClassDef(AliEveHOMERSourceMapByType, 0);
+};
+
+#endif