CMS 3D CMS Logo

AlignmentCSCBeamHaloSelector.cc
Go to the documentation of this file.
2 
5 
11 
12 // constructor ----------------------------------------------------------------
13 
15  : m_minStations(iConfig.getParameter<unsigned int>("minStations")),
16  m_minHitsPerStation(iConfig.getParameter<unsigned int>("minHitsPerStation")) {
17  edm::LogInfo("AlignmentCSCBeamHaloSelector")
18  << "Acceptable tracks must have at least " << m_minHitsPerStation << " hits in " << m_minStations
19  << " different CSC stations." << std::endl;
20 }
21 
22 // destructor -----------------------------------------------------------------
23 
25 
26 // do selection ---------------------------------------------------------------
27 
29  const edm::Event &iEvent) const {
30  Tracks result;
31 
32  for (auto const &track : tracks) {
33  std::map<int, unsigned int> station_map;
34 
35  for (auto const &hit : track->recHits()) {
36  DetId id = hit->geographicalId();
37  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
38  CSCDetId cscid(id.rawId());
39  int station = (cscid.endcap() == 1 ? 1 : -1) * cscid.station();
40 
41  std::map<int, unsigned int>::const_iterator station_iter = station_map.find(station);
42  if (station_iter == station_map.end()) {
43  station_map[station] = 0;
44  }
45  station_map[station]++;
46  } // end if it's a CSC hit
47  } // end loop over hits
48 
49  unsigned int stations = 0;
50  for (std::map<int, unsigned int>::const_iterator station_iter = station_map.begin();
51  station_iter != station_map.end();
52  ++station_iter) {
53  if (station_iter->second > m_minHitsPerStation)
54  stations++;
55  }
56  if (stations >= m_minStations) {
57  result.push_back(track);
58  }
59  } // end loop over tracks
60 
61  return result;
62 }
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
MessageLogger.h
relativeConstraints.station
station
Definition: relativeConstraints.py:67
AlignmentCSCBeamHaloSelector::m_minStations
unsigned int m_minStations
Definition: AlignmentCSCBeamHaloSelector.h:29
TrackingRecHitFwd.h
AlignmentCSCBeamHaloSelector::~AlignmentCSCBeamHaloSelector
~AlignmentCSCBeamHaloSelector()
destructor
Definition: AlignmentCSCBeamHaloSelector.cc:24
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
CSCDetId.h
DetId
Definition: DetId.h:17
TrackingRecHit.h
AlignmentCSCBeamHaloSelector::AlignmentCSCBeamHaloSelector
AlignmentCSCBeamHaloSelector(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
constructor
Definition: AlignmentCSCBeamHaloSelector.cc:14
AlignmentCSCBeamHaloSelector::Tracks
std::vector< const reco::Track * > Tracks
Definition: AlignmentCSCBeamHaloSelector.h:17
edm::ParameterSet
Definition: ParameterSet.h:47
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
CSCDetId
Definition: CSCDetId.h:26
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
AlignmentCSCBeamHaloSelector::select
Tracks select(const Tracks &tracks, const edm::Event &iEvent) const
select tracks
Definition: AlignmentCSCBeamHaloSelector.cc:28
MuonSubdetId.h
DetId.h
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
mps_fire.result
result
Definition: mps_fire.py:311
DetId::Muon
Definition: DetId.h:26
ParameterSet.h
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
edm::Event
Definition: Event.h:73
AlignmentCSCBeamHaloSelector.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hit
Definition: SiStripHitEffFromCalibTree.cc:88
AlignmentCSCBeamHaloSelector::m_minHitsPerStation
unsigned int m_minHitsPerStation
Definition: AlignmentCSCBeamHaloSelector.h:30