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::ProductRegistryHelper

Public Member Functions

 BeamSplash (const edm::ParameterSet &)
 
 ~BeamSplash ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

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
 
typedef WorkerT< EDFilterWorkerType
 
- 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::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 33 of file BeamSplash.h.

Constructor & Destructor Documentation

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

Definition at line 35 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: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 47 of file BeamSplash.cc.

48 {
49 }

Member Function Documentation

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

Implements edm::EDFilter.

Definition at line 51 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().

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