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
PhysDecl Class Reference

#include <PhysDecl.h>

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

Public Member Functions

 PhysDecl (const edm::ParameterSet &)
 
 ~PhysDecl ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
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 ()
 
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
 
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 &) override
 

Private Attributes

bool applyfilter
 
bool debugOn
 
std::vector< std::string > hlNames_
 
edm::InputTag hlTriggerResults_
 
bool init_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::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

Definition at line 33 of file PhysDecl.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file PhysDecl.cc.

References bsc_activity_cfg::applyfilter, GOODCOLL_filter_cfg::debugOn, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

34 {
35  applyfilter = iConfig.getUntrackedParameter<bool>("applyfilter",true);
36  debugOn = iConfig.getUntrackedParameter<bool>("debugOn",false);
37  hlTriggerResults_ = iConfig.getParameter<edm::InputTag> ("HLTriggerResults");
38  init_ = false;
39 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool applyfilter
Definition: PhysDecl.h:41
bool init_
Definition: PhysDecl.h:43
bool debugOn
Definition: PhysDecl.h:42
edm::InputTag hlTriggerResults_
Definition: PhysDecl.h:45
PhysDecl::~PhysDecl ( )

Definition at line 41 of file PhysDecl.cc.

42 {
43 }

Member Function Documentation

bool PhysDecl::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 45 of file PhysDecl.cc.

References bsc_activity_cfg::applyfilter, edm::EventBase::bunchCrossing(), gather_cfg::cout, GOODCOLL_filter_cfg::debugOn, edm::EventID::event(), edm::Event::getByLabel(), L1GlobalTriggerReadoutRecord::gtFdlWord(), i, edm::EventBase::id(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), n, L1GtFdlWord::physicsDeclared(), edm::Handle< T >::product(), edm::EventID::run(), edm::TriggerNames::triggerNames(), and edm::Event::triggerNames().

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().

46 {
47 
48  bool accepted = false;
49 
50  int ievt = iEvent.id().event();
51  int irun = iEvent.id().run();
52  int ils = iEvent.luminosityBlock();
53  int bx = iEvent.bunchCrossing();
54 
55 
56  //hlt info
58  iEvent.getByLabel(hlTriggerResults_,HLTR);
59 
60  if(HLTR.isValid())
61  {
62  if (!init_) {
63  init_=true;
64  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*HLTR);
65  hlNames_=triggerNames.triggerNames();
66  }
67  if(debugOn)
68  {
69  std::cout << "HLT_debug: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Acc: " ;
70  const unsigned int n(hlNames_.size());
71  for (unsigned int i=0; i!=n; ++i)
72  {
73  if (HLTR->accept(i))
74  {
75  std::cout << hlNames_[i] << ",";
76  }
77  }
78  std::cout << std::endl;
79  }
80 
81  }
82 
83  // trigger info
84 
86  iEvent.getByLabel("gtDigis", gtrr_handle);
87  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
88 
89  L1GtFdlWord fdlWord = gtrr->gtFdlWord();
90  // std::cout << "phys decl. bit=" << fdlWord.physicsDeclared() << std::endl;
91  if (fdlWord.physicsDeclared() ==1) accepted=true;
92 
93 
94  if (debugOn) {
95 
96  std::cout << "PhysDecl_debug: Run " << irun << " Event " << ievt << " Lumi Block " << ils << " Bunch Crossing " << bx << " Accepted " << accepted << std::endl;
97  }
98 
99  if (applyfilter)
100  return accepted;
101  else
102  return true;
103 
104 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:199
std::vector< std::string > hlNames_
Definition: PhysDecl.h:44
bool applyfilter
Definition: PhysDecl.h:41
int bunchCrossing() const
Definition: EventBase.h:62
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
bool init_
Definition: PhysDecl.h:43
bool debugOn
Definition: PhysDecl.h:42
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
T const * product() const
Definition: Handle.h:81
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
const cms_uint16_t physicsDeclared() const
get/set &quot;physics declared&quot; bit
Definition: L1GtFdlWord.h:227
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:121
edm::InputTag hlTriggerResults_
Definition: PhysDecl.h:45

Member Data Documentation

bool PhysDecl::applyfilter
private

Definition at line 41 of file PhysDecl.h.

bool PhysDecl::debugOn
private

Definition at line 42 of file PhysDecl.h.

std::vector<std::string> PhysDecl::hlNames_
private

Definition at line 44 of file PhysDecl.h.

edm::InputTag PhysDecl::hlTriggerResults_
private

Definition at line 45 of file PhysDecl.h.

bool PhysDecl::init_
private

Definition at line 43 of file PhysDecl.h.