CMS 3D CMS Logo

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

#include <CSCSimHitMatcher.h>

Inheritance diagram for CSCSimHitMatcher:
MuonSimHitMatcher

Public Member Functions

void camberIdsToString (const std::set< unsigned int > &) const
 
std::set< unsigned int > chamberIds (int type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsStation (int station) const
 
void chamberIdsToString (const std::set< unsigned int > &set) const
 
 CSCSimHitMatcher (const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
 
std::set< unsigned int > detIds (int type=MuonHitHelper::CSC_ALL) const
 
void fitHitsInChamber (unsigned int detid, float &mean, float &slope) const
 
bool hitStation (int, int) const
 
std::set< int > hitStripsInDetId (unsigned int, int margin_n_strips=0) const
 
std::set< int > hitWiregroupsInDetId (unsigned int, int margin_n_wg=0) const
 
void init (const edm::Event &e, const edm::EventSetup &eventSetup)
 initialize the event More...
 
float LocalBendingInChamber (unsigned int detid) const
 
void match (const SimTrack &t, const SimVertex &v)
 do the matching More...
 
int nCoincidenceChambers (int min_n_layers=4) const
 
int nLayersWithHitsInChamber (unsigned int) const
 
int nStations (int nl=4) const
 
GlobalPoint simHitPositionKeyLayer (unsigned int chamberid) const
 
GlobalPoint simHitsMeanPositionStation (int n) const
 
float simHitsMeanStrip (const edm::PSimHitContainer &sim_hits) const
 
float simHitsMeanWG (const edm::PSimHitContainer &sim_hits) const
 
 ~CSCSimHitMatcher ()
 
- 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

edm::ESGetToken< CSCGeometry, MuonGeometryRecordgeomToken_
 

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 CSC SimHit to SimTrack

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

Definition at line 16 of file CSCSimHitMatcher.h.

Constructor & Destructor Documentation

◆ CSCSimHitMatcher()

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

◆ ~CSCSimHitMatcher()

CSCSimHitMatcher::~CSCSimHitMatcher ( )
inline

Definition at line 22 of file CSCSimHitMatcher.h.

22 {}

Member Function Documentation

◆ camberIdsToString()

void CSCSimHitMatcher::camberIdsToString ( const std::set< unsigned int > &  ) const

◆ chamberIds()

std::set< unsigned int > CSCSimHitMatcher::chamberIds ( int  type = MuonHitHelper::CSC_ALL) const

Definition at line 95 of file CSCSimHitMatcher.cc.

95  {
96  std::set<unsigned int> result;
97  for (const auto& p : chamber_to_hits_) {
98  const auto& id = p.first;
99  if (csc_type > 0) {
100  CSCDetId detId(id);
101  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
102  continue;
103  }
104  result.insert(id);
105  }
106  return result;
107 }

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

Referenced by chamberIdsStation(), hitStation(), and nCoincidenceChambers().

◆ chamberIdsStation()

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

Definition at line 344 of file CSCSimHitMatcher.cc.

344  {
345  set<unsigned int> result;
346  switch (station) {
347  case 1: {
348  const auto& p1(chamberIds(MuonHitHelper::CSC_ME1a));
349  const auto& p2(chamberIds(MuonHitHelper::CSC_ME1b));
350  const auto& p3(chamberIds(MuonHitHelper::CSC_ME12));
351  const auto& p4(chamberIds(MuonHitHelper::CSC_ME13));
352  result.insert(p1.begin(), p1.end());
353  result.insert(p2.begin(), p2.end());
354  result.insert(p3.begin(), p3.end());
355  result.insert(p4.begin(), p4.end());
356  break;
357  }
358  case 2: {
359  const auto& p1(chamberIds(MuonHitHelper::CSC_ME21));
360  const auto& p2(chamberIds(MuonHitHelper::CSC_ME22));
361  result.insert(p1.begin(), p1.end());
362  result.insert(p2.begin(), p2.end());
363  break;
364  }
365  case 3: {
366  const auto& p1(chamberIds(MuonHitHelper::CSC_ME31));
367  const auto& p2(chamberIds(MuonHitHelper::CSC_ME32));
368  result.insert(p1.begin(), p1.end());
369  result.insert(p2.begin(), p2.end());
370  break;
371  }
372  case 4: {
373  const auto& p1(chamberIds(MuonHitHelper::CSC_ME41));
374  const auto& p2(chamberIds(MuonHitHelper::CSC_ME42));
375  result.insert(p1.begin(), p1.end());
376  result.insert(p2.begin(), p2.end());
377  break;
378  }
379  };
380  return result;
381 }

References chamberIds(), MuonHitHelper::CSC_ME12, MuonHitHelper::CSC_ME13, MuonHitHelper::CSC_ME1a, MuonHitHelper::CSC_ME1b, MuonHitHelper::CSC_ME21, MuonHitHelper::CSC_ME22, MuonHitHelper::CSC_ME31, MuonHitHelper::CSC_ME32, MuonHitHelper::CSC_ME41, MuonHitHelper::CSC_ME42, p1, p2, p3, p4, mps_fire::result, and relativeConstraints::station.

◆ chamberIdsToString()

void CSCSimHitMatcher::chamberIdsToString ( const std::set< unsigned int > &  set) const

Definition at line 337 of file CSCSimHitMatcher.cc.

337  {
338  for (const auto& p : set) {
339  CSCDetId detId(p);
340  edm::LogInfo("CSCSimHitMatcher") << " " << detId << "\n";
341  }
342 }

References AlCaHLTBitMon_ParallelJobs::p.

◆ clear()

void CSCSimHitMatcher::clear ( void  )
private

Definition at line 383 of file CSCSimHitMatcher.cc.

References MuonSimHitMatcher::clear().

Referenced by match().

◆ detIds()

std::set< unsigned int > CSCSimHitMatcher::detIds ( int  type = MuonHitHelper::CSC_ALL) const

Definition at line 81 of file CSCSimHitMatcher.cc.

81  {
82  std::set<unsigned int> result;
83  for (const auto& p : detid_to_hits_) {
84  const auto& id = p.first;
85  if (csc_type > 0) {
86  CSCDetId detId(id);
87  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
88  continue;
89  }
90  result.insert(id);
91  }
92  return result;
93 }

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

Referenced by match().

◆ fitHitsInChamber()

void CSCSimHitMatcher::fitHitsInChamber ( unsigned int  detid,
float &  mean,
float &  slope 
) const

Definition at line 210 of file CSCSimHitMatcher.cc.

210  {
211  const CSCDetId cscid(detid);
212 
213  const auto& sim_hits = hitsInChamber(detid);
214 
215  if (sim_hits.empty())
216  return;
217 
218  vector<float> x;
219  vector<float> y;
220  vector<float> xe;
221  vector<float> ye;
222 
223  const float HALF_STRIP_ERROR = 0.288675;
224 
225  for (const auto& h : sim_hits) {
226  const LocalPoint& lp = h.entryPoint();
227  const auto& d = h.detUnitId();
228  float s = dynamic_cast<const CSCGeometry*>(geometry_)->layer(d)->geometry()->strip(lp);
229  // shift to key half strip layer (layer 3)
230  x.push_back(CSCDetId(d).layer() - 3);
231  y.push_back(s);
232  xe.push_back(float(0));
233  ye.push_back(2 * HALF_STRIP_ERROR);
234  }
235  if (x.size() < 2)
236  return;
237 
238  std::unique_ptr<TGraphErrors> gr(new TGraphErrors(x.size(), &x[0], &y[0], &xe[0], &ye[0]));
239  std::unique_ptr<TF1> fit(new TF1("fit", "pol1", -3, 4));
240  gr->Fit("fit", "EMQ");
241 
242  intercept = fit->GetParameter(0);
243  slope = fit->GetParameter(1);
244 }

References ztail::d, L1TowerCalibrationProducer_cfi::fit, MuonSimHitMatcher::geometry_, MuonSimHitMatcher::hitsInChamber(), alignCSCRings::s, slope, tools::TF1, x, and y.

◆ hitStation()

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

Definition at line 118 of file CSCSimHitMatcher.cc.

118  {
119  int nst = 0;
120  for (const auto& ddt : chamberIds()) {
121  const CSCDetId id(ddt);
122  int ri(id.ring());
123  if (id.station() != st)
124  continue;
125 
126  // ME1/a case - check the ME1/b chamber
127  if (st == 1 and ri == 4) {
128  CSCDetId idME1b(id.endcap(), id.station(), 1, id.chamber(), 0);
129  const int nl1a(nLayersWithHitsInChamber(id.rawId()));
130  const int nl1b(nLayersWithHitsInChamber(idME1b.rawId()));
131  if (nl1a + nl1b < nlayers)
132  continue;
133  ++nst;
134  }
135  // ME1/b case - check the ME1/a chamber
136  else if (st == 1 and ri == 1) {
137  CSCDetId idME1a(id.endcap(), id.station(), 4, id.chamber(), 0);
138  const int nl1a(nLayersWithHitsInChamber(idME1a.rawId()));
139  const int nl1b(nLayersWithHitsInChamber(id.rawId()));
140  if (nl1a + nl1b < nlayers)
141  continue;
142  ++nst;
143  }
144  // default case
145  else {
146  const int nl(nLayersWithHitsInChamber(id.rawId()));
147  if (nl < nlayers)
148  continue;
149  ++nst;
150  }
151  }
152  return nst;
153 }

References relativeConstraints::chamber, chamberIds(), makeMuonMisalignmentScenario::endcap, triggerObjects_cff::id, nlayers, nLayersWithHitsInChamber(), DetId::rawId(), relativeConstraints::ring, and relativeConstraints::station.

Referenced by nStations().

◆ hitStripsInDetId()

std::set< int > CSCSimHitMatcher::hitStripsInDetId ( unsigned int  detid,
int  margin_n_strips = 0 
) const

Definition at line 290 of file CSCSimHitMatcher.cc.

290  {
291  set<int> result;
292  const auto& simhits = MuonSimHitMatcher::hitsInDetId(detid);
293  CSCDetId id(detid);
294  int max_nstrips = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry()->numberOfStrips();
295  for (const auto& h : simhits) {
296  const LocalPoint& lp = h.entryPoint();
297  int central_strip = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry()->nearestStrip(lp);
298  int smin = central_strip - margin_n_strips;
299  smin = (smin > 0) ? smin : 1;
300  int smax = central_strip + margin_n_strips;
301  smax = (smax <= max_nstrips) ? smax : max_nstrips;
302  for (int ss = smin; ss <= smax; ++ss)
303  result.insert(ss);
304  }
305  return result;
306 }

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

Referenced by match().

◆ hitWiregroupsInDetId()

std::set< int > CSCSimHitMatcher::hitWiregroupsInDetId ( unsigned int  detid,
int  margin_n_wg = 0 
) const

Definition at line 308 of file CSCSimHitMatcher.cc.

308  {
309  set<int> result;
310  const auto& simhits = MuonSimHitMatcher::hitsInDetId(detid);
311  CSCDetId id(detid);
312  int max_n_wg = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry()->numberOfWireGroups();
313  for (const auto& h : simhits) {
314  const LocalPoint& lp = h.entryPoint();
315  const auto& layer_geo = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry();
316  int central_wg = layer_geo->wireGroup(layer_geo->nearestWire(lp));
317  int wg_min = central_wg - margin_n_wg;
318  wg_min = (wg_min > 0) ? wg_min : 1;
319  int wg_max = central_wg + margin_n_wg;
320  wg_max = (wg_max <= max_n_wg) ? wg_max : max_n_wg;
321  for (int wg = wg_min; wg <= wg_max; ++wg)
322  result.insert(wg);
323  }
324  return result;
325 }

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

◆ init()

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

initialize the event

Definition at line 19 of file CSCSimHitMatcher.cc.

19  {
20  geometry_ = &iSetup.getData(geomToken_);
22 }

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

◆ LocalBendingInChamber()

float CSCSimHitMatcher::LocalBendingInChamber ( unsigned int  detid) const

Definition at line 159 of file CSCSimHitMatcher.cc.

159  {
160  const CSCDetId cscid(detid);
161  if (nLayersWithHitsInChamber(detid) < 6)
162  return -100;
163  float phi_layer1 = -10;
164  float phi_layer6 = 10;
165 
166  if (cscid.station() == 1 and (cscid.ring() == 1 or cscid.ring() == 4)) {
167  // phi in layer 1
168  const CSCDetId cscid1a(cscid.endcap(), cscid.station(), 4, cscid.chamber(), 1);
169  const CSCDetId cscid1b(cscid.endcap(), cscid.station(), 1, cscid.chamber(), 1);
170  const edm::PSimHitContainer& hits1a = MuonSimHitMatcher::hitsInDetId(cscid1a.rawId());
171  const edm::PSimHitContainer& hits1b = MuonSimHitMatcher::hitsInDetId(cscid1b.rawId());
172  const GlobalPoint& gp1a = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid1a.rawId()));
173  const GlobalPoint& gp1b = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid1b.rawId()));
174  if (!hits1a.empty() and !hits1b.empty())
175  phi_layer1 = (gp1a.phi() + gp1b.phi()) / 2.0;
176  else if (!hits1a.empty())
177  phi_layer1 = gp1a.phi();
178  else if (!hits1b.empty())
179  phi_layer1 = gp1b.phi();
180 
181  // phi in layer 6
182  const CSCDetId cscid6a(cscid.endcap(), cscid.station(), 4, cscid.chamber(), 6);
183  const CSCDetId cscid6b(cscid.endcap(), cscid.station(), 1, cscid.chamber(), 6);
184  const edm::PSimHitContainer& hits6a = MuonSimHitMatcher::hitsInDetId(cscid6a.rawId());
185  const edm::PSimHitContainer& hits6b = MuonSimHitMatcher::hitsInDetId(cscid6b.rawId());
186  const GlobalPoint& gp6a = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid6a.rawId()));
187  const GlobalPoint& gp6b = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid6b.rawId()));
188  if (!hits6a.empty() and !hits6b.empty())
189  phi_layer6 = (gp6a.phi() + gp6b.phi()) / 2.0;
190  else if (!hits6a.empty())
191  phi_layer6 = gp6a.phi();
192  else if (!hits6b.empty())
193  phi_layer6 = gp6b.phi();
194 
195  } else {
196  // phi in layer 1
197  const CSCDetId cscid1(cscid.endcap(), cscid.station(), cscid.ring(), cscid.chamber(), 1);
198  const GlobalPoint& gp1 = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid1.rawId()));
199  phi_layer1 = gp1.phi();
200 
201  // phi in layer 6
202  const CSCDetId cscid6(cscid.endcap(), cscid.station(), cscid.ring(), cscid.chamber(), 6);
203  const GlobalPoint& gp6 = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid6.rawId()));
204  phi_layer6 = gp6.phi();
205  }
206  return deltaPhi(phi_layer6, phi_layer1);
207 }

