CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonTrackValidator Class Reference

#include <MuonTrackValidator.h>

Inheritance diagram for MuonTrackValidator:
DQMEDAnalyzer MuonTrackValidatorBase edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMEDAnalyzer::DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 MuonTrackValidator (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~MuonTrackValidator () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList_simHitTpMapTag
 
edm::InputTag associatormap
 
bool BiDirectional_RecoToSim_association
 
std::unique_ptr< CosmicParametersDefinerForTPcosmicParametersDefinerTP_
 
CosmicTrackingParticleSelector cosmictpSelector
 
std::string dirName_
 
std::unique_ptr< ParametersDefinerForTPlhcParametersDefinerTP_
 
bool MABH
 
edm::EDGetTokenT< reco::RecoToSimCollectionrecoToSimCollection_Token
 
edm::EDGetTokenT< reco::SimToRecoCollectionsimToRecoCollection_Token
 
TrackingParticleSelector tpSelector
 
bool UseAssociators
 
bool useGEMs_
 
bool useME0_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Member Functions inherited from MuonTrackValidatorBase
void BinLogX (TH1 *h)
 
void doProfileX (TH2 *th2, MonitorElement *me)
 
void doProfileX (MonitorElement *th2m, MonitorElement *me)
 
template<typename T >
void fillPlotNoFlow (MonitorElement *h, T val)
 
double getEta (double eta)
 
double getPt (double pt)
 
 MuonTrackValidatorBase (const edm::ParameterSet &pset, edm::ConsumesCollector iC)
 Constructor. More...
 
 MuonTrackValidatorBase (const edm::ParameterSet &pset)
 
virtual ~MuonTrackValidatorBase () noexcept(false)
 Destructor. More...
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 
- Protected Attributes inherited from MuonTrackValidatorBase
std::vector< std::string > associators
 
edm::InputTag bsSrc
 
edm::EDGetTokenT< reco::BeamSpotbsSrc_Token
 
std::vector< MonitorElement * > chi2_vs_eta
 
std::vector< MonitorElement * > chi2_vs_nhits
 
std::vector< MonitorElement * > chi2_vs_phi
 
int cotThetaRes_nbin
 
double cotThetaRes_rangeMax
 
double cotThetaRes_rangeMin
 
bool do_MUOhitsPlots
 
bool do_TRKhitsPlots
 
std::vector< MonitorElement * > dxypull_vs_eta
 
int dxyRes_nbin
 
double dxyRes_rangeMax
 
double dxyRes_rangeMin
 
std::vector< MonitorElement * > dxyres_vs_eta
 
std::vector< MonitorElement * > dxyres_vs_pt
 
std::vector< MonitorElement * > dzpull_vs_eta
 
int dzRes_nbin
 
double dzRes_rangeMax
 
double dzRes_rangeMin
 
std::vector< MonitorElement * > dzres_vs_eta
 
std::vector< MonitorElement * > dzres_vs_pt
 
int etaRes_nbin
 
double etaRes_rangeMax
 
double etaRes_rangeMin
 
std::vector< MonitorElement * > etares_vs_eta
 
std::vector< MonitorElement * > h_assoc2dxy
 
std::vector< MonitorElement * > h_assoc2dz
 
std::vector< MonitorElement * > h_assoc2eta
 
std::vector< MonitorElement * > h_assoc2hit
 
std::vector< MonitorElement * > h_assoc2phi
 
std::vector< MonitorElement * > h_assoc2pT
 
std::vector< MonitorElement * > h_assoc2pu
 
std::vector< MonitorElement * > h_assocdxy
 
std::vector< MonitorElement * > h_assocdz
 
std::vector< MonitorElement * > h_assoceta
 
std::vector< MonitorElement * > h_assocFraction
 
std::vector< MonitorElement * > h_assochi2
 
std::vector< MonitorElement * > h_assochi2_prob
 
std::vector< MonitorElement * > h_assochit
 
std::vector< MonitorElement * > h_assocphi
 
std::vector< MonitorElement * > h_assocpT
 
std::vector< MonitorElement * > h_assocpu
 
std::vector< MonitorElement * > h_assocRpos
 
std::vector< MonitorElement * > h_assocSharedHit
 
std::vector< MonitorElement * > h_assocZpos
 
std::vector< MonitorElement * > h_charge
 
std::vector< MonitorElement * > h_dxypull
 
std::vector< MonitorElement * > h_dxypulleta
 
std::vector< MonitorElement * > h_dzpull
 
std::vector< MonitorElement * > h_dzpulleta
 
std::vector< MonitorElement * > h_etaRes
 
std::vector< MonitorElement * > h_fakes
 
std::vector< MonitorElement * > h_losthits
 
std::vector< MonitorElement * > h_misiddxy
 
std::vector< MonitorElement * > h_misiddz
 
std::vector< MonitorElement * > h_misideta
 
std::vector< MonitorElement * > h_misidhit
 
std::vector< MonitorElement * > h_misidphi
 
std::vector< MonitorElement * > h_misidpT
 
std::vector< MonitorElement * > h_misidpu
 
std::vector< MonitorElement * > h_nchi2
 
std::vector< MonitorElement * > h_nchi2_prob
 
std::vector< MonitorElement * > h_nhits
 
std::vector< MonitorElement * > h_nlosthits
 
std::vector< MonitorElement * > h_nmisslayers_inner
 
std::vector< MonitorElement * > h_nmisslayers_outer
 
std::vector< MonitorElement * > h_phipull
 
std::vector< MonitorElement * > h_phipulleta
 
std::vector< MonitorElement * > h_phipullphi
 
std::vector< MonitorElement * > h_ptpull
 
std::vector< MonitorElement * > h_ptpulleta
 
std::vector< MonitorElement * > h_ptpullphi
 
std::vector< MonitorElement * > h_PurityVsQuality
 
std::vector< MonitorElement * > h_qoverppull
 
std::vector< MonitorElement * > h_recodxy
 
std::vector< MonitorElement * > h_recodz
 
std::vector< MonitorElement * > h_recoeta
 
std::vector< MonitorElement * > h_recohit
 
std::vector< MonitorElement * > h_recophi
 
std::vector< MonitorElement * > h_recopT
 
std::vector< MonitorElement * > h_recopu
 
std::vector< MonitorElement * > h_simuldxy
 
std::vector< MonitorElement * > h_simuldz
 
std::vector< MonitorElement * > h_simuleta
 
std::vector< MonitorElement * > h_simulhit
 
std::vector< MonitorElement * > h_simulphi
 
std::vector< MonitorElement * > h_simulpT
 
std::vector< MonitorElement * > h_simulpu
 
std::vector< MonitorElement * > h_simulRpos
 
std::vector< MonitorElement * > h_simulZpos
 
std::vector< MonitorElement * > h_thetapull
 
std::vector< MonitorElement * > h_thetapulleta
 
std::vector< MonitorElement * > h_thetapullphi
 
std::vector< MonitorElement * > h_tracks
 
bool ignoremissingtkcollection_
 
std::vector< edm::InputTaglabel
 
edm::InputTag label_pileupinfo
 
edm::InputTag label_tp
 
bool label_tp_refvector
 
double maxCSCHit
 
double maxDTHit
 
double maxDxy
 
double maxDz
 
double maxEta
 
int maxFTracks
 
double maxLayers
 
double maxNHit
 
int maxNTracks
 
double maxPhi
 
double maxPixels
 
double maxPt
 
double maxPU
 
double maxRPCHit
 
double maxRpos
 
double maxZpos
 
double minCSCHit
 
double minDTHit
 
double minDxy
 
double minDz
 
double minEta
 
int minFTracks
 
double minLayers
 
double minNHit
 
int minNTracks
 
double minPhi
 
double minPixels
 
double minPt
 
double minPU
 
double minRPCHit
 
double minRpos
 
double minZpos
 
edm::ParameterSet muonHistoParameters
 
std::vector< MonitorElement * > nCSChits_vs_eta
 
std::vector< MonitorElement * > nDThits_vs_eta
 
std::vector< MonitorElement * > nGEMhits_vs_eta
 
std::vector< MonitorElement * > nhits_vs_eta
 
std::vector< MonitorElement * > nhits_vs_phi
 
int nintCSCHit
 
int nintDTHit
 
int nintDxy
 
int nintDz
 
int nintEta
 
int nintFTracks
 
int nintLayers
 
int nintNHit
 
int nintNTracks
 
int nintPhi
 
int nintPixels
 
int nintPt
 
int nintPU
 
int nintRPCHit
 
int nintRpos
 
int nintZpos
 
std::vector< MonitorElement * > nlosthits_vs_eta
 
std::vector< MonitorElement * > nME0hits_vs_eta
 
std::vector< MonitorElement * > nPixel_LayersWithMeas_vs_eta
 
std::vector< MonitorElement * > nRecHits_vs_nSimHits
 
std::vector< MonitorElement * > nRPChits_vs_eta
 
std::vector< MonitorElement * > nTRK_LayersWithMeas_vs_eta
 
std::string out
 
std::string parametersDefiner
 
std::vector< MonitorElement * > phipull_vs_eta
 
std::vector< MonitorElement * > phipull_vs_phi
 
int phiRes_nbin
 
double phiRes_rangeMax
 
double phiRes_rangeMin
 
std::vector< MonitorElement * > phires_vs_eta
 
std::vector< MonitorElement * > phires_vs_phi
 
std::vector< MonitorElement * > phires_vs_pt
 
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupinfo_Token
 
std::vector< MonitorElement * > ptpull_vs_eta
 
std::vector< MonitorElement * > ptpull_vs_phi
 
int ptRes_nbin
 
double ptRes_rangeMax
 
double ptRes_rangeMin
 
std::vector< MonitorElement * > ptres_vs_eta
 
std::vector< MonitorElement * > ptres_vs_phi
 
std::vector< MonitorElement * > ptres_vs_pt
 
edm::ESHandle< MagneticFieldtheMF
 
std::vector< MonitorElement * > thetaCotres_vs_eta
 
std::vector< MonitorElement * > thetaCotres_vs_pt
 
std::vector< MonitorElement * > thetapull_vs_eta
 
std::vector< MonitorElement * > thetapull_vs_phi
 
edm::EDGetTokenT< TrackingParticleRefVectortp_refvector_Token
 
edm::EDGetTokenT< TrackingParticleCollectiontp_Token
 
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > track_Collection_Token
 
bool useFabsEta
 
bool useInvPt
 
bool useLogPt
 
bool usemuon
 
bool usetracker
 

Detailed Description

Class that produces histograms to validate Muon Track Reconstruction performances

Definition at line 24 of file MuonTrackValidator.h.

Constructor & Destructor Documentation

◆ MuonTrackValidator()

MuonTrackValidator::MuonTrackValidator ( const edm::ParameterSet pset)
inline

Constructor.

Definition at line 27 of file MuonTrackValidator.h.

References _simHitTpMapTag, LCToCPAssociation_cfi::associator, associatormap, MuonTrackValidatorBase::associators, BiDirectional_RecoToSim_association, MuonTrackValidatorBase::bsSrc, MuonTrackValidatorBase::bsSrc_Token, cosmicParametersDefinerTP_, cosmictpSelector, dirName_, Exception, ProducerED_cfi::InputTag, edm::InputTag::label(), MuonTrackValidatorBase::label, MuonTrackValidatorBase::label_pileupinfo, MuonTrackValidatorBase::label_tp, MuonTrackValidatorBase::label_tp_refvector, lhcParametersDefinerTP_, MABH, MuonTrackValidatorBase::parametersDefiner, MuonTrackValidatorBase::pileupinfo_Token, muonDTDigis_cfi::pset, recoToSimCollection_Token, simToRecoCollection_Token, AlCaHLTBitMon_QueryRunRegistry::string, MuonTrackValidatorBase::tp_refvector_Token, MuonTrackValidatorBase::tp_Token, tpSelector, MuonTrackValidatorBase::track_Collection_Token, UseAssociators, useGEMs_, useME0_, MuonTrackValidatorBase::usemuon, and MuonTrackValidatorBase::usetracker.

28  dirName_ = pset.getParameter<std::string>("dirName");
29  associatormap = pset.getParameter<edm::InputTag>("associatormap");
30  UseAssociators = pset.getParameter<bool>("UseAssociators");
31  useGEMs_ = pset.getParameter<bool>("useGEMs");
32  useME0_ = pset.getParameter<bool>("useME0");
33  edm::ParameterSet tpset = pset.getParameter<edm::ParameterSet>("muonTPSelector");
34  tpSelector = TrackingParticleSelector(tpset.getParameter<double>("ptMin"),
35  tpset.getParameter<double>("ptMax"),
36  tpset.getParameter<double>("minRapidity"),
37  tpset.getParameter<double>("maxRapidity"),
38  tpset.getParameter<double>("tip"),
39  tpset.getParameter<double>("lip"),
40  tpset.getParameter<int>("minHit"),
41  tpset.getParameter<bool>("signalOnly"),
42  tpset.getParameter<bool>("intimeOnly"),
43  tpset.getParameter<bool>("chargedOnly"),
44  tpset.getParameter<bool>("stableOnly"),
45  tpset.getParameter<std::vector<int> >("pdgId"));
46 
47  cosmictpSelector = CosmicTrackingParticleSelector(tpset.getParameter<double>("ptMin"),
48  tpset.getParameter<double>("minRapidity"),
49  tpset.getParameter<double>("maxRapidity"),
50  tpset.getParameter<double>("tip"),
51  tpset.getParameter<double>("lip"),
52  tpset.getParameter<int>("minHit"),
53  tpset.getParameter<bool>("chargedOnly"),
54  tpset.getParameter<std::vector<int> >("pdgId"));
55 
56  BiDirectional_RecoToSim_association = pset.getParameter<bool>("BiDirectional_RecoToSim_association");
57 
58  // dump cfg parameters
59  edm::LogVerbatim("MuonTrackValidator") << "constructing MuonTrackValidator: " << pset.dump();
60 
61  // Declare consumes (also for the base class)
62  bsSrc_Token = consumes<reco::BeamSpot>(bsSrc);
64  tp_refvector_Token = consumes<TrackingParticleRefVector>(label_tp);
65  else
66  tp_Token = consumes<TrackingParticleCollection>(label_tp);
67  pileupinfo_Token = consumes<std::vector<PileupSummaryInfo> >(label_pileupinfo);
68  for (unsigned int www = 0; www < label.size(); www++) {
69  track_Collection_Token.push_back(consumes<edm::View<reco::Track> >(label[www]));
70  }
71  simToRecoCollection_Token = consumes<reco::SimToRecoCollection>(associatormap);
72  recoToSimCollection_Token = consumes<reco::RecoToSimCollection>(associatormap);
73 
74  if (parametersDefiner == "LhcParametersDefinerForTP") {
75  lhcParametersDefinerTP_ = std::make_unique<ParametersDefinerForTP>(bsSrc, consumesCollector());
76  } else if (parametersDefiner == "CosmicParametersDefinerForTP") {
77  cosmicParametersDefinerTP_ = std::make_unique<CosmicParametersDefinerForTP>(consumesCollector());
78  } else {
79  throw cms::Exception("Configuration") << "Unexpected label: parametersDefiner = " << parametersDefiner;
80  }
81 
82  _simHitTpMapTag = mayConsume<SimHitTPAssociationProducer::SimHitTPAssociationList>(
83  pset.getParameter<edm::InputTag>("simHitTpMapTag"));
84 
85  MABH = false;
86  if (!UseAssociators) {
87  // flag MuonAssociatorByHits
88  if (associators[0] == "MuonAssociationByHits")
89  MABH = true;
90  // reset string associators to the map label
91  associators.clear();
92  associators.push_back(associatormap.label());
93  edm::LogVerbatim("MuonTrackValidator") << "--> associators reset to: " << associators[0];
94  } else {
95  for (auto const& associator : associators) {
96  consumes<reco::TrackToTrackingParticleAssociator>(edm::InputTag(associator));
97  }
98  }
99 
100  // inform on which SimHits will be counted
101  if (usetracker)
102  edm::LogVerbatim("MuonTrackValidator") << "\n usetracker = TRUE : Tracker SimHits WILL be counted";
103  else
104  edm::LogVerbatim("MuonTrackValidator") << "\n usetracker = FALSE : Tracker SimHits WILL NOT be counted";
105  if (usemuon)
106  edm::LogVerbatim("MuonTrackValidator") << " usemuon = TRUE : Muon SimHits WILL be counted";
107  else
108  edm::LogVerbatim("MuonTrackValidator") << " usemuon = FALSE : Muon SimHits WILL NOT be counted" << std::endl;
109 
110  // loop over the reco::Track collections to validate: check for inconsistent input settings
111  for (unsigned int www = 0; www < label.size(); www++) {
112  std::string recoTracksLabel = label[www].label();
113  std::string recoTracksInstance = label[www].instance();
114 
115  // tracks with hits only on tracker
116  if (recoTracksLabel == "generalTracks" || recoTracksLabel == "probeTracks" ||
117  recoTracksLabel == "displacedTracks" || recoTracksLabel == "extractGemMuons" ||
118  recoTracksLabel == "extractMe0Muons" || recoTracksLabel == "ctfWithMaterialTracksP5LHCNavigation" ||
119  recoTracksLabel == "ctfWithMaterialTracksP5" ||
120  recoTracksLabel == "hltIterL3OIMuonTrackSelectionHighPurity" || recoTracksLabel == "hltIterL3MuonMerged" ||
121  recoTracksLabel == "hltIterL3MuonAndMuonFromL1Merged") {
122  if (usemuon) {
123  edm::LogWarning("MuonTrackValidator")
124  << "\n*** WARNING : inconsistent input tracksTag = " << label[www] << "\n with usemuon == true"
125  << "\n ---> resetting to usemuon == false ";
126  usemuon = false;
127  }
128  if (!usetracker) {
129  edm::LogWarning("MuonTrackValidator")
130  << "\n*** WARNING : inconsistent input tracksTag = " << label[www] << "\n with usetracker == false"
131  << "\n ---> resetting to usetracker == true ";
132  usetracker = true;
133  }
134  }
135 
136  // tracks with hits only on muon detectors
137  else if (recoTracksLabel == "seedsOfSTAmuons" || recoTracksLabel == "standAloneMuons" ||
138  recoTracksLabel == "seedsOfDisplacedSTAmuons" || recoTracksLabel == "displacedStandAloneMuons" ||
139  recoTracksLabel == "refittedStandAloneMuons" || recoTracksLabel == "cosmicMuons" ||
140  recoTracksLabel == "cosmicMuons1Leg" || recoTracksLabel == "hltL2Muons") {
141  if (usetracker) {
142  edm::LogWarning("MuonTrackValidator")
143  << "\n*** WARNING : inconsistent input tracksTag = " << label[www] << "\n with usetracker == true"
144  << "\n ---> resetting to usetracker == false ";
145  usetracker = false;
146  }
147  if (!usemuon) {
148  edm::LogWarning("MuonTrackValidator")
149  << "\n*** WARNING : inconsistent input tracksTag = " << label[www] << "\n with usemuon == false"
150  << "\n ---> resetting to usemuon == true ";
151  usemuon = true;
152  }
153  }
154 
155  } // for (unsigned int www=0;www<label.size();www++)
156  }
Log< level::Info, true > LogVerbatim
edm::EDGetTokenT< TrackingParticleRefVector > tp_refvector_Token
std::unique_ptr< CosmicParametersDefinerForTP > cosmicParametersDefinerTP_
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > track_Collection_Token
std::unique_ptr< ParametersDefinerForTP > lhcParametersDefinerTP_
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > _simHitTpMapTag
CosmicTrackingParticleSelector cosmictpSelector
std::vector< edm::InputTag > label
MuonTrackValidatorBase(const edm::ParameterSet &pset, edm::ConsumesCollector iC)
Constructor.
ObjectSelector< CosmicTrackingParticleSelector > CosmicTrackingParticleSelector
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimCollection_Token
edm::EDGetTokenT< TrackingParticleCollection > tp_Token
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoCollection_Token
TrackingParticleSelector tpSelector
edm::InputTag associatormap
Log< level::Warning, false > LogWarning
std::vector< std::string > associators
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupinfo_Token
SingleObjectSelector< TrackingParticleCollection, ::TrackingParticleSelector > TrackingParticleSelector
edm::EDGetTokenT< reco::BeamSpot > bsSrc_Token

