CMS 3D CMS Logo

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

#include <CaloOnlineTools/EcalExclusiveTrigFilter/src/EcalExclusiveTrigFilter.cc>

Inheritance diagram for EcalExclusiveTrigFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalExclusiveTrigFilter (const edm::ParameterSet &)
 
 ~EcalExclusiveTrigFilter () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< int > l1Accepts_
 
edm::InputTag l1GTReadoutRecTag_
 
std::vector< std::string > l1Names_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 37 of file EcalExclusiveTrigFilter.h.

Constructor & Destructor Documentation

EcalExclusiveTrigFilter::EcalExclusiveTrigFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 36 of file EcalExclusiveTrigFilter.cc.

37  : l1GTReadoutRecTag_(iConfig.getUntrackedParameter<std::string>("L1GlobalReadoutRecord", "gtDigis")) {
38  //now do what ever initialization is needed
39 }
T getUntrackedParameter(std::string const &, T const &) const
EcalExclusiveTrigFilter::~EcalExclusiveTrigFilter ( )
override

Definition at line 41 of file EcalExclusiveTrigFilter.cc.

41  {
42  // do anything here that needs to be done at desctruction time
43  // (e.g. close files, deallocate resources etc.)
44 }

Member Function Documentation

bool EcalExclusiveTrigFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 51 of file EcalExclusiveTrigFilter.cc.

References L1GtPsbWord::aData(), L1GtPsbWord::bData(), gather_cfg::cout, L1GlobalTriggerReadoutRecord::decisionWord(), edm::Event::getByLabel(), L1MuGMTReadoutCollection::getRecords(), L1GlobalTriggerReadoutRecord::gtPsbWord(), mps_fire::i, edm::HandleBase::isValid(), l1Accepts_, l1GTReadoutRecTag_, l1Names_, and edm::Handle< T >::product().

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

