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=1) 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 TrackingGeometrygeometry ()
 
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 clear ()
 
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::ESGetToken< GEMGeometry, MuonGeometryRecordgeomToken_
 
std::map< unsigned int, edm::PSimHitContainersuperchamber_to_hits_
 

Additional Inherited Members

- Protected Member Functions inherited from MuonSimHitMatcher
void clear ()
 
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 16 of file GEMSimHitMatcher.h.

Constructor & Destructor Documentation

◆ GEMSimHitMatcher()

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

Definition at line 5 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::discardEleHits_, geomToken_, 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 
14 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
ParameterSet const & getParameterSet(std::string const &) const
edm::ParameterSet simHitPSet_
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::~GEMSimHitMatcher ( )
inline

Definition at line 22 of file GEMSimHitMatcher.h.

22 {}

Member Function Documentation

◆ chamberIds()

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

Definition at line 184 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().

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

◆ clear()

void GEMSimHitMatcher::clear ( void  )
private

Definition at line 352 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::clear(), detids_to_copads_, detids_to_pads_, and superchamber_to_hits_.

Referenced by match().

352  {
354 
355  superchamber_to_hits_.clear();
356  detids_to_pads_.clear();
357  detids_to_copads_.clear();
358 }
std::map< unsigned int, std::set< int > > detids_to_pads_
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
std::map< unsigned int, std::set< int > > detids_to_copads_

◆ detIds()

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

Definition at line 163 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(), and nPadsWithHits().

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

◆ detIdsCoincidences()

std::set< unsigned int > GEMSimHitMatcher::detIdsCoincidences ( ) const

Definition at line 177 of file GEMSimHitMatcher.cc.

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

Referenced by nCoincidencePadsWithHits().

177  {
178  std::set<unsigned int> result;
179  for (const auto& p : detids_to_copads_)
180  result.insert(p.first);
181  return result;
182 }
std::map< unsigned int, std::set< int > > detids_to_copads_

◆ hitCoPadsInDetId()

std::set< int > GEMSimHitMatcher::hitCoPadsInDetId ( unsigned int  detid) const

Definition at line 316 of file GEMSimHitMatcher.cc.

References detids_to_copads_, and none.

Referenced by nCoincidencePadsWithHits().

316  {
317  set<int> none;
318  if (detids_to_copads_.find(detid) == detids_to_copads_.end())
319  return none;
320  return detids_to_copads_.at(detid);
321 }
std::map< unsigned int, std::set< int > > detids_to_copads_

◆ hitPadsInDetId()

std::set< int > GEMSimHitMatcher::hitPadsInDetId ( unsigned int  detid) const

Definition at line 309 of file GEMSimHitMatcher.cc.

References detids_to_pads_, and none.

Referenced by nPadsWithHits().

309  {
310  set<int> none;
311  if (detids_to_pads_.find(detid) == detids_to_pads_.end())
312  return none;
313  return detids_to_pads_.at(detid);
314 }
std::map< unsigned int, std::set< int > > detids_to_pads_

◆ hitPartitions()

std::set< int > GEMSimHitMatcher::hitPartitions ( ) const

Definition at line 323 of file GEMSimHitMatcher.cc.

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

323  {
324  std::set<int> result;
325 
326  const auto& detids = detIds();
327  for (const auto& id : detids) {
328  GEMDetId idd(id);
329  result.insert(idd.roll());
330  }
331  return result;
332 }
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const

◆ hitsInSuperChamber()

const edm::PSimHitContainer & GEMSimHitMatcher::hitsInSuperChamber ( unsigned int  detid) const

Definition at line 214 of file GEMSimHitMatcher.cc.

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

Referenced by match(), and nLayersWithHitsInSuperChamber().

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

◆ hitStation()

bool GEMSimHitMatcher::hitStation ( int  st,
int  nlayers 
) const

Definition at line 235 of file GEMSimHitMatcher.cc.

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

Referenced by nStations().

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

◆ hitStripsInDetId()

std::set< int > GEMSimHitMatcher::hitStripsInDetId ( unsigned int  detid,
int  margin_n_strips = 1 
) const

Definition at line 290 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().

290  {
291  set<int> result;
292  const auto& simhits = MuonSimHitMatcher::hitsInDetId(detid);
293  GEMDetId id(detid);
294  int max_nstrips = dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id)->nstrips();
295  for (const auto& h : simhits) {
296  const LocalPoint& lp = h.entryPoint();
297  int central_strip =
298  static_cast<int>(dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(id)->topology().channel(lp));
299  int smin = central_strip - margin_n_strips;
300  smin = (smin > 0) ? smin : 0;
301  int smax = central_strip + margin_n_strips;
302  smax = (smax <= max_nstrips) ? smax : max_nstrips;
303  for (int ss = smin; ss <= smax; ++ss)
304  result.insert(ss);
305  }
306  return result;
307 }
const TrackingGeometry * geometry_
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ init()

