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 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 matchSimHitsToSimTrack ()
 

Private Attributes

edm::ESGetToken< DTGeometry, MuonGeometryRecordgeomToken_
 
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
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 DT SimHit to SimTrack

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

Definition at line 16 of file DTSimHitMatcher.h.

Constructor & Destructor Documentation

◆ DTSimHitMatcher()

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

◆ ~DTSimHitMatcher()

DTSimHitMatcher::~DTSimHitMatcher ( )
inline

Definition at line 22 of file DTSimHitMatcher.h.

22 {}

Member Function Documentation

◆ chamberIds()

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

Definition at line 80 of file DTSimHitMatcher.cc.

80  {
81  std::set<unsigned int> result;
82  for (const auto& p : chamber_to_hits_) {
83  const auto& id = p.first;
84  if (dt_type > 0) {
85  DTChamberId detId(id);
86  if (MuonHitHelper::toDTType(detId.wheel(), detId.station()) != dt_type)
87  continue;
88  }
89  result.insert(id);
90  }
91  return result;
92 }

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 288 of file DTSimHitMatcher.cc.

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

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 66 of file DTSimHitMatcher.cc.

66  {
67  std::set<unsigned int> result;
68  for (const auto& p : detid_to_hits_) {
69  const auto& id = p.first;
70  if (dt_type > 0) {
71  DTWireId detId(id);
72  if (MuonHitHelper::toDTType(detId.wheel(), detId.station()) != dt_type)
73  continue;
74  }
75  result.insert(id);
76  }
77  return result;
78 }

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 281 of file DTSimHitMatcher.cc.

281  {
282  for (const auto& p : set) {
283  DTChamberId detId(p);
284  edm::LogInfo("DTSimHitMatcher") << " " << detId << "\n";
285  }
286 }

References AlCaHLTBitMon_ParallelJobs::p.

◆ hitsInChamber()

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

Definition at line 128 of file DTSimHitMatcher.cc.

128  {
129  if (!MuonHitHelper::isDT(detid))
130  return no_hits_;
131 
132  const DTWireId id(detid);
133  if (chamber_to_hits_.find(id.chamberId().rawId()) == chamber_to_hits_.end())
134  return no_hits_;
135  return chamber_to_hits_.at(id.chamberId().rawId());
136 }

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 108 of file DTSimHitMatcher.cc.

108  {
109  if (!MuonHitHelper::isDT(detid))
110  return no_hits_;
111 
112  const DTWireId id(detid);
113  if (layer_to_hits_.find(id.layerId().rawId()) == layer_to_hits_.end())
114  return no_hits_;
115  return layer_to_hits_.at(id.layerId().rawId());
116 }

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 118 of file DTSimHitMatcher.cc.

118  {
119  if (!MuonHitHelper::isDT(detid))
120  return no_hits_;
121 
122  const DTWireId id(detid);
123  if (superlayer_to_hits_.find(id.superlayerId().rawId()) == superlayer_to_hits_.end())
124  return no_hits_;
125  return superlayer_to_hits_.at(id.superlayerId().rawId());
126 }

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 138 of file DTSimHitMatcher.cc.

138  {
139  int nst = 0;
140  for (const auto& ddt : chamberIds()) {
141  const DTChamberId id(ddt);
142  if (id.station() != st)
143  continue;
144 
145  // require at least 1 superlayer
146  const int nsl(nSuperLayersWithHitsInChamber(id.rawId()));
147  if (nsl < nsuperlayers)
148  continue;
149 
150  // require at least 3 layers hit per chamber
151  const int nl(nLayersWithHitsInChamber(id.rawId()));
152  if (nl < nlayers)
153  continue;
154  ++nst;
155  }
156  return nst;
157 }

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 269 of file DTSimHitMatcher.cc.

269  {
270  set<unsigned int> result;
271  const auto& superLayers(dynamic_cast<const DTGeometry*>(geometry_)->chamber(DTChamberId(detid))->superLayers());
272  for (const auto& sl : superLayers) {
273  if (verbose_)
274  edm::LogInfo("DTSimHitMatcher") << "hitWiresInDTChamberId::sl id " << sl->id();
275  const auto& p(hitWiresInDTSuperLayerId(sl->id().rawId(), margin_n_wires));
276  result.insert(p.begin(), p.end());
277  }
278  return result;
279 }

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 231 of file DTSimHitMatcher.cc.

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

