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";
195 momentumTP =
tp->momentum();
196 vertexTP =
tp->vertex();
202 momentum.z() /
sqrt(momentum.perp2());
209 dxyGen = (-vertexTP.x() *
sin(momentumTP.phi()) + vertexTP.y() *
cos(momentumTP.phi()));
210 dzGen = vertexTP.z() - (vertexTP.x() * momentumTP.x() + vertexTP.y() * momentumTP.y()) /
211 sqrt(momentumTP.perp2()) * momentumTP.z() /
sqrt(momentumTP.perp2());
237 std::vector<std::pair<RefToBase<Track>,
double> >
rt;
238 if (genRecColl.
find(tpr) != genRecColl.
end()) {
239 rt = (std::vector<std::pair<RefToBase<Track>,
double> >)genRecColl[tpr];
243 matchedTrackPointer =
rt.begin()->first.get();
244 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt=" <<
sqrt(momentumTP.perp2())
245 <<
" associated with quality:" <<
rt.begin()->second <<
"\n";
248 edm::LogVerbatim(
"TrackValidator") <<
"GenParticle #" << st <<
" with pt,eta,phi: " <<
sqrt(momentumTP.perp2())
249 <<
" , " << momentumTP.eta() <<
" , " << momentumTP.phi() <<
" , " 250 <<
" NOT associated to any reco::Track" 278 <<
label[www].label() <<
":" <<
label[www].instance() <<
": " 289 bool isSigGenMatched(
false);
290 bool isGenMatched(
false);
291 bool isChargeMatched(
true);
292 int numAssocRecoTracks = 0;
294 double sharedFraction = 0.;
295 std::vector<std::pair<GenParticleRef, double> >
tp;
303 sharedFraction =
tp[0].second;
306 isChargeMatched =
false;
307 if (genRecColl.
find(
tp[0].first) != genRecColl.
end())
308 numAssocRecoTracks = genRecColl[
tp[0].
first].
size();
311 for (
unsigned int tp_ite = 0; tp_ite <
tp.size(); ++tp_ite) {
322 <<
" associated with quality:" <<
tp.begin()->second <<
"\n";
326 <<
"reco::Track #" << rT <<
" with pt=" <<
track->pt() <<
" NOT associated to any GenParticle" 382 int chargeTP = tpr->charge();
385 histograms.histoProducerAlgo,
w, momentumTP, vertexTP, chargeTP, *
track,
bs.position());
403 <<
"Total Associated (genToReco): " << ats <<
"\n" 404 <<
"Total Reconstructed: " << rT <<
"\n" 405 <<
"Total Associated (recoToGen): " << at <<
"\n" 406 <<
"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_