References CSCDetId::chamber(), SiPixelRawToDigiRegional_cfi::deltaPhi, CSCDetId::endcap(), MuonSimHitMatcher::hitsInDetId(), nLayersWithHitsInChamber(), or, PV3DBase< T, PVType, FrameType >::phi(), CSCDetId::ring(), MuonSimHitMatcher::simHitsMeanPosition(), and CSCDetId::station().

◆ match()

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

do the matching

Definition at line 25 of file CSCSimHitMatcher.cc.

25  {
26  clear();
27 
28  // instantiates the track ids and simhits
30 
31  // hard cut on non-CSC muons
32  if (std::abs(track.momentum().eta()) < 0.9)
33  return;
34  if (std::abs(track.momentum().eta()) > 2.45)
35  return;
36 
38 
39  if (verbose_) {
40  edm::LogInfo("CSCSimHitMatcher") << "nTrackIds " << track_ids_.size() << " nSelectedCSCSimHits " << hits_.size();
41  edm::LogInfo("CSCSimHitMatcher") << "detids CSC " << detIds(0).size();
42 
43  for (const auto& id : detIds(0)) {
44  const auto& simhits = hitsInDetId(id);
45  const auto& simhits_gp = simHitsMeanPosition(simhits);
46  const auto& strips = hitStripsInDetId(id);
47  CSCDetId cscid(id);
48  if (cscid.station() == 1 and (cscid.ring() == 1 or cscid.ring() == 4)) {
49  edm::LogInfo("CSCSimHitMatcher") << "cscdetid " << CSCDetId(id) << ": " << simhits.size() << " "
50  << simhits_gp.phi() << " " << detid_to_hits_[id].size();
51  edm::LogInfo("CSCSimHitMatcher") << "nStrip " << strips.size();
52  edm::LogInfo("CSCSimHitMatcher") << "strips : ";
53  for (const auto& p : strips) {
54  edm::LogInfo("CSCSimHitMatcher") << p;
55  }
56  }
57  }
58  }
59 }

