18typedef std::pair<const xAOD::TrackParticle*, const Trk::RIO_OnTrack*>
pairTrkRio;
27 m_assocs.insert(std::make_pair(trk,shPattern));
30 int shPattern = 100000*shB + 1000*shS + 100*shP;
31 m_assocs.insert(std::make_pair(trk,shPattern));
34 int tempSharedPattern(0);
37 if(aI!=aE) tempSharedPattern = aI->second;
38 return tempSharedPattern/100000;
41 int tempSharedPattern(0);
44 if(aI!=aE) tempSharedPattern = aI->second;
45 return ((tempSharedPattern%100000)%1000)/100;
48 int tempSharedPattern(0);
51 if(aI!=aE) tempSharedPattern = aI->second;
52 return (tempSharedPattern%100000)/1000;
56 std::cout<<
"SharedHitTrackAssoc has "<<this->
size()<<
" elements:"<<std::endl;
60 std::cout <<
"--> track: "
61 <<
" Eta= " << aI->first->eta()
62 <<
" Phi= " << aI->first->phi()
63 <<
" pT= " << aI->first->pt()
64 <<
" Shared pattern= " << aI->second
98 std::cout<<name()<<
" initialized"<<std::endl;
99 return StatusCode::SUCCESS;
104 MsgStream mlog(msgSvc(), name());
109 if (
sc.isFailure()) {
111 return StatusCode::SUCCESS;
123 for (; trk1I!=trkE; ++trk1I) {
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);
141 for (; trk1I!=trkE; ++trk1I) {
144 ATH_MSG_ERROR(
"Can't get the original track ! Please run on ESD");
145 return StatusCode::SUCCESS;
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();
162 q1 = 10000*(2*nprec1-nh1) -
int(20.*chi21/
float(nprec1));
170 ATH_MSG_VERBOSE(
"First track (pT="<<t1p4.Pt()<<
", eta="<<t1p4.Eta ()<<
") has " << mb->size() <<
" RIOs on track");
183 for (; trk2I!=trkE; ++trk2I) {
184 if(trk2I==trk1I)
continue;
187 ATH_MSG_ERROR(
"Can't get the original track ! Please run on ESD");
188 return StatusCode::SUCCESS;
191 double deltaR = t1p4.DeltaR(t2p4);
197 chi22 = (*trk2I)->chiSquared();
204 q2 = 10000*(2*nprec2-nh2) -
int(20.*chi22/
float(nprec2));
205 if (q1 > q2)
continue;
208 nextMb = mb->begin();
209 for(; nextMb != lastMb; ++nextMb) {
213 if( (!pixl) && (!ssct) )
continue;
215 for(
int i=0;i<
m_nbpl;i++) pl[i] =
false;
216 for(
int i=0;i<
m_nbpd;i++) pd[i] =
false;
221 for(
int i=1;i<
m_nbpl;i++) pl[i] = ( player == i );
224 for(
int i=0;i<
m_nbpd;i++) pd[i] = ( pdisk == i );
228 for(
int i=0;i<
m_nbsl;i++) sl[i] =
false;
229 for(
int i=0;i<
m_nbsd;i++) sd[i] =
false;
233 for(
int i=0;i<
m_nbsl;i++) sl[i] = ( slayer == i );
236 for(
int i=0;i<
m_nbsd;i++) sd[i] = ( sdisk == i );
243 if (nextMb == mb->begin())
ATH_MSG_VERBOSE(
"Second track (pT="<<t2p4.Pt()<<
") has " << mb2->
size() <<
" RIOs on track");
245 for(; nextMb2 != lastMb2; ++nextMb2) {
249 if( (!pixl2) && (!ssct2) )
continue;
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);
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]);
261 pairTrkRio p = std::make_pair(*trk1I,nextRio);
262 for(
int i=0;i<
m_nbpl;i++) {
263 if (pl[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_npl[i]++;myvecTrkRio.push_back(p);}
265 for(
int i=0;i<
m_nbpd;i++) {
266 if (pd[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_npd[i]++;myvecTrkRio.push_back(p);}
268 for(
int i=0;i<
m_nbsl;i++) {
269 if (sl[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_nsl[i]++;myvecTrkRio.push_back(p);}
271 for(
int i=0;i<
m_nbsd;i++) {
272 if (sd[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {
m_nsd[i]++;myvecTrkRio.push_back(p);}
290 if (mlog.level() <= MSG::DEBUG) assoc->
dump();
299 return StatusCode::SUCCESS;
303 return StatusCode::SUCCESS;
Scalar deltaR(const MatrixBase< Derived > &vec) const
#define ATH_MSG_VERBOSE(x)
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
std::vector< pairTrkRio > vecpairTrkRio
std::pair< const xAOD::TrackParticle *, const Trk::RIO_OnTrack * > pairTrkRio
Assoc::const_iterator AssocIter
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
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.
bool m_qualOrder
pairs of tracks with dR>dRCut not considered
const PixelID * m_pixelId
if true use shared info from track summary instead of recomputing them
std::string m_inputTrackCollection
virtual StatusCode execute()
int numberSharedPix() const
int numberSharedSct() const
virtual StatusCode initialize()
bool m_useTrackSummaryShared
std::string m_sharedHitMapLocation
location of inputTracks in StoreGate
double m_deltaRCut
location of sharedHitMap in StoreGate
virtual ~SharedHitMapper()
SharedHitMapper(const std::string &name, ISvcLocator *pSvcLocator)
int numberSharedBLayer() const
virtual StatusCode finalize()
int numberSharedSct(const xAOD::TrackParticle *const trk) const
int numberSharedBLayer(const xAOD::TrackParticle *const trk) const
void add(const xAOD::TrackParticle *const trk, int shPattern)
int numberSharedPix(const xAOD::TrackParticle *const trk) const
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
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.
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].