◆ ~MuonTrackValidator()

MuonTrackValidator::~MuonTrackValidator ( )
inlineoverride

Destructor.

Definition at line 159 of file MuonTrackValidator.h.

159 {}

Member Function Documentation

◆ analyze()

void MuonTrackValidator::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 356 of file MuonTrackValidator.cc.

References funct::abs(), LCToCPAssociation_cfi::associator, muonValidationHeavyIons_cff::associatormap, MuonErrorMatrixAnalyzer_cfi::associatorName, ticlDumper_cff::associators, edm::AssociationMap< Tag >::begin(), MuonTrackValidator_cfi::BiDirectional_RecoToSim_association, cms::cuda::bs, reco::TrackBase::charge(), funct::cos(), histoParameters_cff::do_MUOhitsPlots, histoParameters_cff::do_TRKhitsPlots, TrackingParticleIP::dxy(), run3scouting_cff::dxyError, TrackingParticleIP::dz(), run3scouting_cff::dzError, edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), HLT_2024v14_cff::fraction, edm::Ref< C, T, F >::get(), mkfit::getEta(), mps_fire::i, createfilelist::int, edm::RefToBase< T >::key(), edm::Ref< C, T, F >::key(), label, MuonTrackValidator_cfi::label_tp_refvector, LogTrace, M_PI, associators_cff::MABH, reco::HitPattern::MISSING_INNER_HITS, reco::HitPattern::MISSING_OUTER_HITS, TrackingParticle::momentum(), reco::TrackBase::numberOfValidHits(), MuonTrackValidator_cfi::parametersDefiner, run3scouting_cff::phiError, edm::AssociationMap< Tag >::post_insert(), edm::Handle< T >::product(), edm::RefVector< C, T, F >::push_back(), run3scouting_cff::qoverpError, quality, hcal_runs::rt, singleTopDQM_cfi::setup, funct::sin(), edm::RefVector< C, T, F >::size(), mathSSE::sqrt(), cmsswSequenceInfo::tp, RecoDisplacedMuonValidator_cfi::tpSelector, HLT_2024v14_cff::track, JetHT_cfg::trackCollection, TrackAlgoCompareUtil_cfi::UseAssociators, histoParameters_cff::usemuon, histoParameters_cff::usetracker, bphysicsOniaDQM_cfi::vertex, w(), and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::ww.

