CMS 3D CMS Logo

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

#include <CSCMuonPortCard.h>

Public Types

typedef CSCTriggerContainer< csctf::TrackStubTrackStubList
 

Public Member Functions

void clear ()
 
 CSCMuonPortCard ()
 
 CSCMuonPortCard (unsigned endcap, unsigned station, unsigned sector, const edm::ParameterSet &conf)
 
std::vector< csctf::TrackStubgetLCTs () const
 
void loadLCTs (const CSCCorrelatedLCTDigiCollection &thedigis)
 
void sortLCTs ()
 
void sortLCTs (const unsigned subsector, const int bx)
 

Private Attributes

bool drop_invalid_stubs_
 
bool drop_low_quality_stubs_
 
unsigned max_stubs_
 
int maxBX_
 
int minBX_
 
std::unique_ptr< LCTQualityControlqualityControl_
 
std::vector< csctf::TrackStubselectedStubs_
 
bool sort_stubs_
 
CSCTriggerContainer< csctf::TrackStubstubs_
 
unsigned theEndcap
 
unsigned theSector
 
unsigned theStation
 
std::string vmeName_
 

Detailed Description

Definition at line 36 of file CSCMuonPortCard.h.

Member Typedef Documentation

◆ TrackStubList

Definition at line 38 of file CSCMuonPortCard.h.

Constructor & Destructor Documentation

◆ CSCMuonPortCard() [1/2]

CSCMuonPortCard::CSCMuonPortCard ( unsigned  endcap,
unsigned  station,
unsigned  sector,
const edm::ParameterSet conf 
)

Definition at line 7 of file CSCMuonPortCard.cc.

9  // Get min and max BX to sort LCTs in MPC.
10  minBX_ = conf.getParameter<int>("MinBX");
11  maxBX_ = conf.getParameter<int>("MaxBX");
12 
13  const auto& mpcParams = conf.getParameter<edm::ParameterSet>("mpcParam");
14  sort_stubs_ = mpcParams.getParameter<bool>("sortStubs");
15  drop_invalid_stubs_ = mpcParams.getParameter<bool>("dropInvalidStubs");
16  drop_low_quality_stubs_ = mpcParams.getParameter<bool>("dropLowQualityStubs");
17  max_stubs_ = mpcParams.getParameter<unsigned>("maxStubs");
18 
19  qualityControl_ = std::make_unique<LCTQualityControl>(endcap, station, sector, 1, 1, conf);
20 
21  const std::string eSign = endcap == 1 ? "+" : "-";
22  vmeName_ = "VME" + eSign + std::to_string(theStation) + "/" + std::to_string(theSector);
23 }

References drop_invalid_stubs_, drop_low_quality_stubs_, makeMuonMisalignmentScenario::endcap, edm::ParameterSet::getParameter(), max_stubs_, maxBX_, minBX_, qualityControl_, sort_stubs_, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, theSector, theStation, and vmeName_.

◆ CSCMuonPortCard() [2/2]

CSCMuonPortCard::CSCMuonPortCard ( )

Definition at line 5 of file CSCMuonPortCard.cc.

5 {}

Member Function Documentation

◆ clear()

void CSCMuonPortCard::clear ( void  )

Definition at line 25 of file CSCMuonPortCard.cc.

25  {
26  stubs_.clear();
27  selectedStubs_.clear();
28 }

References CSCTriggerContainer< T >::clear(), selectedStubs_, and stubs_.

Referenced by loadLCTs().

◆ getLCTs()

std::vector<csctf::TrackStub> CSCMuonPortCard::getLCTs ( ) const
inline

Definition at line 58 of file CSCMuonPortCard.h.

58 { return selectedStubs_; }

References selectedStubs_.

◆ loadLCTs()

void CSCMuonPortCard::loadLCTs ( const CSCCorrelatedLCTDigiCollection thedigis)

Definition at line 30 of file CSCMuonPortCard.cc.

30  {
31  // clear the input and output collection
32  clear();
33 
34  for (auto Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
35  const CSCDetId& detid((*Citer).first);
36  const unsigned endcap = detid.endcap();
37  const unsigned station = detid.station();
38  const unsigned sector = detid.triggerSector();
39 
40  // select stubs by region
41  if (endcap != theEndcap or station != theStation or sector != theSector)
42  continue;
43 
44  // Put everything from the digi container into a trigger container.
45  // This allows us to sort per BX more easily.
46  for (auto Diter = (*Citer).second.first; Diter != (*Citer).second.second; Diter++) {
47  stubs_.push_back(csctf::TrackStub((*Diter), (*Citer).first));
48  }
49  }
50 }

