CMS 3D CMS Logo

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

#include <GEMDigiTrackMatch.h>

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

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GEMDigiTrackMatch (const edm::ParameterSet &ps)
 
 ~GEMDigiTrackMatch () override
 
- Public Member Functions inherited from GEMTrackMatch
void buildLUT (const int maxChamberId)
 
void FillWithTrigger (MonitorElement *me[3], Float_t eta)
 
void FillWithTrigger (MonitorElement *me[3][3], Float_t eta, Float_t phi, bool odd[3], bool even[3])
 
void FillWithTrigger (MonitorElement *me[4][3], bool array[3][2], Float_t value)
 
void FillWithTrigger (MonitorElement *me[4][3][3], bool array[3][2], Float_t eta, Float_t phi, bool odd[3], bool even[3])
 
 GEMTrackMatch (const edm::ParameterSet &cfg)
 
std::pair< int, int > getClosestChambers (const int maxChamberId, int region, float phi)
 
std::pair< double, double > getEtaRange (int station, int chamber)
 
std::pair< double, double > getEtaRangeForPhi (int station)
 
bool isSimTrackGood (const SimTrack &)
 
void setGeometry (const GEMGeometry &geom)
 
 ~GEMTrackMatch () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Attributes

MonitorElementcopad_eta [4][3]
 
MonitorElementcopad_phi [4][3][3]
 
MonitorElementdg_eta [4][3]
 
MonitorElementdg_phi [4][3][3]
 
MonitorElementdg_sh_eta [4][3]
 
MonitorElementdg_sh_phi [4][3][3]
 
edm::EDGetToken gem_copadToken_
 
edm::EDGetToken gem_digiToken_
 
edm::EDGetToken gem_padToken_
 
MonitorElementpad_eta [4][3]
 
MonitorElementpad_phi [4][3][3]
 
MonitorElementtrack_eta [3]
 
MonitorElementtrack_phi [3][3]
 

Additional Inherited Members

- Protected Attributes inherited from GEMTrackMatch
edm::ParameterSet cfg_
 
float chamberHeight_
 
bool detailPlot_
 
std::vector< double > etaRangeForPhi
 
const GEMGeometrygem_geom_
 
float maxEta_
 
float minEta_
 
float minPt_
 
std::pair< std::vector< float >, std::vector< int > > negativeLUT_
 
unsigned int nstation
 
std::pair< std::vector< float >, std::vector< int > > positiveLUT_
 
float radiusCenter_
 
edm::EDGetToken simHitsToken_
 
edm::EDGetToken simTracksToken_
 
edm::EDGetToken simVerticesToken_
 
int useRoll_
 

Detailed Description

Definition at line 14 of file GEMDigiTrackMatch.h.

Constructor & Destructor Documentation

GEMDigiTrackMatch::GEMDigiTrackMatch ( const edm::ParameterSet ps)
explicit

Definition at line 12 of file GEMDigiTrackMatch.cc.

References GEMTrackMatch::cfg_, GEMTrackMatch::detailPlot_, gem_copadToken_, gem_digiToken_, gem_padToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), GEMTrackMatch::simHitsToken_, GEMTrackMatch::simTracksToken_, GEMTrackMatch::simVerticesToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

