CMS 3D CMS Logo

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

#include <PhysicsObjectsMonitor.h>

Inheritance diagram for PhysicsObjectsMonitor:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

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 one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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_
 

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
static const int CSC
Definition: MuonSubdetId.h:13
#define debug
Definition: HDRShower.cc:19
edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken_
static const int RPC
Definition: MuonSubdetId.h:14
T get() const
Definition: EventSetup.h:62
static const int DT
Definition: MuonSubdetId.h:12
double recPt
void PhysicsObjectsMonitor::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

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 }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
TH2F * getTH2F() const
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109

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.