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_.

7  : MuonSimHitMatcher(ps, std::move(iC)) {
8  simHitPSet_ = ps.getParameterSet("gemSimHit");
9  verbose_ = simHitPSet_.getParameter<int>("verbose");
10  simMuOnly_ = simHitPSet_.getParameter<bool>("simMuOnly");
11  discardEleHits_ = simHitPSet_.getParameter<bool>("discardEleHits");
12 
15 }
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 190 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().

190  {
191  std::set<unsigned int> result;
192  for (const auto& p : chamber_to_hits_) {
193  const auto& id = p.first;
194  if (gem_type > 0) {
195  GEMDetId detId(id);
196  if (MuonHitHelper::toGEMType(detId.station(), detId.ring()) != gem_type)
197  continue;
198  }
199  result.insert(id);
200  }
201  return result;
202 }
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 170 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().

170  {
171  std::set<unsigned int> result;
172  for (const auto& p : detid_to_hits_) {
173  const auto& id = p.first;
174  if (gem_type > 0) {
175  GEMDetId detId(id);
176  if (MuonHitHelper::toGEMType(detId.station(), detId.ring()) != gem_type)
177  continue;
178  }
179  result.insert(id);
180  }
181  return result;
182 }
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 184 of file GEMSimHitMatcher.cc.

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

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

184  {
185  std::set<unsigned int> result;
186  for (const auto& p : detids_to_copads_) result.insert(p.first);
187  return result;
188 }
std::map< unsigned int, std::set< int > > detids_to_copads_
std::set< int > GEMSimHitMatcher::hitCoPadsInDetId ( unsigned int  detid) const

Definition at line 327 of file GEMSimHitMatcher.cc.

References detids_to_copads_, and none.

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

327  {
328  set<int> none;
329  if (detids_to_copads_.find(detid) == detids_to_copads_.end()) return none;
330  return detids_to_copads_.at(detid);
331 }
std::map< unsigned int, std::set< int > > detids_to_copads_
std::set< int > GEMSimHitMatcher::hitPadsInDetId ( unsigned int  detid) const

Definition at line 321 of file GEMSimHitMatcher.cc.

References detids_to_pads_, and none.

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

321  {
322  set<int> none;
323  if (detids_to_pads_.find(detid) == detids_to_pads_.end()) return none;
324  return detids_to_pads_.at(detid);
325 }
std::map< unsigned int, std::set< int > > detids_to_pads_
std::set< int > GEMSimHitMatcher::hitPartitions ( ) const

Definition at line 333 of file GEMSimHitMatcher.cc.

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

Referenced by ~GEMSimHitMatcher().

333  {
334  std::set<int> result;
335 
336  const auto& detids = detIds();
337  for (const auto& id : detids) {
338  GEMDetId idd(id);
339  result.insert(idd.roll());
340  }
341  return result;
342 }
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
const edm::PSimHitContainer & GEMSimHitMatcher::hitsInSuperChamber ( unsigned int  detid) const

Definition at line 219 of file GEMSimHitMatcher.cc.

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

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

220  {
221  if (MuonHitHelper::isGEM(detid)) {
222  const GEMDetId id(detid);
223  if (superchamber_to_hits_.find(id.chamberId().rawId()) ==
224  superchamber_to_hits_.end())
225  return no_hits_;
226  return superchamber_to_hits_.at(id.chamberId().rawId());
227  }
228 
229  return no_hits_;
230 }
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
edm::PSimHitContainer no_hits_
static bool isGEM(unsigned int detId)
Definition: MuonHitHelper.cc:8
bool GEMSimHitMatcher::hitStation ( int  st,
int  nlayers 
) const

Definition at line 242 of file GEMSimHitMatcher.cc.

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

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

242  {
243  int nst = 0;
244  for (const auto& ddt : chamberIds()) {
245  const GEMDetId id(ddt);
246  if (id.station() != st) continue;
247 
248  const int nl(nLayersWithHitsInSuperChamber(id.rawId()));
249  if (nl < nlayers) continue;
250  ++nst;
251  }
252  return nst;
253 }
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 298 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::geometry_, h, MuonSimHitMatcher::hitsInDetId(), triggerObjects_cff::id, and mps_fire::result.

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

