CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTLevel1Pattern Class Reference
Inheritance diagram for HLTLevel1Pattern:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 HLTLevel1Pattern (const edm::ParameterSet &)
 
 ~HLTLevel1Pattern ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter ()
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Attributes

std::vector< int > m_bunchCrossings
 
unsigned int m_daqPartitions
 
edm::InputTag m_gtReadoutRecord
 
bool m_ignoreL1Mask
 
bool m_invert
 
bool m_throw
 
bool m_triggerAlgo
 
std::string m_triggerBit
 
bool m_triggerMasked
 
unsigned int m_triggerNumber
 
std::vector< int > m_triggerPattern
 
edm::ESWatcher
< L1GtTriggerMenuRcd
m_watchL1Menu
 
edm::ESWatcher
< L1GtTriggerMaskAlgoTrigRcd
m_watchPhysicsMask
 
edm::ESWatcher
< L1GtTriggerMaskTechTrigRcd
m_watchTechnicalMask
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

This class is an HLTFilter (-> EDFilter) that checks for a specific pattern of L1 accept/reject in 5 BX's for a given L1 bit It can be configured to use or ignore the L1 trigger mask

Date:
2011/02/23 17:03:00
Revision:
1.6
Author
Andrea Bocci

Definition at line 33 of file HLTLevel1Pattern.cc.

Constructor & Destructor Documentation

HLTLevel1Pattern::HLTLevel1Pattern ( const edm::ParameterSet config)
explicit

Definition at line 70 of file HLTLevel1Pattern.cc.

References edm::ParameterSet::getParameter(), i, m_bunchCrossings, m_triggerPattern, and listBenchmarks::pattern.

