CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
BeamSplash Class Reference

#include <BeamSplash.h>

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

Public Member Functions

 BeamSplash (const edm::ParameterSet &)
 
 ~BeamSplash () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

bool applyfilter
 
edm::InputTag EBRecHitCollection_
 
edm::InputTag EERecHitCollection_
 
double EnergyCutEcal
 
double EnergyCutHcal
 
double EnergyCutTot
 
edm::InputTag HBHERecHitCollection_
 

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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 31 of file BeamSplash.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file BeamSplash.cc.

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

36  {
37  EBRecHitCollection_ = iConfig.getParameter<edm::InputTag>("ebrechitcollection");
38  EERecHitCollection_ = iConfig.getParameter<edm::InputTag>("eerechitcollection");
39  HBHERecHitCollection_ = iConfig.getParameter<edm::InputTag>("hbherechitcollection");
40 
41  EnergyCutTot = iConfig.getUntrackedParameter<double>("energycuttot");
42  EnergyCutEcal = iConfig.getUntrackedParameter<double>("energycutecal");
43  EnergyCutHcal = iConfig.getUntrackedParameter<double>("energycuthcal");
44  applyfilter = iConfig.getUntrackedParameter<bool>("applyfilter", true);
45 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag HBHERecHitCollection_
Definition: BeamSplash.h:41
double EnergyCutEcal
Definition: BeamSplash.h:43
double EnergyCutHcal
Definition: BeamSplash.h:44
edm::InputTag EERecHitCollection_
Definition: BeamSplash.h:40
double EnergyCutTot
Definition: BeamSplash.h:42
bool applyfilter
Definition: BeamSplash.h:45
edm::InputTag EBRecHitCollection_
Definition: BeamSplash.h:39
BeamSplash::~BeamSplash ( )
override

Definition at line 47 of file BeamSplash.cc.

47 {}

Member Function Documentation

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

Definition at line 49 of file BeamSplash.cc.

References cms::dd::accepted(), bsc_activity_cfg::applyfilter, edm::SortedCollection< T, SORT >::begin(), edm::EventBase::bunchCrossing(), gather_cfg::cout, DEFINE_FWK_MODULE, filterRecHits_cfi::EBRecHits, filterRecHits_cfi::EERecHits, edm::SortedCollection< T, SORT >::end(), edm::EventID::event(), edm::Event::getByLabel(), egHLT::errCodes::HBHERecHits, edm::EventBase::id(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), edm::Handle< T >::product(), and edm::EventID::run().

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

49  {
50  bool accepted = false;
51 
52  bool acceptedtot = false;
53  bool acceptedEcal = false;
54  bool acceptedHcal = false;
55 
56  int ievt = iEvent.id().event();
57  int irun = iEvent.id().run();
58  int ils = iEvent.luminosityBlock();
59  int ibx = iEvent.bunchCrossing();
60 
61  double totene = 0;
62  double ecalene = 0;
63  double hcalene = 0;
64 
65  Handle<EBRecHitCollection> pEBRecHits;
66  Handle<EERecHitCollection> pEERecHits;
67  Handle<HBHERecHitCollection> pHBHERecHits;
68 
69  const EBRecHitCollection* EBRecHits = nullptr;
70  const EERecHitCollection* EERecHits = nullptr;
71  const HBHERecHitCollection* HBHERecHits = nullptr;
72 
73  if (!EBRecHitCollection_.label().empty() && !EBRecHitCollection_.instance().empty()) {
74  iEvent.getByLabel(EBRecHitCollection_, pEBRecHits);
75  if (pEBRecHits.isValid()) {
76  EBRecHits = pEBRecHits.product(); // get a ptr to the product
77  } else {
78  edm::LogError("EcalRecHitError") << "Error! can't get the product " << EBRecHitCollection_.label();
79  }
80  }
81 
82  if (!EERecHitCollection_.label().empty() && !EERecHitCollection_.instance().empty()) {
83  iEvent.getByLabel(EERecHitCollection_, pEERecHits);
84 
85  if (pEERecHits.isValid()) {
86  EERecHits = pEERecHits.product(); // get a ptr to the product
87  } else {
88  edm::LogError("EcalRecHitError") << "Error! can't get the product " << EERecHitCollection_.label();
89  }
90  }
91 
92  if (!HBHERecHitCollection_.label().empty()) {
93  iEvent.getByLabel(HBHERecHitCollection_, pHBHERecHits);
94 
95  if (pHBHERecHits.isValid()) {
96  HBHERecHits = pHBHERecHits.product(); // get a ptr to the product
97  } else {
98  edm::LogError("HcalRecHitError") << "Error! can't get the product " << HBHERecHitCollection_.label();
99  }
100  }
101 
102  // now sum over them
103  if (EBRecHits) {
104  for (EBRecHitCollection::const_iterator it = EBRecHits->begin(); it != EBRecHits->end(); ++it) {
105  totene += it->energy();
106  ecalene += it->energy();
107  }
108  }
109  if (EERecHits) {
110  for (EERecHitCollection::const_iterator it = EERecHits->begin(); it != EERecHits->end(); ++it) {
111  totene += it->energy();
112  ecalene += it->energy();
113  }
114  }
115  if (HBHERecHits) {
116  for (HBHERecHitCollection::const_iterator it = HBHERecHits->begin(); it != HBHERecHits->end(); ++it) {
117  totene += it->energy();
118  hcalene += it->energy();
119  }
120  }
121 
122  if (totene > EnergyCutTot)
123  acceptedtot = true;
124  if (ecalene > EnergyCutEcal)
125  acceptedEcal = true;
126  if (hcalene > EnergyCutHcal)
127  acceptedHcal = true;
128 
129  accepted = acceptedtot | acceptedEcal | acceptedHcal;
130 
131  if (accepted) {
132  edm::LogVerbatim("BeamSplash") << "!!!!!!!BeamSplash!!!!!!!: run:" << irun << " event:" << ievt << " ls:" << ils
133  << " bx= " << ibx << " totene=" << totene << " ecalene=" << ecalene
134  << " hcalene=" << hcalene;
135  std::cout << "!!!!!!!BeamSplash!!!!!!!: run:" << irun << " event:" << ievt << " ls:" << ils << " bx= " << ibx
136  << " totene=" << totene << " ecalene=" << ecalene << " hcalene=" << hcalene << std::endl;
137  }
138 
139  if (applyfilter)
140  return accepted;
141  else
142  return true;
143 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
edm::InputTag HBHERecHitCollection_
Definition: BeamSplash.h:41
double EnergyCutEcal
Definition: BeamSplash.h:43
std::vector< EcalRecHit >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
double EnergyCutHcal
Definition: BeamSplash.h:44
edm::InputTag EERecHitCollection_
Definition: BeamSplash.h:40
bool isValid() const
Definition: HandleBase.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
double EnergyCutTot
Definition: BeamSplash.h:42
const_iterator end() const
T const * product() const
Definition: Handle.h:69
bool accepted(std::vector< std::string_view > const &, std::string_view)
std::string const & label() const
Definition: InputTag.h:36
edm::EventID id() const
Definition: EventBase.h:59
bool applyfilter
Definition: BeamSplash.h:45
std::string const & instance() const
Definition: InputTag.h:37
const_iterator begin() const
edm::InputTag EBRecHitCollection_
Definition: BeamSplash.h:39

Member Data Documentation

bool BeamSplash::applyfilter
private

Definition at line 45 of file BeamSplash.h.

edm::InputTag BeamSplash::EBRecHitCollection_
private

Definition at line 39 of file BeamSplash.h.

edm::InputTag BeamSplash::EERecHitCollection_
private

Definition at line 40 of file BeamSplash.h.

double BeamSplash::EnergyCutEcal
private

Definition at line 43 of file BeamSplash.h.

double BeamSplash::EnergyCutHcal
private

Definition at line 44 of file BeamSplash.h.

double BeamSplash::EnergyCutTot
private

Definition at line 42 of file BeamSplash.h.

edm::InputTag BeamSplash::HBHERecHitCollection_
private

Definition at line 41 of file BeamSplash.h.