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
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 ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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
 
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
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 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().

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

Definition at line 48 of file BeamSplash.cc.

49 {
50 }

Member Function Documentation

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

Implements edm::EDFilter.

Definition at line 52 of file BeamSplash.cc.

References bsc_activity_cfg::applyfilter, edm::SortedCollection< T, SORT >::begin(), edm::EventBase::bunchCrossing(), gather_cfg::cout, egHLT::errCodes::EBRecHits, egHLT::errCodes::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().

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

Member Data Documentation

bool BeamSplash::applyfilter
private

Definition at line 47 of file BeamSplash.h.

edm::InputTag BeamSplash::EBRecHitCollection_
private

Definition at line 41 of file BeamSplash.h.

edm::InputTag BeamSplash::EERecHitCollection_
private

Definition at line 42 of file BeamSplash.h.

double BeamSplash::EnergyCutEcal
private

Definition at line 45 of file BeamSplash.h.

double BeamSplash::EnergyCutHcal
private

Definition at line 46 of file BeamSplash.h.

double BeamSplash::EnergyCutTot
private

Definition at line 44 of file BeamSplash.h.

edm::InputTag BeamSplash::HBHERecHitCollection_
private

Definition at line 43 of file BeamSplash.h.