59 {
60
62
64 ATH_CHECK(trigRNNOutputColl.record (std::make_unique<xAOD::TrigRNNOutputContainer>(),
65 std::make_unique<xAOD::TrigRNNOutputAuxContainer>()));
66
68
71
72 if (roiCollection->size()==0) {
74 return StatusCode::SUCCESS;
75 }
76
78
80 <<
": Eta = " << (roiDescriptor)->
eta()
81 <<
", Phi = " << (roiDescriptor)->
phi());
82
83
84 std::vector<float> trththits{0,-999,0,-999,-999,-999};
85
86
89
90
93
94
95 std::vector<TRT_hit> hit;
96
97
100
104
105 float phiTolerance = 0.001;
106 float etaTolerance = 0.001;
107
110
113
115 float fineWedgeHalfWidth = coarseWedgeHalfWidth/
m_nBinFine;
116
117
119
122
123 if (trtDCC->size() == 0){
124 return StatusCode::SUCCESS;
125 }
126
127 InDet::TRT_DriftCircleContainer::const_iterator trtdriftContainerItr = trtDCC->begin();
128 InDet::TRT_DriftCircleContainer::const_iterator trtdriftContainerItrE = trtDCC->end();
129
130 for (; trtdriftContainerItr != trtdriftContainerItrE; ++trtdriftContainerItr) {
131
132 InDet::TRT_DriftCircleCollection::const_iterator trtItr = (*trtdriftContainerItr)->begin();
133 InDet::TRT_DriftCircleCollection::const_iterator trtEnd = (*trtdriftContainerItr)->end();
134
135 for(; trtItr!=trtEnd; ++trtItr){
136
137
138 const InDetDD::TRT_BaseElement *
det = (*trtItr)->detectorElement();
139 Identifier
ID = (*trtItr)->identify();
141
142 bool hth = false;
143 float hphi = strawcenter.phi();
144 float heta = strawcenter.eta();
145 float R = strawcenter.perp();
146
147 if ((*trtItr)->highLevel()) hth = true;
148
149
151 hit.push_back(
make_hit(hphi,R,hth));
152
153
154
155 int countbin=0;
159 float increment = 2*coarseWedgeHalfWidth;
160 for(float roibincenter = startValue; roibincenter < endValue; roibincenter += increment){
162 if(hth) count_httrt_c.at(countbin) += 1.;
163 count_tottrt_c.at(countbin) += 1.;
164 break;
165 }
166 countbin++;
167 }
168 }
169 ATH_MSG_VERBOSE (
"timeOverThreshold=" << (*trtItr)->timeOverThreshold()
170 << " highLevel=" << (*trtItr)->highLevel()
171 << " rawDriftTime=" << (*trtItr)->rawDriftTime()
178 << " scPhi=" << hphi
179 << " scEta=" << heta);
180 }
181 }
182 }
183
184
185 int maxHits = 0;
186 int dist = 0;
187
188 for (size_t iw = 0; iw < count_httrt_c.size(); iw++){
189 if(maxHits <= count_httrt_c[iw]){
190 maxHits = count_httrt_c[iw];
191 dist = iw;
192 }
193 }
194
195
196 float center_pos_phi=roiDescriptor->
phi()+(2*dist+1-
m_nBinCoarse)*coarseWedgeHalfWidth;
197
198
199 for(
size_t v=0;
v<hit.size();
v++){
200 int countbin=0;
202 float startValue = center_pos_phi - 3*coarseWedgeHalfWidth + fineWedgeHalfWidth;
203 float endValue = center_pos_phi + 3*coarseWedgeHalfWidth;
204 float increment = 2*fineWedgeHalfWidth;
205 for(float roibincenter = startValue; roibincenter < endValue; roibincenter += increment){
207 if(hit[v].isHT) count_httrt.at(countbin) += 1.;
208 count_tottrt.at(countbin) += 1.;
209 break;
210 }
211 countbin++;
212 }
213 }
214 }
215
216
217 maxHits = 0;
218 dist = 0;
219
220 for (size_t iw = 0; iw < count_httrt.size(); iw++){
221 if(maxHits <= count_httrt[iw]){
222 maxHits = count_httrt[iw];
223 dist = iw;
224 }
225 }
226
227
228 center_pos_phi+=(2*dist+1-3*
m_nBinFine)*fineWedgeHalfWidth;
229
230
231 int trthit=0, trthit_ht=0;
232 for(
size_t v=0;
v<hit.size();
v++){
234 if(hit[v].isHT) trthit_ht+=1;
235 trthit+=1;
236 }
237 }
238
240 trththits[0] = trthit_ht;
241 trththits[1] = (
float)trthit_ht/trthit;
242 }
243
244
245 trthit = 0;
246 trthit_ht = 0;
247
250
251
252 if(binNumber >= 0 && binNumber < (int)count_httrt.size()){
253 trthit += count_tottrt.at(binNumber);
254 trthit_ht += count_httrt.at(binNumber);
255 }
256 }
257
259 trththits[2] = trthit_ht;
260 trththits[3] = (
float)trthit_ht/trthit;
261 }
262
263 trththits[4]=roiDescriptor->
eta();
264 trththits[5]=roiDescriptor->
phi();
265
271
272
274 trigRNNOutputColl->push_back(rnnOutput);
276
277 ATH_MSG_DEBUG(
"REGTEST: returning an xAOD::TrigRNNOutputContainer with size "<< trigRNNOutputColl->size() <<
".");
278
279 return StatusCode::SUCCESS;
280}
Scalar eta() const
pseudorapidity method
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::vector< Identifier > ID
Athena::TPCnvVers::Current TrigRoiDescriptor
float dist2COR(float R, float phi1, float phi2)
bool hth_eta_match(float caleta, float trteta, float etaWindow)
TRT_hit make_hit(float phi, float R, bool isHT)
virtual double etaMinus() const override final
gets eta at zMinus
virtual double etaPlus() const override final
gets eta at zedPlus
virtual double phi() const override final
Methods to retrieve data members.
virtual double phiMinus() const override final
gets phiMinus
virtual double eta() const override final
virtual double phiPlus() const override final
gets phiPlus
Gaudi::Property< int > m_wedgeNBin
Gaudi::Property< float > m_etaHalfWidth
Gaudi::Property< int > m_nBinCoarse
Gaudi::Property< float > m_roadWidth
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
const TRT_ID * m_trtHelper
TRT ID helper.
Gaudi::Property< float > m_phiHalfWidth
SG::WriteHandleKey< xAOD::TrigRNNOutputContainer > m_trigRNNOutputKey
Gaudi::Property< float > m_roadMaxEta
Gaudi::Property< float > m_wedgeMinEta
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_trtDCContainerKey
Gaudi::Property< int > m_nBinFine
void setRnnDecision(const std::vector< float > &d)
Eigen::Matrix< double, 3, 1 > Vector3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
T deltaPhi(T phiA, T phiB)
Return difference phiA - phiB in range [-pi, pi].
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TrigRNNOutput_v2 TrigRNNOutput
Define the latest version of the RingerRings class.
setTeId setLumiBlock roiId