CMS 3D CMS Logo

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

#include <NewMuonTrackValidator.h>

Inheritance diagram for NewMuonTrackValidator:
DQMEDAnalyzer NewMuonTrackValidatorBase edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 Method called before the event loop. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 Method called at the end of the event loop. More...
 
 NewMuonTrackValidator (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~NewMuonTrackValidator ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 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)
 
- Protected Member Functions inherited from NewMuonTrackValidatorBase
void BinLogX (TH1 *h)
 
void doProfileX (TH2 *th2, MonitorElement *me)
 
void doProfileX (MonitorElement *th2m, MonitorElement *me)
 
template<typename T >
void fillPlotNoFlow (MonitorElement *h, T val)
 
double getEta (double eta)
 
double getPt (double pt)
 
 NewMuonTrackValidatorBase (const edm::ParameterSet &pset, edm::ConsumesCollector iC)
 Constructor. More...
 
 NewMuonTrackValidatorBase (const edm::ParameterSet &pset)
 
virtual ~NewMuonTrackValidatorBase ()(false)
 Destructor. More...
 
- Protected Attributes inherited from NewMuonTrackValidatorBase
std::vector< std::string > associators
 
edm::InputTag bsSrc
 
edm::EDGetTokenT< reco::BeamSpotbsSrc_Token
 
std::vector< MonitorElement * > chi2_vs_eta
 
std::vector< MonitorElement * > chi2_vs_nhits
 
std::vector< MonitorElement * > chi2_vs_phi
 
int cotThetaRes_nbin
 
double cotThetaRes_rangeMax
 
double cotThetaRes_rangeMin
 
bool do_MUOhitsPlots
 
bool do_TRKhitsPlots
 
std::vector< MonitorElement * > dxypull_vs_eta
 
int dxyRes_nbin
 
double dxyRes_rangeMax
 
double dxyRes_rangeMin
 
std::vector< MonitorElement * > dxyres_vs_eta
 
std::vector< MonitorElement * > dxyres_vs_pt
 
std::vector< MonitorElement * > dzpull_vs_eta
 
int dzRes_nbin
 
double dzRes_rangeMax
 
double dzRes_rangeMin
 
std::vector< MonitorElement * > dzres_vs_eta
 
std::vector< MonitorElement * > dzres_vs_pt
 
int etaRes_nbin
 
double etaRes_rangeMax
 
double etaRes_rangeMin
 
std::vector< MonitorElement * > etares_vs_eta
 
std::vector< MonitorElement * > h_assoc2dxy
 
std::vector< MonitorElement * > h_assoc2dz
 
std::vector< MonitorElement * > h_assoc2eta
 
std::vector< MonitorElement * > h_assoc2hit
 
std::vector< MonitorElement * > h_assoc2phi
 
std::vector< MonitorElement * > h_assoc2pT
 
std::vector< MonitorElement * > h_assoc2pu
 
std::vector< MonitorElement * > h_assocdxy
 
std::vector< MonitorElement * > h_assocdz
 
std::vector< MonitorElement * > h_assoceta
 
std::vector< MonitorElement * > h_assocFraction
 
std::vector< MonitorElement * > h_assochi2
 
std::vector< MonitorElement * > h_assochi2_prob
 
std::vector< MonitorElement * > h_assochit
 
std::vector< MonitorElement * > h_assocphi
 
std::vector< MonitorElement * > h_assocpT
 
std::vector< MonitorElement * > h_assocpu
 
std::vector< MonitorElement * > h_assocRpos
 
std::vector< MonitorElement * > h_assocSharedHit
 
std::vector< MonitorElement * > h_assocZpos
 
std::vector< MonitorElement * > h_charge
 
std::vector< MonitorElement * > h_dxypull
 
std::vector< MonitorElement * > h_dxypulleta
 
std::vector< MonitorElement * > h_dzpull
 
std::vector< MonitorElement * > h_dzpulleta
 
std::vector< MonitorElement * > h_etaRes
 
std::vector< MonitorElement * > h_fakes
 
std::vector< MonitorElement * > h_losthits
 
std::vector< MonitorElement * > h_misiddxy
 
std::vector< MonitorElement * > h_misiddz
 
std::vector< MonitorElement * > h_misideta
 
std::vector< MonitorElement * > h_misidhit
 
std::vector< MonitorElement * > h_misidphi
 
std::vector< MonitorElement * > h_misidpT
 
std::vector< MonitorElement * > h_misidpu
 
std::vector< MonitorElement * > h_nchi2
 
std::vector< MonitorElement * > h_nchi2_prob
 
std::vector< MonitorElement * > h_nhits
 
std::vector< MonitorElement * > h_nlosthits
 
std::vector< MonitorElement * > h_nmisslayers_inner
 
std::vector< MonitorElement * > h_nmisslayers_outer
 
std::vector< MonitorElement * > h_phipull
 
std::vector< MonitorElement * > h_phipulleta
 
std::vector< MonitorElement * > h_phipullphi
 
std::vector< MonitorElement * > h_ptpull
 
std::vector< MonitorElement * > h_ptpulleta
 
std::vector< MonitorElement * > h_ptpullphi
 
std::vector< MonitorElement * > h_PurityVsQuality
 
std::vector< MonitorElement * > h_qoverppull
 
std::vector< MonitorElement * > h_recodxy
 
std::vector< MonitorElement * > h_recodz
 
std::vector< MonitorElement * > h_recoeta
 
std::vector< MonitorElement * > h_recohit
 
std::vector< MonitorElement * > h_recophi
 
std::vector< MonitorElement * > h_recopT
 
std::vector< MonitorElement * > h_recopu
 
std::vector< MonitorElement * > h_simuldxy
 
std::vector< MonitorElement * > h_simuldz
 
std::vector< MonitorElement * > h_simuleta
 
std::vector< MonitorElement * > h_simulhit
 
std::vector< MonitorElement * > h_simulphi
 
std::vector< MonitorElement * > h_simulpT
 
std::vector< MonitorElement * > h_simulpu
 
std::vector< MonitorElement * > h_simulRpos
 
std::vector< MonitorElement * > h_simulZpos
 
std::vector< MonitorElement * > h_thetapull
 
std::vector< MonitorElement * > h_thetapulleta
 
std::vector< MonitorElement * > h_thetapullphi
 
std::vector< MonitorElement * > h_tracks
 
bool ignoremissingtkcollection_
 
std::vector< edm::InputTaglabel
 
edm::InputTag label_pileupinfo
 
edm::InputTag label_tp_effic
 
edm::InputTag label_tp_fake
 
double maxCSCHit
 
double maxDTHit
 
double maxDxy
 
double maxDz
 
double maxEta
 
double maxLayers
 
double maxNHit
 
double maxPhi
 
double maxPixels
 
double maxPt
 
double maxPU
 
double maxRPCHit
 
double maxRpos
 
double maxZpos
 
double minCSCHit
 
double minDTHit
 
double minDxy
 
double minDz
 
double minEta
 
double minLayers
 
double minNHit
 
double minPhi
 
double minPixels
 
double minPt
 
double minPU
 
double minRPCHit
 
double minRpos
 
double minZpos
 
edm::ParameterSet muonHistoParameters
 
std::vector< MonitorElement * > nCSChits_vs_eta
 
std::vector< MonitorElement * > nDThits_vs_eta
 
std::vector< MonitorElement * > nGEMhits_vs_eta
 
std::vector< MonitorElement * > nhits_vs_eta
 
std::vector< MonitorElement * > nhits_vs_phi
 
int nintCSCHit
 
int nintDTHit
 
int nintDxy
 
int nintDz
 
int nintEta
 
int nintLayers
 
int nintNHit
 
int nintPhi
 
int nintPixels
 
int nintPt
 
int nintPU
 
int nintRPCHit
 
int nintRpos
 
int nintZpos
 
std::vector< MonitorElement * > nlosthits_vs_eta
 
std::vector< MonitorElement * > nME0hits_vs_eta
 
std::vector< MonitorElement * > nPixel_LayersWithMeas_vs_eta
 
std::vector< MonitorElement * > nRecHits_vs_nSimHits
 
std::vector< MonitorElement * > nRPChits_vs_eta
 
std::vector< MonitorElement * > nTRK_LayersWithMeas_vs_eta
 
std::string out
 
std::string parametersDefiner
 
std::vector< MonitorElement * > phipull_vs_eta
 
std::vector< MonitorElement * > phipull_vs_phi
 
int phiRes_nbin
 
double phiRes_rangeMax
 
double phiRes_rangeMin
 
std::vector< MonitorElement * > phires_vs_eta
 
std::vector< MonitorElement * > phires_vs_phi
 
std::vector< MonitorElement * > phires_vs_pt
 
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupinfo_Token
 
std::vector< MonitorElement * > ptpull_vs_eta
 
std::vector< MonitorElement * > ptpull_vs_phi
 
int ptRes_nbin
 
double ptRes_rangeMax
 
double ptRes_rangeMin
 
std::vector< MonitorElement * > ptres_vs_eta
 
std::vector< MonitorElement * > ptres_vs_phi
 
std::vector< MonitorElement * > ptres_vs_pt
 
edm::ESHandle< MagneticFieldtheMF
 
std::vector< MonitorElement * > thetaCotres_vs_eta
 
std::vector< MonitorElement * > thetaCotres_vs_pt
 
std::vector< MonitorElement * > thetapull_vs_eta
 
std::vector< MonitorElement * > thetapull_vs_phi
 
edm::EDGetTokenT< TrackingParticleCollectiontp_effic_Token
 
edm::EDGetTokenT< TrackingParticleCollectiontp_fake_Token
 
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > track_Collection_Token
 
bool useFabsEta
 
bool useInvPt
 
bool useLogPt
 
bool usemuon
 
bool usetracker
 

Detailed Description

Class that produces histograms to validate Muon Track Reconstruction performances

Definition at line 17 of file NewMuonTrackValidator.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 20 of file NewMuonTrackValidator.h.

References _simHitTpMapTag, ctfWithMaterialTrackMCMatch_cfi::associator, associatormap, NewMuonTrackValidatorBase::associators, BiDirectional_RecoToSim_association, NewMuonTrackValidatorBase::bsSrc, NewMuonTrackValidatorBase::bsSrc_Token, edm::EDConsumerBase::consumes(), cosmictpSelector, dirName_, edm::ParameterSet::dump(), edm::ParameterSet::getParameter(), NewMuonTrackValidatorBase::label, NewMuonTrackValidatorBase::label_pileupinfo, NewMuonTrackValidatorBase::label_tp_effic, NewMuonTrackValidatorBase::label_tp_fake, MABH, NewMuonTrackValidatorBase::pileupinfo_Token, recoToSimCollection_Token, simToRecoCollection_Token, AlCaHLTBitMon_QueryRunRegistry::string, NewMuonTrackValidatorBase::tp_effic_Token, NewMuonTrackValidatorBase::tp_fake_Token, tpSelector, NewMuonTrackValidatorBase::track_Collection_Token, UseAssociators, useGEMs_, useME0_, NewMuonTrackValidatorBase::usemuon, and NewMuonTrackValidatorBase::usetracker.