356  {
357  using namespace reco;
358 
359  edm::LogInfo("MuonTrackValidator") << "\n===================================================="
360  << "\n"
361  << "Analyzing new event"
362  << "\n"
363  << "====================================================\n"
364  << "\n";
365 
367  int PU_NumInteractions(-1);
368 
369  if (parametersDefiner == "LhcParametersDefinerForTP") {
370  // PileupSummaryInfo is contained only in collision events
371  event.getByToken(pileupinfo_Token, puinfoH);
372  for (std::vector<PileupSummaryInfo>::const_iterator puInfoIt = puinfoH->begin(); puInfoIt != puinfoH->end();
373  ++puInfoIt) {
374  if (puInfoIt->getBunchCrossing() == 0) {
375  PU_NumInteractions = puInfoIt->getPU_NumInteractions();
376  break;
377  }
378  }
379 
380  } else if (parametersDefiner == "CosmicParametersDefinerForTP") {
382  //warning: make sure the TP collection used in the map is the same used here
383  event.getByToken(_simHitTpMapTag, simHitsTPAssoc);
384  cosmicParametersDefinerTP_->initEvent(simHitsTPAssoc);
385  cosmictpSelector.initEvent(simHitsTPAssoc);
386  }
387 
389  const TrackingParticleRefVector* ptr_TPrefV = nullptr;
391  edm::Handle<TrackingParticleRefVector> TPCollectionRefVector_H;
392 
393  if (label_tp_refvector) {
394  event.getByToken(tp_refvector_Token, TPCollectionRefVector_H);
395  ptr_TPrefV = TPCollectionRefVector_H.product();
396  } else {
397  event.getByToken(tp_Token, TPCollection_H);
398  size_t nTP = TPCollection_H->size();
399  for (size_t i = 0; i < nTP; ++i) {
400  TPrefV.push_back(TrackingParticleRef(TPCollection_H, i));
401  }
402  ptr_TPrefV = &TPrefV;
403  }
404  TrackingParticleRefVector const& tPC = *ptr_TPrefV;
405 
406  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
407  bool bs_Available = event.getByToken(bsSrc_Token, recoBeamSpotHandle);
409  if (bs_Available)
410  bs = *recoBeamSpotHandle;
411  edm::LogVerbatim("MuonTrackValidator") << bs;
412 
413  std::vector<const reco::TrackToTrackingParticleAssociator*> associator;
414  if (UseAssociators) {
416  for (auto const& associatorName : associators) {
417  event.getByLabel(associatorName, theAssociator);
418  associator.push_back(theAssociator.product());
419  }
420  }
421 
422  int w = 0;
423  for (unsigned int ww = 0; ww < associators.size(); ww++) {
424  for (unsigned int www = 0; www < label.size(); www++) {
425  //
426  //get collections from the event
427  //
429  unsigned int trackCollectionSize = 0;
430 
431  reco::RecoToSimCollection recSimColl;
432  reco::SimToRecoCollection simRecColl;
433 
434  // account for missing track collections (HLT case)
436  recSimColl.post_insert();
437  simRecColl.post_insert();
438  }
439 
440  //associate tracks to TrackingParticles
441  else {
442  trackCollectionSize = trackCollection->size();
443 
444  if (UseAssociators) {
445  edm::LogVerbatim("MuonTrackValidator")
446  << "Analyzing " << label[www].process() << ":" << label[www].label() << ":" << label[www].instance()
447  << " with " << associators[ww].c_str() << "\n";
448 
449  LogTrace("MuonTrackValidator") << "Calling associateRecoToSim method"
450  << "\n";
451  recSimColl = associator[ww]->associateRecoToSim(trackCollection, TPCollection_H);
452  LogTrace("MuonTrackValidator") << "Calling associateSimToReco method"
453  << "\n";
454  simRecColl = associator[ww]->associateSimToReco(trackCollection, TPCollection_H);
455  } else {
456  edm::LogVerbatim("MuonTrackValidator")
457  << "Analyzing " << label[www].process() << ":" << label[www].label() << ":" << label[www].instance()
458  << " with " << associatormap.process() << ":" << associatormap.label() << ":" << associatormap.instance()
459  << "\n";
460 
461  Handle<reco::SimToRecoCollection> simtorecoCollectionH;
462  event.getByToken(simToRecoCollection_Token, simtorecoCollectionH);
463  simRecColl = *simtorecoCollectionH.product();
464 
465  Handle<reco::RecoToSimCollection> recotosimCollectionH;
466  event.getByToken(recoToSimCollection_Token, recotosimCollectionH);
467  recSimColl = *recotosimCollectionH.product();
468  }
469  }
470 
471  //
472  //fill simulation histograms
473  //
474  edm::LogVerbatim("MuonTrackValidator") << "\n# of TrackingParticles: " << tPC.size() << "\n";
475  int ats = 0;
476  int st = 0;
477 
478  for (size_t i = 0; i < tPC.size(); i++) {
479  bool TP_is_matched = false;
480  bool isChargeOK = true;
481  double quality = 0.;
482 
483  const TrackingParticleRef& tpr = tPC[i];
484  const TrackingParticle& tp = *tpr;
485 
486  TrackingParticle::Vector momentumTP;
487  TrackingParticle::Point vertexTP;
488  double dxySim = 0;
489  double dzSim = 0;
490 
491  //If the TrackingParticle is collision-like, get the momentum and vertex at production state
492  //and the impact parameters w.r.t. PCA
493  if (parametersDefiner == "LhcParametersDefinerForTP") {
494  LogTrace("MuonTrackValidator") << "TrackingParticle " << i;
495  if (!tpSelector(tp))
496  continue;
497  momentumTP = tp.momentum();
498  vertexTP = tp.vertex();
499  TrackingParticle::Vector momentum = lhcParametersDefinerTP_->momentum(event, setup, tpr);
501  dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position());
502  dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position());
503  }
504  //for cosmics get the momentum and vertex at PCA
505  else if (parametersDefiner == "CosmicParametersDefinerForTP") {
506  edm::LogVerbatim("MuonTrackValidator") << "TrackingParticle " << i;
507  if (!cosmictpSelector(tpr, &bs, event, setup))
508  continue;
509  momentumTP = cosmicParametersDefinerTP_->momentum(event, setup, tpr);
510  vertexTP = cosmicParametersDefinerTP_->vertex(event, setup, tpr);
511  dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
512  dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
513  }
514 
515  // Number of counted SimHits depend on the selection of tracker and muon detectors (via cfg parameters)
516  int nSimHits = 0;
517  if (usetracker && usemuon) {
518  nSimHits = tpr.get()->numberOfHits();
519  } else if (!usetracker && usemuon) {
520  nSimHits = tpr.get()->numberOfHits() - tpr.get()->numberOfTrackerHits();
521  } else if (usetracker && !usemuon) {
522  nSimHits = tpr.get()->numberOfTrackerHits();
523  }
524 
525  edm::LogVerbatim("MuonTrackValidator") << "--------------------Selected TrackingParticle #" << tpr.key()
526  << " (N counted simhits = " << nSimHits << ")";
527  edm::LogVerbatim("MuonTrackValidator")
528  << "momentumTP: pt = " << sqrt(momentumTP.perp2()) << ", pz = " << momentumTP.z()
529  << ", \t vertexTP: radius = " << sqrt(vertexTP.perp2()) << ", z = " << vertexTP.z();
530  st++;
531 
532  double TPeta = momentumTP.eta();
533  double xTPeta = getEta(TPeta); // may be |eta| in histos according to useFabsEta
534  double TPpt = sqrt(momentumTP.perp2());
535  double xTPpt = getPt(TPpt); // may be 1/pt in histos according to useInvPt
536  double TPphi = momentumTP.phi();
537  double TPrpos = sqrt(vertexTP.perp2());
538  double TPzpos = vertexTP.z();
539 
540  int assoc_recoTrack_NValidHits = 0;
541  if (simRecColl.find(tpr) != simRecColl.end()) {
542  auto const& rt = simRecColl[tpr];
543  if (!rt.empty()) {
544  RefToBase<Track> assoc_recoTrack = rt.begin()->first;
545  TP_is_matched = true;
546  ats++;
547  if (assoc_recoTrack->charge() != tpr->charge())
548  isChargeOK = false;
549  quality = rt.begin()->second;
550  assoc_recoTrack_NValidHits = assoc_recoTrack->numberOfValidHits();
551  edm::LogVerbatim("MuonTrackValidator") << "-----------------------------associated to Track #"
552  << assoc_recoTrack.key() << " with quality:" << quality << "\n";
553  }
554  } else {
555  edm::LogVerbatim("MuonTrackValidator")
556  << "TrackingParticle #" << tpr.key() << " with pt,eta,phi: " << sqrt(momentumTP.perp2()) << " , "
557  << momentumTP.eta() << " , " << momentumTP.phi() << " , "
558  << " NOT associated to any reco::Track"
559  << "\n";
560  }
561 
562  // histos for efficiency vs eta
563  fillPlotNoFlow(h_simuleta[w], xTPeta);
564  if (TP_is_matched) {
565  fillPlotNoFlow(h_assoceta[w], xTPeta);
566  if (!isChargeOK)
567  fillPlotNoFlow(h_misideta[w], xTPeta);
568  }
569 
570  // histos for efficiency vs phi
571  fillPlotNoFlow(h_simulphi[w], TPphi);
572  if (TP_is_matched) {
573  fillPlotNoFlow(h_assocphi[w], TPphi);
574  if (!isChargeOK)
575  fillPlotNoFlow(h_misidphi[w], TPphi);
576  }
577 
578  // histos for efficiency vs pT
579  fillPlotNoFlow(h_simulpT[w], xTPpt);
580  if (TP_is_matched) {
581  fillPlotNoFlow(h_assocpT[w], xTPpt);
582  if (!isChargeOK)
583  fillPlotNoFlow(h_misidpT[w], xTPpt);
584  }
585 
586  // histos for efficiency vs dxy
587  fillPlotNoFlow(h_simuldxy[w], dxySim);
588  if (TP_is_matched) {
589  fillPlotNoFlow(h_assocdxy[w], dxySim);
590  if (!isChargeOK)
591  fillPlotNoFlow(h_misiddxy[w], dxySim);
592  }
593 
594  // histos for efficiency vs dz
595  fillPlotNoFlow(h_simuldz[w], dzSim);
596  if (TP_is_matched) {
597  fillPlotNoFlow(h_assocdz[w], dzSim);
598  if (!isChargeOK)
599  fillPlotNoFlow(h_misiddz[w], dzSim);
600  }
601 
602  // histos for efficiency vs Radius
603  fillPlotNoFlow(h_simulRpos[w], TPrpos);
604  if (TP_is_matched)
605  fillPlotNoFlow(h_assocRpos[w], TPrpos);
606 
607  // histos for efficiency vs z position
608  fillPlotNoFlow(h_simulZpos[w], TPzpos);
609  if (TP_is_matched)
610  fillPlotNoFlow(h_assocZpos[w], TPzpos);
611 
612  // histos for efficiency vs Number of Hits
613  fillPlotNoFlow(h_simulhit[w], nSimHits);
614  if (TP_is_matched) {
615  fillPlotNoFlow(h_assochit[w], nSimHits);
616  nRecHits_vs_nSimHits[w]->Fill(nSimHits, assoc_recoTrack_NValidHits);
617 
618  // charge misid is more useful w.r.t. nRecHits (filled after)
619  //if (!isChargeOK) fillPlotNoFlow(h_misidhit[w], nSimHits);
620  }
621 
622  // histos for efficiency vs PileUp
623  fillPlotNoFlow(h_simulpu[w], PU_NumInteractions);
624  if (TP_is_matched) {
625  fillPlotNoFlow(h_assocpu[w], PU_NumInteractions);
626  if (!isChargeOK)
627  fillPlotNoFlow(h_misidpu[w], PU_NumInteractions);
628  }
629 
630  } // End for (size_t i = 0; i < tPCeff.size(); i++) {
631 
632  //
633  //fill reconstructed track histograms
634  //
635  edm::LogVerbatim("MuonTrackValidator")
636  << "\n# of reco::Tracks with " << label[www].process() << ":" << label[www].label() << ":"
637  << label[www].instance() << ": " << trackCollectionSize << "\n";
638 
639  int at = 0;
640  int rT = 0;
641  for (edm::View<Track>::size_type i = 0; i < trackCollectionSize; ++i) {
642  bool Track_is_matched = false;
643  bool isChargeOK = true;
645  int nRecHits = track->numberOfValidHits();
646  rT++;
647 
648  std::vector<std::pair<TrackingParticleRef, double> > tp;
650 
651  // new logic (bidirectional)
653  edm::LogVerbatim("MuonTrackValidator") << "----------------------------------------Track #" << track.key()
654  << " (N valid rechits = " << nRecHits << ")";
655 
656  if (recSimColl.find(track) != recSimColl.end()) {
657  tp = recSimColl[track];
658  if (!tp.empty()) {
659  tpr = tp.begin()->first;
660  // RtS and StR must associate the same pair !
661  if (simRecColl.find(tpr) != simRecColl.end()) {
662  auto const& assoc_track_checkback = simRecColl[tpr].begin()->first;
663 
664  if (assoc_track_checkback.key() == track.key()) {
665  Track_is_matched = true;
666  at++;
667  if (track->charge() != tpr->charge())
668  isChargeOK = false;
669  double Purity = tp.begin()->second;
670  double Quality = simRecColl[tpr].begin()->second;
671  edm::LogVerbatim("MuonTrackValidator")
672  << "with pt=" << track->pt() << " associated with purity:" << Purity << " to TrackingParticle #"
673  << tpr.key() << "\n";
674  if (MABH)
675  h_PurityVsQuality[w]->Fill(Quality, Purity);
676  }
677  }
678  }
679  }
680 
681  if (!Track_is_matched)
682  edm::LogVerbatim("MuonTrackValidator")
683  << "with pt=" << track->pt() << " NOT associated to any TrackingParticle"
684  << "\n";
685  }
686  // old logic, valid for cosmics 2-legs reco (bugged for collision scenario)
687  else {
688  if (recSimColl.find(track) != recSimColl.end()) {
689  tp = recSimColl[track];
690  if (!tp.empty()) {
691  tpr = tp.begin()->first;
692  Track_is_matched = true;
693  at++;
694  if (track->charge() != tpr->charge())
695  isChargeOK = false;
696  edm::LogVerbatim("MuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
697  << " associated with quality:" << tp.begin()->second << "\n";
698  }
699  } else {
700  edm::LogVerbatim("MuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
701  << " NOT associated to any TrackingParticle"
702  << "\n";
703  }
704  }
705 
706  double etaRec = track->eta();
707  double xetaRec = getEta(etaRec);
708 
709  double ptRec = track->pt();
710  double xptRec = getPt(ptRec);
711 
712  double qoverpRec = track->qoverp();
713  double phiRec = track->phi();
714  double thetaRec = track->theta();
715  double dxyRec = track->dxy(bs.position());
716  double dzRec = track->dz(bs.position());
717 
718  double qoverpError = track->qoverpError();
719  double ptError = track->ptError();
720  double thetaError = track->thetaError();
721  double phiError = track->phiError();
722  double dxyError = track->dxyError();
723  double dzError = track->dzError();
724 
725  // histos for fake rate vs eta
726  fillPlotNoFlow(h_recoeta[w], xetaRec);
727  if (Track_is_matched) {
728  fillPlotNoFlow(h_assoc2eta[w], xetaRec);
729  }
730 
731  // histos for fake rate vs phi
732  fillPlotNoFlow(h_recophi[w], phiRec);
733  if (Track_is_matched) {
734  fillPlotNoFlow(h_assoc2phi[w], phiRec);
735  }
736 
737  // histos for fake rate vs pT
738  fillPlotNoFlow(h_recopT[w], xptRec);
739  if (Track_is_matched) {
740  fillPlotNoFlow(h_assoc2pT[w], xptRec);
741  }
742 
743  // histos for fake rate vs dxy
744  fillPlotNoFlow(h_recodxy[w], dxyRec);
745  if (Track_is_matched) {
746  fillPlotNoFlow(h_assoc2dxy[w], dxyRec);
747  }
748 
749  // histos for fake rate vs dz
750  fillPlotNoFlow(h_recodz[w], dzRec);
751  if (Track_is_matched) {
752  fillPlotNoFlow(h_assoc2dz[w], dzRec);
753  }
754 
755  // histos for fake rate vs Number of RecHits in track
756  fillPlotNoFlow(h_recohit[w], nRecHits);
757  if (Track_is_matched) {
758  fillPlotNoFlow(h_assoc2hit[w], nRecHits);
759  // charge misid w.r.t. nRecHits
760  if (!isChargeOK)
761  fillPlotNoFlow(h_misidhit[w], nRecHits);
762  }
763 
764  // histos for fake rate vs Number of PU interactions
765  fillPlotNoFlow(h_recopu[w], PU_NumInteractions);
766  if (Track_is_matched) {
767  fillPlotNoFlow(h_assoc2pu[w], PU_NumInteractions);
768  }
769 
770  // Fill other histos
771  TrackingParticle* tpp = const_cast<TrackingParticle*>(tpr.get());
772  // TrackingParticle parameters at point of closest approach to the beamline
773  TrackingParticle::Vector momentumTP;
774  TrackingParticle::Point vertexTP;
775 
776  if (parametersDefiner == "LhcParametersDefinerForTP") {
777  // following reco plots are made only from tracks associated to selected signal TPs
778  if (!(Track_is_matched && tpSelector(*tpp)))
779  continue;
780  else {
781  momentumTP = lhcParametersDefinerTP_->momentum(event, setup, tpr);
782  vertexTP = lhcParametersDefinerTP_->vertex(event, setup, tpr);
783  }
784  } else if (parametersDefiner == "CosmicParametersDefinerForTP") {
785  // following reco plots are made only from tracks associated to selected signal TPs
786  if (!(Track_is_matched && cosmictpSelector(tpr, &bs, event, setup)))
787  continue;
788  else {
789  momentumTP = cosmicParametersDefinerTP_->momentum(event, setup, tpr);
790  vertexTP = cosmicParametersDefinerTP_->vertex(event, setup, tpr);
791  }
792  }
793 
794  if (associators[ww] == "trackAssociatorByChi2") {
795  //association chi2
796  double assocChi2 = -tp.begin()->second; //in association map is stored -chi2
797  h_assochi2[www]->Fill(assocChi2);
798  h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2) * 5, 5));
799  } else if (associators[ww] == "trackAssociatorByHits") {
800  double fraction = tp.begin()->second;
801  h_assocFraction[www]->Fill(fraction);
802  h_assocSharedHit[www]->Fill(fraction * nRecHits);
803  }
804 
805  h_charge[w]->Fill(track->charge());
806 
807  // Hits
808  h_nhits[w]->Fill(nRecHits);
809  nhits_vs_eta[w]->Fill(xetaRec, nRecHits);
810  nhits_vs_phi[w]->Fill(phiRec, nRecHits);
811 
812  if (do_MUOhitsPlots) {
813  nDThits_vs_eta[w]->Fill(xetaRec, track->hitPattern().numberOfValidMuonDTHits());
814  nCSChits_vs_eta[w]->Fill(xetaRec, track->hitPattern().numberOfValidMuonCSCHits());
815  nRPChits_vs_eta[w]->Fill(xetaRec, track->hitPattern().numberOfValidMuonRPCHits());
816  if (useGEMs_)
817  nGEMhits_vs_eta[w]->Fill(xetaRec, track->hitPattern().numberOfValidMuonGEMHits());
818  if (useME0_)
819  nME0hits_vs_eta[w]->Fill(xetaRec, track->hitPattern().numberOfValidMuonME0Hits());
820  }
821 
822  if (do_TRKhitsPlots) {
823  nTRK_LayersWithMeas_vs_eta[w]->Fill(xetaRec, track->hitPattern().trackerLayersWithMeasurement());
824  nPixel_LayersWithMeas_vs_eta[w]->Fill(xetaRec, track->hitPattern().pixelLayersWithMeasurement());
825  h_nlosthits[w]->Fill(track->numberOfLostHits());
826  h_nmisslayers_inner[w]->Fill(track->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS));
827  h_nmisslayers_outer[w]->Fill(track->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_OUTER_HITS));
828  nlosthits_vs_eta[w]->Fill(xetaRec, track->numberOfLostHits());
829  }
830 
831  // normalized chi2
832  h_nchi2[w]->Fill(track->normalizedChi2());
833  h_nchi2_prob[w]->Fill(TMath::Prob(track->chi2(), (int)track->ndof()));
834  chi2_vs_nhits[w]->Fill(nRecHits, track->normalizedChi2());
835  chi2_vs_eta[w]->Fill(xetaRec, track->normalizedChi2());
836  chi2_vs_phi[w]->Fill(phiRec, track->normalizedChi2());
837 
838  double ptSim = sqrt(momentumTP.perp2());
839  double xptSim = getPt(ptSim);
840  double qoverpSim = tpr->charge() / sqrt(momentumTP.x() * momentumTP.x() + momentumTP.y() * momentumTP.y() +
841  momentumTP.z() * momentumTP.z());
842  double etaSim = momentumTP.eta();
843  double thetaSim = momentumTP.theta();
844  double phiSim = momentumTP.phi();
845  double dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
846  double dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
847 
848  double etares = etaRec - etaSim;
849  double ptRelRes = (ptRec - ptSim) / ptSim; // relative residual -> resolution
850  double ptPull = (ptRec - ptSim) / ptError;
851  double qoverpPull = (qoverpRec - qoverpSim) / qoverpError;
852  double thetaPull = (thetaRec - thetaSim) / thetaError;
853  double phiDiff = phiRec - phiSim;
854  if (abs(phiDiff) > M_PI) {
855  if (phiDiff > 0.)
856  phiDiff = phiDiff - 2. * M_PI;
857  else
858  phiDiff = phiDiff + 2. * M_PI;
859  }
860  double phiPull = phiDiff / phiError;
861  double dxyPull = (dxyRec - dxySim) / dxyError;
862  double dzPull = (dzRec - dzSim) / dzError;
863 
864  h_etaRes[w]->Fill(etares);
865  etares_vs_eta[w]->Fill(xetaRec, etares);
866 
867  ptres_vs_eta[w]->Fill(xetaRec, ptRelRes);
868  ptres_vs_pt[w]->Fill(xptSim, ptRelRes);
869  ptres_vs_phi[w]->Fill(phiRec, ptRelRes);
870  h_ptpull[w]->Fill(ptPull);
871  ptpull_vs_eta[w]->Fill(xetaRec, ptPull);
872  ptpull_vs_phi[w]->Fill(phiRec, ptPull);
873  h_qoverppull[w]->Fill(qoverpPull);
874 
875  thetaCotres_vs_eta[w]->Fill(xetaRec, cos(thetaRec) / sin(thetaRec) - cos(thetaSim) / sin(thetaSim));
876  thetaCotres_vs_pt[w]->Fill(xptSim, cos(thetaRec) / sin(thetaRec) - cos(thetaSim) / sin(thetaSim));
877  h_thetapull[w]->Fill(thetaPull);
878  thetapull_vs_eta[w]->Fill(xetaRec, thetaPull);
879  thetapull_vs_phi[w]->Fill(phiRec, thetaPull);
880 
881  phires_vs_eta[w]->Fill(xetaRec, phiDiff);
882  phires_vs_pt[w]->Fill(xptSim, phiDiff);
883  phires_vs_phi[w]->Fill(phiRec, phiDiff);
884  h_phipull[w]->Fill(phiPull);
885  phipull_vs_eta[w]->Fill(xetaRec, phiPull);
886  phipull_vs_phi[w]->Fill(phiRec, phiPull);
887 
888  dxyres_vs_eta[w]->Fill(xetaRec, dxyRec - dxySim);
889  dxyres_vs_pt[w]->Fill(xptSim, dxyRec - dxySim);
890  h_dxypull[w]->Fill(dxyPull);
891  dxypull_vs_eta[w]->Fill(xetaRec, dxyPull);
892 
893  dzres_vs_eta[w]->Fill(xetaRec, dzRec - dzSim);
894  dzres_vs_pt[w]->Fill(xptSim, dzRec - dzSim);
895  h_dzpull[w]->Fill(dzPull);
896  dzpull_vs_eta[w]->Fill(xetaRec, dzPull);
897 
898  double contrib_Qoverp = qoverpPull * qoverpPull / 5;
899  double contrib_dxy = dxyPull * dxyPull / 5;
900  double contrib_dz = dzPull * dzPull / 5;
901  double contrib_theta = thetaPull * thetaPull / 5;
902  double contrib_phi = phiPull * phiPull / 5;
903  double assoChi2 = contrib_Qoverp + contrib_dxy + contrib_dz + contrib_theta + contrib_phi;
904 
905  LogTrace("MuonTrackValidator") << "normalized Chi2 (track 5-dofs matching) = " << assoChi2 << "\n"
906  << "\t contrib_Qoverp = " << contrib_Qoverp << "\n"
907  << "\t contrib_theta = " << contrib_theta << "\n"
908  << "\t contrib_phi = " << contrib_phi << "\n"
909  << "\t contrib_dxy = " << contrib_dxy << "\n"
910  << "\t contrib_dz = " << contrib_dz << "\n";
911 
912  LogTrace("MuonTrackValidator") << "ptRec = " << ptRec << "\n"
913  << "etaRec = " << etaRec << "\n"
914  << "qoverpRec = " << qoverpRec << "\n"
915  << "thetaRec = " << thetaRec << "\n"
916  << "phiRec = " << phiRec << "\n"
917  << "dxyRec = " << dxyRec << "\n"
918  << "dzRec = " << dzRec << "\n"
919  << ""
920  << "\n"
921  << "qoverpError = " << qoverpError << "\n"
922  << "thetaError = " << thetaError << "\n"
923  << "phiError = " << phiError << "\n"
924  << "dxyError = " << dxyError << "\n"
925  << "dzError = " << dzError << "\n"
926  << ""
927  << "\n"
928  << "ptSim = " << ptSim << "\n"
929  << "etaSim = " << etaSim << "\n"
930  << "qoverpSim = " << qoverpSim << "\n"
931  << "thetaSim = " << thetaSim << "\n"
932  << "phiSim = " << phiSim << "\n"
933  << "dxySim = " << dxySim << "\n"
934  << "dzSim = " << dzSim << "\n";
935  } // End of for(edm::View<Track>::size_type i=0; i<trackCollectionSize; ++i) {
936 
937  h_tracks[w]->Fill(at);
938  h_fakes[w]->Fill(rT - at);
939  edm::LogVerbatim("MuonTrackValidator") << "Total Simulated: " << st << "\n"
940  << "Total Associated (simToReco): " << ats << "\n"
941  << "Total Reconstructed: " << rT << "\n"
942  << "Total Associated (recoToSim): " << at << "\n"
943  << "Total Fakes: " << rT - at << "\n";
944  w++;
945  } // End of for (unsigned int www=0;www<label.size();www++){
946  } //END of for (unsigned int ww=0;ww<associators.size();ww++){
947 }
void fillPlotNoFlow(MonitorElement *h, T val)
std::vector< MonitorElement * > h_assoc2phi
std::vector< MonitorElement * > h_recoeta
std::vector< MonitorElement * > phipull_vs_phi
Log< level::Info, true > LogVerbatim
unsigned int size_type
Definition: View.h:92
std::vector< MonitorElement * > h_assoc2hit
std::vector< MonitorElement * > h_PurityVsQuality
std::vector< MonitorElement * > h_etaRes
edm::EDGetTokenT< TrackingParticleRefVector > tp_refvector_Token
std::vector< MonitorElement * > h_misiddxy
std::vector< MonitorElement * > h_assochi2_prob
std::vector< MonitorElement * > h_recopT
std::unique_ptr< CosmicParametersDefinerForTP > cosmicParametersDefinerTP_
std::vector< MonitorElement * > h_nchi2_prob
std::vector< MonitorElement * > dxyres_vs_eta
std::vector< MonitorElement * > h_assoc2dxy
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > track_Collection_Token
std::vector< MonitorElement * > thetaCotres_vs_eta
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
std::vector< MonitorElement * > h_recohit
std::vector< MonitorElement * > dxyres_vs_pt
T w() const
std::vector< MonitorElement * > h_fakes
std::unique_ptr< ParametersDefinerForTP > lhcParametersDefinerTP_
std::string const & instance() const
Definition: InputTag.h:37
std::vector< MonitorElement * > h_dxypull
std::vector< MonitorElement * > phires_vs_phi
std::vector< MonitorElement * > h_assoc2pu
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T const * product() const
Definition: Handle.h:70
std::vector< MonitorElement * > h_nhits
std::vector< MonitorElement * > h_ptpull
std::vector< MonitorElement * > ptpull_vs_phi
std::string const & label() const
Definition: InputTag.h:36
std::vector< MonitorElement * > h_assoceta
std::vector< MonitorElement * > h_tracks
std::vector< MonitorElement * > nDThits_vs_eta
std::vector< MonitorElement * > dzres_vs_pt
key_type key() const
Accessor for product key.
Definition: Ref.h:244
const_iterator find(const key_type &k) const
find element with specified reference key
#define LogTrace(id)
std::vector< MonitorElement * > ptres_vs_eta
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > _simHitTpMapTag
std::vector< MonitorElement * > h_simuldxy
const_iterator end() const
last iterator over the map (read only)
std::vector< MonitorElement * > h_simuldz
math::XYZPointD Point
point in the space
std::vector< MonitorElement * > h_misiddz
std::vector< MonitorElement * > nhits_vs_eta
std::vector< MonitorElement * > nhits_vs_phi
string quality
std::vector< MonitorElement * > h_nchi2
std::vector< MonitorElement * > h_nmisslayers_inner
std::vector< MonitorElement * > h_qoverppull
CosmicTrackingParticleSelector cosmictpSelector
std::vector< MonitorElement * > thetapull_vs_eta
int charge() const
track electric charge
Definition: TrackBase.h:596
std::vector< MonitorElement * > chi2_vs_nhits
std::vector< MonitorElement * > h_misidphi
std::vector< MonitorElement * > h_simulphi
std::vector< edm::InputTag > label
std::vector< MonitorElement * > h_assocSharedHit
std::vector< MonitorElement * > thetapull_vs_phi
std::vector< MonitorElement * > h_misidpu
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
void post_insert()
post insert action
T sqrt(T t)
Definition: SSEVec.h:23
std::vector< MonitorElement * > h_assoc2dz
std::vector< MonitorElement * > phires_vs_pt
std::vector< MonitorElement * > ptres_vs_phi
std::vector< MonitorElement * > h_assocZpos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< MonitorElement * > ptpull_vs_eta
std::vector< MonitorElement * > h_recophi
std::vector< MonitorElement * > nRecHits_vs_nSimHits
std::vector< MonitorElement * > dzres_vs_eta
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< MonitorElement * > nME0hits_vs_eta
std::vector< MonitorElement * > h_simulRpos
std::vector< MonitorElement * > nTRK_LayersWithMeas_vs_eta
std::vector< MonitorElement * > chi2_vs_eta
std::vector< MonitorElement * > h_simulhit
std::vector< MonitorElement * > h_charge
trackCollection
Definition: JetHT_cfg.py:51
std::vector< MonitorElement * > h_assocphi
#define M_PI
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimCollection_Token
Log< level::Info, false > LogInfo
edm::EDGetTokenT< TrackingParticleCollection > tp_Token
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoCollection_Token
size_t key() const
Definition: RefToBase.h:226
std::vector< MonitorElement * > h_assocpT
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
std::vector< MonitorElement * > h_assocpu
std::vector< MonitorElement * > ptres_vs_pt
std::vector< MonitorElement * > h_simulpT
std::vector< MonitorElement * > dzpull_vs_eta
std::vector< MonitorElement * > h_recodz
std::vector< MonitorElement * > phires_vs_eta
std::vector< MonitorElement * > h_misideta
std::vector< MonitorElement * > nlosthits_vs_eta
TrackingParticleSelector tpSelector
std::vector< MonitorElement * > dxypull_vs_eta
std::vector< MonitorElement * > h_nlosthits
std::vector< MonitorElement * > etares_vs_eta
std::vector< MonitorElement * > h_misidhit
std::vector< MonitorElement * > h_nmisslayers_outer
const_iterator begin() const
first iterator over the map (read only)
fixed size matrix
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
edm::InputTag associatormap
std::vector< MonitorElement * > h_simulZpos
std::vector< MonitorElement * > h_recodxy
std::vector< MonitorElement * > h_recopu
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:226
std::vector< MonitorElement * > h_phipull
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
std::vector< MonitorElement * > h_assocdz
std::vector< MonitorElement * > thetaCotres_vs_pt
void initEvent(edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssocToSet) const
Monte Carlo truth information used for tracking validation.
std::vector< MonitorElement * > h_dzpull
std::vector< MonitorElement * > nPixel_LayersWithMeas_vs_eta
std::vector< MonitorElement * > h_assoc2pT
std::vector< MonitorElement * > h_assochi2
std::vector< MonitorElement * > h_misidpT
std::vector< MonitorElement * > h_assocFraction
math::XYZVectorD Vector
point in the space
std::string const & process() const
Definition: InputTag.h:40
std::vector< MonitorElement * > chi2_vs_phi
std::vector< std::string > associators
std::vector< MonitorElement * > h_assocRpos
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupinfo_Token
std::vector< MonitorElement * > h_assocdxy
std::vector< MonitorElement * > h_thetapull
std::vector< MonitorElement * > nRPChits_vs_eta
std::vector< MonitorElement * > h_simulpu
edm::Ref< TrackingParticleCollection > TrackingParticleRef
std::vector< MonitorElement * > h_assochit
std::vector< MonitorElement * > nGEMhits_vs_eta
Definition: event.py:1
std::vector< MonitorElement * > nCSChits_vs_eta
std::vector< MonitorElement * > h_simuleta
std::vector< MonitorElement * > phipull_vs_eta
std::vector< MonitorElement * > h_assoc2eta
edm::EDGetTokenT< reco::BeamSpot > bsSrc_Token

