CMS 3D CMS Logo

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

#include <PhysicsObjectsMonitor.h>

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

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

Private Attributes

MonitorElementcharge
 
MonitorElementCSCvsRPC
 
MonitorElementDTvsCSC
 
MonitorElementDTvsRPC
 
MonitorElementh1_Pres
 
MonitorElementhPres
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagFiledToken_
 
MonitorElementNCSChits
 
MonitorElementNDThits
 
MonitorElementNmuon
 
MonitorElementNrechits
 
MonitorElementNRPChits
 
MonitorElementpt
 
MonitorElementptot
 
MonitorElementpx
 
MonitorElementpy
 
MonitorElementpz
 
std::string theDataType
 
std::string theSeedCollectionLabel
 
std::string theSTAMuonLabel
 
edm::EDGetTokenT< reco::TrackCollectiontheSTAMuonToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

For now: Analyzer of StandAlone muon tracks Later: Add other detectors and more Reco

Author
M. Mulders - CERN marti.nosp@m.jn.m.nosp@m.ulder.nosp@m.s@ce.nosp@m.rn.ch Based on STAMuonAnalyzer by R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Analyzer of the StandAlone muon tracks

Author
M. Mulders - CERN marti.nosp@m.jn.m.nosp@m.ulder.nosp@m.s@ce.nosp@m.rn.ch Based on STAMuonAnalyzer by R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 32 of file PhysicsObjectsMonitor.h.

Constructor & Destructor Documentation

◆ PhysicsObjectsMonitor()

PhysicsObjectsMonitor::PhysicsObjectsMonitor ( const edm::ParameterSet pset)

Constructor.

Definition at line 31 of file PhysicsObjectsMonitor.cc.

31  {
32  theSTAMuonLabel = pset.getUntrackedParameter<string>("StandAloneTrackCollectionLabel");
33  theSeedCollectionLabel = pset.getUntrackedParameter<string>("MuonSeedCollectionLabel");
34  theDataType = pset.getUntrackedParameter<string>("DataType");
36  if (theDataType != "RealData" && theDataType != "SimData")
37  edm::LogInfo("PhysicsObjectsMonitor") << "Error in Data Type!!" << endl;
38 
39  if (theDataType == "SimData") {
40  edm::LogInfo("PhysicsObjectsMonitor") << "Sorry! Running this package on simulation is no longer supported! ";
41  }
42 
43  // set Token(-s)
45  consumes<reco::TrackCollection>(pset.getUntrackedParameter<string>("StandAloneTrackCollectionLabel"));
46 }

References DeDxTools::esConsumes(), and muonDTDigis_cfi::pset.

◆ ~PhysicsObjectsMonitor()

PhysicsObjectsMonitor::~PhysicsObjectsMonitor ( )
override

Destructor.

Definition at line 49 of file PhysicsObjectsMonitor.cc.

49 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 75 of file PhysicsObjectsMonitor.cc.

75  {
76  edm::LogInfo("PhysicsObjectsMonitor") << "Run: " << event.id().run() << " Event: " << event.id().event();
78 
79  // Get the RecTrack collection from the event
81  event.getByToken(theSTAMuonToken_, staTracks);
82 
83  const auto &theMGField = eventSetup.getHandle(magFiledToken_);
84 
85  double recPt = 0.;
86  double simPt = 0.;
87 
88  reco::TrackCollection::const_iterator staTrack;
89 
90  edm::LogInfo("PhysicsObjectsMonitor") << "Reconstructed tracks: " << staTracks->size() << endl;
91  Nmuon->Fill(staTracks->size());
92  for (staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack) {
93  reco::TransientTrack track(*staTrack, &*theMGField);
94 
95  int nrechits = 0;
96  int nDThits = 0;
97  int nCSChits = 0;
98  int nRPChits = 0;
99 
100  for (trackingRecHit_iterator it = track.recHitsBegin(); it != track.recHitsEnd(); it++) {
101  if ((*it)->isValid()) {
102  edm::LogInfo("PhysicsObjectsMonitor") << "Analyzer: Aha this looks like a Rechit!" << std::endl;
103  if ((*it)->geographicalId().subdetId() == MuonSubdetId::DT) {
104  nDThits++;
105  } else if ((*it)->geographicalId().subdetId() == MuonSubdetId::CSC) {
106  nCSChits++;
107  } else if ((*it)->geographicalId().subdetId() == MuonSubdetId::RPC) {
108  nRPChits++;
109  } else {
110  edm::LogInfo("PhysicsObjectsMonitor") << "This is an UNKNOWN hit !! " << std::endl;
111  }
112  nrechits++;
113  }
114  }
115 
116  Nrechits->Fill(nrechits);
117  NDThits->Fill(nDThits);
118  NCSChits->Fill(nCSChits);
119  DTvsCSC->Fill(nDThits, nCSChits);
120  NRPChits->Fill(nRPChits);
121 
122  debug.dumpFTS(track.impactPointTSCP().theState());
123 
124  recPt = track.impactPointTSCP().momentum().perp();
125  edm::LogInfo("PhysicsObjectsMonitor")
126  << " p: " << track.impactPointTSCP().momentum().mag() << " pT: " << recPt << endl;
127  pt->Fill(recPt);
128  ptot->Fill(track.impactPointTSCP().momentum().mag());
129  charge->Fill(track.impactPointTSCP().charge());
130  px->Fill(track.impactPointTSCP().momentum().x());
131  py->Fill(track.impactPointTSCP().momentum().y());
132  pz->Fill(track.impactPointTSCP().momentum().z());
133  }
134  edm::LogInfo("PhysicsObjectsMonitor") << "---" << endl;
135  if (recPt && theDataType == "SimData") {
136  hPres->Fill((recPt - simPt) / simPt);
137  h1_Pres->Fill((1 / recPt - 1 / simPt) / (1 / simPt));
138  }
139 }

