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
 
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 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< CSCGeometrycsc_geom_
 

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

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

Definition at line 14 of file CSCSimHitMatcher.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file CSCSimHitMatcher.cc.

References MuonSimHitMatcher::discardEleHits_, 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("cscSimHit");
8  verbose_ = simHitPSet_.getParameter<int>("verbose");
9  simMuOnly_ = simHitPSet_.getParameter<bool>("simMuOnly");
10  discardEleHits_ = simHitPSet_.getParameter<bool>("discardEleHits");
11 
13 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::ParameterSet simHitPSet_
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
MuonSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
std::vector< PSimHit > PSimHitContainer
def move(src, dest)
Definition: eostools.py:511
CSCSimHitMatcher::~CSCSimHitMatcher ( )
inline

Member Function Documentation

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

Referenced by ~CSCSimHitMatcher().

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

Definition at line 93 of file CSCSimHitMatcher.cc.

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

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

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

Definition at line 305 of file CSCSimHitMatcher.cc.

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, and mps_fire::result.

Referenced by ~CSCSimHitMatcher().

305  {
306  set<unsigned int> result;
307  switch (station) {
308  case 1: {
309  const auto& p1(chamberIds(MuonHitHelper::CSC_ME1a));
310  const auto& p2(chamberIds(MuonHitHelper::CSC_ME1b));
311  const auto& p3(chamberIds(MuonHitHelper::CSC_ME12));
312  const auto& p4(chamberIds(MuonHitHelper::CSC_ME13));
313  result.insert(p1.begin(), p1.end());
314  result.insert(p2.begin(), p2.end());
315  result.insert(p3.begin(), p3.end());
316  result.insert(p4.begin(), p4.end());
317  break;
318  }
319  case 2: {
320  const auto& p1(chamberIds(MuonHitHelper::CSC_ME21));
321  const auto& p2(chamberIds(MuonHitHelper::CSC_ME22));
322  result.insert(p1.begin(), p1.end());
323  result.insert(p2.begin(), p2.end());
324  break;
325  }
326  case 3: {
327  const auto& p1(chamberIds(MuonHitHelper::CSC_ME31));
328  const auto& p2(chamberIds(MuonHitHelper::CSC_ME32));
329  result.insert(p1.begin(), p1.end());
330  result.insert(p2.begin(), p2.end());
331  break;
332  }
333  case 4: {
334  const auto& p1(chamberIds(MuonHitHelper::CSC_ME41));
335  const auto& p2(chamberIds(MuonHitHelper::CSC_ME42));
336  result.insert(p1.begin(), p1.end());
337  result.insert(p2.begin(), p2.end());
338  break;
339  }
340  };
341  return result;
342 }
double p4[4]
Definition: TauolaWrapper.h:92
std::set< unsigned int > chamberIds(int type=MuonHitHelper::CSC_ALL) const
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
double p3[4]
Definition: TauolaWrapper.h:91
void CSCSimHitMatcher::chamberIdsToString ( const std::set< unsigned int > &  set) const

Definition at line 298 of file CSCSimHitMatcher.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by ~CSCSimHitMatcher().

298  {
299  for (const auto& p : set) {
300  CSCDetId detId(p);
301  edm::LogInfo("CSCSimHitMatcher") << " " << detId << "\n";
302  }
303 }
std::set< unsigned int > CSCSimHitMatcher::detIds ( int  type = MuonHitHelper::CSC_ALL) const

Definition at line 79 of file CSCSimHitMatcher.cc.

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

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

79  {
80  std::set<unsigned int> result;
81  for (const auto& p : detid_to_hits_) {
82  const auto& id = p.first;
83  if (csc_type > 0) {
84  CSCDetId detId(id);
85  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
86  continue;
87  }
88  result.insert(id);
89  }
90  return result;
91 }
static int toCSCType(int st, int ri)
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
bool CSCSimHitMatcher::hitStation ( int  st,
int  nlayers 
) const

Definition at line 116 of file CSCSimHitMatcher.cc.

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

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

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

Definition at line 251 of file CSCSimHitMatcher.cc.

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

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

