BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnFHCalModule.cxx
Go to the documentation of this file.
1
/** @file BmnFHCalModule.cxx
2
** @author Nikolay Karpushkin <karpushkin@inr.ru>
3
** @date 27.03.2022
4
**
5
** Code of Class for Bmn FHCal module data container in event
6
**/
7
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
}
Option_t
const char Option_t
kFHCAL
@ kFHCAL
Definition
BmnDetectorList.h:34
BmnFHCalModule::operator=
BmnFHCalModule & operator=(const BmnFHCalModule &)
Assignment operator.
Definition
BmnFHCalModule.cxx:44
BmnFHCalModule::fModId
int fModId
Definition
BmnFHCalModule.h:66
BmnFHCalModule::fModuleEnergy
float fModuleEnergy
Definition
BmnFHCalModule.h:67
BmnFHCalModule::reset
void reset()
Definition
BmnFHCalModule.cxx:91
BmnFHCalModule::fSectVec
std::vector< float > fSectVec
Definition
BmnFHCalModule.h:68
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
FairHit
TVector3
BmnFHCalModule.h
std
Definition
json.hpp:4446
std::noexcept
*brief exchanges the values of two JSON objects *sa nlohmann::NLOHMANN_BASIC_JSON_TPL &j2 noexcept(is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
Definition
json.hpp:20347
detectors
fhcal
BmnFHCalModule.cxx
Generated on
for BmnRoot by
1.17.0