Project
Loading...
Searching...
No Matches
o2::base::Detector Class Referenceabstract

#include <Detector.h>

Inherits FairDetector.

Inherited by o2::base::DetImpl< Detector >, o2::base::DetImpl< ExternalDetector >, o2::base::DetImpl< CloneTestDetector >, and o2::base::DetImpl< Det >.

Public Member Functions

 Detector (const char *name, Bool_t Active)
 
 Detector ()
 Default Constructor.
 
 ~Detector () override
 Default Destructor.
 
void Material (Int_t imat, const char *name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t *buf=nullptr, Int_t nwbuf=0)
 
void Mixture (Int_t imat, const char *name, Float_t *a, Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat)
 
void Medium (Int_t numed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t *ubuf=nullptr, Int_t nbuf=0)
 
void SpecialCuts (Int_t numed, const std::initializer_list< std::pair< ECut, Float_t > > &parIDValMap)
 Custom processes and transport cuts.
 
void SpecialCut (Int_t numed, ECut parID, Float_t val)
 Set cut by name and value.
 
void SpecialProcesses (Int_t numed, const std::initializer_list< std::pair< EProc, int > > &parIDValMap)
 
void SpecialProcess (Int_t numed, EProc parID, int val)
 Set process by name and value.
 
void Matrix (Int_t &nmat, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3) const
 
void SetSpecialPhysicsCuts () override
 
virtual void addAlignableVolumes () const
 declare alignable volumes of detector
 
virtual void fillParallelWorld () const
 fill parallel geometry with sensitive volumes of detector
 
virtual void defineWrapperVolume (Int_t id, Double_t rmin, Double_t rmax, Double_t zspan)
 Sets per wrapper volume parameters.
 
virtual void setNumberOfWrapperVolumes (Int_t n)
 Books arrays for wrapper volumes.
 
virtual void defineLayer (Int_t nlay, Double_t phi0, Double_t r, Int_t nladd, Int_t nmod, Double_t lthick=0., Double_t dthick=0., UInt_t detType=0, Int_t buildFlag=0)
 
virtual void defineLayerTurbo (Int_t nlay, Double_t phi0, Double_t r, Int_t nladd, Int_t nmod, Double_t width, Double_t tilt, Double_t lthick=0., Double_t dthick=0., UInt_t detType=0, Int_t buildFlag=0)
 
int getMaterialID (int imat) const
 
int getMediumID (int imed) const
 
void getMediumIDMappingAsVector (std::vector< int > &mapping)
 
std::string addNameTo (const char *ext) const
 
virtual std::string getHitBranchNames (int probe) const =0
 
virtual void updateHitTrackIndices (std::map< int, int > const &)=0
 
virtual void attachHits (fair::mq::Channel &, fair::mq::Parts &)=0
 
virtual void fillHitBranch (TTree &tr, fair::mq::Parts &parts, int &index)=0
 
virtual void collectHits (int eventID, fair::mq::Parts &parts, int &index, bool shm)=0
 
virtual void mergeHitEntriesAndFlush (int eventID, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered)=0
 
virtual void mergeHitEntries (TTree &origin, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered)=0
 
virtual void InitializeO2Detector ()=0
 
void Initialize () final
 
virtual void initializeLate ()=0
 
virtual bool isMTSafe () const
 whether this detector may run in multithreaded Geant4, with one clone per worker thread
 
int registerSensitiveVolumeAndGetVolID (std::string const &name)
 
int registerSensitiveVolumeAndGetVolID (TGeoVolume const *vol)
 
TClonesArray * GetCollection (int iColl) const final
 
- Public Member Functions inherited from FairDetector
 FairDetector (const char *Name, Bool_t Active, Int_t DetId=0)
 
 FairDetector ()
 
virtual ~FairDetector ()
 
virtual Bool_t ProcessHits (FairVolume *v=0)=0
 
virtual void EndOfEvent ()
 
virtual void Register ()=0
 
virtual TClonesArray * GetCollection (Int_t iColl) const =0
 
virtual void Reset ()=0
 
virtual void CopyClones (TClonesArray *, TClonesArray *, Int_t)
 
virtual void FinishPrimary ()
 
virtual void FinishRun ()
 
virtual void BeginPrimary ()
 
virtual void PostTrack ()
 
virtual void PreTrack ()
 
virtual void BeginEvent ()
 
virtual void FinishEvent ()
 
void SaveGeoParams ()
 
Int_t GetDetId ()
 
- Public Member Functions inherited from FairModule
 FairModule ()
 
 FairModule (const char *Name, const char *title, Bool_t Active=kFALSE)
 
virtual ~FairModule ()
 
virtual void Print (Option_t *) const
 
