CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SectorProcessorShower.cc
Go to the documentation of this file.
3 
5  emtf_assert(emtf::MIN_ENDCAP <= endcap && endcap <= emtf::MAX_ENDCAP);
7 
8  endcap_ = endcap;
9  sector_ = sector;
10 
11  enableTwoLooseShowers_ = pset.getParameter<bool>("enableTwoLooseShowers");
12  enableOneNominalShower_ = pset.getParameter<bool>("enableOneNominalShowers");
13  enableOneTightShower_ = pset.getParameter<bool>("enableOneTightShowers");
14  nLooseShowers_ = pset.getParameter<unsigned>("nLooseShowers");
15  nNominalShowers_ = pset.getParameter<unsigned>("nNominalShowers");
16  nTightShowers_ = pset.getParameter<unsigned>("nTightShowers");
17 }
18 
20  l1t::RegionalMuonShowerBxCollection& out_showers) const {
21  // reset
22  std::vector<CSCShowerDigi> selected_showers;
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  selected_showers.emplace_back(*digi);
42  }
43  }
44  }
45  }
46 
47  // Shower recognition logic: at least one nominal shower (see DN-20-033, section 5.2)
48  const unsigned nLooseInTime(std::count_if(
49  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isLooseInTime(); }));
50  const unsigned nNominalInTime(std::count_if(
51  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isNominalInTime(); }));
52  const unsigned nTightInTime(std::count_if(
53  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isTightInTime(); }));
54 
55  const bool hasTwoLooseInTime(nLooseInTime >= nLooseShowers_);
56  const bool hasOneNominalInTime(nNominalInTime >= nNominalShowers_);
57  const bool hasOneTightInTime(nTightInTime >= nTightShowers_);
58 
59  // for startup Run-3 we're not considering out of time triggers
60  const bool acceptLoose(enableTwoLooseShowers_ and hasTwoLooseInTime);
61  const bool acceptNominal(enableOneNominalShower_ and hasOneNominalInTime);
62  const bool acceptTight(enableOneTightShower_ and hasOneTightInTime);
63 
64  // trigger condition
65  const bool accept(acceptLoose or acceptNominal or acceptTight);
66 
67  if (accept) {
68  // shower output
69  l1t::RegionalMuonShower out_shower(hasOneNominalInTime, false, hasTwoLooseInTime, false, hasOneTightInTime, false);
71  out_shower.setTFIdentifiers(sector_ - 1, tftype);
72  out_showers.push_back(0, out_shower);
73  }
74 }
75 
76 // shower selection
77 int SectorProcessorShower::select_shower(const CSCDetId& tp_detId, const CSCShowerDigi& shower) const {
78  int selected = -1;
79 
80  int tp_endcap = tp_detId.endcap();
81  int tp_sector = tp_detId.triggerSector();
82  int tp_station = tp_detId.station();
83  int tp_chamber = tp_detId.chamber();
84  int tp_csc_ID = shower.getCSCID();
85 
86  // station 1 --> subsector 1 or 2
87  // station 2,3,4 --> subsector 0
88  int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
89 
90  // Check if the chamber belongs to this sector processor at this BX.
91  selected = get_index_shower(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID);
92  return selected;
93 }
94 
96  int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const {
97  int selected = -1;
98 
99  // shower trigger does not considers overlaps
100  if (is_in_sector_csc(tp_endcap, tp_sector)) {
101  if (tp_station == 1) { // ME1: 0 - 8, 9 - 17
102  selected = (tp_subsector - 1) * 9 + (tp_csc_ID - 1);
103  } else { // ME2,3,4: 18 - 26, 27 - 35, 36 - 44
104  selected = (tp_station)*9 + (tp_csc_ID - 1);
105  }
106  }
107 
108  emtf_assert(selected != -1);
109  return selected;
110 }
111 
112 bool SectorProcessorShower::is_in_sector_csc(int tp_endcap, int tp_sector) const {
113  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
114 }
int chamber() const
Definition: CSCDetId.h:62
constexpr int MIN_ENDCAP
Definition: Common.h:45
int get_index_shower(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
uint16_t getCSCID() const
Definition: CSCShowerDigi.h:35
int select_shower(const CSCDetId &, const CSCShowerDigi &) const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
int endcap() const
Definition: CSCDetId.h:85
constexpr int MIN_TRIGSECTOR
Definition: Common.h:49
void process(const CSCShowerDigiCollection &showers, l1t::RegionalMuonShowerBxCollection &out_showers) const
void configure(const edm::ParameterSet &, int endcap, int sector)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define emtf_assert(expr)
Definition: DebugTools.h:18
int triggerSector() const
Definition: CSCDetId.cc:3
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 station() const
Definition: CSCDetId.h:79
constexpr int MAX_TRIGSECTOR
Definition: Common.h:50
bool is_in_sector_csc(int tp_endcap, int tp_sector) const
DigiRangeIterator end() const
DigiRangeIterator begin() const
void push_back(int bx, T object)
A container for a generic type of digis indexed by some index, implemented with a map&lt;IndexType...