10#define TRGECLCLUSTER_SHORT_NAMES
11#include <framework/gearbox/Unit.h>
13#include "trg/ecl/TrgEclTiming.h"
26 m_EventTimingQualityFlag = -1;
27 m_EventTimingTCId = 0;
28 m_EventTimingTCThetaId = 0;
29 m_EventTimingTCEnergy = 0;
30 m_EventTimingQualityThresholds = {0.5, 2.0};
44 const std::vector<double>& HitTCEnergy,
45 const std::vector<double>& HitTCTiming)
57 double EventTiming = 0;
62 }
else if (method == 1) {
78 double FastestEnergy = 0;
79 double FastestTiming = 9999;
81 const int hit_size =
TCTiming.size();
83 for (
int ihit = 0; ihit < hit_size; ihit++) {
84 if (
TCTiming[ihit] < FastestTiming) {
86 FastestTCId =
TCId[ihit];
91 if (FastestTCId < 81) {
93 }
else if (FastestTCId < 513) {
99 m_EventTimingTCId = FastestTCId;
101 m_EventTimingTCEnergy = FastestEnergy;
103 return FastestTiming;
112 double maxEnergy = 0;
113 double maxTiming = 0;
115 const int hit_size =
TCTiming.size();
117 for (
int ihit = 0; ihit < hit_size; ihit++) {
121 maxTCId =
TCId[ihit];
126 }
else if (maxTCId < 513) {
133 m_EventTimingQualityFlag = 0;
135 if (maxEnergy > m_EventTimingQualityThresholds[1]) {
136 m_EventTimingQualityFlag = 3;
137 }
else if (maxEnergy > m_EventTimingQualityThresholds[0]) {
138 m_EventTimingQualityFlag = 2;
140 m_EventTimingQualityFlag = 1;
144 m_EventTimingTCId = maxTCId;
146 m_EventTimingTCEnergy = maxEnergy;
156 std::vector<double> maxEnergy;
157 std::vector<double> maxTiming;
164 maxEnergy.resize(NtopTC, 0);
165 maxTiming.resize(NtopTC, 0);
167 const int hit_size =
TCTiming.size();
169 double EventTiming = 0;
171 for (
int iNtopTC = 0; iNtopTC < NtopTC ; iNtopTC++) {
172 for (
int ihit = 0; ihit < hit_size; ihit++) {
174 if (maxEnergy[iNtopTC] <
TCEnergy[ihit]) {
175 maxEnergy[iNtopTC] =
TCEnergy[ihit];
176 maxTiming[iNtopTC] =
TCTiming[ihit];
177 maxTCId =
TCId[ihit];
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];
187 E_sum += maxEnergy[iNtopTC];
188 EventTiming += maxEnergy[iNtopTC] * maxTiming[iNtopTC];
191 EventTiming /= E_sum;
195 }
else if (maxTCId < 513) {
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
std::vector< double > TCEnergy
TC Energy.
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.
std::vector< double > TCTiming
TC Timing.
virtual ~TrgEclTiming()
Constructor.
TrgEclTiming()
Constructor.
double GetEventTiming01()
The Most energetic TC Timing.
int Source
Timing Source (FWD, Barrel, Backward)
double GetEventTiming02()
Energy weighted Timing of Top 3 energetic TC.
TrgEclMapping * _TCMap
Object of TC Mapping.
std::vector< int > TCId
TC Id.
Abstract base class for different kinds of events.