CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCDigiMatcher Class Reference

#include <CSCDigiMatcher.h>

Public Member Functions

std::set< unsigned int > chamberIdsComparator (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsStrip (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsWire (int csc_type=MuonHitHelper::CSC_ALL) const
 
const CSCComparatorDigiContainercomparatorDigisInChamber (unsigned int) const
 
const CSCComparatorDigiContainercomparatorDigisInDetId (unsigned int) const
 
std::set< int > comparatorsInChamber (unsigned int, int max_gap_to_fill=0) const
 
std::set< int > comparatorsInDetId (unsigned int) const
 
 CSCDigiMatcher (edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
 
std::set< unsigned int > detIdsComparator (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > detIdsStrip (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > detIdsWire (int csc_type=MuonHitHelper::CSC_ALL) const
 
void init (const edm::Event &e, const edm::EventSetup &eventSetup)
 
void match (const SimTrack &t, const SimVertex &v)
 do the matching More...
 
std::shared_ptr< CSCSimHitMatchermuonSimHitMatcher () const
 
int nCoincidenceComparatorChambers (int min_n_layers=4) const
 
int nCoincidenceStripChambers (int min_n_layers=4) const
 
int nCoincidenceWireChambers (int min_n_layers=4) const
 
int nLayersWithComparatorInChamber (unsigned int) const
 
int nLayersWithStripInChamber (unsigned int) const
 
int nLayersWithWireInChamber (unsigned int) const
 
const CSCStripDigiContainerstripDigisInChamber (unsigned int) const
 
const CSCStripDigiContainerstripDigisInDetId (unsigned int) const
 
std::set< int > stripsInChamber (unsigned int, int max_gap_to_fill=0) const
 
std::set< int > stripsInDetId (unsigned int) const
 
const CSCWireDigiContainerwireDigisInChamber (unsigned int) const
 
const CSCWireDigiContainerwireDigisInDetId (unsigned int) const
 
std::set< int > wiregroupsInChamber (unsigned int, int max_gap_to_fill=0) const
 
std::set< int > wiregroupsInDetId (unsigned int) const
 
 ~CSCDigiMatcher ()
 

Private Member Functions

void clear ()
 
void matchComparatorsToSimTrack (const CSCComparatorDigiCollection &comparators)
 
void matchStripsToSimTrack (const CSCStripDigiCollection &strips)
 
void matchWiresToSimTrack (const CSCWireDigiCollection &wires)
 
template<class T >
std::set< unsigned int > selectDetIds (const T &digis, int csc_type) const
 

Private Attributes

std::map< unsigned int,
CSCComparatorDigiContainer
chamber_to_comparators_
 
std::map< unsigned int,
CSCStripDigiContainer
chamber_to_strips_
 
std::map< unsigned int,
CSCWireDigiContainer
chamber_to_wires_
 
edm::EDGetTokenT
< CSCComparatorDigiCollection
comparatorDigiInput_
 
edm::Handle
< CSCComparatorDigiCollection
comparatorDigisH_
 
std::map< unsigned int,
CSCComparatorDigiContainer
detid_to_comparators_
 
std::map< unsigned int,
CSCStripDigiContainer
detid_to_strips_
 
std::map< unsigned int,
CSCWireDigiContainer
detid_to_wires_
 
int matchDeltaComparator_
 
int matchDeltaStrip_
 
int matchDeltaWG_
 
int maxBXComparator_
 
int maxBXStrip_
 
int maxBXWire_
 
int minBXComparator_
 
int minBXStrip_
 
int minBXWire_
 
std::shared_ptr< CSCSimHitMatchermuonSimHitMatcher_
 
CSCComparatorDigiContainer no_comparators_
 
CSCStripDigiContainer no_strips_
 
CSCWireDigiContainer no_wires_
 
edm::EDGetTokenT
< CSCStripDigiCollection
stripDigiInput_
 
edm::Handle
< CSCStripDigiCollection
stripDigisH_
 
int verboseComparator_
 
int verboseStrip_
 
int verboseWG_
 
edm::EDGetTokenT
< CSCWireDigiCollection
wireDigiInput_
 
edm::Handle
< CSCWireDigiCollection
wireDigisH_
 

Detailed Description

Description: Matching of Digis to SimTrack in CSC

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

Definition at line 25 of file CSCDigiMatcher.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file CSCDigiMatcher.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), and eostools::move().

5  {
6  const auto& wireDigi = pset.getParameterSet("cscWireDigi");
7  verboseWG_ = wireDigi.getParameter<int>("verbose");
8  minBXWire_ = wireDigi.getParameter<int>("minBX");
9  maxBXWire_ = wireDigi.getParameter<int>("maxBX");
10  matchDeltaWG_ = wireDigi.getParameter<int>("matchDeltaWG");
11 
12  const auto& comparatorDigi = pset.getParameterSet("cscComparatorDigi");
13  verboseComparator_ = comparatorDigi.getParameter<int>("verbose");
14  minBXComparator_ = comparatorDigi.getParameter<int>("minBX");
15  maxBXComparator_ = comparatorDigi.getParameter<int>("maxBX");
16  matchDeltaComparator_ = comparatorDigi.getParameter<int>("matchDeltaStrip");
17 
18  const auto& stripDigi = pset.getParameterSet("cscStripDigi");
19  verboseStrip_ = stripDigi.getParameter<int>("verbose");
20  minBXStrip_ = stripDigi.getParameter<int>("minBX");
21  maxBXStrip_ = stripDigi.getParameter<int>("maxBX");
22  matchDeltaStrip_ = stripDigi.getParameter<int>("matchDeltaStrip");
23 
24  // make a new simhits matcher
26 
28  iC.consumes<CSCComparatorDigiCollection>(comparatorDigi.getParameter<edm::InputTag>("inputTag"));
29  stripDigiInput_ = iC.consumes<CSCStripDigiCollection>(stripDigi.getParameter<edm::InputTag>("inputTag"));
30  wireDigiInput_ = iC.consumes<CSCWireDigiCollection>(wireDigi.getParameter<edm::InputTag>("inputTag"));
31 }
std::shared_ptr< CSCSimHitMatcher > muonSimHitMatcher_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
def move
Definition: eostools.py:511
edm::EDGetTokenT< CSCWireDigiCollection > wireDigiInput_
edm::EDGetTokenT< CSCComparatorDigiCollection > comparatorDigiInput_
edm::EDGetTokenT< CSCStripDigiCollection > stripDigiInput_
CSCDigiMatcher::~CSCDigiMatcher ( )
inline

Definition at line 31 of file CSCDigiMatcher.h.

31 {}

Member Function Documentation

std::set< unsigned int > CSCDigiMatcher::chamberIdsComparator ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 179 of file CSCDigiMatcher.cc.

179  {
180  return selectDetIds(chamber_to_comparators_, csc_type);
181 }
std::map< unsigned int, CSCComparatorDigiContainer > chamber_to_comparators_
std::set< unsigned int > selectDetIds(const T &digis, int csc_type) const
std::set< unsigned int > CSCDigiMatcher::chamberIdsStrip ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 183 of file CSCDigiMatcher.cc.

183  {
184  return selectDetIds(chamber_to_strips_, csc_type);
185 }
std::map< unsigned int, CSCStripDigiContainer > chamber_to_strips_
std::set< unsigned int > selectDetIds(const T &digis, int csc_type) const
std::set< unsigned int > CSCDigiMatcher::chamberIdsWire ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 187 of file CSCDigiMatcher.cc.

187  {
188  return selectDetIds(chamber_to_wires_, csc_type);
189 }
std::map< unsigned int, CSCWireDigiContainer > chamber_to_wires_
std::set< unsigned int > selectDetIds(const T &digis, int csc_type) const
void CSCDigiMatcher::clear ( void  )
private

Definition at line 379 of file CSCDigiMatcher.cc.

379  {
380  detid_to_comparators_.clear();
381  chamber_to_comparators_.clear();
382 
383  detid_to_strips_.clear();
384  chamber_to_strips_.clear();
385 
386  detid_to_wires_.clear();
387  chamber_to_wires_.clear();
388 }
std::map< unsigned int, CSCWireDigiContainer > detid_to_wires_
std::map< unsigned int, CSCComparatorDigiContainer > chamber_to_comparators_
std::map< unsigned int, CSCWireDigiContainer > chamber_to_wires_
std::map< unsigned int, CSCComparatorDigiContainer > detid_to_comparators_
std::map< unsigned int, CSCStripDigiContainer > chamber_to_strips_
std::map< unsigned int, CSCStripDigiContainer > detid_to_strips_
const CSCComparatorDigiContainer & CSCDigiMatcher::comparatorDigisInChamber ( unsigned int  detid) const

Definition at line 197 of file CSCDigiMatcher.cc.

197  {
198  if (chamber_to_comparators_.find(detid) == chamber_to_comparators_.end())
199  return no_comparators_;
200  return chamber_to_comparators_.at(detid);
201 }
CSCComparatorDigiContainer no_comparators_
std::map< unsigned int, CSCComparatorDigiContainer > chamber_to_comparators_
const CSCComparatorDigiContainer & CSCDigiMatcher::comparatorDigisInDetId ( unsigned int  detid) const

Definition at line 191 of file CSCDigiMatcher.cc.

191  {
192  if (detid_to_comparators_.find(detid) == detid_to_comparators_.end())
193  return no_comparators_;
194  return detid_to_comparators_.at(detid);
195 }
CSCComparatorDigiContainer no_comparators_
std::map< unsigned int, CSCComparatorDigiContainer > detid_to_comparators_
std::set< int > CSCDigiMatcher::comparatorsInChamber ( unsigned int  detid,
int  max_gap_to_fill = 0 
) const

Definition at line 320 of file CSCDigiMatcher.cc.

References ztail::d, mps_fire::result, and alignCSCRings::s.

320  {
321  set<int> result;
322  const auto& digis = comparatorDigisInChamber(detid);
323  for (const auto& d : digis) {
324  result.insert(d.getStrip());
325  }
326  if (max_gap_to_fill > 0) {
327  int prev = -111;
328  for (const auto& s : result) {
329  if (s - prev > 1 && s - prev - 1 <= max_gap_to_fill) {
330  for (int fill_s = prev + 1; fill_s < s; ++fill_s)
331  result.insert(fill_s);
332  }
333  prev = s;
334  }
335  }
336 
337  return result;
338 }
tuple result
Definition: mps_fire.py:311
tuple d
Definition: ztail.py:151
const CSCComparatorDigiContainer & comparatorDigisInChamber(unsigned int) const
std::set< int > CSCDigiMatcher::comparatorsInDetId ( unsigned int  detid) const

Definition at line 293 of file CSCDigiMatcher.cc.

References ztail::d, and mps_fire::result.

293  {
294  set<int> result;
295  const auto& digis = comparatorDigisInDetId(detid);
296  for (const auto& d : digis) {
297  result.insert(d.getHalfStrip());
298  }
299  return result;
300 }
const CSCComparatorDigiContainer & comparatorDigisInDetId(unsigned int) const
tuple result
Definition: mps_fire.py:311
tuple d
Definition: ztail.py:151
std::set< unsigned int > CSCDigiMatcher::detIdsComparator ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 167 of file CSCDigiMatcher.cc.

167  {
168  return selectDetIds(detid_to_comparators_, csc_type);
169 }
std::map< unsigned int, CSCComparatorDigiContainer > detid_to_comparators_
std::set< unsigned int > selectDetIds(const T &digis, int csc_type) const
std::set< unsigned int > CSCDigiMatcher::detIdsStrip ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 171 of file CSCDigiMatcher.cc.

171  {
172  return selectDetIds(detid_to_strips_, csc_type);
173 }
std::map< unsigned int, CSCStripDigiContainer > detid_to_strips_
std::set< unsigned int > selectDetIds(const T &digis, int csc_type) const
std::set< unsigned int > CSCDigiMatcher::detIdsWire ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 175 of file CSCDigiMatcher.cc.

175  {
176  return selectDetIds(detid_to_wires_, csc_type);
177 }
std::map< unsigned int, CSCWireDigiContainer > detid_to_wires_
std::set< unsigned int > selectDetIds(const T &digis, int csc_type) const
void CSCDigiMatcher::init ( const edm::Event e,
const edm::EventSetup eventSetup 
)

Definition at line 33 of file CSCDigiMatcher.cc.

References edm::Event::getByToken().

33  {
34  muonSimHitMatcher_->init(iEvent, iSetup);
35 
37  iEvent.getByToken(stripDigiInput_, stripDigisH_);
38  iEvent.getByToken(wireDigiInput_, wireDigisH_);
39 }
std::shared_ptr< CSCSimHitMatcher > muonSimHitMatcher_
edm::Handle< CSCComparatorDigiCollection > comparatorDigisH_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< CSCWireDigiCollection > wireDigiInput_
edm::Handle< CSCWireDigiCollection > wireDigisH_
edm::Handle< CSCStripDigiCollection > stripDigisH_
edm::EDGetTokenT< CSCComparatorDigiCollection > comparatorDigiInput_
edm::EDGetTokenT< CSCStripDigiCollection > stripDigiInput_
void CSCDigiMatcher::match ( const SimTrack t,
const SimVertex v 
)

do the matching

Definition at line 42 of file CSCDigiMatcher.cc.

References clear(), DigiDM_cff::strips, and DigiDM_cff::wires.

42  {
43  // match simhits first
44  muonSimHitMatcher_->match(t, v);
45 
46  // get the digi collections
50 
51  clear();
52 
53  // now match the digis
54  matchComparatorsToSimTrack(comparators);
55  matchStripsToSimTrack(strips);
56  matchWiresToSimTrack(wires);
57 }
std::shared_ptr< CSCSimHitMatcher > muonSimHitMatcher_
edm::Handle< CSCComparatorDigiCollection > comparatorDigisH_
void matchStripsToSimTrack(const CSCStripDigiCollection &strips)
void matchWiresToSimTrack(const CSCWireDigiCollection &wires)
tuple 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
T const * product() const
Definition: Handle.h:70
edm::Handle< CSCWireDigiCollection > wireDigisH_
void matchComparatorsToSimTrack(const CSCComparatorDigiCollection &comparators)
edm::Handle< CSCStripDigiCollection > stripDigisH_
tuple wires
Definition: DigiDM_cff.py:33
void CSCDigiMatcher::matchComparatorsToSimTrack ( const CSCComparatorDigiCollection comparators)
private

Definition at line 59 of file CSCDigiMatcher.cc.

References c, CSCDetId::chamberId(), filterCSVwithJSON::copy, gather_cfg::cout, gpuClustering::id, and DetId::rawId().

59  {
60  const auto& det_ids = muonSimHitMatcher_->detIds(0);
61  for (const auto& id : det_ids) {
62  CSCDetId layer_id(id);
63 
64  const auto& hit_comparators = muonSimHitMatcher_->hitStripsInDetId(id, matchDeltaStrip_);
65  if (verboseComparator_) {
66  cout << "hit_comparators_fat, CSCid " << layer_id << " ";
67  copy(hit_comparators.begin(), hit_comparators.end(), ostream_iterator<int>(cout, " "));
68  cout << endl;
69  }
70 
71  const auto& comp_digis_in_det = comparators.get(layer_id);
72  for (auto c = comp_digis_in_det.first; c != comp_digis_in_det.second; ++c) {
74  edm::LogInfo("CSCDigiMatcher") << "sdigi " << layer_id << " (comparator, comparator, Tbin ) " << *c;
75 
76  // check that the first BX for this digi wasn't too early or too late
77  if (c->getTimeBin() < minBXComparator_ || c->getTimeBin() > maxBXComparator_)
78  continue;
79 
80  int comparator = c->getStrip(); // comparators are counted from 1
81  // check that it matches a comparator that was hit by SimHits from our track
82  if (hit_comparators.find(comparator) == hit_comparators.end())
83  continue;
84 
86  edm::LogInfo("CSCDigiMatcher") << "Matched comparator " << *c;
87  detid_to_comparators_[id].push_back(*c);
88  chamber_to_comparators_[layer_id.chamberId().rawId()].push_back(*c);
89  }
90  }
91 }
std::shared_ptr< CSCSimHitMatcher > muonSimHitMatcher_
const edm::EventSetup & c
uint16_t *__restrict__ id
std::map< unsigned int, CSCComparatorDigiContainer > chamber_to_comparators_
std::map< unsigned int, CSCComparatorDigiContainer > detid_to_comparators_
Log< level::Info, false > LogInfo
tuple cout
Definition: gather_cfg.py:144
void CSCDigiMatcher::matchStripsToSimTrack ( const CSCStripDigiCollection strips)
private

Definition at line 93 of file CSCDigiMatcher.cc.

References c, CSCDetId::chamberId(), filterCSVwithJSON::copy, gather_cfg::cout, gpuClustering::id, or, sistrip::SpyUtilities::range(), DetId::rawId(), relativeConstraints::ring, relativeConstraints::station, and digitizers_cfi::strip.

93  {
94  for (auto detUnitIt = strips.begin(); detUnitIt != strips.end(); ++detUnitIt) {
95  const CSCDetId& id = (*detUnitIt).first;
96  const auto& range = (*detUnitIt).second;
97  for (auto digiIt = range.first; digiIt != range.second; ++digiIt) {
98  if (id.station() == 1 and (id.ring() == 1 or id.ring() == 4))
99  if (verboseStrip_)
100  edm::LogInfo("CSCDigiMatcher") << "CSCid " << id << " Strip digi (strip, strip, Tbin ) " << (*digiIt);
101  }
102  }
103 
104  const auto& det_ids = muonSimHitMatcher_->detIds(0);
105  for (const auto& id : det_ids) {
106  CSCDetId layer_id(id);
107 
108  const auto& hit_strips = muonSimHitMatcher_->hitStripsInDetId(id, matchDeltaStrip_);
109  if (verboseStrip_) {
110  cout << "hit_strips_fat, CSCid " << layer_id << " ";
111  copy(hit_strips.begin(), hit_strips.end(), ostream_iterator<int>(cout, " "));
112  cout << endl;
113  }
114 
115  const auto& strip_digis_in_det = strips.get(layer_id);
116  for (auto c = strip_digis_in_det.first; c != strip_digis_in_det.second; ++c) {
117  if (verboseStrip_)
118  edm::LogInfo("CSCDigiMatcher") << "sdigi " << layer_id << " (strip, Tbin ) " << *c;
119 
120  int strip = c->getStrip(); // strips are counted from 1
121  // check that it matches a strip that was hit by SimHits from our track
122  if (hit_strips.find(strip) == hit_strips.end())
123  continue;
124 
125  if (verboseStrip_)
126  edm::LogInfo("CSCDigiMatcher") << "Matched strip " << *c;
127  detid_to_strips_[id].push_back(*c);
128  chamber_to_strips_[layer_id.chamberId().rawId()].push_back(*c);
129  }
130  }
131 }
std::shared_ptr< CSCSimHitMatcher > muonSimHitMatcher_
const edm::EventSetup & c
uint16_t *__restrict__ id
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const uint16_t range(const Frame &aFrame)
std::map< unsigned int, CSCStripDigiContainer > chamber_to_strips_
Log< level::Info, false > LogInfo
std::map< unsigned int, CSCStripDigiContainer > detid_to_strips_
tuple cout
Definition: gather_cfg.py:144
void CSCDigiMatcher::matchWiresToSimTrack ( const CSCWireDigiCollection wires)
private

Definition at line 133 of file CSCDigiMatcher.cc.

References CSCDetId::chamberId(), filterCSVwithJSON::copy, gather_cfg::cout, gpuClustering::id, DetId::rawId(), and w.

133  {
134  const auto& det_ids = muonSimHitMatcher_->detIds(0);
135  for (const auto& id : det_ids) {
136  CSCDetId layer_id(id);
137 
138  const auto& hit_wires = muonSimHitMatcher_->hitWiregroupsInDetId(id, matchDeltaWG_);
139  if (verboseWG_) {
140  cout << "hit_wires ";
141  copy(hit_wires.begin(), hit_wires.end(), ostream_iterator<int>(cout, " "));
142  cout << endl;
143  }
144 
145  const auto& wire_digis_in_det = wires.get(layer_id);
146  for (auto w = wire_digis_in_det.first; w != wire_digis_in_det.second; ++w) {
147  if (verboseStrip_)
148  edm::LogInfo("CSCDigiMatcher") << "wdigi " << layer_id << " (wire, Tbin ) " << *w;
149 
150  // check that the first BX for this digi wasn't too early or too late
151  if (w->getTimeBin() < minBXWire_ || w->getTimeBin() > maxBXWire_)
152  continue;
153 
154  int wg = w->getWireGroup(); // wiregroups are counted from 1
155  // check that it matches a strip that was hit by SimHits from our track
156  if (hit_wires.find(wg) == hit_wires.end())
157  continue;
158 
159  if (verboseStrip_)
160  edm::LogInfo("CSCDigiMatcher") << "Matched wire digi " << *w << endl;
161  detid_to_wires_[id].push_back(*w);
162  chamber_to_wires_[layer_id.chamberId().rawId()].push_back(*w);
163  }
164  }
165 }
std::shared_ptr< CSCSimHitMatcher > muonSimHitMatcher_
std::map< unsigned int, CSCWireDigiContainer > detid_to_wires_
const double w
Definition: UKUtility.cc:23
uint16_t *__restrict__ id
std::map< unsigned int, CSCWireDigiContainer > chamber_to_wires_
Log< level::Info, false > LogInfo
tuple cout
Definition: gather_cfg.py:144
std::shared_ptr<CSCSimHitMatcher> CSCDigiMatcher::muonSimHitMatcher ( ) const
inline

Definition at line 83 of file CSCDigiMatcher.h.

References muonSimHitMatcher_.

83 { return muonSimHitMatcher_; }
std::shared_ptr< CSCSimHitMatcher > muonSimHitMatcher_
int CSCDigiMatcher::nCoincidenceComparatorChambers ( int  min_n_layers = 4) const

Definition at line 263 of file CSCDigiMatcher.cc.

References mps_fire::result.

263  {
264  int result = 0;
265  const auto& chamber_ids = chamberIdsComparator();
266  for (const auto& id : chamber_ids) {
267  if (nLayersWithComparatorInChamber(id) >= min_n_layers)
268  result += 1;
269  }
270  return result;
271 }
std::set< unsigned int > chamberIdsComparator(int csc_type=MuonHitHelper::CSC_ALL) const
tuple result
Definition: mps_fire.py:311
int nLayersWithComparatorInChamber(unsigned int) const
int CSCDigiMatcher::nCoincidenceStripChambers ( int  min_n_layers = 4) const

Definition at line 273 of file CSCDigiMatcher.cc.

References mps_fire::result.

273  {
274  int result = 0;
275  const auto& chamber_ids = chamberIdsStrip();
276  for (const auto& id : chamber_ids) {
277  if (nLayersWithStripInChamber(id) >= min_n_layers)
278  result += 1;
279  }
280  return result;
281 }
int nLayersWithStripInChamber(unsigned int) const
tuple result
Definition: mps_fire.py:311
std::set< unsigned int > chamberIdsStrip(int csc_type=MuonHitHelper::CSC_ALL) const
int CSCDigiMatcher::nCoincidenceWireChambers ( int  min_n_layers = 4) const

Definition at line 283 of file CSCDigiMatcher.cc.

References mps_fire::result.

283  {
284  int result = 0;
285  const auto& chamber_ids = chamberIdsWire();
286  for (const auto& id : chamber_ids) {
287  if (nLayersWithWireInChamber(id) >= min_n_layers)
288  result += 1;
289  }
290  return result;
291 }
std::set< unsigned int > chamberIdsWire(int csc_type=MuonHitHelper::CSC_ALL) const
int nLayersWithWireInChamber(unsigned int) const
tuple result
Definition: mps_fire.py:311
int CSCDigiMatcher::nLayersWithComparatorInChamber ( unsigned int  detid) const

Definition at line 227 of file CSCDigiMatcher.cc.

References CSCDetId::chamber(), relativeConstraints::empty, CSCDetId::endcap(), mps_fire::i, CSCDetId::ring(), and CSCDetId::station().

227  {
228  int nLayers = 0;
229  CSCDetId chamberId(detid);
230  for (int i = 1; i <= 6; ++i) {
231  CSCDetId layerId(chamberId.endcap(), chamberId.station(), chamberId.ring(), chamberId.chamber(), i);
232  if (!comparatorDigisInDetId(layerId.rawId()).empty()) {
233  nLayers++;
234  }
235  }
236  return nLayers;
237 }
const CSCComparatorDigiContainer & comparatorDigisInDetId(unsigned int) const
int CSCDigiMatcher::nLayersWithStripInChamber ( unsigned int  detid) const

Definition at line 239 of file CSCDigiMatcher.cc.

References CSCDetId::chamber(), relativeConstraints::empty, CSCDetId::endcap(), mps_fire::i, CSCDetId::ring(), and CSCDetId::station().

239  {
240  int nLayers = 0;
241  CSCDetId chamberId(detid);
242  for (int i = 1; i <= 6; ++i) {
243  CSCDetId layerId(chamberId.endcap(), chamberId.station(), chamberId.ring(), chamberId.chamber(), i);
244  if (!stripDigisInDetId(layerId.rawId()).empty()) {
245  nLayers++;
246  }
247  }
248  return nLayers;
249 }
const CSCStripDigiContainer & stripDigisInDetId(unsigned int) const
int CSCDigiMatcher::nLayersWithWireInChamber ( unsigned int  detid) const

Definition at line 251 of file CSCDigiMatcher.cc.

References CSCDetId::chamber(), relativeConstraints::empty, CSCDetId::endcap(), mps_fire::i, CSCDetId::ring(), and CSCDetId::station().

251  {
252  int nLayers = 0;
253  CSCDetId chamberId(detid);
254  for (int i = 1; i <= 6; ++i) {
255  CSCDetId layerId(chamberId.endcap(), chamberId.station(), chamberId.ring(), chamberId.chamber(), i);
256  if (!wireDigisInDetId(layerId.rawId()).empty()) {
257  nLayers++;
258  }
259  }
260  return nLayers;
261 }
const CSCWireDigiContainer & wireDigisInDetId(unsigned int) const
template<class T >
std::set< unsigned int > CSCDigiMatcher::selectDetIds ( const T digis,
int  csc_type 
) const
private

Definition at line 133 of file CSCDigiMatcher.h.

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

133  {
134  std::set<unsigned int> result;
135  for (const auto& p : digis) {
136  const auto& id = p.first;
137  if (csc_type > 0) {
138  CSCDetId detId(id);
139  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
140  continue;
141  }
142  result.insert(p.first);
143  }
144  return result;
145 }
static int toCSCType(int st, int ri)
tuple result
Definition: mps_fire.py:311
const CSCStripDigiContainer & CSCDigiMatcher::stripDigisInChamber ( unsigned int  detid) const

Definition at line 209 of file CSCDigiMatcher.cc.

209  {
210  if (chamber_to_strips_.find(detid) == chamber_to_strips_.end())
211  return no_strips_;
212  return chamber_to_strips_.at(detid);
213 }
CSCStripDigiContainer no_strips_
std::map< unsigned int, CSCStripDigiContainer > chamber_to_strips_
const CSCStripDigiContainer & CSCDigiMatcher::stripDigisInDetId ( unsigned int  detid) const

Definition at line 203 of file CSCDigiMatcher.cc.

203  {
204  if (detid_to_strips_.find(detid) == detid_to_strips_.end())
205  return no_strips_;
206  return detid_to_strips_.at(detid);
207 }
CSCStripDigiContainer no_strips_
std::map< unsigned int, CSCStripDigiContainer > detid_to_strips_
std::set< int > CSCDigiMatcher::stripsInChamber ( unsigned int  detid,
int  max_gap_to_fill = 0 
) const

Definition at line 340 of file CSCDigiMatcher.cc.

References ztail::d, mps_fire::result, and alignCSCRings::s.

340  {
341  set<int> result;
342  const auto& digis = stripDigisInChamber(detid);
343  for (const auto& d : digis) {
344  result.insert(d.getStrip());
345  }
346  if (max_gap_to_fill > 0) {
347  int prev = -111;
348  for (const auto& s : result) {
349  if (s - prev > 1 && s - prev - 1 <= max_gap_to_fill) {
350  for (int fill_s = prev + 1; fill_s < s; ++fill_s)
351  result.insert(fill_s);
352  }
353  prev = s;
354  }
355  }
356 
357  return result;
358 }
tuple result
Definition: mps_fire.py:311
tuple d
Definition: ztail.py:151
const CSCStripDigiContainer & stripDigisInChamber(unsigned int) const
std::set< int > CSCDigiMatcher::stripsInDetId ( unsigned int  detid) const

Definition at line 302 of file CSCDigiMatcher.cc.

References ztail::d, and mps_fire::result.

302  {
303  set<int> result;
304  const auto& digis = stripDigisInDetId(detid);
305  for (const auto& d : digis) {
306  result.insert(d.getStrip());
307  }
308  return result;
309 }
tuple result
Definition: mps_fire.py:311
tuple d
Definition: ztail.py:151
const CSCStripDigiContainer & stripDigisInDetId(unsigned int) const
const CSCWireDigiContainer & CSCDigiMatcher::wireDigisInChamber ( unsigned int  detid) const

Definition at line 221 of file CSCDigiMatcher.cc.

221  {
222  if (chamber_to_wires_.find(detid) == chamber_to_wires_.end())
223  return no_wires_;
224  return chamber_to_wires_.at(detid);
225 }
std::map< unsigned int, CSCWireDigiContainer > chamber_to_wires_
CSCWireDigiContainer no_wires_
const CSCWireDigiContainer & CSCDigiMatcher::wireDigisInDetId ( unsigned int  detid) const

Definition at line 215 of file CSCDigiMatcher.cc.

215  {
216  if (detid_to_wires_.find(detid) == detid_to_wires_.end())
217  return no_wires_;
218  return detid_to_wires_.at(detid);
219 }
std::map< unsigned int, CSCWireDigiContainer > detid_to_wires_
CSCWireDigiContainer no_wires_
std::set< int > CSCDigiMatcher::wiregroupsInChamber ( unsigned int  detid,
int  max_gap_to_fill = 0 
) const

Definition at line 360 of file CSCDigiMatcher.cc.

References ztail::d, mps_fire::result, and w.

360  {
361  set<int> result;
362  const auto& digis = wireDigisInChamber(detid);
363  for (const auto& d : digis) {
364  result.insert(d.getWireGroup());
365  }
366  if (max_gap_to_fill > 0) {
367  int prev = -111;
368  for (const auto& w : result) {
369  if (w - prev > 1 && w - prev - 1 <= max_gap_to_fill) {
370  for (int fill_w = prev + 1; fill_w < w; ++fill_w)
371  result.insert(fill_w);
372  }
373  prev = w;
374  }
375  }
376  return result;
377 }
const double w
Definition: UKUtility.cc:23
tuple result
Definition: mps_fire.py:311
tuple d
Definition: ztail.py:151
const CSCWireDigiContainer & wireDigisInChamber(unsigned int) const
std::set< int > CSCDigiMatcher::wiregroupsInDetId ( unsigned int  detid) const

Definition at line 311 of file CSCDigiMatcher.cc.

References ztail::d, and mps_fire::result.

311  {
312  set<int> result;
313  const auto& digis = wireDigisInDetId(detid);
314  for (const auto& d : digis) {
315  result.insert(d.getWireGroup());
316  }
317  return result;
318 }
const CSCWireDigiContainer & wireDigisInDetId(unsigned int) const
tuple result
Definition: mps_fire.py:311
tuple d
Definition: ztail.py:151

Member Data Documentation

std::map<unsigned int, CSCComparatorDigiContainer> CSCDigiMatcher::chamber_to_comparators_
private

Definition at line 119 of file CSCDigiMatcher.h.

std::map<unsigned int, CSCStripDigiContainer> CSCDigiMatcher::chamber_to_strips_
private

Definition at line 122 of file CSCDigiMatcher.h.

std::map<unsigned int, CSCWireDigiContainer> CSCDigiMatcher::chamber_to_wires_
private

Definition at line 125 of file CSCDigiMatcher.h.

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCDigiMatcher::comparatorDigiInput_
private

Definition at line 96 of file CSCDigiMatcher.h.

edm::Handle<CSCComparatorDigiCollection> CSCDigiMatcher::comparatorDigisH_
private

Definition at line 100 of file CSCDigiMatcher.h.

std::map<unsigned int, CSCComparatorDigiContainer> CSCDigiMatcher::detid_to_comparators_
private

Definition at line 118 of file CSCDigiMatcher.h.

std::map<unsigned int, CSCStripDigiContainer> CSCDigiMatcher::detid_to_strips_
private

Definition at line 121 of file CSCDigiMatcher.h.

std::map<unsigned int, CSCWireDigiContainer> CSCDigiMatcher::detid_to_wires_
private

Definition at line 124 of file CSCDigiMatcher.h.

int CSCDigiMatcher::matchDeltaComparator_
private

Definition at line 110 of file CSCDigiMatcher.h.

int CSCDigiMatcher::matchDeltaStrip_
private

Definition at line 111 of file CSCDigiMatcher.h.

int CSCDigiMatcher::matchDeltaWG_
private

Definition at line 112 of file CSCDigiMatcher.h.

int CSCDigiMatcher::maxBXComparator_
private

Definition at line 106 of file CSCDigiMatcher.h.

int CSCDigiMatcher::maxBXStrip_
private

Definition at line 107 of file CSCDigiMatcher.h.

int CSCDigiMatcher::maxBXWire_
private

Definition at line 108 of file CSCDigiMatcher.h.

int CSCDigiMatcher::minBXComparator_
private

Definition at line 106 of file CSCDigiMatcher.h.

int CSCDigiMatcher::minBXStrip_
private

Definition at line 107 of file CSCDigiMatcher.h.

int CSCDigiMatcher::minBXWire_
private

Definition at line 108 of file CSCDigiMatcher.h.

std::shared_ptr<CSCSimHitMatcher> CSCDigiMatcher::muonSimHitMatcher_
private

Definition at line 104 of file CSCDigiMatcher.h.

Referenced by muonSimHitMatcher().

CSCComparatorDigiContainer CSCDigiMatcher::no_comparators_
private

Definition at line 127 of file CSCDigiMatcher.h.

CSCStripDigiContainer CSCDigiMatcher::no_strips_
private

Definition at line 128 of file CSCDigiMatcher.h.

CSCWireDigiContainer CSCDigiMatcher::no_wires_
private

Definition at line 129 of file CSCDigiMatcher.h.

edm::EDGetTokenT<CSCStripDigiCollection> CSCDigiMatcher::stripDigiInput_
private

Definition at line 97 of file CSCDigiMatcher.h.

edm::Handle<CSCStripDigiCollection> CSCDigiMatcher::stripDigisH_
private

Definition at line 101 of file CSCDigiMatcher.h.

int CSCDigiMatcher::verboseComparator_
private

Definition at line 114 of file CSCDigiMatcher.h.

int CSCDigiMatcher::verboseStrip_
private

Definition at line 115 of file CSCDigiMatcher.h.

int CSCDigiMatcher::verboseWG_
private

Definition at line 116 of file CSCDigiMatcher.h.

edm::EDGetTokenT<CSCWireDigiCollection> CSCDigiMatcher::wireDigiInput_
private

Definition at line 98 of file CSCDigiMatcher.h.

edm::Handle<CSCWireDigiCollection> CSCDigiMatcher::wireDigisH_
private

Definition at line 102 of file CSCDigiMatcher.h.