CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
44 
45  private:
46  virtual void beginJob() override ;
47  virtual bool filter(edm::Event&, const edm::EventSetup&) override;
48  virtual 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"))
69  , m_maxSegments(iConfig.getParameter<int>("maxSegments"))
70 {
71  edm::Service<TFileService> tFileService;
72  m_numSegments = tFileService->make<TH1F>("numSegments", "", 201, -0.5, 200.5);
73 }
74 
75 
77 {
78  // do anything here that needs to be done at desctruction time
79  // (e.g. close files, deallocate resources etc.)
80 }
81 
82 
83 //
84 // member functions
85 //
86 
87 // ------------ method called to produce the data ------------
88 bool
91  iEvent.getByLabel(m_src, cscSegments);
92 
93  m_numSegments->Fill(cscSegments->size());
94 
95  if (m_maxSegments < 0) return true;
96 
97  else if (int(cscSegments->size()) <= m_maxSegments) return true;
98 
99  else return false;
100 }
101 
102 // ------------ method called once each job just before starting event loop ------------
104 
105 // ------------ method called once each job just after ending the event loop ------------
107 
108 //define this as a plug-in
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
CSCOverlapsBeamSplashCut(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:230
virtual void beginJob() override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
virtual bool filter(edm::Event &, const edm::EventSetup &) override
virtual void endJob() override