CMS 3D CMS Logo

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

#include <GEMSimHitMatcher.h>

Inheritance diagram for GEMSimHitMatcher:
MuonSimHitMatcher

Public Member Functions

std::set< unsigned int > chamberIds (int gem_type=MuonHitHelper::GEM_ALL) const
 
std::set< unsigned int > detIds (int gem_type=MuonHitHelper::GEM_ALL) const
 
std::set< unsigned int > detIdsCoincidences () const
 
 GEMSimHitMatcher (const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
 
std::set< int > hitCoPadsInDetId (unsigned int) const
 
std::set< int > hitPadsInDetId (unsigned int) const
 
std::set< int > hitPartitions () const
 
const edm::PSimHitContainerhitsInSuperChamber (unsigned int) const
 
bool hitStation (int, int) const
 
std::set< int > hitStripsInDetId (unsigned int, int margin_n_strips=0) const
 
void init (const edm::Event &e, const edm::EventSetup &eventSetup)
 initialize the event More...
 
void match (const SimTrack &t, const SimVertex &v)
 do the matching More...
 
int nCoincidencePadsWithHits () const
 
int nLayersWithHitsInSuperChamber (unsigned int) const
 
int nPadsWithHits () const
 
int nStations (int nl=2) const
 
float simHitsGEMCentralPosition (const edm::PSimHitContainer &sim_hits) const
 
float simHitsMeanStrip (const edm::PSimHitContainer &sim_hits) const
 
std::set< unsigned int > superChamberIds () const
 
std::set< unsigned int > superChamberIdsCoincidences () const
 
 ~GEMSimHitMatcher ()
 
- Public Member Functions inherited from MuonSimHitMatcher
std::set< unsigned int > chamberIds (int type=0) const
 
std::set< unsigned int > detIds (int type=0) const
 
const edm::PSimHitContainerhitsInChamber (unsigned int) const
 
const edm::PSimHitContainerhitsInDetId (unsigned int) const
 
void init (const edm::Event &e, const edm::EventSetup &eventSetup)
 initialize the event More...
 
void match (const SimTrack &t, const SimVertex &v)
 do the matching More...
 
 MuonSimHitMatcher (const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
 
const edm::PSimHitContainersimHits (int) const
 
GlobalVector simHitsMeanMomentum (const edm::PSimHitContainer &sim_hits) const
 
GlobalPoint simHitsMeanPosition (const edm::PSimHitContainer &sim_hits) const
 
GlobalPoint simHitsMeanPositionStation (int n) const
 
 ~MuonSimHitMatcher ()
 

Private Member Functions

void matchSimHitsToSimTrack ()
 

Private Attributes

std::map< unsigned int, std::set< int > > detids_to_copads_
 
std::map< unsigned int, std::set< int > > detids_to_pads_
 
edm::ESHandle< GEMGeometrygem_geom_
 
std::map< unsigned int, edm::PSimHitContainersuperchamber_to_hits_
 

Additional Inherited Members

- Protected Member Functions inherited from MuonSimHitMatcher
std::vector< unsigned int > getIdsOfSimTrackShower (unsigned trk_id, const edm::SimTrackContainer &simTracks, const edm::SimVertexContainer &simVertices)
 
- Protected Attributes inherited from MuonSimHitMatcher
std::map< unsigned int, edm::PSimHitContainerchamber_to_hits_
 
std::map< unsigned int, edm::PSimHitContainerdetid_to_hits_
 
bool discardEleHits_
 
const TrackingGeometrygeometry_
 
bool hasGeometry_
 
edm::PSimHitContainer hits_
 
edm::PSimHitContainer no_hits_
 
edm::EDGetTokenT< edm::PSimHitContainersimHitInput_
 
edm::ParameterSet simHitPSet_
 
edm::PSimHitContainer simHits_
 
edm::Handle< edm::PSimHitContainersimHitsH_
 
bool simMuOnly_
 
edm::EDGetTokenT< edm::SimTrackContainersimTrackInput_
 
edm::SimTrackContainer simTracks_
 
edm::Handle< edm::SimTrackContainersimTracksH_
 
edm::EDGetTokenT< edm::SimVertexContainersimVertexInput_
 
edm::SimVertexContainer simVertices_
 
edm::Handle< edm::SimVertexContainersimVerticesH_
 
std::vector< unsigned > track_ids_
 
std::map< unsigned int, unsigned int > trkid_to_index_
 
bool verbose_
 
bool verboseSimTrack_
 

Detailed Description

Description: Matching of GEM SimHit to SimTrack

Author: Sven Dildick (TAMU), Tao Huang (TAMU)

Definition at line 14 of file GEMSimHitMatcher.h.

Constructor & Destructor Documentation

GEMSimHitMatcher::GEMSimHitMatcher ( const edm::ParameterSet iPS,
edm::ConsumesCollector &&  iC 
)

Definition at line 5 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::discardEleHits_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), MuonSimHitMatcher::simHitInput_, MuonSimHitMatcher::simHitPSet_, MuonSimHitMatcher::simMuOnly_, and MuonSimHitMatcher::verbose_.

6  : MuonSimHitMatcher(ps, std::move(iC)) {
7  simHitPSet_ = ps.getParameterSet("gemSimHit");
8  verbose_ = simHitPSet_.getParameter<int>("verbose");
9  simMuOnly_ = simHitPSet_.getParameter<bool>("simMuOnly");
10  discardEleHits_ = simHitPSet_.getParameter<bool>("discardEleHits");
11 
13 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::ParameterSet simHitPSet_
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
MuonSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
std::vector< PSimHit > PSimHitContainer
def move(src, dest)
Definition: eostools.py:511
GEMSimHitMatcher::~GEMSimHitMatcher ( )
inline

Member Function Documentation

std::set< unsigned int > GEMSimHitMatcher::chamberIds ( int  gem_type = MuonHitHelper::GEM_ALL) const

Definition at line 181 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::chamber_to_hits_, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, GEMDetId::ring(), GEMDetId::station(), and MuonHitHelper::toGEMType().

Referenced by hitStation(), and ~GEMSimHitMatcher().

181  {
182  std::set<unsigned int> result;
183  for (const auto& p : chamber_to_hits_) {
184  const auto& id = p.first;
185  if (gem_type > 0) {
186  GEMDetId detId(id);
187  if (MuonHitHelper::toGEMType(detId.station(), detId.ring()) != gem_type)
188  continue;
189  }
190  result.insert(id);
191  }
192  return result;
193 }
static int toGEMType(int st, int ri)
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
std::set< unsigned int > GEMSimHitMatcher::detIds ( int  gem_type = MuonHitHelper::GEM_ALL) const

Definition at line 160 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::detid_to_hits_, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, GEMDetId::ring(), GEMDetId::station(), and MuonHitHelper::toGEMType().

Referenced by hitPartitions(), match(), matchSimHitsToSimTrack(), nPadsWithHits(), and ~GEMSimHitMatcher().

160  {
161  std::set<unsigned int> result;
162  for (const auto& p : detid_to_hits_) {
163  const auto& id = p.first;
164  if (gem_type > 0) {
165  GEMDetId detId(id);
166  if (MuonHitHelper::toGEMType(detId.station(), detId.ring()) != gem_type)
167  continue;
168  }
169  result.insert(id);
170  }
171  return result;
172 }
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
static int toGEMType(int st, int ri)
std::set< unsigned int > GEMSimHitMatcher::detIdsCoincidences ( ) const

Definition at line 174 of file GEMSimHitMatcher.cc.

References detids_to_copads_, AlCaHLTBitMon_ParallelJobs::p, and mps_fire::result.

Referenced by nCoincidencePadsWithHits(), and ~GEMSimHitMatcher().

174  {
175  std::set<unsigned int> result;
176  for (const auto& p : detids_to_copads_)
177  result.insert(p.first);
178  return result;
179 }
std::map< unsigned int, std::set< int > > detids_to_copads_
std::set< int > GEMSimHitMatcher::hitCoPadsInDetId ( unsigned int  detid) const

Definition at line 313 of file GEMSimHitMatcher.cc.

References detids_to_copads_, and none.

Referenced by nCoincidencePadsWithHits(), and ~GEMSimHitMatcher().

313  {
314  set<int> none;
315  if (detids_to_copads_.find(detid) == detids_to_copads_.end())
316  return none;
317  return detids_to_copads_.at(detid);
318 }
std::map< unsigned int, std::set< int > > detids_to_copads_
std::set< int > GEMSimHitMatcher::hitPadsInDetId ( unsigned int  detid) const

Definition at line 306 of file GEMSimHitMatcher.cc.

References detids_to_pads_, and none.

Referenced by nPadsWithHits(), and ~GEMSimHitMatcher().

306  {
307  set<int> none;
308  if (detids_to_pads_.find(detid) == detids_to_pads_.end())
309  return none;
310  return detids_to_pads_.at(detid);
311 }
std::map< unsigned int, std::set< int > > detids_to_pads_
std::set< int > GEMSimHitMatcher::hitPartitions ( ) const

Definition at line 320 of file GEMSimHitMatcher.cc.

References detIds(), mps_fire::result, and GEMDetId::roll().

Referenced by ~GEMSimHitMatcher().

320  {
321  std::set<int> result;
322 
323  const auto& detids = detIds();
324  for (const auto& id : detids) {
325  GEMDetId idd(id);
326  result.insert(idd.roll());
327  }
328  return result;
329 }
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
const edm::PSimHitContainer & GEMSimHitMatcher::hitsInSuperChamber ( unsigned int  detid) const

Definition at line 211 of file GEMSimHitMatcher.cc.

References triggerObjects_cff::id, MuonHitHelper::isGEM(), MuonSimHitMatcher::no_hits_, and superchamber_to_hits_.

Referenced by match(), nLayersWithHitsInSuperChamber(), and ~GEMSimHitMatcher().

211  {
212  if (MuonHitHelper::isGEM(detid)) {
213  const GEMDetId id(detid);
214  if (superchamber_to_hits_.find(id.chamberId().rawId()) == superchamber_to_hits_.end())
215  return no_hits_;
216  return superchamber_to_hits_.at(id.chamberId().rawId());
217  }
218 
219  return no_hits_;
220 }
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
edm::PSimHitContainer no_hits_
static bool isGEM(unsigned int detId)
Definition: MuonHitHelper.cc:7
bool GEMSimHitMatcher::hitStation ( int  st,
int  nlayers 
) const

Definition at line 232 of file GEMSimHitMatcher.cc.

References chamberIds(), triggerObjects_cff::id, nLayersWithHitsInSuperChamber(), and relativeConstraints::station.

Referenced by nStations(), and ~GEMSimHitMatcher().

232  {
233  int nst = 0;
234  for (const auto& ddt : chamberIds()) {
235  const GEMDetId id(ddt);
236  if (id.station() != st)
237  continue;
238 
239  const int nl(nLayersWithHitsInSuperChamber(id.rawId()));
240  if (nl < nlayers)
241  continue;
242  ++nst;
243  }
244  return nst;
245 }
std::set< unsigned int > chamberIds(int gem_type=MuonHitHelper::GEM_ALL) const
int nLayersWithHitsInSuperChamber(unsigned int) const
std::set< int > GEMSimHitMatcher::hitStripsInDetId ( unsigned int  detid,
int  margin_n_strips = 0 
) const

Definition at line 287 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::geometry_, h, MuonSimHitMatcher::hitsInDetId(), triggerObjects_cff::id, mps_fire::result, HLTBitAnalyser_cfi::simhits, and contentValuesCheck::ss.

Referenced by match(), and ~GEMSimHitMatcher().

287  {
288  set<int> result;
289  const auto& simhits = MuonSimHitMatcher::hitsInDetId(detid);
290  GEMDetId id(detid);
291  int max_nstrips = dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id)->nstrips();
292  for (const auto& h : simhits) {
293  const LocalPoint& lp = h.entryPoint();
294  int central_strip =
295  static_cast<int>(dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id)->topology().channel(lp));
296  int smin = central_strip - margin_n_strips;
297  smin = (smin > 0) ? smin : 1;
298  int smax = central_strip + margin_n_strips;
299  smax = (smax <= max_nstrips) ? smax : max_nstrips;
300  for (int ss = smin; ss <= smax; ++ss)
301  result.insert(ss);
302  }
303  return result;
304 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
void GEMSimHitMatcher::init ( const edm::Event e,
const edm::EventSetup eventSetup 
)

initialize the event

Definition at line 16 of file GEMSimHitMatcher.cc.

References gem_geom_, MuonSimHitMatcher::geometry_, edm::EventSetup::get(), MuonSimHitMatcher::hasGeometry_, MuonSimHitMatcher::init(), and edm::ESHandleBase::isValid().

Referenced by ~GEMSimHitMatcher().

16  {
17  iSetup.get<MuonGeometryRecord>().get(gem_geom_);
18  if (gem_geom_.isValid()) {
19  geometry_ = dynamic_cast<const GEMGeometry*>(&*gem_geom_);
20  } else {
21  hasGeometry_ = false;
22  edm::LogWarning("GEMSimHitMatcher") << "+++ Info: GEM geometry is unavailable. +++\n";
23  }
25 }
const TrackingGeometry * geometry_
int iEvent
Definition: GenABIO.cc:224
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
bool isValid() const
Definition: ESHandle.h:44
edm::ESHandle< GEMGeometry > gem_geom_
void GEMSimHitMatcher::match ( const SimTrack t,
const SimVertex v 
)

do the matching

Definition at line 28 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::chamber_to_hits_, detIds(), MuonSimHitMatcher::hasGeometry_, MuonSimHitMatcher::hits_, MuonSimHitMatcher::hitsInDetId(), hitsInSuperChamber(), hitStripsInDetId(), triggerObjects_cff::id, MuonSimHitMatcher::match(), matchSimHitsToSimTrack(), nCoincidencePadsWithHits(), AlCaHLTBitMon_ParallelJobs::p, MuonSimHitMatcher::simHitsMeanPosition(), DigiDM_cff::strips, superchamber_to_hits_, superChamberIds(), MuonSimHitMatcher::track_ids_, and MuonSimHitMatcher::verbose_.

Referenced by ~GEMSimHitMatcher().

28  {
29  // instantiates the track ids and simhits
31 
32  if (hasGeometry_) {
34 
35  if (verbose_) {
36  edm::LogInfo("GEMSimHitMatcher") << "nTrackIds " << track_ids_.size() << " nSelectedGEMSimHits " << hits_.size()
37  << endl;
38  edm::LogInfo("GEMSimHitMatcher") << "detids GEM " << detIds(0).size() << endl;
39 
40  const auto& gem_ch_ids = detIds();
41  for (const auto& id : gem_ch_ids) {
42  const auto& gem_simhits = MuonSimHitMatcher::hitsInDetId(id);
43  const auto& gem_simhits_gp = simHitsMeanPosition(gem_simhits);
44  edm::LogInfo("GEMSimHitMatcher") << "gemchid " << GEMDetId(id) << ": nHits " << gem_simhits.size() << " phi "
45  << gem_simhits_gp.phi() << " nCh " << chamber_to_hits_[id].size() << endl;
46  const auto& strips = hitStripsInDetId(id);
47  edm::LogInfo("GEMSimHitMatcher") << "nStrip " << strips.size() << endl;
48  edm::LogInfo("GEMSimHitMatcher") << "strips : ";
49  for (const auto& p : strips) {
50  edm::LogInfo("GEMSimHitMatcher") << p;
51  }
52  }
53  const auto& gem_sch_ids = superChamberIds();
54  for (const auto& id : gem_sch_ids) {
55  const auto& gem_simhits = hitsInSuperChamber(id);
56  const auto& gem_simhits_gp = simHitsMeanPosition(gem_simhits);
57  edm::LogInfo("GEMSimHitMatcher") << "gemschid " << GEMDetId(id) << ": " << nCoincidencePadsWithHits() << " | "
58  << gem_simhits.size() << " " << gem_simhits_gp.phi() << " "
59  << superchamber_to_hits_[id].size() << endl;
60  }
61  }
62  }
63 }
edm::PSimHitContainer hits_
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=0) const
std::vector< unsigned > track_ids_
std::set< unsigned int > superChamberIds() const
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
int nCoincidencePadsWithHits() const
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
void GEMSimHitMatcher::matchSimHitsToSimTrack ( )
private