References ALCARECOTkAlJpsiMuMu_cff::charge, MuonSubdetId::CSC, debug, MuonSubdetId::DT, edm::EventSetup::getHandle(), DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, recPt, MuonSubdetId::RPC, muonTagProbeFilters_cff::staTracks, and HLT_FULL_cff::track.

◆ bookHistograms()

void PhysicsObjectsMonitor::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 51 of file PhysicsObjectsMonitor.cc.

51  {
52  iBooker.setCurrentFolder("PhysicsObjects/MuonReconstruction");
53 
54  hPres = iBooker.book1D("pTRes", "pT Resolution", 100, -2, 2);
55  h1_Pres = iBooker.book1D("invPTRes", "1/pT Resolution", 100, -2, 2);
56 
57  charge = iBooker.book1D("charge", "track charge", 5, -2.5, 2.5);
58  ptot = iBooker.book1D("ptot", "track momentum", 50, 0, 50);
59  pt = iBooker.book1D("pt", "track pT", 100, 0, 50);
60  px = iBooker.book1D("px ", "track px", 100, -50, 50);
61  py = iBooker.book1D("py", "track py", 100, -50, 50);
62  pz = iBooker.book1D("pz", "track pz", 100, -50, 50);
63  Nmuon = iBooker.book1D("Nmuon", "Number of muon tracks", 11, -.5, 10.5);
64  Nrechits = iBooker.book1D("Nrechits", "Number of RecHits/Segments on track", 21, -.5, 21.5);
65  NDThits = iBooker.book1D("NDThits", "Number of DT Hits/Segments on track", 31, -.5, 31.5);
66  NCSChits = iBooker.book1D("NCSChits", "Number of CSC Hits/Segments on track", 31, -.5, 31.5);
67  NRPChits = iBooker.book1D("NRPChits", "Number of RPC hits on track", 11, -.5, 11.5);
68 
69  DTvsCSC = iBooker.book2D("DTvsCSC", "Number of DT vs CSC hits on track", 29, -.5, 28.5, 29, -.5, 28.5);
70  TH2F *root_ob = DTvsCSC->getTH2F();
71  root_ob->SetXTitle("Number of DT hits");
72  root_ob->SetYTitle("Number of CSC hits");
73 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), ALCARECOTkAlJpsiMuMu_cff::charge, dqm::legacy::MonitorElement::getTH2F(), DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, and dqm::implementation::NavigatorBase::setCurrentFolder().

Member Data Documentation

◆ charge

MonitorElement* PhysicsObjectsMonitor::charge
private

Definition at line 51 of file PhysicsObjectsMonitor.h.

◆ CSCvsRPC

MonitorElement* PhysicsObjectsMonitor::CSCvsRPC
private

Definition at line 63 of file PhysicsObjectsMonitor.h.

◆ DTvsCSC

MonitorElement* PhysicsObjectsMonitor::DTvsCSC
private

Definition at line 61 of file PhysicsObjectsMonitor.h.

◆ DTvsRPC

MonitorElement* PhysicsObjectsMonitor::DTvsRPC
private

Definition at line 62 of file PhysicsObjectsMonitor.h.

◆ h1_Pres

MonitorElement* PhysicsObjectsMonitor::h1_Pres
private

Definition at line 48 of file PhysicsObjectsMonitor.h.

◆ hPres

MonitorElement* PhysicsObjectsMonitor::hPres
private

Definition at line 47 of file PhysicsObjectsMonitor.h.

◆ magFiledToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> PhysicsObjectsMonitor::magFiledToken_
private

Definition at line 70 of file PhysicsObjectsMonitor.h.

◆ NCSChits

MonitorElement* PhysicsObjectsMonitor::NCSChits
private

Definition at line 60 of file PhysicsObjectsMonitor.h.

◆ NDThits

MonitorElement* PhysicsObjectsMonitor::NDThits
private

Definition at line 59 of file PhysicsObjectsMonitor.h.

◆ Nmuon

MonitorElement* PhysicsObjectsMonitor::Nmuon
private

