diff --git a/DDCore/include/DD4hep/DetType.h b/DDCore/include/DD4hep/DetType.h index f96120303bd84d5dac07295c8de60898d8da0696..ddcbbe679a6631252415be564d0b3521e4577507 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 e35b45bdec935cf59c5071388b470c819b18fc1e..6da55ecb0ae014bc0c6da1194b4fffa8dd58f9e6 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 4a1ecc4c000f2acab8ba8f1a40f2c0ba1243f6f3..621a9b3ec2dc74f934338995b62c4201e54b89b3 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() << ", " ;