Definition at line 65 of file GEMSimHitMatcher.cc.

References funct::abs(), MuonSimHitMatcher::chamber_to_hits_, ztail::d, MuonSimHitMatcher::detid_to_hits_, detIds(), detids_to_copads_, detids_to_pads_, MuonSimHitMatcher::discardEleHits_, MuonSimHitMatcher::geometry_, h, hfClusterShapes_cfi::hits, MuonSimHitMatcher::hits_, MuonSimHitMatcher::hitsInDetId(), triggerObjects_cff::id, globals_cff::id1, globals_cff::id2, GEMDetId::layer(), or, EgammaValidation_cff::pdgid, GEMDetId::region(), GEMDetId::ring(), GEMDetId::roll(), MuonSimHitMatcher::simHits_, MuonSimHitMatcher::simMuOnly_, GEMDetId::station(), superchamber_to_hits_, MuonSimHitMatcher::track_ids_, and MuonSimHitMatcher::verbose_.

Referenced by match(), and ~GEMSimHitMatcher().

65  {
66  for (const auto& track_id : track_ids_) {
67  for (const auto& h : simHits_) {
68  if (h.trackId() != track_id)
69  continue;
70  int pdgid = h.particleType();
71  if (simMuOnly_ && std::abs(pdgid) != 13)
72  continue;
73  // discard electron hits in the GEM chambers
74  if (discardEleHits_ && pdgid == 11)
75  continue;
76 
77  const GEMDetId& p_id(h.detUnitId());
78  detid_to_hits_[h.detUnitId()].push_back(h);
79  hits_.push_back(h);
80  chamber_to_hits_[p_id.chamberId().rawId()].push_back(h);
81  superchamber_to_hits_[p_id.superChamberId().rawId()].push_back(h);
82  }
83  }
84 
85  // find pads with hits
86  const auto& detids = detIds();
87  // find 2-layer coincidence pads with hits
88  for (const auto& d : detids) {
89  GEMDetId id(d);
90  const auto& hits = hitsInDetId(d);
91  const auto& roll = dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id);
92  // int max_npads = roll->npads();
93  set<int> pads;
94  for (const auto& h : hits) {
95  const LocalPoint& lp = h.entryPoint();
96  pads.insert(1 + static_cast<int>(roll->padTopology().channel(lp)));
97  }
98  detids_to_pads_[d] = pads;
99  }
100 
101  // find 2-layer coincidence pads with hits
102  for (const auto& d : detids) {
103  GEMDetId id1(d);
104  if (id1.layer() != 1)
105  continue;
106 
107  // find pads with hits in layer1
108  const auto& hits1 = hitsInDetId(d);
109  const auto& roll1 = dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id1);
110  set<int> pads1;
111  set<int> pads2;
112  set<int> copads;
113 
114  for (const auto& h : hits1) {
115  const LocalPoint& lp = h.entryPoint();
116  pads1.insert(1 + static_cast<int>(roll1->padTopology().channel(lp)));
117  if (verbose_)
118  edm::LogInfo("GEMSimHitMatcher") << "GEMHits detid1 " << id1 << " pad1 "
119  << 1 + static_cast<int>(roll1->padTopology().channel(lp)) << std::endl;
120  }
121 
122  // find pads with hits in layer2
123  for (const auto& d2 : detids) {
124  // staggered geometry???? improve here !!
125  GEMDetId id2(d2);
126  // does layer 2 has simhits?
127  if (id2.layer() != 2 or id2.region() != id1.region() or id2.ring() != id1.ring() or
128  id2.station() != id1.station() or abs(id2.roll() - id1.roll()) > 1)
129  continue;
130  const auto& hits2 = hitsInDetId(id2());
131  const auto& roll2 = dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id2);
132  for (const auto& h : hits2) {
133  const LocalPoint& lp = h.entryPoint();
134  pads2.insert(1 + static_cast<int>(roll2->padTopology().channel(lp)));
135  if (verbose_)
136  edm::LogInfo("GEMSimHitMatcher") << "GEMHits detid2 " << id2 << " pad2 "
137  << 1 + static_cast<int>(roll2->padTopology().channel(lp)) << std::endl;
138  }
139  }
140 
141  for (const auto& pad1 : pads1) {
142  for (const auto& pad2 : pads2) {
143  if (abs(pad1 - pad2) <= 2) {
144  if (copads.find(pad1) == copads.end())
145  copads.insert(pad1);
146  if (copads.find(pad2) == copads.end())
147  copads.insert(pad2);
148  }
149  }
150  }
151 
152  if (copads.empty())
153  continue;
154 
155  // detids here is layer1 id
156  detids_to_copads_[d] = copads;
157  }
158 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
std::map< unsigned int, std::set< int > > detids_to_pads_
edm::PSimHitContainer hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
std::vector< unsigned > track_ids_
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
edm::PSimHitContainer simHits_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
d
Definition: ztail.py:151
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
std::map< unsigned int, std::set< int > > detids_to_copads_
int GEMSimHitMatcher::nCoincidencePadsWithHits ( ) const

