Project
Loading...
Searching...
No Matches
o2::emcal::Detector Class Reference

Detector simulation class for the EMCAL detector. More...

#include <Detector.h>

Inherits o2::base::DetImpl< Detector >.

Public Types

enum  MediumType_t {
  ID_AIR = 0 , ID_PB = 1 , ID_SC = 2 , ID_AL = 3 ,
  ID_STEEL = 4 , ID_PAPER = 5
}
 

Public Member Functions

 Detector ()=default
 Default constructor.
 
 Detector (Bool_t isActive)
 Main constructor.
 
 ~Detector () override
 Destructor.
 
void InitializeO2Detector () override
 Initializing detector.
 
Bool_t ProcessHits (FairVolume *v=nullptr) final
 Processing hit creation in the EMCAL scintillator volume.
 
HitAddHit (Int_t trackID, Int_t primary, Double_t initialEnergy, Int_t detID, const math_utils::Point3D< float > &pos, const math_utils::Vector3D< float > &mom, Double_t time, Double_t energyloss)
 Add EMCAL hit.
 
ParentAddSuperparent (Int_t trackID, Int_t pdg, Double_t energy)
 
void Register () override
 register container with hits
 
std::vector< Hit > * getHits (Int_t iColl) const
 Get access to the hits.
 
void Reset () final
 Clean point collection.
 
void EndOfEvent () final
 Steps to be carried out at the end of the event.
 
GeometryGetGeometry ()
 Get the EMCAL geometry desciption.
 
void BeginPrimary () override
 Begin primaray.
 
void FinishPrimary () override
 Finish current primary.
 
- Public Member Functions inherited from o2::base::DetImpl< Detector >
std::string getHitBranchNames (int probe) const override
 
void updateHitTrackIndices (std::map< int, int > const &indexmapping) override
 
void attachHits (fair::mq::Channel &channel, fair::mq::Parts &parts) override
 
void mergeAndAdjustHits (std::string const &brname, TTree &origin, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered)
 
void mergeAndAdjustHits (std::string const &brname, L &hitbuffervector, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered)
 
void mergeHitEntries (TTree &origin, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered) final
 
void mergeHitEntriesAndFlush (int eventID, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered) final
 
void collectHits (int eventID, fair::mq::Parts &parts, int &index) override
 
void fillHitBranch (TTree &tr, fair::mq::Parts &parts, int &index) override
 
FairModuleCloneModule () const final
 
void freeHitBuffers ()
 
bool setHits (int i, std::vector< Hit_t > *ptr)
 
void createHitBuffers ()
 
void initializeLate () final
 
void BeginEvent () final
 
 ~DetImpl () override
 
 Detector (const char *name, Bool_t Active)
 
 Detector ()
 Default Constructor.
 
 Detector (const Detector &origin)
 
- Public Member Functions inherited from o2::base::Detector
 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, Float_t theta1, Float_t phi1, Float_t theta2, Float_t phi2, Float_t theta3, Float_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
 
void Initialize () final
 
int registerSensitiveVolumeAndGetVolID (std::string const &name)
 
int registerSensitiveVolumeAndGetVolID (TGeoVolume const *vol)
 
TClonesArray * GetCollection (int iColl) const final
 

Protected Member Functions

void CreateMaterials ()
 Creating detector materials for the EMCAL detector and space frame.
 
void ConstructGeometry () override
 
void CreateEmcalEnvelope ()
 Generate EMCAL envelop (mother volume of all supermodules)
 
void CreateShiskebabGeometry ()
 Generate tower geometry.
 
void CreateSupermoduleGeometry (const std::string_view mother="XEN1")
 Generate super module geometry.
 
void CreateEmcalModuleGeometry (const std::string_view mother="SMOD", const std::string_view child="EMOD")
 Generate module geometry (2x2 towers)
 
void CreateAlFrontPlate (const std::string_view mother="EMOD", const std::string_view child="ALFP")
 Generate aluminium plates geometry.
 
int CreateEMCALVolume (const std::string_view name, const std::string_view shape, MediumType_t mediumID, Double_t *shapeParams, Int_t nparams)
 Create new EMCAL volume and add it to the list of sensitive volumes.
 