251  {
252  set<int> result;
253  const auto& simhits = MuonSimHitMatcher::hitsInDetId(detid);
254  CSCDetId id(detid);
255  int max_nstrips = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry()->numberOfStrips();
256  for (const auto& h : simhits) {
257  const LocalPoint& lp = h.entryPoint();
258  int central_strip = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry()->nearestStrip(lp);
259  int smin = central_strip - margin_n_strips;
260  smin = (smin > 0) ? smin : 1;
261  int smax = central_strip + margin_n_strips;
262  smax = (smax <= max_nstrips) ? smax : max_nstrips;
263  for (int ss = smin; ss <= smax; ++ss)
264  result.insert(ss);
265  }
266  return result;
267 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
std::set< int > CSCSimHitMatcher::hitWiregroupsInDetId ( unsigned int  detid,
int  margin_n_wg = 0 
) const

Definition at line 269 of file CSCSimHitMatcher.cc.

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

Referenced by ~CSCSimHitMatcher().

269  {
270  set<int> result;
271  const auto& simhits = MuonSimHitMatcher::hitsInDetId(detid);
272  CSCDetId id(detid);
273  int max_n_wg = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry()->numberOfWireGroups();
274  for (const auto& h : simhits) {
275  const LocalPoint& lp = h.entryPoint();
276  const auto& layer_geo = dynamic_cast<const CSCGeometry*>(geometry_)->layer(id)->geometry();
277  int central_wg = layer_geo->wireGroup(layer_geo->nearestWire(lp));
278  int wg_min = central_wg - margin_n_wg;
279  wg_min = (wg_min > 0) ? wg_min : 1;
280  int wg_max = central_wg + margin_n_wg;
281  wg_max = (wg_max <= max_n_wg) ? wg_max : max_n_wg;
282  for (int wg = wg_min; wg <= wg_max; ++wg)
283  result.insert(wg);
284  }
285  return result;
286 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
void CSCSimHitMatcher::init ( const edm::Event e,
const edm::EventSetup eventSetup 
)

initialize the event

Definition at line 16 of file CSCSimHitMatcher.cc.

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

Referenced by ~CSCSimHitMatcher().

16  {
17  iSetup.get<MuonGeometryRecord>().get(csc_geom_);
18  if (csc_geom_.isValid()) {
19  geometry_ = &*csc_geom_;
20  } else {
21  hasGeometry_ = false;
22  edm::LogWarning("CSCSimHitMatcher") << "+++ Info: CSC geometry is unavailable. +++\n";
23  }
25 }
const TrackingGeometry * geometry_
int iEvent
Definition: GenABIO.cc:224
edm::ESHandle< CSCGeometry > csc_geom_
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
bool isValid() const
Definition: ESHandle.h:44
float CSCSimHitMatcher::LocalBendingInChamber ( unsigned int  detid) const

Definition at line 157 of file CSCSimHitMatcher.cc.

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

Referenced by ~CSCSimHitMatcher().

157  {
158  const CSCDetId cscid(detid);
159  if (nLayersWithHitsInChamber(detid) < 6)
160  return -100;
161  float phi_layer1 = -10;
162  float phi_layer6 = 10;
163 
164  if (cscid.station() == 1 and (cscid.ring() == 1 or cscid.ring() == 4)) {
165  // phi in layer 1
166  const CSCDetId cscid1a(cscid.endcap(), cscid.station(), 4, cscid.chamber(), 1);
167  const CSCDetId cscid1b(cscid.endcap(), cscid.station(), 1, cscid.chamber(), 1);
168  const edm::PSimHitContainer& hits1a = MuonSimHitMatcher::hitsInDetId(cscid1a.rawId());
169  const edm::PSimHitContainer& hits1b = MuonSimHitMatcher::hitsInDetId(cscid1b.rawId());
170  const GlobalPoint& gp1a = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid1a.rawId()));
171  const GlobalPoint& gp1b = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid1b.rawId()));
172  if (!hits1a.empty() and !hits1b.empty())
173  phi_layer1 = (gp1a.phi() + gp1b.phi()) / 2.0;
174  else if (!hits1a.empty())
175  phi_layer1 = gp1a.phi();
176  else if (!hits1b.empty())
177  phi_layer1 = gp1b.phi();
178 
179  // phi in layer 6
180  const CSCDetId cscid6a(cscid.endcap(), cscid.station(), 4, cscid.chamber(), 6);
181  const CSCDetId cscid6b(cscid.endcap(), cscid.station(), 1, cscid.chamber(), 6);
182  const edm::PSimHitContainer& hits6a = MuonSimHitMatcher::hitsInDetId(cscid6a.rawId());
183  const edm::PSimHitContainer& hits6b = MuonSimHitMatcher::hitsInDetId(cscid6b.rawId());
184  const GlobalPoint& gp6a = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid6a.rawId()));
185  const GlobalPoint& gp6b = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid6b.rawId()));
186  if (!hits6a.empty() and !hits6b.empty())
187  phi_layer6 = (gp6a.phi() + gp6b.phi()) / 2.0;
188  else if (!hits6a.empty())
189  phi_layer6 = gp6a.phi();
190  else if (!hits6b.empty())
191  phi_layer6 = gp6b.phi();
192 
193  } else {
194  // phi in layer 1
195  const CSCDetId cscid1(cscid.endcap(), cscid.station(), cscid.ring(), cscid.chamber(), 1);
196  const GlobalPoint& gp1 = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid1.rawId()));
197  phi_layer1 = gp1.phi();
198 
199  // phi in layer 6
200  const CSCDetId cscid6(cscid.endcap(), cscid.station(), cscid.ring(), cscid.chamber(), 6);
201  const GlobalPoint& gp6 = simHitsMeanPosition(MuonSimHitMatcher::hitsInDetId(cscid6.rawId()));
202  phi_layer6 = gp6.phi();
203  }
204  return deltaPhi(phi_layer6, phi_layer1);
205 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
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
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
int nLayersWithHitsInChamber(unsigned int) const
std::vector< PSimHit > PSimHitContainer
void CSCSimHitMatcher::match ( const SimTrack t,
const SimVertex v 
)

