BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnNdet.h
Go to the documentation of this file.
1#ifndef BMNNDET_H
2#define BMNNDET_H
3
4#include "BmnNdetGeo.h"
5#include "BmnNdetGeoPar.h"
6#include "BmnNdetPoint.h"
7#include "FairDetector.h"
8#include "TClonesArray.h"
9#include "TLorentzVector.h"
10#include "TVector3.h"
11
12#include <boost/functional/hash.hpp>
13#include <map>
14#include <string>
15#include <unordered_map>
16
17class BmnNdet : public FairDetector
18{
19 public:
20 /** Default constructor **/
21 BmnNdet();
22
23 /** Standard constructor.
24 *@param name Detector name
25 *@param active Sensitivity flag
26 **/
27 BmnNdet(const char* name, Bool_t active);
28
29 /** Destructor **/
30 virtual ~BmnNdet();
31
32 /** Initialises detector and FairRun **/
33 virtual void Initialize();
34
35 /** Processes hits and creates BmnNdetPoints.
36 *@param vol Pointer to the active volume
37 *@return kTRUE if the volume is sensitive and a hit is processed, otherwise kFALSE
38 **/
39 virtual Bool_t ProcessHits(FairVolume* vol = nullptr);
40
41 /** Removes zero-energy hits
42 *@param point Pointer to the hit
43 *@return true if the track has non zero impact, otherwise removes it from collection and returns false
44 **/
46
47 /** Called at the end of each event **/
48 virtual void EndOfEvent();
49
50 /** Called at the beginning of each event **/
51 virtual void BeginEvent();
52
53 /** Registers the hit collection in the ROOT manager **/
54 virtual void Register();
55
56 /** Accessor to the hit collection
57 *@param iColl Index of the collection
58 *@return Pointer to the hit collection
59 **/
60 virtual TClonesArray* GetCollection(Int_t iColl) const;
61
62 /** Screen output of hit collection **/
63 virtual void Print(Option_t*) const;
64
65 /** Clears the hit collection **/
66 virtual void Reset();
67
68 /** Constructs geometry from files **/
69 virtual void ConstructGeometry();
70
71 /** Checks whether a volume is sensitive based on its name.
72 *@param name Volume name
73 *@return kTRUE if the volume is sensitive, otherwise kFALSE
74 **/
75 virtual Bool_t CheckIfSensitive(std::string name);
76
77 /** Checks whether current volume is vacuum
78 *@return kTRUE if the volume is vacuum, otherwise kFALSE
79 **/
80 virtual Bool_t CheckIfVacuum();
81
82 /** Retrieves the hit index corresponding to a specific address and trackID.
83 *@param trackID trackID
84 *@param address BmnNdetAddress
85 *@return index of the hit if found, otherwise -1
86 **/
87 Int_t FindHitIndex(int trackID, uint32_t address);
88
89 /** Retrieves the hit corresponding to a specific address and trackID.
90 *@param trackID trackID
91 *@param address BmnNdetAddress
92 *@return Pointer to the hit if found, otherwise nullptr
93 **/
94 BmnNdetPoint* GetHit(int trackID, uint32_t address);
95
96 /** Adds the hit to hits collection.
97 *@param point BmnNdetPoint
98 *@return Pointer to the hit
99 **/
101
102 /** Remove hit from hits collection by index.
103 *@param index hit index
104 **/
105 void RemoveHit(Int_t index);
106
107 /** Returns index of surface point.
108 *@param start_track_id track index
109 **/
110 int GetSurfacePoint(int start_track_id);
111
112 private:
113 BmnNdetGeo* fGeoHandler; // Geometry handler
114 TClonesArray* fCollection; // Output Point collection
115 TClonesArray* fSurfaceCollection; // Output Surface Point collection
116
117 ClassDef(BmnNdet, 8)
118};
119
120#endif
bool Bool_t
int Int_t
const char Option_t
#define ClassDef(name, id)
virtual Bool_t ProcessHits(FairVolume *vol=nullptr)
Processes hits and creates BmnNdetPoints.
Definition BmnNdet.cxx:93
virtual ~BmnNdet()
Destructor.
Definition BmnNdet.cxx:35
BmnNdetGeo * fGeoHandler
Definition BmnNdet.h:113
Int_t FindHitIndex(int trackID, uint32_t address)
Retrieves the hit index corresponding to a specific address and trackID.
Definition BmnNdet.cxx:62
TClonesArray * fCollection
Definition BmnNdet.h:114
virtual void EndOfEvent()
Called at the end of each event.
Definition BmnNdet.cxx:197
BmnNdet()
Default constructor.
Definition BmnNdet.cxx:17
BmnNdetPoint * AddHit(BmnNdetPoint *point)
Adds the hit to hits collection.
Definition BmnNdet.cxx:302
virtual TClonesArray * GetCollection(Int_t iColl) const
Accessor to the hit collection.
Definition BmnNdet.cxx:214
virtual Bool_t CheckIfVacuum()
Checks whether current volume is vacuum.
Definition BmnNdet.cxx:297
virtual Bool_t CheckIfSensitive(std::string name)
Checks whether a volume is sensitive based on its name.
Definition BmnNdet.cxx:289
bool FinaliseTrackProcessing(BmnNdetPoint *point)
Removes zero-energy hits.
Definition BmnNdet.cxx:183
virtual void ConstructGeometry()
Constructs geometry from files.
Definition BmnNdet.cxx:244
virtual void Reset()
Clears the hit collection.
Definition BmnNdet.cxx:237
virtual void Register()
Registers the hit collection in the ROOT manager.
Definition BmnNdet.cxx:204
int GetSurfacePoint(int start_track_id)
Returns index of surface point.
Definition BmnNdet.cxx:319
TClonesArray * fSurfaceCollection
Definition BmnNdet.h:115
void RemoveHit(Int_t index)
Remove hit from hits collection by index.
Definition BmnNdet.cxx:309
BmnNdetPoint * GetHit(int trackID, uint32_t address)
Retrieves the hit corresponding to a specific address and trackID.
Definition BmnNdet.cxx:76
virtual void Initialize()
Initialises detector and FairRun.
Definition BmnNdet.cxx:49
virtual void BeginEvent()
Called at the beginning of each event.
Definition BmnNdet.cxx:57
virtual void Print(Option_t *) const
Screen output of hit collection.
Definition BmnNdet.cxx:224