References funct::abs(), clear(), MuonSimHitMatcher::detid_to_hits_, detIds(), MuonSimHitMatcher::hits_, MuonSimHitMatcher::hitsInDetId(), hitStripsInDetId(), triggerObjects_cff::id, MuonSimHitMatcher::match(), matchSimHitsToSimTrack(), or, AlCaHLTBitMon_ParallelJobs::p, CSCDetId::ring(), HLTBitAnalyser_cfi::simhits, MuonSimHitMatcher::simHitsMeanPosition(), CSCDetId::station(), DigiDM_cff::strips, HLT_FULL_cff::track, MuonSimHitMatcher::track_ids_, MuonSimHitMatcher::verbose_, and bphysicsOniaDQM_cfi::vertex.

◆ matchSimHitsToSimTrack()

void CSCSimHitMatcher::matchSimHitsToSimTrack ( )
private

Definition at line 61 of file CSCSimHitMatcher.cc.

61  {
62  for (const auto& track_id : track_ids_) {
63  for (const auto& h : simHits_) {
64  if (h.trackId() != track_id)
65  continue;
66  int pdgid = h.particleType();
67  if (simMuOnly_ && std::abs(pdgid) != 13)
68  continue;
69  // discard electron hits in the CSC chambers
70  if (discardEleHits_ && std::abs(pdgid) == 11)
71  continue;
72 
73  const CSCDetId& layer_id(h.detUnitId());
74  hits_.push_back(h);
75  detid_to_hits_[h.detUnitId()].push_back(h);
76  chamber_to_hits_[layer_id.chamberId().rawId()].push_back(h);
77  }
78  }
79 }

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

