CMS 3D CMS Logo

SelectHFMinBias.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: BeamSplash
4 // Class: BeamSPlash
5 //
6 //
7 // Original Author: Luca Malgeri
8 
9 #include <memory>
10 #include <vector>
11 #include <map>
12 #include <set>
13 
14 // user include files
15 
24 
28 
29 using namespace edm;
30 using namespace std;
31 
33 
35 
38  iEvent.getByLabel("towerMaker", towers);
39 
40  int negTowers = 0;
41  int posTowers = 0;
42  for (CaloTowerCollection::const_iterator cal = towers->begin(); cal != towers->end(); ++cal) {
43  for (unsigned int i = 0; i < cal->constituentsSize(); i++) {
44  const DetId id = cal->constituent(i);
45  if (id.det() == DetId::Hcal) {
46  HcalSubdetector subdet = (HcalSubdetector(id.subdetId()));
47  if (subdet == HcalForward) {
48  if (cal->energy() > 3. && cal->eta() < -3.)
49  negTowers++;
50  if (cal->energy() > 3. && cal->eta() > 3.)
51  posTowers++;
52  }
53  }
54  }
55  }
56  if (negTowers > 0 && posTowers > 0)
57  return true;
58 
59  return false;
60 }
61 
62 //define this as a plug-in
SelectHFMinBias(const edm::ParameterSet &)
std::vector< CaloTower >::const_iterator const_iterator
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HcalSubdetector
Definition: HcalAssistant.h:31
~SelectHFMinBias() override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
const_iterator end() const
Definition: DetId.h:17
bool filter(edm::Event &, const edm::EventSetup &) override
HLT enums.
const_iterator begin() const