◆ bookHistograms()

void MuonTrackValidator::bookHistograms ( DQMEDAnalyzer::DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &  setup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 21 of file MuonTrackValidator.cc.

References trackingPlots::assoc, ticlDumper_cff::associators, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), histoParameters_cff::cotThetaRes_nbin, histoParameters_cff::cotThetaRes_rangeMax, histoParameters_cff::cotThetaRes_rangeMin, TrackerOfflineValidation_Dqm_cff::dirName, histoParameters_cff::do_MUOhitsPlots, histoParameters_cff::do_TRKhitsPlots, histoParameters_cff::dxyRes_nbin, histoParameters_cff::dxyRes_rangeMax, histoParameters_cff::dxyRes_rangeMin, histoParameters_cff::dzRes_nbin, histoParameters_cff::dzRes_rangeMax, histoParameters_cff::dzRes_rangeMin, histoParameters_cff::etaRes_nbin, histoParameters_cff::etaRes_rangeMax, histoParameters_cff::etaRes_rangeMin, label, associators_cff::MABH, histoParameters_cff::maxCSCHit, histoParameters_cff::maxDTHit, gather_cfg::maxDxy, beam_dqm_sourceclient-live_cfg::maxDz, razorScouting_cff::maxEta, histoParameters_cff::maxFTracks, pixelTopology::maxLayers, histoParameters_cff::maxNHit, HLT_2024v14_cff::maxNTracks, HLT_2024v14_cff::maxPhi, histoParameters_cff::maxPixels, PV_cfg::maxPt, pileupFilter_cff::maxPU, histoParameters_cff::maxRPCHit, histoParameters_cff::maxRpos, HGVHistoProducerAlgoBlock_cfi::maxZpos, histoParameters_cff::minCSCHit, histoParameters_cff::minDTHit, histoParameters_cff::minDxy, pfMETCorrectionType0_cfi::minDz, EgHLTOffEleSelection_cfi::minEta, histoParameters_cff::minFTracks, beam_dqm_sourceclient-live_cfg::minLayers, histoParameters_cff::minNHit, histoParameters_cff::minNTracks, HLT_2024v14_cff::minPhi, histoParameters_cff::minPixels, PV_cfg::minPt, pileupFilter_cff::minPU, histoParameters_cff::minRPCHit, histoParameters_cff::minRpos, HGVHistoProducerAlgoBlock_cfi::minZpos, histoParameters_cff::nintCSCHit, histoParameters_cff::nintDTHit, histoParameters_cff::nintDxy, histoParameters_cff::nintDz, HGVHistoProducerAlgoBlock_cfi::nintEta, histoParameters_cff::nintFTracks, histoParameters_cff::nintLayers, histoParameters_cff::nintNHit, histoParameters_cff::nintNTracks, HGVHistoProducerAlgoBlock_cfi::nintPhi, histoParameters_cff::nintPixels, HGVHistoProducerAlgoBlock_cfi::nintPt, histoParameters_cff::nintPU, histoParameters_cff::nintRPCHit, histoParameters_cff::nintRpos, HGVHistoProducerAlgoBlock_cfi::nintZpos, histoParameters_cff::phiRes_nbin, histoParameters_cff::phiRes_rangeMax, histoParameters_cff::phiRes_rangeMin, histoParameters_cff::ptRes_nbin, histoParameters_cff::ptRes_rangeMax, histoParameters_cff::ptRes_rangeMin, python.rootplot.root2matplotlib::replace(), pvMonitor::setBinLogX(), dqm::implementation::NavigatorBase::setCurrentFolder(), TrackValidationHeavyIons_cff::useLogPt, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::ww.

