Belle II Software development
TrgEclTiming Class Reference

A Class of ECL Trigger clustering
More...

#include <TrgEclTiming.h>

Public Member Functions

 TrgEclTiming ()
 Constructor.
 
virtual ~TrgEclTiming ()
 Constructor.
 
 TrgEclTiming (TrgEclTiming &)=delete
 Destructor.
 
TrgEclTimingoperator= (TrgEclTiming &)=delete
 Assignment operator, deleted.
 
void Setup (const std::vector< int > &, const std::vector< double > &, const std::vector< double > &)
 SetUp.
 
double GetEventTiming (int)
 Get Evnet-timing.
 
double GetEventTiming00 ()
 Fastest TC Timing.
 
double GetEventTiming01 ()
 The Most energetic TC Timing.
 
double GetEventTiming02 ()
 Energy weighted Timing of Top 3 energetic TC.
 
void SetNofTopTC (int NtopTC)
 Set # of considered TC in Energy weighted timing method.
 
int GetTimingSource ()
 Get Timing Source.
 
void setEventTimingQualityThresholds (const std::vector< double > &iEventTimingQualityThresholds)
 
int getEventTimingQualityFlag ()
 
int getEventTimingTCId ()
 
int getEventTimingTCThetaId ()
 
double getEventTimingTCEnergy ()
 

Private Attributes

std::vector< double > TCEnergy
 TC Energy.
 
std::vector< double > TCTiming
 TC Timing.
 
std::vector< int > TCId
 TC Id.
 
int m_EventTimingQualityFlag
 
std::vector< double > m_EventTimingQualityThresholds
 
int m_EventTimingTCId
 
int m_EventTimingTCThetaId
 
double m_EventTimingTCEnergy
 
int NofTopTC
 
TrgEclMapping_TCMap
 Object of TC Mapping.
 
int Source
 Timing Source (FWD, Barrel, Backward)
 

Detailed Description

A Class of ECL Trigger clustering

Definition at line 29 of file TrgEclTiming.h.

Constructor & Destructor Documentation

◆ TrgEclTiming() [1/2]

Constructor.

Definition at line 20 of file TrgEclTiming.cc.

20 : NofTopTC(3), Source(0)
21{
22 _TCMap = new TrgEclMapping();
23 TCEnergy.clear();
24 TCTiming.clear();
25 TCId.clear();
26 m_EventTimingQualityFlag = -1;
27 m_EventTimingTCId = 0;
28 m_EventTimingTCThetaId = 0;
29 m_EventTimingTCEnergy = 0;
30 m_EventTimingQualityThresholds = {0.5, 2.0}; // GeV
31}
A class of TC Mapping.
Definition: TrgEclMapping.h:26
std::vector< double > TCEnergy
TC Energy.
Definition: TrgEclTiming.h:87
std::vector< double > TCTiming
TC Timing.
Definition: TrgEclTiming.h:89
int Source
Timing Source (FWD, Barrel, Backward)
Definition: TrgEclTiming.h:113
TrgEclMapping * _TCMap
Object of TC Mapping.
Definition: TrgEclTiming.h:111
std::vector< int > TCId
TC Id.
Definition: TrgEclTiming.h:91

◆ ~TrgEclTiming()

~TrgEclTiming ( )
virtual

Constructor.

Destructor

Definition at line 35 of file TrgEclTiming.cc.

36{
37 delete _TCMap;
38}

◆ TrgEclTiming() [2/2]

TrgEclTiming ( TrgEclTiming )
delete

Destructor.

Copy constructor, deleted

Member Function Documentation

◆ GetEventTiming()

double GetEventTiming ( int  method)

Get Evnet-timing.

Definition at line 55 of file TrgEclTiming.cc.

56{
57 double EventTiming = 0;
58
59 if (method == 0) {
60 // Fastest timing (belle)
61 EventTiming = GetEventTiming00();
62 } else if (method == 1) {
63 // Maximum energy
64 EventTiming = GetEventTiming01();
65 } else {
66 // Energy weighted timing
67 EventTiming = GetEventTiming02();
68 }
69
70 return EventTiming;
71}
double GetEventTiming00()
Fastest TC Timing.
Definition: TrgEclTiming.cc:75
double GetEventTiming01()
The Most energetic TC Timing.
double GetEventTiming02()
Energy weighted Timing of Top 3 energetic TC.