void GEMSimHitMatcher::init ( const edm::Event e,
const edm::EventSetup eventSetup 
)

initialize the event

Definition at line 17 of file GEMSimHitMatcher.cc.

References MuonSimHitMatcher::geometry_, geomToken_, edm::EventSetup::getData(), iEvent, and MuonSimHitMatcher::init().

17  {
18  geometry_ = &iSetup.getData(geomToken_);
20 }
const TrackingGeometry * geometry_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
int iEvent
Definition: GenABIO.cc:224
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event

◆ match()

void GEMSimHitMatcher::match ( const SimTrack t,
const SimVertex v 
)

do the matching

Definition at line 23 of file GEMSimHitMatcher.cc.

References funct::abs(), MuonSimHitMatcher::chamber_to_hits_, clear(), detIds(), 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(), HLT_2022v12_cff::track, MuonSimHitMatcher::track_ids_, MuonSimHitMatcher::verbose_, and bphysicsOniaDQM_cfi::vertex.

23  {
24  clear();
25 
26  // instantiates the track ids and simhits
28 
29  // hard cut on non-GEM muons
30  if (std::abs(track.momentum().eta()) < 1.55)
31  return;
32 
34 
35  if (verbose_) {
36  edm::LogInfo("GEMSimHitMatcher") << "nTrackIds " << track_ids_.size() << " nSelectedGEMSimHits " << hits_.size();
37  edm::LogInfo("GEMSimHitMatcher") << "detids GEM " << detIds(0).size();
38 
39  const auto& gem_ch_ids = detIds();
40  for (const auto& id : gem_ch_ids) {
41  const auto& gem_simhits = MuonSimHitMatcher::hitsInDetId(id);
42  const auto& gem_simhits_gp = simHitsMeanPosition(gem_simhits);
43  edm::LogInfo("GEMSimHitMatcher") << "gemchid " << GEMDetId(id) << ": nHits " << gem_simhits.size() << " phi "
44  << gem_simhits_gp.phi() << " nCh " << chamber_to_hits_[id].size();
45  const auto& strips = hitStripsInDetId(id);
46  edm::LogInfo("GEMSimHitMatcher") << "nStrip " << strips.size();
47  edm::LogInfo("GEMSimHitMatcher") << "strips : ";
48  for (const auto& p : strips) {
49  edm::LogInfo("GEMSimHitMatcher") << p;
50  }
51  }
52  const auto& gem_sch_ids = superChamberIds();
53  for (const auto& id : gem_sch_ids) {
54  const auto& gem_simhits = hitsInSuperChamber(id);
55  const auto& gem_simhits_gp = simHitsMeanPosition(gem_simhits);
56  edm::LogInfo("GEMSimHitMatcher") << "gemschid " << GEMDetId(id) << ": " << nCoincidencePadsWithHits() << " | "
57  << gem_simhits.size() << " " << gem_simhits_gp.phi() << " "
58  << superchamber_to_hits_[id].size();
59  }
60  }
61 }
edm::PSimHitContainer hits_
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=1) const
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
std::vector< unsigned > track_ids_
int nCoincidencePadsWithHits() const
std::set< unsigned int > superChamberIds() const
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
Log< level::Info, false > LogInfo
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
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

◆ matchSimHitsToSimTrack()

void GEMSimHitMatcher::matchSimHitsToSimTrack ( )
private

Definition at line 63 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, or, compareTotals::pad1, compareTotals::pad2, EgammaValidation_cff::pdgid, MuonSimHitMatcher::simHits_, MuonSimHitMatcher::simMuOnly_, superchamber_to_hits_, MuonSimHitMatcher::track_ids_, and MuonSimHitMatcher::verbose_.

Referenced by match().

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

◆ nCoincidencePadsWithHits()

int GEMSimHitMatcher::nCoincidencePadsWithHits ( ) const

Definition at line 343 of file GEMSimHitMatcher.cc.

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

Referenced by match().

343  {
344  int result = 0;
345  const auto& copad_ids = detIdsCoincidences();
346  for (const auto& id : copad_ids) {
347  result += hitCoPadsInDetId(id).size();
348  }
349  return result;
350 }
std::set< unsigned int > detIdsCoincidences() const
std::set< int > hitCoPadsInDetId(unsigned int) const

