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.

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

Referenced by 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

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