DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
dd4hep::DetType Class Reference

Helper class for encoding sub detector types in a flag word. More...

#include <DetType.h>

Public Types

enum  DetectorTypeEnumeration {
  IGNORE = 0, TRACKER = 1 << 0, CALORIMETER = 1 << 1, CHERENKOV = 1 << 2,
  ENDCAP = 1 << 3, BARREL = 1 << 4, FORWARD = 1 << 5, VERTEX = 1 << 6,
  STRIP = 1 << 7, PIXEL = 1 << 8, GASEOUS = 1 << 9, WIRE = 1 << 10,
  ELECTROMAGNETIC = 1 << 11, HADRONIC = 1 << 12, MUON = 1 << 13, SUPPORT = 1 << 14,
  BEAMPIPE = 1 << 15, COIL = 1 << 16, AUXILIARY = 1 << 17
}
 Different detector type flags. More...
 

Public Member Functions

 DetType ()
 default c'tor More...
 
 DetType (unsigned long types)
 
void set (unsigned long prop)
 set additional properties More...
 
void unset (unsigned long prop)
 unset the given properties More...
 
bool is (unsigned long prop) const
 true if detector has all properties More...
 
bool isNot (unsigned long prop) const
 true if detector has none of the given properties More...
 
unsigned long to_ulong () const
 return the flag word More...
 

Private Attributes

unsigned long _type
 

Friends

std::ostream & operator<< (std::ostream &os, const DetType &t)
 

Detailed Description

Helper class for encoding sub detector types in a flag word.

Example:
DetType type( DetType::TRACKER | DetType::STRIP | DetType::BARREL ) ;
type.is( DetType::ELECTROMAGNETIC ) ; // false
type.isNot( DetType::CALORIMETER ) ; // true
type.is( DetType::STRIP | DetType::BARREL ) ; // true

Author
F.gaede, DESY
Date
05.02.2016

Definition at line 33 of file DetType.h.

Member Enumeration Documentation

◆ DetectorTypeEnumeration

Different detector type flags.

Enumerator
IGNORE 
TRACKER 
CALORIMETER 
CHERENKOV 
ENDCAP 
BARREL 
FORWARD 
VERTEX 
STRIP 
PIXEL 
GASEOUS 
WIRE 
ELECTROMAGNETIC 
HADRONIC 
MUON 
SUPPORT 
BEAMPIPE 
COIL 
AUXILIARY 

Definition at line 40 of file DetType.h.

Constructor & Destructor Documentation

◆ DetType() [1/2]

dd4hep::DetType::DetType ( )
inline

default c'tor

Definition at line 63 of file DetType.h.

◆ DetType() [2/2]

dd4hep::DetType::DetType ( unsigned long  types)
inline

initialize with a ulong containing all properties, e.g. DetType type( DetType::TRACKER | DetType::STRIP | DetType::BARREL ) ;

Definition at line 68 of file DetType.h.

Member Function Documentation

◆ is()

bool dd4hep::DetType::is ( unsigned long  prop) const
inline

true if detector has all properties

Definition at line 81 of file DetType.h.

◆ isNot()

bool dd4hep::DetType::isNot ( unsigned long  prop) const
inline

true if detector has none of the given properties

Definition at line 86 of file DetType.h.

◆ set()

void dd4hep::DetType::set ( unsigned long  prop)
inline

set additional properties

Definition at line 71 of file DetType.h.

◆ to_ulong()

unsigned long dd4hep::DetType::to_ulong ( ) const
inline

return the flag word

Definition at line 91 of file DetType.h.

◆ unset()

void dd4hep::DetType::unset ( unsigned long  prop)
inline

unset the given properties

Definition at line 76 of file DetType.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const DetType t 
)
friend

Definition at line 99 of file DetType.h.

Member Data Documentation

◆ _type

unsigned long dd4hep::DetType::_type
private

Definition at line 96 of file DetType.h.


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