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 **/
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 **/
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 CheckIfVacuum()
Checks whether current volume is vacuum.
virtual Bool_t CheckIfSensitive(std::string name)
Checks whether a volume is sensitive based on its name.
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.
TClonesArray * fCollection
Definition BmnNdet.h:114
virtual void Initialize()
Initialises detector and FairRun.
BmnNdet()
Default constructor.
virtual ~BmnNdet()
Destructor.
virtual void Reset()
Clears the hit collection.
virtual Bool_t ProcessHits(FairVolume *vol=nullptr)
Processes hits and creates BmnNdetPoints.
BmnNdetPoint * AddHit(BmnNdetPoint *point)
Adds the hit to hits collection.
bool FinaliseTrackProcessing(BmnNdetPoint *point)
Removes zero-energy hits.
virtual void ConstructGeometry()
Constructs geometry from files.
int GetSurfacePoint(int start_track_id)
Returns index of surface point.
BmnNdet(const char *name, Bool_t active)
Standard constructor.
virtual TClonesArray * GetCollection(Int_t iColl) const
Accessor to the hit collection.
TClonesArray * fSurfaceCollection
Definition BmnNdet.h:115
void RemoveHit(Int_t index)
Remove hit from hits collection by index.
BmnNdetPoint * GetHit(int trackID, uint32_t address)
Retrieves the hit corresponding to a specific address and trackID.
virtual void Print(Option_t *) const
Screen output of hit collection.
virtual void BeginEvent()
Called at the beginning of each event.
virtual void EndOfEvent()
Called at the end of each event.
virtual void Register()
Registers the hit collection in the ROOT manager.