299  {
300  set<int> result;
301  const auto& simhits = MuonSimHitMatcher::hitsInDetId(detid);
302  GEMDetId id(detid);
303  int max_nstrips =
304  dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id)->nstrips();
305  for (const auto& h : simhits) {
306  const LocalPoint& lp = h.entryPoint();
307  int central_strip =
308  static_cast<int>(dynamic_cast<const GEMGeometry*>(geometry_)
309  ->etaPartition(id)
310  ->topology()
311  .channel(lp));
312  int smin = central_strip - margin_n_strips;
313  smin = (smin > 0) ? smin : 1;
314  int smax = central_strip + margin_n_strips;
315  smax = (smax <= max_nstrips) ? smax : max_nstrips;
316  for (int ss = smin; ss <= smax; ++ss) result.insert(ss);
317  }
318  return result;
319 }
const TrackingGeometry * geometry_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
void GEMSimHitMatcher::init ( const edm::Event e,
const edm::EventSetup eventSetup 
)

initialize the event

Definition at line 18 of file GEMSimHitMatcher.cc.

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

Referenced by ~GEMSimHitMatcher().

19  {
20  iSetup.get<MuonGeometryRecord>().get(gem_geom_);
21  if (gem_geom_.isValid()) {
22  geometry_ = dynamic_cast<const GEMGeometry*>(&*gem_geom_);
23  } else {
24  hasGeometry_ = false;
25  edm::LogWarning("GEMSimHitMatcher")
26  << "+++ Info: GEM geometry is unavailable. +++\n";
27  }
29 }
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 32 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(), RecoTauPiZeroBuilderPlugins_cfi::strips, superchamber_to_hits_, superChamberIds(), MuonSimHitMatcher::track_ids_, and MuonSimHitMatcher::verbose_.

Referenced by ~GEMSimHitMatcher().

32  {
33  // instantiates the track ids and simhits
35 
36  if (hasGeometry_) {
38 
39  if (verbose_) {
40  edm::LogInfo("GEMSimHitMatcher")
41  << "nTrackIds " << track_ids_.size() << " nSelectedGEMSimHits "
42  << hits_.size() << endl;
43  edm::LogInfo("GEMSimHitMatcher")
44  << "detids GEM " << detIds(0).size() << endl;
45 
46  const auto& gem_ch_ids = detIds();
47  for (const auto& id : gem_ch_ids) {
48  const auto& gem_simhits = MuonSimHitMatcher::hitsInDetId(id);
49  const auto& gem_simhits_gp = simHitsMeanPosition(gem_simhits);
50  edm::LogInfo("GEMSimHitMatcher")
51  << "gemchid " << GEMDetId(id) << ": nHits " << gem_simhits.size()
52  << " phi " << gem_simhits_gp.phi() << " nCh "
53  << chamber_to_hits_[id].size() << endl;
54  const auto& strips = hitStripsInDetId(id);
55  edm::LogInfo("GEMSimHitMatcher") << "nStrip " << strips.size() << endl;
56  edm::LogInfo("GEMSimHitMatcher") << "strips : ";
57  for (const auto& p : strips) {
58  edm::LogInfo("GEMSimHitMatcher") << p;
59  }
60  }
61  const auto& gem_sch_ids = superChamberIds();
62  for (const auto& id : gem_sch_ids) {
63  const auto& gem_simhits = hitsInSuperChamber(id);
64  const auto& gem_simhits_gp = simHitsMeanPosition(gem_simhits);
65  edm::LogInfo("GEMSimHitMatcher")
66  << "gemschid " << GEMDetId(id) << ": " << nCoincidencePadsWithHits()
67  << " | " << gem_simhits.size() << " " << gem_simhits_gp.phi() << " "
68  << superchamber_to_hits_[id].size() << endl;
69  }
70  }
71  }
72 }
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
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
void GEMSimHitMatcher::matchSimHitsToSimTrack ( )
private

Definition at line 74 of file GEMSimHitMatcher.cc.

References funct::abs(), MuonSimHitMatcher::chamber_to_hits_, edmIntegrityCheck::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, BPhysicsValidation_cfi::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().

