CMS 3D CMS Logo

SectorProcessorShower.cc
Go to the documentation of this file.
3 
7 
8  endcap_ = endcap;
9  sector_ = sector;
10 
11  enableTwoLooseShowers_ = pset.getParameter<bool>("enableTwoLooseShowers");
12  enableOneNominalShower_ = pset.getParameter<bool>("enableOneNominalShowers");
13  nLooseShowers_ = pset.getParameter<unsigned>("nLooseShowers");
14  nNominalShowers_ = pset.getParameter<unsigned>("nNominalShowers");
15 }
16 
18  l1t::RegionalMuonShowerBxCollection& out_showers) const {
19  // reset
20  std::vector<CSCShowerDigi> selected_showers;
21 
22  // shower selection
23  auto chamber = in_showers.begin();
24  auto chend = in_showers.end();
25  for (; chamber != chend; ++chamber) {
26  auto digi = (*chamber).second.first;
27  auto dend = (*chamber).second.second;
28  for (; digi != dend; ++digi) {
29  // Returns CSC "link" index (0 - 45)
30  int selected_shower = select_shower((*chamber).first, *digi);
31 
32  // index is valid
33  if (selected_shower >= 0) {
34  // 18 in ME1; 9x3 in ME2,3,4
36 
37  // shower is valid
38  if (digi->isValid()) {
39  selected_showers.emplace_back(*digi);
40  }
41  }
42  }
43  }
44 
45  // Shower recognition logic: at least one nominal shower (see DN-20-033, section 5.2)
46  const unsigned nLooseInTime(std::count_if(
47  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isLooseInTime(); }));
48  const unsigned nNominalInTime(std::count_if(
49  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isNominalInTime(); }));
50  const unsigned nLooseOutOfTime(std::count_if(
51  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isLooseOutOfTime(); }));
52  const unsigned nNominalOutOfTime(std::count_if(
53  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isNominalOutOfTime(); }));
54 
55  const bool hasTwoLooseInTime(nLooseInTime >= nLooseShowers_);
56  const bool hasOneNominalInTime(nNominalInTime >= nNominalShowers_);
57  const bool hasTwoLooseOutOfTime(nLooseOutOfTime >= nLooseShowers_);
58  const bool hasOneNominalOutOfTime(nNominalOutOfTime >= nNominalShowers_);
59 
60  const bool acceptLoose(enableTwoLooseShowers_ and (hasTwoLooseInTime or hasTwoLooseOutOfTime));
61  const bool acceptNominal(enableOneNominalShower_ and (hasOneNominalInTime or hasOneNominalOutOfTime));
62  // trigger condition
63  const bool accept(acceptLoose or acceptNominal);
64 
65  if (accept) {
66  // shower output
67  l1t::RegionalMuonShower out_shower(
68  hasOneNominalInTime, hasOneNominalOutOfTime, hasTwoLooseInTime, hasTwoLooseOutOfTime);
69  out_shower.setEndcap(endcap_);
70  out_shower.setSector(sector_);
71  out_showers.push_back(0, out_shower);
72  }
73 }
74 
75 // shower selection
76 int SectorProcessorShower::select_shower(const CSCDetId& tp_detId, const CSCShowerDigi& shower) const {
77  int selected = -1;
78 
79  int tp_endcap = tp_detId.endcap();
80  int tp_sector = tp_detId.triggerSector();
81  int tp_station = tp_detId.station();
82  int tp_chamber = tp_detId.chamber();
83  int tp_csc_ID = shower.getCSCID();
84 
85  // station 1 --> subsector 1 or 2
86  // station 2,3,4 --> subsector 0
87  int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
88 
89  // Check if the chamber belongs to this sector processor at this BX.
90  selected = get_index_shower(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID);
91  return selected;
92 }
93 
95  int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const {
96  int selected = -1;
97 
98  // shower trigger does not considers overlaps
99  if (is_in_sector_csc(tp_endcap, tp_sector)) {
100  if (tp_station == 1) { // ME1: 0 - 8, 9 - 17
101  selected = (tp_subsector - 1) * 9 + (tp_csc_ID - 1);
102  } else { // ME2,3,4: 18 - 26, 27 - 35, 36 - 44
103  selected = (tp_station)*9 + (tp_csc_ID - 1);
104  }
105  }
106 
107  emtf_assert(selected != -1);
108  return selected;
109 }
110 
111 bool SectorProcessorShower::is_in_sector_csc(int tp_endcap, int tp_sector) const {
112  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
113 }
SectorProcessorShower::process
void process(const CSCShowerDigiCollection &showers, l1t::RegionalMuonShowerBxCollection &out_showers) const
Definition: SectorProcessorShower.cc:17
CSCConstants::MAX_CSCS_PER_EMTF_SP_NO_OVERLAP
Definition: CSCConstants.h:146
emtf::MIN_TRIGSECTOR
constexpr int MIN_TRIGSECTOR
Definition: Common.h:49
SectorProcessorShower::nNominalShowers_
unsigned nNominalShowers_
Definition: SectorProcessorShower.h:37
l1t::RegionalMuonShower
Definition: RegionalMuonShower.h:16
SectorProcessorShower::sector_
int sector_
Definition: SectorProcessorShower.h:34
MuonDigiCollection
A container for a generic type of digis indexed by some index, implemented with a map<IndexType,...
Definition: MuonDigiCollection.h:87
CSCShowerDigi
Definition: CSCShowerDigi.h:9
SectorProcessorShower::is_in_sector_csc
bool is_in_sector_csc(int tp_endcap, int tp_sector) const
Definition: SectorProcessorShower.cc:111
emtf::MAX_ENDCAP
constexpr int MAX_ENDCAP
Definition: Common.h:46
SectorProcessorShower.h
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
SectorProcessorShower::endcap_
int endcap_
Definition: SectorProcessorShower.h:34
SectorProcessorShower::get_index_shower
int get_index_shower(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
Definition: SectorProcessorShower.cc:94
emtf::MAX_TRIGSECTOR
constexpr int MAX_TRIGSECTOR
Definition: Common.h:50
SectorProcessorShower::configure
void configure(const edm::ParameterSet &, int endcap, int sector)
Definition: SectorProcessorShower.cc:4
BXVector
Definition: BXVector.h:15
l1t::RegionalMuonShower::setSector
void setSector(const unsigned sector)
Definition: RegionalMuonShower.h:31
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
SectorProcessorShower::nLooseShowers_
unsigned nLooseShowers_
Definition: SectorProcessorShower.h:38
emtf::MIN_ENDCAP
constexpr int MIN_ENDCAP
Definition: Common.h:45
CSCConstants.h
MuonDigiCollection::end
DigiRangeIterator end() const
Definition: MuonDigiCollection.h:136
MuonDigiCollection::begin
DigiRangeIterator begin() const
Definition: MuonDigiCollection.h:134
CSCDetId::triggerSector
int triggerSector() const
Definition: CSCDetId.cc:3
SectorProcessorShower::select_shower
int select_shower(const CSCDetId &, const CSCShowerDigi &) const
Definition: SectorProcessorShower.cc:76
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCDetId
Definition: CSCDetId.h:26
CSCDetId::chamber
int chamber() const
Definition: CSCDetId.h:62
SectorProcessorShower::enableOneNominalShower_
bool enableOneNominalShower_
Definition: SectorProcessorShower.h:35
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
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
emtf_assert
#define emtf_assert(expr)
Definition: DebugTools.h:18
l1t::RegionalMuonShower::setEndcap
void setEndcap(const int endcap)
Definition: RegionalMuonShower.h:30
SectorProcessorShower::enableTwoLooseShowers_
bool enableTwoLooseShowers_
Definition: SectorProcessorShower.h:36
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
BXVector::push_back
void push_back(int bx, T object)
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCShowerDigi::getCSCID
uint16_t getCSCID() const
Definition: CSCShowerDigi.h:35