Double_t CalculateLightYield (Double_t energydeposit, Double_t tracklength, Int_t charge) const
 Calculate the amount of light seen by the APD for a given track segment (charged particles only) according to Bricks law.
 
HitFindHit (Int_t cellID, Int_t parentID)
 Try to find hit with same cell and parent track ID.
 
- Protected Member Functions inherited from o2::base::DetImpl< Detector >
 ClassDefOverride (DetImpl, 0)
 pointer to hit (collector) buffer location (strictly internal)
 
- Protected Member Functions inherited from o2::base::Detector
 Detector (const Detector &origin)
 
Detectoroperator= (const Detector &)
 

Friends

template<typename Det >
class o2::base::DetImpl
 

Additional Inherited Members

- Static Public Member Functions inherited from o2::base::Detector
static void setDensityFactor (Float_t density)
 
static Float_t getDensityFactor ()
 
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 Attributes inherited from o2::base::DetImpl< Detector >
bool * mShmBusy [NHITBUFFERS]
 
std::vector< void * > mCachedPtr [NHITBUFFERS]
 pointer to bool in shared mem indicating of IO busy
 
int mCurrentBuffer
 
int mInitialized
 
charmHitCollectorBufferPtr
 
- Static Protected Attributes inherited from o2::base::DetImpl< Detector >
static constexpr int NHITBUFFERS
 

Detailed Description

Detector simulation class for the EMCAL detector.

The detector class handles the implementation of the EMCAL detector within the virtual Monte-Carlo framework and the simulation of the EMCAL detector up to hit generation

Definition at line 51 of file Detector.h.

Member Enumeration Documentation

◆ MediumType_t

Enumerator
ID_AIR 
ID_PB 
ID_SC 
ID_AL 
ID_STEEL 
ID_PAPER 

Definition at line 54 of file Detector.h.

Constructor & Destructor Documentation

◆ Detector() [1/2]

o2::emcal::Detector::Detector ( )
default

Default constructor.

◆ Detector() [2/2]

Detector::Detector ( Bool_t  isActive)

Main constructor.

Parameters
isActiveSwitch whether detector is active in simulation

Definition at line 42 of file Detector.cxx.

◆ ~Detector()

Detector::~Detector ( )
override

Destructor.

Definition at line 112 of file Detector.cxx.

Member Function Documentation

◆ AddHit()

Hit * Detector::AddHit ( Int_t  trackID,
Int_t  primary,
Double_t  initialEnergy,
Int_t  detID,
const math_utils::Point3D< float > &  pos,
const math_utils::Vector3D< float > &  mom,
Double_t  time,
Double_t  energyloss 
)

Add EMCAL hit.

Parameters
trackIDIndex of the track in the MC stack
primaryIndex of the primary particle in the MC stack
initialEnergyEnergy of the particle entering the EMCAL
detIDIndex of the detector (cell) for which the hit is created
posPosition vector of the particle at the hit
momMomentum vector of the particle at the hit
timeTime of the hit
energylossEnergy deposit in EMCAL
Returns
Pointer to the current hit

Internally adding hits coming from the same track

Definition at line 322 of file Detector.cxx.

◆ AddSuperparent()

Parent * Detector::AddSuperparent ( Int_t  trackID,
Int_t  pdg,
Double_t  energy 
)

Definition at line 332 of file Detector.cxx.

◆ BeginPrimary()

void Detector::BeginPrimary ( )
override

Begin primaray.

Caching current primary ID and set current parent ID to the current primary ID

Definition at line 1010 of file Detector.cxx.

◆ CalculateLightYield()

Double_t Detector::CalculateLightYield ( Double_t  energydeposit,
Double_t  tracklength,
Int_t  charge 
) const
protected

Calculate the amount of light seen by the APD for a given track segment (charged particles only) according to Bricks law.

Parameters
[in]energydepositEnergy deposited by a charged particle in the track segment
[in]tracklengthLength of the track segment
[in]chargeTrack charge (in units of elementary charge)
Returns
Light yield

Definition at line 339 of file Detector.cxx.

◆ ConstructGeometry()

void Detector::ConstructGeometry ( )
overrideprotected

Definition at line 143 of file Detector.cxx.

◆ CreateAlFrontPlate()

