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

#include <ECALActivity.h>

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

Public Member Functions

 ECALActivity (const edm::ParameterSet &)
 
 ~ECALActivity ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 &) override
 

Private Attributes

bool applyfilter
 
int EBnum
 
edm::InputTag EBRecHitCollection_
 
double EBthresh
 
int EEnum
 
edm::InputTag EERecHitCollection_
 
double EEthresh
 
int ETOTnum
 
double ETOTthresh
 

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

Definition at line 33 of file ECALActivity.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file ECALActivity.cc.

References bsc_activity_cfg::applyfilter, bsc_activity_cfg::EBnum, bsc_activity_cfg::EBthresh, bsc_activity_cfg::EEnum, bsc_activity_cfg::EEthresh, bsc_activity_cfg::ETOTnum, bsc_activity_cfg::ETOTthresh, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

34 {
35  EBRecHitCollection_ = iConfig.getParameter<edm::InputTag>("ebrechitcollection");
36  EERecHitCollection_ = iConfig.getParameter<edm::InputTag>("ebrechitcollection");
37 
38  EBnum=iConfig.getUntrackedParameter<int>("EBnum");
39  EBthresh=iConfig.getUntrackedParameter<double>("EBthresh");
40  EEnum=iConfig.getUntrackedParameter<int>("EEnum");
41  EEthresh=iConfig.getUntrackedParameter<double>("EEthresh");
42  ETOTnum=iConfig.getUntrackedParameter<int>("ETOTnum");
43  ETOTthresh=iConfig.getUntrackedParameter<double>("ETOTthresh");
44  applyfilter = iConfig.getUntrackedParameter<bool>("applyfilter",true);
45 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double EBthresh
Definition: ECALActivity.h:45
edm::InputTag EBRecHitCollection_
Definition: ECALActivity.h:41
bool applyfilter
Definition: ECALActivity.h:50
double EEthresh
Definition: ECALActivity.h:47
edm::InputTag EERecHitCollection_
Definition: ECALActivity.h:42
double ETOTthresh
Definition: ECALActivity.h:49
ECALActivity::~ECALActivity ( )

Definition at line 47 of file ECALActivity.cc.

48 {
49 }

Member Function Documentation

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

Implements edm::EDFilter.

Definition at line 51 of file ECALActivity.cc.

References bsc_activity_cfg::applyfilter, edm::SortedCollection< T, SORT >::begin(), bsc_activity_cfg::EBnum, egHLT::errCodes::EBRecHits, bsc_activity_cfg::EBthresh, bsc_activity_cfg::EEnum, egHLT::errCodes::EERecHits, bsc_activity_cfg::EEthresh, edm::SortedCollection< T, SORT >::end(), bsc_activity_cfg::ETOTnum, bsc_activity_cfg::ETOTthresh, edm::Event::getByLabel(), edm::HandleBase::isValid(), 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().

52 {
53  bool accepted = false;
54  bool eb= false;
55  bool ee= false;
56  bool etot= false;
57 
58  //int ievt = iEvent.id().event();
59  //int irun = iEvent.id().run();
60  //int ils = iEvent.luminosityBlock();
61 
62  int ebabovethresh=0;
63  int eeabovethresh=0;
64  int etotabovethresh=0;
65 
66 
69 
70  const EBRecHitCollection* EBRecHits = 0;
71  const EERecHitCollection* EERecHits = 0;
72 
73  if ( EBRecHitCollection_.label() != "" && EBRecHitCollection_.instance() != "" )
74  {
75  iEvent.getByLabel( EBRecHitCollection_, pEBRecHits);
76  if ( pEBRecHits.isValid() )
77  {
78  EBRecHits = pEBRecHits.product(); // get a ptr to the product
79  }
80  else
81  {
82  edm::LogError("EcalRecHitError") << "Error! can't get the product " << EBRecHitCollection_.label() ;
83  }
84  }
85 
86  if ( EERecHitCollection_.label() != "" && EERecHitCollection_.instance() != "" )
87  {
88  iEvent.getByLabel( EERecHitCollection_, pEERecHits);
89 
90  if ( pEERecHits.isValid() )
91  {
92  EERecHits = pEERecHits.product(); // get a ptr to the product
93  }
94  else
95  {
96  edm::LogError("EcalRecHitError") << "Error! can't get the product " << EERecHitCollection_.label() ;
97  }
98  }
99 
100 
101  // now loop over them
102  if (EBRecHits)
103  {
104  for(EBRecHitCollection::const_iterator it = EBRecHits->begin(); it != EBRecHits->end(); ++it)
105  {
106  if (it->energy()>EBthresh) ebabovethresh++;
107  if (it->energy()>ETOTthresh) etotabovethresh++;
108  }
109  }
110  if (EERecHits)
111  {
112  for(EERecHitCollection::const_iterator it = EERecHits->begin(); it != EERecHits->end(); ++it)
113  {
114  if (it->energy()>EEthresh) eeabovethresh++;
115  if (it->energy()>ETOTthresh) etotabovethresh++;
116  }
117  }
118 
119  if(ebabovethresh>=EBnum) eb=true;
120  if(eeabovethresh>=EEnum) ee=true;
121  if(etotabovethresh>=ETOTnum) etot=true;
122 
123  accepted = eb|ee|etot;
124 
125  if (applyfilter)
126  return accepted;
127  else
128  return true;
129 
130 }
double EBthresh
Definition: ECALActivity.h:45
std::vector< EcalRecHit >::const_iterator const_iterator
edm::InputTag EBRecHitCollection_
Definition: ECALActivity.h:41
bool applyfilter
Definition: ECALActivity.h:50
double EEthresh
Definition: ECALActivity.h:47
edm::InputTag EERecHitCollection_
Definition: ECALActivity.h:42
bool isValid() const
Definition: HandleBase.h:75
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
const_iterator end() const
T const * product() const
Definition: Handle.h:81
double ETOTthresh
Definition: ECALActivity.h:49
std::string const & label() const
Definition: InputTag.h:36
std::string const & instance() const
Definition: InputTag.h:37
const_iterator begin() const

Member Data Documentation

bool ECALActivity::applyfilter
private

Definition at line 50 of file ECALActivity.h.

int ECALActivity::EBnum
private

Definition at line 44 of file ECALActivity.h.

edm::InputTag ECALActivity::EBRecHitCollection_
private

Definition at line 41 of file ECALActivity.h.

double ECALActivity::EBthresh
private

Definition at line 45 of file ECALActivity.h.

int ECALActivity::EEnum
private

Definition at line 46 of file ECALActivity.h.

edm::InputTag ECALActivity::EERecHitCollection_
private

Definition at line 42 of file ECALActivity.h.

double ECALActivity::EEthresh
private

Definition at line 47 of file ECALActivity.h.

int ECALActivity::ETOTnum
private

Definition at line 48 of file ECALActivity.h.

double ECALActivity::ETOTthresh
private

Definition at line 49 of file ECALActivity.h.