21  dirName_ = pset.getParameter<std::string>("dirName");
22  associatormap = pset.getParameter< edm::InputTag >("associatormap");
23  UseAssociators = pset.getParameter< bool >("UseAssociators");
24  useGEMs_ = pset.getParameter< bool >("useGEMs");
25  useME0_ = pset.getParameter< bool >("useME0");
26  edm::ParameterSet tpset = pset.getParameter<edm::ParameterSet>("muonTPSelector");
27  tpSelector = TrackingParticleSelector(tpset.getParameter<double>("ptMin"),
28  tpset.getParameter<double>("minRapidity"),
29  tpset.getParameter<double>("maxRapidity"),
30  tpset.getParameter<double>("tip"),
31  tpset.getParameter<double>("lip"),
32  tpset.getParameter<int>("minHit"),
33  tpset.getParameter<bool>("signalOnly"),
34  tpset.getParameter<bool>("intimeOnly"),
35  tpset.getParameter<bool>("chargedOnly"),
36  tpset.getParameter<bool>("stableOnly"),
37  tpset.getParameter<std::vector<int> >("pdgId"));
38 
39  cosmictpSelector = CosmicTrackingParticleSelector(tpset.getParameter<double>("ptMin"),
40  tpset.getParameter<double>("minRapidity"),
41  tpset.getParameter<double>("maxRapidity"),
42  tpset.getParameter<double>("tip"),
43  tpset.getParameter<double>("lip"),
44  tpset.getParameter<int>("minHit"),
45  tpset.getParameter<bool>("chargedOnly"),
46  tpset.getParameter<std::vector<int> >("pdgId"));
47 
48  BiDirectional_RecoToSim_association = pset.getParameter<bool>("BiDirectional_RecoToSim_association");
49 
50  // dump cfg parameters
51  edm::LogVerbatim("NewMuonTrackValidator") << "constructing NewMuonTrackValidator: " << pset.dump();
52 
53  // Declare consumes (also for the base class)
54  bsSrc_Token = consumes<reco::BeamSpot>(bsSrc);
55  tp_effic_Token = consumes<TrackingParticleCollection>(label_tp_effic);
56  tp_fake_Token = consumes<TrackingParticleCollection>(label_tp_fake);
57  pileupinfo_Token = consumes<std::vector<PileupSummaryInfo> >(label_pileupinfo);
58  for (unsigned int www=0;www<label.size();www++){
60  }
61  simToRecoCollection_Token = consumes<reco::SimToRecoCollection>(associatormap);
62  recoToSimCollection_Token = consumes<reco::RecoToSimCollection>(associatormap);
63 
64  _simHitTpMapTag = mayConsume<SimHitTPAssociationProducer::SimHitTPAssociationList>(pset.getParameter<edm::InputTag>("simHitTpMapTag"));
65 
66  MABH = false;
67  if (!UseAssociators) {
68  // flag MuonAssociatorByHits
69  if (associators[0] == "MuonAssociationByHits") MABH = true;
70  // reset string associators to the map label
71  associators.clear();
72  associators.push_back(associatormap.label());
73  edm::LogVerbatim("NewMuonTrackValidator") << "--> associators reset to: " <<associators[0];
74  } else {
75  for (auto const& associator :associators) {
76  consumes<reco::TrackToTrackingParticleAssociator>(edm::InputTag(associator));
77  }
78  }
79 
80  // inform on which SimHits will be counted
81  if (usetracker) edm::LogVerbatim("NewMuonTrackValidator")
82  <<"\n usetracker = TRUE : Tracker SimHits WILL be counted";
83  else edm::LogVerbatim("NewMuonTrackValidator")
84  <<"\n usetracker = FALSE : Tracker SimHits WILL NOT be counted";
85  if (usemuon) edm::LogVerbatim("NewMuonTrackValidator")
86  <<" usemuon = TRUE : Muon SimHits WILL be counted";
87  else edm::LogVerbatim("NewMuonTrackValidator")
88  <<" usemuon = FALSE : Muon SimHits WILL NOT be counted"<<std::endl;
89 
90  // loop over the reco::Track collections to validate: check for inconsistent input settings
91  for (unsigned int www=0;www<label.size();www++) {
92  std::string recoTracksLabel = label[www].label();
93  std::string recoTracksInstance = label[www].instance();
94 
95  // tracks with hits only on tracker
96  if (recoTracksLabel=="generalTracks" ||
97  (recoTracksLabel.find("cutsRecoTracks") != std::string::npos) ||
98  recoTracksLabel=="ctfWithMaterialTracksP5LHCNavigation" ||
99  recoTracksLabel=="hltL3TkTracksFromL2" ||
100  (recoTracksLabel=="hltL3Muons" && recoTracksInstance=="L2Seeded"))
101  {
102  if (usemuon) {
103  edm::LogWarning("NewMuonTrackValidator")
104  <<"\n*** WARNING : inconsistent input tracksTag = "<<label[www]
105  <<"\n with usemuon == true"<<"\n ---> please change to usemuon == false ";
106  }
107  if (!usetracker) {
108  edm::LogWarning("NewMuonTrackValidator")
109  <<"\n*** WARNING : inconsistent input tracksTag = "<<label[www]
110  <<"\n with usetracker == false"<<"\n ---> please change to usetracker == true ";
111  }
112  }
113 
114  // tracks with hits only on muon detectors
115  else if (recoTracksLabel=="standAloneMuons" ||
116  recoTracksLabel=="standAloneSETMuons" ||
117  recoTracksLabel=="cosmicMuons" ||
118  recoTracksLabel=="hltL2Muons")
119  {
120  if (usetracker) {
121  edm::LogWarning("NewMuonTrackValidator")
122  <<"\n*** WARNING : inconsistent input tracksTag = "<<label[www]
123  <<"\n with usetracker == true"<<"\n ---> please change to usetracker == false ";
124  }
125  if (!usemuon) {
126  edm::LogWarning("NewMuonTrackValidator")
127  <<"\n*** WARNING : inconsistent input tracksTag = "<<label[www]
128  <<"\n with usemuon == false"<<"\n ---> please change to usemuon == true ";
129  }
130  }
131 
132  } // for (unsigned int www=0;www<label.size();www++)
133  }
T getParameter(std::string const &) const
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > _simHitTpMapTag
NewMuonTrackValidatorBase(const edm::ParameterSet &pset, edm::ConsumesCollector iC)
Constructor.
std::string dump(unsigned int indent=0) const
edm::EDGetTokenT< TrackingParticleCollection > tp_effic_Token
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > track_Collection_Token
edm::EDGetTokenT< reco::BeamSpot > bsSrc_Token
TrackingParticleSelector tpSelector
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
edm::EDGetTokenT< TrackingParticleCollection > tp_fake_Token
ObjectSelector< CosmicTrackingParticleSelector > CosmicTrackingParticleSelector
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimCollection_Token
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoCollection_Token
CosmicTrackingParticleSelector cosmictpSelector
std::vector< std::string > associators
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupinfo_Token
std::vector< edm::InputTag > label
virtual NewMuonTrackValidator::~NewMuonTrackValidator ( )
inlinevirtual

Destructor.

Definition at line 136 of file NewMuonTrackValidator.h.

References analyze(), and bookHistograms().

136 { }

Member Function Documentation

void NewMuonTrackValidator::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
override

Method called before the event loop.

Method called once per event

Definition at line 217 of file NewMuonTrackValidator.cc.

References funct::abs(), ctfWithMaterialTrackMCMatch_cfi::associator, muonValidationHeavyIons_cff::associatormap, MuonErrorMatrixAnalyzer_cfi::associatorName, simPFProducer_cfi::associators, edm::AssociationMap< Tag >::begin(), MuonTrackValidator_cfi::BiDirectional_RecoToSim_association, reco::TrackBase::charge(), reco::TrackBase::chi2(), CosmicParametersDefinerForTP::clone(), funct::cos(), histoParameters_cff::do_MUOhitsPlots, histoParameters_cff::do_TRKhitsPlots, TrackingParticleIP::dxy(), reco::TrackBase::dxy(), reco::TrackBase::dxyError(), TrackingParticleIP::dz(), reco::TrackBase::dz(), reco::TrackBase::dzError(), edm::AssociationMap< Tag >::end(), reco::TrackBase::eta(), edm::AssociationMap< Tag >::find(), dedxEstimators_cff::fraction, edm::EventSetup::get(), edm::Ref< C, T, F >::get(), edm::Event::getByToken(), getEta(), reco::TrackBase::hitPattern(), mps_fire::i, createfilelist::int, edm::RefToBase< T >::key(), edm::Ref< C, T, F >::key(), diffTwoXMLs::label, LogTrace, M_PI, NewAssociators_cff::MABH, reco::HitPattern::MISSING_INNER_HITS, reco::HitPattern::MISSING_OUTER_HITS, ParametersDefinerForTP::momentum(), TrackingParticle::momentum(), eostools::move(), reco::TrackBase::ndof(), reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfHits(), reco::TrackBase::numberOfLostHits(), reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidMuonCSCHits(), reco::HitPattern::numberOfValidMuonDTHits(), reco::HitPattern::numberOfValidMuonGEMHits(), reco::HitPattern::numberOfValidMuonME0Hits(), reco::HitPattern::numberOfValidMuonRPCHits(), MuonTrackValidator_cfi::parametersDefiner, reco::TrackBase::phi(), muonME0DigisPreReco_cfi::phiError, reco::TrackBase::phiError(), reco::HitPattern::pixelLayersWithMeasurement(), reco::BeamSpot::position(), edm::Handle< T >::product(), reco::TrackBase::pt(), reco::TrackBase::ptError(), reco::TrackBase::qoverp(), reco::TrackBase::qoverpError(), btvTracks_cfi::quality, funct::sin(), mathSSE::sqrt(), reco::TrackBase::theta(), reco::TrackBase::thetaError(), NewRecoMuonValidator_cfi::tpSelector, HiIsolationCommonParameters_cff::track, findElectronsInSiStrips_cfi::trackCollection, reco::HitPattern::trackerLayersWithMeasurement(), TrackAlgoCompareUtil_cfi::UseAssociators, histoParameters_cff::usemuon, histoParameters_cff::usetracker, ParametersDefinerForTP::vertex(), TrackingParticle::vertex(), and w.