23  {
24  for (unsigned int ww = 0; ww < associators.size(); ww++) {
25  for (unsigned int www = 0; www < label.size(); www++) {
26  ibooker.cd();
27  InputTag algo = label[www];
28  string dirName = dirName_;
29 
30  auto setBinLogX = [this](TH1* th1) {
31  if (this->useLogPt) {
32  BinLogX(th1);
33  }
34  };
35 
36  if (!algo.process().empty())
37  dirName += algo.process() + "_";
38  if (!algo.label().empty())
39  dirName += algo.label();
40  if (!algo.instance().empty())
41  dirName += ("_" + algo.instance());
42  if (dirName.find("Tracks") < dirName.length()) {
43  dirName.replace(dirName.find("Tracks"), 6, "Trks");
44  }
45  if (dirName.find("UpdatedAtVtx") < dirName.length()) {
46  dirName.replace(dirName.find("UpdatedAtVtx"), 12, "UpdAtVtx");
47  }
48  string assoc = associators[ww];
49  if (assoc.find("tpToTkmuTrackAssociation") < assoc.length()) {
50  dirName += "_TkAsso";
51  }
52  std::replace(dirName.begin(), dirName.end(), ':', '_');
53  ibooker.setCurrentFolder(dirName);
54 
55  h_tracks.push_back(
56  ibooker.book1D("Ntracks", "Number of reconstructed tracks", nintNTracks, minNTracks, maxNTracks));
57  h_fakes.push_back(ibooker.book1D("Nfakes", "Number of fake reco tracks", nintFTracks, minFTracks, maxFTracks));
58  h_charge.push_back(ibooker.book1D("Ncharge", "track charge", 3, -1.5, 1.5));
59 
60  h_recoeta.push_back(ibooker.book1D("num_reco_eta", "N of reco track vs eta", nintEta, minEta, maxEta));
61  h_assoceta.push_back(ibooker.book1D(
62  "num_assoSimToReco_eta", "N of associated tracks (simToReco) vs eta", nintEta, minEta, maxEta));
63  h_assoc2eta.push_back(ibooker.book1D(
64  "num_assoRecoToSim_eta", "N of associated (recoToSim) tracks vs eta", nintEta, minEta, maxEta));
65  h_simuleta.push_back(ibooker.book1D("num_simul_eta", "N of simulated tracks vs eta", nintEta, minEta, maxEta));
66  h_misideta.push_back(ibooker.book1D("num_chargemisid_eta",
67  "N of associated (simToReco) tracks with charge misID vs eta",
68  nintEta,
69  minEta,
70  maxEta));
71 
72  h_recopT.push_back(ibooker.book1D("num_reco_pT", "N of reco track vs pT", nintPt, minPt, maxPt, setBinLogX));
73  h_assocpT.push_back(ibooker.book1D(
74  "num_assoSimToReco_pT", "N of associated tracks (simToReco) vs pT", nintPt, minPt, maxPt, setBinLogX));
75  h_assoc2pT.push_back(ibooker.book1D(
76  "num_assoRecoToSim_pT", "N of associated (recoToSim) tracks vs pT", nintPt, minPt, maxPt, setBinLogX));
77  h_simulpT.push_back(
78  ibooker.book1D("num_simul_pT", "N of simulated tracks vs pT", nintPt, minPt, maxPt, setBinLogX));
79  h_misidpT.push_back(ibooker.book1D("num_chargemisid_pT",
80  "N of associated (simToReco) tracks with charge misID vs pT",
81  nintPt,
82  minPt,
83  maxPt,
84  setBinLogX));
85 
86  h_recophi.push_back(ibooker.book1D("num_reco_phi", "N of reco track vs phi", nintPhi, minPhi, maxPhi));
87  h_assocphi.push_back(ibooker.book1D(
88  "num_assoSimToReco_phi", "N of associated tracks (simToReco) vs phi", nintPhi, minPhi, maxPhi));
89  h_assoc2phi.push_back(ibooker.book1D(
90  "num_assoRecoToSim_phi", "N of associated (recoToSim) tracks vs phi", nintPhi, minPhi, maxPhi));
91  h_simulphi.push_back(ibooker.book1D("num_simul_phi", "N of simulated tracks vs phi", nintPhi, minPhi, maxPhi));
92  h_misidphi.push_back(ibooker.book1D("num_chargemisid_phi",
93  "N of associated (simToReco) tracks with charge misID vs phi",
94  nintPhi,
95  minPhi,
96  maxPhi));
97 
98  h_recohit.push_back(ibooker.book1D("num_reco_hit", "N of reco tracks vs N SimHits", nintNHit, minNHit, maxNHit));
99  h_assochit.push_back(ibooker.book1D(
100  "num_assoSimToReco_hit", "N of associated tracks (simToReco) vs N SimHits", nintNHit, minNHit, maxNHit));
101  h_assoc2hit.push_back(ibooker.book1D(
102  "num_assoRecoToSim_hit", "N of associated (recoToSim) tracks vs N Rechits", nintNHit, minNHit, maxNHit));
103  h_simulhit.push_back(
104  ibooker.book1D("num_simul_hit", "N of simulated tracks vs N SimHits", nintNHit, minNHit, maxNHit));
105  h_misidhit.push_back(ibooker.book1D("num_chargemisid_hit",
106  "N of associated (recoToSim) tracks with charge misID vs N RecHits",
107  nintNHit,
108  minNHit,
109  maxNHit));
110 
111  h_recodxy.push_back(ibooker.book1D("num_reco_dxy", "N of reco track vs dxy", nintDxy, minDxy, maxDxy));
112  h_assocdxy.push_back(ibooker.book1D(
113  "num_assoSimToReco_dxy", "N of associated tracks (simToReco) vs dxy", nintDxy, minDxy, maxDxy));
114  h_assoc2dxy.push_back(ibooker.book1D(
115  "num_assoRecoToSim_dxy", "N of associated (recoToSim) tracks vs dxy", nintDxy, minDxy, maxDxy));
116  h_simuldxy.push_back(ibooker.book1D("num_simul_dxy", "N of simulated tracks vs dxy", nintDxy, minDxy, maxDxy));
117  h_misiddxy.push_back(ibooker.book1D("num_chargemisid_dxy",
118  "N of associated (simToReco) tracks with charge misID vs dxy",
119  nintDxy,
120  minDxy,
121  maxDxy));
122  h_recodz.push_back(ibooker.book1D("num_reco_dz", "N of reco track vs dz", nintDz, minDz, maxDz));
123  h_assocdz.push_back(
124  ibooker.book1D("num_assoSimToReco_dz", "N of associated tracks (simToReco) vs dz", nintDz, minDz, maxDz));
125  h_assoc2dz.push_back(
126  ibooker.book1D("num_assoRecoToSim_dz", "N of associated (recoToSim) tracks vs dz", nintDz, minDz, maxDz));
127  h_simuldz.push_back(ibooker.book1D("num_simul_dz", "N of simulated tracks vs dz", nintDz, minDz, maxDz));
128  h_misiddz.push_back(ibooker.book1D(
129  "num_chargemisid_dz", "N of associated (simToReco) tracks with charge misID vs dz", nintDz, minDz, maxDz));
130 
131  h_assocRpos.push_back(ibooker.book1D(
132  "num_assoSimToReco_Rpos", "N of associated tracks (simToReco) vs Radius", nintRpos, minRpos, maxRpos));
133  h_simulRpos.push_back(
134  ibooker.book1D("num_simul_Rpos", "N of simulated tracks vs Radius", nintRpos, minRpos, maxRpos));
135 
136  h_assocZpos.push_back(ibooker.book1D(
137  "num_assoSimToReco_Zpos", "N of associated tracks (simToReco) vs Z", nintZpos, minZpos, maxZpos));
138  h_simulZpos.push_back(ibooker.book1D("num_simul_Zpos", "N of simulated tracks vs Z", nintZpos, minZpos, maxZpos));
139 
140  h_recopu.push_back(ibooker.book1D("num_reco_pu", "N of reco track vs pu", nintPU, minPU, maxPU));
141  h_assocpu.push_back(
142  ibooker.book1D("num_assoSimToReco_pu", "N of associated tracks (simToReco) vs pu", nintPU, minPU, maxPU));
143  h_assoc2pu.push_back(
144  ibooker.book1D("num_assoRecoToSim_pu", "N of associated (recoToSim) tracks vs pu", nintPU, minPU, maxPU));
145  h_simulpu.push_back(ibooker.book1D("num_simul_pu", "N of simulated tracks vs pu", nintPU, minPU, maxPU));
146  h_misidpu.push_back(ibooker.book1D(
147  "num_chargemisid_pu", "N of associated (simToReco) charge misIDed tracks vs pu", nintPU, minPU, maxPU));
148 
149  h_nchi2.push_back(ibooker.book1D("chi2", "Track normalized #chi^{2}", 80, 0., 20.));
150  h_nchi2_prob.push_back(ibooker.book1D("chi2prob", "Probability of track normalized #chi^{2}", 100, 0., 1.));
151 
152  chi2_vs_nhits.push_back(
153  ibooker.book2D("chi2_vs_nhits", "#chi^{2} vs nhits", nintNHit, minNHit, maxNHit, 20, 0., 10.));
154  chi2_vs_eta.push_back(ibooker.book2D("chi2_vs_eta", "chi2_vs_eta", nintEta, minEta, maxEta, 40, 0., 20.));
155  chi2_vs_phi.push_back(ibooker.book2D("chi2_vs_phi", "#chi^{2} vs #phi", nintPhi, minPhi, maxPhi, 40, 0., 20.));
156 
157  h_nhits.push_back(ibooker.book1D("nhits", "Number of hits per track", nintNHit, minNHit, maxNHit));
158  nhits_vs_eta.push_back(
159  ibooker.book2D("nhits_vs_eta", "Number of Hits vs eta", nintEta, minEta, maxEta, nintNHit, minNHit, maxNHit));
160  nhits_vs_phi.push_back(
161  ibooker.book2D("nhits_vs_phi", "#hits vs #phi", nintPhi, minPhi, maxPhi, nintNHit, minNHit, maxNHit));
162 
163  if (do_MUOhitsPlots) {
164  nDThits_vs_eta.push_back(ibooker.book2D(
165  "nDThits_vs_eta", "Number of DT hits vs eta", nintEta, minEta, maxEta, nintDTHit, minDTHit, maxDTHit));
166  nCSChits_vs_eta.push_back(ibooker.book2D(
167  "nCSChits_vs_eta", "Number of CSC hits vs eta", nintEta, minEta, maxEta, nintCSCHit, minCSCHit, maxCSCHit));
168  nRPChits_vs_eta.push_back(ibooker.book2D(
169  "nRPChits_vs_eta", "Number of RPC hits vs eta", nintEta, minEta, maxEta, nintRPCHit, minRPCHit, maxRPCHit));
170  if (useGEMs_)
171  nGEMhits_vs_eta.push_back(ibooker.book2D(
172  "nGEMhits_vs_eta", "Number of GEM hits vs eta", nintEta, minEta, maxEta, nintNHit, minNHit, maxNHit));
173  if (useME0_)
174  nME0hits_vs_eta.push_back(ibooker.book2D(
175  "nME0hits_vs_eta", "Number of ME0 hits vs eta", nintEta, minEta, maxEta, nintNHit, minNHit, maxNHit));
176  }
177 
178  if (do_TRKhitsPlots) {
179  nTRK_LayersWithMeas_vs_eta.push_back(ibooker.book2D("nTRK_LayersWithMeas_vs_eta",
180  "# TRK Layers with measurement vs eta",
181  nintEta,
182  minEta,
183  maxEta,
184  nintLayers,
185  minLayers,
186  maxLayers));
187  nPixel_LayersWithMeas_vs_eta.push_back(ibooker.book2D("nPixel_LayersWithMeas_vs_eta",
188  "Number of Pixel Layers with measurement vs eta",
189  nintEta,
190  minEta,
191  maxEta,
192  nintPixels,
193  minPixels,
194  maxPixels));
195  h_nmisslayers_inner.push_back(ibooker.book1D(
196  "nTRK_misslayers_inner", "Number of missing inner TRK layers", nintLayers, minLayers, maxLayers));
197  h_nmisslayers_outer.push_back(ibooker.book1D(
198  "nTRK_misslayers_outer", "Number of missing outer TRK layers", nintLayers, minLayers, maxLayers));
199  h_nlosthits.push_back(ibooker.book1D("nlosthits", "Number of lost hits per track", 6, -0.5, 5.5));
200  nlosthits_vs_eta.push_back(ibooker.book2D(
201  "nlosthits_vs_eta", "Number of lost hits per track vs eta", nintEta, minEta, maxEta, 6, -0.5, 5.5));
202  }
203 
204  ptres_vs_eta.push_back(ibooker.book2D("ptres_vs_eta",
205  "p_{T} Relative Residual vs #eta",
206  nintEta,
207  minEta,
208  maxEta,
209  ptRes_nbin,
211  ptRes_rangeMax));
212  ptres_vs_phi.push_back(ibooker.book2D("ptres_vs_phi",
213  "p_{T} Relative Residual vs #phi",
214  nintPhi,
215  minPhi,
216  maxPhi,
217  ptRes_nbin,
219  ptRes_rangeMax));
220  ptres_vs_pt.push_back(ibooker.book2D("ptres_vs_pt",
221  "p_{T} Relative Residual vs p_{T}",
222  nintPt,
223  minPt,
224  maxPt,
225  ptRes_nbin,
228  setBinLogX));
229  h_ptpull.push_back(ibooker.book1D("ptpull", "p_{T} Pull", 100, -10., 10.));
230  ptpull_vs_eta.push_back(
231  ibooker.book2D("ptpull_vs_eta", "p_{T} Pull vs #eta", nintEta, minEta, maxEta, 100, -10., 10.));
232  ptpull_vs_phi.push_back(
233  ibooker.book2D("ptpull_vs_phi", "p_{T} Pull vs #phi", nintPhi, minPhi, maxPhi, 100, -10., 10.));
234  h_qoverppull.push_back(ibooker.book1D("qoverppull", "q/p Pull", 100, -10., 10.));
235 
236  h_etaRes.push_back(ibooker.book1D("etaRes", "#eta residual", etaRes_nbin, etaRes_rangeMin, etaRes_rangeMax));
237  etares_vs_eta.push_back(ibooker.book2D("etares_vs_eta",
238  "#eta Residual vs #eta",
239  nintEta,
240  minEta,
241  maxEta,
242  etaRes_nbin,
244  etaRes_rangeMax));
245 
246  thetaCotres_vs_eta.push_back(ibooker.book2D("thetaCotres_vs_eta",
247  "cot(#theta) Residual vs #eta",
248  nintEta,
249  minEta,
250  maxEta,
254  thetaCotres_vs_pt.push_back(ibooker.book2D("thetaCotres_vs_pt",
255  "cot(#theta) Residual vs p_{T}",
256  nintPt,
257  minPt,
258  maxPt,
262  setBinLogX));
263  h_thetapull.push_back(ibooker.book1D("thetapull", "#theta Pull", 100, -10., 10.));
264  thetapull_vs_eta.push_back(
265  ibooker.book2D("thetapull_vs_eta", "#theta Pull vs #eta", nintEta, minEta, maxEta, 100, -10, 10));
266  thetapull_vs_phi.push_back(
267  ibooker.book2D("thetapull_vs_phi", "#theta Pull vs #phi", nintPhi, minPhi, maxPhi, 100, -10, 10));
268 
269  phires_vs_eta.push_back(ibooker.book2D("phires_vs_eta",
270  "#phi Residual vs #eta",
271  nintEta,
272  minEta,
273  maxEta,
274  phiRes_nbin,
276  phiRes_rangeMax));
277  phires_vs_pt.push_back(ibooker.book2D("phires_vs_pt",
278  "#phi Residual vs p_{T}",
279  nintPt,
280  minPt,
281  maxPt,
282  phiRes_nbin,
285  setBinLogX));
286  phires_vs_phi.push_back(ibooker.book2D("phires_vs_phi",
287  "#phi Residual vs #phi",
288  nintPhi,
289  minPhi,
290  maxPhi,
291  phiRes_nbin,
293  phiRes_rangeMax));
294  h_phipull.push_back(ibooker.book1D("phipull", "#phi Pull", 100, -10., 10.));
295  phipull_vs_eta.push_back(
296  ibooker.book2D("phipull_vs_eta", "#phi Pull vs #eta", nintEta, minEta, maxEta, 100, -10, 10));
297  phipull_vs_phi.push_back(
298  ibooker.book2D("phipull_vs_phi", "#phi Pull vs #phi", nintPhi, minPhi, maxPhi, 100, -10, 10));
299 
300  dxyres_vs_eta.push_back(ibooker.book2D("dxyres_vs_eta",
301  "dxy Residual vs #eta",
302  nintEta,
303  minEta,
304  maxEta,
305  dxyRes_nbin,
307  dxyRes_rangeMax));
308  dxyres_vs_pt.push_back(ibooker.book2D("dxyres_vs_pt",
309  "dxy Residual vs p_{T}",
310  nintPt,
311  minPt,
312  maxPt,
313  dxyRes_nbin,
316  setBinLogX));
317  h_dxypull.push_back(ibooker.book1D("dxypull", "dxy Pull", 100, -10., 10.));
318  dxypull_vs_eta.push_back(
319  ibooker.book2D("dxypull_vs_eta", "dxy Pull vs #eta", nintEta, minEta, maxEta, 100, -10, 10));
320 
321  dzres_vs_eta.push_back(ibooker.book2D(
322  "dzres_vs_eta", "dz Residual vs #eta", nintEta, minEta, maxEta, dzRes_nbin, dzRes_rangeMin, dzRes_rangeMax));
323  dzres_vs_pt.push_back(ibooker.book2D("dzres_vs_pt",
324  "dz Residual vs p_{T}",
325  nintPt,
326  minPt,
327  maxPt,
328  dzRes_nbin,
331  setBinLogX));
332  h_dzpull.push_back(ibooker.book1D("dzpull", "dz Pull", 100, -10., 10.));
333  dzpull_vs_eta.push_back(
334  ibooker.book2D("dzpull_vs_eta", "dz Pull vs #eta", nintEta, minEta, maxEta, 100, -10, 10));
335 
336  nRecHits_vs_nSimHits.push_back(ibooker.book2D(
337  "nRecHits_vs_nSimHits", "nRecHits vs nSimHits", nintNHit, minNHit, maxNHit, nintNHit, minNHit, maxNHit));
338 
339  if (MABH) {
340  h_PurityVsQuality.push_back(
341  ibooker.book2D("PurityVsQuality", "Purity vs Quality (MABH)", 20, 0.01, 1.01, 20, 0.01, 1.01));
342  }
343 
344  if (associators[ww] == "trackAssociatorByChi2") {
345  h_assochi2.push_back(ibooker.book1D("assocChi2", "track association #chi^{2}", 1000, 0., 100.));
346  h_assochi2_prob.push_back(ibooker.book1D("assocChi2_prob", "probability of association #chi^{2}", 100, 0., 1.));
347  } else if (associators[ww] == "trackAssociatorByHits") {
348  h_assocFraction.push_back(ibooker.book1D("assocFraction", "fraction of shared hits", 22, 0., 1.1));
349  h_assocSharedHit.push_back(ibooker.book1D("assocSharedHit", "number of shared hits", 41, -0.5, 40.5));
350  }
351 
352  } //for (unsigned int www=0;www<label.size();www++)
353  } //for (unsigned int ww=0;ww<associators.size();ww++)
354 }
std::vector< MonitorElement * > h_assoc2phi
std::vector< MonitorElement * > h_recoeta
std::vector< MonitorElement * > phipull_vs_phi
std::vector< MonitorElement * > h_assoc2hit
std::vector< MonitorElement * > h_PurityVsQuality
std::vector< MonitorElement * > h_etaRes
void setBinLogX(TH1 *h)
std::vector< MonitorElement * > h_misiddxy
std::vector< MonitorElement * > h_assochi2_prob
std::vector< MonitorElement * > h_recopT
std::vector< MonitorElement * > h_nchi2_prob
std::vector< MonitorElement * > dxyres_vs_eta
std::vector< MonitorElement * > h_assoc2dxy
std::vector< MonitorElement * > thetaCotres_vs_eta
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::vector< MonitorElement * > h_recohit
std::vector< MonitorElement * > dxyres_vs_pt
std::vector< MonitorElement * > h_fakes
std::vector< MonitorElement * > h_dxypull
std::vector< MonitorElement * > phires_vs_phi
std::vector< MonitorElement * > h_assoc2pu
def replace(string, replacements)
std::vector< MonitorElement * > h_nhits
std::vector< MonitorElement * > h_ptpull
std::vector< MonitorElement * > ptpull_vs_phi
std::vector< MonitorElement * > h_assoceta
std::vector< MonitorElement * > h_tracks
std::vector< MonitorElement * > nDThits_vs_eta
std::vector< MonitorElement * > dzres_vs_pt
std::vector< MonitorElement * > ptres_vs_eta
std::vector< MonitorElement * > h_simuldxy
std::vector< MonitorElement * > h_simuldz
std::vector< MonitorElement * > h_misiddz
std::vector< MonitorElement * > nhits_vs_eta
std::vector< MonitorElement * > nhits_vs_phi
std::vector< MonitorElement * > h_nchi2
std::vector< MonitorElement * > h_nmisslayers_inner
std::vector< MonitorElement * > h_qoverppull
std::vector< MonitorElement * > thetapull_vs_eta
std::vector< MonitorElement * > chi2_vs_nhits
std::vector< MonitorElement * > h_misidphi
std::vector< MonitorElement * > h_simulphi
std::vector< edm::InputTag > label
std::vector< MonitorElement * > h_assocSharedHit
std::vector< MonitorElement * > thetapull_vs_phi
std::vector< MonitorElement * > h_misidpu
std::vector< MonitorElement * > h_assoc2dz
std::vector< MonitorElement * > phires_vs_pt
std::vector< MonitorElement * > ptres_vs_phi
std::vector< MonitorElement * > h_assocZpos
std::vector< MonitorElement * > ptpull_vs_eta
std::vector< MonitorElement * > h_recophi
std::vector< MonitorElement * > nRecHits_vs_nSimHits
std::vector< MonitorElement * > dzres_vs_eta
std::vector< MonitorElement * > nME0hits_vs_eta
std::vector< MonitorElement * > h_simulRpos
std::vector< MonitorElement * > nTRK_LayersWithMeas_vs_eta
std::vector< MonitorElement * > chi2_vs_eta
std::vector< MonitorElement * > h_simulhit
std::vector< MonitorElement * > h_charge
std::vector< MonitorElement * > h_assocphi
std::vector< MonitorElement * > h_assocpT
std::vector< MonitorElement * > h_assocpu
std::vector< MonitorElement * > ptres_vs_pt
std::vector< MonitorElement * > h_simulpT
std::vector< MonitorElement * > dzpull_vs_eta
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
std::vector< MonitorElement * > h_recodz
std::vector< MonitorElement * > phires_vs_eta
std::vector< MonitorElement * > h_misideta
std::vector< MonitorElement * > nlosthits_vs_eta
std::vector< MonitorElement * > dxypull_vs_eta
std::vector< MonitorElement * > h_nlosthits
std::vector< MonitorElement * > etares_vs_eta
std::vector< MonitorElement * > h_misidhit
std::vector< MonitorElement * > h_nmisslayers_outer
std::vector< MonitorElement * > h_simulZpos
std::vector< MonitorElement * > h_recodxy
std::vector< MonitorElement * > h_recopu
std::vector< MonitorElement * > h_phipull
std::vector< MonitorElement * > h_assocdz
std::vector< MonitorElement * > thetaCotres_vs_pt
std::vector< MonitorElement * > h_dzpull
std::vector< MonitorElement * > nPixel_LayersWithMeas_vs_eta
std::vector< MonitorElement * > h_assoc2pT
std::vector< MonitorElement * > h_assochi2
std::vector< MonitorElement * > h_misidpT
std::vector< MonitorElement * > h_assocFraction
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::vector< MonitorElement * > chi2_vs_phi
std::vector< std::string > associators
std::vector< MonitorElement * > h_assocRpos
std::vector< MonitorElement * > h_assocdxy
std::vector< MonitorElement * > h_thetapull
std::vector< MonitorElement * > nRPChits_vs_eta
std::vector< MonitorElement * > h_simulpu
std::vector< MonitorElement * > h_assochit
std::vector< MonitorElement * > nGEMhits_vs_eta
std::vector< MonitorElement * > nCSChits_vs_eta
std::vector< MonitorElement * > h_simuleta
std::vector< MonitorElement * > phipull_vs_eta
std::vector< MonitorElement * > h_assoc2eta

Member Data Documentation

◆ _simHitTpMapTag

edm::EDGetTokenT<SimHitTPAssociationProducer::SimHitTPAssociationList> MuonTrackValidator::_simHitTpMapTag
private

Definition at line 169 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ associatormap

edm::InputTag MuonTrackValidator::associatormap
private

Definition at line 166 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ BiDirectional_RecoToSim_association

bool MuonTrackValidator::BiDirectional_RecoToSim_association
private

Definition at line 184 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ cosmicParametersDefinerTP_

std::unique_ptr<CosmicParametersDefinerForTP> MuonTrackValidator::cosmicParametersDefinerTP_
private

Definition at line 172 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ cosmictpSelector

CosmicTrackingParticleSelector MuonTrackValidator::cosmictpSelector
private

Definition at line 181 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ dirName_

std::string MuonTrackValidator::dirName_
private

Definition at line 165 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ lhcParametersDefinerTP_

std::unique_ptr<ParametersDefinerForTP> MuonTrackValidator::lhcParametersDefinerTP_
private

Definition at line 171 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ MABH

bool MuonTrackValidator::MABH
private

Definition at line 186 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ recoToSimCollection_Token

edm::EDGetTokenT<reco::RecoToSimCollection> MuonTrackValidator::recoToSimCollection_Token
private

Definition at line 168 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ simToRecoCollection_Token

edm::EDGetTokenT<reco::SimToRecoCollection> MuonTrackValidator::simToRecoCollection_Token
private

Definition at line 167 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ tpSelector

TrackingParticleSelector MuonTrackValidator::tpSelector
private

Definition at line 180 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ UseAssociators

bool MuonTrackValidator::UseAssociators
private

Definition at line 174 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ useGEMs_

bool MuonTrackValidator::useGEMs_
private

Definition at line 175 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().

◆ useME0_

bool MuonTrackValidator::useME0_
private

Definition at line 176 of file MuonTrackValidator.h.

Referenced by MuonTrackValidator().