CMS 3D CMS Logo

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

#include <AlignmentCSCBeamHaloSelector.h>

Public Types

typedef std::vector< const
reco::Track * > 
Tracks
 

Public Member Functions

 AlignmentCSCBeamHaloSelector (const edm::ParameterSet &iConfig)
 constructor More...
 
Tracks select (const Tracks &tracks, const edm::Event &iEvent) const
 select tracks More...
 
 ~AlignmentCSCBeamHaloSelector ()
 destructor More...
 

Private Attributes

unsigned int m_minHitsPerStation
 
unsigned int m_minStations
 

Detailed Description

Definition at line 14 of file AlignmentCSCBeamHaloSelector.h.

Member Typedef Documentation

Definition at line 16 of file AlignmentCSCBeamHaloSelector.h.

Constructor & Destructor Documentation

AlignmentCSCBeamHaloSelector::AlignmentCSCBeamHaloSelector ( const edm::ParameterSet iConfig)

constructor

Definition at line 14 of file AlignmentCSCBeamHaloSelector.cc.

References m_minHitsPerStation, and m_minStations.

15  : m_minStations(iConfig.getParameter<unsigned int>("minStations"))
16  , m_minHitsPerStation(iConfig.getParameter<unsigned int>("minHitsPerStation"))
17 {
18  edm::LogInfo("AlignmentCSCBeamHaloSelector")
19  << "Acceptable tracks must have at least " << m_minHitsPerStation << " hits in " << m_minStations << " different CSC stations." << std::endl;
20 }
T getParameter(std::string const &) const
AlignmentCSCBeamHaloSelector::~AlignmentCSCBeamHaloSelector ( )

destructor

Definition at line 24 of file AlignmentCSCBeamHaloSelector.cc.

24 {}

Member Function Documentation

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 python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), python.Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), python.Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), python.Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), python.Vispa.Views.AbstractView.AbstractView::restoreSelection(), and CSCBeamHaloConfigSelector::select().

29  {
30  Tracks result;
31 
32  for (Tracks::const_iterator track = tracks.begin(); track != tracks.end(); ++track) {
33  std::map<int, unsigned int> station_map;
34 
35  for (trackingRecHit_iterator hit = (*track)->recHitsBegin(); hit != (*track)->recHitsEnd(); ++hit) {
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(); station_iter != station_map.end(); ++station_iter) {
51  if (station_iter->second > m_minHitsPerStation) stations++;
52  }
53  if (stations >= m_minStations) {
54  result.push_back(*track);
55  }
56  } // end loop over tracks
57 
58  return result;
59 }
std::vector< const reco::Track * > Tracks
static const int CSC
Definition: MuonSubdetId.h:15
tuple result
Definition: query.py:137
Definition: DetId.h:20
tuple tracks
Definition: testEve_cfg.py:39

Member Data Documentation

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().