virtual void SetGeometryFileName (TString fname, TString geoVer="0")
 
virtual TString GetGeometryFileName ()
 
virtual TString GetGeometryFileVer ()
 
virtual void ConstructGeometry ()
 
virtual void ConstructOpGeometry ()
 
virtual void ConstructRootGeometry (TGeoMatrix *shiftM=nullptr)
 
virtual void ConstructASCIIGeometry ()
 
virtual void ModifyGeometry () __attribute__((deprecated("Use FairAlignmentHandler instead
 
virtual void RegisterAlignmentMatrices ()
 
virtual void ConstructGDMLGeometry (__attribute__((unused)) TGeoMatrix *posrot)
 
virtual FairModule * CloneModule () const
 
virtual void BeginWorkerRun () const
 
virtual void FinishWorkerRun () const
 
virtual Bool_t IsSensitive (const std::string &name)
 
virtual Bool_t CheckIfSensitive (__attribute__((unused)) std::string name) __attribute__((deprecated("The method CheckIfSensitive is deprecated. Implement IsSensitive in the detector classes.")))
 
virtual void ExpandNode (TGeoNode *Node)
 
virtual void ExpandNodeForGDML (__attribute__((unused)) TGeoNode *curNode)
 
virtual Int_t getVolId (const TString &) const
 
Int_t GetModId ()
 
void SetVerboseLevel (Int_t level)
 
Bool_t IsActive ()
 
void SetModId (Int_t id)
 
void SetMotherVolume (TString volName)
 
virtual void SetParContainers ()
 
virtual void InitParContainers ()
 
TList * GetListOfGeoPar ()
 
FairVolume * getFairVolume (FairGeoNode *fNode)
 
void AddSensitiveVolume (TGeoVolume *v)
 
void SetMC (TVirtualMC *mc)
 cahed pointer to MC (available only after initialization)
 
 ClassDef (FairModule, 4)
 

Static Public Member Functions

static void setDensityFactor (Float_t density)
 
static Float_t getDensityFactor ()
 
static int updatedTrackIndex (std::map< int, int > const &indexmapping, int trackID)
 
static int offsetTrackIndex (int trackID, int nprimaries, int primaryOffset, int secondaryOffset)
 
static void initFieldTrackingParams (int &mode, float &maxfield)
 
static void setDetId2HitBitIndex (std::vector< int > const &v)
 set the DetID to HitBitIndex mapping. Succeeds if not already set.
 
static std::vector< int > const & getDetId2HitBitIndex ()
 

Protected Member Functions

 Detector (const Detector &origin)
 
Detector & operator= (const Detector &)
 
- Protected Member Functions inherited from FairDetector
 FairDetector (const FairDetector &)
 
FairDetector & operator= (const FairDetector &)
 
void DefineSensitiveVolumes ()
 
 ClassDef (FairDetector, 1)
 /// FairLogger
 
- Protected Member Functions inherited from FairModule
 FairModule (const FairModule &)
 
FairModule & operator= (const FairModule &)
 

Additional Inherited Members

- Public Attributes inherited from FairModule
virtual void see Tutorial4 for examples
 
TString fMotherVolumeName
 
- Static Public Attributes inherited from FairModule
static thread_local FairVolumeList * vList = 0
 
static thread_local Int_t fNbOfVolumes = 0
 
static thread_local TRefArray * svList = 0
 
static thread_local TArrayI * volNumber = 0
 
- Protected Attributes inherited from FairDetector
Int_t fDetId
 
FairLogger * fLogger
 
- Protected Attributes inherited from FairModule
TString fgeoVer
 
TString fgeoName
 
Int_t fModId
 
Bool_t fActive
 
Int_t fNbOfSensitiveVol
 
Int_t fVerboseLevel
 
TList * flGeoPar
 
Bool_t fGeoSaved
 list of Detector Geometry parameters
 
TVirtualMC * fMC
 flag for initialisation
 

Detailed Description

This is the basic class for any AliceO2 detector module, whether it is sensitive or not. Detector classes depend on this.

Definition at line 50 of file Detector.h.

Constructor & Destructor Documentation

◆ Detector() [1/3]

Detector::Detector ( const char *  name,
Bool_t  Active 
)

Definition at line 37 of file Detector.cxx.

◆ Detector() [2/3]

Detector::Detector ( )

Default Constructor.

Definition at line 36 of file Detector.cxx.

◆ ~Detector()

Detector::~Detector ( )
overridedefault

Default Destructor.

Definition at line 93 of file Detector.cxx.

◆ Detector() [3/3]

Detector::Detector ( const Detector &  origin)
protecteddefault

Definition at line 81 of file Detector.cxx.

Member Function Documentation

◆ addAlignableVolumes()

void Detector::addAlignableVolumes ( ) const
virtual

◆ addNameTo()

std::string o2::base::Detector::addNameTo ( const char *  ext) const
inline

Definition at line 151 of file Detector.h.

◆ attachHits()

virtual void o2::base::Detector::attachHits ( fair::mq::Channel &  ,
fair::mq::Parts &   
)
pure virtual

◆ collectHits()

virtual void o2::base::Detector::collectHits ( int  eventID,
fair::mq::Parts &  parts,
int &  index,
bool  shm 
)
pure virtual

◆ defineLayer()

virtual void o2::base::Detector::defineLayer ( Int_t  nlay,
Double_t  phi0,
Double_t  r,
Int_t  nladd,
Int_t  nmod,
Double_t  lthick = 0.,
Double_t  dthick = 0.,
UInt_t  detType = 0,
Int_t  buildFlag = 0 
)
virtual

Reimplemented in o2::its::Detector.

◆ defineLayerTurbo()

void Detector::defineLayerTurbo ( Int_t  nlay,
Double_t  phi0,
Double_t  r,
Int_t  nladd,
Int_t  nmod,
Double_t  width,
Double_t  tilt,
Double_t  lthick = 0.,
Double_t  dthick = 0.,
UInt_t  detType = 0,
Int_t  buildFlag = 0 
)
virtual

Definition at line 117 of file Detector.cxx.

◆ defineWrapperVolume()

void Detector::defineWrapperVolume ( Int_t  id,
Double_t  rmin,
Double_t  rmax,
Double_t  zspan 
)
virtual

Sets per wrapper volume parameters.

Reimplemented in o2::its::Detector.

Definition at line 110 of file Detector.cxx.

◆ fillHitBranch()

virtual void o2::base::Detector::fillHitBranch ( TTree &  tr,
fair::mq::Parts &  parts,
int &  index 
)
pure virtual

◆ fillParallelWorld()

void Detector::fillParallelWorld ( ) const
virtual

fill parallel geometry with sensitive volumes of detector

Reimplemented in o2::its::Detector.

Definition at line 174 of file Detector.cxx.

◆ GetCollection()

TClonesArray * Detector::GetCollection ( int  iColl) const
final

Definition at line 162 of file Detector.cxx.

◆ getDensityFactor()

static Float_t o2::base::Detector::getDensityFactor ( )
inlinestatic

Definition at line 98 of file Detector.h.

◆ getDetId2HitBitIndex()

static std::vector< int > const & o2::base::Detector::getDetId2HitBitIndex ( )
inlinestatic

Definition at line 244 of file Detector.h.

◆ getHitBranchNames()

std::string Detector::getHitBranchNames ( int  probe) const
pure virtual

◆ getMaterialID()

int o2::base::Detector::getMaterialID ( int  imat) const
inline

Definition at line 128 of file Detector.h.

◆ getMediumID()

int o2::base::Detector::getMediumID ( int  imed) const
inline

Definition at line 136 of file Detector.h.

◆ getMediumIDMappingAsVector()

void o2::base::Detector::getMediumIDMappingAsVector ( std::vector< int > &  mapping)
inline

Definition at line 144 of file Detector.h.

◆ initFieldTrackingParams()

void Detector::initFieldTrackingParams ( int &  mode,
float &  maxfield 
)
static

Definition at line 143 of file Detector.cxx.

◆ Initialize()

void o2::base::Detector::Initialize ( )
inlinefinalvirtual

Initialization of the detector is done here

Reimplemented from FairDetector.

Definition at line 210 of file Detector.h.

◆ initializeLate()

virtual void o2::base::Detector::initializeLate ( )
pure virtual

◆ InitializeO2Detector()

◆ isMTSafe()

virtual bool o2::base::Detector::isMTSafe ( ) const
inlinevirtual

◆ Material()

void Detector::Material ( Int_t  imat,
const char *  name,
Float_t  a,
Float_t  z,
Float_t  dens,
Float_t  radl,
Float_t  absl,
Float_t *  buf = nullptr,
Int_t  nwbuf = 0 
)

Definition at line 59 of file Detector.cxx.

◆ Matrix()

void Detector::Matrix ( Int_t &  nmat,
Double_t  theta1,
Double_t  phi1,
Double_t  theta2,
Double_t  phi2,
Double_t  theta3,
Double_t  phi3 
) const

Define a rotation matrix. angles are in degrees.

Parameters
nmaton output contains the number assigned to the rotation matrix
theta1polar angle for axis I
theta2polar angle for axis II
theta3polar angle for axis III
phi1azimuthal angle for axis I
phi2azimuthal angle for axis II
phi3azimuthal angle for axis III

Definition at line 104 of file Detector.cxx.

◆ Medium()

void Detector::Medium ( Int_t  numed,
const char *  name,
Int_t  nmat,
Int_t  isvol,
Int_t  ifield,
Float_t  fieldm,
Float_t  tmaxfd,
Float_t  stemax,
Float_t  deemax,
Float_t  epsil,
Float_t  stmin,
Float_t *  ubuf = nullptr,
Int_t  nbuf = 0 
)

Definition at line 72 of file Detector.cxx.

◆ mergeHitEntries()

virtual void o2::base::Detector::mergeHitEntries ( TTree &  origin,
TTree &  target,
std::vector< int > const &  trackoffsets,
std::vector< int > const &  nprimaries,
std::vector< int > const &  subevtsOrdered 
)
pure virtual

◆ mergeHitEntriesAndFlush()

virtual void o2::base::Detector::mergeHitEntriesAndFlush ( int  eventID,
TTree &  target,
std::vector< int > const &  trackoffsets,
std::vector< int > const &  nprimaries,
std::vector< int > const &  subevtsOrdered 
)
pure virtual

◆ Mixture()

void Detector::Mixture ( Int_t  imat,
const char *  name,
Float_t *  a,
Float_t *  z,
Float_t  dens,
Int_t  nlmat,
Float_t *  wmat 
)

Definition at line 66 of file Detector.cxx.

◆ offsetTrackIndex()

static int o2::base::Detector::offsetTrackIndex ( int  trackID,
int  nprimaries,
int  primaryOffset,
int  secondaryOffset 
)
inlinestatic

Definition at line 178 of file Detector.h.

◆ operator=()

Detector & Detector::operator= ( const Detector &  rhs)
protected

Definition at line 46 of file Detector.cxx.

◆ registerSensitiveVolumeAndGetVolID() [1/2]

int Detector::registerSensitiveVolumeAndGetVolID ( std::string const &  name)

helper wrapper function to register a geometry volume given by name with FairRoot

Returns
The MonteCarlo ID for the volume

Definition at line 190 of file Detector.cxx.

◆ registerSensitiveVolumeAndGetVolID() [2/2]

int Detector::registerSensitiveVolumeAndGetVolID ( TGeoVolume const *  vol)

helper wrapper function to register a geometry volume given by TGeoVolume vol

Returns
The MonteCarlo ID for the volume

Definition at line 178 of file Detector.cxx.

◆ setDensityFactor()

static void o2::base::Detector::setDensityFactor ( Float_t  density)
inlinestatic

Definition at line 93 of file Detector.h.

◆ setDetId2HitBitIndex()

static void o2::base::Detector::setDetId2HitBitIndex ( std::vector< int > const &  v)
inlinestatic

set the DetID to HitBitIndex mapping. Succeeds if not already set.

Definition at line 243 of file Detector.h.

◆ setNumberOfWrapperVolumes()

void Detector::setNumberOfWrapperVolumes ( Int_t  n)
virtual

Books arrays for wrapper volumes.

Definition at line 111 of file Detector.cxx.

◆ SetSpecialPhysicsCuts()

void Detector::SetSpecialPhysicsCuts ( )
overridevirtual

implements interface of FairModule; generic implementation for O2 detectors

Reimplemented from FairModule.

Reimplemented in o2::tpc::Detector.

Definition at line 122 of file Detector.cxx.

◆ SpecialCut()

void Detector::SpecialCut ( Int_t  numed,
ECut  parID,
Float_t  val 
)

Set cut by name and value.

Definition at line 86 of file Detector.cxx.

◆ SpecialCuts()

void Detector::SpecialCuts ( Int_t  numed,
const std::initializer_list< std::pair< ECut, Float_t > > &  parIDValMap 
)

Custom processes and transport cuts.

Definition at line 80 of file Detector.cxx.

◆ SpecialProcess()

void Detector::SpecialProcess ( Int_t  numed,
EProc  parID,
int  val 
)

Set process by name and value.

Definition at line 98 of file Detector.cxx.

◆ SpecialProcesses()

void Detector::SpecialProcesses ( Int_t  numed,
const std::initializer_list< std::pair< EProc, int > > &  parIDValMap 
)

Definition at line 92 of file Detector.cxx.

◆ updatedTrackIndex()

static int o2::base::Detector::updatedTrackIndex ( std::map< int, int > const &  indexmapping,
int  trackID 
)
inlinestatic

Definition at line 169 of file Detector.h.

◆ updateHitTrackIndices()

virtual void o2::base::Detector::updateHitTrackIndices ( std::map< int, int > const &  )
pure virtual

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