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
HLTLevel1Activity Class Reference
Inheritance diagram for HLTLevel1Activity:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 HLTLevel1Activity (const edm::ParameterSet &)
 
 ~HLTLevel1Activity ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

std::vector< int > m_bunchCrossings
 
unsigned int m_daqPartitions
 
edm::InputTag m_gtReadoutRecord
 
bool m_ignoreL1Mask
 
bool m_invert
 
std::vector< bool > m_maskedPhysics
 
std::vector< bool > m_maskedTechnical
 
std::vector< bool > m_selectPhysics
 
std::vector< bool > m_selectTechnical
 
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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

This class is an EDFilter that checks if there was any L1 activity It can be configured to

Date:
2012/01/23 00:13:18
Revision:
1.15
Author
Andrea Bocci

Definition at line 39 of file HLTLevel1Activity.cc.

Constructor & Destructor Documentation

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

Definition at line 72 of file HLTLevel1Activity.cc.

References edm::ParameterSet::getParameter(), i, m_maskedPhysics, m_maskedTechnical, m_selectPhysics, and m_selectTechnical.

72  :
73  m_gtReadoutRecord( config.getParameter<edm::InputTag> ("L1GtReadoutRecordTag") ),
74  m_bunchCrossings( config.getParameter<std::vector<int> > ("bunchCrossings") ),
79  m_daqPartitions( config.getParameter<unsigned int> ("daqPartitions") ),
80  m_ignoreL1Mask( config.getParameter<bool> ("ignoreL1Mask") ),
81  m_invert( config.getParameter<bool> ("invert") )
82 {
83  unsigned long long low = config.getParameter<unsigned long long>("physicsLoBits");
84  unsigned long long high = config.getParameter<unsigned long long>("physicsHiBits");
85  unsigned long long tech = config.getParameter<unsigned long long>("technicalBits");
86  for (unsigned int i = 0; i < 64; i++) {
87  m_selectPhysics[i] = low & (0x01ULL << (unsigned long long) i);
88  m_maskedPhysics[i] = low & (0x01ULL << (unsigned long long) i);
89  }
90  for (unsigned int i = 0; i < 64; i++) {
91  m_selectPhysics[i+64] = high & (0x01ULL << (unsigned long long) i);
92  m_maskedPhysics[i+64] = high & (0x01ULL << (unsigned long long) i);
93  }
94  for (unsigned int i = 0; i < 64; i++) {
95  m_selectTechnical[i] = tech & (0x01ULL << (unsigned long long) i);
96  m_maskedTechnical[i] = tech & (0x01ULL << (unsigned long long) i);
97  }
98 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
unsigned int m_daqPartitions
std::vector< bool > m_selectTechnical
#define TECHNICAL_BITS_SIZE
std::vector< bool > m_selectPhysics
edm::InputTag m_gtReadoutRecord
std::vector< bool > m_maskedPhysics
#define PHYSICS_BITS_SIZE
std::vector< int > m_bunchCrossings
std::vector< bool > m_maskedTechnical
HLTLevel1Activity::~HLTLevel1Activity ( )

Definition at line 100 of file HLTLevel1Activity.cc.

101 {
102 }

Member Function Documentation

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

Definition at line 105 of file HLTLevel1Activity.cc.

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

105  {
107  desc.add<edm::InputTag>("L1GtReadoutRecordTag",edm::InputTag("hltGtDigis"));
108  {
109  std::vector<int> temp1;
110  temp1.reserve(3);
111  temp1.push_back(0);
112  temp1.push_back(-1);
113  temp1.push_back(1);
114  desc.add<std::vector<int> >("bunchCrossings",temp1);
115  }
116  desc.add<unsigned int>("daqPartitions",1);
117  desc.add<bool>("ignoreL1Mask",false);
118  desc.add<bool>("invert",false);
119  desc.add<unsigned long long int>("physicsLoBits",1);
120  desc.add<unsigned long long int>("physicsHiBits",262144);
121  desc.add<unsigned long long int>("technicalBits",1);
122  descriptions.add("hltLevel1Activity",desc);
123 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTLevel1Activity::filter ( edm::Event event,
const edm::EventSetup setup 
)
virtual

Implements edm::EDFilter.

Definition at line 131 of file HLTLevel1Activity.cc.

References edm::ESWatcher< T >::check(), edm::EventSetup::get(), i, m_bunchCrossings, m_daqPartitions, m_gtReadoutRecord, m_ignoreL1Mask, m_invert, m_maskedPhysics, m_maskedTechnical, m_selectPhysics, m_selectTechnical, m_watchPhysicsMask, m_watchTechnicalMask, PHYSICS_BITS_SIZE, and TECHNICAL_BITS_SIZE.

132 {
133  // apply L1 mask to the physics bits
134  // - mask & partition == part. --> fully masked
135  // - mask & partition == 0x00 --> fully unmasked
136  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
137  if (not m_ignoreL1Mask and m_watchPhysicsMask.check(setup)) {
139  setup.get<L1GtTriggerMaskAlgoTrigRcd>().get(h_mask);
140  const std::vector<unsigned int> & mask = h_mask->gtTriggerMask();
141  for (unsigned int i = 0; i < PHYSICS_BITS_SIZE; ++i)
142  m_maskedPhysics[i] = m_selectPhysics[i] and ((mask[i] & m_daqPartitions) != m_daqPartitions);
143  }
144 
145  // apply L1 mask to the technical bits
146  // - mask & partition == part. --> fully masked
147  // - mask & partition == 0x00 --> fully unmasked
148  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
149  if (not m_ignoreL1Mask and m_watchTechnicalMask.check(setup)) {
151  setup.get<L1GtTriggerMaskTechTrigRcd>().get(h_mask);
152  const std::vector<unsigned int> & mask = h_mask->gtTriggerMask();
153  for (unsigned int i = 0; i < TECHNICAL_BITS_SIZE; ++i)
154  m_maskedTechnical[i] = m_selectTechnical[i] and ((mask[i] & m_daqPartitions) != m_daqPartitions);
155  }
156 
157  // access the L1 decisions
159  event.getByLabel(m_gtReadoutRecord, h_gtReadoutRecord);
160 
161  // compare the results with the requested bits, and return true as soon as the first match is found
162  BOOST_FOREACH(int bx, m_bunchCrossings) {
163  const std::vector<bool> & physics = h_gtReadoutRecord->decisionWord(bx);
164  if (physics.size() != PHYSICS_BITS_SIZE)
165  // error in L1 results
166  return m_invert;
167  for (unsigned int i = 0; i < PHYSICS_BITS_SIZE; ++i)
168  if (m_maskedPhysics[i] and physics[i])
169  return not m_invert;
170  const std::vector<bool> & technical = h_gtReadoutRecord->technicalTriggerWord(bx);
171  if (technical.size() != TECHNICAL_BITS_SIZE)
172  // error in L1 results
173  return m_invert;
174  for (unsigned int i = 0; i < TECHNICAL_BITS_SIZE; ++i)
175  if (m_maskedTechnical[i] and technical[i])
176  return not m_invert;
177  }
178 
179  return m_invert;
180 }
int i
Definition: DBlmapReader.cc:9
unsigned int m_daqPartitions
edm::ESWatcher< L1GtTriggerMaskAlgoTrigRcd > m_watchPhysicsMask
std::vector< bool > m_selectTechnical
#define TECHNICAL_BITS_SIZE
std::vector< bool > m_selectPhysics
edm::InputTag m_gtReadoutRecord
std::vector< bool > m_maskedPhysics
#define PHYSICS_BITS_SIZE
const T & get() const
Definition: EventSetup.h:55
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
std::vector< int > m_bunchCrossings
edm::ESWatcher< L1GtTriggerMaskTechTrigRcd > m_watchTechnicalMask
std::vector< bool > m_maskedTechnical

Member Data Documentation

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

Definition at line 48 of file HLTLevel1Activity.cc.

Referenced by filter().

unsigned int HLTLevel1Activity::m_daqPartitions
private

Definition at line 53 of file HLTLevel1Activity.cc.

Referenced by filter().

edm::InputTag HLTLevel1Activity::m_gtReadoutRecord
private

Definition at line 47 of file HLTLevel1Activity.cc.

Referenced by filter().

bool HLTLevel1Activity::m_ignoreL1Mask
private

Definition at line 54 of file HLTLevel1Activity.cc.

Referenced by filter().

bool HLTLevel1Activity::m_invert
private

Definition at line 55 of file HLTLevel1Activity.cc.

Referenced by filter().

std::vector<bool> HLTLevel1Activity::m_maskedPhysics
private

Definition at line 51 of file HLTLevel1Activity.cc.

Referenced by filter(), and HLTLevel1Activity().

std::vector<bool> HLTLevel1Activity::m_maskedTechnical
private

Definition at line 52 of file HLTLevel1Activity.cc.

Referenced by filter(), and HLTLevel1Activity().

std::vector<bool> HLTLevel1Activity::m_selectPhysics
private

Definition at line 49 of file HLTLevel1Activity.cc.

Referenced by filter(), and HLTLevel1Activity().

std::vector<bool> HLTLevel1Activity::m_selectTechnical
private

Definition at line 50 of file HLTLevel1Activity.cc.

Referenced by filter(), and HLTLevel1Activity().

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

Definition at line 57 of file HLTLevel1Activity.cc.

Referenced by filter().

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

Definition at line 58 of file HLTLevel1Activity.cc.

Referenced by filter().