Definition at line 57 of file PhysicsObjectsMonitor.h.

◆ Nrechits

MonitorElement* PhysicsObjectsMonitor::Nrechits
private

Definition at line 58 of file PhysicsObjectsMonitor.h.

◆ NRPChits

MonitorElement* PhysicsObjectsMonitor::NRPChits
private

Definition at line 64 of file PhysicsObjectsMonitor.h.

◆ pt

MonitorElement* PhysicsObjectsMonitor::pt
private

◆ ptot

MonitorElement* PhysicsObjectsMonitor::ptot
private

Definition at line 52 of file PhysicsObjectsMonitor.h.

◆ px

MonitorElement* PhysicsObjectsMonitor::px
private

Definition at line 54 of file PhysicsObjectsMonitor.h.

◆ py

MonitorElement* PhysicsObjectsMonitor::py
private

Definition at line 55 of file PhysicsObjectsMonitor.h.

◆ pz

MonitorElement* PhysicsObjectsMonitor::pz
private

Definition at line 56 of file PhysicsObjectsMonitor.h.

◆ theDataType

std::string PhysicsObjectsMonitor::theDataType
private

Definition at line 66 of file PhysicsObjectsMonitor.h.

◆ theSeedCollectionLabel

std::string PhysicsObjectsMonitor::theSeedCollectionLabel
private

Definition at line 44 of file PhysicsObjectsMonitor.h.

◆ theSTAMuonLabel

std::string PhysicsObjectsMonitor::theSTAMuonLabel
private

Definition at line 43 of file PhysicsObjectsMonitor.h.

◆ theSTAMuonToken_

edm::EDGetTokenT<reco::TrackCollection> PhysicsObjectsMonitor::theSTAMuonToken_
private

Definition at line 69 of file PhysicsObjectsMonitor.h.

PhysicsObjectsMonitor::NCSChits
MonitorElement * NCSChits
Definition: PhysicsObjectsMonitor.h:60
PhysicsObjectsMonitor::magFiledToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFiledToken_
Definition: PhysicsObjectsMonitor.h:70
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
PhysicsObjectsMonitor::hPres
MonitorElement * hPres
Definition: PhysicsObjectsMonitor.h:47
PhysicsObjectsMonitor::pz
MonitorElement * pz
Definition: PhysicsObjectsMonitor.h:56
PhysicsObjectsMonitor::NDThits
MonitorElement * NDThits
Definition: PhysicsObjectsMonitor.h:59
PhysicsObjectsMonitor::h1_Pres
MonitorElement * h1_Pres
Definition: PhysicsObjectsMonitor.h:48
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< reco::TrackCollection >
PhysicsObjectsMonitor::px
MonitorElement * px
Definition: PhysicsObjectsMonitor.h:54
PhysicsObjectsMonitor::theDataType
std::string theDataType
Definition: PhysicsObjectsMonitor.h:66
PhysicsObjectsMonitor::Nrechits
MonitorElement * Nrechits
Definition: PhysicsObjectsMonitor.h:58
recPt
double recPt
Definition: PFJetBenchmarkAnalyzer.cc:75
PhysicsObjectsMonitor::NRPChits
MonitorElement * NRPChits
Definition: PhysicsObjectsMonitor.h:64
PhysicsObjectsMonitor::theSTAMuonLabel
std::string theSTAMuonLabel
Definition: PhysicsObjectsMonitor.h:43
dqm::impl::MonitorElement::getTH2F
virtual TH2F * getTH2F()
Definition: MonitorElement.cc:995
debug
#define debug
Definition: HDRShower.cc:19
MuonPatternRecoDumper
Definition: MuonPatternRecoDumper.h:18
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
PhysicsObjectsMonitor::theSeedCollectionLabel
std::string theSeedCollectionLabel
Definition: PhysicsObjectsMonitor.h:44
PhysicsObjectsMonitor::charge
MonitorElement * charge
Definition: PhysicsObjectsMonitor.h:51
PhysicsObjectsMonitor::ptot
MonitorElement * ptot
Definition: PhysicsObjectsMonitor.h:52
PhysicsObjectsMonitor::pt
MonitorElement * pt
Definition: PhysicsObjectsMonitor.h:53
PhysicsObjectsMonitor::Nmuon
MonitorElement * Nmuon
Definition: PhysicsObjectsMonitor.h:57
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
muonTagProbeFilters_cff.staTracks
staTracks
Definition: muonTagProbeFilters_cff.py:29
PhysicsObjectsMonitor::theSTAMuonToken_
edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken_
Definition: PhysicsObjectsMonitor.h:69
PhysicsObjectsMonitor::DTvsCSC
MonitorElement * DTvsCSC
Definition: PhysicsObjectsMonitor.h:61
reco::TransientTrack
Definition: TransientTrack.h:19
PhysicsObjectsMonitor::py
MonitorElement * py
Definition: PhysicsObjectsMonitor.h:55
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
dqm::implementation::IBooker::book2D
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:177
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98