References clear(), CSCDetId::endcap(), makeMuonMisalignmentScenario::endcap, or, CSCTriggerContainer< T >::push_back(), relativeConstraints::station, CSCDetId::station(), stubs_, theEndcap, theSector, theStation, and CSCDetId::triggerSector().

◆ sortLCTs() [1/2]

void CSCMuonPortCard::sortLCTs ( )

Definition at line 52 of file CSCMuonPortCard.cc.

52  {
53  // sort the LCTs per BX and subsector
54  for (int bx = minBX_; bx <= maxBX_; ++bx) {
55  // station 1 case with all 10 degree chambers
56  if (theStation == 1) {
57  sortLCTs(1, bx);
58  sortLCTs(2, bx);
59  }
60  // station 2,3,4 case with mixture of 10 and 20 degree chambers
61  else {
62  sortLCTs(0, bx);
63  }
64  }
65 }

References l1GtPatternGenerator_cfi::bx, maxBX_, minBX_, and theStation.

◆ sortLCTs() [2/2]

void CSCMuonPortCard::sortLCTs ( const unsigned  subsector,
const int  bx 
)

Definition at line 67 of file CSCMuonPortCard.cc.

67  {
68  // temporary vector
69  std::vector<csctf::TrackStub> result = stubs_.get(theEndcap, theStation, theSector, subsector, bx);
70 
71  // pre-selection step
72  for (auto LCT = result.begin(); LCT != result.end(); LCT++) {
73  // step 1: no invalid stubs
74  if (drop_invalid_stubs_ && !LCT->isValid()) {
75  result.erase(LCT, LCT);
76  }
77 
78  // step 2: no low-quality stubs
79  if (drop_low_quality_stubs_ && LCT->getQuality() == 0) {
80  result.erase(LCT, LCT);
81  }
82  }
83 
84  // sort+select
85  if (!result.empty()) {
86  // sort according to quality and CSCDetId
87  if (sort_stubs_) {
88  std::sort(result.begin(), result.end(), std::greater<csctf::TrackStub>());
89  }
90 
91  // select up to MAX_LCTS_PER_MPC (default 18) per bunch crossing.
92  const unsigned maxStubs = std::min(max_stubs_, unsigned(CSCConstants::MAX_LCTS_PER_MPC));
93  if (result.size() > maxStubs) {
94  result.erase(result.begin() + maxStubs, result.end());
95  }
96 
97  // Go through the sorted list and label the LCTs with a sorting number.
98  unsigned i = 0;
99  for (auto LCT = result.begin(); LCT != result.end(); LCT++) {
100  LCT->setMPCLink(++i);
101  }
102 
103  // check if the MPC stubs are valid
104  for (const auto& lct : result) {
105  const CSCDetId& detid(lct.getDetId().rawId());
106  const unsigned station(detid.station());
107  const unsigned ring(detid.ring());
108  qualityControl_->checkValid(*(lct.getDigi()), station, ring);
109  }
110 
111  // now insert the temporary vector in the output collection
112  selectedStubs_.insert(selectedStubs_.end(), result.begin(), result.end());
113  }
114 }

References l1GtPatternGenerator_cfi::bx, drop_invalid_stubs_, drop_low_quality_stubs_, CSCTriggerContainer< T >::get(), mps_fire::i, CSCConstants::MAX_LCTS_PER_MPC, max_stubs_, auxiliaryParams::maxStubs, min(), qualityControl_, mps_fire::result, relativeConstraints::ring, selectedStubs_, sort_stubs_, relativeConstraints::station, stubs_, theEndcap, theSector, and theStation.

Member Data Documentation

◆ drop_invalid_stubs_

bool CSCMuonPortCard::drop_invalid_stubs_
private

Definition at line 77 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

◆ drop_low_quality_stubs_

bool CSCMuonPortCard::drop_low_quality_stubs_
private

Definition at line 78 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

◆ max_stubs_

