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 97 of file SectorProcessorShower.cc.

References emtf_assert, and is_in_sector_csc().

Referenced by select_shower().

98  {
99  int selected = -1;
100 
101  // shower trigger does not considers overlaps
102  if (is_in_sector_csc(tp_endcap, tp_sector)) {
103  if (tp_station == 1) { // ME1: 0 - 8, 9 - 17
104  selected = (tp_subsector - 1) * 9 + (tp_csc_ID - 1);
105  } else { // ME2,3,4: 18 - 26, 27 - 35, 36 - 44
106  selected = (tp_station)*9 + (tp_csc_ID - 1);
107  }
108  }
109 
110  emtf_assert(selected != -1);
111  return selected;
112 }
#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 114 of file SectorProcessorShower.cc.

References endcap_, and sector_.

Referenced by get_index_shower().

114  {
115  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
116 }

◆ 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(), relativeConstraints::chamber, emtf_assert, l1t::emtf_neg, l1t::emtf_pos, enableOneLooseShower_, enableOneNominalShower_, enableOneTightShower_, enableTwoLooseShowers_, MuonDigiCollection< IndexType, DigiType >::end(), endcap_, 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  // 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  // Updated shower recognition logic: at least one loose shower (starting April 2023)
47  const unsigned nLooseInTime(std::count_if(
48  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isLooseInTime(); }));
49  const unsigned nNominalInTime(std::count_if(
50  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isNominalInTime(); }));
51  const unsigned nTightInTime(std::count_if(
52  selected_showers.begin(), selected_showers.end(), [](CSCShowerDigi p) { return p.isTightInTime(); }));
53 
54  const bool hasOneLooseInTime(nLooseInTime >= 1);
55  const bool hasTwoLooseInTime(nLooseInTime >= 2);
56  const bool hasOneNominalInTime(nNominalInTime >= 1);
57  const bool hasOneTightInTime(nTightInTime >= 1);
58 
59  // for startup Run-3 we're not considering out of time triggers
60  const bool acceptLoose(enableOneLooseShower_ and hasOneLooseInTime);
61  const bool acceptTwoLoose(enableTwoLooseShowers_ and hasTwoLooseInTime);
62  const bool acceptNominal(enableOneNominalShower_ and hasOneNominalInTime);
63  const bool acceptTight(enableOneTightShower_ and hasOneTightInTime);
64 
65  // trigger condition
66  const bool accept(acceptLoose or acceptTwoLoose or acceptNominal or acceptTight);
67 
68  if (accept) {
69  // shower output
70  l1t::RegionalMuonShower out_shower(
71  hasOneNominalInTime, false, hasTwoLooseInTime, false, hasOneLooseInTime, hasOneTightInTime, false);
73  out_shower.setTFIdentifiers(sector_ - 1, tftype);
74  out_showers.push_back(0, out_shower);
75  }
76 }
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 79 of file SectorProcessorShower.cc.

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

Referenced by process().

79  {
80  int selected = -1;
81 
82  int tp_endcap = tp_detId.endcap();
83  int tp_sector = tp_detId.triggerSector();
84  int tp_station = tp_detId.station();
85  int tp_chamber = tp_detId.chamber();
86  int tp_csc_ID = shower.getCSCID();
87 
88  // station 1 --> subsector 1 or 2
89  // station 2,3,4 --> subsector 0
90  int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
91 
92  // Check if the chamber belongs to this sector processor at this BX.
93  selected = get_index_shower(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID);
94  return selected;
95 }
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.