BmnRoot
Loading...
Searching...
No Matches
BmnFHCalModule.cxx
Go to the documentation of this file.
1
8#include "BmnFHCalModule.h"
9
10#include "BmnDetectorList.h" // for kFHCAL
11
12#include <iostream>
13using namespace std;
14
16 : FairHit()
17 , fModId(0)
18 , fModuleEnergy(0.0)
19 , fSectVec()
20{}
21
22BmnFHCalModule::BmnFHCalModule(int ModuleId, const TVector3& posHit, const TVector3& posHitErr, int pointIndx)
23 : FairHit(kFHCAL, posHit, posHitErr, pointIndx)
24 , fModId(ModuleId)
25 , fModuleEnergy(0.0)
26{
27 fSectVec.clear();
28}
29
31 : FairHit(other)
32 , fModId(other.fModId)
33 , fModuleEnergy(other.fModuleEnergy)
34 , fSectVec(other.fSectVec)
35{}
36
38 : FairHit(std::move(other))
39 , fModId(other.fModId)
40 , fModuleEnergy(other.fModuleEnergy)
41 , fSectVec(std::move(other.fSectVec))
42{}
43
45{
46 if (this != &other) {
47 FairHit::operator=(other);
48 fModId = other.fModId;
49 fModuleEnergy = other.fModuleEnergy;
50 fSectVec = other.fSectVec;
51 }
52 return *this;
53}
54
56{
57 if (this != &other) {
58 FairHit::operator=(std::move(other));
59 fModId = other.fModId;
60 fModuleEnergy = other.fModuleEnergy;
61 fSectVec = std::move(other.fSectVec);
62 }
63 return *this;
64}
65
66void BmnFHCalModule::Print(Option_t* option) const
67{
68 cout << "Module ID: " << fModId << "\n"
69 << "Energy: " << fModuleEnergy << "\n"
70 << "Sections: " << GetNsections() << "\n"
71 << "Position: (" << GetX() << ", " << GetY() << ", " << GetZ() << ")" << endl;
72}
73
74void BmnFHCalModule::SummarizeModule(double section_threshold)
75{
76 double energy = 0.0;
77 for (const auto& section_energy : fSectVec) {
78 if (section_energy > section_threshold) {
79 energy += section_energy;
80 }
81 }
82 SetEnergy(energy);
83}
84
86{
87 fModuleEnergy = 0.;
88 std::fill(fSectVec.begin(), fSectVec.end(), 0.0);
89}
90
92{
93 fModId = 0;
95 fSectVec.clear();
96
97 TVector3 zero;
98 SetPosition(zero);
99 SetPositionError(zero);
100 SetRefIndex(-1);
101}
@ kFHCAL
Class for Bmn FHCal module data container in event.
BmnFHCalModule & operator=(const BmnFHCalModule &)
BmnFHCalModule()
Default constructor.
void SummarizeModule(double section_threshold=0.0)
virtual void Print(Option_t *option="") const
int GetNsections() const
Sections number.
void SetEnergy(float Energy)
STL namespace.