Referenced by ~NewMuonTrackValidator().

217  {
218  using namespace reco;
219 
220  edm::LogInfo("NewMuonTrackValidator") << "\n====================================================" << "\n"
221  << "Analyzing new event" << "\n"
222  << "====================================================\n" << "\n";
223 
225  int PU_NumInteractions(-1);
226 
227  edm::ESHandle<ParametersDefinerForTP> Lhc_parametersDefinerTP;
228  std::unique_ptr<ParametersDefinerForTP> Cosmic_parametersDefinerTP;
229 
230  if(parametersDefiner=="LhcParametersDefinerForTP") {
231  setup.get<TrackAssociatorRecord>().get(parametersDefiner, Lhc_parametersDefinerTP);
232 
233  // PileupSummaryInfo is contained only in collision events
234  event.getByToken(pileupinfo_Token,puinfoH);
235  for (std::vector<PileupSummaryInfo>::const_iterator puInfoIt = puinfoH->begin(); puInfoIt != puinfoH->end(); ++puInfoIt) {
236  if (puInfoIt->getBunchCrossing()==0) {
237  PU_NumInteractions = puInfoIt->getPU_NumInteractions();
238  break;
239  }
240  }
241 
242  }
243  else if(parametersDefiner=="CosmicParametersDefinerForTP") {
244  edm::ESHandle<CosmicParametersDefinerForTP> _Cosmic_parametersDefinerTP;
245  setup.get<TrackAssociatorRecord>().get(parametersDefiner, _Cosmic_parametersDefinerTP);
246 
247  //Since we modify the object, we must clone it
248  Cosmic_parametersDefinerTP = _Cosmic_parametersDefinerTP->clone();
249 
251  //warning: make sure the TP collection used in the map is the same used here
252  event.getByToken(_simHitTpMapTag,simHitsTPAssoc);
253  Cosmic_parametersDefinerTP->initEvent(simHitsTPAssoc);
254  cosmictpSelector.initEvent(simHitsTPAssoc);
255  }
256  else {
257  edm::LogError("NewMuonTrackValidator")
258  << "Unexpected label: parametersDefiner = "<< parametersDefiner.c_str() << "\n";
259  }
260 
261  edm::Handle<TrackingParticleCollection> TPCollectionHeff ;
262  event.getByToken(tp_effic_Token,TPCollectionHeff);
263  TrackingParticleCollection const & tPCeff = *(TPCollectionHeff.product());
264 
265  edm::Handle<TrackingParticleCollection> TPCollectionHfake ;
266  event.getByToken(tp_fake_Token,TPCollectionHfake);
267 
268  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
269  event.getByToken(bsSrc_Token,recoBeamSpotHandle);
270  reco::BeamSpot bs = *recoBeamSpotHandle;
271 
272  std::vector<const reco::TrackToTrackingParticleAssociator*> associator;
273  if (UseAssociators) {
275  for (auto const& associatorName : associators) {
276  event.getByLabel(associatorName,theAssociator);
277  associator.push_back( theAssociator.product() );
278  }
279  }
280 
281  int w=0;
282  for (unsigned int ww=0;ww<associators.size();ww++) {
283  for (unsigned int www=0;www<label.size();www++) {
284  //
285  //get collections from the event
286  //
288  if(!event.getByToken(track_Collection_Token[www], trackCollection) && ignoremissingtkcollection_) continue;
289 
290  reco::RecoToSimCollection const * recSimCollP=nullptr;
291  reco::SimToRecoCollection const * simRecCollP=nullptr;
292  reco::RecoToSimCollection recSimCollL;
293  reco::SimToRecoCollection simRecCollL;
294 
295  //associate tracks
296  if(UseAssociators) {
297  edm::LogVerbatim("NewMuonTrackValidator") << "Analyzing "
298  << label[www].process()<<":"
299  << label[www].label()<<":"
300  << label[www].instance()<<" with "
301  << associators[ww].c_str() <<"\n";
302 
303  LogTrace("NewMuonTrackValidator") << "Calling associateRecoToSim method" << "\n";
304  // recSimColl=associator[ww]->associateRecoToSim(trackCollection,
305  // TPCollectionHfake);
306  recSimCollL = std::move(associator[ww]->associateRecoToSim(trackCollection,
307  TPCollectionHfake));
308  recSimCollP = &recSimCollL;
309 
310  LogTrace("NewMuonTrackValidator") << "Calling associateSimToReco method" << "\n";
311  // simRecColl=associator[ww]->associateSimToReco(trackCollection,
312  // TPCollectionHeff);
313  simRecCollL = std::move(associator[ww]->associateSimToReco(trackCollection,
314  TPCollectionHeff));
315  simRecCollP = &simRecCollL;
316  }
317 
318  else {
319  edm::LogVerbatim("NewMuonTrackValidator") << "Analyzing "
320  << label[www].process()<<":"
321  << label[www].label()<<":"
322  << label[www].instance()<<" with "
323  << associatormap.process()<<":"
324  << associatormap.label()<<":"
325  << associatormap.instance()<<"\n";
326 
327  Handle<reco::SimToRecoCollection > simtorecoCollectionH;
328  event.getByToken(simToRecoCollection_Token,simtorecoCollectionH);
329  // simRecColl= *(simtorecoCollectionH.product());
330  simRecCollP = simtorecoCollectionH.product();
331 
332  Handle<reco::RecoToSimCollection > recotosimCollectionH;
333  event.getByToken(recoToSimCollection_Token,recotosimCollectionH);
334  // recSimColl= *(recotosimCollectionH.product());
335  recSimCollP = recotosimCollectionH.product();
336  }
337 
338  reco::RecoToSimCollection const & recSimColl = *recSimCollP;
339  reco::SimToRecoCollection const & simRecColl = *simRecCollP;
340 
341  //
342  //fill simulation histograms
343  //
344  edm::LogVerbatim("NewMuonTrackValidator") << "\n# of TrackingParticles: " << tPCeff.size() << "\n";
345  int ats = 0;
346  int st = 0;
347  for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
348  bool TP_is_matched = false;
349  bool isChargeOK = true;
350  double quality = 0.;
351 
352  TrackingParticleRef tpr(TPCollectionHeff, i);
353  TrackingParticle* tp = const_cast<TrackingParticle*>(tpr.get());
354 
355  TrackingParticle::Vector momentumTP;
356  TrackingParticle::Point vertexTP;
357  double dxySim = 0;
358  double dzSim = 0;
359 
360  //If the TrackingParticle is collision-like, get the momentum and vertex at production state
361  //and the impact parameters w.r.t. PCA
362  if(parametersDefiner=="LhcParametersDefinerForTP")
363  {
364  LogTrace("NewMuonTrackValidator") <<"TrackingParticle "<< i;
365  if(! tpSelector(*tp)) continue;
366  momentumTP = tp->momentum();
367  vertexTP = tp->vertex();
368  TrackingParticle::Vector momentum = Lhc_parametersDefinerTP->momentum(event,setup,tpr);
369  TrackingParticle::Point vertex = Lhc_parametersDefinerTP->vertex(event,setup,tpr);
370  dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position());
371  dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position());
372  }
373  //for cosmics get the momentum and vertex at PCA
374  else if(parametersDefiner=="CosmicParametersDefinerForTP")
375  {
376  edm::LogVerbatim("NewMuonTrackValidator") <<"TrackingParticle "<< i;
377  if(! cosmictpSelector(tpr,&bs,event,setup)) continue;
378  momentumTP = Cosmic_parametersDefinerTP->momentum(event,setup,tpr);
379  vertexTP = Cosmic_parametersDefinerTP->vertex(event,setup,tpr);
380  dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
381  dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
382  }
383  edm::LogVerbatim("NewMuonTrackValidator") <<"--------------------Selected TrackingParticle #"<<tpr.key();
384  edm::LogVerbatim("NewMuonTrackValidator") <<"momentumTP: pt = "<<sqrt(momentumTP.perp2())<<", pz = "<<momentumTP.z()
385  <<", \t vertexTP: radius = "<<sqrt(vertexTP.perp2())<< ", z = "<<vertexTP.z() <<"\n";
386  st++;
387 
388  double TPeta = momentumTP.eta();
389  double xTPeta = getEta(TPeta); // may be |eta| in histos according to useFabsEta
390  double TPpt = sqrt(momentumTP.perp2());
391  double xTPpt = getPt(TPpt); // may be 1/pt in histos according to useInvPt
392  double TPphi = momentumTP.phi();
393  double TPrpos = sqrt(vertexTP.perp2());
394  double TPzpos = vertexTP.z();
395 
396  // Number of counted SimHits depend on the selection of tracker and muon detectors (via cfg parameters)
397  int nSimHits = 0;
398  if (usetracker && usemuon) {
399  nSimHits= tpr.get()->numberOfHits();
400  }
401  else if (!usetracker && usemuon) {
402  nSimHits= tpr.get()->numberOfHits() - tpr.get()->numberOfTrackerHits();
403  }
404  else if (usetracker && !usemuon) {
405  nSimHits=tpr.get()->numberOfTrackerHits();
406  }
407  edm::LogVerbatim("NewMuonTrackValidator") << "\t N simhits = "<< nSimHits<<"\n";
408 
409  int assoc_recoTrack_NValidHits = 0;
410  if(simRecColl.find(tpr) != simRecColl.end()) {
411  auto const & rt = simRecColl[tpr];
412  if (rt.size()!=0) {
413  RefToBase<Track> assoc_recoTrack = rt.begin()->first;
414  edm::LogVerbatim("NewMuonTrackValidator")<<"-----------------------------associated Track #"<<assoc_recoTrack.key();
415  TP_is_matched = true;
416  ats++;
417  if (assoc_recoTrack->charge() != tpr->charge()) isChargeOK = false;
418  quality = rt.begin()->second;
419  assoc_recoTrack_NValidHits = assoc_recoTrack->numberOfValidHits();
420  edm::LogVerbatim("NewMuonTrackValidator") << "TrackingParticle #" <<tpr.key()
421  << " with pt=" << sqrt(momentumTP.perp2())
422  << " associated with quality:" << quality <<"\n";
423  }
424  } else {
425  edm::LogVerbatim("NewMuonTrackValidator")
426  << "TrackingParticle #" << tpr.key()
427  << " with pt,eta,phi: "
428  << sqrt(momentumTP.perp2()) << " , "<< momentumTP.eta() << " , "<< momentumTP.phi() << " , "
429  << " NOT associated to any reco::Track" << "\n";
430  }
431 
432  // histos for efficiency vs eta
433  fillPlotNoFlow(h_simuleta[w], xTPeta);
434  if (TP_is_matched) {
435  fillPlotNoFlow(h_assoceta[w], xTPeta);
436  if (!isChargeOK) fillPlotNoFlow(h_misideta[w], xTPeta);
437  }
438 
439  // histos for efficiency vs phi
440  fillPlotNoFlow(h_simulphi[w], TPphi);
441  if (TP_is_matched) {
442  fillPlotNoFlow(h_assocphi[w], TPphi);
443  if (!isChargeOK) fillPlotNoFlow(h_misidphi[w], TPphi);
444  }
445 
446  // histos for efficiency vs pT
447  fillPlotNoFlow(h_simulpT[w], xTPpt);
448  if (TP_is_matched) {
449  fillPlotNoFlow(h_assocpT[w], xTPpt);
450  if (!isChargeOK) fillPlotNoFlow(h_misidpT[w], xTPpt);
451  }
452 
453  // histos for efficiency vs dxy
454  fillPlotNoFlow(h_simuldxy[w], dxySim);
455  if (TP_is_matched) {
456  fillPlotNoFlow(h_assocdxy[w], dxySim);
457  if (!isChargeOK) fillPlotNoFlow(h_misiddxy[w], dxySim);
458  }
459 
460  // histos for efficiency vs dz
461  fillPlotNoFlow(h_simuldz[w], dzSim);
462  if (TP_is_matched) {
463  fillPlotNoFlow(h_assocdz[w], dzSim);
464  if (!isChargeOK) fillPlotNoFlow(h_misiddz[w], dzSim);
465  }
466 
467  // histos for efficiency vs Radius
468  fillPlotNoFlow(h_simulRpos[w], TPrpos);
469  if (TP_is_matched) fillPlotNoFlow(h_assocRpos[w], TPrpos);
470 
471  // histos for efficiency vs z position
472  fillPlotNoFlow(h_simulZpos[w], TPzpos);
473  if (TP_is_matched) fillPlotNoFlow(h_assocZpos[w], TPzpos);
474 
475  // histos for efficiency vs Number of Hits
476  fillPlotNoFlow(h_simulhit[w], nSimHits );
477  if (TP_is_matched) {
478  fillPlotNoFlow(h_assochit[w], nSimHits );
479  nRecHits_vs_nSimHits[w]->Fill(nSimHits, assoc_recoTrack_NValidHits);
480 
481  // charge misid is more useful w.r.t. nRecHits (filled after)
482  //if (!isChargeOK) fillPlotNoFlow(h_misidhit[w], nSimHits);
483  }
484 
485  // histos for efficiency vs PileUp
486  fillPlotNoFlow(h_simulpu[w], PU_NumInteractions);
487  if (TP_is_matched) {
488  fillPlotNoFlow(h_assocpu[w], PU_NumInteractions);
489  if (!isChargeOK) fillPlotNoFlow(h_misidpu[w], PU_NumInteractions);
490  }
491 
492  } // End for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
493 
494  //
495  //fill reconstructed track histograms
496  //
497  edm::LogVerbatim("NewMuonTrackValidator") << "\n# of reco::Tracks with "
498  << label[www].process()<<":"
499  << label[www].label()<<":"
500  << label[www].instance()
501  << ": " << trackCollection->size() << "\n";
502  int at = 0;
503  int rT = 0;
504  for(edm::View<Track>::size_type i=0; i < trackCollection->size(); ++i){
505  bool Track_is_matched = false;
506  bool isChargeOK = true;
507  RefToBase<Track> track(trackCollection, i);
508  rT++;
509 
510  std::vector<std::pair<TrackingParticleRef, double> > tp;
512 
513  // new logic (bidirectional)
515  edm::LogVerbatim("NewMuonTrackValidator")<<"----------------------------------------Track #"<< track.key();
516 
517  if(recSimColl.find(track) != recSimColl.end()) {
518  tp = recSimColl[track];
519  if (tp.size() != 0) {
520  tpr = tp.begin()->first;
521  // RtS and StR must associate the same pair !
522  if(simRecColl.find(tpr) != simRecColl.end()) {
523  auto const & assoc_track_checkback = simRecColl[tpr].begin()->first;
524 
525  if ( assoc_track_checkback.key() == track.key() ) {
526  edm::LogVerbatim("NewMuonTrackValidator")<<"------------------associated TrackingParticle #"<<tpr.key();
527  Track_is_matched = true;
528  at++;
529  if (track->charge() != tpr->charge()) isChargeOK = false;
530  double Purity = tp.begin()->second;
531  double Quality = simRecColl[tpr].begin()->second;
532  edm::LogVerbatim("NewMuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
533  << " associated with purity:" << Purity <<"\n";
534  if (MABH) h_PurityVsQuality[w]->Fill(Quality,Purity);
535  }
536  }
537  }
538  }
539 
540  if (!Track_is_matched)
541  edm::LogVerbatim("NewMuonTrackValidator")
542  << "reco::Track #" << track.key() << " with pt=" << track->pt() << " NOT associated to any TrackingParticle" << "\n";
543  }
544  // old logic, valid for cosmics 2-legs reco (bugged for collision scenario)
545  else {
546  if(recSimColl.find(track) != recSimColl.end()){
547  tp = recSimColl[track];
548  if (tp.size()!=0) {
549  tpr = tp.begin()->first;
550  Track_is_matched = true;
551  at++;
552  if (track->charge() != tpr->charge()) isChargeOK = false;
553  edm::LogVerbatim("NewMuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
554  << " associated with quality:" << tp.begin()->second <<"\n";
555  }
556  } else {
557  edm::LogVerbatim("NewMuonTrackValidator") << "reco::Track #" << track.key() << " with pt=" << track->pt()
558  << " NOT associated to any TrackingParticle" << "\n";
559  }
560  }
561 
562  //
563  int nRecHits = track->numberOfValidHits();
564  edm::LogVerbatim("NewMuonTrackValidator") << "\t N valid rechits = "<< nRecHits <<"\n";
565 
566  double etaRec = track->eta();
567  double xetaRec = getEta(etaRec);
568 
569  double ptRec = track->pt();
570  double xptRec = getPt(ptRec);
571 
572  double qoverpRec = track->qoverp();
573  double phiRec = track->phi();
574  double thetaRec = track->theta();
575  double dxyRec = track->dxy(bs.position());
576  double dzRec = track->dz(bs.position());
577 
578  double qoverpError = track->qoverpError();
579  double ptError = track->ptError();
580  double thetaError = track->thetaError();
581  double phiError = track->phiError();
582  double dxyError = track->dxyError();
583  double dzError = track->dzError();
584 
585  // histos for fake rate vs eta
586  fillPlotNoFlow(h_recoeta[w], xetaRec);
587  if (Track_is_matched) {
588  fillPlotNoFlow(h_assoc2eta[w], xetaRec);
589  }
590 
591  // histos for fake rate vs phi
592  fillPlotNoFlow(h_recophi[w], phiRec);
593  if (Track_is_matched) {
594  fillPlotNoFlow(h_assoc2phi[w], phiRec);
595  }
596 
597  // histos for fake rate vs pT
598  fillPlotNoFlow(h_recopT[w], xptRec);
599  if (Track_is_matched) {
600  fillPlotNoFlow(h_assoc2pT[w], xptRec);
601  }
602 
603  // histos for fake rate vs dxy
604  fillPlotNoFlow(h_recodxy[w], dxyRec);
605  if (Track_is_matched) {
606  fillPlotNoFlow(h_assoc2dxy[w], dxyRec);
607  }
608 
609  // histos for fake rate vs dz
610  fillPlotNoFlow(h_recodz[w], dzRec);
611  if (Track_is_matched) {
612  fillPlotNoFlow(h_assoc2dz[w], dzRec);
613  }
614 
615  // histos for fake rate vs Number of RecHits in track
616  fillPlotNoFlow(h_recohit[w], nRecHits);
617  if (Track_is_matched) {
618  fillPlotNoFlow(h_assoc2hit[w], nRecHits);
619  // charge misid w.r.t. nRecHits
620  if (!isChargeOK) fillPlotNoFlow(h_misidhit[w], nRecHits);
621  }
622 
623  // histos for fake rate vs Number of PU interactions
624  fillPlotNoFlow(h_recopu[w], PU_NumInteractions);
625  if (Track_is_matched) {
626  fillPlotNoFlow(h_assoc2pu[w], PU_NumInteractions);
627  }
628 
629  // Fill other histos
630  TrackingParticle* tpp = const_cast<TrackingParticle*>(tpr.get());
631  // TrackingParticle parameters at point of closest approach to the beamline
632  TrackingParticle::Vector momentumTP;
633  TrackingParticle::Point vertexTP;
634 
635  if (parametersDefiner=="LhcParametersDefinerForTP") {
636  // following reco plots are made only from tracks associated to selected signal TPs
637  if (! (Track_is_matched && tpSelector(*tpp)) ) continue;
638  else {
639  momentumTP = Lhc_parametersDefinerTP->momentum(event,setup,tpr) ;
640  vertexTP = Lhc_parametersDefinerTP->vertex(event,setup,tpr);
641  }
642  }
643  else if (parametersDefiner=="CosmicParametersDefinerForTP") {
644  // following reco plots are made only from tracks associated to selected signal TPs
645  if (! (Track_is_matched && cosmictpSelector(tpr,&bs,event,setup)) ) continue;
646  else {
647  momentumTP = Cosmic_parametersDefinerTP->momentum(event,setup,tpr) ;
648  vertexTP = Cosmic_parametersDefinerTP->vertex(event,setup,tpr);
649  }
650  }
651 
652  if (associators[ww]=="trackAssociatorByChi2"){
653  //association chi2
654  double assocChi2 = -tp.begin()->second;//in association map is stored -chi2
655  h_assochi2[www]->Fill(assocChi2);
656  h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2)*5,5));
657  }
658  else if (associators[ww]=="trackAssociatorByHits"){
659  double fraction = tp.begin()->second;
660  h_assocFraction[www]->Fill(fraction);
661  h_assocSharedHit[www]->Fill(fraction*nRecHits);
662  }
663 
664  h_charge[w]->Fill(track->charge());
665 
666  // Hits
667  h_nhits[w]->Fill(nRecHits);
668  nhits_vs_eta[w]->Fill(xetaRec, nRecHits);
669  nhits_vs_phi[w]->Fill(phiRec, nRecHits);
670 
671  if (do_MUOhitsPlots) {
672  nDThits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonDTHits());
673  nCSChits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonCSCHits());
674  nRPChits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonRPCHits());
675  if(useGEMs_) nGEMhits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonGEMHits());
676  if(useME0_) nME0hits_vs_eta[w]->Fill(xetaRec,track->hitPattern().numberOfValidMuonME0Hits());
677  }
678 
679  if (do_TRKhitsPlots) {
680  nTRK_LayersWithMeas_vs_eta[w]->Fill(xetaRec,track->hitPattern().trackerLayersWithMeasurement());
681  nPixel_LayersWithMeas_vs_eta[w]->Fill(xetaRec,track->hitPattern().pixelLayersWithMeasurement());
682  h_nlosthits[w]->Fill(track->numberOfLostHits());
683  h_nmisslayers_inner[w]->Fill(track->hitPattern().numberOfHits(reco::HitPattern::MISSING_INNER_HITS));
684  h_nmisslayers_outer[w]->Fill(track->hitPattern().numberOfHits(reco::HitPattern::MISSING_OUTER_HITS));
685  nlosthits_vs_eta[w]->Fill(xetaRec,track->numberOfLostHits());
686  }
687 
688  // normalized chi2
689  h_nchi2[w]->Fill(track->normalizedChi2());
690  h_nchi2_prob[w]->Fill(TMath::Prob(track->chi2(),(int)track->ndof()));
691  chi2_vs_nhits[w]->Fill(nRecHits, track->normalizedChi2());
692  chi2_vs_eta[w]->Fill(xetaRec, track->normalizedChi2());
693  chi2_vs_phi[w]->Fill(phiRec,track->normalizedChi2());
694 
695  double ptSim = sqrt(momentumTP.perp2());
696  double xptSim = getPt(ptSim);
697  double qoverpSim = tpr->charge() /
698  sqrt(momentumTP.x()*momentumTP.x()+momentumTP.y()*momentumTP.y()+momentumTP.z()*momentumTP.z());
699  double etaSim = momentumTP.eta();
700  double thetaSim = momentumTP.theta();
701  double phiSim = momentumTP.phi();
702  double dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
703  double dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
704 
705  double etares = etaRec - etaSim;
706  double ptRelRes = (ptRec - ptSim) / ptSim; // relative residual -> resolution
707  double ptPull = (ptRec - ptSim) / ptError;
708  double qoverpPull = (qoverpRec-qoverpSim) / qoverpError;
709  double thetaPull = (thetaRec - thetaSim) / thetaError;
710  double phiDiff = phiRec - phiSim;
711  if (abs(phiDiff) > M_PI) {
712  if (phiDiff >0.) phiDiff = phiDiff - 2.*M_PI;
713  else phiDiff = phiDiff + 2.*M_PI;
714  }
715  double phiPull = phiDiff / phiError;
716  double dxyPull = (dxyRec-dxySim) / dxyError;
717  double dzPull = (dzRec-dzSim) / dzError;
718 
719  h_etaRes[w]->Fill(etares);
720  etares_vs_eta[w]->Fill(xetaRec, etares);
721 
722  ptres_vs_eta[w]->Fill(xetaRec,ptRelRes);
723  ptres_vs_pt[w]->Fill(xptSim,ptRelRes);
724  ptres_vs_phi[w]->Fill(phiRec,ptRelRes);
725  h_ptpull[w]->Fill(ptPull);
726  ptpull_vs_eta[w]->Fill(xetaRec,ptPull);
727  ptpull_vs_phi[w]->Fill(phiRec,ptPull);
728  h_qoverppull[w]->Fill(qoverpPull);
729 
730  thetaCotres_vs_eta[w]->Fill(xetaRec, cos(thetaRec)/sin(thetaRec) - cos(thetaSim)/sin(thetaSim));
731  thetaCotres_vs_pt[w]->Fill(xptSim, cos(thetaRec)/sin(thetaRec) - cos(thetaSim)/sin(thetaSim));
732  h_thetapull[w]->Fill(thetaPull);
733  thetapull_vs_eta[w]->Fill(xetaRec,thetaPull);
734  thetapull_vs_phi[w]->Fill(phiRec,thetaPull);
735 
736  phires_vs_eta[w]->Fill(xetaRec,phiDiff);
737  phires_vs_pt[w]->Fill(xptSim,phiDiff);
738  phires_vs_phi[w]->Fill(phiRec,phiDiff);
739  h_phipull[w]->Fill(phiPull);
740  phipull_vs_eta[w]->Fill(xetaRec,phiPull);
741  phipull_vs_phi[w]->Fill(phiRec,phiPull);
742 
743  dxyres_vs_eta[w]->Fill(xetaRec,dxyRec-dxySim);
744  dxyres_vs_pt[w]->Fill(xptSim,dxyRec-dxySim);
745  h_dxypull[w]->Fill(dxyPull);
746  dxypull_vs_eta[w]->Fill(xetaRec,dxyPull);
747 
748  dzres_vs_eta[w]->Fill(xetaRec,dzRec-dzSim);
749  dzres_vs_pt[w]->Fill(xptSim,dzRec-dzSim);
750  h_dzpull[w]->Fill(dzPull);
751  dzpull_vs_eta[w]->Fill(xetaRec,dzPull);
752 
753  double contrib_Qoverp = qoverpPull*qoverpPull/5;
754  double contrib_dxy = dxyPull*dxyPull/5;
755  double contrib_dz = dzPull*dzPull/5;
756  double contrib_theta = thetaPull*thetaPull/5;
757  double contrib_phi = phiPull*phiPull/5;
758  double assoChi2 = contrib_Qoverp+contrib_dxy+contrib_dz+contrib_theta+contrib_phi;
759 
760  edm::LogVerbatim("NewMuonTrackValidator") << "normalized Chi2 (track 5-dofs matching) = "<<assoChi2 <<"\n"
761  << "\t contrib_Qoverp = " << contrib_Qoverp << "\n"
762  << "\t contrib_theta = " << contrib_theta << "\n"
763  << "\t contrib_phi = " << contrib_phi << "\n"
764  << "\t contrib_dxy = " << contrib_dxy << "\n"
765  << "\t contrib_dz = " << contrib_dz << "\n";
766 
767  edm::LogVerbatim("NewMuonTrackValidator") << "ptRec = " << ptRec << "\n"
768  << "etaRec = " << etaRec << "\n"
769  << "qoverpRec = " << qoverpRec << "\n"
770  << "thetaRec = " << thetaRec << "\n"
771  << "phiRec = " << phiRec << "\n"
772  << "dxyRec = " << dxyRec << "\n"
773  << "dzRec = " << dzRec << "\n"
774  << "" << "\n"
775  << "qoverpError = " << qoverpError << "\n"
776  << "thetaError = " << thetaError << "\n"
777  << "phiError = " << phiError << "\n"
778  << "dxyError = " << dxyError << "\n"
779  << "dzError = " << dzError << "\n"
780  << "" << "\n"
781  << "ptSim = " << ptSim << "\n"
782  << "etaSim = " << etaSim << "\n"
783  << "qoverpSim = " << qoverpSim << "\n"
784  << "thetaSim = " << thetaSim << "\n"
785  << "phiSim = " << phiSim << "\n"
786  << "dxySim = " << dxySim << "\n"
787  << "dzSim = " << dzSim << "\n";
788  } // End of for(edm::View<Track>::size_type i=0; i < trackCollection->size(); ++i){
789 
790  h_tracks[w]->Fill(at);
791  h_fakes[w]->Fill(rT-at);
792  edm::LogVerbatim("NewMuonTrackValidator") << "Total Simulated: " << st << "\n"
793  << "Total Associated (simToReco): " << ats << "\n"
794  << "Total Reconstructed: " << rT << "\n"
795  << "Total Associated (recoToSim): " << at << "\n"
796  << "Total Fakes: " << rT-at << "\n";
797  w++;
798  } // End of for (unsigned int www=0;www<label.size();www++){
799  } //END of for (unsigned int ww=0;ww<associators.size();ww++){
800 }
unsigned int size_type
Definition: View.h:90
std::vector< MonitorElement * > h_assocdxy
std::vector< MonitorElement * > dxyres_vs_pt
std::vector< MonitorElement * > h_misideta
std::vector< MonitorElement * > h_assochi2_prob
std::vector< MonitorElement * > h_recopu
std::vector< MonitorElement * > h_assoc2hit
std::vector< MonitorElement * > h_misiddz
std::vector< MonitorElement * > h_assocpT
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > _simHitTpMapTag
std::vector< MonitorElement * > h_dxypull
const double w
Definition: UKUtility.cc:23
std::vector< MonitorElement * > h_assoc2dz
std::vector< TrackingParticle > TrackingParticleCollection
Vector momentum() const
spatial momentum vector
const_iterator end() const
last iterator over the map (read only)
std::vector< MonitorElement * > thetapull_vs_eta
std::vector< MonitorElement * > h_dzpull
std::vector< MonitorElement * > etares_vs_eta
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< MonitorElement * > dxyres_vs_eta
edm::EDGetTokenT< TrackingParticleCollection > tp_effic_Token
std::vector< MonitorElement * > phires_vs_eta
std::vector< MonitorElement * > h_assocphi
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > track_Collection_Token
std::vector< MonitorElement * > nhits_vs_eta
std::vector< MonitorElement * > nhits_vs_phi
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< MonitorElement * > h_assocpu
const_iterator find(const key_type &k) const
find element with specified reference key
std::vector< MonitorElement * > thetaCotres_vs_pt
std::vector< MonitorElement * > nDThits_vs_eta
std::vector< MonitorElement * > h_assocdz
std::vector< MonitorElement * > h_misidpu
std::vector< MonitorElement * > phipull_vs_phi
std::vector< MonitorElement * > dzres_vs_pt
std::vector< MonitorElement * > dzpull_vs_eta
edm::EDGetTokenT< reco::BeamSpot > bsSrc_Token
std::vector< MonitorElement * > h_recophi
std::vector< MonitorElement * > phipull_vs_eta
std::vector< MonitorElement * > h_recodz
key_type key() const
Accessor for product key.
Definition: Ref.h:264
std::vector< MonitorElement * > h_phipull
TrackingParticleSelector tpSelector
std::vector< MonitorElement * > chi2_vs_eta
std::vector< MonitorElement * > ptres_vs_phi
std::vector< MonitorElement * > h_nmisslayers_inner
uint16_t size_type
std::vector< MonitorElement * > h_nlosthits
std::vector< MonitorElement * > h_assochi2
std::vector< MonitorElement * > nME0hits_vs_eta
std::vector< MonitorElement * > nRPChits_vs_eta
std::vector< MonitorElement * > h_assoceta
std::vector< MonitorElement * > h_recodxy
math::XYZPointD Point
point in the space
std::vector< MonitorElement * > h_simulhit
std::vector< MonitorElement * > h_thetapull
std::vector< MonitorElement * > h_ptpull
std::vector< MonitorElement * > h_assoc2dxy
std::vector< MonitorElement * > h_assoc2pu
std::vector< MonitorElement * > h_assocRpos
std::vector< MonitorElement * > ptpull_vs_phi
std::vector< MonitorElement * > thetaCotres_vs_eta
std::vector< MonitorElement * > h_misidpT
std::vector< MonitorElement * > h_tracks
std::vector< MonitorElement * > dzres_vs_eta
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
std::vector< MonitorElement * > chi2_vs_phi
size_t key() const
Definition: RefToBase.h:250
edm::EDGetTokenT< TrackingParticleCollection > tp_fake_Token
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< MonitorElement * > h_nhits
std::vector< MonitorElement * > h_assocZpos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< MonitorElement * > nPixel_LayersWithMeas_vs_eta
std::vector< MonitorElement * > ptres_vs_pt
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< MonitorElement * > h_nchi2
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
std::vector< MonitorElement * > dxypull_vs_eta
std::vector< MonitorElement * > h_fakes
std::vector< MonitorElement * > h_simulZpos
void initEvent(edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssocToSet) const
std::vector< MonitorElement * > phires_vs_pt
std::vector< MonitorElement * > h_simulphi
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:815
std::vector< MonitorElement * > h_recopT
std::vector< MonitorElement * > nTRK_LayersWithMeas_vs_eta
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
std::vector< MonitorElement * > nGEMhits_vs_eta
std::vector< MonitorElement * > h_simuldxy
std::vector< MonitorElement * > h_simuleta
std::vector< MonitorElement * > h_simulRpos
#define LogTrace(id)
std::vector< MonitorElement * > nlosthits_vs_eta
std::vector< MonitorElement * > h_charge
std::vector< MonitorElement * > h_assoc2pT
#define M_PI
std::vector< MonitorElement * > h_simuldz
std::vector< MonitorElement * > h_assocSharedHit
std::vector< MonitorElement * > h_etaRes
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimCollection_Token
std::vector< MonitorElement * > h_assoc2eta
std::vector< MonitorElement * > ptpull_vs_eta
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoCollection_Token
T const * product() const
Definition: Handle.h:81
CosmicTrackingParticleSelector cosmictpSelector
std::vector< std::string > associators
std::vector< MonitorElement * > nRecHits_vs_nSimHits
std::vector< MonitorElement * > nCSChits_vs_eta
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupinfo_Token
std::vector< MonitorElement * > h_assocFraction
std::vector< MonitorElement * > thetapull_vs_phi
std::vector< MonitorElement * > h_assochit
std::vector< MonitorElement * > h_recohit
std::string const & label() const
Definition: InputTag.h:36
std::vector< MonitorElement * > h_simulpu
Point vertex() const
Parent vertex position.
std::string const & process() const
Definition: InputTag.h:40
std::vector< MonitorElement * > h_nmisslayers_outer
std::unique_ptr< ParametersDefinerForTP > clone() const override
fixed size matrix
std::vector< MonitorElement * > h_nchi2_prob
std::vector< MonitorElement * > chi2_vs_nhits
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
std::vector< MonitorElement * > h_simulpT
std::vector< edm::InputTag > label
Monte Carlo truth information used for tracking validation.
int charge() const
track electric charge
Definition: TrackBase.h:562
const Point & position() const
position
Definition: BeamSpot.h:62
const_iterator begin() const
first iterator over the map (read only)
std::vector< MonitorElement * > h_misidhit
std::vector< MonitorElement * > h_recoeta
math::XYZVectorD Vector
point in the space
std::vector< MonitorElement * > h_misidphi
std::vector< MonitorElement * > h_qoverppull
std::vector< MonitorElement * > phires_vs_phi
std::string const & instance() const
Definition: InputTag.h:37
std::vector< MonitorElement * > h_PurityVsQuality
def move(src, dest)
Definition: eostools.py:510
void fillPlotNoFlow(MonitorElement *h, T val)
std::vector< MonitorElement * > ptres_vs_eta
std::vector< MonitorElement * > h_assoc2phi
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
std::vector< MonitorElement * > h_misiddxy
void NewMuonTrackValidator::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &  setup 
)
overridevirtual