References MuonSimHitMatcher::geometry_, h, 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 257 of file DTSimHitMatcher.cc.

257  {
258  set<unsigned int> result;
259  const auto& layers(dynamic_cast<const DTGeometry*>(geometry_)->superLayer(DTSuperLayerId(detid))->layers());
260  for (const auto& l : layers) {
261  if (verbose_)
262  edm::LogInfo("DTSimHitMatcher") << "hitWiresInDTSuperLayerId::l id " << l->id();
263  const auto& p(hitWiresInDTLayerId(l->id().rawId(), margin_n_wires));
264  result.insert(p.begin(), p.end());
265  }
266  return result;
267 }

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 17 of file DTSimHitMatcher.cc.

17  {
18  geometry_ = &iSetup.getData(geomToken_);
20 }

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

◆ layerIds()

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

Definition at line 94 of file DTSimHitMatcher.cc.

94  {
95  std::set<unsigned int> result;
96  for (const auto& p : layer_to_hits_)
97  result.insert(p.first);
98  return result;
99 }

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 23 of file DTSimHitMatcher.cc.

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

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

◆ matchSimHitsToSimTrack()

void DTSimHitMatcher::matchSimHitsToSimTrack ( )
private

Definition at line 44 of file DTSimHitMatcher.cc.

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

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 164 of file DTSimHitMatcher.cc.

164  {
165  set<int> layers_with_hits;
166  const auto& hits = hitsInLayer(detid);
167  for (const auto& h : hits) {
168  if (MuonHitHelper::isDT(detid)) {
169  const DTWireId idd(h.detUnitId());
170  layers_with_hits.insert(idd.wire());
171  }
172  }
173  return layers_with_hits.size();
174 }

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

◆ nLayersWithHitsInChamber()

int DTSimHitMatcher::nLayersWithHitsInChamber ( unsigned int  detid) const

Definition at line 200 of file DTSimHitMatcher.cc.

200  {
201  int nLayers = 0;
202  const auto& superLayers(dynamic_cast<const DTGeometry*>(geometry_)->chamber(DTChamberId(detid))->superLayers());
203  for (const auto& sl : superLayers) {
204  nLayers += nLayersWithHitsInSuperLayer(sl->id().rawId());
205  }
206  return nLayers;
207 }

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

Referenced by hitStation().

◆ nLayersWithHitsInSuperLayer()

int DTSimHitMatcher::nLayersWithHitsInSuperLayer ( unsigned int  detid) const

Definition at line 176 of file DTSimHitMatcher.cc.

176  {
177  set<int> layers_with_hits;
178  const auto& hits = hitsInSuperLayer(detid);
179  for (const auto& h : hits) {
180  if (MuonHitHelper::isDT(detid)) {
181  const DTLayerId idd(h.detUnitId());
182  layers_with_hits.insert(idd.layer());
183  }
184  }
185  return layers_with_hits.size();
186 }

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 159 of file DTSimHitMatcher.cc.

159  {
160  return (hitStation(1, nsuperlayers, nlayers) + hitStation(2, nsuperlayers, nlayers) +
161  hitStation(3, nsuperlayers, nlayers) + hitStation(4, nsuperlayers, nlayers));
162 }

References hitStation(), and nlayers.

◆ nSuperLayersWithHitsInChamber()

int DTSimHitMatcher::nSuperLayersWithHitsInChamber ( unsigned int  detid) const

Definition at line 188 of file DTSimHitMatcher.cc.

188  {
189  set<int> sl_with_hits;
190  const auto& hits = MuonSimHitMatcher::hitsInChamber(detid);
191  for (const auto& h : hits) {
192  if (MuonHitHelper::isDT(detid)) {
193  const DTSuperLayerId idd(h.detUnitId());
194  sl_with_hits.insert(idd.superLayer());
195  }
196  }
197  return sl_with_hits.size();
198 }

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 208 of file DTSimHitMatcher.cc.

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

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

◆ superlayerIds()

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

Definition at line 101 of file DTSimHitMatcher.cc.

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

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

Member Data Documentation

◆ geomToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTSimHitMatcher::geomToken_
private

Definition at line 78 of file DTSimHitMatcher.h.

Referenced by DTSimHitMatcher(), and init().

◆ layer_to_hits_

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

Definition at line 75 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 76 of file DTSimHitMatcher.h.

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

