63 {
64
66
68 ATH_CHECK(trigRNNOutputColl.record (std::make_unique<xAOD::TrigRNNOutputContainer>(),
69 std::make_unique<xAOD::TrigRNNOutputAuxContainer>()));
70
72
75
76 if (roiCollection->size()==0) {
78 return StatusCode::SUCCESS;
79 }
80
82
84 <<
": Eta = " << (roiDescriptor)->
eta()
85 <<
", Phi = " << (roiDescriptor)->
phi());
86
87
88 std::vector<float> trththits{0,-999,0,-999,-999,-999};
89
90
93
94
97
98
99 std::vector<TRT_hit> hit;
100
101
104
108
109 float phiTolerance = 0.001;
110 float etaTolerance = 0.001;
111
114
117
119 float fineWedgeHalfWidth = coarseWedgeHalfWidth/
m_nBinFine;
120
121
123
126
127 if (trtDCC->size() == 0){
128 return StatusCode::SUCCESS;
129 }
130
131 InDet::TRT_DriftCircleContainer::const_iterator trtdriftContainerItr = trtDCC->begin();
132 InDet::TRT_DriftCircleContainer::const_iterator trtdriftContainerItrE = trtDCC->end();
133
134 for (; trtdriftContainerItr != trtdriftContainerItrE; ++trtdriftContainerItr) {
135
136 InDet::TRT_DriftCircleCollection::const_iterator trtItr = (*trtdriftContainerItr)->begin();
137 InDet::TRT_DriftCircleCollection::const_iterator trtEnd = (*trtdriftContainerItr)->end();
138
139 for(; trtItr!=trtEnd; ++trtItr){
140
141
142 const InDetDD::TRT_BaseElement *
det = (*trtItr)->detectorElement();
143 Identifier
ID = (*trtItr)->identify();
145
146 bool hth = false;
147 float hphi = strawcenter.phi();
148 float heta = strawcenter.eta();
149 float R = strawcenter.perp();
150
151 if ((*trtItr)->highLevel()) hth = true;
152
153
155 hit.push_back(
make_hit(hphi,R,hth));
156
157
158
159 int countbin=0;
163 float increment = 2*coarseWedgeHalfWidth;
164 for(float roibincenter = startValue; roibincenter < endValue; roibincenter += increment){
166 if(hth) count_httrt_c.at(countbin) += 1.;
167 count_tottrt_c.at(countbin) += 1.;
168 break;
169 }
170 countbin++;
171 }
172 }
173 ATH_MSG_VERBOSE (
"timeOverThreshold=" << (*trtItr)->timeOverThreshold()
174 << " highLevel=" << (*trtItr)->highLevel()
175 << " rawDriftTime=" << (*trtItr)->rawDriftTime()
178 <<
" layer_or_wheel=" <<
m_trtHelper->layer_or_wheel(ID)
182 << " scPhi=" << hphi
183 << " scEta=" << heta);
184 }
185 }
186 }
187
188
189 int maxHits = 0;
190 int dist = 0;
191
192 for (size_t iw = 0; iw < count_httrt_c.size(); iw++){
193 if(maxHits <= count_httrt_c[iw]){
194 maxHits = count_httrt_c[iw];
195 dist = iw;
196 }
197 }
198
199
200 float center_pos_phi=roiDescriptor->
phi()+(2*dist+1-
m_nBinCoarse)*coarseWedgeHalfWidth;
201
202
203 for(
size_t v=0;
v<hit.size();
v++){
204 int countbin=0;
206 float startValue = center_pos_phi - 3*coarseWedgeHalfWidth + fineWedgeHalfWidth;
207 float endValue = center_pos_phi + 3*coarseWedgeHalfWidth;
208 float increment = 2*fineWedgeHalfWidth;
209 for(float roibincenter = startValue; roibincenter < endValue; roibincenter += increment){
211 if(hit[v].isHT) count_httrt.at(countbin) += 1.;
212 count_tottrt.at(countbin) += 1.;
213 break;
214 }
215 countbin++;
216 }
217 }
218 }
219
220
221 maxHits = 0;
222 dist = 0;
223
224 for (size_t iw = 0; iw < count_httrt.size(); iw++){
225 if(maxHits <= count_httrt[iw]){
226 maxHits = count_httrt[iw];
227 dist = iw;
228 }
229 }
230
231
232 center_pos_phi+=(2*dist+1-3*
m_nBinFine)*fineWedgeHalfWidth;
233
234
235 int trthit=0, trthit_ht=0;
236 for(
size_t v=0;
v<hit.size();
v++){
238 if(hit[v].isHT) trthit_ht+=1;
239 trthit+=1;
240 }
241 }
242
244 trththits[0] = trthit_ht;
245 trththits[1] = (
float)trthit_ht/trthit;
246 }
247
248
249 trthit = 0;
250 trthit_ht = 0;
251
254
255
256 if(binNumber >= 0 && binNumber < (int)count_httrt.size()){
257 trthit += count_tottrt.at(binNumber);
258 trthit_ht += count_httrt.at(binNumber);
259 }
260 }
261
263 trththits[2] = trthit_ht;
264 trththits[3] = (
float)trthit_ht/trthit;
265 }
266
267 trththits[4]=roiDescriptor->
eta();
268 trththits[5]=roiDescriptor->
phi();
269
275
276
278 trigRNNOutputColl->push_back(rnnOutput);
280
281 ATH_MSG_DEBUG(
"REGTEST: returning an xAOD::TrigRNNOutputContainer with size "<< trigRNNOutputColl->size() <<
".");
282
283 return StatusCode::SUCCESS;
284}
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)
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())
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
TrigRNNOutput_v2 TrigRNNOutput
Define the latest version of the RingerRings class.
setTeId setLumiBlock roiId