41 const uint32_t NonMatchedTrackId = (uint32_t)-1;
51 if (detId <
other.detId)
53 else if (detId >
other.detId)
55 else if (collision <
other.collision)
57 else if (
other.collision < collision)
60 return simTrackId <
other.simTrackId;
64 return detId ==
other.detId && collision ==
other.collision && simTrackId ==
other.simTrackId;
79 typedef std::pair<TrackQuality::Layer::SubDet, short int>
DetLayer;
96 switch (detId.
det()) {
143 std::vector<MatchedHit> matchedHits;
148 DetId detId = (*hit)->geographicalId();
153 if (!(*hit)->isValid()) {
154 MatchedHit matchedHit;
155 matchedHit.detId = detId;
156 matchedHit.simTrackId = NonMatchedTrackId;
158 switch ((*hit)->getType()) {
171 matchedHits.push_back(matchedHit);
176 std::vector<SimHitIdpr> simIds =
associator_->associateHitId(**
hit);
179 if (simIds.empty()) {
180 MatchedHit matchedHit;
181 matchedHit.detId = detId;
182 matchedHit.simTrackId = NonMatchedTrackId;
185 matchedHits.push_back(matchedHit);
190 for (std::vector<SimHitIdpr>::const_iterator
i = simIds.begin();
i != simIds.end(); ++
i) {
191 MatchedHit matchedHit;
192 matchedHit.detId = detId;
193 matchedHit.simTrackId =
i->first;
194 matchedHit.collision =
i->second;
202 matchedHits.push_back(matchedHit);
207 std::stable_sort(matchedHits.begin(), matchedHits.end());
210 std::stable_sort(matchedHits.begin(), matchedHits.end());
213 typedef std::multimap<DetLayer, const MatchedHit *> LayerHitMap;
214 LayerHitMap layerHitMap;
217 for (std::vector<MatchedHit>::const_iterator
hit = matchedHits.begin();
hit != matchedHits.end();) {
219 const MatchedHit *best =
nullptr;
225 best->simTrackId == NonMatchedTrackId) {
229 }
while (
hit != matchedHits.end() &&
hit->detId == best->detId);
232 if (best->simTrackId != NonMatchedTrackId || best->state !=
Layer::Missed) {
233 layerHitMap.insert(std::make_pair(
getDetLayer(best->detId, tTopo), best));
239 #ifdef DEBUG_TRACK_QUALITY 240 std::cout <<
"---------------------" << std::endl;
243 for (LayerHitMap::const_iterator
hit = layerHitMap.begin();
hit != layerHitMap.end(); ++
hit) {
244 #ifdef DEBUG_TRACK_QUALITY 245 std::cout <<
"detLayer (" <<
hit->first.first <<
", " <<
hit->first.second <<
")" 246 <<
" [" << (uint32_t)
hit->second->detId <<
"] sim(" << (
int)
hit->second->simTrackId <<
")" 247 <<
" hit(" <<
hit->second->recHitId <<
") -> " <<
hit->second->state << std::endl;
std::vector< TrackingParticleRef > SimParticleTrail
std::unique_ptr< TrackerHitAssociator > associator_
std::pair< TrackQuality::Layer::SubDet, short int > DetLayer
TrackerHitAssociator::Config trackerHitAssociatorConfig_
constexpr Detector det() const
get the detector field from this detid
unsigned int layer(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
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.
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
DetLayer getDetLayer(DetId detId, const TrackerTopology *tTopo)
std::vector< Layer > layers_
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
const Layer & layer(unsigned int index) const
Return information about the given layer by index.
int layer() const
Return the layer number.
bool operator<(DTCELinkId const &lhs, DTCELinkId const &rhs)
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
TrackQuality(const edm::ParameterSet &, edm::ConsumesCollector &iC)
Constructor by pset.
static const int statePriorities[]