Definition at line 340 of file GEMSimHitMatcher.cc.

References detIdsCoincidences(), hitCoPadsInDetId(), and mps_fire::result.

Referenced by match(), and ~GEMSimHitMatcher().

340  {
341  int result = 0;
342  const auto& copad_ids = detIdsCoincidences();
343  for (const auto& id : copad_ids) {
344  result += hitCoPadsInDetId(id).size();
345  }
346  return result;
347 }
std::set< unsigned int > detIdsCoincidences() const
std::set< int > hitCoPadsInDetId(unsigned int) const
int GEMSimHitMatcher::nLayersWithHitsInSuperChamber ( unsigned int  detid) const

Definition at line 222 of file GEMSimHitMatcher.cc.

References h, hfClusterShapes_cfi::hits, and hitsInSuperChamber().

Referenced by hitStation(), and ~GEMSimHitMatcher().

222  {
223  set<int> layers_with_hits;
224  const auto& hits = hitsInSuperChamber(detid);
225  for (const auto& h : hits) {
226  const GEMDetId& idd(h.detUnitId());
227  layers_with_hits.insert(idd.layer());
228  }
229  return layers_with_hits.size();
230 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
int GEMSimHitMatcher::nPadsWithHits ( ) const

Definition at line 331 of file GEMSimHitMatcher.cc.

References detIds(), hitPadsInDetId(), and mps_fire::result.

Referenced by ~GEMSimHitMatcher().

331  {
332  int result = 0;
333  const auto& pad_ids = detIds();
334  for (const auto& id : pad_ids) {
335  result += hitPadsInDetId(id).size();
336  }
337  return result;
338 }
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
std::set< int > hitPadsInDetId(unsigned int) const
int GEMSimHitMatcher::nStations ( int  nl = 2) const

Definition at line 247 of file GEMSimHitMatcher.cc.

References hitStation().

Referenced by ~GEMSimHitMatcher().

247 { return (hitStation(1, nlayers) + hitStation(2, nlayers)); }
bool hitStation(int, int) const
float GEMSimHitMatcher::simHitsGEMCentralPosition ( const edm::PSimHitContainer sim_hits) const

Definition at line 249 of file GEMSimHitMatcher.cc.

References central, MuonSimHitMatcher::geometry_, runTauDisplay::gp, h, TrackingGeometry::idToDet(), MuonHitHelper::isGEM(), dqmiodumpmetadata::n, PV3DBase< T, PVType, FrameType >::perp(), and GeomDet::toGlobal().

Referenced by ~GEMSimHitMatcher().

249  {
250  if (sim_hits.empty())
251  return -0.0; // point "zero"
252 
253  float central = -0.0;
254  size_t n = 0;
255  for (const auto& h : sim_hits) {
256  LocalPoint lp(0., 0., 0.); // local central
257  GlobalPoint gp;
258  if (MuonHitHelper::isGEM(h.detUnitId())) {
259  gp = geometry_->idToDet(h.detUnitId())->surface().toGlobal(lp);
260  }
261  central = gp.perp();
262  if (n >= 1)
263  edm::LogWarning("GEMSimHitMatcher") << "warning! find more than one simhits in GEM chamber " << std::endl;
264  ++n;
265  }
266 
267  return central;
268 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
T perp() const
Definition: PV3DBase.h:69
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
virtual const GeomDet * idToDet(DetId) const =0
static bool isGEM(unsigned int detId)
Definition: MuonHitHelper.cc:7
float GEMSimHitMatcher::simHitsMeanStrip ( const edm::PSimHitContainer sim_hits) const

Definition at line 270 of file GEMSimHitMatcher.cc.

References ztail::d, f, MuonSimHitMatcher::geometry_, h, and dqmiodumpmetadata::n.

Referenced by ~GEMSimHitMatcher().

270  {
271  if (sim_hits.empty())
272  return -1.f;
273 
274  float sums = 0.f;
275  size_t n = 0;
276  for (const auto& h : sim_hits) {
277  const LocalPoint& lp = h.entryPoint();
278  const auto& d = h.detUnitId();
279  sums += dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(d)->strip(lp);
280  ++n;
281  }
282  if (n == 0)
283  return -1.f;
284  return sums / n;
285 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
double f[11][100]
d
Definition: ztail.py:151
std::set< unsigned int > GEMSimHitMatcher::superChamberIds ( ) const

Definition at line 195 of file GEMSimHitMatcher.cc.

References AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and superchamber_to_hits_.

Referenced by match(), and ~GEMSimHitMatcher().

195  {
196  std::set<unsigned int> result;
197  for (const auto& p : superchamber_to_hits_)
198  result.insert(p.first);
199  return result;
200 }
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
std::set< unsigned int > GEMSimHitMatcher::superChamberIdsCoincidences ( ) const

Definition at line 202 of file GEMSimHitMatcher.cc.

References detids_to_copads_, AlCaHLTBitMon_ParallelJobs::p, DetId::rawId(), mps_fire::result, and GEMDetId::superChamberId().

Referenced by ~GEMSimHitMatcher().

202  {
203  std::set<unsigned int> result;
204  for (const auto& p : detids_to_copads_) {
205  const GEMDetId& p_id(p.first);
206  result.insert(p_id.superChamberId().rawId());
207  }
208  return result;
209 }
std::map< unsigned int, std::set< int > > detids_to_copads_

Member Data Documentation

std::map<unsigned int, std::set<int> > GEMSimHitMatcher::detids_to_copads_
private
std::map<unsigned int, std::set<int> > GEMSimHitMatcher::detids_to_pads_
private

Definition at line 83 of file GEMSimHitMatcher.h.

Referenced by hitPadsInDetId(), and matchSimHitsToSimTrack().

edm::ESHandle<GEMGeometry> GEMSimHitMatcher::gem_geom_
private

Definition at line 78 of file GEMSimHitMatcher.h.

Referenced by init().

std::map<unsigned int, edm::PSimHitContainer> GEMSimHitMatcher::superchamber_to_hits_
private