74  {
75  for (const auto& track_id : track_ids_) {
76  for (const auto& h : simHits_) {
77  if (h.trackId() != track_id) continue;
78  int pdgid = h.particleType();
79  if (simMuOnly_ && std::abs(pdgid) != 13) continue;
80  // discard electron hits in the GEM chambers
81  if (discardEleHits_ && pdgid == 11) continue;
82 
83  const GEMDetId& p_id(h.detUnitId());
84  detid_to_hits_[h.detUnitId()].push_back(h);
85  hits_.push_back(h);
86  chamber_to_hits_[p_id.chamberId().rawId()].push_back(h);
87  superchamber_to_hits_[p_id.superChamberId().rawId()].push_back(h);
88  }
89  }
90 
91  // find pads with hits
92  const auto& detids = detIds();
93  // find 2-layer coincidence pads with hits
94  for (const auto& d : detids) {
95  GEMDetId id(d);
96  const auto& hits = hitsInDetId(d);
97  const auto& roll =
98  dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id);
99  // int max_npads = roll->npads();
100  set<int> pads;
101  for (const auto& h : hits) {
102  const LocalPoint& lp = h.entryPoint();
103  pads.insert(1 + static_cast<int>(roll->padTopology().channel(lp)));
104  }
105  detids_to_pads_[d] = pads;
106  }
107 
108  // find 2-layer coincidence pads with hits
109  for (const auto& d : detids) {
110  GEMDetId id1(d);
111  if (id1.layer() != 1) continue;
112 
113  // find pads with hits in layer1
114  const auto& hits1 = hitsInDetId(d);
115  const auto& roll1 =
116  dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id1);
117  set<int> pads1;
118  set<int> pads2;
119  set<int> copads;
120 
121  for (const auto& h : hits1) {
122  const LocalPoint& lp = h.entryPoint();
123  pads1.insert(1 + static_cast<int>(roll1->padTopology().channel(lp)));
124  if (verbose_)
125  edm::LogInfo("GEMSimHitMatcher")
126  << "GEMHits detid1 " << id1 << " pad1 "
127  << 1 + static_cast<int>(roll1->padTopology().channel(lp))
128  << std::endl;
129  }
130 
131  // find pads with hits in layer2
132  for (const auto& d2 : detids) {
133  // staggered geometry???? improve here !!
134  GEMDetId id2(d2);
135  // does layer 2 has simhits?
136  if (id2.layer() != 2 or id2.region() != id1.region() or
137  id2.ring() != id1.ring() or id2.station() != id1.station() or
138  abs(id2.roll() - id1.roll()) > 1)
139  continue;
140  const auto& hits2 = hitsInDetId(id2());
141  const auto& roll2 =
142  dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id2);
143  for (const auto& h : hits2) {
144  const LocalPoint& lp = h.entryPoint();
145  pads2.insert(1 + static_cast<int>(roll2->padTopology().channel(lp)));
146  if (verbose_)
147  edm::LogInfo("GEMSimHitMatcher")
148  << "GEMHits detid2 " << id2 << " pad2 "
149  << 1 + static_cast<int>(roll2->padTopology().channel(lp))
150  << std::endl;
151  }
152  }
153 
154  for (const auto& pad1 : pads1) {
155  for (const auto& pad2 : pads2) {
156  if (abs(pad1 - pad2) <= 2) {
157  if (copads.find(pad1) == copads.end()) copads.insert(pad1);
158  if (copads.find(pad2) == copads.end()) copads.insert(pad2);
159  }
160  }
161  }
162 
163  if (copads.empty()) continue;
164 
165  // detids here is layer1 id
166  detids_to_copads_[d] = copads;
167  }
168 }
const TrackingGeometry * geometry_
std::map< unsigned int, std::set< int > > detids_to_pads_
edm::PSimHitContainer hits_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
std::map< unsigned int, std::set< int > > detids_to_copads_
int GEMSimHitMatcher::nCoincidencePadsWithHits ( ) const

Definition at line 353 of file GEMSimHitMatcher.cc.

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

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