do the matching

Definition at line 28 of file CSCSimHitMatcher.cc.

References MuonSimHitMatcher::detid_to_hits_, detIds(), MuonSimHitMatcher::hasGeometry_, 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, MuonSimHitMatcher::track_ids_, and MuonSimHitMatcher::verbose_.

Referenced by ~CSCSimHitMatcher().

28  {
29  // instantiates the track ids and simhits
31 
32  if (hasGeometry_) {
34 
35  if (verbose_) {
36  edm::LogInfo("CSCSimHitMatcher") << "nTrackIds " << track_ids_.size() << " nSelectedCSCSimHits " << hits_.size()
37  << endl;
38  edm::LogInfo("CSCSimHitMatcher") << "detids CSC " << detIds(0).size() << endl;
39 
40  for (const auto& id : detIds(0)) {
41  const auto& simhits = hitsInDetId(id);
42  const auto& simhits_gp = simHitsMeanPosition(simhits);
43  const auto& strips = hitStripsInDetId(id);
44  CSCDetId cscid(id);
45  if (cscid.station() == 1 and (cscid.ring() == 1 or cscid.ring() == 4)) {
46  edm::LogInfo("CSCSimHitMatcher") << "cscdetid " << CSCDetId(id) << ": " << simhits.size() << " "
47  << simhits_gp.phi() << " " << detid_to_hits_[id].size() << endl;
48  edm::LogInfo("CSCSimHitMatcher") << "nStrip " << strips.size() << endl;
49  edm::LogInfo("CSCSimHitMatcher") << "strips : ";
50  for (const auto& p : strips) {
51  edm::LogInfo("CSCSimHitMatcher") << p;
52  }
53  }
54  }
55  }
56  }
57 }
edm::PSimHitContainer hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
std::set< unsigned int > detIds(int type=MuonHitHelper::CSC_ALL) const
std::vector< unsigned > track_ids_
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=0) const
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
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
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
void CSCSimHitMatcher::matchSimHitsToSimTrack ( )
private

Definition at line 59 of file CSCSimHitMatcher.cc.

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

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