DTSimHitMatcher::hitsInSuperLayer
const edm::PSimHitContainer & hitsInSuperLayer(unsigned int) const
Definition: DTSimHitMatcher.cc:118
DTGeometry
Definition: DTGeometry.h:28
DTSuperLayerId
Definition: DTSuperLayerId.h:12
DTSimHitMatcher::hitWiresInDTSuperLayerId
std::set< unsigned int > hitWiresInDTSuperLayerId(unsigned int, int margin_n_wires=0) const
Definition: DTSimHitMatcher.cc:257
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
DTSimHitMatcher::nLayersWithHitsInChamber
int nLayersWithHitsInChamber(unsigned int) const
Definition: DTSimHitMatcher.cc:200
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:75
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
MuonSimHitMatcher::geometry_
const TrackingGeometry * geometry_
Definition: MuonSimHitMatcher.h:84
MuonHitHelper::DT_MB24p
Definition: MuonHitHelper.h:81
relativeConstraints.station
station
Definition: relativeConstraints.py:67
MuonSimHitMatcher::verbose_
bool verbose_
Definition: MuonSimHitMatcher.h:81
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
MuonHitHelper::DT_MB01
Definition: MuonHitHelper.h:70
MuonSimHitMatcher::detid_to_hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
Definition: MuonSimHitMatcher.h:106
MuonSimHitMatcher::simHitsMeanPosition
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
Definition: MuonSimHitMatcher.cc:99
MuonHitHelper::DT_MB22n
Definition: MuonHitHelper.h:87
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MuonHitHelper::DT_MB02
Definition: MuonHitHelper.h:71
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
DTSimHitMatcher::hitsInLayer
const edm::PSimHitContainer & hitsInLayer(unsigned int) const
Definition: DTSimHitMatcher.cc:108
MuonHitHelper::DT_MB11n
Definition: MuonHitHelper.h:82
MuonSimHitMatcher::simHits_
edm::PSimHitContainer simHits_
Definition: MuonSimHitMatcher.h:97
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:188
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:109
p2
double p2[4]
Definition: TauolaWrapper.h:90
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
Point3DBase< float, LocalTag >
DTSimHitMatcher::chamberIds
std::set< unsigned int > chamberIds(int type=MuonHitHelper::DT_ALL) const
Definition: DTSimHitMatcher.cc:80
DTLayerId
Definition: DTLayerId.h:12
MuonSimHitMatcher::track_ids_
std::vector< unsigned > track_ids_
Definition: MuonSimHitMatcher.h:99
MuonSimHitMatcher::no_hits_
edm::PSimHitContainer no_hits_
Definition: MuonSimHitMatcher.h:102
MuonTCMETValueMapProducer_cff.nLayers
nLayers
Definition: MuonTCMETValueMapProducer_cff.py:38
MuonSimHitMatcher::discardEleHits_
bool discardEleHits_
Definition: MuonSimHitMatcher.h:80
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:44
DTSimHitMatcher::detIds
std::set< unsigned int > detIds(int type=MuonHitHelper::DT_ALL) const
Definition: DTSimHitMatcher.cc:66
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:176
MuonHitHelper::DT_MB12n
Definition: MuonHitHelper.h:83
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:107
MuonHitHelper::DT_MB04
Definition: MuonHitHelper.h:73
DTSimHitMatcher::geomToken_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > geomToken_
Definition: DTSimHitMatcher.h:78
MuonSimHitMatcher::simHitInput_
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
Definition: MuonSimHitMatcher.h:88
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
DTSimHitMatcher::hitWiresInDTLayerId
std::set< unsigned int > hitWiresInDTLayerId(unsigned int, int margin_n_wires=0) const
Definition: DTSimHitMatcher.cc:231
MuonHitHelper::DT_MB22p
Definition: MuonHitHelper.h:79
MuonHitHelper::DT_MB12p
Definition: MuonHitHelper.h:75
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:29
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
MuonSimHitMatcher::simMuOnly_
bool simMuOnly_
Definition: MuonSimHitMatcher.h:79
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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:76
DTSimHitMatcher::hitStation
bool hitStation(int, int, int) const
Definition: DTSimHitMatcher.cc:138
ztail.d
d
Definition: ztail.py:151
MuonHitHelper::DT_MB13n
Definition: MuonHitHelper.h:84
mps_fire.result
result
Definition: mps_fire.py:311
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:105
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:2128
nlayers
Definition: HIMultiTrackSelector.h:48
MuonSimHitMatcher::MuonSimHitMatcher
MuonSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
Definition: MuonSimHitMatcher.cc:7