◆ GetEventTiming00()

double GetEventTiming00 ( )

Fastest TC Timing.

Definition at line 75 of file TrgEclTiming.cc.

76{
77 Source = 0;
78 double FastestEnergy = 0;
79 double FastestTiming = 9999;
80 int FastestTCId = 0;
81 const int hit_size = TCTiming.size();
82
83 for (int ihit = 0; ihit < hit_size; ihit++) {
84 if (TCTiming[ihit] < FastestTiming) {
85 FastestTiming = TCTiming[ihit];
86 FastestTCId = TCId[ihit];
87 FastestEnergy = TCEnergy[ihit];
88 }
89 }
90
91 if (FastestTCId < 81) {
92 Source = 1;
93 } else if (FastestTCId < 513) {
94 Source = 2;
95 } else {
96 Source = 4;
97 }
98
99 m_EventTimingTCId = FastestTCId;
100 m_EventTimingTCThetaId = _TCMap->getTCThetaIdFromTCId(FastestTCId);
101 m_EventTimingTCEnergy = FastestEnergy;
102
103 return FastestTiming;
104}
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]

◆ GetEventTiming01()

double GetEventTiming01 ( )

The Most energetic TC Timing.

Definition at line 108 of file TrgEclTiming.cc.

109{
110 Source = 0;
111
112 double maxEnergy = 0;
113 double maxTiming = 0;
114 int maxTCId = 0;
115 const int hit_size = TCTiming.size();
116
117 for (int ihit = 0; ihit < hit_size; ihit++) {
118 if (TCEnergy[ihit] > maxEnergy) {
119 maxEnergy = TCEnergy[ihit] ;
120 maxTiming = TCTiming[ihit] ;
121 maxTCId = TCId[ihit];
122 }
123 }
124 if (maxTCId < 81) {
125 Source = 1;
126 } else if (maxTCId < 513) {
127 Source = 2;
128 } else {
129 Source = 4;
130 }
131
132 if (hit_size == 0) {
133 m_EventTimingQualityFlag = 0;
134 } else {
135 if (maxEnergy > m_EventTimingQualityThresholds[1]) {
136 m_EventTimingQualityFlag = 3;
137 } else if (maxEnergy > m_EventTimingQualityThresholds[0]) {
138 m_EventTimingQualityFlag = 2;
139 } else {
140 m_EventTimingQualityFlag = 1;
141 }
142 }
143
144 m_EventTimingTCId = maxTCId;
145 m_EventTimingTCThetaId = _TCMap->getTCThetaIdFromTCId(maxTCId);
146 m_EventTimingTCEnergy = maxEnergy;
147
148 return maxTiming;
149}

◆ GetEventTiming02()

double GetEventTiming02 ( )

Energy weighted Timing of Top 3 energetic TC.

Definition at line 153 of file TrgEclTiming.cc.

154{
155 Source = 0;
156 std::vector<double> maxEnergy;
157 std::vector<double> maxTiming;
158
159 const int NtopTC = NofTopTC;
160 int maxTCId = 0;
161
162 maxEnergy.clear();
163 maxTiming.clear();
164 maxEnergy.resize(NtopTC, 0);
165 maxTiming.resize(NtopTC, 0);
166
167 const int hit_size = TCTiming.size();
168 double E_sum = 0;
169 double EventTiming = 0;
170
171 for (int iNtopTC = 0; iNtopTC < NtopTC ; iNtopTC++) {
172 for (int ihit = 0; ihit < hit_size; ihit++) {
173 if (iNtopTC == 0) {
174 if (maxEnergy[iNtopTC] < TCEnergy[ihit]) {
175 maxEnergy[iNtopTC] = TCEnergy[ihit];
176 maxTiming[iNtopTC] = TCTiming[ihit];
177 maxTCId = TCId[ihit];
178 }
179 } else if (iNtopTC > 0) {
180 if (maxEnergy[iNtopTC - 1] > TCEnergy[ihit] &&
181 maxEnergy[iNtopTC] < TCEnergy[ihit]) {
182 maxEnergy[iNtopTC] = TCEnergy[ihit];
183 maxTiming[iNtopTC] = TCTiming[ihit];
184 }
185 }
186 }
187 E_sum += maxEnergy[iNtopTC];
188 EventTiming += maxEnergy[iNtopTC] * maxTiming[iNtopTC];
189 }
190
191 EventTiming /= E_sum;
192
193 if (maxTCId < 81) {
194 Source = 1;
195 } else if (maxTCId < 513) {
196 Source = 2;
197 } else {
198 Source = 4;
199 }
200
201 return EventTiming;
202}

