CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Attributes | Private Attributes
RecoMuonValidator Class Reference

#include <RecoMuonValidator.h>

Inheritance diagram for RecoMuonValidator:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  CommonME
 
struct  HistoDimensions
 
struct  MuonME
 

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual int countMuonHits (const reco::Track &track) const
 
virtual int countTrackerHits (const reco::Track &track) const
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &eventSetup) override
 
void dqmEndRun (edm::Run const &, edm::EventSetup const &) override
 
 RecoMuonValidator (const edm::ParameterSet &pset)
 
 ~RecoMuonValidator () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Attributes

edm::InputTag beamspotLabel_
 
edm::EDGetTokenT< reco::BeamSpotbeamspotToken_
 
CommonMEcommonME_
 
DQMStoredbe_
 
bool doAbsEta_
 
bool doAssoc_
 
HistoDimensions hDim
 
edm::InputTag muAssocLabel_
 
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociatormuAssocToken_
 
edm::InputTag muonLabel_
 
MuonMEmuonME_
 
std::string muonSelection_
 
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
 
std::string outputFileName_
 
edm::InputTag primvertexLabel_
 
edm::EDGetTokenT< reco::VertexCollectionprimvertexToken_
 
edm::ParameterSet pset
 
edm::InputTag simLabel_
 
edm::EDGetTokenT< TrackingParticleCollectionsimToken_
 
std::string subDir_
 
std::string subsystemname_
 
MuonServiceProxytheMuonService
 
TrackingParticleSelector tpSelector_
 
reco::MuonTrackType trackType_
 
bool usePFMuon_
 
unsigned int verbose_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Private Attributes

StringCutObjectSelector< reco::Muonselector_
 
bool wantTightMuon_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 32 of file RecoMuonValidator.h.

Constructor & Destructor Documentation

RecoMuonValidator::RecoMuonValidator ( const edm::ParameterSet pset)

Definition at line 555 of file RecoMuonValidator.cc.

References beamspotLabel_, beamspotToken_, dbe_, RecoMuonValidator::HistoDimensions::doAbsEta, doAbsEta_, doAssoc_, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), reco::GlobalTk, hDim, reco::InnerTk, RecoMuonValidator::HistoDimensions::maxDxy, RecoMuonValidator::HistoDimensions::maxDz, RecoMuonValidator::HistoDimensions::maxErrDxy, RecoMuonValidator::HistoDimensions::maxErrDz, RecoMuonValidator::HistoDimensions::maxErrEta, RecoMuonValidator::HistoDimensions::maxErrP, RecoMuonValidator::HistoDimensions::maxErrPhi, RecoMuonValidator::HistoDimensions::maxErrPt, RecoMuonValidator::HistoDimensions::maxErrQPt, RecoMuonValidator::HistoDimensions::maxEta, RecoMuonValidator::HistoDimensions::maxP, RecoMuonValidator::HistoDimensions::maxPhi, RecoMuonValidator::HistoDimensions::maxPt, RecoMuonValidator::HistoDimensions::minDxy, RecoMuonValidator::HistoDimensions::minDz, RecoMuonValidator::HistoDimensions::minErrDxy, RecoMuonValidator::HistoDimensions::minErrDz, RecoMuonValidator::HistoDimensions::minErrEta, RecoMuonValidator::HistoDimensions::minErrP, RecoMuonValidator::HistoDimensions::minErrPhi, RecoMuonValidator::HistoDimensions::minErrPt, RecoMuonValidator::HistoDimensions::minErrQPt, RecoMuonValidator::HistoDimensions::minEta, RecoMuonValidator::HistoDimensions::minP, RecoMuonValidator::HistoDimensions::minPhi, RecoMuonValidator::HistoDimensions::minPt, muAssocLabel_, muAssocToken_, muonLabel_, MuonServiceProxy_cff::MuonServiceProxy, muonToken_, RecoMuonValidator::HistoDimensions::nAssoc, RecoMuonValidator::HistoDimensions::nBinDxy, RecoMuonValidator::HistoDimensions::nBinDz, RecoMuonValidator::HistoDimensions::nBinErr, RecoMuonValidator::HistoDimensions::nBinEta, RecoMuonValidator::HistoDimensions::nBinP, RecoMuonValidator::HistoDimensions::nBinPhi, RecoMuonValidator::HistoDimensions::nBinPt, RecoMuonValidator::HistoDimensions::nBinPull, RecoMuonValidator::HistoDimensions::nDof, RecoMuonValidator::HistoDimensions::nTrks, Utilities::operator, reco::OuterTk, outputFileName_, Pi, primvertexLabel_, primvertexToken_, reco::Segments, simLabel_, simToken_, AlCaHLTBitMon_QueryRunRegistry::string, subDir_, subsystemname_, theMuonService, tpSelector_, PbPb_ZMuSkimMuonDPG_cff::trackType, trackType_, RecoMuonValidator::HistoDimensions::usePFMuon, usePFMuon_, verbose_, wantTightMuon_, and RecoMuonValidator::HistoDimensions::wPull.

556  : selector_(pset.getParameter<std::string>("selection")) {
557  // pset=ps;
558  verbose_ = pset.getUntrackedParameter<unsigned int>("verbose", 0);
559 
560  outputFileName_ = pset.getUntrackedParameter<string>("outputFileName", "");
561 
562  wantTightMuon_ = pset.getParameter<bool>("wantTightMuon");
563  beamspotLabel_ = pset.getParameter<edm::InputTag>("beamSpot");
564  primvertexLabel_ = pset.getParameter<edm::InputTag>("primaryVertex");
565  beamspotToken_ = consumes<reco::BeamSpot>(beamspotLabel_);
566  primvertexToken_ = consumes<reco::VertexCollection>(primvertexLabel_);
567 
568  // Set histogram dimensions from config
569 
570  hDim.nBinP = pset.getUntrackedParameter<unsigned int>("nBinP");
571  hDim.minP = pset.getUntrackedParameter<double>("minP");
572  hDim.maxP = pset.getUntrackedParameter<double>("maxP");
573 
574  hDim.nBinPt = pset.getUntrackedParameter<unsigned int>("nBinPt");
575  hDim.minPt = pset.getUntrackedParameter<double>("minPt");
576  hDim.maxPt = pset.getUntrackedParameter<double>("maxPt");
577 
578  doAbsEta_ = pset.getUntrackedParameter<bool>("doAbsEta");
580  hDim.nBinEta = pset.getUntrackedParameter<unsigned int>("nBinEta");
581  hDim.minEta = pset.getUntrackedParameter<double>("minEta");
582  hDim.maxEta = pset.getUntrackedParameter<double>("maxEta");
583 
584  hDim.nBinDxy = pset.getUntrackedParameter<unsigned int>("nBinDxy");
585  hDim.minDxy = pset.getUntrackedParameter<double>("minDxy");
586  hDim.maxDxy = pset.getUntrackedParameter<double>("maxDxy");
587 
588  hDim.nBinDz = pset.getUntrackedParameter<unsigned int>("nBinDz");
589  hDim.minDz = pset.getUntrackedParameter<double>("minDz");
590  hDim.maxDz = pset.getUntrackedParameter<double>("maxDz");
591 
592  hDim.nBinPhi = pset.getUntrackedParameter<unsigned int>("nBinPhi");
593  hDim.minPhi = pset.getUntrackedParameter<double>("minPhi", -TMath::Pi());
594  hDim.maxPhi = pset.getUntrackedParameter<double>("maxPhi", TMath::Pi());
595 
596  hDim.nBinErr = pset.getUntrackedParameter<unsigned int>("nBinErr");
597  hDim.nBinPull = pset.getUntrackedParameter<unsigned int>("nBinPull");
598 
599  hDim.wPull = pset.getUntrackedParameter<double>("wPull");
600 
601  hDim.minErrP = pset.getUntrackedParameter<double>("minErrP");
602  hDim.maxErrP = pset.getUntrackedParameter<double>("maxErrP");
603 
604  hDim.minErrPt = pset.getUntrackedParameter<double>("minErrPt");
605  hDim.maxErrPt = pset.getUntrackedParameter<double>("maxErrPt");
606 
607  hDim.minErrQPt = pset.getUntrackedParameter<double>("minErrQPt");
608  hDim.maxErrQPt = pset.getUntrackedParameter<double>("maxErrQPt");
609 
610  hDim.minErrEta = pset.getUntrackedParameter<double>("minErrEta");
611  hDim.maxErrEta = pset.getUntrackedParameter<double>("maxErrEta");
612 
613  hDim.minErrPhi = pset.getUntrackedParameter<double>("minErrPhi");
614  hDim.maxErrPhi = pset.getUntrackedParameter<double>("maxErrPhi");
615 
616  hDim.minErrDxy = pset.getUntrackedParameter<double>("minErrDxy");
617  hDim.maxErrDxy = pset.getUntrackedParameter<double>("maxErrDxy");
618 
619  hDim.minErrDz = pset.getUntrackedParameter<double>("minErrDz");
620  hDim.maxErrDz = pset.getUntrackedParameter<double>("maxErrDz");
621 
622  hDim.nTrks = pset.getUntrackedParameter<unsigned int>("nTrks");
623  hDim.nAssoc = pset.getUntrackedParameter<unsigned int>("nAssoc");
624  hDim.nDof = pset.getUntrackedParameter<unsigned int>("nDof", 55);
625 
626  // Labels for simulation and reconstruction tracks
627  simLabel_ = pset.getParameter<InputTag>("simLabel");
628  muonLabel_ = pset.getParameter<InputTag>("muonLabel");
629  simToken_ = consumes<TrackingParticleCollection>(simLabel_);
630  muonToken_ = consumes<edm::View<reco::Muon> >(muonLabel_);
631 
632  // Labels for sim-reco association
633  doAssoc_ = pset.getUntrackedParameter<bool>("doAssoc", true);
634  muAssocLabel_ = pset.getParameter<InputTag>("muAssocLabel");
635  if (doAssoc_) {
636  muAssocToken_ = consumes<reco::MuonToTrackingParticleAssociator>(muAssocLabel_);
637  }
638 
639  // Different momentum assignment and additional histos in case of PF muons
640  usePFMuon_ = pset.getUntrackedParameter<bool>("usePFMuon");
642 
643  //type of track
644  std::string trackType = pset.getParameter<std::string>("trackType");
645  if (trackType == "inner")
647  else if (trackType == "outer")
649  else if (trackType == "global")
651  else if (trackType == "segments")
653  else
654  throw cms::Exception("Configuration") << "Track type '" << trackType << "' not supported.\n";
655 
656  // seedPropagatorName_ = pset.getParameter<string>("SeedPropagator");
657 
658  ParameterSet tpset = pset.getParameter<ParameterSet>("tpSelector");
659  tpSelector_ = TrackingParticleSelector(tpset.getParameter<double>("ptMin"),
660  tpset.getParameter<double>("ptMax"),
661  tpset.getParameter<double>("minRapidity"),
662  tpset.getParameter<double>("maxRapidity"),
663  tpset.getParameter<double>("tip"),
664  tpset.getParameter<double>("lip"),
665  tpset.getParameter<int>("minHit"),
666  tpset.getParameter<bool>("signalOnly"),
667  tpset.getParameter<bool>("intimeOnly"),
668  tpset.getParameter<bool>("chargedOnly"),
669  tpset.getParameter<bool>("stableOnly"),
670  tpset.getParameter<std::vector<int> >("pdgId"));
671 
672  // the service parameters
673  ParameterSet serviceParameters = pset.getParameter<ParameterSet>("ServiceParameters");
674  theMuonService = new MuonServiceProxy(serviceParameters);
675 
676  // retrieve the instance of DQMService
678  subsystemname_ = pset.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem");
679 
680  subDir_ = pset.getUntrackedParameter<string>("subDir");
681  if (subDir_.empty())
682  subDir_ = "RecoMuonV";
683  if (subDir_[subDir_.size() - 1] == '/')
684  subDir_.erase(subDir_.size() - 1);
685 }
const double Pi
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
edm::EDGetTokenT< TrackingParticleCollection > simToken_
edm::InputTag simLabel_
StringCutObjectSelector< reco::Muon > selector_
reco::MuonTrackType trackType_
edm::EDGetTokenT< reco::VertexCollection > primvertexToken_
TrackingParticleSelector tpSelector_
MuonServiceProxy * theMuonService
edm::InputTag muAssocLabel_
HistoDimensions hDim
std::string outputFileName_
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
unsigned int verbose_
edm::InputTag muonLabel_
std::string subsystemname_
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociator > muAssocToken_
edm::InputTag beamspotLabel_
edm::InputTag primvertexLabel_
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
RecoMuonValidator::~RecoMuonValidator ( )
override

Definition at line 795 of file RecoMuonValidator.cc.

References theMuonService.

795  {
796  if (theMuonService)
797  delete theMuonService;
798 }
MuonServiceProxy * theMuonService

Member Function Documentation

void RecoMuonValidator::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
override

Definition at line 820 of file RecoMuonValidator.cc.

References reco::MuonToTrackingParticleAssociator::associateMuons(), beamspotToken_, reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), edm::View< T >::begin(), commonME_, funct::cos(), countMuonHits(), countTrackerHits(), doAbsEta_, doAssoc_, edm::View< T >::end(), relativeConstraints::error, dqm::impl::MonitorElement::Fill(), RecoMuonValidator::MuonME::fill(), edm::Ref< C, T, F >::get(), RecoMuonValidator::CommonME::hMuonAllEta_, RecoMuonValidator::CommonME::hMuonAllP_, RecoMuonValidator::CommonME::hMuonAllPhi_, RecoMuonValidator::CommonME::hMuonAllPt_, RecoMuonValidator::CommonME::hMuonEta_, RecoMuonValidator::CommonME::hMuonP_, RecoMuonValidator::CommonME::hMuonPhi_, RecoMuonValidator::CommonME::hMuonPt_, RecoMuonValidator::CommonME::hMuonTrackDxy_, RecoMuonValidator::CommonME::hMuonTrackDz_, RecoMuonValidator::CommonME::hMuonTrackEta_, RecoMuonValidator::CommonME::hMuonTrackP_, RecoMuonValidator::CommonME::hMuonTrackPhi_, RecoMuonValidator::CommonME::hMuonTrackPt_, RecoMuonValidator::CommonME::hNDeltaInvalidHitsHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsGTHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsITHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsOTHitPattern_, RecoMuonValidator::MuonME::hNMuon_, RecoMuonValidator::MuonME::hNMuonHits_, RecoMuonValidator::MuonME::hNMuonHits_vs_Eta_, RecoMuonValidator::MuonME::hNMuonHits_vs_Pt_, RecoMuonValidator::MuonME::hNSim_, RecoMuonValidator::MuonME::hNSimHits_, RecoMuonValidator::MuonME::hNSimToReco_, RecoMuonValidator::MuonME::hNTrackerHits_, RecoMuonValidator::MuonME::hNTrackerHits_vs_Eta_, RecoMuonValidator::MuonME::hNTrackerHits_vs_Pt_, RecoMuonValidator::MuonME::hNTrksEta_, RecoMuonValidator::MuonME::hNTrksPt_, RecoMuonValidator::MuonME::hSimDxy_, RecoMuonValidator::MuonME::hSimDz_, RecoMuonValidator::MuonME::hSimEta_, RecoMuonValidator::MuonME::hSimP_, RecoMuonValidator::MuonME::hSimPhi_, RecoMuonValidator::MuonME::hSimPt_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHits_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsEta_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsPt_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHits_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsEta_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsPt_, mps_fire::i, edm::Ref< C, T, F >::isNonnull(), muon::isTightMuon(), Mu, muAssocToken_, HLTObjectMonitor_cfi::muonEta, muonME_, HLTObjectMonitor_cfi::muonPhi, HLTObjectMonitor_cfi::muonPt, HLTTauDQMOffline_cfi::Muons, muonToken_, reco::BeamSpot::position(), position, primvertexToken_, edm::Handle< T >::product(), edm::RefToBaseVector< T >::push_back(), edm::RefVector< C, T, F >::push_back(), selector_, reco::BeamSpot::sigmaZ(), simToken_, funct::sin(), edm::View< T >::size(), tpSelector_, trackType_, usePFMuon_, wantTightMuon_, and PV3DBase< T, PVType, FrameType >::x().

