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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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

Private Attributes

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

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 30 of file PhysicsObjectsMonitor.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 31 of file PhysicsObjectsMonitor.cc.

References edm::ParameterSet::getUntrackedParameter().

31  {
32  theSTAMuonLabel = pset.getUntrackedParameter<string>("StandAloneTrackCollectionLabel");
33  theSeedCollectionLabel = pset.getUntrackedParameter<string>("MuonSeedCollectionLabel");
34  theDataType = pset.getUntrackedParameter<string>("DataType");
35 
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 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken_
PhysicsObjectsMonitor::~PhysicsObjectsMonitor ( )
override

Destructor.

Definition at line 49 of file PhysicsObjectsMonitor.cc.

49 {}

Member Function Documentation

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

Definition at line 75 of file PhysicsObjectsMonitor.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, TrajectoryStateClosestToPoint::charge(), MuonSubdetId::CSC, debug, DEFINE_FWK_MODULE, MuonSubdetId::DT, MuonPatternRecoDumper::dumpFTS(), edm::EventSetup::get(), reco::TransientTrack::impactPointTSCP(), PV3DBase< T, PVType, FrameType >::mag(), TrajectoryStateClosestToPoint::momentum(), PV3DBase< T, PVType, FrameType >::perp(), DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, reco::TransientTrack::recHitsBegin(), reco::TransientTrack::recHitsEnd(), recPt, MuonSubdetId::RPC, muonTagProbeFilters_cff::staTracks, TrajectoryStateClosestToPoint::theState(), HLT_2018_cff::track, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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  ESHandle<MagneticField> theMGField;
84  eventSetup.get<IdealMagneticFieldRecord>().get(theMGField);
85 
86  double recPt = 0.;
87  double simPt = 0.;
88 
89  reco::TrackCollection::const_iterator staTrack;
90 
91  edm::LogInfo("PhysicsObjectsMonitor") << "Reconstructed tracks: " << staTracks->size() << endl;
92  Nmuon->Fill(staTracks->size());
93  for (staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack) {
94  reco::TransientTrack track(*staTrack, &*theMGField);
95 
96  int nrechits = 0;
97  int nDThits = 0;
98  int nCSChits = 0;
99  int nRPChits = 0;
100 
101  for (trackingRecHit_iterator it = track.recHitsBegin(); it != track.recHitsEnd(); it++) {
102  if ((*it)->isValid()) {
103  edm::LogInfo("PhysicsObjectsMonitor") << "Analyzer: Aha this looks like a Rechit!" << std::endl;
104  if ((*it)->geographicalId().subdetId() == MuonSubdetId::DT) {
105  nDThits++;
106  } else if ((*it)->geographicalId().subdetId() == MuonSubdetId::CSC) {
107  nCSChits++;
108  } else if ((*it)->geographicalId().subdetId() == MuonSubdetId::RPC) {
109  nRPChits++;
110  } else {
111  edm::LogInfo("PhysicsObjectsMonitor") << "This is an UNKNOWN hit !! " << std::endl;
112  }
113  nrechits++;
114  }
115  }
116 
117  Nrechits->Fill(nrechits);
118  NDThits->Fill(nDThits);
119  NCSChits->Fill(nCSChits);
120  DTvsCSC->Fill(nDThits, nCSChits);
121  NRPChits->Fill(nRPChits);
122 
123  debug.dumpFTS(track.impactPointTSCP().theState());
124 
125  recPt = track.impactPointTSCP().momentum().perp();
126  edm::LogInfo("PhysicsObjectsMonitor")
127  << " p: " << track.impactPointTSCP().momentum().mag() << " pT: " << recPt << endl;
128  pt->Fill(recPt);
129  ptot->Fill(track.impactPointTSCP().momentum().mag());
130  charge->Fill(track.impactPointTSCP().charge());
131  px->Fill(track.impactPointTSCP().momentum().x());
132  py->Fill(track.impactPointTSCP().momentum().y());
133  pz->Fill(track.impactPointTSCP().momentum().z());
134  }
135  edm::LogInfo("PhysicsObjectsMonitor") << "---" << endl;
136  if (recPt && theDataType == "SimData") {
137  hPres->Fill((recPt - simPt) / simPt);
138  h1_Pres->Fill((1 / recPt - 1 / simPt) / (1 / simPt));
139  }
140 }
std::string dumpFTS(const FreeTrajectoryState &fts) const
void Fill(long long x)
#define debug
Definition: HDRShower.cc:19
static constexpr int RPC
Definition: MuonSubdetId.h:13
edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken_
T get() const
Definition: EventSetup.h:73
double recPt
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
void PhysicsObjectsMonitor::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 51 of file PhysicsObjectsMonitor.cc.

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

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 }

Member Data Documentation

MonitorElement* PhysicsObjectsMonitor::charge
private
MonitorElement* PhysicsObjectsMonitor::CSCvsRPC
private

Definition at line 61 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::DTvsCSC
private

Definition at line 59 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::DTvsRPC
private

Definition at line 60 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::h1_Pres
private

Definition at line 46 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::hPres
private

Definition at line 45 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::NCSChits
private

Definition at line 58 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::NDThits
private

Definition at line 57 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::Nmuon
private

Definition at line 55 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::Nrechits
private

Definition at line 56 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::NRPChits
private

Definition at line 62 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::pt
private
MonitorElement* PhysicsObjectsMonitor::ptot
private

Definition at line 50 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::px
private

Definition at line 52 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::py
private

Definition at line 53 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::pz
private

Definition at line 54 of file PhysicsObjectsMonitor.h.

std::string PhysicsObjectsMonitor::theDataType
private

Definition at line 64 of file PhysicsObjectsMonitor.h.

std::string PhysicsObjectsMonitor::theSeedCollectionLabel
private

Definition at line 42 of file PhysicsObjectsMonitor.h.

std::string PhysicsObjectsMonitor::theSTAMuonLabel
private

Definition at line 41 of file PhysicsObjectsMonitor.h.

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

Definition at line 67 of file PhysicsObjectsMonitor.h.