◆ nLayersWithHitsInSuperChamber()

int GEMSimHitMatcher::nLayersWithHitsInSuperChamber ( unsigned int  detid) const

Definition at line 225 of file GEMSimHitMatcher.cc.

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

Referenced by hitStation().

225  {
226  set<int> layers_with_hits;
227  const auto& hits = hitsInSuperChamber(detid);
228  for (const auto& h : hits) {
229  const GEMDetId& idd(h.detUnitId());
230  layers_with_hits.insert(idd.layer());
231  }
232  return layers_with_hits.size();
233 }
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ nPadsWithHits()

int GEMSimHitMatcher::nPadsWithHits ( ) const

Definition at line 334 of file GEMSimHitMatcher.cc.

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

334  {
335  int result = 0;
336  const auto& pad_ids = detIds();
337  for (const auto& id : pad_ids) {
338  result += hitPadsInDetId(id).size();
339  }
340  return result;
341 }
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
std::set< int > hitPadsInDetId(unsigned int) const

◆ nStations()

int GEMSimHitMatcher::nStations ( int  nl = 2) const

Definition at line 250 of file GEMSimHitMatcher.cc.

References hitStation(), and nlayers.

250 { return (hitStation(1, nlayers) + hitStation(2, nlayers)); }
bool hitStation(int, int) const

◆ simHitsGEMCentralPosition()

float GEMSimHitMatcher::simHitsGEMCentralPosition ( const edm::PSimHitContainer sim_hits) const

Definition at line 252 of file GEMSimHitMatcher.cc.

References central, MuonSimHitMatcher::geometry_, runTauDisplay::gp, h, TrackingGeometry::idToDet(), MuonHitHelper::isGEM(), dqmiodumpmetadata::n, and GeomDet::toGlobal().

252  {
253  if (sim_hits.empty())
254  return -0.0; // point "zero"
255 
256  float central = -0.0;
257  size_t n = 0;
258  for (const auto& h : sim_hits) {
259  LocalPoint lp(0., 0., 0.); // local central
260  GlobalPoint gp;
261  if (MuonHitHelper::isGEM(h.detUnitId())) {
262  gp = geometry_->idToDet(h.detUnitId())->surface().toGlobal(lp);
263  }
264  central = gp.perp();
265  if (n >= 1)
266  edm::LogWarning("GEMSimHitMatcher") << "warning! find more than one simhits in GEM chamber " << std::endl;
267  ++n;
268  }
269 
270  return central;
271 }
const TrackingGeometry * geometry_
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
Log< level::Warning, false > LogWarning
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ simHitsMeanStrip()

float GEMSimHitMatcher::simHitsMeanStrip ( const edm::PSimHitContainer sim_hits) const

Definition at line 273 of file GEMSimHitMatcher.cc.

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

273  {
274  if (sim_hits.empty())
275  return -1.f;
276 
277  float sums = 0.f;
278  size_t n = 0;
279  for (const auto& h : sim_hits) {
280  const LocalPoint& lp = h.entryPoint();
281  const auto& d = h.detUnitId();
282  sums += dynamic_cast<const GEMGeometry*>(geometry_)->etaPartition(d)->strip(lp);
283  ++n;
284  }
285  if (n == 0)
286  return -1.f;
287  return sums / n;
288 }
const TrackingGeometry * geometry_
double f[11][100]
d
Definition: ztail.py:151
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ superChamberIds()

std::set< unsigned int > GEMSimHitMatcher::superChamberIds ( ) const

Definition at line 198 of file GEMSimHitMatcher.cc.

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

Referenced by match().

198  {
199  std::set<unsigned int> result;
200  for (const auto& p : superchamber_to_hits_)
201  result.insert(p.first);
202  return result;
203 }
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_

◆ superChamberIdsCoincidences()

std::set< unsigned int > GEMSimHitMatcher::superChamberIdsCoincidences ( ) const

Definition at line 205 of file GEMSimHitMatcher.cc.

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

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

Member Data Documentation

◆ detids_to_copads_

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

◆ detids_to_pads_

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

Definition at line 87 of file GEMSimHitMatcher.h.

Referenced by clear(), hitPadsInDetId(), and matchSimHitsToSimTrack().

◆ geomToken_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMSimHitMatcher::geomToken_
private

Definition at line 82 of file GEMSimHitMatcher.h.

Referenced by GEMSimHitMatcher(), and init().

◆ superchamber_to_hits_

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