CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
AlignmentCSCTrackSelector Class Reference

#include <AlignmentCSCTrackSelector.h>

Public Types

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

Public Member Functions

 AlignmentCSCTrackSelector (const edm::ParameterSet &cfg)
 constructor More...
 
Tracks select (const Tracks &tracks, const edm::Event &evt) const
 select tracks More...
 
 ~AlignmentCSCTrackSelector ()
 destructor More...
 

Private Attributes

int m_maxHitsPerStation
 
int m_minHitsDT
 
int m_minHitsPerStation
 
edm::InputTag m_src
 
int m_stationA
 
int m_stationB
 

Detailed Description

Definition at line 15 of file AlignmentCSCTrackSelector.h.

Member Typedef Documentation

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

Definition at line 17 of file AlignmentCSCTrackSelector.h.

Constructor & Destructor Documentation

AlignmentCSCTrackSelector::AlignmentCSCTrackSelector ( const edm::ParameterSet cfg)

constructor

Definition at line 15 of file AlignmentCSCTrackSelector.cc.

16  : m_src(cfg.getParameter<edm::InputTag>("src")),
17  m_stationA(cfg.getParameter<int>("stationA")),
18  m_stationB(cfg.getParameter<int>("stationB")),
19  m_minHitsDT(cfg.getParameter<int>("minHitsDT")),
20  m_minHitsPerStation(cfg.getParameter<int>("minHitsPerStation")),
21  m_maxHitsPerStation(cfg.getParameter<int>("maxHitsPerStation")) {}
T getParameter(std::string const &) const
AlignmentCSCTrackSelector::~AlignmentCSCTrackSelector ( )

destructor

Definition at line 25 of file AlignmentCSCTrackSelector.cc.

25 {}

Member Function Documentation

AlignmentCSCTrackSelector::Tracks AlignmentCSCTrackSelector::select ( const Tracks tracks,
const edm::Event evt 
) const

select tracks

Definition at line 29 of file AlignmentCSCTrackSelector.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, CSCDetId::endcap(), m_maxHitsPerStation, m_minHitsDT, m_minHitsPerStation, m_stationA, m_stationB, DetId::Muon, mps_fire::result, relativeConstraints::station, CSCDetId::station(), and HLT_2018_cff::track.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), Vispa.Views.AbstractView.AbstractView::restoreSelection(), and CSCTrackConfigSelector::select().

29  {
30  Tracks result;
31 
32  for (auto const& track : tracks) {
33  int hitsOnStationA = 0;
34  int hitsOnStationB = 0;
35 
36  for (auto const& hit : track->recHits()) {
37  DetId id = hit->geographicalId();
38 
39  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT) {
40  if (m_stationA == 0)
41  hitsOnStationA++;
42  if (m_stationB == 0)
43  hitsOnStationB++;
44  } else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
45  CSCDetId cscid(id.rawId());
46  int station = (cscid.endcap() == 1 ? 1 : -1) * cscid.station();
47 
48  if (station == m_stationA)
49  hitsOnStationA++;
50  if (station == m_stationB)
51  hitsOnStationB++;
52 
53  } // end if CSC
54  } // end loop over hits
55 
56  bool stationAokay;
57  if (m_stationA == 0)
58  stationAokay = (m_minHitsDT <= hitsOnStationA);
59  else
60  stationAokay = (m_minHitsPerStation <= hitsOnStationA && hitsOnStationA <= m_maxHitsPerStation);
61 
62  bool stationBokay;
63  if (m_stationB == 0)
64  stationBokay = (m_minHitsDT <= hitsOnStationB);
65  else
66  stationBokay = (m_minHitsPerStation <= hitsOnStationB && hitsOnStationB <= m_maxHitsPerStation);
67 
68  if (stationAokay && stationBokay) {
69  result.push_back(track);
70  }
71  } // end loop over tracks
72 
73  return result;
74 }
std::vector< const reco::Track * > Tracks
Definition: DetId.h:17
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12

Member Data Documentation

int AlignmentCSCTrackSelector::m_maxHitsPerStation
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

int AlignmentCSCTrackSelector::m_minHitsDT
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

int AlignmentCSCTrackSelector::m_minHitsPerStation
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

edm::InputTag AlignmentCSCTrackSelector::m_src
private

Definition at line 29 of file AlignmentCSCTrackSelector.h.

int AlignmentCSCTrackSelector::m_stationA
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

int AlignmentCSCTrackSelector::m_stationB
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().