37 pset.getParameter<
double>(
"minRapidityGP"),
38 pset.getParameter<
double>(
"maxRapidityGP"),
39 pset.getParameter<
double>(
"tipGP"),
40 pset.getParameter<
double>(
"lipGP"),
41 pset.getParameter<
bool>(
"chargedOnlyGP"),
42 pset.getParameter<
int>(
"statusGP"),
43 pset.getParameter<std::vector<int> >(
"pdgIdGP"));
68 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" 70 <<
"Analyzing new event" 72 <<
"====================================================\n" 91 event.getByToken(
bsSrc, recoBeamSpotHandle);
98 for (
unsigned int puinfo_ite = 0; puinfo_ite < (*puinfoH).size(); ++puinfo_ite) {
99 if ((*puinfoH)[puinfo_ite].getBunchCrossing() == 0) {
100 puinfo = (*puinfoH)[puinfo_ite];
112 trackGenAssociator = trackGenAssociatorH.
product();
121 std::vector<const edm::ValueMap<reco::DeDxData>*> v_dEdx;
127 v_dEdx.push_back(dEdx1Handle.
product());
128 v_dEdx.push_back(dEdx2Handle.
product());
131 std::vector<float> mvaDummy;
134 for (
unsigned int www = 0; www <
label.size(); www++) {
152 LogTrace(
"TrackValidator") <<
"Calling associateRecoToGen method" 155 LogTrace(
"TrackValidator") <<
"Calling associateGenToReco method" 164 genRecColl = *(gentorecoCollectionH.
product());
168 recGenColl = *(recotogenCollectionH.
product());
177 edm::LogVerbatim(
"TrackValidator") <<
"\n# of GenParticles: " << tPCeff.size() <<
"\n";
198 momentumTP =
tp->momentum();
199 vertexTP =
tp->vertex();
205 momentum.z() /
sqrt(momentum.perp2());
212 dxyGen = (-vertexTP.x() *
sin(momentumTP.phi()) + vertexTP.y() *
cos(momentumTP.phi()));
213 dzGen = vertexTP.z() - (vertexTP.x() * momentumTP.x() + vertexTP.y() * momentumTP.y()) /
214 sqrt(momentumTP.perp2()) * momentumTP.z() /
sqrt(momentumTP.perp2());
240 std::vector<std::pair<RefToBase<Track>,
double> >
rt;
241 if (genRecColl.
find(tpr) != genRecColl.
end()) {
242 rt = (std::vector<std::pair<RefToBase<Track>,
double> >)genRecColl[tpr];
246 matchedTrackPointer =
rt.begin()->first.get();
247 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt=" <<
sqrt(momentumTP.perp2())
248 <<
" associated with quality:" <<
rt.begin()->second <<
"\n";
251 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt,eta,phi: " <<
sqrt(momentumTP.perp2())
252 <<
" , " << momentumTP.eta() <<
" , " << momentumTP.phi() <<
" , " 253 <<
" NOT associated to any reco::Track" 270 if (matchedTrackPointer)
285 <<
label[www].label() <<
":" <<
label[www].instance() <<
": " 296 bool isSigGenMatched(
false);
297 bool isGenMatched(
false);
298 bool isChargeMatched(
true);
299 int numAssocRecoTracks = 0;
301 double sharedFraction = 0.;
302 std::vector<std::pair<GenParticleRef, double> >
tp;
310 sharedFraction =
tp[0].second;
313 isChargeMatched =
false;
314 if (genRecColl.
find(
tp[0].first) != genRecColl.
end())
315 numAssocRecoTracks = genRecColl[
tp[0].
first].
size();
318 for (
unsigned int tp_ite = 0; tp_ite <
tp.size(); ++tp_ite) {
329 <<
" associated with quality:" <<
tp.begin()->second <<
"\n";
333 <<
"reco::Track #" << rT <<
" with pt=" <<
track->pt() <<
" NOT associated to any GenParticle" 389 int chargeTP = tpr->charge();
392 histograms.histoProducerAlgo,
w, momentumTP, vertexTP, chargeTP, *
track,
bs.position());
410 <<
"Total Associated (genToReco): " << ats <<
"\n" 411 <<
"Total Reconstructed: " << rT <<
"\n" 412 <<
"Total Associated (recoToGen): " << at <<
"\n" 413 <<
"Total Fakes: " << rT - at <<
"\n";
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoEsToken
Log< level::Info, true > LogVerbatim
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
edm::EDGetTokenT< reco::GenToRecoCollection > associatormapGtR
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > m_dEdx2Tag
static const std::string kTrackAssociatorByChi2("trackAssociatorByChi2")
reco::RecoToGenCollection associateRecoToGen(const edm::RefToBaseVector< reco::Track > &tracks, const edm::RefVector< reco::GenParticleCollection > &gens) const
Association Sim To Reco with Collections (Gen Particle version)
Sin< T >::type sin(const T &t)
T const * product() const
constexpr bool isUninitialized() const noexcept
void dqmAnalyze(const edm::Event &, const edm::EventSetup &, const Histograms &) const override
Method called once per event.
edm::EDGetTokenT< reco::BeamSpot > bsSrc
const_iterator find(const key_type &k) const
find element with specified reference key
MultiTrackValidatorGenPs(const edm::ParameterSet &pset)
Constructor.
const_iterator end() const
last iterator over the map (read only)
math::XYZPointD Point
point in the space
const bool useAssociators_
std::vector< edm::InputTag > associators
edm::EDGetTokenT< reco::TrackToGenParticleAssociator > label_gen_associator
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > labelToken
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > m_dEdx1Tag
GenParticleCustomSelector gpSelector
Cos< T >::type cos(const T &t)
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > label_pileupinfo
std::vector< edm::InputTag > label
SingleObjectSelector< GenParticleCollection, ::GenParticleCustomSelector > GenParticleCustomSelector
std::unique_ptr< ParametersDefinerForTP > parametersDefinerTP_
std::unique_ptr< MTVHistoProducerAlgoForTracker > histoProducerAlgo_
Log< level::Info, false > LogInfo
~MultiTrackValidatorGenPs() override
Destructor.
const bool ignoremissingtkcollection_
T const * get() const
Returns C++ pointer to the item.
edm::EDGetTokenT< TrackingParticleCollection > label_tp_fake
math::XYZVectorD Vector
point in the space
edm::EDGetTokenT< reco::RecoToGenCollection > associatormapRtG
edm::EDGetTokenT< TrackingParticleCollection > label_tp_effic
const int getPU_NumInteractions() const
const bool doRecoTrackPlots_
reco::GenToRecoCollection associateGenToReco(const edm::RefToBaseVector< reco::Track > &tracks, const edm::RefVector< reco::GenParticleCollection > &gens) const
Association Sim To Reco with Collections (Gen Particle version)
const bool parametersDefinerIsCosmic_
const bool doSimTrackPlots_