353  {
354  int result = 0;
355  const auto& copad_ids = detIdsCoincidences();
356  for (const auto& id : copad_ids) {
357  result += hitCoPadsInDetId(id).size();
358  }
359  return result;
360 }
std::set< unsigned int > detIdsCoincidences() const
std::set< int > hitCoPadsInDetId(unsigned int) const
int GEMSimHitMatcher::nLayersWithHitsInSuperChamber ( unsigned int  detid) const

Definition at line 232 of file GEMSimHitMatcher.cc.

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

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

232  {
233  set<int> layers_with_hits;
234  const auto& hits = hitsInSuperChamber(detid);
235  for (const auto& h : hits) {
236  const GEMDetId& idd(h.detUnitId());
237  layers_with_hits.insert(idd.layer());
238  }
239  return layers_with_hits.size();
240 }
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 344 of file GEMSimHitMatcher.cc.

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

Referenced by ~GEMSimHitMatcher().

344  {
345  int result = 0;
346  const auto& pad_ids = detIds();
347  for (const auto& id : pad_ids) {
348  result += hitPadsInDetId(id).size();
349  }
350  return result;
351 }
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 255 of file GEMSimHitMatcher.cc.

References hitStation().

Referenced by ~GEMSimHitMatcher().

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

Definition at line 259 of file GEMSimHitMatcher.cc.

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

Referenced by ~GEMSimHitMatcher().

260  {
261  if (sim_hits.empty()) return -0.0; // point "zero"
262 
263  float central = -0.0;
264  size_t n = 0;
265  for (const auto& h : sim_hits) {
266  LocalPoint lp(0., 0., 0.); // local central
267  GlobalPoint gp;
268  if (MuonHitHelper::isGEM(h.detUnitId())) {
269  gp = geometry_->idToDet(h.detUnitId())->surface().toGlobal(lp);
270  }
271  central = gp.perp();
272  if (n >= 1)
273  edm::LogWarning("GEMSimHitMatcher")
274  << "warning! find more than one simhits in GEM chamber " << std::endl;
275  ++n;
276  }
277 
278  return central;
279 }
const TrackingGeometry * geometry_
T perp() const
Definition: PV3DBase.h:72
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
virtual const GeomDet * idToDet(DetId) const =0
static bool isGEM(unsigned int detId)
Definition: MuonHitHelper.cc:8
float GEMSimHitMatcher::simHitsMeanStrip ( const edm::PSimHitContainer sim_hits) const

Definition at line 281 of file GEMSimHitMatcher.cc.

References edmIntegrityCheck::d, f, MuonSimHitMatcher::geometry_, h, and gen::n.

Referenced by ~GEMSimHitMatcher().

282  {
283  if (sim_hits.empty()) return -1.f;
284 
285  float sums = 0.f;
286  size_t n = 0;
287  for (const auto& h : sim_hits) {
288  const LocalPoint& lp = h.entryPoint();
289  const auto& d = h.detUnitId();
290  sums +=
291  dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(d)->strip(lp);
292  ++n;
293  }
294  if (n == 0) return -1.f;
295  return sums / n;
296 }
const TrackingGeometry * geometry_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
double f[11][100]
std::set< unsigned int > GEMSimHitMatcher::superChamberIds ( ) const

Definition at line 204 of file GEMSimHitMatcher.cc.

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

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

204  {
205  std::set<unsigned int> result;
206  for (const auto& p : superchamber_to_hits_) result.insert(p.first);
207  return result;
208 }
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
std::set< unsigned int > GEMSimHitMatcher::superChamberIdsCoincidences ( ) const

Definition at line 210 of file GEMSimHitMatcher.cc.

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

Referenced by ~GEMSimHitMatcher().

210  {
211  std::set<unsigned int> result;
212  for (const auto& p : detids_to_copads_) {
213  const GEMDetId& p_id(p.first);
214  result.insert(p_id.superChamberId().rawId());
215  }
216  return result;
217 }
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 84 of file GEMSimHitMatcher.h.

Referenced by hitPadsInDetId(), and matchSimHitsToSimTrack().

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

Definition at line 79 of file GEMSimHitMatcher.h.

Referenced by init().

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