5#ifndef DETECTOR_DETECTOR_H_
6#define DETECTOR_DETECTOR_H_
12#include "FairDetector.h"
13#include "FairRootManager.h"
15#include "TLorentzVector.h"
19template <
typename Po
intType>
24 Detector(
const char* Name, Bool_t Active, Int_t detID)
25 : FairDetector(Name, Active, detID),
37 template <
typename... Args>
39 fDetPoints->emplace_back(std::forward<Args>(args)...);
46 void Initialize()
override { FairDetector::Initialize(); }
54 FairRootManager::Instance()->RegisterAny(PointType::Class()->GetName(),
58 TClonesArray*
GetCollection(Int_t iColl)
const override {
return nullptr; }
62 Int_t oldTrackID = point.GetTrackID();
63 if (oldTrackID >= 0 && oldTrackID <
static_cast<Int_t
>(indexMap.size())) {
64 point.SetTrackID(indexMap[oldTrackID]);
76 void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset)
override {
Interface for detectors using STL containers (std::vector) for MC points.
void BeginPrimary() override
Int_t fTrackID
event index
std::vector< PointType > * fDetPoints
energy loss
void EndOfEvent() override
Int_t fVolumeID
track index
void PostTrack() override
void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset) override
TLorentzVector fPos
volume id
void ConstructGeometry() override=0
Double_t fTime
momentum at entrance
~Detector() override=default
Detector(const char *Name, Bool_t Active, Int_t detID)
void FinishPrimary() override
Detector(const char *Name, Bool_t Active)
void BeginEvent() override
PointType * AddHit(Args &&... args)
TLorentzVector fMom
position at entrance
TClonesArray * GetCollection(Int_t iColl) const override
void SetSpecialPhysicsCuts() override
void Initialize() override
void UpdatePointTrackIndices(const std::vector< Int_t > &indexMap) override
Update track indices in point collection after track filtering.
void FinishRun() override