32 std::string trackQualityType = config.
getParameter<std::string>(
"trackQuality");
68 std::map<TrackingVertexRef,std::pair<double, std::size_t> > matches;
70 std::cout <<
"reco::VertexCollection size = " << recoVertexes->size();
71 std::cout <<
" ; TrackingVertexCollection size = " << trackingVertexes->size() << std::endl << std::endl;
74 for (std::size_t recoIndex = 0; recoIndex < recoVertexes->size(); ++recoIndex)
80 double recoDaughterWeight = 0.;
95 std::vector<std::pair<TrackingParticleRef,double> > associations = associator[*recoDaughter];
99 std::vector<std::pair<TrackingParticleRef,double> >::const_iterator association = associations.begin();
100 association != associations.end();
107 matches[trackingVertex].first += recoVertex->
trackWeight(*recoDaughter);
108 matches[trackingVertex].second++;
112 recoDaughterWeight += recoVertex->
trackWeight(*recoDaughter);
115 std::size_t assoIndex = 0;
120 match != matches.end();
126 double matchedDaughterWeight =
match->second.first;
127 std::size_t matchedDaughterCounter =
match->second.second;
130 std::size_t simDaughterCounter = 0;
134 simDaughter != trackingVertex->daughterTracks_end();
137 if (
selector_(**simDaughter) ) simDaughterCounter++;
140 if ( simDaughterCounter < matchedDaughterCounter )
141 simDaughterCounter = matchedDaughterCounter;
146 double quality = (double)matchedDaughterWeight/recoDaughterWeight;
151 outputCollection.
insert(recoVertex, std::make_pair(trackingVertex, quality));
154 std::cout <<
" ; SimDaughterCounter = " << simDaughterCounter;
155 std::cout <<
" ; RecoDaughterWeight = " << recoDaughterWeight;
156 std::cout <<
" ; MatchedDaughterCounter = " << matchedDaughterCounter;
157 std::cout <<
" ; MatchedDaughterWeight = " << matchedDaughterWeight;
158 std::cout <<
" ; quality = " << quality << std::endl;
165 std::cout <<
"RecoToSim OUTPUT COLLECTION: outputCollection.size() = " << outputCollection.
size() << std::endl << std::endl;
167 return outputCollection;
182 std::map<std::size_t,std::pair<double, std::size_t> > matches;
185 for (std::size_t simIndex = 0; simIndex < trackingVertexes->size(); ++simIndex)
191 std::size_t simDaughterCounter = 0;
196 simDaughter != trackingVertex->daughterTracks_end();
201 if ( !
selector_(**simDaughter) )
continue;
206 std::vector<std::pair<reco::TrackBaseRef, double> > associations = associator[*simDaughter];
210 std::vector<std::pair<reco::TrackBaseRef,double> >::const_iterator association = associations.begin();
211 association != associations.end();
217 for (std::size_t recoIndex = 0; recoIndex < recoVertexes->size(); ++recoIndex)
229 recoDaughter->id() == recoTrack.
id() &&
230 recoDaughter->key() == recoTrack.
key()
233 matches[recoIndex].first += recoVertex->
trackWeight(*recoDaughter);
234 matches[recoIndex].second++;
241 simDaughterCounter++;
244 std::size_t assoIndex = 0;
248 std::map<std::size_t,std::pair<double,std::size_t> >::const_iterator
match = matches.begin();
249 match != matches.end();
255 double matchedDaughterWeight =
match->second.first;
256 std::size_t matchedDaughterCounter =
match->second.second;
258 double recoDaughterWeight = 0.;
267 recoDaughterWeight += recoVertex->
trackWeight(*recoDaughter);
270 if ( recoDaughterWeight < matchedDaughterWeight )
271 recoDaughterWeight = matchedDaughterWeight;
276 double quality = (double)matchedDaughterCounter/simDaughterCounter;
281 outputCollection.
insert(trackingVertex, std::make_pair(recoVertex, quality));
284 std::cout <<
" ; SimDaughterCounter = " << simDaughterCounter;
285 std::cout <<
" ; RecoDaughterWeight = " << recoDaughterWeight;
286 std::cout <<
" ; MatchedDaughterCounter = " << matchedDaughterCounter;
287 std::cout <<
" ; MatchedDaughterWeight = " << matchedDaughterWeight;
288 std::cout <<
" ; quality = " << quality << std::endl;
294 std::cout <<
"SimToReco OUTPUT COLLECTION: outputCollection.size() = " << outputCollection.
size() << std::endl << std::endl;
296 return outputCollection;
T getParameter(std::string const &) const
trackRef_iterator tracks_end() const
last iterator over tracks
double S2RMatchedRecoRatio_
reco::TrackBase::TrackQuality trackQuality_
double R2SMatchedRecoRatio_
double S2RMatchedSimRatio_
TrackingParticleSelector selector_
reco::VertexSimToRecoCollection associateSimToReco(edm::Handle< edm::View< reco::Vertex > > &, edm::Handle< TrackingVertexCollection > &, const edm::Event &, reco::SimToRecoCollection &) const
double R2SMatchedSimRatio_
size_type numberOfAssociations(const key_type &k) const
number of associations to a key
reco::VertexRecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Vertex > > &, edm::Handle< TrackingVertexCollection > &, const edm::Event &, reco::RecoToSimCollection &) const
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
static TrackQuality qualityByName(const std::string &name)
size_type size() const
map size
void insert(const key_type &k, const data_type &v)
insert an association
VertexAssociatorByTracks(const edm::ParameterSet &)
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
~VertexAssociatorByTracks()
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
trackRef_iterator tracks_begin() const
first iterator over tracks