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>
13
using namespace
std
;
14
15
BmnFHCalModule::BmnFHCalModule
()
16
: FairHit()
17
, fModId(0)
18
, fModuleEnergy(0.0)
19
, fSectVec()
20
{}
21
22
BmnFHCalModule::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
30
BmnFHCalModule::BmnFHCalModule
(
const
BmnFHCalModule
& other)
31
: FairHit(other)
32
, fModId(other.fModId)
33
, fModuleEnergy(other.fModuleEnergy)
34
, fSectVec(other.fSectVec)
35
{}
36
37
BmnFHCalModule::BmnFHCalModule
(
BmnFHCalModule
&& other) noexcept
38
: FairHit(std::move(other))
39
, fModId(other.fModId)
40
, fModuleEnergy(other.fModuleEnergy)
41
, fSectVec(std::move(other.fSectVec))
42
{}
43
44
BmnFHCalModule
&
BmnFHCalModule::operator=
(
const
BmnFHCalModule
& other)
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
55
BmnFHCalModule
&
BmnFHCalModule::operator=
(
BmnFHCalModule
&& other)
noexcept
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
66
void
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
74
void
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
85
void
BmnFHCalModule::ResetSections
()
86
{
87
fModuleEnergy = 0.;
88
std::fill(fSectVec.begin(), fSectVec.end(), 0.0);
89
}
90
91
void
BmnFHCalModule::reset
()
92
{
93
fModId = 0;
94
ResetSections
();
95
fSectVec.clear();
96
97
TVector3 zero;
98
SetPosition(zero);
99
SetPositionError(zero);
100
SetRefIndex(-1);
101
}
kFHCAL
@ kFHCAL
Definition
BmnDetectorList.h:34
BmnFHCalModule
Class for Bmn FHCal module data container in event.
Definition
BmnFHCalModule.h:19
BmnFHCalModule::operator=
BmnFHCalModule & operator=(const BmnFHCalModule &)
Definition
BmnFHCalModule.cxx:44
BmnFHCalModule::reset
void reset()
Definition
BmnFHCalModule.cxx:91
BmnFHCalModule::BmnFHCalModule
BmnFHCalModule()
Default constructor.
Definition
BmnFHCalModule.cxx:15
BmnFHCalModule::SummarizeModule
void SummarizeModule(double section_threshold=0.0)
Definition
BmnFHCalModule.cxx:74
BmnFHCalModule::ResetSections
void ResetSections()
Definition
BmnFHCalModule.cxx:85
BmnFHCalModule::Print
virtual void Print(Option_t *option="") const
Definition
BmnFHCalModule.cxx:66
BmnFHCalModule::GetNsections
int GetNsections() const
Sections number.
Definition
BmnFHCalModule.h:49
BmnFHCalModule::SetEnergy
void SetEnergy(float Energy)
Definition
BmnFHCalModule.h:55
BmnFHCalModule.h
std
STL namespace.
detectors
fhcal
BmnFHCalModule.cxx
Generated on Fri May 15 2026 10:40:51 for BmnRoot by
1.9.8