CMS 3D CMS Logo

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

#include <AlignmentCSCOverlapSelector.h>

Public Types

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

Public Member Functions

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

Private Attributes

unsigned int m_minHitsPerChamber
 
int m_station
 

Detailed Description

Definition at line 14 of file AlignmentCSCOverlapSelector.h.

Member Typedef Documentation

◆ Tracks

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

Definition at line 16 of file AlignmentCSCOverlapSelector.h.

Constructor & Destructor Documentation

◆ AlignmentCSCOverlapSelector()

AlignmentCSCOverlapSelector::AlignmentCSCOverlapSelector ( const edm::ParameterSet iConfig)

constructor

Definition at line 14 of file AlignmentCSCOverlapSelector.cc.

References m_minHitsPerChamber, and m_station.

15  : m_station(iConfig.getParameter<int>("station")),
16  m_minHitsPerChamber(iConfig.getParameter<unsigned int>("minHitsPerChamber")) {
17  if (m_station == 0) {
18  edm::LogInfo("AlignmentCSCOverlapSelector")
19  << "Acceptable tracks must have " << m_minHitsPerChamber << " in two chambers on all stations." << std::endl;
20  } else {
21  edm::LogInfo("AlignmentCSCOverlapSelector") << "Acceptable tracks must have " << m_minHitsPerChamber
22  << " in two chambers on station " << m_station << "." << std::endl;
23  }
24 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Log< level::Info, false > LogInfo

◆ ~AlignmentCSCOverlapSelector()

AlignmentCSCOverlapSelector::~AlignmentCSCOverlapSelector ( )

destructor

Definition at line 28 of file AlignmentCSCOverlapSelector.cc.

28 {}

Member Function Documentation

◆ select()

AlignmentCSCOverlapSelector::Tracks AlignmentCSCOverlapSelector::select ( const Tracks tracks,
const edm::Event iEvent 
) const

select tracks

Definition at line 32 of file AlignmentCSCOverlapSelector.cc.

References CSCDetId::chamber(), MuonSubdetId::CSC, CSCDetId::endcap(), m_minHitsPerChamber, m_station, DetId::Muon, mps_fire::result, relativeConstraints::station, CSCDetId::station(), HLT_2022v12_cff::track, and tracks.

Referenced by CSCOverlapConfigSelector::select().

33  {
34  Tracks result;
35 
36  for (auto const &track : tracks) {
37  unsigned int MEminus4_even = 0;
38  unsigned int MEminus4_odd = 0;
39  unsigned int MEminus3_even = 0;
40  unsigned int MEminus3_odd = 0;
41  unsigned int MEminus2_even = 0;
42  unsigned int MEminus2_odd = 0;
43  unsigned int MEminus1_even = 0;
44  unsigned int MEminus1_odd = 0;
45 
46  unsigned int MEplus1_even = 0;
47  unsigned int MEplus1_odd = 0;
48  unsigned int MEplus2_even = 0;
49  unsigned int MEplus2_odd = 0;
50  unsigned int MEplus3_even = 0;
51  unsigned int MEplus3_odd = 0;
52  unsigned int MEplus4_even = 0;
53  unsigned int MEplus4_odd = 0;
54 
55  for (auto const &hit : track->recHits()) {
56  DetId id = hit->geographicalId();
57  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
58  CSCDetId cscid(id.rawId());
59  int station = (cscid.endcap() == 1 ? 1 : -1) * cscid.station();
60 
61  if (station == -4) {
62  if (cscid.chamber() % 2 == 0)
63  MEminus4_even++;
64  else
65  MEminus4_odd++;
66  } else if (station == -3) {
67  if (cscid.chamber() % 2 == 0)
68  MEminus3_even++;
69  else
70  MEminus3_odd++;
71  } else if (station == -2) {
72  if (cscid.chamber() % 2 == 0)
73  MEminus2_even++;
74  else
75  MEminus2_odd++;
76  } else if (station == -1) {
77  if (cscid.chamber() % 2 == 0)
78  MEminus1_even++;
79  else
80  MEminus1_odd++;
81  }
82 
83  else if (station == 1) {
84  if (cscid.chamber() % 2 == 0)
85  MEplus1_even++;
86  else
87  MEplus1_odd++;
88  } else if (station == 2) {
89  if (cscid.chamber() % 2 == 0)
90  MEplus2_even++;
91  else
92  MEplus2_odd++;
93  } else if (station == 3) {
94  if (cscid.chamber() % 2 == 0)
95  MEplus3_even++;
96  else
97  MEplus3_odd++;
98  } else if (station == 4) {
99  if (cscid.chamber() % 2 == 0)
100  MEplus4_even++;
101  else
102  MEplus4_odd++;
103  }
104 
105  } // end if it's a CSC hit
106  } // end loop over hits
107 
108  if ((m_station == 0 || m_station == -4) && (MEminus4_even >= m_minHitsPerChamber) &&
109  (MEminus4_odd >= m_minHitsPerChamber))
110  result.push_back(track);
111 
112  else if ((m_station == 0 || m_station == -3) && (MEminus3_even >= m_minHitsPerChamber) &&
113  (MEminus3_odd >= m_minHitsPerChamber))
114  result.push_back(track);
115 
116  else if ((m_station == 0 || m_station == -2) && (MEminus2_even >= m_minHitsPerChamber) &&
117  (MEminus2_odd >= m_minHitsPerChamber))
118  result.push_back(track);
119 
120  else if ((m_station == 0 || m_station == -1) && (MEminus1_even >= m_minHitsPerChamber) &&
121  (MEminus1_odd >= m_minHitsPerChamber))
122  result.push_back(track);
123 
124  else if ((m_station == 0 || m_station == 1) && (MEplus1_even >= m_minHitsPerChamber) &&
125  (MEplus1_odd >= m_minHitsPerChamber))
126  result.push_back(track);
127 
128  else if ((m_station == 0 || m_station == 2) && (MEplus2_even >= m_minHitsPerChamber) &&
129  (MEplus2_odd >= m_minHitsPerChamber))
130  result.push_back(track);
131 
132  else if ((m_station == 0 || m_station == 3) && (MEplus3_even >= m_minHitsPerChamber) &&
133  (MEplus3_odd >= m_minHitsPerChamber))
134  result.push_back(track);
135 
136  else if ((m_station == 0 || m_station == 4) && (MEplus4_even >= m_minHitsPerChamber) &&
137  (MEplus4_odd >= m_minHitsPerChamber))
138  result.push_back(track);
139 
140  } // end loop over tracks
141 
142  return result;
143 }
std::vector< const reco::Track * > Tracks
Definition: DetId.h:17
auto const & tracks
cannot be loose
static constexpr int CSC
Definition: MuonSubdetId.h:12

Member Data Documentation

◆ m_minHitsPerChamber

unsigned int AlignmentCSCOverlapSelector::m_minHitsPerChamber
private

Definition at line 29 of file AlignmentCSCOverlapSelector.h.

Referenced by AlignmentCSCOverlapSelector(), and select().

◆ m_station

int AlignmentCSCOverlapSelector::m_station
private

Definition at line 28 of file AlignmentCSCOverlapSelector.h.

Referenced by AlignmentCSCOverlapSelector(), and select().