89 {
90
93 if (not eventInfo.isValid()) {
95 return StatusCode::FAILURE;
96 }
101 }
102 int lumiBlock0 =eventInfo->lumiBlock();
104
105 if (not rdoContainer.isValid()) {
107 return StatusCode::FAILURE;
108 }
109 SG::ReadHandle<DataVector<Trk::Track>> trkCollection(
m_tracksName);
110 if (not trkCollection.isValid()) {
112 return StatusCode::FAILURE;
113 }
114
115
116
118 if (not vertices.isValid()) {
119 ATH_MSG_DEBUG (
"Couldn't retrieve VertexContainer with key: PrimaryVertices");
120 return StatusCode::SUCCESS;
121 }
122
123 int countVertices(0);
126 if ( vx-> nTrackParticles() >= 3) countVertices++;
127 }
128 }
129 if (countVertices < 1) {
130 ATH_MSG_INFO(
"no vertices with at least 3 tracks found" );
131 return StatusCode::SUCCESS;
132 }
133
135 int countRDOhitsInEvent(0);
137 const InDetRawDataCollection<TRT_RDORawData>* TRTCollection(*rdoIt);
138 if (not TRTCollection) continue;
140 countRDOhitsInEvent++;
141 }
142 }
143 if (countRDOhitsInEvent>100000) {
144 ATH_MSG_INFO(
"N RDO hits in event greater than 100000: " << countRDOhitsInEvent <<
", exiting" );
146 }
147
148 if (trkCollection->size() > 10) {
149 ATH_MSG_INFO(
"N tracks greater than 10: " << trkCollection->size() <<
", exiting" );
151 }
152 }
153
154
155
156
157
158 std::vector<Identifier> holeIdentifiers;
159 std::vector<Identifier> holeIdentifiersWithHits;
161 const Trk::Track *
track = *trackIt;
162
163 const Trk::Perigee* perigee = (*trackIt)->perigeeParameters();
164 if ( not perigee ) {
ATH_MSG_ERROR(
"Trk::Perigee missing" );
continue; }
165 if ( std::abs(perigee->pT())/CLHEP::GeV < 1. ) continue;
166
167 const DataVector<const Trk::TrackStateOnSurface>* trackStates = (**trackIt).trackStateOnSurfaces();
168 if ( not trackStates ) {
ATH_MSG_ERROR(
"Trk::TrackStateOnSurface empty" );
continue; }
169
170 int n_pixel_hits(0), n_sct_hits(0), n_trt_hits(0);
172 if ( *trackStatesIt ==
nullptr ) {
ATH_MSG_ERROR(
"*trackStatesIt == 0" );
continue; }
173
175
176 if ( dynamic_cast<const InDet::TRT_DriftCircleOnTrack*> ( (*trackStatesIt)->measurementOnTrack() ) ) n_trt_hits++;
177 else if ( dynamic_cast<const InDet::SCT_ClusterOnTrack*> ( (*trackStatesIt)->measurementOnTrack() ) ) n_sct_hits++;
178 else if( dynamic_cast<const InDet::PixelClusterOnTrack*> ( (*trackStatesIt)->measurementOnTrack() ) ) n_pixel_hits++;
179 }
180 if (n_pixel_hits<2 || n_sct_hits < 6 || n_trt_hits<15) continue;
181
182
183
184
185
187
188 if ( *trackStatesIt ==
nullptr ) {
ATH_MSG_ERROR(
"*trackStatesIt == 0" );
continue; }
189
191
192 const InDet::TRT_DriftCircleOnTrack *driftCircleOnTrack = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>( (*trackStatesIt)->measurementOnTrack() );
193 if ( not driftCircleOnTrack ) continue;
194
195 const Trk::TrackStateOnSurface& hit = **trackStatesIt;
196
200
201 double unbiased_locR = unbiased_track_parameters->parameters()[
Trk::locR];
202 if ( std::abs(unbiased_locR) >
m_locR_cut )
continue;
203
204 const InDet::TRT_DriftCircle *
driftCircle = driftCircleOnTrack->prepRawData();
205 if ( driftCircle ==
nullptr ) {
ATH_MSG_ERROR(
"driftCircle == 0" );
continue; }
206
211
212 }
213
214
215
217 if (
holes==
nullptr )
continue;
218 for (
const Trk::TrackStateOnSurface* trackStates : *
holes) {
219
221
223 if (!track_parameters) {
ATH_MSG_WARNING(
"m_trt_hole_finder track_parameters missing" );
continue; }
224
226 if ( !(
m_TRTHelper->is_trt(
id)) ) {
ATH_MSG_ERROR(
"m_trt_hole_finder returned something that is not a TRT hole" );
continue; }
227
228
230
231 holeIdentifiers.push_back( id );
232 }
233
234 }
235
236
237
238
239
241 const InDetRawDataCollection<TRT_RDORawData>* TRTCollection(*rdoIt);
242 if (TRTCollection==nullptr) continue;
244 Identifier id = (*trtIt)->identify();
247 if ((*trtIt)->highLevel()) (*m_accumulateHits)[(
index[0]>0)?0:1][
index[2]][
index[5]][2]++;
248
249 if (std::find(holeIdentifiers.begin(), holeIdentifiers.end(), id) != holeIdentifiers.end())
250 holeIdentifiersWithHits.push_back( id );
251 }
252 }
253
254
255
256
257
258 for (
unsigned int i=0;
i<holeIdentifiers.size();
i++) {
259
260 Identifier
id = holeIdentifiers[
i];
261
263
265
266 if (std::find(holeIdentifiersWithHits.begin(), holeIdentifiersWithHits.end(), id) != holeIdentifiersWithHits.end())
268 }
269
270
271
276}
#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.