Method called at the end of the event loop.

Implements DQMEDAnalyzer.

Definition at line 25 of file NewMuonTrackValidator.cc.

References patPFMETCorrections_cff::algo, trackingPlots::assoc, simPFProducer_cfi::associators, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), Validation_cff::cotThetaRes_nbin, Validation_cff::cotThetaRes_rangeMax, Validation_cff::cotThetaRes_rangeMin, TrackerOfflineValidation_Dqm_cff::dirName, histoParameters_cff::do_MUOhitsPlots, histoParameters_cff::do_TRKhitsPlots, Validation_cff::dxyRes_nbin, Validation_cff::dxyRes_rangeMax, Validation_cff::dxyRes_rangeMin, histoParameters_cff::dzRes_nbin, histoParameters_cff::dzRes_rangeMax, histoParameters_cff::dzRes_rangeMin, histoParameters_cff::etaRes_nbin, histoParameters_cff::etaRes_rangeMax, histoParameters_cff::etaRes_rangeMin, edm::InputTag::instance(), edm::InputTag::label(), diffTwoXMLs::label, NewAssociators_cff::MABH, histoParameters_cff::maxCSCHit, histoParameters_cff::maxDTHit, gather_cfg::maxDxy, cutBasedMuonId_MuonPOG_V0_cff::maxDz, maxEta, histoParameters_cff::maxLayers, histoParameters_cff::maxNHit, MuonErrorMatrixAnalyzer_cfi::maxPhi, histoParameters_cff::maxPixels, MuonErrorMatrixAnalyzer_cfi::maxPt, pileupFilter_cff::maxPU, histoParameters_cff::maxRPCHit, histoParameters_cff::maxRpos, Validation_cff::maxZpos, histoParameters_cff::minCSCHit, histoParameters_cff::minDTHit, Validation_cff::minDxy, Validation_cff::minDz, cutBasedElectronID_CSA14_50ns_V0_cff::minEta, dt1dClusters_cfi::minLayers, histoParameters_cff::minNHit, MuonErrorMatrixAnalyzer_cfi::minPhi, histoParameters_cff::minPixels, lostTracks_cfi::minPt, pileupFilter_cff::minPU, histoParameters_cff::minRPCHit, histoParameters_cff::minRpos, Validation_cff::minZpos, histoParameters_cff::nintCSCHit, histoParameters_cff::nintDTHit, Validation_cff::nintDxy, Validation_cff::nintDz, Validation_cff::nintEta, histoParameters_cff::nintLayers, histoParameters_cff::nintNHit, histoParameters_cff::nintPhi, histoParameters_cff::nintPixels, Validation_cff::nintPt, histoParameters_cff::nintPU, histoParameters_cff::nintRPCHit, histoParameters_cff::nintRpos, Validation_cff::nintZpos, Validation_cff::phiRes_nbin, Validation_cff::phiRes_rangeMax, Validation_cff::phiRes_rangeMin, edm::InputTag::process(), histoParameters_cff::ptRes_nbin, histoParameters_cff::ptRes_rangeMax, histoParameters_cff::ptRes_rangeMin, python.rootplot.root2matplotlib::replace(), DQMStore::IBooker::setCurrentFolder(), and Validation_cff::useLogPt.