70  :
71  m_gtReadoutRecord( config.getParameter<edm::InputTag> ("L1GtReadoutRecordTag") ),
72  m_triggerBit( config.getParameter<std::string> ("triggerBit") ),
73  m_bunchCrossings( config.getParameter<std::vector<int> > ("bunchCrossings") ),
75  m_daqPartitions( config.getParameter<unsigned int> ("daqPartitions") ),
76  m_triggerNumber( 0 ),
77  m_triggerAlgo( true ),
78  m_triggerMasked( false ),
79  m_ignoreL1Mask( config.getParameter<bool> ("ignoreL1Mask") ),
80  m_invert( config.getParameter<bool> ("invert") ),
81  m_throw ( config.getParameter<bool> ("throw" ) )
82 {
83  std::vector<int> pattern( config.getParameter<std::vector<int> > ("triggerPattern") );
84  if (pattern.size() != m_bunchCrossings.size())
85  throw cms::Exception("Configuration") << "\"bunchCrossings\" and \"triggerPattern\" parameters do not match";
86 
87  for (unsigned int i = 0; i < pattern.size(); ++i)
88  m_triggerPattern[i] = (bool) pattern[i];
89 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::string m_triggerBit
edm::InputTag m_gtReadoutRecord
std::vector< int > m_bunchCrossings
unsigned int m_triggerNumber
unsigned int m_daqPartitions
std::vector< int > m_triggerPattern
HLTLevel1Pattern::~HLTLevel1Pattern ( )

Definition at line 91 of file HLTLevel1Pattern.cc.

92 {
93 }

Member Function Documentation

void HLTLevel1Pattern::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 96 of file HLTLevel1Pattern.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

96  {
98  desc.add<edm::InputTag>("L1GtReadoutRecordTag",edm::InputTag("hltGtDigis"));
99  desc.add<std::string>("triggerBit","L1Tech_RPC_TTU_pointing_Cosmics.v0");
100  {
101  std::vector<int> temp1;
102  temp1.reserve(5);
103  temp1.push_back(-2);
104  temp1.push_back(-1);
105  temp1.push_back(0);
106  temp1.push_back(1);
107  temp1.push_back(2);
108  desc.add<std::vector<int> >("bunchCrossings",temp1);
109  }
110  desc.add<unsigned int>("daqPartitions",1);
111  desc.add<bool>("ignoreL1Mask",false);
112  desc.add<bool>("invert",false);
113  desc.add<bool>("throw",true);
114  {
115  std::vector<int> temp1;
116  temp1.reserve(5);
117  temp1.push_back(1);
118  temp1.push_back(1);
119  temp1.push_back(1);
120  temp1.push_back(0);
121  temp1.push_back(0);
122  desc.add<std::vector<int> >("triggerPattern",temp1);
123  }
124  descriptions.add("hltLevel1Pattern",desc);
125 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTLevel1Pattern::filter ( edm::Event event,
const edm::EventSetup setup 
)
virtual

Implements HLTFilter.

Definition at line 133 of file HLTLevel1Pattern.cc.

References edm::ESWatcher< T >::check(), edm::hlt::Exception, edm::EventSetup::get(), i, m_bunchCrossings, m_daqPartitions, m_gtReadoutRecord, m_ignoreL1Mask, m_invert, m_throw, m_triggerAlgo, m_triggerBit, m_triggerMasked, m_triggerNumber, m_triggerPattern, m_watchL1Menu, m_watchPhysicsMask, m_watchTechnicalMask, or, and query::result.

134 {
135  // determine the L1 algo or tech bit to use
136  if (m_watchL1Menu.check(setup)) {
138  setup.get<L1GtTriggerMenuRcd>().get(h_menu);
139 
140  // look for an Algo L1 bit
141  const AlgorithmMap & algoMap = h_menu->gtAlgorithmAliasMap();
142  const AlgorithmMap & techMap = h_menu->gtTechnicalTriggerMap();
143  AlgorithmMap::const_iterator entry;
144  if ((entry = algoMap.find(m_triggerBit)) != algoMap.end()) {
145  m_triggerAlgo = true;
146  m_triggerNumber = entry->second.algoBitNumber();
147  } else
148  if ((entry = techMap.find(m_triggerBit)) != techMap.end()) {
149  m_triggerAlgo = false;
150  m_triggerNumber = entry->second.algoBitNumber();
151  } else {
152  if (m_throw) {
153  throw cms::Exception("Configuration") << "requested L1 trigger \"" << m_triggerBit << "\" does not exist in the current L1 menu";
154  } else {
155  return m_invert;
156  }
157  }
158  }
159 
160  if (m_triggerAlgo) {
161  // check the L1 algorithms mask
162  // - mask & partition == part. --> fully masked
163  // - mask & partition == 0x00 --> fully unmasked
164  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
165  if (m_watchPhysicsMask.check(setup)) {
167  setup.get<L1GtTriggerMaskAlgoTrigRcd>().get(h_mask);
168  m_triggerMasked = ((h_mask->gtTriggerMask()[m_triggerNumber] & m_daqPartitions) == m_daqPartitions);
169  }
170  } else {
171  // check the L1 technical triggers mask
172  // - mask & partition == part. --> fully masked
173  // - mask & partition == 0x00 --> fully unmasked
174  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
175  if (m_watchTechnicalMask.check(setup)) {
177  setup.get<L1GtTriggerMaskTechTrigRcd>().get(h_mask);
178  m_triggerMasked = ((h_mask->gtTriggerMask()[m_triggerNumber] & m_daqPartitions) == m_daqPartitions);
179  }
180  }
181 
182  // is the L1 trigger masked ?
183  if (not m_ignoreL1Mask and m_triggerMasked)
184  return m_invert;
185 
186  // access the L1 decisions
188  event.getByLabel(m_gtReadoutRecord, h_gtReadoutRecord);
189 
190  // check the L1 algorithms results
191  for (unsigned int i = 0; i < m_bunchCrossings.size(); ++i) {
192  int bx = m_bunchCrossings[i];
193  const std::vector<bool> & word = (m_triggerAlgo) ? h_gtReadoutRecord->decisionWord(bx) : h_gtReadoutRecord->technicalTriggerWord(bx);
194  if (word.empty() or m_triggerNumber >= word.size())
195  // L1 results not available, bail out
196  return m_invert;
197  bool result = word[m_triggerNumber];
198  if (result != m_triggerPattern[i])
199  // comparison failed, bail out
200  return m_invert;
201  }
202 
203  // comparison successful
204  return not m_invert;
205 }
int i
Definition: DBlmapReader.cc:9
std::string m_triggerBit
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
edm::InputTag m_gtReadoutRecord
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
edm::ESWatcher< L1GtTriggerMaskTechTrigRcd > m_watchTechnicalMask
std::vector< int > m_bunchCrossings
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
tuple result
Definition: query.py:137
unsigned int m_triggerNumber
edm::ESWatcher< L1GtTriggerMenuRcd > m_watchL1Menu
const T & get() const
Definition: EventSetup.h:55
unsigned int m_daqPartitions
std::vector< int > m_triggerPattern
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
edm::ESWatcher< L1GtTriggerMaskAlgoTrigRcd > m_watchPhysicsMask

Member Data Documentation

std::vector<int> HLTLevel1Pattern::m_bunchCrossings
private

Definition at line 43 of file HLTLevel1Pattern.cc.

Referenced by filter(), and HLTLevel1Pattern().

unsigned int HLTLevel1Pattern::m_daqPartitions
private

Definition at line 45 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::InputTag HLTLevel1Pattern::m_gtReadoutRecord
private

Definition at line 41 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_ignoreL1Mask
private

Definition at line 49 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_invert
private

Definition at line 50 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_throw
private

Definition at line 51 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_triggerAlgo
private

Definition at line 47 of file HLTLevel1Pattern.cc.

Referenced by filter().

std::string HLTLevel1Pattern::m_triggerBit
private

Definition at line 42 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_triggerMasked
private

Definition at line 48 of file HLTLevel1Pattern.cc.

Referenced by filter().

unsigned int HLTLevel1Pattern::m_triggerNumber
private

Definition at line 46 of file HLTLevel1Pattern.cc.

Referenced by filter().

std::vector<int> HLTLevel1Pattern::m_triggerPattern
private

Definition at line 44 of file HLTLevel1Pattern.cc.

Referenced by filter(), and HLTLevel1Pattern().

edm::ESWatcher<L1GtTriggerMenuRcd> HLTLevel1Pattern::m_watchL1Menu
private

Definition at line 53 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::ESWatcher<L1GtTriggerMaskAlgoTrigRcd> HLTLevel1Pattern::m_watchPhysicsMask
private

Definition at line 54 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::ESWatcher<L1GtTriggerMaskTechTrigRcd> HLTLevel1Pattern::m_watchTechnicalMask
private

Definition at line 55 of file HLTLevel1Pattern.cc.

Referenced by filter().