CMS 3D CMS Logo

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

#include <DTSimHitMatcher.h>

Inheritance diagram for DTSimHitMatcher:
MuonSimHitMatcher

Public Member Functions

std::set< unsigned int > chamberIds (int type=MuonHitHelper::DT_ALL) const
 
std::set< unsigned int > chamberIdsStation (int station) const
 
std::set< unsigned int > detIds (int type=MuonHitHelper::DT_ALL) const
 
void dtChamberIdsToString (const std::set< unsigned int > &) const
 
 DTSimHitMatcher (const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
 
const edm::PSimHitContainerhitsInChamber (unsigned int) const
 
const edm::PSimHitContainerhitsInLayer (unsigned int) const
 
const edm::PSimHitContainerhitsInSuperLayer (unsigned int) const
 
bool hitStation (int, int, int) const
 
std::set< unsigned int > hitWiresInDTChamberId (unsigned int, int margin_n_wires=0) const
 
std::set< unsigned int > hitWiresInDTLayerId (unsigned int, int margin_n_wires=0) const
 
std::set< unsigned int > hitWiresInDTSuperLayerId (unsigned int, int margin_n_wires=0) const
 
void init (const edm::Event &e, const edm::EventSetup &eventSetup)
 initialize the event More...
 
std::set< unsigned int > layerIds () const
 
void match (const SimTrack &t, const SimVertex &v)
 do the matching More...
 
int nCellsWithHitsInLayer (unsigned int) const
 
int nLayersWithHitsInChamber (unsigned int) const
 
int nLayersWithHitsInSuperLayer (unsigned int) const
 
int nStations (int nsl=1, int nl=3) const
 
int nSuperLayersWithHitsInChamber (unsigned int) const
 
GlobalPoint simHitsMeanPositionStation (int n) const
 
float simHitsMeanWire (const edm::PSimHitContainer &sim_hits) const
 
std::set< unsigned int > superlayerIds () const
 
 ~DTSimHitMatcher ()
 
- 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

edm::ESHandle< DTGeometrydt_geom_
 
std::map< unsigned int, edm::PSimHitContainerlayer_to_hits_
 
std::map< unsigned int, edm::PSimHitContainersuperlayer_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 DT SimHit to SimTrack

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

Definition at line 14 of file DTSimHitMatcher.h.

Constructor & Destructor Documentation

◆ DTSimHitMatcher()

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

◆ ~DTSimHitMatcher()

DTSimHitMatcher::~DTSimHitMatcher ( )
inline

Definition at line 20 of file DTSimHitMatcher.h.

20 {}

Member Function Documentation

◆ chamberIds()

std::set< unsigned int > DTSimHitMatcher::chamberIds ( int  type = MuonHitHelper::DT_ALL) const

Definition at line 88 of file DTSimHitMatcher.cc.

88  {
89  std::set<unsigned int> result;
90  for (const auto& p : chamber_to_hits_) {
91  const auto& id = p.first;
92  if (dt_type > 0) {
93  DTChamberId detId(id);
94  if (MuonHitHelper::toDTType(detId.wheel(), detId.station()) != dt_type)
95  continue;
96  }
97  result.insert(id);
98  }
99  return result;
100 }

References MuonSimHitMatcher::chamber_to_hits_, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, DTChamberId::station(), MuonHitHelper::toDTType(), and DTChamberId::wheel().

Referenced by chamberIdsStation(), and hitStation().

◆ chamberIdsStation()

std::set< unsigned int > DTSimHitMatcher::chamberIdsStation ( int  station) const

Definition at line 296 of file DTSimHitMatcher.cc.

296  {
297  set<unsigned int> result;
298  switch (station) {
299  case 1: {
300  const auto& p1(chamberIds(MuonHitHelper::DT_MB21p));
301  const auto& p2(chamberIds(MuonHitHelper::DT_MB11p));
302  const auto& p3(chamberIds(MuonHitHelper::DT_MB01));
303  const auto& p4(chamberIds(MuonHitHelper::DT_MB11n));
304  const auto& p5(chamberIds(MuonHitHelper::DT_MB21n));
305  result.insert(p1.begin(), p1.end());
306  result.insert(p2.begin(), p2.end());
307  result.insert(p3.begin(), p3.end());
308  result.insert(p4.begin(), p4.end());
309  result.insert(p5.begin(), p5.end());
310  break;
311  }
312  case 2: {
313  const auto& p1(chamberIds(MuonHitHelper::DT_MB22p));
314  const auto& p2(chamberIds(MuonHitHelper::DT_MB12p));
315  const auto& p3(chamberIds(MuonHitHelper::DT_MB02));
316  const auto& p4(chamberIds(MuonHitHelper::DT_MB12n));
317  const auto& p5(chamberIds(MuonHitHelper::DT_MB22n));
318  result.insert(p1.begin(), p1.end());
319  result.insert(p2.begin(), p2.end());
320  result.insert(p3.begin(), p3.end());
321  result.insert(p4.begin(), p4.end());
322  result.insert(p5.begin(), p5.end());
323  break;
324  }
325  case 3: {
326  const auto& p1(chamberIds(MuonHitHelper::DT_MB23p));
327  const auto& p2(chamberIds(MuonHitHelper::DT_MB13p));
328  const auto& p3(chamberIds(MuonHitHelper::DT_MB03));
329  const auto& p4(chamberIds(MuonHitHelper::DT_MB13n));
330  const auto& p5(chamberIds(MuonHitHelper::DT_MB23n));
331  result.insert(p1.begin(), p1.end());
332  result.insert(p2.begin(), p2.end());
333  result.insert(p3.begin(), p3.end());
334  result.insert(p4.begin(), p4.end());
335  result.insert(p5.begin(), p5.end());
336  break;
337  }
338  case 4: {
339  const auto& p1(chamberIds(MuonHitHelper::DT_MB24p));
340  const auto& p2(chamberIds(MuonHitHelper::DT_MB14p));
341  const auto& p3(chamberIds(MuonHitHelper::DT_MB04));
342  const auto& p4(chamberIds(MuonHitHelper::DT_MB14n));
343  const auto& p5(chamberIds(MuonHitHelper::DT_MB24n));
344  result.insert(p1.begin(), p1.end());
345  result.insert(p2.begin(), p2.end());
346  result.insert(p3.begin(), p3.end());
347  result.insert(p4.begin(), p4.end());
348  result.insert(p5.begin(), p5.end());
349  break;
350  }
351  };
352  return result;
353 }

References chamberIds(), MuonHitHelper::DT_MB01, MuonHitHelper::DT_MB02, MuonHitHelper::DT_MB03, MuonHitHelper::DT_MB04, MuonHitHelper::DT_MB11n, MuonHitHelper::DT_MB11p, MuonHitHelper::DT_MB12n, MuonHitHelper::DT_MB12p, MuonHitHelper::DT_MB13n, MuonHitHelper::DT_MB13p, MuonHitHelper::DT_MB14n, MuonHitHelper::DT_MB14p, MuonHitHelper::DT_MB21n, MuonHitHelper::DT_MB21p, MuonHitHelper::DT_MB22n, MuonHitHelper::DT_MB22p, MuonHitHelper::DT_MB23n, MuonHitHelper::DT_MB23p, MuonHitHelper::DT_MB24n, MuonHitHelper::DT_MB24p, p1, p2, p3, p4, mps_fire::result, and relativeConstraints::station.

◆ detIds()

std::set< unsigned int > DTSimHitMatcher::detIds ( int  type = MuonHitHelper::DT_ALL) const

Definition at line 74 of file DTSimHitMatcher.cc.

74  {
75  std::set<unsigned int> result;
76  for (const auto& p : detid_to_hits_) {
77  const auto& id = p.first;
78  if (dt_type > 0) {
79  DTWireId detId(id);
80  if (MuonHitHelper::toDTType(detId.wheel(), detId.station()) != dt_type)
81  continue;
82  }
83  result.insert(id);
84  }
85  return result;
86 }

References MuonSimHitMatcher::detid_to_hits_, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, DTChamberId::station(), MuonHitHelper::toDTType(), and DTChamberId::wheel().

Referenced by match().

◆ dtChamberIdsToString()

void DTSimHitMatcher::dtChamberIdsToString ( const std::set< unsigned int > &  set) const

Definition at line 289 of file DTSimHitMatcher.cc.

289  {
290  for (const auto& p : set) {
291  DTChamberId detId(p);
292  edm::LogInfo("DTSimHitMatcher") << " " << detId << "\n";
293  }
294 }

References AlCaHLTBitMon_ParallelJobs::p.

◆ hitsInChamber()

const edm::PSimHitContainer & DTSimHitMatcher::hitsInChamber ( unsigned int  detid) const

Definition at line 136 of file DTSimHitMatcher.cc.

136  {
137  if (!MuonHitHelper::isDT(detid))
138  return no_hits_;
139 
140  const DTWireId id(detid);
141  if (chamber_to_hits_.find(id.chamberId().rawId()) == chamber_to_hits_.end())
142  return no_hits_;
143  return chamber_to_hits_.at(id.chamberId().rawId());
144 }

References MuonSimHitMatcher::chamber_to_hits_, triggerObjects_cff::id, MuonHitHelper::isDT(), and MuonSimHitMatcher::no_hits_.

◆ hitsInLayer()

const edm::PSimHitContainer & DTSimHitMatcher::hitsInLayer ( unsigned int  detid) const

Definition at line 116 of file DTSimHitMatcher.cc.

116  {
117  if (!MuonHitHelper::isDT(detid))
118  return no_hits_;
119 
120  const DTWireId id(detid);
121  if (layer_to_hits_.find(id.layerId().rawId()) == layer_to_hits_.end())
122  return no_hits_;
123  return layer_to_hits_.at(id.layerId().rawId());
124 }

References triggerObjects_cff::id, MuonHitHelper::isDT(), layer_to_hits_, and MuonSimHitMatcher::no_hits_.

Referenced by nCellsWithHitsInLayer().

◆ hitsInSuperLayer()

const edm::PSimHitContainer & DTSimHitMatcher::hitsInSuperLayer ( unsigned int  detid) const

Definition at line 126 of file DTSimHitMatcher.cc.

126  {
127  if (!MuonHitHelper::isDT(detid))
128  return no_hits_;
129 
130  const DTWireId id(detid);
131  if (superlayer_to_hits_.find(id.superlayerId().rawId()) == superlayer_to_hits_.end())
132  return no_hits_;
133  return superlayer_to_hits_.at(id.superlayerId().rawId());
134 }

References triggerObjects_cff::id, MuonHitHelper::isDT(), MuonSimHitMatcher::no_hits_, and superlayer_to_hits_.

Referenced by nLayersWithHitsInSuperLayer().

◆ hitStation()

bool DTSimHitMatcher::hitStation ( int  st,
int  nsuperlayers,
int  nlayers 
) const

Definition at line 146 of file DTSimHitMatcher.cc.

146  {
147  int nst = 0;
148  for (const auto& ddt : chamberIds()) {
149  const DTChamberId id(ddt);
150  if (id.station() != st)
151  continue;
152 
153  // require at least 1 superlayer
154  const int nsl(nSuperLayersWithHitsInChamber(id.rawId()));
155  if (nsl < nsuperlayers)
156  continue;
157 
158  // require at least 3 layers hit per chamber
159  const int nl(nLayersWithHitsInChamber(id.rawId()));
160  if (nl < nlayers)
161  continue;
162  ++nst;
163  }
164  return nst;
165 }

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

Referenced by nStations().

◆ hitWiresInDTChamberId()

std::set< unsigned int > DTSimHitMatcher::hitWiresInDTChamberId ( unsigned int  detid,
int  margin_n_wires = 0 
) const

Definition at line 277 of file DTSimHitMatcher.cc.

277  {
278  set<unsigned int> result;
279  const auto& superLayers(dynamic_cast<const DTGeometry*>(geometry_)->chamber(DTChamberId(detid))->superLayers());
280  for (const auto& sl : superLayers) {
281  if (verbose_)
282  edm::LogInfo("DTSimHitMatcher") << "hitWiresInDTChamberId::sl id " << sl->id() << endl;
283  const auto& p(hitWiresInDTSuperLayerId(sl->id().rawId(), margin_n_wires));
284  result.insert(p.begin(), p.end());
285  }
286  return result;
287 }

References relativeConstraints::chamber, MuonSimHitMatcher::geometry_, hitWiresInDTSuperLayerId(), AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and MuonSimHitMatcher::verbose_.

◆ hitWiresInDTLayerId()

std::set< unsigned int > DTSimHitMatcher::hitWiresInDTLayerId ( unsigned int  detid,
int  margin_n_wires = 0 
) const

Definition at line 239 of file DTSimHitMatcher.cc.

239  {
240  set<unsigned int> result;
241  if (MuonHitHelper::isDT(detid)) {
242  DTLayerId id(detid);
243  int max_nwires = dynamic_cast<const DTGeometry*>(geometry_)->layer(id)->specificTopology().channels();
244  for (int wn = 0; wn <= max_nwires; ++wn) {
245  DTWireId wid(id, wn);
246  for (const auto& h : MuonSimHitMatcher::hitsInDetId(wid.rawId())) {
247  if (verbose_)
248  edm::LogInfo("DTSimHitMatcher") << "central DTWireId " << wid << " simhit " << h << endl;
249  int smin = wn - margin_n_wires;
250  smin = (smin > 0) ? smin : 1;
251  int smax = wn + margin_n_wires;
252  smax = (smax <= max_nwires) ? smax : max_nwires;
253  for (int ss = smin; ss <= smax; ++ss) {
254  DTWireId widd(id, ss);
255  if (verbose_)
256  edm::LogInfo("DTSimHitMatcher") << "\tadding DTWireId to collection " << widd << endl;
257  result.insert(widd.rawId());
258  }
259  }
260  }
261  }
262  return result;
263 }

References MuonSimHitMatcher::geometry_, MuonSimHitMatcher::hitsInDetId(), triggerObjects_cff::id, MuonHitHelper::isDT(), DetId::rawId(), mps_fire::result, contentValuesCheck::ss, and MuonSimHitMatcher::verbose_.

Referenced by hitWiresInDTSuperLayerId().

◆ hitWiresInDTSuperLayerId()

std::set< unsigned int > DTSimHitMatcher::hitWiresInDTSuperLayerId ( unsigned int  detid,
int  margin_n_wires = 0 
) const

Definition at line 265 of file DTSimHitMatcher.cc.

265  {
266  set<unsigned int> result;
267  const auto& layers(dynamic_cast<const DTGeometry*>(geometry_)->superLayer(DTSuperLayerId(detid))->layers());
268  for (const auto& l : layers) {
269  if (verbose_)
270  edm::LogInfo("DTSimHitMatcher") << "hitWiresInDTSuperLayerId::l id " << l->id() << endl;
271  const auto& p(hitWiresInDTLayerId(l->id().rawId(), margin_n_wires));
272  result.insert(p.begin(), p.end());
273  }
274  return result;
275 }

References MuonSimHitMatcher::geometry_, hitWiresInDTLayerId(), cmsLHEtoEOSManager::l, hgcalTopologyTester_cfi::layers, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and MuonSimHitMatcher::verbose_.

Referenced by hitWiresInDTChamberId().

◆ init()

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

initialize the event

Definition at line 16 of file DTSimHitMatcher.cc.

16  {
17  iSetup.get<MuonGeometryRecord>().get(dt_geom_);
18  if (dt_geom_.isValid()) {
19  geometry_ = &*dt_geom_;
20  } else {
21  hasGeometry_ = false;
22  edm::LogWarning("DTSimHitMatcher") << "+++ Info: DT geometry is unavailable. +++\n";
23  }
25 }

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

◆ layerIds()

std::set< unsigned int > DTSimHitMatcher::layerIds ( ) const

Definition at line 102 of file DTSimHitMatcher.cc.

102  {
103  std::set<unsigned int> result;
104  for (const auto& p : layer_to_hits_)
105  result.insert(p.first);
106  return result;
107 }

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

◆ match()

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

do the matching

Definition at line 28 of file DTSimHitMatcher.cc.

28  {
29  // instantiates the track ids and simhits
31 
32  if (hasGeometry_) {
34 
35  if (verbose_) {
36  edm::LogInfo("DTSimHitMatcher") << "nTrackIds " << track_ids_.size() << " nSelectedDTSimHits " << hits_.size()
37  << endl;
38  edm::LogInfo("DTSimHitMatcher") << "detids DT " << detIds(0).size() << endl;
39 
40  const auto& dt_det_ids = detIds(0);
41  for (const auto& id : dt_det_ids) {
42  const auto& dt_simhits = MuonSimHitMatcher::hitsInDetId(id);
43  const auto& dt_simhits_gp = simHitsMeanPosition(dt_simhits);
44  edm::LogInfo("DTSimHitMatcher") << "DTWireId " << DTWireId(id) << ": nHits " << dt_simhits.size() << " eta "
45  << dt_simhits_gp.eta() << " phi " << dt_simhits_gp.phi() << " nCh "
46  << chamber_to_hits_[id].size() << endl;
47  }
48  }
49  }
50 }

References MuonSimHitMatcher::chamber_to_hits_, detIds(), MuonSimHitMatcher::hasGeometry_, MuonSimHitMatcher::hits_, MuonSimHitMatcher::hitsInDetId(), triggerObjects_cff::id, MuonSimHitMatcher::match(), matchSimHitsToSimTrack(), MuonSimHitMatcher::simHitsMeanPosition(), HLT_2018_cff::track, MuonSimHitMatcher::track_ids_, MuonSimHitMatcher::verbose_, and bphysicsOniaDQM_cfi::vertex.

◆ matchSimHitsToSimTrack()

void DTSimHitMatcher::matchSimHitsToSimTrack ( )
private

Definition at line 52 of file DTSimHitMatcher.cc.

52  {
53  for (const auto& track_id : track_ids_) {
54  for (const auto& h : simHits_) {
55  if (h.trackId() != track_id)
56  continue;
57  int pdgid = h.particleType();
58  if (simMuOnly_ && std::abs(pdgid) != 13)
59  continue;
60  // discard electron hits in the DT chambers
61  if (discardEleHits_ && pdgid == 11)
62  continue;
63 
64  const DTWireId layer_id(h.detUnitId());
65  detid_to_hits_[h.detUnitId()].push_back(h);
66  hits_.push_back(h);
67  layer_to_hits_[layer_id.layerId().rawId()].push_back(h);
68  superlayer_to_hits_[layer_id.superlayerId().rawId()].push_back(h);
69  chamber_to_hits_[layer_id.chamberId().rawId()].push_back(h);
70  }
71  }
72 }

References funct::abs(), MuonSimHitMatcher::chamber_to_hits_, MuonSimHitMatcher::detid_to_hits_, MuonSimHitMatcher::discardEleHits_, MuonSimHitMatcher::hits_, layer_to_hits_, EgammaValidation_cff::pdgid, MuonSimHitMatcher::simHits_, MuonSimHitMatcher::simMuOnly_, superlayer_to_hits_, and MuonSimHitMatcher::track_ids_.

Referenced by match().

◆ nCellsWithHitsInLayer()

int DTSimHitMatcher::nCellsWithHitsInLayer ( unsigned int  detid) const

Definition at line 172 of file DTSimHitMatcher.cc.

172  {
173  set<int> layers_with_hits;
174  const auto& hits = hitsInLayer(detid);
175  for (const auto& h : hits) {
176  if (MuonHitHelper::isDT(detid)) {
177  const DTWireId idd(h.detUnitId());
178  layers_with_hits.insert(idd.wire());
179  }
180  }
181  return layers_with_hits.size();
182 }

References hfClusterShapes_cfi::hits, hitsInLayer(), and MuonHitHelper::isDT().

◆ nLayersWithHitsInChamber()

int DTSimHitMatcher::nLayersWithHitsInChamber ( unsigned int  detid) const

Definition at line 208 of file DTSimHitMatcher.cc.

208  {
209  int nLayers = 0;
210  const auto& superLayers(dynamic_cast<const DTGeometry*>(geometry_)->chamber(DTChamberId(detid))->superLayers());
211  for (const auto& sl : superLayers) {
212  nLayers += nLayersWithHitsInSuperLayer(sl->id().rawId());
213  }
214  return nLayers;
215 }

References relativeConstraints::chamber, MuonSimHitMatcher::geometry_, MuonTCMETValueMapProducer_cff::nLayers, and nLayersWithHitsInSuperLayer().

Referenced by hitStation().

◆ nLayersWithHitsInSuperLayer()

int DTSimHitMatcher::nLayersWithHitsInSuperLayer ( unsigned int  detid) const

Definition at line 184 of file DTSimHitMatcher.cc.

184  {
185  set<int> layers_with_hits;
186  const auto& hits = hitsInSuperLayer(detid);
187  for (const auto& h : hits) {
188  if (MuonHitHelper::isDT(detid)) {
189  const DTLayerId idd(h.detUnitId());
190  layers_with_hits.insert(idd.layer());
191  }
192  }
193  return layers_with_hits.size();
194 }

References hfClusterShapes_cfi::hits, hitsInSuperLayer(), and MuonHitHelper::isDT().

Referenced by nLayersWithHitsInChamber().

◆ nStations()

int DTSimHitMatcher::nStations ( int  nsl = 1,
int  nl = 3 
) const

Definition at line 167 of file DTSimHitMatcher.cc.

167  {
168  return (hitStation(1, nsuperlayers, nlayers) + hitStation(2, nsuperlayers, nlayers) +
169  hitStation(3, nsuperlayers, nlayers) + hitStation(4, nsuperlayers, nlayers));
170 }

References hitStation(), and nlayers.

◆ nSuperLayersWithHitsInChamber()

int DTSimHitMatcher::nSuperLayersWithHitsInChamber ( unsigned int  detid) const

Definition at line 196 of file DTSimHitMatcher.cc.

196  {
197  set<int> sl_with_hits;
198  const auto& hits = MuonSimHitMatcher::hitsInChamber(detid);
199  for (const auto& h : hits) {
200  if (MuonHitHelper::isDT(detid)) {
201  const DTSuperLayerId idd(h.detUnitId());
202  sl_with_hits.insert(idd.superLayer());
203  }
204  }
205  return sl_with_hits.size();
206 }

References hfClusterShapes_cfi::hits, MuonSimHitMatcher::hitsInChamber(), and MuonHitHelper::isDT().

Referenced by hitStation().

◆ simHitsMeanPositionStation()

GlobalPoint DTSimHitMatcher::simHitsMeanPositionStation ( int  n) const

◆ simHitsMeanWire()

float DTSimHitMatcher::simHitsMeanWire ( const edm::PSimHitContainer sim_hits) const

Definition at line 216 of file DTSimHitMatcher.cc.

216  {
217  if (sim_hits.empty())
218  return -1.f;
219 
220  float sums = 0.f;
221  size_t n = 0;
222  for (const auto& h : sim_hits) {
223  const LocalPoint& lp = h.entryPoint();
224  float s;
225  const auto& d = h.detUnitId();
226  if (MuonHitHelper::isDT(d)) {
227  // find nearest wire
228  s = dynamic_cast<const DTGeometry*>(geometry_)->layer(DTLayerId(d))->specificTopology().channel(lp);
229  } else
230  continue;
231  sums += s;
232  ++n;
233  }
234  if (n == 0)
235  return -1.f;
236  return sums / n;
237 }

References ztail::d, f, MuonSimHitMatcher::geometry_, MuonHitHelper::isDT(), dqmiodumpmetadata::n, and alignCSCRings::s.

◆ superlayerIds()

std::set< unsigned int > DTSimHitMatcher::superlayerIds ( ) const

Definition at line 109 of file DTSimHitMatcher.cc.

109  {
110  std::set<unsigned int> result;
111  for (const auto& p : superlayer_to_hits_)
112  result.insert(p.first);
113  return result;
114 }

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

Member Data Documentation

◆ dt_geom_

edm::ESHandle<DTGeometry> DTSimHitMatcher::dt_geom_
private

Definition at line 76 of file DTSimHitMatcher.h.

Referenced by init().

◆ layer_to_hits_

std::map<unsigned int, edm::PSimHitContainer> DTSimHitMatcher::layer_to_hits_
private

Definition at line 73 of file DTSimHitMatcher.h.

Referenced by hitsInLayer(), layerIds(), and matchSimHitsToSimTrack().

◆ superlayer_to_hits_

std::map<unsigned int, edm::PSimHitContainer> DTSimHitMatcher::superlayer_to_hits_
private

Definition at line 74 of file DTSimHitMatcher.h.

Referenced by hitsInSuperLayer(), matchSimHitsToSimTrack(), and superlayerIds().

DTSimHitMatcher::hitsInSuperLayer
const edm::PSimHitContainer & hitsInSuperLayer(unsigned int) const
Definition: DTSimHitMatcher.cc:126
DTSimHitMatcher::dt_geom_
edm::ESHandle< DTGeometry > dt_geom_
Definition: DTSimHitMatcher.h:76
DTSuperLayerId
Definition: DTSuperLayerId.h:12
DTSimHitMatcher::hitWiresInDTSuperLayerId
std::set< unsigned int > hitWiresInDTSuperLayerId(unsigned int, int margin_n_wires=0) const
Definition: DTSimHitMatcher.cc:265
DTSimHitMatcher::nLayersWithHitsInChamber
int nLayersWithHitsInChamber(unsigned int) const
Definition: DTSimHitMatcher.cc:208
MuonHitHelper::DT_MB14n
Definition: MuonHitHelper.h:85
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
MuonHitHelper::DT_MB14p
Definition: MuonHitHelper.h:77
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
DTSimHitMatcher::layer_to_hits_
std::map< unsigned int, edm::PSimHitContainer > layer_to_hits_
Definition: DTSimHitMatcher.h:73
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
MuonSimHitMatcher::geometry_
const TrackingGeometry * geometry_
Definition: MuonSimHitMatcher.h:81
MuonHitHelper::DT_MB24p
Definition: MuonHitHelper.h:81
relativeConstraints.station
station
Definition: relativeConstraints.py:67
MuonSimHitMatcher::verbose_
bool verbose_
Definition: MuonSimHitMatcher.h:78
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MuonHitHelper::DT_MB01
Definition: MuonHitHelper.h:70
edm::LogInfo
Definition: MessageLogger.h:254
MuonSimHitMatcher::detid_to_hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
Definition: MuonSimHitMatcher.h:103
MuonSimHitMatcher::simHitsMeanPosition
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
Definition: MuonSimHitMatcher.cc:99
MuonHitHelper::DT_MB22n
Definition: MuonHitHelper.h:87
MuonHitHelper::DT_MB02
Definition: MuonHitHelper.h:71
DTSimHitMatcher::hitsInLayer
const edm::PSimHitContainer & hitsInLayer(unsigned int) const
Definition: DTSimHitMatcher.cc:116
MuonHitHelper::DT_MB11n
Definition: MuonHitHelper.h:82
MuonSimHitMatcher::simHits_
edm::PSimHitContainer simHits_
Definition: MuonSimHitMatcher.h:94
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
MuonHitHelper::DT_MB11p
Definition: MuonHitHelper.h:74
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DTSimHitMatcher::nSuperLayersWithHitsInChamber
int nSuperLayersWithHitsInChamber(unsigned int) const
Definition: DTSimHitMatcher.cc:196
h
MuonHitHelper::toDTType
static int toDTType(int wh, int st)
Definition: MuonHitHelper.cc:141
DTWireId
Definition: DTWireId.h:12
MuonHitHelper::DT_MB13p
Definition: MuonHitHelper.h:76
MuonSimHitMatcher::simHitPSet_
edm::ParameterSet simHitPSet_
Definition: MuonSimHitMatcher.h:106
p2
double p2[4]
Definition: TauolaWrapper.h:90
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
Point3DBase< float, LocalTag >
DTSimHitMatcher::chamberIds
std::set< unsigned int > chamberIds(int type=MuonHitHelper::DT_ALL) const
Definition: DTSimHitMatcher.cc:88
DTLayerId
Definition: DTLayerId.h:12
MuonSimHitMatcher::track_ids_
std::vector< unsigned > track_ids_
Definition: MuonSimHitMatcher.h:96
MuonSimHitMatcher::no_hits_
edm::PSimHitContainer no_hits_
Definition: MuonSimHitMatcher.h:99
MuonTCMETValueMapProducer_cff.nLayers
nLayers
Definition: MuonTCMETValueMapProducer_cff.py:38
edm::LogWarning
Definition: MessageLogger.h:141
MuonSimHitMatcher::discardEleHits_
bool discardEleHits_
Definition: MuonSimHitMatcher.h:77
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
MuonHitHelper::DT_MB23n
Definition: MuonHitHelper.h:88
MuonHitHelper::DT_MB21n
Definition: MuonHitHelper.h:86
DTSimHitMatcher::matchSimHitsToSimTrack
void matchSimHitsToSimTrack()
Definition: DTSimHitMatcher.cc:52
DTSimHitMatcher::detIds
std::set< unsigned int > detIds(int type=MuonHitHelper::DT_ALL) const
Definition: DTSimHitMatcher.cc:74
MuonHitHelper::DT_MB21p
Definition: MuonHitHelper.h:78
MuonSimHitMatcher::match
void match(const SimTrack &t, const SimVertex &v)
do the matching
Definition: MuonSimHitMatcher.cc:26
MuonHitHelper::DT_MB23p
Definition: MuonHitHelper.h:80
DTSimHitMatcher::nLayersWithHitsInSuperLayer
int nLayersWithHitsInSuperLayer(unsigned int) const
Definition: DTSimHitMatcher.cc:184
MuonHitHelper::DT_MB12n
Definition: MuonHitHelper.h:83
MuonSimHitMatcher::hasGeometry_
bool hasGeometry_
Definition: MuonSimHitMatcher.h:79
iEvent
int iEvent
Definition: GenABIO.cc:224
p4
double p4[4]
Definition: TauolaWrapper.h:92
p1
double p1[4]
Definition: TauolaWrapper.h:89
MuonSimHitMatcher::chamber_to_hits_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Definition: MuonSimHitMatcher.h:104
MuonHitHelper::DT_MB04
Definition: MuonHitHelper.h:73
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
MuonSimHitMatcher::simHitInput_
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
Definition: MuonSimHitMatcher.h:85
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
DTSimHitMatcher::hitWiresInDTLayerId
std::set< unsigned int > hitWiresInDTLayerId(unsigned int, int margin_n_wires=0) const
Definition: DTSimHitMatcher.cc:239
MuonHitHelper::DT_MB22p
Definition: MuonHitHelper.h:79
MuonHitHelper::DT_MB12p
Definition: MuonHitHelper.h:75
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
MuonSimHitMatcher::hitsInDetId
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
Definition: MuonSimHitMatcher.cc:87
eostools.move
def move(src, dest)
Definition: eostools.py:511
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
MuonSimHitMatcher::simMuOnly_
bool simMuOnly_
Definition: MuonSimHitMatcher.h:76
p3
double p3[4]
Definition: TauolaWrapper.h:91
MuonHitHelper::DT_MB24n
Definition: MuonHitHelper.h:89
MuonSimHitMatcher::hitsInChamber
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
Definition: MuonSimHitMatcher.cc:93
DTSimHitMatcher::superlayer_to_hits_
std::map< unsigned int, edm::PSimHitContainer > superlayer_to_hits_
Definition: DTSimHitMatcher.h:74
DTSimHitMatcher::hitStation
bool hitStation(int, int, int) const
Definition: DTSimHitMatcher.cc:146
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
ztail.d
d
Definition: ztail.py:151
MuonHitHelper::DT_MB13n
Definition: MuonHitHelper.h:84
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTChamberId
Definition: DTChamberId.h:14
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
MuonHitHelper::DT_MB03
Definition: MuonHitHelper.h:72
MuonSimHitMatcher::hits_
edm::PSimHitContainer hits_
Definition: MuonSimHitMatcher.h:102
EgammaValidation_cff.pdgid
pdgid
Definition: EgammaValidation_cff.py:30
MuonSimHitMatcher::init
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
Definition: MuonSimHitMatcher.cc:17
MuonHitHelper::isDT
static bool isDT(unsigned int detId)
check detid type
Definition: MuonHitHelper.cc:3
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
nlayers
Definition: HIMultiTrackSelector.h:48
MuonSimHitMatcher::MuonSimHitMatcher
MuonSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
Definition: MuonSimHitMatcher.cc:7