Referenced by ~NewMuonTrackValidator().

25  {
26 
27  for (unsigned int ww=0;ww<associators.size();ww++){
28  for (unsigned int www=0;www<label.size();www++){
29 
30  ibooker.cd();
31  InputTag algo = label[www];
32  string dirName=dirName_;
33  if (algo.process()!="")
34  dirName+=algo.process()+"_";
35  if(algo.label()!="")
36  dirName+=algo.label();
37  if(algo.instance()!="")
38  dirName+=("_"+algo.instance());
39  if (dirName.find("Tracks")<dirName.length()){
40  dirName.replace(dirName.find("Tracks"),6,"Trks");
41  }
42  if (dirName.find("UpdatedAtVtx")<dirName.length()){
43  dirName.replace(dirName.find("UpdatedAtVtx"),12,"UpdAtVtx");
44  }
45  string assoc= associators[ww];
46  if (assoc.find("tpToTkmuTrackAssociation")<assoc.length()){
47  dirName+="_TkAsso";
48  }
49  std::replace(dirName.begin(), dirName.end(), ':', '_');
50  ibooker.setCurrentFolder(dirName.c_str());
51 
52  h_tracks.push_back( ibooker.book1D("Ntracks","Number of reconstructed tracks",100,-0.5,99.5) );
53  h_fakes.push_back( ibooker.book1D("Nfakes","Number of fake reco tracks",20,-0.5,19.5) );
54  h_charge.push_back( ibooker.book1D("Ncharge","track charge",3,-1.5,1.5) );
55 
56  h_recoeta.push_back( ibooker.book1D("num_reco_eta","N of reco track vs eta",nintEta,minEta,maxEta) );
57  h_assoceta.push_back( ibooker.book1D("num_assoSimToReco_eta","N of associated tracks (simToReco) vs eta",nintEta,minEta,maxEta) );
58  h_assoc2eta.push_back( ibooker.book1D("num_assoRecoToSim_eta","N of associated (recoToSim) tracks vs eta",nintEta,minEta,maxEta) );
59  h_simuleta.push_back( ibooker.book1D("num_simul_eta","N of simulated tracks vs eta",nintEta,minEta,maxEta) );
60  h_misideta.push_back( ibooker.book1D("num_chargemisid_eta","N of associated (simToReco) tracks with charge misID vs eta",nintEta,minEta,maxEta) );
61 
62  h_recopT.push_back( ibooker.book1D("num_reco_pT","N of reco track vs pT",nintPt,minPt,maxPt) );
63  h_assocpT.push_back( ibooker.book1D("num_assoSimToReco_pT","N of associated tracks (simToReco) vs pT",nintPt,minPt,maxPt) );
64  h_assoc2pT.push_back( ibooker.book1D("num_assoRecoToSim_pT","N of associated (recoToSim) tracks vs pT",nintPt,minPt,maxPt) );
65  h_simulpT.push_back( ibooker.book1D("num_simul_pT","N of simulated tracks vs pT",nintPt,minPt,maxPt) );
66  h_misidpT.push_back( ibooker.book1D("num_chargemisid_pT","N of associated (simToReco) tracks with charge misID vs pT",nintPt,minPt,maxPt) );
67 
68  h_recophi.push_back( ibooker.book1D("num_reco_phi","N of reco track vs phi",nintPhi,minPhi,maxPhi) );
69  h_assocphi.push_back( ibooker.book1D("num_assoSimToReco_phi","N of associated tracks (simToReco) vs phi",nintPhi,minPhi,maxPhi) );
70  h_assoc2phi.push_back( ibooker.book1D("num_assoRecoToSim_phi","N of associated (recoToSim) tracks vs phi",nintPhi,minPhi,maxPhi) );
71  h_simulphi.push_back( ibooker.book1D("num_simul_phi","N of simulated tracks vs phi",nintPhi,minPhi,maxPhi) );
72  h_misidphi.push_back( ibooker.book1D("num_chargemisid_phi","N of associated (simToReco) tracks with charge misID vs phi",nintPhi,minPhi,maxPhi) );
73 
74  h_recohit.push_back( ibooker.book1D("num_reco_hit","N of reco tracks vs N SimHits",nintNHit,minNHit,maxNHit) );
75  h_assochit.push_back( ibooker.book1D("num_assoSimToReco_hit","N of associated tracks (simToReco) vs N SimHits",nintNHit,minNHit,maxNHit) );
76  h_assoc2hit.push_back( ibooker.book1D("num_assoRecoToSim_hit","N of associated (recoToSim) tracks vs N Rechits",nintNHit,minNHit,maxNHit) );
77  h_simulhit.push_back( ibooker.book1D("num_simul_hit","N of simulated tracks vs N SimHits",nintNHit,minNHit,maxNHit) );
78  h_misidhit.push_back( ibooker.book1D("num_chargemisid_hit","N of associated (recoToSim) tracks with charge misID vs N RecHits",nintNHit,minNHit,maxNHit) );
79 
80  h_recodxy.push_back( ibooker.book1D("num_reco_dxy","N of reco track vs dxy",nintDxy,minDxy,maxDxy) );
81  h_assocdxy.push_back( ibooker.book1D("num_assoSimToReco_dxy","N of associated tracks (simToReco) vs dxy",nintDxy,minDxy,maxDxy) );
82  h_assoc2dxy.push_back( ibooker.book1D("num_assoRecoToSim_dxy","N of associated (recoToSim) tracks vs dxy",nintDxy,minDxy,maxDxy) );
83  h_simuldxy.push_back( ibooker.book1D("num_simul_dxy","N of simulated tracks vs dxy",nintDxy,minDxy,maxDxy) );
84  h_misiddxy.push_back( ibooker.book1D("num_chargemisid_dxy","N of associated (simToReco) tracks with charge misID vs dxy",nintDxy,minDxy,maxDxy) );
85  h_recodz.push_back( ibooker.book1D("num_reco_dz","N of reco track vs dz",nintDz,minDz,maxDz) );
86  h_assocdz.push_back( ibooker.book1D("num_assoSimToReco_dz","N of associated tracks (simToReco) vs dz",nintDz,minDz,maxDz) );
87  h_assoc2dz.push_back( ibooker.book1D("num_assoRecoToSim_dz","N of associated (recoToSim) tracks vs dz",nintDz,minDz,maxDz) );
88  h_simuldz.push_back( ibooker.book1D("num_simul_dz","N of simulated tracks vs dz",nintDz,minDz,maxDz) );
89  h_misiddz.push_back( ibooker.book1D("num_chargemisid_dz","N of associated (simToReco) tracks with charge misID vs dz",nintDz,minDz,maxDz) );
90 
91  h_assocRpos.push_back( ibooker.book1D("num_assoSimToReco_Rpos","N of associated tracks (simToReco) vs Radius",nintRpos,minRpos,maxRpos) );
92  h_simulRpos.push_back( ibooker.book1D("num_simul_Rpos","N of simulated tracks vs Radius",nintRpos,minRpos,maxRpos) );
93 
94  h_assocZpos.push_back( ibooker.book1D("num_assoSimToReco_Zpos","N of associated tracks (simToReco) vs Z",nintZpos,minZpos,maxZpos) );
95  h_simulZpos.push_back( ibooker.book1D("num_simul_Zpos","N of simulated tracks vs Z",nintZpos,minZpos,maxZpos) );
96 
97  h_recopu.push_back( ibooker.book1D("num_reco_pu","N of reco track vs pu",nintPU,minPU,maxPU) );
98  h_assocpu.push_back( ibooker.book1D("num_assoSimToReco_pu","N of associated tracks (simToReco) vs pu",nintPU,minPU,maxPU) );
99  h_assoc2pu.push_back( ibooker.book1D("num_assoRecoToSim_pu","N of associated (recoToSim) tracks vs pu",nintPU,minPU,maxPU) );
100  h_simulpu.push_back( ibooker.book1D("num_simul_pu","N of simulated tracks vs pu",nintPU,minPU,maxPU) );
101  h_misidpu.push_back( ibooker.book1D("num_chargemisid_pu","N of associated (simToReco) charge misIDed tracks vs pu",nintPU,minPU,maxPU) );
102 
103  h_nchi2.push_back( ibooker.book1D("chi2","Track normalized #chi^{2}", 80, 0., 20.) );
104  h_nchi2_prob.push_back( ibooker.book1D("chi2prob", "Probability of track normalized #chi^{2}",100,0.,1.) );
105 
106  chi2_vs_nhits.push_back( ibooker.book2D("chi2_vs_nhits","#chi^{2} vs nhits",nintNHit,minNHit,maxNHit,20,0.,10.) );
107  chi2_vs_eta.push_back( ibooker.book2D("chi2_vs_eta","chi2_vs_eta",nintEta,minEta,maxEta, 40, 0., 20. ));
108  chi2_vs_phi.push_back( ibooker.book2D("chi2_vs_phi","#chi^{2} vs #phi",nintPhi,minPhi,maxPhi, 40, 0., 20. ) );
109 
110  h_nhits.push_back( ibooker.book1D("nhits", "Number of hits per track", nintNHit,minNHit,maxNHit ) );
111  nhits_vs_eta.push_back( ibooker.book2D("nhits_vs_eta","Number of Hits vs eta",nintEta,minEta,maxEta,nintNHit,minNHit,maxNHit) );
112  nhits_vs_phi.push_back( ibooker.book2D("nhits_vs_phi","#hits vs #phi",nintPhi,minPhi,maxPhi,nintNHit,minNHit,maxNHit) );
113 
114  if (do_MUOhitsPlots) {
115  nDThits_vs_eta.push_back( ibooker.book2D("nDThits_vs_eta","Number of DT hits vs eta",nintEta,minEta,maxEta,nintDTHit,minDTHit,maxDTHit) );
116  nCSChits_vs_eta.push_back( ibooker.book2D("nCSChits_vs_eta","Number of CSC hits vs eta",nintEta,minEta,maxEta,nintCSCHit,minCSCHit,maxCSCHit) );
117  nRPChits_vs_eta.push_back( ibooker.book2D("nRPChits_vs_eta","Number of RPC hits vs eta",nintEta,minEta,maxEta,nintRPCHit,minRPCHit,maxRPCHit) );
118  if (useGEMs_)
119  nGEMhits_vs_eta.push_back( ibooker.book2D("nGEMhits_vs_eta","Number of GEM hits vs eta",nintEta,minEta,maxEta,nintNHit,minNHit,maxNHit) );
120  if(useME0_)
121  nME0hits_vs_eta.push_back( ibooker.book2D("nME0hits_vs_eta","Number of ME0 hits vs eta",nintEta,minEta,maxEta,nintNHit,minNHit,maxNHit) );
122 
123  }
124 
125  if (do_TRKhitsPlots) {
126  nTRK_LayersWithMeas_vs_eta.push_back(ibooker.book2D("nTRK_LayersWithMeas_vs_eta","# TRK Layers with measurement vs eta",
128  nPixel_LayersWithMeas_vs_eta.push_back(ibooker.book2D("nPixel_LayersWithMeas_vs_eta","Number of Pixel Layers with measurement vs eta",
130  h_nmisslayers_inner.push_back( ibooker.book1D("nTRK_misslayers_inner", "Number of missing inner TRK layers", nintLayers,minLayers,maxLayers ) );
131  h_nmisslayers_outer.push_back( ibooker.book1D("nTRK_misslayers_outer", "Number of missing outer TRK layers", nintLayers,minLayers,maxLayers ) );
132  h_nlosthits.push_back( ibooker.book1D("nlosthits", "Number of lost hits per track", 6,-0.5,5.5 ) );
133  nlosthits_vs_eta.push_back( ibooker.book2D("nlosthits_vs_eta","Number of lost hits per track vs eta",nintEta,minEta,maxEta,6,-0.5,5.5) );
134  }
135 
136  ptres_vs_eta.push_back(ibooker.book2D("ptres_vs_eta","p_{T} Relative Residual vs #eta",
138  ptres_vs_phi.push_back( ibooker.book2D("ptres_vs_phi","p_{T} Relative Residual vs #phi",
140  ptres_vs_pt.push_back(ibooker.book2D("ptres_vs_pt","p_{T} Relative Residual vs p_{T}",
142  h_ptpull.push_back( ibooker.book1D("ptpull", "p_{T} Pull", 100, -10., 10.) );
143  ptpull_vs_eta.push_back(ibooker.book2D("ptpull_vs_eta","p_{T} Pull vs #eta",nintEta,minEta,maxEta,100,-10.,10.));
144  ptpull_vs_phi.push_back(ibooker.book2D("ptpull_vs_phi","p_{T} Pull vs #phi",nintPhi,minPhi,maxPhi,100,-10.,10.));
145  h_qoverppull.push_back( ibooker.book1D("qoverppull","q/p Pull", 100, -10., 10.) );
146 
147  h_etaRes.push_back( ibooker.book1D("etaRes", "#eta residual", etaRes_nbin, etaRes_rangeMin, etaRes_rangeMax) );
148  etares_vs_eta.push_back( ibooker.book2D("etares_vs_eta","#eta Residual vs #eta",
150 
151  thetaCotres_vs_eta.push_back(ibooker.book2D("thetaCotres_vs_eta","cot(#theta) Residual vs #eta",
153  thetaCotres_vs_pt.push_back(ibooker.book2D("thetaCotres_vs_pt","cot(#theta) Residual vs p_{T}",
155  h_thetapull.push_back( ibooker.book1D("thetapull","#theta Pull",100,-10.,10.) );
156  thetapull_vs_eta.push_back(ibooker.book2D("thetapull_vs_eta","#theta Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
157  thetapull_vs_phi.push_back(ibooker.book2D("thetapull_vs_phi","#theta Pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
158 
159  phires_vs_eta.push_back(ibooker.book2D("phires_vs_eta","#phi Residual vs #eta",
161  phires_vs_pt.push_back(ibooker.book2D("phires_vs_pt","#phi Residual vs p_{T}",
163  phires_vs_phi.push_back(ibooker.book2D("phires_vs_phi","#phi Residual vs #phi",
165  h_phipull.push_back( ibooker.book1D("phipull","#phi Pull",100,-10.,10.) );
166  phipull_vs_eta.push_back(ibooker.book2D("phipull_vs_eta","#phi Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
167  phipull_vs_phi.push_back(ibooker.book2D("phipull_vs_phi","#phi Pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
168 
169  dxyres_vs_eta.push_back(ibooker.book2D("dxyres_vs_eta","dxy Residual vs #eta",
171  dxyres_vs_pt.push_back( ibooker.book2D("dxyres_vs_pt","dxy Residual vs p_{T}",
173  h_dxypull.push_back( ibooker.book1D("dxypull","dxy Pull",100,-10.,10.) );
174  dxypull_vs_eta.push_back(ibooker.book2D("dxypull_vs_eta","dxy Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
175 
176  dzres_vs_eta.push_back(ibooker.book2D("dzres_vs_eta","dz Residual vs #eta",
178  dzres_vs_pt.push_back(ibooker.book2D("dzres_vs_pt","dz Residual vs p_{T}",
180  h_dzpull.push_back( ibooker.book1D("dzpull","dz Pull",100,-10.,10.) );
181  dzpull_vs_eta.push_back(ibooker.book2D("dzpull_vs_eta","dz Pull vs #eta",nintEta,minEta,maxEta,100,-10,10));
182 
183  nRecHits_vs_nSimHits.push_back( ibooker.book2D("nRecHits_vs_nSimHits","nRecHits vs nSimHits",nintNHit,minNHit,maxNHit, nintNHit,minNHit,maxNHit ));
184 
185  if (MABH) {
186  h_PurityVsQuality.push_back
187  (ibooker.book2D("PurityVsQuality","Purity vs Quality (MABH)",20,0.01,1.01,20,0.01,1.01) );
188  }
189 
190  if (associators[ww]=="trackAssociatorByChi2"){
191  h_assochi2.push_back( ibooker.book1D("assocChi2","track association #chi^{2}",1000,0.,100.) );
192  h_assochi2_prob.push_back(ibooker.book1D("assocChi2_prob","probability of association #chi^{2}",100,0.,1.));
193  } else if (associators[ww]=="trackAssociatorByHits"){
194  h_assocFraction.push_back( ibooker.book1D("assocFraction","fraction of shared hits",22,0.,1.1) );
195  h_assocSharedHit.push_back(ibooker.book1D("assocSharedHit","number of shared hits",41,-0.5,40.5));
196  }
197 
198  if (useLogPt) {
199  BinLogX(h_simulpT.back()->getTH1F());
200  BinLogX(h_assocpT.back()->getTH1F());
201  BinLogX(h_recopT.back()->getTH1F());
202  BinLogX(h_assoc2pT.back()->getTH1F());
203  BinLogX(h_misidpT.back()->getTH1F());
204 
205  BinLogX(phires_vs_pt.back()->getTH2F());
206  BinLogX(thetaCotres_vs_pt.back()->getTH2F());
207  BinLogX(dxyres_vs_pt.back()->getTH2F());
208  BinLogX(dzres_vs_pt.back()->getTH2F());
209  BinLogX(ptres_vs_pt.back()->getTH2F());
210  }
211 
212  } //for (unsigned int www=0;www<label.size();www++)
213  } //for (unsigned int ww=0;ww<associators.size();ww++)
214 
215 }
std::vector< MonitorElement * > h_assocdxy
std::vector< MonitorElement * > dxyres_vs_pt
std::vector< MonitorElement * > h_misideta
std::vector< MonitorElement * > h_assochi2_prob
std::vector< MonitorElement * > h_recopu
std::vector< MonitorElement * > h_assoc2hit
std::vector< MonitorElement * > h_misiddz
std::vector< MonitorElement * > h_assocpT
std::vector< MonitorElement * > h_dxypull
std::vector< MonitorElement * > h_assoc2dz
std::vector< MonitorElement * > thetapull_vs_eta
std::vector< MonitorElement * > h_dzpull
std::vector< MonitorElement * > etares_vs_eta
std::vector< MonitorElement * > dxyres_vs_eta
void cd(void)
Definition: DQMStore.cc:269
std::vector< MonitorElement * > phires_vs_eta
std::vector< MonitorElement * > h_assocphi
std::vector< MonitorElement * > nhits_vs_eta
std::vector< MonitorElement * > nhits_vs_phi
std::vector< MonitorElement * > h_assocpu
std::vector< MonitorElement * > thetaCotres_vs_pt
std::vector< MonitorElement * > nDThits_vs_eta
std::vector< MonitorElement * > h_assocdz
std::vector< MonitorElement * > h_misidpu
std::vector< MonitorElement * > phipull_vs_phi
def replace(string, replacements)
std::vector< MonitorElement * > dzres_vs_pt
std::vector< MonitorElement * > dzpull_vs_eta
std::vector< MonitorElement * > h_recophi
std::vector< MonitorElement * > phipull_vs_eta
std::vector< MonitorElement * > h_recodz
std::vector< MonitorElement * > h_phipull
std::vector< MonitorElement * > chi2_vs_eta
std::vector< MonitorElement * > ptres_vs_phi
std::vector< MonitorElement * > h_nmisslayers_inner
std::vector< MonitorElement * > h_nlosthits
std::vector< MonitorElement * > h_assochi2
std::vector< MonitorElement * > nME0hits_vs_eta
std::vector< MonitorElement * > nRPChits_vs_eta
std::vector< MonitorElement * > h_assoceta
std::vector< MonitorElement * > h_recodxy
std::vector< MonitorElement * > h_simulhit
std::vector< MonitorElement * > h_thetapull
std::vector< MonitorElement * > h_ptpull
std::vector< MonitorElement * > h_assoc2dxy
std::vector< MonitorElement * > h_assoc2pu
std::vector< MonitorElement * > h_assocRpos
std::vector< MonitorElement * > ptpull_vs_phi
std::vector< MonitorElement * > thetaCotres_vs_eta
std::vector< MonitorElement * > h_misidpT
std::vector< MonitorElement * > h_tracks
std::vector< MonitorElement * > dzres_vs_eta
std::vector< MonitorElement * > chi2_vs_phi
std::vector< MonitorElement * > h_nhits
std::vector< MonitorElement * > h_assocZpos
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< MonitorElement * > nPixel_LayersWithMeas_vs_eta
std::vector< MonitorElement * > ptres_vs_pt
std::vector< MonitorElement * > h_nchi2
std::vector< MonitorElement * > dxypull_vs_eta
std::vector< MonitorElement * > h_fakes
std::vector< MonitorElement * > h_simulZpos
std::vector< MonitorElement * > phires_vs_pt
std::vector< MonitorElement * > h_simulphi
std::vector< MonitorElement * > h_recopT
std::vector< MonitorElement * > nTRK_LayersWithMeas_vs_eta
std::vector< MonitorElement * > nGEMhits_vs_eta
std::vector< MonitorElement * > h_simuldxy
std::vector< MonitorElement * > h_simuleta
std::vector< MonitorElement * > h_simulRpos
std::vector< MonitorElement * > nlosthits_vs_eta
std::vector< MonitorElement * > h_charge
std::vector< MonitorElement * > h_assoc2pT
std::vector< MonitorElement * > h_simuldz
std::vector< MonitorElement * > h_assocSharedHit
std::vector< MonitorElement * > h_etaRes
std::vector< MonitorElement * > h_assoc2eta
std::vector< MonitorElement * > ptpull_vs_eta
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::vector< std::string > associators
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::vector< MonitorElement * > nRecHits_vs_nSimHits
std::vector< MonitorElement * > nCSChits_vs_eta
std::vector< MonitorElement * > h_assocFraction
std::vector< MonitorElement * > thetapull_vs_phi
std::vector< MonitorElement * > h_assochit
std::vector< MonitorElement * > h_recohit
std::string const & label() const
Definition: InputTag.h:36
std::vector< MonitorElement * > h_simulpu
std::string const & process() const
Definition: InputTag.h:40
std::vector< MonitorElement * > h_nmisslayers_outer
std::vector< MonitorElement * > h_nchi2_prob
std::vector< MonitorElement * > chi2_vs_nhits
std::vector< MonitorElement * > h_simulpT
std::vector< edm::InputTag > label
std::vector< MonitorElement * > h_misidhit
std::vector< MonitorElement * > h_recoeta
std::vector< MonitorElement * > h_misidphi
std::vector< MonitorElement * > h_qoverppull
std::vector< MonitorElement * > phires_vs_phi
std::string const & instance() const
Definition: InputTag.h:37
std::vector< MonitorElement * > h_PurityVsQuality
std::vector< MonitorElement * > ptres_vs_eta
std::vector< MonitorElement * > h_assoc2phi
std::vector< MonitorElement * > h_misiddxy

Member Data Documentation

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

Definition at line 151 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

edm::InputTag NewMuonTrackValidator::associatormap
private

Definition at line 148 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

bool NewMuonTrackValidator::BiDirectional_RecoToSim_association
private

Definition at line 163 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

CosmicTrackingParticleSelector NewMuonTrackValidator::cosmictpSelector
private

Definition at line 160 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

std::string NewMuonTrackValidator::dirName_
private

Definition at line 147 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

bool NewMuonTrackValidator::MABH
private

Definition at line 165 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

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

Definition at line 150 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

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

Definition at line 149 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

TrackingParticleSelector NewMuonTrackValidator::tpSelector
private

Definition at line 159 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

bool NewMuonTrackValidator::UseAssociators
private

Definition at line 153 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

bool NewMuonTrackValidator::useGEMs_
private

Definition at line 154 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().

bool NewMuonTrackValidator::useME0_
private

Definition at line 155 of file NewMuonTrackValidator.h.

Referenced by NewMuonTrackValidator().