59  {
60  for (const auto& track_id : track_ids_) {
61  for (const auto& h : simHits_) {
62  if (h.trackId() != track_id)
63  continue;
64  int pdgid = h.particleType();
65  if (simMuOnly_ && std::abs(pdgid) != 13)
66  continue;
67  // discard electron hits in the CSC chambers
68  if (discardEleHits_ && pdgid == 11)
69  continue;
70 
71  const CSCDetId& layer_id(h.detUnitId());
72  hits_.push_back(h);
73  detid_to_hits_[h.detUnitId()].push_back(h);
74  chamber_to_hits_[layer_id.chamberId().rawId()].push_back(h);
75  }
76  }
77 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
edm::PSimHitContainer hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
std::vector< unsigned > track_ids_
edm::PSimHitContainer simHits_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int CSCSimHitMatcher::nCoincidenceChambers ( int  min_n_layers = 4) const

Definition at line 288 of file CSCSimHitMatcher.cc.

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

Referenced by ~CSCSimHitMatcher().

288  {
289  int result = 0;
290  const auto& chamber_ids = chamberIds(0);
291  for (const auto& id : chamber_ids) {
292  if (nLayersWithHitsInChamber(id) >= min_n_layers)
293  result += 1;
294  }
295  return result;
296 }
std::set< unsigned int > chamberIds(int type=MuonHitHelper::CSC_ALL) const
int nLayersWithHitsInChamber(unsigned int) const
int CSCSimHitMatcher::nLayersWithHitsInChamber ( unsigned int  detid) const

Definition at line 107 of file CSCSimHitMatcher.cc.

References h, and MuonSimHitMatcher::hitsInChamber().

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

107  {
108  set<int> layers_with_hits;
109  for (const auto& h : MuonSimHitMatcher::hitsInChamber(detid)) {
110  const CSCDetId& idd(h.detUnitId());
111  layers_with_hits.insert(idd.layer());
112  }
113  return layers_with_hits.size();
114 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
int CSCSimHitMatcher::nStations ( int  nl = 4) const

Definition at line 153 of file CSCSimHitMatcher.cc.

References hitStation().

Referenced by ~CSCSimHitMatcher().

153  {
154  return (hitStation(1, nlayers) + hitStation(2, nlayers) + hitStation(3, nlayers) + hitStation(4, nlayers));
155 }
bool hitStation(int, int) const
GlobalPoint CSCSimHitMatcher::simHitPositionKeyLayer ( unsigned int  chamberid) const

Referenced by ~CSCSimHitMatcher().

GlobalPoint CSCSimHitMatcher::simHitsMeanPositionStation ( int  n) const

Referenced by ~CSCSimHitMatcher().

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

Definition at line 207 of file CSCSimHitMatcher.cc.

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

Referenced by ~CSCSimHitMatcher().

207  {
208  if (sim_hits.empty())
209  return -1.f;
210 
211  float sums = 0.f;
212  size_t n = 0;
213  for (const auto& h : sim_hits) {
214  const LocalPoint& lp = h.entryPoint();
215  float s;
216  const auto& d = h.detUnitId();
217  s = dynamic_cast<const CSCGeometry*>(geometry_)->layer(d)->geometry()->strip(lp);
218  // convert to half-strip:
219  s *= 2.;
220  sums += s;
221  ++n;
222  }
223  if (n == 0)
224  return -1.f;
225  return sums / n;
226 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
double f[11][100]
d
Definition: ztail.py:151
float CSCSimHitMatcher::simHitsMeanWG ( const edm::PSimHitContainer sim_hits) const

Definition at line 228 of file CSCSimHitMatcher.cc.

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

Referenced by ~CSCSimHitMatcher().

228  {
229  if (sim_hits.empty())
230  return -1.f;
231 
232  float sums = 0.f;
233  size_t n = 0;
234  for (const auto& h : sim_hits) {
235  const LocalPoint& lp = h.entryPoint();
236  float s;
237  const auto& d = h.detUnitId();
238  // find nearest wire
239  const auto& layerG(dynamic_cast<const CSCGeometry*>(geometry_)->layer(d)->geometry());
240  int nearestWire(layerG->nearestWire(lp));
241  // then find the corresponding wire group
242  s = layerG->wireGroup(nearestWire);
243  sums += s;
244  ++n;
245  }
246  if (n == 0)
247  return -1.f;
248  return sums / n;
249 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
double f[11][100]
d
Definition: ztail.py:151
ESHandle< TrackerGeometry > geometry

Member Data Documentation

edm::ESHandle<CSCGeometry> CSCSimHitMatcher::csc_geom_
private

Definition at line 76 of file CSCSimHitMatcher.h.

Referenced by init().