◆ getEventTimingQualityFlag()

int getEventTimingQualityFlag ( )
inline

Definition at line 65 of file TrgEclTiming.h.

66 {
67 return m_EventTimingQualityFlag;
68 }

◆ getEventTimingTCEnergy()

double getEventTimingTCEnergy ( )
inline

Definition at line 80 of file TrgEclTiming.h.

81 {
82 return m_EventTimingTCEnergy;
83 }

◆ getEventTimingTCId()

int getEventTimingTCId ( )
inline

Definition at line 70 of file TrgEclTiming.h.

71 {
72 return m_EventTimingTCId;
73 }

◆ getEventTimingTCThetaId()

int getEventTimingTCThetaId ( )
inline

Definition at line 75 of file TrgEclTiming.h.

76 {
77 return m_EventTimingTCThetaId;
78 }

◆ GetTimingSource()

int GetTimingSource ( )
inline

Get Timing Source.

Definition at line 58 of file TrgEclTiming.h.

58{return Source;}

◆ setEventTimingQualityThresholds()

void setEventTimingQualityThresholds ( const std::vector< double > &  iEventTimingQualityThresholds)
inline

Definition at line 60 of file TrgEclTiming.h.

61 {
62 m_EventTimingQualityThresholds = iEventTimingQualityThresholds;
63 }

◆ SetNofTopTC()

void SetNofTopTC ( int  NtopTC)
inline

Set # of considered TC in Energy weighted timing method.

Definition at line 56 of file TrgEclTiming.h.

56{NofTopTC = NtopTC;}

◆ Setup()

void Setup ( const std::vector< int > &  HitTCId,
const std::vector< double > &  HitTCEnergy,
const std::vector< double > &  HitTCTiming 
)

SetUp.

Definition at line 43 of file TrgEclTiming.cc.

46{
47 TCId = HitTCId;
48 TCEnergy = HitTCEnergy;
49 TCTiming = HitTCTiming;
50 return;
51}

Member Data Documentation

◆ _TCMap

TrgEclMapping* _TCMap
private

Object of TC Mapping.

Definition at line 111 of file TrgEclTiming.h.

◆ m_EventTimingQualityFlag

int m_EventTimingQualityFlag
private

Definition at line 98 of file TrgEclTiming.h.

◆ m_EventTimingQualityThresholds

std::vector<double> m_EventTimingQualityThresholds
private

Definition at line 100 of file TrgEclTiming.h.

◆ m_EventTimingTCEnergy

double m_EventTimingTCEnergy
private

Definition at line 106 of file TrgEclTiming.h.

◆ m_EventTimingTCId

int m_EventTimingTCId
private

Definition at line 102 of file TrgEclTiming.h.

◆ m_EventTimingTCThetaId

int m_EventTimingTCThetaId
private

Definition at line 104 of file TrgEclTiming.h.

◆ NofTopTC

int NofTopTC
private

of considered TC in Energy weighted timing method.

Definition at line 109 of file TrgEclTiming.h.

◆ Source

int Source
private

Timing Source (FWD, Barrel, Backward)

Definition at line 113 of file TrgEclTiming.h.

◆ TCEnergy

std::vector<double> TCEnergy
private

TC Energy.

Definition at line 87 of file TrgEclTiming.h.

◆ TCId

std::vector<int> TCId
private

TC Id.

Definition at line 91 of file TrgEclTiming.h.

◆ TCTiming

std::vector<double> TCTiming
private

TC Timing.

Definition at line 89 of file TrgEclTiming.h.


The documentation for this class was generated from the following files: