CMS 3D CMS Logo

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

#include <RecoDisplacedMuonValidator.h>

Inheritance diagram for RecoDisplacedMuonValidator:
DQMOneEDAnalyzer<> edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > 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
 
 RecoDisplacedMuonValidator (const edm::ParameterSet &pset)
 
 ~RecoDisplacedMuonValidator () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer<>
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
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::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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_
 
bool tpRefVector
 
edm::EDGetTokenT< TrackingParticleRefVectortpRefVectorToken_
 
TrackingParticleSelector tpSelector_
 
reco::MuonTrackType trackType_
 
bool usePFMuon_
 
unsigned int verbose_
 
- Protected Attributes inherited from DQMOneEDAnalyzer<>
edm::EDPutTokenT< DQMTokenrunToken_
 

Private Attributes

StringCutObjectSelector< reco::Muonselector_
 
bool wantTightMuon_
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer<>
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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 29 of file RecoDisplacedMuonValidator.h.

Constructor & Destructor Documentation

◆ RecoDisplacedMuonValidator()

RecoDisplacedMuonValidator::RecoDisplacedMuonValidator ( const edm::ParameterSet pset)

Definition at line 555 of file RecoDisplacedMuonValidator.cc.

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

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

◆ ~RecoDisplacedMuonValidator()

RecoDisplacedMuonValidator::~RecoDisplacedMuonValidator ( )
override

Definition at line 800 of file RecoDisplacedMuonValidator.cc.

800 {}

Member Function Documentation

◆ analyze()

void RecoDisplacedMuonValidator::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 819 of file RecoDisplacedMuonValidator.cc.

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

819  {
820  // Look for the Primary Vertex (and use the BeamSpot instead, if you can't find it):
821  reco::Vertex::Point posVtx;
822  reco::Vertex::Error errVtx;
824  event.getByToken(primvertexToken_, recVtxs);
825  unsigned int theIndexOfThePrimaryVertex = 999.;
826  for (unsigned int ind = 0; ind < recVtxs->size(); ++ind) {
827  if ((*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake())) {
828  theIndexOfThePrimaryVertex = ind;
829  break;
830  }
831  }
832  if (theIndexOfThePrimaryVertex < 100) {
833  posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).position();
834  errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).error();
835  } else {
836  LogInfo("RecoDisplacedMuonValidator") << "reco::PrimaryVertex not found, use BeamSpot position instead\n";
837  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
838  event.getByToken(beamspotToken_, recoBeamSpotHandle);
839  reco::BeamSpot bs = *recoBeamSpotHandle;
840  posVtx = bs.position();
841  errVtx(0, 0) = bs.BeamWidthX();
842  errVtx(1, 1) = bs.BeamWidthY();
843  errVtx(2, 2) = bs.sigmaZ();
844  }
845  const reco::Vertex thePrimaryVertex(posVtx, errVtx);
846 
847  // Get TrackingParticles
849  const TrackingParticleRefVector* ptr_TPrefV = nullptr;
851  Handle<TrackingParticleRefVector> TPCollectionRefVector_H;
852 
853  if (tpRefVector) {
854  event.getByToken(tpRefVectorToken_, TPCollectionRefVector_H);
855  ptr_TPrefV = TPCollectionRefVector_H.product();
856  TPrefV = *ptr_TPrefV;
857  } else {
858  event.getByToken(simToken_, simHandle);
859  size_t nTP = simHandle->size();
860  for (size_t i = 0; i < nTP; ++i) {
861  TPrefV.push_back(TrackingParticleRef(simHandle, i));
862  }
863  ptr_TPrefV = &TPrefV;
864  }
865 
866  // Get Muons
867  Handle<edm::View<Muon> > muonHandle;
868  event.getByToken(muonToken_, muonHandle);
869  View<Muon> muonColl = *(muonHandle.product());
870 
871  reco::MuonToTrackingParticleAssociator const* assoByHits = nullptr;
872  if (doAssoc_) {
874  event.getByToken(muAssocToken_, associatorBase);
875  assoByHits = associatorBase.product();
876  }
877 
878  const size_t nSim = ptr_TPrefV->size();
879 
881  for (size_t i = 0; i < muonHandle->size(); ++i) {
882  Muons.push_back(muonHandle->refAt(i));
883  }
884 
885  muonME_->hNSim_->Fill(nSim);
886  muonME_->hNMuon_->Fill(muonColl.size());
887 
888  reco::MuonToSimCollection muonToSimColl;
889  reco::SimToMuonCollection simToMuonColl;
890 
891  if (doAssoc_) {
892  edm::LogVerbatim("RecoDisplacedMuonValidator")
893  << "\n >>> MuonToSim association : " << muAssocLabel_ << " <<< \n"
894  << " muon collection : " << muonLabel_ << " (size = " << muonHandle->size() << ") \n"
895  << " TrackingParticle collection : " << simLabel_ << " (size = " << nSim << ")";
896 
897  assoByHits->associateMuons(muonToSimColl, simToMuonColl, Muons, trackType_, TPrefV);
898  } else {
899  /*
900  // SimToMuon associations
901  Handle<reco::RecoToSimCollection> simToTrkMuHandle;
902  event.getByLabel(trkMuAssocLabel_, simToTrkMuHandle);
903  trkSimRecColl = *(simToTrkMuHandle.product());
904 
905  Handle<reco::RecoToSimCollection> simToStaMuHandle;
906  event.getByLabel(staMuAssocLabel_, simToStaMuHandle);
907  staSimRecColl = *(simToStaMuHandle.product());
908 
909  Handle<reco::RecoToSimCollection> simToGlbMuHandle;
910  event.getByLabel(glbMuAssocLabel_, simToGlbMuHandle);
911  glbSimRecColl = *(simToGlbMuHandle.product());
912 
913  // MuonToSim associations
914  Handle<reco::SimToRecoCollection> trkMuToSimHandle;
915  event.getByLabel(trkMuAssocLabel_, trkMuToSimHandle);
916  trkRecSimColl = *(trkMuToSimHandle.product());
917 
918  Handle<reco::SimToRecoCollection> staMuToSimHandle;
919  event.getByLabel(staMuAssocLabel_, staMuToSimHandle);
920  staRecSimColl = *(staMuToSimHandle.product());
921 
922  Handle<reco::SimToRecoCollection> glbMuToSimHandle;
923  event.getByLabel(glbMuAssocLabel_, glbMuToSimHandle);
924  glbRecSimColl = *(glbMuToSimHandle.product());
925 */
926  }
927 
928  int glbNTrackerHits = 0;
929  int trkNTrackerHits = 0;
930  int glbNMuonHits = 0;
931  int staNMuonHits = 0;
932  int NTrackerHits = 0;
933  int NMuonHits = 0;
934 
935  // Analyzer reco::Muon
936  for (View<Muon>::const_iterator iMuon = muonColl.begin(); iMuon != muonColl.end(); ++iMuon) {
937  double muonP, muonPt, muonEta, muonPhi;
938  if (usePFMuon_) {
939  muonP = iMuon->pfP4().P();
940  muonPt = iMuon->pfP4().Pt();
941  muonEta = iMuon->pfP4().Eta();
942  muonPhi = iMuon->pfP4().Phi();
943  } else {
944  muonP = iMuon->p();
945  muonPt = iMuon->pt();
946  muonEta = iMuon->eta();
947  muonPhi = iMuon->phi();
948  }
949 
950  //histograms for fractions
951  commonME_->hMuonAllP_->Fill(muonP);
955 
956  if (!selector_(*iMuon))
957  continue;
958  if (wantTightMuon_) {
959  if (!muon::isTightMuon(*iMuon, thePrimaryVertex))
960  continue;
961  }
962 
963  TrackRef Track = iMuon->track();
964 
965  if (trackType_ == reco::InnerTk) {
966  Track = iMuon->track();
967  trkNTrackerHits = countTrackerHits(*Track);
968  } else if (trackType_ == reco::OuterTk) {
969  Track = iMuon->standAloneMuon();
970  } else if (trackType_ == reco::GlobalTk) {
971  Track = iMuon->combinedMuon();
972  glbNTrackerHits = countTrackerHits(*Track);
973  glbNMuonHits = countMuonHits(*Track);
974  }
975 
980  //ip histograms
983 
984  NTrackerHits = countTrackerHits(*Track);
985  muonME_->hNTrackerHits_->Fill(NTrackerHits);
986  muonME_->hNTrackerHits_vs_Pt_->Fill(Track->pt(), NTrackerHits);
987  muonME_->hNTrackerHits_vs_Eta_->Fill(Track->eta(), NTrackerHits);
988 
989  NMuonHits = countMuonHits(*Track);
990  muonME_->hNMuonHits_->Fill(NMuonHits);
991  muonME_->hNMuonHits_vs_Pt_->Fill(Track->pt(), NMuonHits);
992  muonME_->hNMuonHits_vs_Eta_->Fill(Track->eta(), NMuonHits);
993 
994  //list of histos for each type
995 
996  // muonME_->hNTrks_->Fill();
998  muonME_->hNTrksPt_->Fill(Track->pt());
999 
1000  commonME_->hMuonP_->Fill(muonP);
1004 
1005  if (iMuon->isGlobalMuon()) {
1006  double gtHitPat = iMuon->globalTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
1007  iMuon->globalTrack()->hitPattern().numberOfValidHits();
1008 
1009  double itHitPat = iMuon->innerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
1010  iMuon->innerTrack()->hitPattern().numberOfValidHits();
1011 
1012  double otHitPat = iMuon->outerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
1013  iMuon->outerTrack()->hitPattern().numberOfValidHits();
1014 
1018  commonME_->hNDeltaInvalidHitsHitPattern_->Fill(gtHitPat - itHitPat - otHitPat);
1019 
1020  //must be global and standalone
1021  if (iMuon->isStandAloneMuon()) {
1022  commonME_->hStaToGlbDiffNMuonHitsEta_->Fill(Track->eta(), staNMuonHits - glbNMuonHits);
1023  commonME_->hStaToGlbDiffNMuonHitsPt_->Fill(Track->pt(), staNMuonHits - glbNMuonHits);
1024  commonME_->hStaToGlbDiffNMuonHits_->Fill(staNMuonHits - glbNMuonHits);
1025  }
1026 
1027  //must be global and tracker
1028  if (iMuon->isTrackerMuon()) {
1029  commonME_->hTrkToGlbDiffNTrackerHitsEta_->Fill(Track->eta(), trkNTrackerHits - glbNTrackerHits);
1030  commonME_->hTrkToGlbDiffNTrackerHitsPt_->Fill(Track->pt(), trkNTrackerHits - glbNTrackerHits);
1031  commonME_->hTrkToGlbDiffNTrackerHits_->Fill(trkNTrackerHits - glbNTrackerHits);
1032  }
1033  }
1034 
1035  } //end of reco muon loop
1036 
1037  // Associate by hits
1038  for (size_t i = 0; i < nSim; i++) {
1039  TrackingParticleRef simRef = TPrefV[i];
1040  const TrackingParticle* simTP = simRef.get();
1041  if (!tpSelector_(*simTP))
1042  continue;
1043 
1044  //denominators for efficiency plots
1045  const double simP = simRef->p();
1046  const double simPt = simRef->pt();
1047  const double simEta = doAbsEta_ ? fabs(simRef->eta()) : simRef->eta();
1048  const double simPhi = simRef->phi();
1049 
1050  GlobalPoint simVtx(simRef->vertex().x(), simRef->vertex().y(), simRef->vertex().z());
1051  GlobalVector simMom(simRef->momentum().x(), simRef->momentum().y(), simRef->momentum().z());
1052  const double simDxy = -simVtx.x() * sin(simPhi) + simVtx.y() * cos(simPhi);
1053  const double simDz = simVtx.z() - (simVtx.x() * simMom.x() + simVtx.y() * simMom.y()) * simMom.z() / simMom.perp2();
1054 
1055  const unsigned int nSimHits = simRef->numberOfHits();
1056 
1057  muonME_->hSimP_->Fill(simP);
1058  muonME_->hSimPt_->Fill(simPt);
1059  muonME_->hSimEta_->Fill(simEta);
1060  muonME_->hSimPhi_->Fill(simPhi);
1061  muonME_->hSimDxy_->Fill(simDxy);
1062  muonME_->hSimDz_->Fill(simDz);
1063  muonME_->hNSimHits_->Fill(nSimHits);
1064 
1065  // Get sim-reco association for a simRef
1066  vector<pair<RefToBase<Muon>, double> > MuRefV;
1067  if (simToMuonColl.find(simRef) != simToMuonColl.end()) {
1068  MuRefV = simToMuonColl[simRef];
1069 
1070  if (!MuRefV.empty()) {
1071  muonME_->hNSimToReco_->Fill(MuRefV.size());
1072  const Muon* Mu = MuRefV.begin()->first.get();
1073  if (!selector_(*Mu))
1074  continue;
1075  if (wantTightMuon_) {
1076  if (!muon::isTightMuon(*Mu, thePrimaryVertex))
1077  continue;
1078  }
1079 
1080  muonME_->fill(&*simTP, Mu);
1081  }
1082  }
1083  }
1084 }
Log< level::Info, true > LogVerbatim
std::map< edm::RefToBase< reco::Muon >, std::vector< std::pair< TrackingParticleRef, double > >, RefToBaseSort > MuonToSimCollection
Definition: MuonTrackType.h:37
void associateMuons(MuonToSimCollection &recoToSim, SimToMuonCollection &simToReco, const edm::RefToBaseVector< reco::Muon > &muons, MuonTrackType type, const edm::RefVector< TrackingParticleCollection > &tpColl) const
edm::EDGetTokenT< TrackingParticleRefVector > tpRefVectorToken_
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
Definition: L1GtObject.h:29
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T const * product() const
Definition: Handle.h:70
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:45
edm::EDGetTokenT< reco::VertexCollection > primvertexToken_
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociator > muAssocToken_
void fill(const TrackingParticle *simRef, const Muon *muonRef)
StringCutObjectSelector< reco::Muon > selector_
size_type size() const
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
Definition: MuonTrackType.h:38
void Fill(long long x)
double pt() const
track transverse momentum
Definition: TrackBase.h:637
virtual int countTrackerHits(const reco::Track &track) const
T x() const
Definition: PV3DBase.h:59
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
Definition: Muon.py:1
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TrackingParticleSelector tpSelector_
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:88
static int position[264][3]
Definition: ReadPGInfo.cc:289
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
edm::EDGetTokenT< TrackingParticleCollection > simToken_
Monte Carlo truth information used for tracking validation.
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
const_iterator begin() const
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
const_iterator end() const
edm::Ref< TrackingParticleCollection > TrackingParticleRef
virtual int countMuonHits(const reco::Track &track) const
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608

◆ bookHistograms()

void RecoDisplacedMuonValidator::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMOneEDAnalyzer<>.

Definition at line 692 of file RecoDisplacedMuonValidator.cc.

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

694  {
695  // book histograms
696  ibooker.cd();
697 
698  ibooker.setCurrentFolder(subDir_);
699 
700  commonME_ = new CommonME;
701  muonME_ = new MuonME;
702 
703  //commonME
704  const int nHits = 100;
705 
706  // - diffs
707  commonME_->hTrkToGlbDiffNTrackerHits_ = ibooker.book1D("TrkGlbDiffNTrackerHits",
708  "Difference of number of tracker hits (tkMuon - globalMuon)",
709  2 * nHits + 1,
710  -nHits - 0.5,
711  nHits + 0.5);
712  commonME_->hStaToGlbDiffNMuonHits_ = ibooker.book1D("StaGlbDiffNMuonHits",
713  "Difference of number of muon hits (staMuon - globalMuon)",
714  2 * nHits + 1,
715  -nHits - 0.5,
716  nHits + 0.5);
717 
719  ibooker.book2D("TrkGlbDiffNTrackerHitsEta",
720  "Difference of number of tracker hits (tkMuon - globalMuon)",
721  hDim.nBinEta,
722  hDim.minEta,
723  hDim.maxEta,
724  2 * nHits + 1,
725  -nHits - 0.5,
726  nHits + 0.5);
727  commonME_->hStaToGlbDiffNMuonHitsEta_ = ibooker.book2D("StaGlbDiffNMuonHitsEta",
728  "Difference of number of muon hits (staMuon - globalMuon)",
729  hDim.nBinEta,
730  hDim.minEta,
731  hDim.maxEta,
732  2 * nHits + 1,
733  -nHits - 0.5,
734  nHits + 0.5);
735 
736  commonME_->hTrkToGlbDiffNTrackerHitsPt_ = ibooker.book2D("TrkGlbDiffNTrackerHitsPt",
737  "Difference of number of tracker hits (tkMuon - globalMuon)",
738  hDim.nBinPt,
739  hDim.minPt,
740  hDim.maxPt,
741  2 * nHits + 1,
742  -nHits - 0.5,
743  nHits + 0.5);
744  commonME_->hStaToGlbDiffNMuonHitsPt_ = ibooker.book2D("StaGlbDiffNMuonHitsPt",
745  "Difference of number of muon hits (staMuon - globalMuon)",
746  hDim.nBinPt,
747  hDim.minPt,
748  hDim.maxPt,
749  2 * nHits + 1,
750  -nHits - 0.5,
751  nHits + 0.5);
752 
753  // -global muon hit pattern
755  "NInvalidHitsGTHitPattern", "Number of invalid hits on a global track", nHits + 1, -0.5, nHits + 0.5);
757  "NInvalidHitsITHitPattern", "Number of invalid hits on an inner track", nHits + 1, -0.5, nHits + 0.5);
759  "NInvalidHitsOTHitPattern", "Number of invalid hits on an outer track", nHits + 1, -0.5, nHits + 0.5);
761  ibooker.book1D("hNDeltaInvalidHitsHitPattern",
762  "The discrepancy for Number of invalid hits on an global track and inner and outer tracks",
763  2 * nHits + 1,
764  -nHits - 0.5,
765  nHits + 0.5);
766 
767  //muon based kinematics
768  commonME_->hMuonP_ = ibooker.book1D("PMuon", "p of muon", hDim.nBinP, hDim.minP, hDim.maxP);
769  commonME_->hMuonPt_ = ibooker.book1D("PtMuon", "p_{T} of muon", hDim.nBinPt, hDim.minPt, hDim.maxPt);
770  commonME_->hMuonEta_ = ibooker.book1D("EtaMuon", "#eta of muon", hDim.nBinEta, hDim.minEta, hDim.maxEta);
771  commonME_->hMuonPhi_ = ibooker.book1D("PhiMuon", "#phi of muon", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
772  //track based kinematics
773  commonME_->hMuonTrackP_ = ibooker.book1D("PMuonTrack", "p of reco muon track", hDim.nBinP, hDim.minP, hDim.maxP);
775  ibooker.book1D("PtMuonTrack", "p_{T} of reco muon track", hDim.nBinPt, hDim.minPt, hDim.maxPt);
777  ibooker.book1D("EtaMuonTrack", "#eta of reco muon track", hDim.nBinEta, hDim.minEta, hDim.maxEta);
779  ibooker.book1D("PhiMuonTrack", "#phi of reco muon track", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
781  ibooker.book1D("DxyMuonTrack", "Dxy of reco muon track", hDim.nBinDxy, hDim.minDxy, hDim.maxDxy);
783  ibooker.book1D("DzMuonTrack", "Dz of reco muon track", hDim.nBinDz, hDim.minDz, hDim.maxDz);
784 
785  //histograms for fractions
786  commonME_->hMuonAllP_ = ibooker.book1D("PMuonAll", "p of muons of all types", hDim.nBinP, hDim.minP, hDim.maxP);
788  ibooker.book1D("PtMuonAll", "p_{T} of muon of all types", hDim.nBinPt, hDim.minPt, hDim.maxPt);
790  ibooker.book1D("EtaMuonAll", "#eta of muon of all types", hDim.nBinEta, hDim.minEta, hDim.maxEta);
792  ibooker.book1D("PhiMuonAll", "#phi of muon of all types", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
793 
794  muonME_->bookHistos(ibooker, subDir_, hDim);
795 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void bookHistos(DQMStore::IBooker &ibooker, const string &dirName, const HistoDimensions &hDim)
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
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits

◆ countMuonHits()

int RecoDisplacedMuonValidator::countMuonHits ( const reco::Track track) const
virtual

Definition at line 1086 of file RecoDisplacedMuonValidator.cc.

References submitPVResolutionJobs::count, DetId::det(), DetId::Muon, mps_fire::result, and HLT_2024v13_cff::track.

Referenced by analyze().

1086  {
1088 
1089  int count = 0;
1090 
1091  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
1092  if ((*hit)->isValid()) {
1093  DetId recoid = (*hit)->geographicalId();
1094  if (recoid.det() == DetId::Muon)
1095  count++;
1096  }
1097  }
1098  return count;
1099 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:17

◆ countTrackerHits()

int RecoDisplacedMuonValidator::countTrackerHits ( const reco::Track track) const
virtual

Definition at line 1101 of file RecoDisplacedMuonValidator.cc.

References submitPVResolutionJobs::count, DetId::det(), mps_fire::result, HLT_2024v13_cff::track, and DetId::Tracker.

Referenced by analyze().

1101  {
1103 
1104  int count = 0;
1105 
1106  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
1107  if ((*hit)->isValid()) {
1108  DetId recoid = (*hit)->geographicalId();
1109  if (recoid.det() == DetId::Tracker)
1110  count++;
1111  }
1112  }
1113  return count;
1114 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:17

◆ dqmBeginRun()

void RecoDisplacedMuonValidator::dqmBeginRun ( const edm::Run ,
const edm::EventSetup eventSetup 
)
overridevirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 806 of file RecoDisplacedMuonValidator.cc.

806 {}

◆ dqmEndRun()

void RecoDisplacedMuonValidator::dqmEndRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 811 of file RecoDisplacedMuonValidator.cc.

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

811  {
812  if (dbe_ && !outputFileName_.empty())
814 }
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:824

Member Data Documentation

◆ beamspotLabel_

edm::InputTag RecoDisplacedMuonValidator::beamspotLabel_
protected

Definition at line 56 of file RecoDisplacedMuonValidator.h.

Referenced by RecoDisplacedMuonValidator().

◆ beamspotToken_

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

Definition at line 58 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ commonME_

CommonME* RecoDisplacedMuonValidator::commonME_
protected

Definition at line 80 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and bookHistograms().

◆ dbe_

DQMStore* RecoDisplacedMuonValidator::dbe_
protected

Definition at line 66 of file RecoDisplacedMuonValidator.h.

Referenced by dqmEndRun(), and RecoDisplacedMuonValidator().

◆ doAbsEta_

bool RecoDisplacedMuonValidator::doAbsEta_
protected

Definition at line 68 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ doAssoc_

bool RecoDisplacedMuonValidator::doAssoc_
protected

Definition at line 69 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ hDim

HistoDimensions RecoDisplacedMuonValidator::hDim
protected

Definition at line 126 of file RecoDisplacedMuonValidator.h.

Referenced by bookHistograms(), and RecoDisplacedMuonValidator().

◆ muAssocLabel_

edm::InputTag RecoDisplacedMuonValidator::muAssocLabel_
protected

Definition at line 53 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ muAssocToken_

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

Definition at line 54 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ muonLabel_

edm::InputTag RecoDisplacedMuonValidator::muonLabel_
protected

Definition at line 45 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ muonME_

MuonME* RecoDisplacedMuonValidator::muonME_
protected

Definition at line 77 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and bookHistograms().

◆ muonSelection_

std::string RecoDisplacedMuonValidator::muonSelection_
protected

Definition at line 46 of file RecoDisplacedMuonValidator.h.

◆ muonToken_

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

Definition at line 51 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ outputFileName_

std::string RecoDisplacedMuonValidator::outputFileName_
protected

Definition at line 61 of file RecoDisplacedMuonValidator.h.

Referenced by dqmEndRun(), and RecoDisplacedMuonValidator().

◆ primvertexLabel_

edm::InputTag RecoDisplacedMuonValidator::primvertexLabel_
protected

Definition at line 57 of file RecoDisplacedMuonValidator.h.

Referenced by RecoDisplacedMuonValidator().

◆ primvertexToken_

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

Definition at line 59 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ pset

edm::ParameterSet RecoDisplacedMuonValidator::pset
protected

Definition at line 64 of file RecoDisplacedMuonValidator.h.

Referenced by RecoDisplacedMuonValidator().

◆ selector_

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

Definition at line 129 of file RecoDisplacedMuonValidator.h.

Referenced by analyze().

◆ simLabel_

edm::InputTag RecoDisplacedMuonValidator::simLabel_
protected

Definition at line 44 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ simToken_

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

Definition at line 47 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ subDir_

std::string RecoDisplacedMuonValidator::subDir_
protected

Definition at line 62 of file RecoDisplacedMuonValidator.h.

Referenced by bookHistograms(), and RecoDisplacedMuonValidator().

◆ subsystemname_

std::string RecoDisplacedMuonValidator::subsystemname_
protected

Definition at line 63 of file RecoDisplacedMuonValidator.h.

Referenced by RecoDisplacedMuonValidator().

◆ tpRefVector

bool RecoDisplacedMuonValidator::tpRefVector
protected

Definition at line 49 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ tpRefVectorToken_

edm::EDGetTokenT<TrackingParticleRefVector> RecoDisplacedMuonValidator::tpRefVectorToken_
protected

Definition at line 48 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ tpSelector_

TrackingParticleSelector RecoDisplacedMuonValidator::tpSelector_
protected

Definition at line 72 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ trackType_

reco::MuonTrackType RecoDisplacedMuonValidator::trackType_
protected

Definition at line 75 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ usePFMuon_

bool RecoDisplacedMuonValidator::usePFMuon_
protected

Definition at line 70 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().

◆ verbose_

unsigned int RecoDisplacedMuonValidator::verbose_
protected

Definition at line 42 of file RecoDisplacedMuonValidator.h.

Referenced by RecoDisplacedMuonValidator().

◆ wantTightMuon_

bool RecoDisplacedMuonValidator::wantTightMuon_
private

Definition at line 130 of file RecoDisplacedMuonValidator.h.

Referenced by analyze(), and RecoDisplacedMuonValidator().