Referenced by match().

◆ nCoincidenceChambers()

int CSCSimHitMatcher::nCoincidenceChambers ( int  min_n_layers = 4) const

Definition at line 327 of file CSCSimHitMatcher.cc.

327  {
328  int result = 0;
329  const auto& chamber_ids = chamberIds(0);
330  for (const auto& id : chamber_ids) {
331  if (nLayersWithHitsInChamber(id) >= min_n_layers)
332  result += 1;
333  }
334  return result;
335 }

References chamberIds(), nLayersWithHitsInChamber(), and mps_fire::result.

◆ nLayersWithHitsInChamber()

int CSCSimHitMatcher::nLayersWithHitsInChamber ( unsigned int  detid) const

Definition at line 109 of file CSCSimHitMatcher.cc.

109  {
110  set<int> layers_with_hits;
111  for (const auto& h : MuonSimHitMatcher::hitsInChamber(detid)) {
112  const CSCDetId& idd(h.detUnitId());
113  layers_with_hits.insert(idd.layer());
114  }
115  return layers_with_hits.size();
116 }

References MuonSimHitMatcher::hitsInChamber().

Referenced by hitStation(), LocalBendingInChamber(), and nCoincidenceChambers().

◆ nStations()

int CSCSimHitMatcher::nStations ( int  nl = 4) const

