32#ifndef ALICEO2_EXT_EXTERNALDETECTOR_H
33#define ALICEO2_EXT_EXTERNALDETECTOR_H
40#include "TLorentzVector.h"
45#include <unordered_map>
87 static std::vector<ExternalDetector*>
createFromJSON(
const std::string& jsonfile);
102 std::vector<o2::ext::Hit>*
getHits(Int_t iColl)
const
110 void Reset()
override;
124 o2::ext::Hit*
addHit(
int trackID,
int sensorID,
const TVector3& startPos,
const TVector3& endPos,
125 const TVector3& startMom,
double startE,
double endTime,
double eLoss,
126 unsigned char startStatus,
unsigned char endStatus,
int pdg = 0,
float length = 0.f);
158 std::vector<o2::ext::Hit>*
mHits =
nullptr;
169 template <
typename Det>
Definition of the Detector class.
Generic hit type for externally injected (CAD-derived) sensitive detectors.
int currentTrackID() const
MCTrack number of the track currently being stepped.
static std::vector< ExternalDetector * > createFromJSON(const std::string &jsonfile)
std::vector< o2::ext::Hit > * mHits
void FinishPrimary() override
void InitializeO2Detector() override
Resolve the Monte Carlo volume IDs of the sensitive volumes.
int mStepCount
volume currently passed to ProcessHits (for the action helpers)
std::unordered_map< int, int > mVolID2SensorID
MC volume IDs of the sensitive volumes.
o2::ext::Hit * addHit(int trackID, int sensorID, const TVector3 &startPos, const TVector3 &endPos, const TVector3 &startMom, double startE, double endTime, double eLoss, unsigned char startStatus, unsigned char endStatus, int pdg=0, float length=0.f)
int currentSensorID() const
ExternalDetectorOptions mOptions
void Register() override
Register the hit collection with the FairRootManager.
std::function< bool(o2::ext::ExternalDetector *)> SensitiveFcn
std::vector< o2::ext::Hit > * getHits(Int_t iColl) const
Get the produced hit collection (probe interface used by DetImpl).
SensitiveFcn mSensitiveAction
container for produced hits
FairVolume * mCurrentVolume
optional user-provided sensitive action (loaded from a macro)
void PostTrack() override
void collectSensitiveVolumeNames(TGeoVolume *vol, std::set< TGeoVolume * > &visited)
recursively collect names of volumes whose medium matches the configured sensitive media
void BeginPrimary() override
Bool_t ProcessHits(FairVolume *v=nullptr) override
Called for each tracking step; produces hits in the sensitive volumes.
void ConstructGeometry() override
Build the CAD geometry, remap its media and register the sensitive volumes.
std::vector< std::string > mSensitiveVolumeNames
Bool_t defaultProcessHits()
the built-in sensitive action used when no macro is configured (generic entrance/exit hit)
struct o2::ext::ExternalDetector::TrackData mTrackData
~ExternalDetector() override
std::set< int > mSensitiveVolIDs
names of the volumes to be made sensitive (filled at geometry build)
void EndOfEvent() override
GLuint const GLchar * name
GLuint GLsizei GLsizei * length
Configuration of a single sensitive external detector.
TGeoMatrix const * placement
std::string sensitiveMacro
std::string sensitiveFunction
std::string root_macro_file
std::vector< std::string > sensitiveMedia
std::string anchor_volume
std::vector< std::string > sensitiveVolumes
dense sensor index per sensitive MC volume ID
TLorentzVector mPositionStart
track status flag at entrance
double mEnergyLoss
momentum at entrance
unsigned char mTrkStatusStart
hit creation started
TLorentzVector mMomentumStart
position at entrance