BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnFHCal.h
Go to the documentation of this file.
1#ifndef BMNFHCAL_H
2#define BMNFHCAL_H
3
4#include "BmnFHCalGeo.h"
5#include "BmnFHCalGeoPar.h"
6#include "BmnFHCalPoint.h"
7#include "FairDetector.h"
8#include "TClonesArray.h"
9#include "TLorentzVector.h"
10#include "TVector3.h"
11
12#include <map>
13#include <string>
14#include <unordered_map>
15
16class BmnFHCal : public FairDetector
17{
18 public:
19 /** Default constructor **/
20 BmnFHCal();
21
22 /** Standard constructor.
23 *@param name Detector name
24 *@param active Sensitivity flag
25 **/
26 BmnFHCal(const char* name, Bool_t active);
27
28 /** Destructor **/
29 virtual ~BmnFHCal();
30
31 /** Initializes detector and FairRun **/
32 virtual void Initialize() override;
33
34 /** Processes hits and creates BmnFHCalPoints.
35 *@param vol Pointer to the active volume
36 *@return kTRUE if the volume is sensitive and a hit is processed, otherwise kFALSE
37 **/
38 virtual Bool_t ProcessHits(FairVolume* vol = nullptr) override;
39
40 /** Called at the end of each event **/
41 virtual void EndOfEvent() override;
42
43 /** Called at the beginning of each event **/
44 virtual void BeginEvent() override;
45
46 /** Registers the hit collection in the ROOT manager **/
47 virtual void Register() override;
48
49 /** Accessor to the hit collection
50 *@param iColl Index of the collection
51 *@return Pointer to the hit collection
52 **/
53 virtual TClonesArray* GetCollection(Int_t iColl) const override;
54
55 /** Screen output of hit collection **/
56 virtual void Print(Option_t*) const override;
57
58 /** Clears the hit collection **/
59 virtual void Reset() override;
60
61 /** Constructs geometry from files **/
62 virtual void ConstructGeometry() override;
63
64 /** Checks whether a volume is sensitive based on its name.
65 *@param name Volume name
66 *@return kTRUE if the volume is sensitive, otherwise kFALSE
67 **/
68 virtual Bool_t CheckIfSensitive(std::string name) override;
69
70 /** Adds the hit to hits collection.
71 *@param point BmnFHCalPoint
72 *@return Pointer to the hit
73 **/
75
76 /** Updates an existing hit by merging information from a new hit,
77 * weighting position, momentum, time, and length according to their energy loss.
78 * @param existing Reference to the existing BmnFHCalPoint hit, which will be updated
79 * @param update Reference to the new BmnFHCalPoint hit, providing additional information
80 **/
81 void UpdateHit(BmnFHCalPoint& existing, const BmnFHCalPoint& update);
82
83 /** Retrieves a hit from the collection based on the detector address.
84 * @param address Detector address of the hit
85 * @return Pointer to the retrieved hit, or nullptr if not found
86 **/
87 BmnFHCalPoint* GetHit(uint32_t address);
88
89 /** Determines the surface-level Monte Carlo track ID associated with the given
90 * starting track ID.
91 * @param start_track_id Initial track ID to trace back to the surface MC track
92 * @return Surface-level MC track ID
93 **/
94 int GetSurfaceMCTrack(int start_track_id);
95
96 private:
97 TClonesArray* fCollection; // Collection of hits for the event
98 std::unique_ptr<BmnFHCalGeo> fGeoHandler; // Pointer to the geometry handler
99 std::unique_ptr<BmnFHCalPoint> fPoint; // Temp storage for the current hit being processed
100 std::map<uint32_t, FairMultiLinkedData> fMultiLinkMap;
101
103};
104
105#endif
bool Bool_t
int Int_t
const char Option_t
#define ClassDefOverride(name, id)
int GetSurfaceMCTrack(int start_track_id)
Determines the surface-level Monte Carlo track ID associated with the given starting track ID.
Definition BmnFHCal.cxx:277
std::unique_ptr< BmnFHCalGeo > fGeoHandler
Definition BmnFHCal.h:98
BmnFHCalPoint * AddHit(BmnFHCalPoint *point)
Adds the hit to hits collection.
Definition BmnFHCal.cxx:237
BmnFHCalPoint * GetHit(uint32_t address)
Retrieves a hit from the collection based on the detector address.
Definition BmnFHCal.cxx:61
virtual ~BmnFHCal()
Destructor.
Definition BmnFHCal.cxx:35
virtual void Reset() override
Clears the hit collection.
Definition BmnFHCal.cxx:182
std::unique_ptr< BmnFHCalPoint > fPoint
Definition BmnFHCal.h:99
virtual void Print(Option_t *) const override
Screen output of hit collection.
Definition BmnFHCal.cxx:168
BmnFHCal()
Default constructor.
Definition BmnFHCal.cxx:17
std::map< uint32_t, FairMultiLinkedData > fMultiLinkMap
Definition BmnFHCal.h:100
virtual void ConstructGeometry() override
Constructs geometry from files.
Definition BmnFHCal.cxx:188
void UpdateHit(BmnFHCalPoint &existing, const BmnFHCalPoint &update)
Updates an existing hit by merging information from a new hit, weighting position,...
Definition BmnFHCal.cxx:244
virtual void EndOfEvent() override
Called at the end of each event.
Definition BmnFHCal.cxx:136
virtual void Initialize() override
Initializes detector and FairRun.
Definition BmnFHCal.cxx:49
virtual void Register() override
Registers the hit collection in the ROOT manager.
Definition BmnFHCal.cxx:143
TClonesArray * fCollection
Definition BmnFHCal.h:97
virtual void BeginEvent() override
Called at the beginning of each event.
Definition BmnFHCal.cxx:55
virtual TClonesArray * GetCollection(Int_t iColl) const override
Accessor to the hit collection.
Definition BmnFHCal.cxx:149
virtual Bool_t ProcessHits(FairVolume *vol=nullptr) override
Processes hits and creates BmnFHCalPoints.
Definition BmnFHCal.cxx:80
virtual Bool_t CheckIfSensitive(std::string name) override
Checks whether a volume is sensitive based on its name.
Definition BmnFHCal.cxx:230