CMS 3D CMS Logo

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 () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 scrapingFilter_cfi::applyfilter, 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 ( )
override

Definition at line 47 of file ECALActivity.cc.

48 {
49 }

Member Function Documentation

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

Definition at line 51 of file ECALActivity.cc.

References scrapingFilter_cfi::applyfilter, edm::SortedCollection< T, SORT >::begin(), DEFINE_FWK_MODULE, egHLT::errCodes::EBRecHits, egHLT::errCodes::EERecHits, edm::SortedCollection< T, SORT >::end(), 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 = nullptr;
71  const EERecHitCollection* EERecHits = nullptr;
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:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:475
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.