39 pset.getParameter<
double>(
"minRapidityGP"),
40 pset.getParameter<
double>(
"maxRapidityGP"),
41 pset.getParameter<
double>(
"tipGP"),
42 pset.getParameter<
double>(
"lipGP"),
43 pset.getParameter<
bool>(
"chargedOnlyGP"),
44 pset.getParameter<
int>(
"statusGP"),
45 pset.getParameter<std::vector<int> >(
"pdgIdGP"));
70 edm::LogInfo(
"TrackValidator") <<
"\n===================================================="
72 <<
"Analyzing new event"
74 <<
"====================================================\n"
94 event.getByToken(
bsSrc, recoBeamSpotHandle);
101 for (
unsigned int puinfo_ite = 0; puinfo_ite < (*puinfoH).size(); ++puinfo_ite) {
102 if ((*puinfoH)[puinfo_ite].getBunchCrossing() == 0) {
103 puinfo = (*puinfoH)[puinfo_ite];
115 trackGenAssociator = trackGenAssociatorH.
product();
124 std::vector<const edm::ValueMap<reco::DeDxData>*> v_dEdx;
130 v_dEdx.push_back(dEdx1Handle.
product());
131 v_dEdx.push_back(dEdx2Handle.
product());
134 std::vector<float> mvaDummy;
137 for (
unsigned int www = 0; www <
label.size(); www++) {
155 LogTrace(
"TrackValidator") <<
"Calling associateRecoToGen method"
158 LogTrace(
"TrackValidator") <<
"Calling associateGenToReco method"
167 genRecColl = *(gentorecoCollectionH.
product());
171 recGenColl = *(recotogenCollectionH.
product());
180 edm::LogVerbatim(
"TrackValidator") <<
"\n# of GenParticles: " << tPCeff.size() <<
"\n";
201 momentumTP =
tp->momentum();
202 vertexTP =
tp->vertex();
208 momentum.z() /
sqrt(momentum.perp2());
213 momentumTP = parametersDefinerTP->momentum(
event,
setup, *
tp);
214 vertexTP = parametersDefinerTP->vertex(
event,
setup, *
tp);
215 dxyGen = (-vertexTP.x() *
sin(momentumTP.phi()) + vertexTP.y() *
cos(momentumTP.phi()));
216 dzGen = vertexTP.z() - (vertexTP.x() * momentumTP.x() + vertexTP.y() * momentumTP.y()) /
217 sqrt(momentumTP.perp2()) * momentumTP.z() /
sqrt(momentumTP.perp2());
243 std::vector<std::pair<RefToBase<Track>,
double> >
rt;
244 if (genRecColl.
find(tpr) != genRecColl.
end()) {
245 rt = (std::vector<std::pair<RefToBase<Track>,
double> >)genRecColl[tpr];
249 matchedTrackPointer =
rt.begin()->first.get();
250 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt=" <<
sqrt(momentumTP.perp2())
251 <<
" associated with quality:" <<
rt.begin()->second <<
"\n";
254 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt,eta,phi: " <<
sqrt(momentumTP.perp2())
255 <<
" , " << momentumTP.eta() <<
" , " << momentumTP.phi() <<
" , "
256 <<
" NOT associated to any reco::Track"
273 if (matchedTrackPointer)
288 <<
label[www].label() <<
":" <<
label[www].instance() <<
": "
299 bool isSigGenMatched(
false);
300 bool isGenMatched(
false);
301 bool isChargeMatched(
true);
302 int numAssocRecoTracks = 0;
304 double sharedFraction = 0.;
305 std::vector<std::pair<GenParticleRef, double> >
tp;
313 sharedFraction =
tp[0].second;
316 isChargeMatched =
false;
317 if (genRecColl.
find(
tp[0].first) != genRecColl.
end())
318 numAssocRecoTracks = genRecColl[
tp[0].
first].
size();
321 for (
unsigned int tp_ite = 0; tp_ite <
tp.size(); ++tp_ite) {
332 <<
" associated with quality:" <<
tp.begin()->second <<
"\n";
336 <<
"reco::Track #" << rT <<
" with pt=" <<
track->pt() <<
" NOT associated to any GenParticle"
392 int chargeTP = tpr->charge();
395 histograms.histoProducerAlgo,
w, momentumTP, vertexTP, chargeTP, *
track,
bs.position());
413 <<
"Total Associated (genToReco): " << ats <<
"\n"
414 <<
"Total Reconstructed: " << rT <<
"\n"
415 <<
"Total Associated (recoToGen): " << at <<
"\n"
416 <<
"Total Fakes: " << rT - at <<
"\n";