void Detector::CreateAlFrontPlate ( const std::string_view  mother = "EMOD",
const std::string_view  child = "ALFP" 
)
protected

Generate aluminium plates geometry.

Definition at line 984 of file Detector.cxx.

◆ CreateEmcalEnvelope()

void Detector::CreateEmcalEnvelope ( )
protected

Generate EMCAL envelop (mother volume of all supermodules)

Definition at line 402 of file Detector.cxx.

◆ CreateEmcalModuleGeometry()

void Detector::CreateEmcalModuleGeometry ( const std::string_view  mother = "SMOD",
const std::string_view  child = "EMOD" 
)
protected

Generate module geometry (2x2 towers)

!!DCSM from 8th to 23th

Definition at line 887 of file Detector.cxx.

◆ CreateEMCALVolume()

int Detector::CreateEMCALVolume ( const std::string_view  name,
const std::string_view  shape,
MediumType_t  mediumID,
Double_t *  shapeParams,
Int_t  nparams 
)
protected

Create new EMCAL volume and add it to the list of sensitive volumes.

Parameters
nameName of the volume
shapeVolume shape type
mediumIDID of the medium
shapeParamsShape parameters
nparamsNumber of shape parameters
Returns
ID of the volume

Should be called for all EMCAL volumes. Internally calls TVirtualMC::Gsvolu(...). Gsvolu should not be used directly as this function adds the volume to the list of sensitive volumes. Making all volumes sensitive is essential in order to not have broken decay chains in the cache due to missing stepping in volumes. This is relevant for the detector itself, not the space frame.

Definition at line 1003 of file Detector.cxx.

◆ CreateMaterials()

void Detector::CreateMaterials ( )
protected

Creating detector materials for the EMCAL detector and space frame.

Definition at line 635 of file Detector.cxx.

◆ CreateShiskebabGeometry()

void Detector::CreateShiskebabGeometry ( )
protected

Generate tower geometry.

Definition at line 454 of file Detector.cxx.

◆ CreateSupermoduleGeometry()

void Detector::CreateSupermoduleGeometry ( const std::string_view  mother = "XEN1")
protected

Generate super module geometry.

Definition at line 718 of file Detector.cxx.

◆ EndOfEvent()

void Detector::EndOfEvent ( )
final

Steps to be carried out at the end of the event.

For EMCAL cleaning the hit collection and the lookup table

Definition at line 141 of file Detector.cxx.

◆ FindHit()

Hit * o2::emcal::Detector::FindHit ( Int_t  cellID,
Int_t  parentID 
)
protected

Try to find hit with same cell and parent track ID.

Parameters
cellIDID of the tower
parentIDID of the parent track

◆ FinishPrimary()

void Detector::FinishPrimary ( )
override

Finish current primary.

Reset caches for current primary, current parent and current cell

Definition at line 1016 of file Detector.cxx.

◆ GetGeometry()

Geometry * Detector::GetGeometry ( )

Get the EMCAL geometry desciption.

Returns
Access to the EMCAL Geometry description

Will be created the first time the function is called

Definition at line 391 of file Detector.cxx.

◆ getHits()

std::vector< Hit > * o2::emcal::Detector::getHits ( Int_t  iColl) const
inline

Get access to the hits.

Returns
Hit collection

Definition at line 101 of file Detector.h.

◆ InitializeO2Detector()

void Detector::InitializeO2Detector ( )
overridevirtual

Initializing detector.

Implements o2::base::Detector.

Definition at line 117 of file Detector.cxx.

◆ ProcessHits()

Bool_t Detector::ProcessHits ( FairVolume *  v = nullptr)
final

Processing hit creation in the EMCAL scintillator volume.

Parameters
vCurrent sensitive volume

check handling of primary particles

Definition at line 170 of file Detector.cxx.

◆ Register()

void Detector::Register ( )
override

register container with hits

Definition at line 374 of file Detector.cxx.

◆ Reset()

void Detector::Reset ( )
final

Clean point collection.

Definition at line 379 of file Detector.cxx.

Friends And Related Symbol Documentation

◆ o2::base::DetImpl

template<typename Det >
friend class o2::base::DetImpl
friend

Definition at line 214 of file Detector.h.


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