CMS 3D CMS Logo

CSCOverlapsBeamSplashCut.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CSCOverlapsBeamSplashCut
4 // Class: CSCOverlapsBeamSplashCut
5 //
13 //
14 // Original Author: Jim Pivarski
15 // Created: Sat Nov 21 21:18:04 CET 2009
16 //
17 
18 // system include files
19 #include <memory>
20 
21 // user include files
29 
30 // references
34 #include "TH1F.h"
35 
36 //
37 // class decleration
38 //
39 
41 public:
43  ~CSCOverlapsBeamSplashCut() override;
44 
45 private:
46  void beginJob() override;
47  bool filter(edm::Event&, const edm::EventSetup&) override;
48  void endJob() override;
49 
50  // ----------member data ---------------------------
54 };
55 
56 //
57 // constants, enums and typedefs
58 //
59 
60 //
61 // static data member definitions
62 //
63 
64 //
65 // constructors and destructor
66 //
68  : m_src(iConfig.getParameter<edm::InputTag>("src")), m_maxSegments(iConfig.getParameter<int>("maxSegments")) {
69  edm::Service<TFileService> tFileService;
70  m_numSegments = tFileService->make<TH1F>("numSegments", "", 201, -0.5, 200.5);
71 }
72 
74  // do anything here that needs to be done at desctruction time
75  // (e.g. close files, deallocate resources etc.)
76 }
77 
78 //
79 // member functions
80 //
81 
82 // ------------ method called to produce the data ------------
85  iEvent.getByLabel(m_src, cscSegments);
86 
87  m_numSegments->Fill(cscSegments->size());
88 
89  if (m_maxSegments < 0)
90  return true;
91 
92  else if (int(cscSegments->size()) <= m_maxSegments)
93  return true;
94 
95  else
96  return false;
97 }
98 
99 // ------------ method called once each job just before starting event loop ------------
101 
102 // ------------ method called once each job just after ending the event loop ------------
104 
105 //define this as a plug-in
CSCOverlapsBeamSplashCut::endJob
void endJob() override
Definition: CSCOverlapsBeamSplashCut.cc:103
CSCOverlapsBeamSplashCut::beginJob
void beginJob() override
Definition: CSCOverlapsBeamSplashCut.cc:100
CSCOverlapsBeamSplashCut
Definition: CSCOverlapsBeamSplashCut.cc:40
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
EDFilter.h
CSCOverlapsBeamSplashCut::CSCOverlapsBeamSplashCut
CSCOverlapsBeamSplashCut(const edm::ParameterSet &)
Definition: CSCOverlapsBeamSplashCut.cc:67
dtChamberEfficiency_cfi.cscSegments
cscSegments
Definition: dtChamberEfficiency_cfi.py:15
CSCOverlapsBeamSplashCut::m_maxSegments
int m_maxSegments
Definition: CSCOverlapsBeamSplashCut.cc:52
edm::Handle< CSCSegmentCollection >
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CSCOverlapsBeamSplashCut::filter
bool filter(edm::Event &, const edm::EventSetup &) override
Definition: CSCOverlapsBeamSplashCut.cc:83
Service.h
TFileService.h
CSCOverlapsBeamSplashCut::m_src
edm::InputTag m_src
Definition: CSCOverlapsBeamSplashCut.cc:51
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EDFilter
Definition: EDFilter.h:38
edm::EventSetup
Definition: EventSetup.h:57
Frameworkfwd.h
CSCOverlapsBeamSplashCut::~CSCOverlapsBeamSplashCut
~CSCOverlapsBeamSplashCut() override
Definition: CSCOverlapsBeamSplashCut.cc:73
EventSetup.h
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
CSCOverlapsBeamSplashCut::m_numSegments
TH1F * m_numSegments
Definition: CSCOverlapsBeamSplashCut.cc:53
CSCSegmentCollection.h