820  {
821  // Look for the Primary Vertex (and use the BeamSpot instead, if you can't find it):
822  reco::Vertex::Point posVtx;
823  reco::Vertex::Error errVtx;
825  event.getByToken(primvertexToken_, recVtxs);
826  unsigned int theIndexOfThePrimaryVertex = 999.;
827  for (unsigned int ind = 0; ind < recVtxs->size(); ++ind) {
828  if ((*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake())) {
829  theIndexOfThePrimaryVertex = ind;
830  break;
831  }
832  }
833  if (theIndexOfThePrimaryVertex < 100) {
834  posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).position();
835  errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).error();
836  } else {
837  LogInfo("RecoMuonValidator") << "reco::PrimaryVertex not found, use BeamSpot position instead\n";
838  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
839  event.getByToken(beamspotToken_, recoBeamSpotHandle);
840  reco::BeamSpot bs = *recoBeamSpotHandle;
841  posVtx = bs.position();
842  errVtx(0, 0) = bs.BeamWidthX();
843  errVtx(1, 1) = bs.BeamWidthY();
844  errVtx(2, 2) = bs.sigmaZ();
845  }
846  const reco::Vertex thePrimaryVertex(posVtx, errVtx);
847 
848  // Get TrackingParticles
850  event.getByToken(simToken_, simHandle);
851  const TrackingParticleCollection simColl = *(simHandle.product());
852 
853  // Get Muons
854  Handle<edm::View<Muon> > muonHandle;
855  event.getByToken(muonToken_, muonHandle);
856  View<Muon> muonColl = *(muonHandle.product());
857 
858  reco::MuonToTrackingParticleAssociator const* assoByHits = nullptr;
859  if (doAssoc_) {
861  event.getByToken(muAssocToken_, associatorBase);
862  assoByHits = associatorBase.product();
863  }
864 
865  const TrackingParticleCollection::size_type nSim = simColl.size();
866 
868  for (size_t i = 0; i < muonHandle->size(); ++i) {
869  Muons.push_back(muonHandle->refAt(i));
870  }
871 
873  for (size_t i = 0; i < nSim; ++i) {
874  allTPs.push_back(TrackingParticleRef(simHandle, i));
875  }
876 
877  muonME_->hNSim_->Fill(nSim);
878  muonME_->hNMuon_->Fill(muonColl.size());
879 
880  reco::MuonToSimCollection muonToSimColl;
881  reco::SimToMuonCollection simToMuonColl;
882 
883  if (doAssoc_) {
884  assoByHits->associateMuons(muonToSimColl, simToMuonColl, Muons, trackType_, allTPs);
885  } else {
886  /*
887  // SimToMuon associations
888  Handle<reco::RecoToSimCollection> simToTrkMuHandle;
889  event.getByLabel(trkMuAssocLabel_, simToTrkMuHandle);
890  trkSimRecColl = *(simToTrkMuHandle.product());
891 
892  Handle<reco::RecoToSimCollection> simToStaMuHandle;
893  event.getByLabel(staMuAssocLabel_, simToStaMuHandle);
894  staSimRecColl = *(simToStaMuHandle.product());
895 
896  Handle<reco::RecoToSimCollection> simToGlbMuHandle;
897  event.getByLabel(glbMuAssocLabel_, simToGlbMuHandle);
898  glbSimRecColl = *(simToGlbMuHandle.product());
899 
900  // MuonToSim associations
901  Handle<reco::SimToRecoCollection> trkMuToSimHandle;
902  event.getByLabel(trkMuAssocLabel_, trkMuToSimHandle);
903  trkRecSimColl = *(trkMuToSimHandle.product());
904 
905  Handle<reco::SimToRecoCollection> staMuToSimHandle;
906  event.getByLabel(staMuAssocLabel_, staMuToSimHandle);
907  staRecSimColl = *(staMuToSimHandle.product());
908 
909  Handle<reco::SimToRecoCollection> glbMuToSimHandle;
910  event.getByLabel(glbMuAssocLabel_, glbMuToSimHandle);
911  glbRecSimColl = *(glbMuToSimHandle.product());
912 */
913  }
914 
915  int glbNTrackerHits = 0;
916  int trkNTrackerHits = 0;
917  int glbNMuonHits = 0;
918  int staNMuonHits = 0;
919  int NTrackerHits = 0;
920  int NMuonHits = 0;
921 
922  // Analyzer reco::Muon
923  for (View<Muon>::const_iterator iMuon = muonColl.begin(); iMuon != muonColl.end(); ++iMuon) {
924  double muonP, muonPt, muonEta, muonPhi;
925  if (usePFMuon_) {
926  muonP = iMuon->pfP4().P();
927  muonPt = iMuon->pfP4().Pt();
928  muonEta = iMuon->pfP4().Eta();
929  muonPhi = iMuon->pfP4().Phi();
930  } else {
931  muonP = iMuon->p();
932  muonPt = iMuon->pt();
933  muonEta = iMuon->eta();
934  muonPhi = iMuon->phi();
935  }
936 
937  //histograms for fractions
938  commonME_->hMuonAllP_->Fill(muonP);
939  commonME_->hMuonAllPt_->Fill(muonPt);
940  commonME_->hMuonAllEta_->Fill(muonEta);
941  commonME_->hMuonAllPhi_->Fill(muonPhi);
942 
943  if (!selector_(*iMuon))
944  continue;
945  if (wantTightMuon_) {
946  if (!muon::isTightMuon(*iMuon, thePrimaryVertex))
947  continue;
948  }
949 
950  TrackRef Track = iMuon->track();
951 
952  if (Track.isNonnull()) {
953  commonME_->hMuonTrackP_->Fill(Track->p());
954  commonME_->hMuonTrackPt_->Fill(Track->pt());
955  commonME_->hMuonTrackEta_->Fill(Track->eta());
956  commonME_->hMuonTrackPhi_->Fill(Track->phi());
957 
958  //ip histograms
959  commonME_->hMuonTrackDxy_->Fill(Track->dxy());
960  commonME_->hMuonTrackDz_->Fill(Track->dz());
961  }
962 
963  if (iMuon->isGlobalMuon()) {
964  Track = iMuon->combinedMuon();
965  glbNTrackerHits = countTrackerHits(*Track);
966  glbNMuonHits = countMuonHits(*Track);
967  } else if (iMuon->isTrackerMuon()) {
968  Track = iMuon->track();
969  trkNTrackerHits = countTrackerHits(*Track);
970  } else {
971  Track = iMuon->standAloneMuon();
972  }
973 
974  NTrackerHits = countTrackerHits(*Track);
975  muonME_->hNTrackerHits_->Fill(NTrackerHits);
976  muonME_->hNTrackerHits_vs_Pt_->Fill(Track->pt(), NTrackerHits);
977  muonME_->hNTrackerHits_vs_Eta_->Fill(Track->eta(), NTrackerHits);
978 
979  NMuonHits = countMuonHits(*Track);
980  muonME_->hNMuonHits_->Fill(NMuonHits);
981  muonME_->hNMuonHits_vs_Pt_->Fill(Track->pt(), NMuonHits);
982  muonME_->hNMuonHits_vs_Eta_->Fill(Track->eta(), NMuonHits);
983 
984  //list of histos for each type
985 
986  // muonME_->hNTrks_->Fill();
987  muonME_->hNTrksEta_->Fill(Track->eta());
988  muonME_->hNTrksPt_->Fill(Track->pt());
989 
990  commonME_->hMuonP_->Fill(muonP);
991  commonME_->hMuonPt_->Fill(muonPt);
992  commonME_->hMuonEta_->Fill(muonEta);
993  commonME_->hMuonPhi_->Fill(muonPhi);
994 
995  if (iMuon->isGlobalMuon()) {
996  double gtHitPat = iMuon->globalTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
997  iMuon->globalTrack()->hitPattern().numberOfValidHits();
998 
999  double itHitPat = iMuon->innerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
1000  iMuon->innerTrack()->hitPattern().numberOfValidHits();
1001 
1002  double otHitPat = iMuon->outerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
1003  iMuon->outerTrack()->hitPattern().numberOfValidHits();
1004 
1008  commonME_->hNDeltaInvalidHitsHitPattern_->Fill(gtHitPat - itHitPat - otHitPat);
1009 
1010  //must be global and standalone
1011  if (iMuon->isStandAloneMuon()) {
1012  commonME_->hStaToGlbDiffNMuonHitsEta_->Fill(Track->eta(), staNMuonHits - glbNMuonHits);
1013  commonME_->hStaToGlbDiffNMuonHitsPt_->Fill(Track->pt(), staNMuonHits - glbNMuonHits);
1014  commonME_->hStaToGlbDiffNMuonHits_->Fill(staNMuonHits - glbNMuonHits);
1015  }
1016 
1017  //must be global and tracker
1018  if (iMuon->isTrackerMuon()) {
1019  commonME_->hTrkToGlbDiffNTrackerHitsEta_->Fill(Track->eta(), trkNTrackerHits - glbNTrackerHits);
1020  commonME_->hTrkToGlbDiffNTrackerHitsPt_->Fill(Track->pt(), trkNTrackerHits - glbNTrackerHits);
1021  commonME_->hTrkToGlbDiffNTrackerHits_->Fill(trkNTrackerHits - glbNTrackerHits);
1022  }
1023  }
1024 
1025  } //end of reco muon loop
1026 
1027  // Associate by hits
1028  for (TrackingParticleCollection::size_type i = 0; i < nSim; i++) {
1029  TrackingParticleRef simRef(simHandle, i);
1030  const TrackingParticle* simTP = simRef.get();
1031  if (!tpSelector_(*simTP))
1032  continue;
1033 
1034  //denominators for efficiency plots
1035  const double simP = simRef->p();
1036  const double simPt = simRef->pt();
1037  const double simEta = doAbsEta_ ? fabs(simRef->eta()) : simRef->eta();
1038  const double simPhi = simRef->phi();
1039 
1040  GlobalPoint simVtx(simRef->vertex().x(), simRef->vertex().y(), simRef->vertex().z());
1041  GlobalVector simMom(simRef->momentum().x(), simRef->momentum().y(), simRef->momentum().z());
1042  const double simDxy = -simVtx.x() * sin(simPhi) + simVtx.y() * cos(simPhi);
1043  const double simDz = simVtx.z() - (simVtx.x() * simMom.x() + simVtx.y() * simMom.y()) * simMom.z() / simMom.perp2();
1044 
1045  const unsigned int nSimHits = simRef->numberOfHits();
1046 
1047  muonME_->hSimP_->Fill(simP);
1048  muonME_->hSimPt_->Fill(simPt);
1049  muonME_->hSimEta_->Fill(simEta);
1050  muonME_->hSimPhi_->Fill(simPhi);
1051  muonME_->hSimDxy_->Fill(simDxy);
1052  muonME_->hSimDz_->Fill(simDz);
1053  muonME_->hNSimHits_->Fill(nSimHits);
1054 
1055  // Get sim-reco association for a simRef
1056  vector<pair<RefToBase<Muon>, double> > MuRefV;
1057  if (simToMuonColl.find(simRef) != simToMuonColl.end()) {
1058  MuRefV = simToMuonColl[simRef];
1059 
1060  if (!MuRefV.empty()) {
1061  muonME_->hNSimToReco_->Fill(MuRefV.size());
1062  const Muon* Mu = MuRefV.begin()->first.get();
1063  if (!selector_(*Mu))
1064  continue;
1065  if (wantTightMuon_) {
1066  if (!muon::isTightMuon(*Mu, thePrimaryVertex))
1067  continue;
1068  }
1069 
1070  muonME_->fill(&*simTP, Mu);
1071  }
1072  }
1073  }
1074 }
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
edm::EDGetTokenT< TrackingParticleCollection > simToken_
std::map< edm::RefToBase< reco::Muon >, std::vector< std::pair< TrackingParticleRef, double > >, RefToBaseSort > MuonToSimCollection
Definition: MuonTrackType.h:37
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
std::vector< TrackingParticle > TrackingParticleCollection
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
StringCutObjectSelector< reco::Muon > selector_
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
size_type size() const
reco::MuonTrackType trackType_
edm::EDGetTokenT< reco::VertexCollection > primvertexToken_
virtual int countTrackerHits(const reco::Track &track) const
uint16_t size_type
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
Definition: MuonTrackType.h:38
void Fill(long long x)
TrackingParticleSelector tpSelector_
const_iterator begin() const
Definition: Muon.py:1
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void associateMuons(MuonToSimCollection &recoToSim, SimToMuonCollection &simToReco, const edm::RefToBaseVector< reco::Muon > &muons, MuonTrackType type, const edm::RefVector< TrackingParticleCollection > &tpColl) const
virtual int countMuonHits(const reco::Track &track) const
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
double p() const
Magnitude of momentum vector. Note this is taken from the first SimTrack only.
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:82
void fill(const TrackingParticle *simRef, const Muon *muonRef)
Definition: L1GtObject.h:29
T const * product() const
Definition: Handle.h:69
double sigmaZ() const
sigma z
Definition: BeamSpot.h:76
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:84
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
static int position[264][3]
Definition: ReadPGInfo.cc:289
void push_back(const RefToBase< T > &)
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociator > muAssocToken_
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
Monte Carlo truth information used for tracking validation.
const Point & position() const
position
Definition: BeamSpot.h:59
const_iterator end() const
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
T x() const
Definition: PV3DBase.h:59
edm::Ref< TrackingParticleCollection > TrackingParticleRef
void RecoMuonValidator::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 687 of file RecoMuonValidator.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), RecoMuonValidator::MuonME::bookHistos(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), commonME_, hDim, RecoMuonValidator::CommonME::hMuonAllEta_, RecoMuonValidator::CommonME::hMuonAllP_, RecoMuonValidator::CommonME::hMuonAllPhi_, RecoMuonValidator::CommonME::hMuonAllPt_, RecoMuonValidator::CommonME::hMuonEta_, RecoMuonValidator::CommonME::hMuonP_, RecoMuonValidator::CommonME::hMuonPhi_, RecoMuonValidator::CommonME::hMuonPt_, RecoMuonValidator::CommonME::hMuonTrackDxy_, RecoMuonValidator::CommonME::hMuonTrackDz_, RecoMuonValidator::CommonME::hMuonTrackEta_, RecoMuonValidator::CommonME::hMuonTrackP_, RecoMuonValidator::CommonME::hMuonTrackPhi_, RecoMuonValidator::CommonME::hMuonTrackPt_, RecoMuonValidator::CommonME::hNDeltaInvalidHitsHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsGTHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsITHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsOTHitPattern_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHits_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsEta_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsPt_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHits_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsEta_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsPt_, RecoMuonValidator::HistoDimensions::maxDxy, RecoMuonValidator::HistoDimensions::maxDz, RecoMuonValidator::HistoDimensions::maxEta, RecoMuonValidator::HistoDimensions::maxP, RecoMuonValidator::HistoDimensions::maxPhi, RecoMuonValidator::HistoDimensions::maxPt, RecoMuonValidator::HistoDimensions::minDxy, RecoMuonValidator::HistoDimensions::minDz, RecoMuonValidator::HistoDimensions::minEta, RecoMuonValidator::HistoDimensions::minP, RecoMuonValidator::HistoDimensions::minPhi, RecoMuonValidator::HistoDimensions::minPt, muonME_, RecoMuonValidator::HistoDimensions::nBinDxy, RecoMuonValidator::HistoDimensions::nBinDz, RecoMuonValidator::HistoDimensions::nBinEta, RecoMuonValidator::HistoDimensions::nBinP, RecoMuonValidator::HistoDimensions::nBinPhi, RecoMuonValidator::HistoDimensions::nBinPt, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), and subDir_.

