CMS 3D CMS Logo

SectorProcessorShower.cc
Go to the documentation of this file.
3 
7 
8  endcap_ = endcap;
9  sector_ = sector;
10 
11  enableOneLooseShower_ = pset.getParameter<bool>("enableOneLooseShower");
12  enableTwoLooseShowers_ = pset.getParameter<bool>("enableTwoLooseShowers");
13  enableOneNominalShower_ = pset.getParameter<bool>("enableOneNominalShower");
14  enableOneTightShower_ = pset.getParameter<bool>("enableOneTightShower");
15 }
16 
18  l1t::RegionalMuonShowerBxCollection& out_showers) const {
19  // reset
20  std::vector<CSCShowerDigi> selected_showers;
21 
22  int bx = 0;
23 
24  // shower selection
25  auto chamber = in_showers.begin();
26  auto chend = in_showers.end();
27  for (; chamber != chend; ++chamber) {
28  auto digi = (*chamber).second.first;
29  auto dend = (*chamber).second.second;
30  for (; digi != dend; ++digi) {
31  // Returns CSC "link" index (0 - 45)
32  int selected_shower = select_shower((*chamber).first, *digi);
33 
34  // index is valid
35  if (selected_shower >= 0) {
36  // 18 in ME1; 9x3 in ME2,3,4
38 
39  // shower is valid
40  if (digi->isValid()) {
41  bx = digi->getBX() - CSCConstants::LCT_CENTRAL_BX;
42  selected_showers.emplace_back(*digi);
43  }
44  }
45  }
46  }
47 
48  // Shower recognition logic: at least one nominal shower (see DN-20-033, section 5.2)
49  // Updated shower recognition logic: at least one loose shower (starting April 2023)
50  const unsigned nLooseInTime(std::count_if(
51  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isLooseInTime(); }));
52  const unsigned nNominalInTime(std::count_if(
53  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isNominalInTime(); }));
54  const unsigned nTightInTime(std::count_if(
55  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isTightInTime(); }));
56 
57  const bool hasOneLooseInTime(nLooseInTime >= 1);
58  const bool hasTwoLooseInTime(nLooseInTime >= 2);
59  const bool hasOneNominalInTime(nNominalInTime >= 1);
60  const bool hasOneTightInTime(nTightInTime >= 1);
61 
62  // for startup Run-3 we're not considering out of time triggers
63  const bool acceptLoose(enableOneLooseShower_ and hasOneLooseInTime);
64  const bool acceptTwoLoose(enableTwoLooseShowers_ and hasTwoLooseInTime);
65  const bool acceptNominal(enableOneNominalShower_ and hasOneNominalInTime);
66  const bool acceptTight(enableOneTightShower_ and hasOneTightInTime);
67 
68  // trigger condition
69  const bool accept(acceptLoose or acceptTwoLoose or acceptNominal or acceptTight);
70 
71  if (accept) {
72  // shower output
73  l1t::RegionalMuonShower out_shower(
74  hasOneNominalInTime, false, hasTwoLooseInTime, false, hasOneLooseInTime, hasOneTightInTime, false);
76  out_shower.setTFIdentifiers(sector_ - 1, tftype);
77  out_showers.push_back(bx, out_shower);
78  }
79 }
80 
81 // shower selection
82 int SectorProcessorShower::select_shower(const CSCDetId& tp_detId, const CSCShowerDigi& shower) const {
83  int selected = -1;
84 
85  int tp_endcap = tp_detId.endcap();
86  int tp_sector = tp_detId.triggerSector();
87  int tp_station = tp_detId.station();
88  int tp_chamber = tp_detId.chamber();
89  int tp_csc_ID = shower.getCSCID();
90 
91  // station 1 --> subsector 1 or 2
92  // station 2,3,4 --> subsector 0
93  int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
94 
95  // Check if the chamber belongs to this sector processor at this BX.
96  selected = get_index_shower(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID);
97  return selected;
98 }
99 
101  int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const {
102  int selected = -1;
103 
104  // shower trigger does not considers overlaps
105  if (is_in_sector_csc(tp_endcap, tp_sector)) {
106  if (tp_station == 1) { // ME1: 0 - 8, 9 - 17
107  selected = (tp_subsector - 1) * 9 + (tp_csc_ID - 1);
108  } else { // ME2,3,4: 18 - 26, 27 - 35, 36 - 44
109  selected = (tp_station)*9 + (tp_csc_ID - 1);
110  }
111  }
112 
113  emtf_assert(selected != -1);
114  return selected;
115 }
116 
117 bool SectorProcessorShower::is_in_sector_csc(int tp_endcap, int tp_sector) const {
118  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
119 }
constexpr int MIN_ENDCAP
Definition: Common.h:45
void process(const CSCShowerDigiCollection &showers, l1t::RegionalMuonShowerBxCollection &out_showers) const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
constexpr int MIN_TRIGSECTOR
Definition: Common.h:49
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
int chamber() const
Definition: CSCDetId.h:62
DigiRangeIterator begin() const
uint16_t getCSCID() const
Definition: CSCShowerDigi.h:52
int station() const
Definition: CSCDetId.h:79
void configure(const edm::ParameterSet &, int endcap, int sector)
#define emtf_assert(expr)
Definition: DebugTools.h:18
int endcap() const
Definition: CSCDetId.h:85
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
constexpr int MAX_ENDCAP
Definition: Common.h:46
int get_index_shower(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
constexpr int MAX_TRIGSECTOR
Definition: Common.h:50
int triggerSector() const
Definition: CSCDetId.cc:3
DigiRangeIterator end() const
void push_back(int bx, T object)
bool is_in_sector_csc(int tp_endcap, int tp_sector) const
int select_shower(const CSCDetId &, const CSCShowerDigi &) const
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...