102 {
103
105
109 if (
sc.isFailure()) {
111 return StatusCode::SUCCESS;
112 }
114
115 SharedHitTrackAssoc* assoc = new SharedHitTrackAssoc();
116 ATH_MSG_INFO(
"Number of initial TrackParticles: " << inputTracks->size());
117
119
120
123 for (; trk1I!=trkE; ++trk1I) {
124 int nbs, nps, nss;
128 if (nbs < 0) nbs = 0;
129 if (nps < 0) nps = 0;
130 if (nss < 0) nss = 0;
131 if(nbs+nps+nss>0) assoc->
add( (*trk1I), nbs, nps, nss);
132 }
133 } else {
134
135
137
138
141 for (; trk1I!=trkE; ++trk1I) {
143 if(trk1==0) {
144 ATH_MSG_ERROR(
"Can't get the original track ! Please run on ESD");
145 return StatusCode::SUCCESS;
146 }
147
148
149 int q1 = 0 ,q2 = 0;
150 int np1 = 0, np2 = 0, ns1 = 0, ns2 = 0;
151 int nhp1 = 0, nhp2 = 0, nhs1 = 0, nhs2 = 0, nh1 = 0, nh2 = 0;
152 int nprec1 = 0, nprec2 = 0;
153 double chi21 = 0., chi22 = 0.;
155 chi21 = (*trk1I)->chiSquared();
158 nprec1 = np1 + ns1;
161 nh1 = nhp1 + nhs1;
162 q1 = 10000*(2*nprec1-nh1) - int(20.*chi21/float(nprec1));
163
164 }
165
167 const DataVector<const Trk::MeasurementBase>*
mb = (*trk1->
track())->measurementsOnTrack();
170 ATH_MSG_VERBOSE(
"First track (pT="<<t1p4.Pt()<<
", eta="<<t1p4.Eta ()<<
") has " <<
mb->size() <<
" RIOs on track");
171
176
181
183 for (; trk2I!=trkE; ++trk2I) {
184 if(trk2I==trk1I) continue;
186 if(trk2==0) {
187 ATH_MSG_ERROR(
"Can't get the original track ! Please run on ESD");
188 return StatusCode::SUCCESS;
189 }
191 double deltaR = t1p4.DeltaR(t2p4);
193
194
195
197 chi22 = (*trk2I)->chiSquared();
200 nprec1 = np1 + ns1;
203 nh2 = nhp2 + nhs2;
204 q2 = 10000*(2*nprec2-nh2) - int(20.*chi22/float(nprec2));
205 if (q1 > q2) continue;
206 }
207
208 nextMb =
mb->begin();
209 for(; nextMb != lastMb; ++nextMb) {
210 const Trk::RIO_OnTrack* nextRio = dynamic_cast<const Trk::RIO_OnTrack*>(*nextMb);
213 if( (!pixl) && (!ssct) ) continue;
214
215 for(
int i=0;
i<
m_nbpl;
i++) pl[i] =
false;
216 for(
int i=0;
i<
m_nbpd;
i++) pd[i] =
false;
217 if(pixl) {
221 for(
int i=1;
i<
m_nbpl;
i++) pl[i] = ( player == i );
222 } else {
224 for(
int i=0;
i<
m_nbpd;
i++) pd[i] = ( pdisk == i );
225 }
226 }
227
228 for(
int i=0;
i<
m_nbsl;
i++) sl[i] =
false;
229 for(
int i=0;
i<
m_nbsd;
i++) sd[i] =
false;
230 if(ssct) {
233 for(
int i=0;
i<
m_nbsl;
i++) sl[i] = ( slayer == i );
234 } else {
236 for(
int i=0;
i<
m_nbsd;
i++) sd[i] = ( sdisk == i );
237 }
238 }
239
240 const DataVector<const Trk::MeasurementBase>* mb2 = (*trk2->
track())->measurementsOnTrack();
243 if (nextMb ==
mb->begin())
ATH_MSG_VERBOSE(
"Second track (pT="<<t2p4.Pt()<<
") has " << mb2->
size() <<
" RIOs on track");
244 int nriosi = 0;
245 for(; nextMb2 != lastMb2; ++nextMb2) {
246 const Trk::RIO_OnTrack* nextRio2 = dynamic_cast<const Trk::RIO_OnTrack*>(*nextMb2);
249 if( (!pixl2) && (!ssct2) ) continue;
250 nriosi++;
252 ATH_MSG_DEBUG(
"Shared hit ! Track1 Pt = " << t1p4.Pt() <<
" Track2 Pt = " << t2p4.Pt());
254 ATH_MSG_VERBOSE(
"Track1 chi2 = " << chi21 <<
" nprec = " << nprec1 <<
" (np,ns) = (" << np1 <<
" , " << ns1 <<
") " <<
" nhole = " << nh1 <<
" (nhp,nhs) = (" << nhp1 <<
" , " << nhs1 <<
") " <<
" quality = " << q1);
255 ATH_MSG_VERBOSE(
"Track2 chi2 = " << chi22 <<
" nprec = " << nprec2 <<
" (np,ns) = (" << np2 <<
" , " << ns2 <<
") " <<
" nhole = " << nh2 <<
" (nhp,nhs) = (" << nhp2 <<
" , " << nhs2 <<
") " <<
" quality = " << q2);
256 }
259 ATH_MSG_DEBUG(sl[0] <<
" "<< sl[1] <<
" " << sl[2] <<
" " << sl[3]);
260 ATH_MSG_DEBUG(sd[0] <<
" "<< sd[1] <<
" " << sd[2] <<
" " << sd[3] <<
" " << sd[4] <<
" "<< sd[5] <<
" " << sd[6] <<
" " << sd[7] <<
" " << sd[8]);
263 if (pl[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_npl[
i]++;myvecTrkRio.push_back(p);}
264 }
266 if (pd[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_npd[
i]++;myvecTrkRio.push_back(p);}
267 }
269 if (sl[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_nsl[
i]++;myvecTrkRio.push_back(p);}
270 }
272 if (sd[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_nsd[
i]++;myvecTrkRio.push_back(p);}
273 }
274 }
275 }
276 }
277 }
278 }
279
284 }
285 }
286 }
287
289
290 if (
mlog.level() <= MSG::DEBUG) assoc->
dump();
291
294 } else {
296 }
297
298
299 return StatusCode::SUCCESS;
300}
Scalar deltaR(const MatrixBase< Derived > &vec) const
#define ATH_MSG_VERBOSE(x)
std::vector< pairTrkRio > vecpairTrkRio
std::pair< const xAOD::TrackParticle *, const Trk::RIO_OnTrack * > pairTrkRio
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
const PixelID * m_pixelId
if true use shared info from track summary instead of recomputing them
int numberSharedPix() const
int numberSharedSct() const
int numberSharedBLayer() const
void add(const xAOD::TrackParticle *const trk, int shPattern)
Identifier identify() const
return the identifier -extends MeasurementBase
TLorentzVector FourMom_t
Definition of the 4-momentum type.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
::StatusCode StatusCode
StatusCode definition for legacy code.
msgSvc
Provide convenience handles for various services.
const double mb
1mb to cm2
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].