689  {
690  // book histograms
691  ibooker.cd();
692 
693  ibooker.setCurrentFolder(subDir_);
694 
695  commonME_ = new CommonME;
696  muonME_ = new MuonME;
697 
698  //commonME
699  const int nHits = 100;
700 
701  // - diffs
702  commonME_->hTrkToGlbDiffNTrackerHits_ = ibooker.book1D("TrkGlbDiffNTrackerHits",
703  "Difference of number of tracker hits (tkMuon - globalMuon)",
704  2 * nHits + 1,
705  -nHits - 0.5,
706  nHits + 0.5);
707  commonME_->hStaToGlbDiffNMuonHits_ = ibooker.book1D("StaGlbDiffNMuonHits",
708  "Difference of number of muon hits (staMuon - globalMuon)",
709  2 * nHits + 1,
710  -nHits - 0.5,
711  nHits + 0.5);
712 
714  ibooker.book2D("TrkGlbDiffNTrackerHitsEta",
715  "Difference of number of tracker hits (tkMuon - globalMuon)",
716  hDim.nBinEta,
717  hDim.minEta,
718  hDim.maxEta,
719  2 * nHits + 1,
720  -nHits - 0.5,
721  nHits + 0.5);
722  commonME_->hStaToGlbDiffNMuonHitsEta_ = ibooker.book2D("StaGlbDiffNMuonHitsEta",
723  "Difference of number of muon hits (staMuon - globalMuon)",
724  hDim.nBinEta,
725  hDim.minEta,
726  hDim.maxEta,
727  2 * nHits + 1,
728  -nHits - 0.5,
729  nHits + 0.5);
730 
731  commonME_->hTrkToGlbDiffNTrackerHitsPt_ = ibooker.book2D("TrkGlbDiffNTrackerHitsPt",
732  "Difference of number of tracker hits (tkMuon - globalMuon)",
733  hDim.nBinPt,
734  hDim.minPt,
735  hDim.maxPt,
736  2 * nHits + 1,
737  -nHits - 0.5,
738  nHits + 0.5);
739  commonME_->hStaToGlbDiffNMuonHitsPt_ = ibooker.book2D("StaGlbDiffNMuonHitsPt",
740  "Difference of number of muon hits (staMuon - globalMuon)",
741  hDim.nBinPt,
742  hDim.minPt,
743  hDim.maxPt,
744  2 * nHits + 1,
745  -nHits - 0.5,
746  nHits + 0.5);
747 
748  // -global muon hit pattern
749  commonME_->hNInvalidHitsGTHitPattern_ = ibooker.book1D(
750  "NInvalidHitsGTHitPattern", "Number of invalid hits on a global track", nHits + 1, -0.5, nHits + 0.5);
751  commonME_->hNInvalidHitsITHitPattern_ = ibooker.book1D(
752  "NInvalidHitsITHitPattern", "Number of invalid hits on an inner track", nHits + 1, -0.5, nHits + 0.5);
753  commonME_->hNInvalidHitsOTHitPattern_ = ibooker.book1D(
754  "NInvalidHitsOTHitPattern", "Number of invalid hits on an outer track", nHits + 1, -0.5, nHits + 0.5);
756  ibooker.book1D("hNDeltaInvalidHitsHitPattern",
757  "The discrepancy for Number of invalid hits on an global track and inner and outer tracks",
758  2 * nHits + 1,
759  -nHits - 0.5,
760  nHits + 0.5);
761 
762  //muon based kinematics
763  commonME_->hMuonP_ = ibooker.book1D("PMuon", "p of muon", hDim.nBinP, hDim.minP, hDim.maxP);
764  commonME_->hMuonPt_ = ibooker.book1D("PtMuon", "p_{T} of muon", hDim.nBinPt, hDim.minPt, hDim.maxPt);
765  commonME_->hMuonEta_ = ibooker.book1D("EtaMuon", "#eta of muon", hDim.nBinEta, hDim.minEta, hDim.maxEta);
766  commonME_->hMuonPhi_ = ibooker.book1D("PhiMuon", "#phi of muon", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
767  //track based kinematics
768  commonME_->hMuonTrackP_ = ibooker.book1D("PMuonTrack", "p of reco muon track", hDim.nBinP, hDim.minP, hDim.maxP);
770  ibooker.book1D("PtMuonTrack", "p_{T} of reco muon track", hDim.nBinPt, hDim.minPt, hDim.maxPt);
772  ibooker.book1D("EtaMuonTrack", "#eta of reco muon track", hDim.nBinEta, hDim.minEta, hDim.maxEta);
774  ibooker.book1D("PhiMuonTrack", "#phi of reco muon track", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
776  ibooker.book1D("DxyMuonTrack", "Dxy of reco muon track", hDim.nBinDxy, hDim.minDxy, hDim.maxDxy);
778  ibooker.book1D("DzMuonTrack", "Dz of reco muon track", hDim.nBinDz, hDim.minDz, hDim.maxDz);
779 
780  //histograms for fractions
781  commonME_->hMuonAllP_ = ibooker.book1D("PMuonAll", "p of muons of all types", hDim.nBinP, hDim.minP, hDim.maxP);
783  ibooker.book1D("PtMuonAll", "p_{T} of muon of all types", hDim.nBinPt, hDim.minPt, hDim.maxPt);
785  ibooker.book1D("EtaMuonAll", "#eta of muon of all types", hDim.nBinEta, hDim.minEta, hDim.maxEta);
787  ibooker.book1D("PhiMuonAll", "#phi of muon of all types", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
788 
789  muonME_->bookHistos(ibooker, subDir_, hDim);
790 }
HistoDimensions hDim
void bookHistos(DQMStore::IBooker &ibooker, const string &dirName, const HistoDimensions &hDim)
int RecoMuonValidator::countMuonHits ( const reco::Track track) const
virtual

Definition at line 1076 of file RecoMuonValidator.cc.

References KineDebug3::count(), DetId::det(), DetId::Muon, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), and mps_fire::result.

Referenced by analyze().

1076  {
1078 
1079  int count = 0;
1080 
1081  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
1082  if ((*hit)->isValid()) {
1083  DetId recoid = (*hit)->geographicalId();
1084  if (recoid.det() == DetId::Muon)
1085  count++;
1086  }
1087  }
1088  return count;
1089 }
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:17
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91
int RecoMuonValidator::countTrackerHits ( const reco::Track track) const
virtual

Definition at line 1091 of file RecoMuonValidator.cc.

References KineDebug3::count(), DetId::det(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), mps_fire::result, and DetId::Tracker.

Referenced by analyze().

1091  {
1093 
1094  int count = 0;
1095 
1096  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
1097  if ((*hit)->isValid()) {
1098  DetId recoid = (*hit)->geographicalId();
1099  if (recoid.det() == DetId::Tracker)
1100  count++;
1101  }
1102  }
1103  return count;
1104 }
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:17
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91
void RecoMuonValidator::dqmBeginRun ( const edm::Run ,
const edm::EventSetup eventSetup 
)
override

