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

◆ Tracks

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

Definition at line 17 of file AlignmentCSCTrackSelector.h.

Constructor & Destructor Documentation

◆ AlignmentCSCTrackSelector()

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")) {}

◆ ~AlignmentCSCTrackSelector()

AlignmentCSCTrackSelector::~AlignmentCSCTrackSelector ( )

destructor

Definition at line 25 of file AlignmentCSCTrackSelector.cc.

25 {}

Member Function Documentation

◆ select()

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

select tracks

Definition at line 29 of file AlignmentCSCTrackSelector.cc.

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 }

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(), HLT_2018_cff::track, and PDWG_EXOHSCP_cff::tracks.

Referenced by CSCTrackConfigSelector::select().

Member Data Documentation

◆ m_maxHitsPerStation

int AlignmentCSCTrackSelector::m_maxHitsPerStation
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

◆ m_minHitsDT

int AlignmentCSCTrackSelector::m_minHitsDT
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

◆ m_minHitsPerStation

int AlignmentCSCTrackSelector::m_minHitsPerStation
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

◆ m_src

edm::InputTag AlignmentCSCTrackSelector::m_src
private

Definition at line 29 of file AlignmentCSCTrackSelector.h.

◆ m_stationA

int AlignmentCSCTrackSelector::m_stationA
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

◆ m_stationB

int AlignmentCSCTrackSelector::m_stationB
private

Definition at line 30 of file AlignmentCSCTrackSelector.h.

Referenced by select().

MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
AlignmentCSCTrackSelector::m_stationB
int m_stationB
Definition: AlignmentCSCTrackSelector.h:30
relativeConstraints.station
station
Definition: relativeConstraints.py:67
AlignmentCSCTrackSelector::m_src
edm::InputTag m_src
Definition: AlignmentCSCTrackSelector.h:29
DetId
Definition: DetId.h:17
AlignmentCSCTrackSelector::m_maxHitsPerStation
int m_maxHitsPerStation
Definition: AlignmentCSCTrackSelector.h:30
AlignmentCSCTrackSelector::m_stationA
int m_stationA
Definition: AlignmentCSCTrackSelector.h:30
AlignmentCSCTrackSelector::m_minHitsDT
int m_minHitsDT
Definition: AlignmentCSCTrackSelector.h:30
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
CSCDetId
Definition: CSCDetId.h:26
AlignmentCSCTrackSelector::Tracks
std::vector< const reco::Track * > Tracks
Definition: AlignmentCSCTrackSelector.h:17
looper.cfg
cfg
Definition: looper.py:297
AlignmentCSCTrackSelector::m_minHitsPerStation
int m_minHitsPerStation
Definition: AlignmentCSCTrackSelector.h:30
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
mps_fire.result
result
Definition: mps_fire.py:303
DetId::Muon
Definition: DetId.h:26
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88