From b4ac80e0b9a69dfad4588d7c844372e76f6eaad2 Mon Sep 17 00:00:00 2001
From: Frank Gaede <frank.gaede@desy.de>
Date: Tue, 9 Feb 2016 09:52:40 +0000
Subject: [PATCH]  - renamed EMCALO, HADCALo to ELECTROMAGNETIC, HADRONIC in
 DetTypes  - use DetectorSelector in dumpdetector

---
 DDCore/include/DD4hep/DetType.h          | 10 +++++-----
 DDCore/include/DD4hep/DetectorSelector.h |  5 +++--
 UtilityApps/src/dumpdetector.cpp         |  3 ++-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/DDCore/include/DD4hep/DetType.h b/DDCore/include/DD4hep/DetType.h
index f96120303..ddcbbe679 100644
--- a/DDCore/include/DD4hep/DetType.h
+++ b/DDCore/include/DD4hep/DetType.h
@@ -21,7 +21,7 @@ namespace DD4hep {
   /** Helper class for encoding sub detector types in a flag word.
    *  Example:<br>
    *  DetType type( DetType::TRACKER | DetType::STRIP | DetType::BARREL ) ; <br>
-   *  type.is( DetType::EMCALO  ) ; // false <br>
+   *  type.is( DetType::ELECTROMAGNETIC  ) ; // false <br>
    *  type.isNot( DetType::CALORIMETER  ) ; // true <br>
    *  type.is( DetType::STRIP | DetType::BARREL ) ; // true <br>
    *
@@ -48,8 +48,8 @@ namespace DD4hep {
       PIXEL	   = 1 <<  8, 
       GASEOUS	   = 1 <<  9, 
       WIRE	   = 1 << 10, 
-      EMCALO	   = 1 << 11, 
-      HADCALO	   = 1 << 12, 
+      ELECTROMAGNETIC = 1 << 11, 
+      HADRONIC	   = 1 << 12, 
       MUON	   = 1 << 13, 
       SUPPORT      = 1 << 14
     } ;
@@ -106,8 +106,8 @@ namespace DD4hep {
     if( t.is( DetType::PIXEL	    ) ) os << "PIXEL, " ;
     if( t.is( DetType::GASEOUS	    ) ) os << "GASEOUS, " ;
     if( t.is( DetType::WIRE	    ) ) os << "WIRE, " ;
-    if( t.is( DetType::EMCALO	    ) ) os << "EMCALO, " ;
-    if( t.is( DetType::HADCALO	    ) ) os << "HADCALO, " ;
+    if( t.is( DetType::ELECTROMAGNETIC	    ) ) os << "ELECTROMAGNETIC, " ;
+    if( t.is( DetType::HADRONIC	    ) ) os << "HADRONIC, " ;
     if( t.is( DetType::MUON	    ) ) os << "MUON, " ;
     if( t.is( DetType::SUPPORT      ) ) os << "SUPPORT, " ;
     return os ;
diff --git a/DDCore/include/DD4hep/DetectorSelector.h b/DDCore/include/DD4hep/DetectorSelector.h
index e35b45bde..6da55ecb0 100644
--- a/DDCore/include/DD4hep/DetectorSelector.h
+++ b/DDCore/include/DD4hep/DetectorSelector.h
@@ -36,8 +36,9 @@ namespace DD4hep {
      *  or multiple types:
      *  r = selector.detectors("tracker", "calorimeter");
      *
-     *  or selections using DetElement flags (DetElement::typeFlag)
-     *  r = selector.detectors(0x15, 0xFF0);
+     *  or selections using DetType flags, e.g:
+     *  select all barrel trackers but not the Vertex detector
+     *  r = selector.detectors(  DetType::TRACKER | DetType::BARREL  , DetType::VERTEX ) ;
      *
      *  \author  M.Frank
      *  \version 1.0
diff --git a/UtilityApps/src/dumpdetector.cpp b/UtilityApps/src/dumpdetector.cpp
index 4a1ecc4c0..621a9b3ec 100644
--- a/UtilityApps/src/dumpdetector.cpp
+++ b/UtilityApps/src/dumpdetector.cpp
@@ -19,6 +19,7 @@
 // Framework include files
 #include "DD4hep/LCDD.h"
 #include "DD4hep/DetType.h"
+#include "DD4hep/DetectorSelector.h"
 #include "DD4hep/DD4hepUnits.h"
 
 #include "DDRec/Surface.h"
@@ -66,7 +67,7 @@ void printDetectorData( DetElement det ){
 void printDetectorSets( std::string name, unsigned int includeFlag,  unsigned int excludeFlag=DetType::IGNORE ){
 
   LCDD& lcdd = LCDD::getInstance();
-  const std::vector<DetElement>& dets = lcdd.detectors( includeFlag, excludeFlag ) ;
+  const std::vector<DetElement>& dets = DetectorSelector(lcdd).detectors( includeFlag, excludeFlag ) ;
   std::cout << " " << name  ;
   for(int i=0,N=dets.size();i<N;++i)  
     std::cout << dets[i].name() << ", " ;
-- 
GitLab