unsigned CSCMuonPortCard::max_stubs_
private

Definition at line 79 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

◆ maxBX_

int CSCMuonPortCard::maxBX_
private

Definition at line 81 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

◆ minBX_

int CSCMuonPortCard::minBX_
private

Definition at line 81 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

◆ qualityControl_

std::unique_ptr<LCTQualityControl> CSCMuonPortCard::qualityControl_
private

Definition at line 73 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

◆ selectedStubs_

std::vector<csctf::TrackStub> CSCMuonPortCard::selectedStubs_
private

Definition at line 70 of file CSCMuonPortCard.h.

Referenced by clear(), getLCTs(), and sortLCTs().

◆ sort_stubs_

bool CSCMuonPortCard::sort_stubs_
private

Definition at line 76 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

◆ stubs_

CSCTriggerContainer<csctf::TrackStub> CSCMuonPortCard::stubs_
private

Definition at line 67 of file CSCMuonPortCard.h.

Referenced by clear(), loadLCTs(), and sortLCTs().

◆ theEndcap

unsigned CSCMuonPortCard::theEndcap
private

Chamber id (trigger-type labels).

Definition at line 62 of file CSCMuonPortCard.h.

Referenced by loadLCTs(), and sortLCTs().

◆ theSector

unsigned CSCMuonPortCard::theSector
private

Definition at line 64 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), loadLCTs(), and sortLCTs().

◆ theStation

unsigned CSCMuonPortCard::theStation
private

Definition at line 63 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), loadLCTs(), and sortLCTs().

◆ vmeName_

std::string CSCMuonPortCard::vmeName_
private

Definition at line 83 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard().

CSCTriggerContainer::clear
void clear()
Definition: CSCTriggerContainer.h:57
mps_fire.i
i
Definition: mps_fire.py:428
CSCMuonPortCard::max_stubs_
unsigned max_stubs_
Definition: CSCMuonPortCard.h:79
CSCMuonPortCard::selectedStubs_
std::vector< csctf::TrackStub > selectedStubs_
Definition: CSCMuonPortCard.h:70
min
T min(T a, T b)
Definition: MathUtil.h:58
relativeConstraints.station
station
Definition: relativeConstraints.py:67
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
auxiliaryParams.maxStubs
maxStubs
Definition: auxiliaryParams.py:44
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCMuonPortCard::maxBX_
int maxBX_
Definition: CSCMuonPortCard.h:81
CSCMuonPortCard::drop_low_quality_stubs_
bool drop_low_quality_stubs_
Definition: CSCMuonPortCard.h:78
csctf::TrackStub
Definition: TrackStub.h:22
CSCMuonPortCard::theEndcap
unsigned theEndcap
Definition: CSCMuonPortCard.h:62
CSCMuonPortCard::theStation
unsigned theStation
Definition: CSCMuonPortCard.h:63
CSCMuonPortCard::vmeName_
std::string vmeName_
Definition: CSCMuonPortCard.h:83
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
CSCMuonPortCard::clear
void clear()
Definition: CSCMuonPortCard.cc:25
CSCDetId
Definition: CSCDetId.h:26
CSCMuonPortCard::drop_invalid_stubs_
bool drop_invalid_stubs_
Definition: CSCMuonPortCard.h:77
CSCMuonPortCard::theSector
unsigned theSector
Definition: CSCMuonPortCard.h:64
CSCMuonPortCard::minBX_
int minBX_
Definition: CSCMuonPortCard.h:81
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCTriggerContainer::push_back
void push_back(const T &data)
Definition: CSCTriggerContainer.h:51
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCMuonPortCard::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCMuonPortCard.h:73
CSCConstants::MAX_LCTS_PER_MPC
Definition: CSCConstants.h:77
mps_fire.result
result
Definition: mps_fire.py:311
CSCMuonPortCard::stubs_
CSCTriggerContainer< csctf::TrackStub > stubs_
Definition: CSCMuonPortCard.h:67
CSCMuonPortCard::sortLCTs
void sortLCTs()
Definition: CSCMuonPortCard.cc:52
CSCTriggerContainer::get
std::vector< T > get() const
Definition: CSCTriggerContainer.h:83
CSCMuonPortCard::sort_stubs_
bool sort_stubs_
Definition: CSCMuonPortCard.h:76