#include <AlignmentCSCBeamHaloSelector.h>
Public Types | |
typedef std::vector< const reco::Track * > | Tracks |
Public Member Functions | |
AlignmentCSCBeamHaloSelector (const edm::ParameterSet &iConfig) | |
constructor | |
Tracks | select (const Tracks &tracks, const edm::Event &iEvent) const |
select tracks | |
~AlignmentCSCBeamHaloSelector () | |
destructor | |
Private Attributes | |
unsigned int | m_minHitsPerStation |
unsigned int | m_minStations |
Definition at line 14 of file AlignmentCSCBeamHaloSelector.h.
typedef std::vector<const reco::Track*> AlignmentCSCBeamHaloSelector::Tracks |
Definition at line 16 of file AlignmentCSCBeamHaloSelector.h.
AlignmentCSCBeamHaloSelector::AlignmentCSCBeamHaloSelector | ( | const edm::ParameterSet & | iConfig | ) |
constructor
Definition at line 14 of file AlignmentCSCBeamHaloSelector.cc.
References m_minHitsPerStation, and m_minStations.
: m_minStations(iConfig.getParameter<unsigned int>("minStations")) , m_minHitsPerStation(iConfig.getParameter<unsigned int>("minHitsPerStation")) { edm::LogInfo("AlignmentCSCBeamHaloSelector") << "Acceptable tracks must have at least " << m_minHitsPerStation << " hits in " << m_minStations << " different CSC stations." << std::endl; }
AlignmentCSCBeamHaloSelector::~AlignmentCSCBeamHaloSelector | ( | ) |
AlignmentCSCBeamHaloSelector::Tracks AlignmentCSCBeamHaloSelector::select | ( | const Tracks & | tracks, |
const edm::Event & | iEvent | ||
) | const |
select tracks
Definition at line 29 of file AlignmentCSCBeamHaloSelector.cc.
References MuonSubdetId::CSC, CSCDetId::endcap(), m_minHitsPerStation, m_minStations, DetId::Muon, query::result, relativeConstraints::station, CSCDetId::station(), and mergeVDriftHistosByStation::stations.
Referenced by CSCBeamHaloConfigSelector::select().
{ Tracks result; for (Tracks::const_iterator track = tracks.begin(); track != tracks.end(); ++track) { std::map<int, unsigned int> station_map; for (trackingRecHit_iterator hit = (*track)->recHitsBegin(); hit != (*track)->recHitsEnd(); ++hit) { DetId id = (*hit)->geographicalId(); if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) { CSCDetId cscid(id.rawId()); int station = (cscid.endcap() == 1 ? 1 : -1) * cscid.station(); std::map<int, unsigned int>::const_iterator station_iter = station_map.find(station); if (station_iter == station_map.end()) { station_map[station] = 0; } station_map[station]++; } // end if it's a CSC hit } // end loop over hits unsigned int stations = 0; for (std::map<int, unsigned int>::const_iterator station_iter = station_map.begin(); station_iter != station_map.end(); ++station_iter) { if (station_iter->second > m_minHitsPerStation) stations++; } if (stations >= m_minStations) { result.push_back(*track); } } // end loop over tracks return result; }
unsigned int AlignmentCSCBeamHaloSelector::m_minHitsPerStation [private] |
Definition at line 29 of file AlignmentCSCBeamHaloSelector.h.
Referenced by AlignmentCSCBeamHaloSelector(), and select().
unsigned int AlignmentCSCBeamHaloSelector::m_minStations [private] |
Definition at line 28 of file AlignmentCSCBeamHaloSelector.h.
Referenced by AlignmentCSCBeamHaloSelector(), and select().