Definition at line 155 of file CSCSimHitMatcher.cc.

155  {
156  return (hitStation(1, nlayers) + hitStation(2, nlayers) + hitStation(3, nlayers) + hitStation(4, nlayers));
157 }

References hitStation(), and nlayers.

◆ simHitPositionKeyLayer()

GlobalPoint CSCSimHitMatcher::simHitPositionKeyLayer ( unsigned int  chamberid) const

◆ simHitsMeanPositionStation()

GlobalPoint CSCSimHitMatcher::simHitsMeanPositionStation ( int  n) const

◆ simHitsMeanStrip()

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

Definition at line 246 of file CSCSimHitMatcher.cc.

246  {
247  if (sim_hits.empty())
248  return -1.f;
249 
250  float sums = 0.f;
251  size_t n = 0;
252  for (const auto& h : sim_hits) {
253  const LocalPoint& lp = h.entryPoint();
254  float s;
255  const auto& d = h.detUnitId();
256  s = dynamic_cast<const CSCGeometry*>(geometry_)->layer(d)->geometry()->strip(lp);
257  // convert to half-strip:
258  s *= 2.;
259  sums += s;
260  ++n;
261  }
262  if (n == 0)
263  return -1.f;
264  return sums / n;
265 }

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

◆ simHitsMeanWG()

