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 enableOneNominalShower_
 
bool enableTwoLooseShowers_
 
int endcap_
 
unsigned nLooseShowers_
 
unsigned nNominalShowers_
 
int sector_
 
int verbose_
 

Detailed Description

Definition at line 20 of file SectorProcessorShower.h.

Constructor & Destructor Documentation

◆ SectorProcessorShower()

SectorProcessorShower::SectorProcessorShower ( )
inlineexplicit

Definition at line 22 of file SectorProcessorShower.h.

22 {}

◆ ~SectorProcessorShower()

SectorProcessorShower::~SectorProcessorShower ( )
inline

Definition at line 23 of file SectorProcessorShower.h.

23 {}

Member Function Documentation

◆ configure()

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

Definition at line 4 of file SectorProcessorShower.cc.

4  {
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 }

References emtf_assert, enableOneNominalShower_, enableTwoLooseShowers_, makeMuonMisalignmentScenario::endcap, endcap_, emtf::MAX_ENDCAP, emtf::MAX_TRIGSECTOR, emtf::MIN_ENDCAP, emtf::MIN_TRIGSECTOR, nLooseShowers_, nNominalShowers_, muonDTDigis_cfi::pset, and sector_.

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

95  {
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 }

References emtf_assert, and is_in_sector_csc().

Referenced by select_shower().

◆ is_in_sector_csc()

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

Definition at line 111 of file SectorProcessorShower.cc.

111  {
112  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
113 }

References endcap_, and sector_.

Referenced by get_index_shower().

◆ process()

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

Definition at line 17 of file SectorProcessorShower.cc.

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  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 }

References accept(), MuonDigiCollection< IndexType, DigiType >::begin(), relativeConstraints::chamber, emtf_assert, enableOneNominalShower_, enableTwoLooseShowers_, MuonDigiCollection< IndexType, DigiType >::end(), endcap_, CSCConstants::MAX_CSCS_PER_EMTF_SP_NO_OVERLAP, nLooseShowers_, nNominalShowers_, or, AlCaHLTBitMon_ParallelJobs::p, BXVector< T >::push_back(), sector_, select_shower(), l1t::RegionalMuonShower::setEndcap(), and l1t::RegionalMuonShower::setSector().

◆ select_shower()

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

Definition at line 76 of file SectorProcessorShower.cc.

76  {
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 }

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

Referenced by process().

Member Data Documentation

◆ enableOneNominalShower_

bool SectorProcessorShower::enableOneNominalShower_
private

Definition at line 35 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ enableTwoLooseShowers_

bool SectorProcessorShower::enableTwoLooseShowers_
private

Definition at line 36 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ endcap_

int SectorProcessorShower::endcap_
private

Definition at line 34 of file SectorProcessorShower.h.

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

◆ nLooseShowers_

unsigned SectorProcessorShower::nLooseShowers_
private

Definition at line 38 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ nNominalShowers_

unsigned SectorProcessorShower::nNominalShowers_
private

Definition at line 37 of file SectorProcessorShower.h.

Referenced by configure(), and process().

◆ sector_

int SectorProcessorShower::sector_
private

Definition at line 34 of file SectorProcessorShower.h.

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

◆ verbose_

int SectorProcessorShower::verbose_
private

Definition at line 34 of file SectorProcessorShower.h.

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
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
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
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
CSCDetId::triggerSector
int triggerSector() const
Definition: CSCDetId.cc:3
SectorProcessorShower::select_shower
int select_shower(const CSCDetId &, const CSCShowerDigi &) const
Definition: SectorProcessorShower.cc:76
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
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
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