DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Public Attributes | List of all members
dd4hep::DetectorSelector Class Reference

View on Detector to select detectors according to certain criteria. More...

#include <DetectorSelector.h>

Public Types

typedef std::vector< DetElementResult
 Result set definition. More...
 

Public Member Functions

 DetectorSelector (Detector &_description)
 Default constructor. More...
 
 ~DetectorSelector ()
 Default destructor. More...
 
const Resultdetectors (const std::string &type)
 Access a set of subdetectors according to the sensitive type. More...
 
Result detectors (const std::string &type1, const std::string &type2, const std::string &type3="", const std::string &type4="", const std::string &type5="")
 Access a set of subdetectors according to several sensitive types. More...
 
Result detectors (unsigned int includeFlag, unsigned int excludeFlag=0) const
 

Public Attributes

Detectordescription
 Reference to main detector description object. More...
 

Detailed Description

View on Detector to select detectors according to certain criteria.

Usage:

Detector& lcd = ....; DetectorSelector selector(description); DetectorSelector::Result r = selector.detectors("tracker");

or multiple types: r = selector.detectors("tracker", "calorimeter");

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

Definition at line 41 of file DetectorSelector.h.

Member Typedef Documentation

◆ Result

Result set definition.

Definition at line 44 of file DetectorSelector.h.

Constructor & Destructor Documentation

◆ DetectorSelector()

dd4hep::DetectorSelector::DetectorSelector ( Detector _description)
inline

Default constructor.

Definition at line 53 of file DetectorSelector.h.

◆ ~DetectorSelector()

dd4hep::DetectorSelector::~DetectorSelector ( )
inline

Default destructor.

Definition at line 56 of file DetectorSelector.h.

Member Function Documentation

◆ detectors() [1/3]

const DetectorSelector::Result & DetectorSelector::detectors ( const std::string &  type)

Access a set of subdetectors according to the sensitive type.

Please note:

  • The sensitive type of a detector is set in the 'detector constructor'.
  • Not sensitive detector structures have the name 'passive'
  • Compounds (ie. nested detectors) are of type 'compound'

Definition at line 21 of file DetectorSelector.cpp.

◆ detectors() [2/3]

DetectorSelector::Result DetectorSelector::detectors ( const std::string &  type1,
const std::string &  type2,
const std::string &  type3 = "",
const std::string &  type4 = "",
const std::string &  type5 = "" 
)

Access a set of subdetectors according to several sensitive types.

Definition at line 28 of file DetectorSelector.cpp.

◆ detectors() [3/3]

DetectorSelector::Result DetectorSelector::detectors ( unsigned int  includeFlag,
unsigned int  excludeFlag = 0 
) const

return a vector with all detectors that have all the type properties in includeFlag set but none of the properties given in excludeFlag

Definition at line 51 of file DetectorSelector.cpp.

Member Data Documentation

◆ description

Detector& dd4hep::DetectorSelector::description

Reference to main detector description object.

Definition at line 47 of file DetectorSelector.h.


The documentation for this class was generated from the following files: