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"
98 event.getByToken(
bsSrc, recoBeamSpotHandle);
105 for (
unsigned int puinfo_ite = 0; puinfo_ite < (*puinfoH).size(); ++puinfo_ite) {
106 if ((*puinfoH)[puinfo_ite].getBunchCrossing() == 0) {
107 puinfo = (*puinfoH)[puinfo_ite];
119 trackGenAssociator = trackGenAssociatorH.
product();
128 std::vector<const edm::ValueMap<reco::DeDxData>*> v_dEdx;
134 v_dEdx.push_back(dEdx1Handle.
product());
135 v_dEdx.push_back(dEdx2Handle.
product());
138 std::vector<float> mvaDummy;
141 for (
unsigned int www = 0; www <
label.size(); www++) {
159 LogTrace(
"TrackValidator") <<
"Calling associateRecoToGen method"
162 LogTrace(
"TrackValidator") <<
"Calling associateGenToReco method"
171 genRecColl = *(gentorecoCollectionH.
product());
175 recGenColl = *(recotogenCollectionH.
product());
184 edm::LogVerbatim(
"TrackValidator") <<
"\n# of GenParticles: " << tPCeff.size() <<
"\n";
205 momentumTP =
tp->momentum();
206 vertexTP =
tp->vertex();
212 momentum.z() /
sqrt(momentum.perp2());
219 dxyGen = (-vertexTP.x() *
sin(momentumTP.phi()) + vertexTP.y() *
cos(momentumTP.phi()));
220 dzGen = vertexTP.z() - (vertexTP.x() * momentumTP.x() + vertexTP.y() * momentumTP.y()) /
221 sqrt(momentumTP.perp2()) * momentumTP.z() /
sqrt(momentumTP.perp2());
247 std::vector<std::pair<RefToBase<Track>,
double> >
rt;
248 if (genRecColl.
find(tpr) != genRecColl.
end()) {
249 rt = (std::vector<std::pair<RefToBase<Track>,
double> >)genRecColl[tpr];
253 matchedTrackPointer =
rt.begin()->first.get();
254 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt=" <<
sqrt(momentumTP.perp2())
255 <<
" associated with quality:" <<
rt.begin()->second <<
"\n";
258 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt,eta,phi: " <<
sqrt(momentumTP.perp2())
259 <<
" , " << momentumTP.eta() <<
" , " << momentumTP.phi() <<
" , "
260 <<
" NOT associated to any reco::Track"
277 if (matchedTrackPointer)
292 <<
label[www].label() <<
":" <<
label[www].instance() <<
": "
303 bool isSigGenMatched(
false);
304 bool isGenMatched(
false);
305 bool isChargeMatched(
true);
306 int numAssocRecoTracks = 0;
308 double sharedFraction = 0.;
309 std::vector<std::pair<GenParticleRef, double> >
tp;
317 sharedFraction =
tp[0].second;
320 isChargeMatched =
false;
321 if (genRecColl.
find(
tp[0].first) != genRecColl.
end())
322 numAssocRecoTracks = genRecColl[
tp[0].
first].
size();
325 for (
unsigned int tp_ite = 0; tp_ite <
tp.size(); ++tp_ite) {
336 <<
" associated with quality:" <<
tp.begin()->second <<
"\n";
340 <<
"reco::Track #" << rT <<
" with pt=" <<
track->pt() <<
" NOT associated to any GenParticle"
396 int chargeTP = tpr->charge();
399 histograms.histoProducerAlgo,
w, momentumTP, vertexTP, chargeTP, *
track,
bs.position());
417 <<
"Total Associated (genToReco): " << ats <<
"\n"
418 <<
"Total Reconstructed: " << rT <<
"\n"
419 <<
"Total Associated (recoToGen): " << at <<
"\n"
420 <<
"Total Fakes: " << rT - at <<
"\n";