40 const uint32_t NonMatchedTrackId = (uint32_t)-1;
52 if (detId < other.detId)
54 else if (detId > other.detId)
56 else if (collision < other.collision)
58 else if (other.collision < collision)
61 return simTrackId < other.simTrackId;
66 return detId == other.detId &&
67 collision == other.collision &&
68 simTrackId == other.simTrackId;
83 typedef std::pair<TrackQuality::Layer::SubDet, short int>
DetLayer;
106 layer=tTopo->
layer(detId);
158 std::vector<MatchedHit> matchedHits;
165 DetId detId = (*hit)->geographicalId();
170 if (!(*hit)->isValid())
172 MatchedHit matchedHit;
173 matchedHit.detId = detId;
174 matchedHit.simTrackId = NonMatchedTrackId;
176 switch ((*hit)->getType())
190 matchedHits.push_back(matchedHit);
195 std::vector<SimHitIdpr> simIds =
associator_->associateHitId(**
hit);
200 MatchedHit matchedHit;
201 matchedHit.detId = detId;
202 matchedHit.simTrackId = NonMatchedTrackId;
205 matchedHits.push_back(matchedHit);
210 for (std::vector<SimHitIdpr>::const_iterator
i = simIds.begin();
211 i != simIds.end(); ++
i)
213 MatchedHit matchedHit;
214 matchedHit.detId = detId;
215 matchedHit.simTrackId =
i->first;
216 matchedHit.collision =
i->second;
224 matchedHits.push_back(matchedHit);
229 std::stable_sort(matchedHits.begin(), matchedHits.end());
232 std::stable_sort(matchedHits.begin(), matchedHits.end());
235 typedef std::multimap<DetLayer, const MatchedHit*> LayerHitMap;
236 LayerHitMap layerHitMap;
239 for (std::vector<MatchedHit>::const_iterator
hit = matchedHits.begin();
240 hit != matchedHits.end();)
243 const MatchedHit *best =
nullptr;
250 statePriorities[
hit->state] > statePriorities[best->state] ||
251 best->simTrackId == NonMatchedTrackId)
257 while (
hit != matchedHits.end() &&
258 hit->detId == best->detId);
261 if (best->simTrackId != NonMatchedTrackId ||
264 layerHitMap.insert(std::make_pair(
271 #ifdef DEBUG_TRACK_QUALITY 272 std::cout <<
"---------------------" << std::endl;
275 for (LayerHitMap::const_iterator
hit = layerHitMap.begin();
276 hit != layerHitMap.end(); ++
hit)
278 #ifdef DEBUG_TRACK_QUALITY 280 <<
"detLayer (" <<
hit->first.first <<
", " <<
hit->first.second <<
")" 281 <<
" [" << (uint32_t)
hit->second->detId <<
"] sim(" << (
int)
hit->second->simTrackId <<
")" 282 <<
" hit(" <<
hit->second->recHitId <<
") -> " <<
hit->second->state << std::endl;
303 layer->
hits.push_back(newHit);
std::vector< TrackingParticleRef > SimParticleTrail
std::unique_ptr< TrackerHitAssociator > associator_
std::pair< TrackQuality::Layer::SubDet, short int > DetLayer
TrackerHitAssociator::Config trackerHitAssociatorConfig_
int layer() const
Return the layer number.
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
void evaluate(SimParticleTrail const &, reco::TrackBaseRef const &, const TrackerTopology *tTopo)
Compute information about the track reconstruction quality.
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
DetLayer getDetLayer(DetId detId, const TrackerTopology *tTopo)
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const Layer & layer(unsigned int index) const
Return information about the given layer by index.
std::vector< Layer > layers_
unsigned int layer(const DetId &id) const
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
Detector det() const
get the detector field from this detid
TrackQuality(const edm::ParameterSet &, edm::ConsumesCollector &iC)
Constructor by pset.
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
static const int statePriorities[]
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.