12  : GEMTrackMatch(ps) {
13  std::string simInputLabel_ = ps.getUntrackedParameter<std::string>("simInputLabel");
14  simHitsToken_ = consumes<edm::PSimHitContainer>(edm::InputTag(simInputLabel_, "MuonGEMHits"));
15  simTracksToken_ = consumes<edm::SimTrackContainer>(ps.getParameter<edm::InputTag>("simTrackCollection"));
16  simVerticesToken_ = consumes<edm::SimVertexContainer>(ps.getParameter<edm::InputTag>("simVertexCollection"));
17 
18  gem_digiToken_ = consumes<GEMDigiCollection>(ps.getParameter<edm::InputTag>("gemDigiInput"));
19  gem_padToken_ = consumes<GEMPadDigiCollection>(ps.getParameter<edm::InputTag>("gemPadDigiInput"));
20  gem_copadToken_ = consumes<GEMCoPadDigiCollection>(ps.getParameter<edm::InputTag>("gemCoPadDigiInput"));
21  detailPlot_ = ps.getParameter<bool>("detailPlot");
22  cfg_ = ps;
23 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet cfg_
Definition: GEMTrackMatch.h:63
edm::EDGetToken simHitsToken_
Definition: GEMTrackMatch.h:64
edm::EDGetToken simVerticesToken_
Definition: GEMTrackMatch.h:66
edm::EDGetToken simTracksToken_
Definition: GEMTrackMatch.h:65
GEMTrackMatch(const edm::ParameterSet &cfg)
Definition: GEMTrackMatch.cc:6
edm::EDGetToken gem_copadToken_
edm::EDGetToken gem_digiToken_
edm::EDGetToken gem_padToken_
GEMDigiTrackMatch::~GEMDigiTrackMatch ( )
override

Definition at line 91 of file GEMDigiTrackMatch.cc.

91 {}

Member Function Documentation

void GEMDigiTrackMatch::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements GEMTrackMatch.

Definition at line 93 of file GEMDigiTrackMatch.cc.

References begin, GEMTrackMatch::cfg_, relativeConstraints::chamber, GEMDigiMatcher::chamberIds(), SimHitMatcher::chamberIdsGEM(), GEMDigiMatcher::chamberIdsWithPads(), copad_eta, copad_phi, gather_cfg::cout, edmIntegrityCheck::d, GEMTrackMatch::detailPlot_, dg_eta, dg_phi, dg_sh_eta, dg_sh_phi, end, MySimTrack::eta, lumiContext::fill, GEMTrackMatch::FillWithTrigger(), gem_copadToken_, MySimTrack::gem_dg, gem_digiToken_, MySimTrack::gem_pad, gem_padToken_, MySimTrack::gem_sh, relativeConstraints::geom, edm::EventSetup::get(), edm::Event::getByToken(), MySimTrack::hitEven, MySimTrack::hitOdd, mps_fire::i, triggerObjects_cff::id, GEMTrackMatch::isSimTrackGood(), edm::HandleBase::isValid(), pad_eta, pad_phi, MySimTrack::phi, edm::Handle< T >::product(), MySimTrack::pt, GEMTrackMatch::simHitsToken_, GEMTrackMatch::simTracksToken_, GEMTrackMatch::simVerticesToken_, protons_cff::t, track_eta, and track_phi.

93  {
95  iSetup.get<MuonGeometryRecord>().get(hGeom);
96  const GEMGeometry &geom = *hGeom;
97 
101  iEvent.getByToken(simHitsToken_, simhits);
102  iEvent.getByToken(simTracksToken_, sim_tracks);
103  iEvent.getByToken(simVerticesToken_, sim_vertices);
104  if (!simhits.isValid() || !sim_tracks.isValid() || !sim_vertices.isValid())
105  return;
106 
107  if (detailPlot_) {
111  iEvent.getByToken(simHitsToken_, simhits);
112  iEvent.getByToken(simTracksToken_, sim_tracks);
113  iEvent.getByToken(simVerticesToken_, sim_vertices);
114  if (!simhits.isValid() || !sim_tracks.isValid() || !sim_vertices.isValid())
115  return;
116 
117  // const edm::SimVertexContainer & sim_vert = *sim_vertices.product();
118  const edm::SimTrackContainer &sim_trks = *sim_tracks.product();
119  MySimTrack track_;
120  for (auto &t : sim_trks) {
121  if (!isSimTrackGood(t)) {
122  continue;
123  }
124 
125  // match hits and digis to this SimTrack
126 
127  const SimHitMatcher &match_sh =
129  const GEMDigiMatcher &match_gd =
131 
132  track_.pt = t.momentum().pt();
133  track_.phi = t.momentum().phi();
134  track_.eta = t.momentum().eta();
135  std::fill(std::begin(track_.hitOdd), std::end(track_.hitOdd), false);
136  std::fill(std::begin(track_.hitEven), std::end(track_.hitEven), false);
137 
138  for (int i = 0; i < 3; i++) {
139  for (int j = 0; j < 2; j++) {
140  track_.gem_sh[i][j] = false;
141  track_.gem_dg[i][j] = false;
142  track_.gem_pad[i][j] = false;
143  }
144  }
145 
146  // ** GEM SimHits ** //
147  const auto gem_sh_ids_ch = match_sh.chamberIdsGEM();
148  for (auto d : gem_sh_ids_ch) {
149  const GEMDetId id(d);
150  if (id.chamber() % 2 == 0)
151  track_.hitEven[id.station() - 1] = true;
152  else if (id.chamber() % 2 == 1)
153  track_.hitOdd[id.station() - 1] = true;
154  else {
155  std::cout << "Error to get chamber id" << std::endl;
156  }
157 
158  track_.gem_sh[id.station() - 1][(id.layer() - 1)] = true;
159  }
160  // ** GEM Digis, Pads and CoPads ** //
161  const auto gem_dg_ids_ch = match_gd.chamberIds();
162 
163  for (auto d : gem_dg_ids_ch) {
164  const GEMDetId id(d);
165  track_.gem_dg[id.station() - 1][(id.layer() - 1)] = true;
166  }
167  const auto gem_pad_ids_ch = match_gd.chamberIdsWithPads();
168  for (auto d : gem_pad_ids_ch) {
169  const GEMDetId id(d);
170  track_.gem_pad[id.station() - 1][(id.layer() - 1)] = true;
171  }
172 
173  FillWithTrigger(track_eta, fabs(track_.eta));
174  FillWithTrigger(track_phi, fabs(track_.eta), track_.phi, track_.hitOdd, track_.hitEven);
175 
176  FillWithTrigger(dg_sh_eta, track_.gem_sh, fabs(track_.eta));
177  FillWithTrigger(dg_eta, track_.gem_dg, fabs(track_.eta));
178  FillWithTrigger(pad_eta, track_.gem_pad, fabs(track_.eta));
179  FillWithTrigger(copad_eta, track_.gem_pad, fabs(track_.eta));
180 
181  // Separate station.
182 
183  FillWithTrigger(dg_sh_phi, track_.gem_sh, fabs(track_.eta), track_.phi, track_.hitOdd, track_.hitEven);
184  FillWithTrigger(dg_phi, track_.gem_dg, fabs(track_.eta), track_.phi, track_.hitOdd, track_.hitEven);
185  FillWithTrigger(pad_phi, track_.gem_pad, fabs(track_.eta), track_.phi, track_.hitOdd, track_.hitEven);
186  FillWithTrigger(copad_phi, track_.gem_pad, fabs(track_.eta), track_.phi, track_.hitOdd, track_.hitEven);
187  }
188  }
189 }
edm::ParameterSet cfg_
Definition: GEMTrackMatch.h:63
std::set< unsigned int > chamberIdsGEM() const
GEM chamber detIds with SimHits.
edm::EDGetToken simHitsToken_
Definition: GEMTrackMatch.h:64
edm::EDGetToken simVerticesToken_
Definition: GEMTrackMatch.h:66
MonitorElement * pad_phi[4][3][3]
bool hitOdd[3]
Definition: GEMTrackMatch.h:38
Float_t eta
Definition: GEMTrackMatch.h:27
MonitorElement * dg_phi[4][3][3]
MonitorElement * copad_phi[4][3][3]
int iEvent
Definition: GenABIO.cc:224
edm::EDGetToken simTracksToken_
Definition: GEMTrackMatch.h:65
MonitorElement * track_eta[3]
bool gem_dg[3][2]
Definition: GEMTrackMatch.h:35
#define end
Definition: vmac.h:39
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetToken gem_copadToken_
edm::EDGetToken gem_digiToken_
bool hitEven[3]
Definition: GEMTrackMatch.h:39
MonitorElement * track_phi[3][3]
Float_t pt
Definition: GEMTrackMatch.h:27
MonitorElement * pad_eta[4][3]
T const * product() const
Definition: Handle.h:74
MonitorElement * dg_sh_phi[4][3][3]
void FillWithTrigger(MonitorElement *me[3], Float_t eta)
MonitorElement * dg_eta[4][3]
bool gem_pad[3][2]
Definition: GEMTrackMatch.h:36
#define begin
Definition: vmac.h:32
std::set< unsigned int > chamberIdsWithPads() const
T get() const
Definition: EventSetup.h:71
Float_t phi
Definition: GEMTrackMatch.h:27
bool isSimTrackGood(const SimTrack &)
std::set< unsigned int > chamberIds() const
bool gem_sh[3][2]
Definition: GEMTrackMatch.h:34
edm::EDGetToken gem_padToken_
std::vector< SimTrack > SimTrackContainer
MonitorElement * dg_sh_eta[4][3]
MonitorElement * copad_eta[4][3]
void GEMDigiTrackMatch::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
override

Definition at line 25 of file GEMDigiTrackMatch.cc.

References DQMStore::IBooker::book1D(), GEMDetLabel::c_suffix, copad_eta, copad_phi, GEMTrackMatch::detailPlot_, dg_eta, dg_phi, dg_sh_eta, dg_sh_phi, relativeConstraints::geom, edm::EventSetup::get(), mps_fire::i, gen::k, GEMDetLabel::l_suffix, LogDebug, GEMTrackMatch::maxEta_, GEMTrackMatch::minEta_, GEMTrackMatch::nstation, pad_eta, pad_phi, Pi, PI, GEMGeometry::regions(), GEMDetLabel::s_suffix, DQMStore::IBooker::setCurrentFolder(), GEMTrackMatch::setGeometry(), AlCaHLTBitMon_QueryRunRegistry::string, createPayload::suffix, track_eta, and track_phi.

25  {
27  iSetup.get<MuonGeometryRecord>().get(hGeom);
28  const GEMGeometry &geom = *hGeom;
29  setGeometry(geom);
30 
31  ibooker.setCurrentFolder("MuonGEMDigisV/GEMDigisTask");
32  LogDebug("GEMDigiTrackMatch") << "ibooker set current folder\n";
33 
34  const float PI = TMath::Pi();
35 
36  nstation = geom.regions()[0]->stations().size();
37  if (detailPlot_) {
38  for (unsigned int j = 0; j < nstation; j++) {
39  string track_eta_name = string("track_eta") + s_suffix[j];
40  string track_eta_title = string("track_eta") + ";SimTrack |#eta|;# of tracks";
41  track_eta[j] = ibooker.book1D(track_eta_name.c_str(), track_eta_title.c_str(), 140, minEta_, maxEta_);
42 
43  for (unsigned int k = 0; k < 3; k++) {
44  string suffix = string(s_suffix[j]) + string(c_suffix[k]);
45  string track_phi_name = string("track_phi") + suffix;
46  string track_phi_title = string("track_phi") + suffix + ";SimTrack #phi;# of tracks";
47  track_phi[j][k] = ibooker.book1D(track_phi_name.c_str(), track_phi_title.c_str(), 200, -PI, PI);
48  }
49 
50  for (unsigned int i = 0; i < 4; i++) {
51  string suffix = string(s_suffix[j]) + string(l_suffix[i]);
52  string dg_eta_name = string("dg_eta") + suffix;
53  string dg_eta_title = dg_eta_name + "; tracks |#eta|; # of tracks";
54  dg_eta[i][j] = ibooker.book1D(dg_eta_name.c_str(), dg_eta_title.c_str(), 140, minEta_, maxEta_);
55 
56  string dg_sh_eta_name = string("dg_sh_eta") + suffix;
57  string dg_sh_eta_title = dg_sh_eta_name + "; tracks |#eta|; # of tracks";
58  dg_sh_eta[i][j] = ibooker.book1D(dg_sh_eta_name.c_str(), dg_sh_eta_title.c_str(), 140, minEta_, maxEta_);
59 
60  string pad_eta_name = string("pad_eta") + suffix;
61  string pad_eta_title = pad_eta_name + "; tracks |#eta|; # of tracks";
62  pad_eta[i][j] = ibooker.book1D(pad_eta_name.c_str(), pad_eta_title.c_str(), 140, minEta_, maxEta_);
63 
64  string copad_eta_name = string("copad_eta") + suffix;
65  string copad_eta_title = copad_eta_name + "; tracks |#eta|; # of tracks";
66  copad_eta[i][j] = ibooker.book1D(copad_eta_name.c_str(), copad_eta_title.c_str(), 140, minEta_, maxEta_);
67 
68  for (unsigned int k = 0; k < 3; k++) {
69  suffix = string(s_suffix[j]) + string(l_suffix[i]) + string(c_suffix[k]);
70  string dg_phi_name = string("dg_phi") + suffix;
71  string dg_phi_title = dg_phi_name + "; tracks #phi; # of tracks";
72  dg_phi[i][j][k] = ibooker.book1D((dg_phi_name).c_str(), dg_phi_title.c_str(), 200, -PI, PI);
73 
74  string dg_sh_phi_name = string("dg_sh_phi") + suffix;
75  string dg_sh_phi_title = dg_sh_phi_name + "; tracks #phi; # of tracks";
76  dg_sh_phi[i][j][k] = ibooker.book1D((dg_sh_phi_name).c_str(), dg_sh_phi_title.c_str(), 200, -PI, PI);
77 
78  string pad_phi_name = string("pad_phi") + suffix;
79  string pad_phi_title = pad_phi_name + "; tracks #phi; # of tracks";
80  pad_phi[i][j][k] = ibooker.book1D((pad_phi_name).c_str(), pad_phi_title.c_str(), 200, -PI, PI);
81 
82  string copad_phi_name = string("copad_phi") + suffix;
83  string copad_phi_title = copad_phi_name + "; tracks #phi; # of tracks";
84  copad_phi[i][j][k] = ibooker.book1D((copad_phi_name).c_str(), copad_phi_title.c_str(), 200, -PI, PI);
85  }
86  }
87  }
88  }
89 }
#define LogDebug(id)
const double Pi
unsigned int nstation
Definition: GEMTrackMatch.h:80
static const std::array< std::string, 4 > l_suffix
Definition: GEMDetLabel.h:4
MonitorElement * pad_phi[4][3][3]
MonitorElement * dg_phi[4][3][3]
MonitorElement * copad_phi[4][3][3]
void setGeometry(const GEMGeometry &geom)
static const std::array< std::string, 2 > s_suffix
Definition: GEMDetLabel.h:5
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * track_eta[3]
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:43
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
#define PI
Definition: QcdUeDQM.h:36
int k[5][pyjets_maxn]
MonitorElement * track_phi[3][3]
MonitorElement * pad_eta[4][3]
MonitorElement * dg_sh_phi[4][3][3]
MonitorElement * dg_eta[4][3]
MonitorElement * dg_sh_eta[4][3]
static const std::array< std::string, 3 > c_suffix
Definition: GEMDetLabel.h:6
MonitorElement * copad_eta[4][3]

Member Data Documentation

MonitorElement* GEMDigiTrackMatch::copad_eta[4][3]
private

Definition at line 28 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::copad_phi[4][3][3]
private

Definition at line 33 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::dg_eta[4][3]
private

Definition at line 25 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::dg_phi[4][3][3]
private

Definition at line 30 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::dg_sh_eta[4][3]
private

Definition at line 26 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::dg_sh_phi[4][3][3]
private

Definition at line 31 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetToken GEMDigiTrackMatch::gem_copadToken_
private

Definition at line 37 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and GEMDigiTrackMatch().

edm::EDGetToken GEMDigiTrackMatch::gem_digiToken_
private

Definition at line 35 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and GEMDigiTrackMatch().

edm::EDGetToken GEMDigiTrackMatch::gem_padToken_
private

Definition at line 36 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and GEMDigiTrackMatch().

MonitorElement* GEMDigiTrackMatch::pad_eta[4][3]
private

Definition at line 27 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::pad_phi[4][3][3]
private

Definition at line 32 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::track_eta[3]
private

Definition at line 22 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::track_phi[3][3]
private

Definition at line 23 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().