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 {
34 }
35 
37 {
38 }
39 
41 {
42 
44 iEvent.getByLabel("towerMaker",towers);
45 
46 
47 int negTowers = 0;
48 int posTowers = 0;
49 for(CaloTowerCollection::const_iterator cal = towers->begin(); cal != towers->end(); ++cal) {
50  for(unsigned int i = 0; i < cal->constituentsSize(); i++) {
51  const DetId id = cal->constituent(i);
52  if(id.det() == DetId::Hcal) {
53  HcalSubdetector subdet=(HcalSubdetector(id.subdetId()));
54  if(subdet == HcalForward) {
55  if(cal->energy()>3. && cal->eta()<-3.)
56  negTowers++;
57  if(cal->energy()>3. && cal->eta()>3.)
58  posTowers++;
59  }
60  }
61  }
62 }
63 if(negTowers>0 && posTowers>0)
64  return true;
65 
66 return false;
67 
68 }
69 
70 //define this as a plug-in
SelectHFMinBias(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< CaloTower >::const_iterator const_iterator
int iEvent
Definition: GenABIO.cc:230
HcalSubdetector
Definition: HcalAssistant.h:31
~SelectHFMinBias() override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
const_iterator end() const
Definition: DetId.h:18
bool filter(edm::Event &, const edm::EventSetup &) override
HLT enums.
const_iterator begin() const