Definition at line 804 of file RecoMuonValidator.cc.

References theMuonService.

804  {
805  if (theMuonService)
806  theMuonService->update(eventSetup);
807 }
MuonServiceProxy * theMuonService
void RecoMuonValidator::dqmEndRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 812 of file RecoMuonValidator.cc.

References dbe_, outputFileName_, and dqm::dqmstoreimpl::DQMStore::save().

812  {
813  if (dbe_ && !outputFileName_.empty())
815 }
std::string outputFileName_
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
Definition: DQMStore.cc:2244

Member Data Documentation

edm::InputTag RecoMuonValidator::beamspotLabel_
protected

Definition at line 56 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<reco::BeamSpot> RecoMuonValidator::beamspotToken_
protected

Definition at line 58 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

CommonME* RecoMuonValidator::commonME_
protected

Definition at line 81 of file RecoMuonValidator.h.

Referenced by analyze(), and bookHistograms().

DQMStore* RecoMuonValidator::dbe_
protected

Definition at line 67 of file RecoMuonValidator.h.

Referenced by dqmEndRun(), and RecoMuonValidator().

bool RecoMuonValidator::doAbsEta_
protected

Definition at line 69 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

bool RecoMuonValidator::doAssoc_
protected

Definition at line 70 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

HistoDimensions RecoMuonValidator::hDim
protected