51  {
52  // get the GMTReadoutCollection
54  iEvent.getByLabel(l1GTReadoutRecTag_, gmtrc_handle);
55  L1MuGMTReadoutCollection const* gmtrc = gmtrc_handle.product();
56  if (!(gmtrc_handle.isValid())) {
57  LogWarning("EcalExclusiveTrigFilter") << "l1MuGMTReadoutCollection"
58  << " not available";
59  //return;
60  }
61 
62  // get hold of L1GlobalReadoutRecord
64  iEvent.getByLabel(l1GTReadoutRecTag_, L1GTRR);
65  bool isEcalL1 = false;
66  const unsigned int sizeOfDecisionWord(L1GTRR->decisionWord().size());
67  if (!(L1GTRR.isValid())) {
68  LogWarning("EcalExclusiveTrigFilter") << l1GTReadoutRecTag_ << " not available";
69  //return;
70  } else if (sizeOfDecisionWord < 128) {
71  LogWarning("EcalExclusiveTrigFilter")
72  << "size of L1 decisionword is " << sizeOfDecisionWord << "; L1 Ecal triggering bits not available";
73  } else {
74  l1Names_.resize(sizeOfDecisionWord);
75  l1Accepts_.resize(sizeOfDecisionWord);
76  for (unsigned int i = 0; i != sizeOfDecisionWord; ++i) {
77  l1Accepts_[i] = 0;
78  l1Names_[i] = "NameNotAvailable";
79  }
80  for (unsigned int i = 0; i != sizeOfDecisionWord; ++i) {
81  if (L1GTRR->decisionWord()[i]) {
82  l1Accepts_[i]++;
83  //cout << "L1A bit: " << i << endl;
84  }
85  }
86 
87  if (l1Accepts_[14] || l1Accepts_[15] || l1Accepts_[16] || l1Accepts_[17] || l1Accepts_[18] || l1Accepts_[19] ||
88  l1Accepts_[20])
89  isEcalL1 = true;
90  if (l1Accepts_[73] || l1Accepts_[74] || l1Accepts_[75] || l1Accepts_[76] || l1Accepts_[77] || l1Accepts_[78])
91  isEcalL1 = true;
92  }
93 
94  bool isRPCL1 = false;
95  bool isDTL1 = false;
96  bool isCSCL1 = false;
97  bool isHCALL1 = false;
98 
99  std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
100  std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr;
101 
102  for (igmtrr = gmt_records.begin(); igmtrr != gmt_records.end(); igmtrr++) {
103  std::vector<L1MuRegionalCand>::const_iterator iter1;
104  std::vector<L1MuRegionalCand> rmc;
105 
106  //DT triggers
107  int idt = 0;
108  rmc = igmtrr->getDTBXCands();
109  for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
110  if (!(*iter1).empty()) {
111  idt++;
112  }
113  }
114 
115  //if(idt>0) std::cout << "Found " << idt << " valid DT candidates in bx wrt. L1A = "
116  // << igmtrr->getBxInEvent() << std::endl;
117  if (igmtrr->getBxInEvent() == 0 && idt > 0)
118  isDTL1 = true;
119 
120  //RPC triggers
121  int irpcb = 0;
122  rmc = igmtrr->getBrlRPCCands();
123  for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
124  if (!(*iter1).empty()) {
125  irpcb++;
126  }
127  }
128 
129  //if(irpcb>0) std::cout << "Found " << irpcb << " valid RPC candidates in bx wrt. L1A = "
130  // << igmtrr->getBxInEvent() << std::endl;
131  if (igmtrr->getBxInEvent() == 0 && irpcb > 0)
132  isRPCL1 = true;
133 
134  //CSC Triggers
135  int icsc = 0;
136  rmc = igmtrr->getCSCCands();
137  for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
138  if (!(*iter1).empty()) {
139  icsc++;
140  }
141  }
142  //if(icsc>0) std::cout << "Found " << icsc << " valid CSC candidates in bx wrt. L1A = "
143  // // << igmtrr->getBxInEvent() << std::endl;
144  if (igmtrr->getBxInEvent() == 0 && icsc > 0)
145  isCSCL1 = true;
146  }
147 
148  L1GlobalTriggerReadoutRecord const* gtrr = L1GTRR.product();
149 
150  for (int ibx = -1; ibx <= 1; ibx++) {
151  bool hcal_top = false;
152  bool hcal_bot = false;
153  const L1GtPsbWord psb = gtrr->gtPsbWord(0xbb0d, ibx);
154  std::vector<int> valid_phi;
155  if ((psb.aData(4) & 0x3f) >= 1) {
156  valid_phi.push_back((psb.aData(4) >> 10) & 0x1f);
157  }
158  if ((psb.bData(4) & 0x3f) >= 1) {
159  valid_phi.push_back((psb.bData(4) >> 10) & 0x1f);
160  }
161  if ((psb.aData(5) & 0x3f) >= 1) {
162  valid_phi.push_back((psb.aData(5) >> 10) & 0x1f);
163  }
164  if ((psb.bData(5) & 0x3f) >= 1) {
165  valid_phi.push_back((psb.bData(5) >> 10) & 0x1f);
166  }
167  std::vector<int>::const_iterator iphi;
168  for (iphi = valid_phi.begin(); iphi != valid_phi.end(); iphi++) {
169  //std::cout << "Found HCAL mip with phi=" << *iphi << " in bx wrt. L1A = " << ibx << std::endl;
170  if (*iphi < 9)
171  hcal_top = true;
172  if (*iphi > 8)
173  hcal_bot = true;
174  }
175  if (ibx == 0 && hcal_top && hcal_bot)
176  isHCALL1 = true;
177  }
178 
179  std::cout << "**** Trigger Source ****" << std::endl;
180  if (isDTL1)
181  std::cout << "DT" << std::endl;
182  if (isRPCL1)
183  std::cout << "RPC" << std::endl;
184  if (isCSCL1)
185  cout << "CSC" << endl;
186  if (isHCALL1)
187  std::cout << "HCAL" << std::endl;
188  if (isEcalL1)
189  std::cout << "ECAL" << std::endl;
190  std::cout << "************************" << std::endl;
191 
192  return (isEcalL1 && !isDTL1 && !isRPCL1 && !isCSCL1 && !isHCALL1);
193 }
const cms_uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:323
const cms_uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:228
const L1GtPsbWord gtPsbWord(cms_uint16_t boardIdValue, int bxInEventValue) const
get / set PSB word (record) in the GT readout record
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
const DecisionWord & decisionWord(int bxInEventValue) const
T const * product() const
Definition: Handle.h:74
std::vector< std::string > l1Names_
std::vector< L1MuGMTReadoutRecord > const & getRecords() const

Member Data Documentation

std::vector<int> EcalExclusiveTrigFilter::l1Accepts_
private

Definition at line 47 of file EcalExclusiveTrigFilter.h.

Referenced by filter().

edm::InputTag EcalExclusiveTrigFilter::l1GTReadoutRecTag_
private

Definition at line 46 of file EcalExclusiveTrigFilter.h.

Referenced by filter().

std::vector<std::string> EcalExclusiveTrigFilter::l1Names_
private

Definition at line 48 of file EcalExclusiveTrigFilter.h.

Referenced by filter().