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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > 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 &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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)
 
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 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::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 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 31 of file PhysicsObjectsMonitor.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file PhysicsObjectsMonitor.cc.

References edm::ParameterSet::getUntrackedParameter().

32  {
34  pset.getUntrackedParameter<string>("StandAloneTrackCollectionLabel");
36  pset.getUntrackedParameter<string>("MuonSeedCollectionLabel");
37  theDataType = pset.getUntrackedParameter<string>("DataType");
38 
39  if (theDataType != "RealData" && theDataType != "SimData")
40  edm::LogInfo("PhysicsObjectsMonitor") << "Error in Data Type!!" << endl;
41 
42  if (theDataType == "SimData") {
43  edm::LogInfo("PhysicsObjectsMonitor")
44  << "Sorry! Running this package on simulation is no longer supported! ";
45  }
46 
47  // set Token(-s)
48  theSTAMuonToken_ = consumes<reco::TrackCollection>(
49  pset.getUntrackedParameter<string>("StandAloneTrackCollectionLabel"));
50 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken_
PhysicsObjectsMonitor::~PhysicsObjectsMonitor ( )
override

Destructor.

Definition at line 53 of file PhysicsObjectsMonitor.cc.

53 {}

Member Function Documentation

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

Definition at line 86 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(), EnergyCorrector::pt, reco::TransientTrack::recHitsBegin(), reco::TransientTrack::recHitsEnd(), recPt, MuonSubdetId::RPC, TrajectoryStateClosestToPoint::theState(), HiIsolationCommonParameters_cff::track, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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

Implements DQMEDAnalyzer.

Definition at line 55 of file PhysicsObjectsMonitor.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), ALCARECOTkAlJpsiMuMu_cff::charge, MonitorElement::getTH2F(), EnergyCorrector::pt, and DQMStore::IBooker::setCurrentFolder().

57  {
58  iBooker.setCurrentFolder("PhysicsObjects/MuonReconstruction");
59 
60  hPres = iBooker.book1D("pTRes", "pT Resolution", 100, -2, 2);
61  h1_Pres = iBooker.book1D("invPTRes", "1/pT Resolution", 100, -2, 2);
62 
63  charge = iBooker.book1D("charge", "track charge", 5, -2.5, 2.5);
64  ptot = iBooker.book1D("ptot", "track momentum", 50, 0, 50);
65  pt = iBooker.book1D("pt", "track pT", 100, 0, 50);
66  px = iBooker.book1D("px ", "track px", 100, -50, 50);
67  py = iBooker.book1D("py", "track py", 100, -50, 50);
68  pz = iBooker.book1D("pz", "track pz", 100, -50, 50);
69  Nmuon = iBooker.book1D("Nmuon", "Number of muon tracks", 11, -.5, 10.5);
70  Nrechits = iBooker.book1D("Nrechits", "Number of RecHits/Segments on track",
71  21, -.5, 21.5);
72  NDThits = iBooker.book1D("NDThits", "Number of DT Hits/Segments on track", 31,
73  -.5, 31.5);
74  NCSChits = iBooker.book1D("NCSChits", "Number of CSC Hits/Segments on track",
75  31, -.5, 31.5);
76  NRPChits =
77  iBooker.book1D("NRPChits", "Number of RPC hits on track", 11, -.5, 11.5);
78 
79  DTvsCSC = iBooker.book2D("DTvsCSC", "Number of DT vs CSC hits on track", 29,
80  -.5, 28.5, 29, -.5, 28.5);
81  TH2F* root_ob = DTvsCSC->getTH2F();
82  root_ob->SetXTitle("Number of DT hits");
83  root_ob->SetYTitle("Number of CSC hits");
84 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
TH2F * getTH2F() const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136

Member Data Documentation

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

Definition at line 63 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::DTvsCSC
private

Definition at line 61 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::DTvsRPC
private

Definition at line 62 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::h1_Pres
private

Definition at line 48 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::hPres
private

Definition at line 47 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::NCSChits
private

Definition at line 60 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::NDThits
private

Definition at line 59 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::Nmuon
private

Definition at line 57 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::Nrechits
private

Definition at line 58 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::NRPChits
private

Definition at line 64 of file PhysicsObjectsMonitor.h.

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

Definition at line 52 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::px
private

Definition at line 54 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::py
private

Definition at line 55 of file PhysicsObjectsMonitor.h.

MonitorElement* PhysicsObjectsMonitor::pz
private

Definition at line 56 of file PhysicsObjectsMonitor.h.

std::string PhysicsObjectsMonitor::theDataType
private

Definition at line 66 of file PhysicsObjectsMonitor.h.

std::string PhysicsObjectsMonitor::theSeedCollectionLabel
private

Definition at line 44 of file PhysicsObjectsMonitor.h.

std::string PhysicsObjectsMonitor::theSTAMuonLabel
private

Definition at line 43 of file PhysicsObjectsMonitor.h.

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

Definition at line 69 of file PhysicsObjectsMonitor.h.