93 {
94
97 if (not eventInfo.isValid()) {
99 return StatusCode::FAILURE;
100 }
105 }
106 int lumiBlock0 =eventInfo->lumiBlock();
108
109 if (not rdoContainer.isValid()) {
111 return StatusCode::FAILURE;
112 }
113 SG::ReadHandle<DataVector<Trk::Track>> trkCollection(
m_tracksName);
114 if (not trkCollection.isValid()) {
116 return StatusCode::FAILURE;
117 }
118
119
120
122 if (not vertices.isValid()) {
123 ATH_MSG_DEBUG (
"Couldn't retrieve VertexContainer with key: PrimaryVertices");
124 return StatusCode::SUCCESS;
125 }
126
127 int countVertices(0);
130 if ( vx-> nTrackParticles() >= 3) countVertices++;
131 }
132 }
133 if (countVertices < 1) {
134 ATH_MSG_INFO(
"no vertices with at least 3 tracks found" );
135 return StatusCode::SUCCESS;
136 }
137
139 int countRDOhitsInEvent(0);
141 const InDetRawDataCollection<TRT_RDORawData>* TRTCollection(*rdoIt);
142 if (not TRTCollection) continue;
144 countRDOhitsInEvent++;
145 }
146 }
147 if (countRDOhitsInEvent>100000) {
148 ATH_MSG_INFO(
"N RDO hits in event greater than 100000: " << countRDOhitsInEvent <<
", exiting" );
150 }
151
152 if (trkCollection->size() > 10) {
153 ATH_MSG_INFO(
"N tracks greater than 10: " << trkCollection->size() <<
", exiting" );
155 }
156 }
157
158
159
160
161
162 std::vector<Identifier> holeIdentifiers;
163 std::vector<Identifier> holeIdentifiersWithHits;
165 const Trk::Track *
track = *trackIt;
166
167 const Trk::Perigee* perigee = (*trackIt)->perigeeParameters();
168 if ( not perigee ) {
ATH_MSG_ERROR(
"Trk::Perigee missing" );
continue; }
169 if ( std::abs(perigee->pT())/CLHEP::GeV < 1. ) continue;
170
171 const DataVector<const Trk::TrackStateOnSurface>* trackStates = (**trackIt).trackStateOnSurfaces();
172 if ( not trackStates ) {
ATH_MSG_ERROR(
"Trk::TrackStateOnSurface empty" );
continue; }
173
174 int n_pixel_hits(0), n_sct_hits(0), n_trt_hits(0);
176 if ( *trackStatesIt ==
nullptr ) {
ATH_MSG_ERROR(
"*trackStatesIt == 0" );
continue; }
177
179
180 if ( dynamic_cast<const InDet::TRT_DriftCircleOnTrack*> ( (*trackStatesIt)->measurementOnTrack() ) ) n_trt_hits++;
181 else if ( dynamic_cast<const InDet::SCT_ClusterOnTrack*> ( (*trackStatesIt)->measurementOnTrack() ) ) n_sct_hits++;
182 else if( dynamic_cast<const InDet::PixelClusterOnTrack*> ( (*trackStatesIt)->measurementOnTrack() ) ) n_pixel_hits++;
183 }
184 if (n_pixel_hits<2 || n_sct_hits < 6 || n_trt_hits<15) continue;
185
186
187
188
189
191
192 if ( *trackStatesIt ==
nullptr ) {
ATH_MSG_ERROR(
"*trackStatesIt == 0" );
continue; }
193
195
196 const InDet::TRT_DriftCircleOnTrack *driftCircleOnTrack = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>( (*trackStatesIt)->measurementOnTrack() );
197 if ( not driftCircleOnTrack ) continue;
198
199 const Trk::TrackStateOnSurface& hit = **trackStatesIt;
200
204
205 double unbiased_locR = unbiased_track_parameters->parameters()[
Trk::locR];
206 if ( std::abs(unbiased_locR) >
m_locR_cut )
continue;
207
208 const InDet::TRT_DriftCircle *
driftCircle = driftCircleOnTrack->prepRawData();
209 if ( driftCircle ==
nullptr ) {
ATH_MSG_ERROR(
"driftCircle == 0" );
continue; }
210
215
216 }
217
218
219
221 if (
holes==
nullptr )
continue;
222 for (
const Trk::TrackStateOnSurface* trackStates : *
holes) {
223
225
227 if (!track_parameters) {
ATH_MSG_WARNING(
"m_trt_hole_finder track_parameters missing" );
continue; }
228
230 if ( !(
m_TRTHelper->is_trt(
id)) ) {
ATH_MSG_ERROR(
"m_trt_hole_finder returned something that is not a TRT hole" );
continue; }
231
232
234
235 holeIdentifiers.push_back( id );
236 }
237
238 }
239
240
241
242
243
245 const InDetRawDataCollection<TRT_RDORawData>* TRTCollection(*rdoIt);
246 if (TRTCollection==nullptr) continue;
248 Identifier id = (*trtIt)->identify();
251 if ((*trtIt)->highLevel()) (*m_accumulateHits)[(
index[0]>0)?0:1][
index[2]][
index[5]][2]++;
252
253 if (std::find(holeIdentifiers.begin(), holeIdentifiers.end(), id) != holeIdentifiers.end())
254 holeIdentifiersWithHits.push_back( id );
255 }
256 }
257
258
259
260
261
262 for (
unsigned int i=0;
i<holeIdentifiers.size();
i++) {
263
264 Identifier
id = holeIdentifiers[
i];
265
267
269
270 if (std::find(holeIdentifiersWithHits.begin(), holeIdentifiersWithHits.end(), id) != holeIdentifiersWithHits.end())
272 }
273
274
275
280}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
SG::ReadHandleKey< xAOD::VertexContainer > m_vxContainerKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
ToolHandle< Trk::ITrackHoleSearchTool > m_trt_hole_finder
StatusCode reportResults()
void myStrawIndex(Identifier id, int *index)
function that returns straw index (in range 0-5481; 0-1641 for barrel, the rest for endcap) same conv...
Gaudi::Property< double > m_locR_cut
SG::ReadHandleKey< DataVector< Trk::Track > > m_tracksName
PublicToolHandle< Trk::IUpdator > m_updator
Gaudi::Property< int > m_skipBusyEvents
SG::ReadHandleKey< TRT_RDO_Container > m_rdoContainerKey
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Hole
A hole on the track - this is defined in the following way.
::StatusCode StatusCode
StatusCode definition for legacy code.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersBase< TrackParametersDim, Charged > TrackParameters
Vertex_v1 Vertex
Define the latest version of the vertex class.