CMS 3D CMS Logo

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

#include <SectorProcessorShower.h>

Public Member Functions

void configure (const edm::ParameterSet &, int endcap, int sector)
 
void process (const CSCShowerDigiCollection &showers, l1t::RegionalMuonShowerBxCollection &out_showers) const
 
 SectorProcessorShower ()
 
 ~SectorProcessorShower ()
 

Private Member Functions

int get_index_shower (int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
 
bool is_in_sector_csc (int tp_endcap, int tp_sector) const
 
int select_shower (const CSCDetId &, const CSCShowerDigi &) const
 

Private Attributes

bool enableOneLooseShower_
 
bool enableOneNominalShower_
 
bool enableOneTightShower_
 
bool enableTwoLooseShowers_
 
int endcap_
 
int sector_
 
int verbose_
 

Detailed Description

Definition at line 22 of file SectorProcessorShower.h.

Constructor & Destructor Documentation

◆ SectorProcessorShower()

SectorProcessorShower::SectorProcessorShower ( )
inlineexplicit

Definition at line 24 of file SectorProcessorShower.h.

24 {}

◆ ~SectorProcessorShower()

SectorProcessorShower::~SectorProcessorShower ( )
inline

Definition at line 25 of file SectorProcessorShower.h.

25 {}

Member Function Documentation

◆ configure()

void SectorProcessorShower::configure ( const edm::ParameterSet pset,
int  endcap,
int  sector 
)

Definition at line 4 of file SectorProcessorShower.cc.

References emtf_assert, enableOneLooseShower_, enableOneNominalShower_, enableOneTightShower_, enableTwoLooseShowers_, makeMuonMisalignmentScenario::endcap, endcap_, emtf::MAX_ENDCAP, emtf::MAX_TRIGSECTOR, emtf::MIN_ENDCAP, emtf::MIN_TRIGSECTOR, muonDTDigis_cfi::pset, hgcalTBTopologyTester_cfi::sector, and sector_.

4  {
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 }
constexpr int MIN_ENDCAP
Definition: Common.h:45
constexpr int MIN_TRIGSECTOR
Definition: Common.h:49
#define emtf_assert(expr)
Definition: DebugTools.h:18
constexpr int MAX_ENDCAP
Definition: Common.h:46
constexpr int MAX_TRIGSECTOR
Definition: Common.h:50

◆ get_index_shower()

int SectorProcessorShower::get_index_shower ( int  tp_endcap,
int  tp_sector,
int  tp_subsector,
int  tp_station,
int  tp_csc_ID 
) const
private

Definition at line 100 of file SectorProcessorShower.cc.

References emtf_assert, and is_in_sector_csc().

Referenced by select_shower().

101  {
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 }
#define emtf_assert(expr)
Definition: DebugTools.h:18
bool is_in_sector_csc(int tp_endcap, int tp_sector) const

◆ is_in_sector_csc()

bool SectorProcessorShower::is_in_sector_csc ( int  tp_endcap,
int  tp_sector 
) const
private

Definition at line 117 of file SectorProcessorShower.cc.

References endcap_, and sector_.

Referenced by get_index_shower().

117  {
118  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
119 }

◆ process()

void SectorProcessorShower::process ( const CSCShowerDigiCollection showers,
l1t::RegionalMuonShowerBxCollection out_showers 
) const

Definition at line 17 of file SectorProcessorShower.cc.

References accept(), MuonDigiCollection< IndexType, DigiType >::begin(), simKBmtfDigis_cfi::bx, relativeConstraints::chamber, emtf_assert, l1t::emtf_neg, l1t::emtf_pos, enableOneLooseShower_, enableOneNominalShower_, enableOneTightShower_, enableTwoLooseShowers_, MuonDigiCollection< IndexType, DigiType >::end(), endcap_, CSCConstants::LCT_CENTRAL_BX, CSCConstants::MAX_CSCS_PER_EMTF_SP_NO_OVERLAP, or, AlCaHLTBitMon_ParallelJobs::p, BXVector< T >::push_back(), sector_, select_shower(), and l1t::RegionalMuonShower::setTFIdentifiers().

18  {
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 }
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
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
#define emtf_assert(expr)
Definition: DebugTools.h:18
void push_back(int bx, T object)
int select_shower(const CSCDetId &, const CSCShowerDigi &) const

◆ select_shower()

int SectorProcessorShower::select_shower ( const CSCDetId tp_detId,
const CSCShowerDigi shower 
) const
private

Definition at line 82 of file SectorProcessorShower.cc.

References CSCDetId::chamber(), CSCDetId::endcap(), get_index_shower(), CSCShowerDigi::getCSCID(), CSCDetId::station(), and CSCDetId::triggerSector().

Referenced by process().

82  {
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 }
int chamber() const
Definition: CSCDetId.h:62
uint16_t getCSCID() const
Definition: CSCShowerDigi.h:52
int station() const
Definition: CSCDetId.h:79
int endcap() const
Definition: CSCDetId.h:85
int get_index_shower(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
int triggerSector() const
Definition: CSCDetId.cc:3

Member Data Documentation

◆ enableOneLooseShower_

bool SectorProcessorShower::enableOneLooseShower_
private

Definition at line 38 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ enableOneNominalShower_

bool SectorProcessorShower::enableOneNominalShower_
private

Definition at line 40 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ enableOneTightShower_

bool SectorProcessorShower::enableOneTightShower_
private

Definition at line 42 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ enableTwoLooseShowers_

bool SectorProcessorShower::enableTwoLooseShowers_
private

Definition at line 44 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ endcap_

int SectorProcessorShower::endcap_
private

Definition at line 36 of file SectorProcessorShower.h.

Referenced by configure(), is_in_sector_csc(), and process().

◆ sector_

int SectorProcessorShower::sector_
private

Definition at line 36 of file SectorProcessorShower.h.

Referenced by configure(), is_in_sector_csc(), and process().

◆ verbose_

int SectorProcessorShower::verbose_
private

Definition at line 36 of file SectorProcessorShower.h.