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 15 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 {
14  std::string simInputLabel_ = ps.getUntrackedParameter<std::string>("simInputLabel");
15  simHitsToken_ = consumes<edm::PSimHitContainer>(edm::InputTag(simInputLabel_,"MuonGEMHits"));
16  simTracksToken_ = consumes< edm::SimTrackContainer >(ps.getParameter<edm::InputTag>("simTrackCollection"));
17  simVerticesToken_ = consumes< edm::SimVertexContainer >(ps.getParameter<edm::InputTag>("simVertexCollection"));
18 
19  gem_digiToken_ = consumes<GEMDigiCollection>(ps.getParameter<edm::InputTag>("gemDigiInput"));
20  gem_padToken_ = consumes<GEMPadDigiCollection>(ps.getParameter<edm::InputTag>("gemPadDigiInput"));
21  gem_copadToken_ = consumes<GEMCoPadDigiCollection>(ps.getParameter<edm::InputTag>("gemCoPadDigiInput"));
22  detailPlot_ = ps.getParameter<bool>("detailPlot");
23  cfg_ = ps;
24 }
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 95 of file GEMDigiTrackMatch.cc.

95 { }

Member Function Documentation

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

Implements GEMTrackMatch.

Definition at line 97 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_, lumiQTWidget::t, track_eta, and track_phi.

98 {
100  iSetup.get<MuonGeometryRecord>().get(hGeom);
101  const GEMGeometry& geom = *hGeom;
102 
106  iEvent.getByToken(simHitsToken_, simhits);
107  iEvent.getByToken(simTracksToken_, sim_tracks);
108  iEvent.getByToken(simVerticesToken_, sim_vertices);
109  if ( !simhits.isValid() || !sim_tracks.isValid() || !sim_vertices.isValid()) return;
110 
111  if ( detailPlot_) {
112 
116  iEvent.getByToken(simHitsToken_, simhits);
117  iEvent.getByToken(simTracksToken_, sim_tracks);
118  iEvent.getByToken(simVerticesToken_, sim_vertices);
119  if ( !simhits.isValid() || !sim_tracks.isValid() || !sim_vertices.isValid()) return;
120 
121  //const edm::SimVertexContainer & sim_vert = *sim_vertices.product();
122  const edm::SimTrackContainer & sim_trks = *sim_tracks.product();
123  MySimTrack track_;
124  for (auto& t: sim_trks)
125  {
126  if (!isSimTrackGood(t))
127  { continue; }
128 
129  // match hits and digis to this SimTrack
130 
132  const GEMDigiMatcher& match_gd = GEMDigiMatcher( match_sh, iEvent, geom, cfg_ ,gem_digiToken_, gem_padToken_, gem_copadToken_);
133 
134  track_.pt = t.momentum().pt();
135  track_.phi = t.momentum().phi();
136  track_.eta = t.momentum().eta();
137  std::fill( std::begin(track_.hitOdd), std::end(track_.hitOdd),false);
138  std::fill( std::begin(track_.hitEven), std::end(track_.hitEven),false);
139 
140  for ( int i= 0 ; i< 3 ; i++) {
141  for ( int j= 0 ; j<2 ; j++) {
142  track_.gem_sh[i][j] = false;
143  track_.gem_dg[i][j] = false;
144  track_.gem_pad[i][j] = false;
145  }
146  }
147 
148  // ** GEM SimHits ** //
149  const auto gem_sh_ids_ch = match_sh.chamberIdsGEM();
150  for(auto d: gem_sh_ids_ch)
151  {
152  const GEMDetId id(d);
153  if ( id.chamber() %2 ==0 ) track_.hitEven[id.station()-1] = true;
154  else if ( id.chamber() %2 ==1 ) track_.hitOdd[id.station()-1] = true;
155  else { std::cout<<"Error to get chamber id"<<std::endl;}
156 
157  track_.gem_sh[ id.station()-1][ (id.layer()-1)] = true;
158 
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  {
165  const GEMDetId id(d);
166  track_.gem_dg[ id.station()-1][ (id.layer()-1)] = true;
167  }
168  const auto gem_pad_ids_ch = match_gd.chamberIdsWithPads();
169  for(auto d: gem_pad_ids_ch)
170  {
171  const GEMDetId id(d);
172  track_.gem_pad[ id.station()-1][ (id.layer()-1)] = true;
173  }
174 
175 
176  FillWithTrigger( track_eta, fabs(track_.eta)) ;
177  FillWithTrigger( track_phi, fabs(track_.eta), track_.phi, track_.hitOdd, track_.hitEven);
178 
179 
180  FillWithTrigger( dg_sh_eta, track_.gem_sh , fabs( track_.eta) );
181  FillWithTrigger( dg_eta, track_.gem_dg , fabs( track_.eta) );
182  FillWithTrigger( pad_eta, track_.gem_pad , fabs( track_.eta) );
183  FillWithTrigger( copad_eta, track_.gem_pad , fabs( track_.eta) );
184 
185  // Separate station.
186 
187  FillWithTrigger( dg_sh_phi, track_.gem_sh ,fabs(track_.eta), track_.phi , track_.hitOdd, track_.hitEven);
188  FillWithTrigger( dg_phi, track_.gem_dg ,fabs(track_.eta), track_.phi , track_.hitOdd, track_.hitEven);
189  FillWithTrigger( pad_phi, track_.gem_pad ,fabs(track_.eta), track_.phi , track_.hitOdd, track_.hitEven);
190  FillWithTrigger( copad_phi, track_.gem_pad ,fabs(track_.eta), track_.phi , track_.hitOdd, track_.hitEven);
191 
192 
193  }
194  }
195 }
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:230
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:81
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:68
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 26 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.

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

Referenced by analyze(), and bookHistograms().

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

Definition at line 35 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 27 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 32 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 28 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 33 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetToken GEMDigiTrackMatch::gem_copadToken_
private

Definition at line 39 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and GEMDigiTrackMatch().

edm::EDGetToken GEMDigiTrackMatch::gem_digiToken_
private

Definition at line 37 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and GEMDigiTrackMatch().

edm::EDGetToken GEMDigiTrackMatch::gem_padToken_
private

Definition at line 38 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and GEMDigiTrackMatch().

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

Definition at line 29 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 34 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMDigiTrackMatch::track_eta[3]
private

Definition at line 24 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 25 of file GEMDigiTrackMatch.h.

Referenced by analyze(), and bookHistograms().