CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

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
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 &)
 
- 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 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 38 of file EcalExclusiveTrigFilter.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file EcalExclusiveTrigFilter.cc.

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

Definition at line 44 of file EcalExclusiveTrigFilter.cc.

45 {
46 
47  // do anything here that needs to be done at desctruction time
48  // (e.g. close files, deallocate resources etc.)
49 
50 }

Member Function Documentation

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

Implements edm::EDFilter.

Definition at line 59 of file EcalExclusiveTrigFilter.cc.

References L1GtPsbWord::aData(), L1GtPsbWord::bData(), gather_cfg::cout, edm::Event::getByLabel(), L1MuGMTReadoutCollection::getRecords(), L1GlobalTriggerReadoutRecord::gtPsbWord(), 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().

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

Member Data Documentation

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

Definition at line 48 of file EcalExclusiveTrigFilter.h.

Referenced by filter().

edm::InputTag EcalExclusiveTrigFilter::l1GTReadoutRecTag_
private

Definition at line 47 of file EcalExclusiveTrigFilter.h.

Referenced by filter().

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

Definition at line 49 of file EcalExclusiveTrigFilter.h.

Referenced by filter().