float CSCSimHitMatcher::simHitsMeanWG ( const edm::PSimHitContainer sim_hits) const

Definition at line 267 of file CSCSimHitMatcher.cc.

267  {
268  if (sim_hits.empty())
269  return -1.f;
270 
271  float sums = 0.f;
272  size_t n = 0;
273  for (const auto& h : sim_hits) {
274  const LocalPoint& lp = h.entryPoint();
275  float s;
276  const auto& d = h.detUnitId();
277  // find nearest wire
278  const auto& layerG(dynamic_cast<const CSCGeometry*>(geometry_)->layer(d)->geometry());
279  int nearestWire(layerG->nearestWire(lp));
280  // then find the corresponding wire group
281  s = layerG->wireGroup(nearestWire);
282  sums += s;
283  ++n;
284  }
285  if (n == 0)
286  return -1.f;
287  return sums / n;
288 }

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

Member Data Documentation

◆ geomToken_

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> CSCSimHitMatcher::geomToken_
private

Definition at line 81 of file CSCSimHitMatcher.h.

Referenced by CSCSimHitMatcher(), and init().

DDAxes::y
MuonSimHitMatcher::clear
void clear()
Definition: MuonSimHitMatcher.cc:139
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
MuonSimHitMatcher::geometry
const TrackingGeometry * geometry()
Definition: MuonSimHitMatcher.h:69
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
MuonSimHitMatcher::geometry_
const TrackingGeometry * geometry_
Definition: MuonSimHitMatcher.h:84
relativeConstraints.station
station
Definition: relativeConstraints.py:67
MuonSimHitMatcher::verbose_
bool verbose_
Definition: MuonSimHitMatcher.h:81
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MuonHitHelper::CSC_ME42
Definition: MuonHitHelper.h:26
MuonHitHelper::CSC_ME1a
Definition: MuonHitHelper.h:17
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
CSCSimHitMatcher::clear
void clear()
Definition: CSCSimHitMatcher.cc:383
L1TowerCalibrationProducer_cfi.fit
fit
Definition: L1TowerCalibrationProducer_cfi.py:36
DDAxes::x
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
CSCSimHitMatcher::hitStripsInDetId
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=0) const
Definition: CSCSimHitMatcher.cc:290
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
tools.TF1
TF1
Definition: tools.py:23
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
MuonSimHitMatcher::simHits_
edm::PSimHitContainer simHits_
Definition: MuonSimHitMatcher.h:97
CSCSimHitMatcher::detIds
std::set< unsigned int > detIds(int type=MuonHitHelper::CSC_ALL) const
Definition: CSCSimHitMatcher.cc:81
CSCGeometry
Definition: CSCGeometry.h:24
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
h
MuonHitHelper::CSC_ME41
Definition: MuonHitHelper.h:25
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
MuonHitHelper::CSC_ME13
Definition: MuonHitHelper.h:20
MuonSimHitMatcher::simHitPSet_
edm::ParameterSet simHitPSet_
Definition: MuonSimHitMatcher.h:109
p2
double p2[4]
Definition: TauolaWrapper.h:90
MuonHitHelper::CSC_ME12
Definition: MuonHitHelper.h:19
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
Point3DBase< float, LocalTag >
MuonSimHitMatcher::track_ids_
std::vector< unsigned > track_ids_
Definition: MuonSimHitMatcher.h:99
MuonSimHitMatcher::discardEleHits_
bool discardEleHits_
Definition: MuonSimHitMatcher.h:80
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
HLTBitAnalyser_cfi.simhits
simhits
SIM objects.
Definition: HLTBitAnalyser_cfi.py:21
MuonSimHitMatcher::match
void match(const SimTrack &t, const SimVertex &v)
do the matching
Definition: MuonSimHitMatcher.cc:26
CSCDetId
Definition: CSCDetId.h:26
MuonHitHelper::CSC_ME22
Definition: MuonHitHelper.h:22
iEvent
int iEvent
Definition: GenABIO.cc:224
MuonHitHelper::CSC_ME21
Definition: MuonHitHelper.h:21
CSCSimHitMatcher::matchSimHitsToSimTrack
void matchSimHitsToSimTrack()
Definition: CSCSimHitMatcher.cc:61
p4
double p4[4]
Definition: TauolaWrapper.h:92
p1
double p1[4]
Definition: TauolaWrapper.h:89
MuonHitHelper::CSC_ME31
Definition: MuonHitHelper.h:23
MuonSimHitMatcher::chamber_to_hits_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Definition: MuonSimHitMatcher.h:107
MuonSimHitMatcher::simHitInput_
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
Definition: MuonSimHitMatcher.h:88
MuonHitHelper::CSC_ME1b
Definition: MuonHitHelper.h:18
MuonSimHitMatcher::hitsInDetId
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
Definition: MuonSimHitMatcher.cc:87
eostools.move
def move(src, dest)
Definition: eostools.py:511
CSCSimHitMatcher::geomToken_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
Definition: CSCSimHitMatcher.h:81
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCSimHitMatcher::hitStation
bool hitStation(int, int) const
Definition: CSCSimHitMatcher.cc:118
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
or
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
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
MuonSimHitMatcher::hitsInChamber
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
Definition: MuonSimHitMatcher.cc:93
ztail.d
d
Definition: ztail.py:151
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
MuonHitHelper::toCSCType
static int toCSCType(int st, int ri)
Definition: MuonHitHelper.cc:195
slope
static const double slope[3]
Definition: CastorTimeSlew.cc:6
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
CSCSimHitMatcher::chamberIds
std::set< unsigned int > chamberIds(int type=MuonHitHelper::CSC_ALL) const
Definition: CSCSimHitMatcher.cc:95
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
fit
Definition: CombinedChiSquaredLikelihood.h:6
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
CSCSimHitMatcher::nLayersWithHitsInChamber
int nLayersWithHitsInChamber(unsigned int) const
Definition: CSCSimHitMatcher.cc:109
nlayers
Definition: HIMultiTrackSelector.h:48
MuonSimHitMatcher::MuonSimHitMatcher
MuonSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
Definition: MuonSimHitMatcher.cc:7
MuonHitHelper::CSC_ME32
Definition: MuonHitHelper.h:24