CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 enableOneTightShower_
 
bool enableTwoLooseShowers_
 
int endcap_
 
unsigned nLooseShowers_
 
unsigned nNominalShowers_
 
unsigned nTightShowers_
 
int sector_
 
int verbose_
 

Detailed Description

Definition at line 22 of file SectorProcessorShower.h.

Constructor & Destructor Documentation

SectorProcessorShower::SectorProcessorShower ( )
inlineexplicit

Definition at line 24 of file SectorProcessorShower.h.

24 {}
SectorProcessorShower::~SectorProcessorShower ( )
inline

Definition at line 25 of file SectorProcessorShower.h.

25 {}

Member Function Documentation

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

Definition at line 4 of file SectorProcessorShower.cc.

References emtf_assert, enableOneNominalShower_, enableOneTightShower_, enableTwoLooseShowers_, Reference_intrackfit_cff::endcap, endcap_, edm::ParameterSet::getParameter(), emtf::MAX_ENDCAP, emtf::MAX_TRIGSECTOR, emtf::MIN_ENDCAP, emtf::MIN_TRIGSECTOR, nLooseShowers_, nNominalShowers_, nTightShowers_, and sector_.

4  {
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 }
constexpr int MIN_ENDCAP
Definition: Common.h:45
constexpr int MIN_TRIGSECTOR
Definition: Common.h:49
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define emtf_assert(expr)
Definition: DebugTools.h:18
constexpr int MAX_ENDCAP
Definition: Common.h:46
constexpr int MAX_TRIGSECTOR
Definition: Common.h:50
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 95 of file SectorProcessorShower.cc.

References emtf_assert, and is_in_sector_csc().

Referenced by select_shower().

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

Definition at line 112 of file SectorProcessorShower.cc.

References endcap_, and sector_.

Referenced by get_index_shower().

112  {
113  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
114 }
void SectorProcessorShower::process ( const CSCShowerDigiCollection showers,
l1t::RegionalMuonShowerBxCollection out_showers 
) const

Definition at line 19 of file SectorProcessorShower.cc.

References accept(), MuonDigiCollection< IndexType, DigiType >::begin(), emtf_assert, l1t::emtf_neg, l1t::emtf_pos, enableOneNominalShower_, enableOneTightShower_, enableTwoLooseShowers_, MuonDigiCollection< IndexType, DigiType >::end(), endcap_, CSCConstants::MAX_CSCS_PER_EMTF_SP_NO_OVERLAP, nLooseShowers_, nNominalShowers_, nTightShowers_, or, AlCaHLTBitMon_ParallelJobs::p, BXVector< T >::push_back(), sector_, select_shower(), and l1t::RegionalMuonShower::setTFIdentifiers().

20  {
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_, tftype);
72  out_showers.push_back(0, out_shower);
73  }
74 }
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
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
#define emtf_assert(expr)
Definition: DebugTools.h:18
void push_back(int bx, T object)
int SectorProcessorShower::select_shower ( const CSCDetId tp_detId,
const CSCShowerDigi shower 
) const
private

Definition at line 77 of file SectorProcessorShower.cc.

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

Referenced by process().

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

Member Data Documentation

bool SectorProcessorShower::enableOneNominalShower_
private

Definition at line 38 of file SectorProcessorShower.h.

Referenced by configure(), and process().

bool SectorProcessorShower::enableOneTightShower_
private

Definition at line 40 of file SectorProcessorShower.h.

Referenced by configure(), and process().

bool SectorProcessorShower::enableTwoLooseShowers_
private

Definition at line 42 of file SectorProcessorShower.h.

Referenced by configure(), and process().

int SectorProcessorShower::endcap_
private

Definition at line 36 of file SectorProcessorShower.h.

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

unsigned SectorProcessorShower::nLooseShowers_
private

Definition at line 45 of file SectorProcessorShower.h.

Referenced by configure(), and process().

unsigned SectorProcessorShower::nNominalShowers_
private

Definition at line 43 of file SectorProcessorShower.h.

Referenced by configure(), and process().

unsigned SectorProcessorShower::nTightShowers_
private

Definition at line 44 of file SectorProcessorShower.h.

Referenced by configure(), and process().

int SectorProcessorShower::sector_
private

Definition at line 36 of file SectorProcessorShower.h.

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

int SectorProcessorShower::verbose_
private

Definition at line 36 of file SectorProcessorShower.h.