Definition at line 127 of file RecoMuonValidator.h.

Referenced by bookHistograms(), and RecoMuonValidator().

edm::InputTag RecoMuonValidator::muAssocLabel_
protected

Definition at line 53 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<reco::MuonToTrackingParticleAssociator> RecoMuonValidator::muAssocToken_
protected

Definition at line 54 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

edm::InputTag RecoMuonValidator::muonLabel_
protected

Definition at line 48 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

MuonME* RecoMuonValidator::muonME_
protected

Definition at line 78 of file RecoMuonValidator.h.

Referenced by analyze(), and bookHistograms().

std::string RecoMuonValidator::muonSelection_
protected

Definition at line 49 of file RecoMuonValidator.h.

edm::EDGetTokenT<edm::View<reco::Muon> > RecoMuonValidator::muonToken_
protected

Definition at line 51 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

std::string RecoMuonValidator::outputFileName_
protected

Definition at line 61 of file RecoMuonValidator.h.

Referenced by dqmEndRun(), and RecoMuonValidator().

edm::InputTag RecoMuonValidator::primvertexLabel_
protected

Definition at line 57 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<reco::VertexCollection> RecoMuonValidator::primvertexToken_
protected

Definition at line 59 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

edm::ParameterSet RecoMuonValidator::pset
protected

