CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
22 
26 
27 using namespace edm;
28 using namespace std;
29 
31 
33 
36  iEvent.getByLabel("towerMaker", towers);
37 
38  int negTowers = 0;
39  int posTowers = 0;
40  for (CaloTowerCollection::const_iterator cal = towers->begin(); cal != towers->end(); ++cal) {
41  for (unsigned int i = 0; i < cal->constituentsSize(); i++) {
42  const DetId id = cal->constituent(i);
43  if (id.det() == DetId::Hcal) {
44  HcalSubdetector subdet = (HcalSubdetector(id.subdetId()));
45  if (subdet == HcalForward) {
46  if (cal->energy() > 3. && cal->eta() < -3.)
47  negTowers++;
48  if (cal->energy() > 3. && cal->eta() > 3.)
49  posTowers++;
50  }
51  }
52  }
53  }
54  if (negTowers > 0 && posTowers > 0)
55  return true;
56 
57  return false;
58 }
59 
60 //define this as a plug-in
SelectHFMinBias(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< CaloTower >::const_iterator const_iterator
int iEvent
Definition: GenABIO.cc:224
HcalSubdetector
Definition: HcalAssistant.h:31
~SelectHFMinBias() override
Definition: DetId.h:17
bool filter(edm::Event &, const edm::EventSetup &) override
HLT enums.