Definition at line 64 of file RecoMuonValidator.h.

StringCutObjectSelector<reco::Muon> RecoMuonValidator::selector_
private

Definition at line 130 of file RecoMuonValidator.h.

Referenced by analyze().

edm::InputTag RecoMuonValidator::simLabel_
protected

Definition at line 47 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<TrackingParticleCollection> RecoMuonValidator::simToken_
protected

Definition at line 50 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

std::string RecoMuonValidator::subDir_
protected

Definition at line 62 of file RecoMuonValidator.h.

Referenced by bookHistograms(), and RecoMuonValidator().

std::string RecoMuonValidator::subsystemname_
protected

Definition at line 63 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

MuonServiceProxy* RecoMuonValidator::theMuonService
protected

Definition at line 66 of file RecoMuonValidator.h.

Referenced by dqmBeginRun(), RecoMuonValidator(), and ~RecoMuonValidator().

TrackingParticleSelector RecoMuonValidator::tpSelector_
protected

Definition at line 73 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

reco::MuonTrackType RecoMuonValidator::trackType_
protected

Definition at line 76 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

bool RecoMuonValidator::usePFMuon_
protected

Definition at line 71 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

unsigned int RecoMuonValidator::verbose_
protected

Definition at line 45 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

bool RecoMuonValidator::wantTightMuon_
private

Definition at line 131 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().