Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Alignment
MuonAlignmentAlgorithms
plugins
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
22
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
23
#include "
FWCore/Framework/interface/EDFilter.h
"
24
#include "
FWCore/Framework/interface/Event.h
"
25
#include "
FWCore/Framework/interface/EventSetup.h
"
26
#include "
FWCore/Framework/interface/ESHandle.h
"
27
#include "
FWCore/Framework/interface/MakerMacros.h
"
28
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
29
30
// references
31
#include "
DataFormats/CSCRecHit/interface/CSCSegmentCollection.h
"
32
#include "
FWCore/ServiceRegistry/interface/Service.h
"
33
#include "
CommonTools/UtilAlgos/interface/TFileService.h
"
34
#include "TH1F.h"
35
36
//
37
// class decleration
38
//
39
40
class
CSCOverlapsBeamSplashCut
:
public
edm::EDFilter
{
41
public
:
42
explicit
CSCOverlapsBeamSplashCut
(
const
edm::ParameterSet
&);
43
~CSCOverlapsBeamSplashCut
();
44
45
private
:
46
virtual
void
beginJob
() ;
47
virtual
bool
filter
(
edm::Event
&,
const
edm::EventSetup
&);
48
virtual
void
endJob
() ;
49
50
// ----------member data ---------------------------
51
edm::InputTag
m_src
;
52
int
m_maxSegments
;
53
TH1F *
m_numSegments
;
54
};
55
56
//
57
// constants, enums and typedefs
58
//
59
60
//
61
// static data member definitions
62
//
63
64
//
65
// constructors and destructor
66
//
67
CSCOverlapsBeamSplashCut::CSCOverlapsBeamSplashCut
(
const
edm::ParameterSet
& iConfig)
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
76
CSCOverlapsBeamSplashCut::~CSCOverlapsBeamSplashCut
()
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
89
CSCOverlapsBeamSplashCut::filter
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
90
edm::Handle<CSCSegmentCollection>
cscSegments
;
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 ------------
103
void
CSCOverlapsBeamSplashCut::beginJob
() {}
104
105
// ------------ method called once each job just after ending the event loop ------------
106
void
CSCOverlapsBeamSplashCut::endJob
() {}
107
108
//define this as a plug-in
109
DEFINE_FWK_MODULE
(
CSCOverlapsBeamSplashCut
);
edm::Service< TFileService >
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
Event.h
MakerMacros.h
EventSetup.h
CSCOverlapsBeamSplashCut
Definition:
CSCOverlapsBeamSplashCut.cc:40
CSCOverlapsBeamSplashCut::m_numSegments
TH1F * m_numSegments
Definition:
CSCOverlapsBeamSplashCut.cc:53
edm::Handle< CSCSegmentCollection >
CSCOverlapsBeamSplashCut::~CSCOverlapsBeamSplashCut
~CSCOverlapsBeamSplashCut()
Definition:
CSCOverlapsBeamSplashCut.cc:76
Frameworkfwd.h
TFileService.h
ParameterSet.h
CSCOverlapsBeamSplashCut::CSCOverlapsBeamSplashCut
CSCOverlapsBeamSplashCut(const edm::ParameterSet &)
Definition:
CSCOverlapsBeamSplashCut.cc:67
iEvent
int iEvent
Definition:
GenABIO.cc:243
CSCOverlapsBeamSplashCut::m_maxSegments
int m_maxSegments
Definition:
CSCOverlapsBeamSplashCut.cc:52
EDFilter.h
ESHandle.h
Service.h
CSCOverlapsBeamSplashCut::filter
virtual bool filter(edm::Event &, const edm::EventSetup &)
Definition:
CSCOverlapsBeamSplashCut.cc:89
edm::EventSetup
Definition:
EventSetup.h:44
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:361
edm::EDFilter
Definition:
EDFilter.h:25
CSCSegmentCollection.h
CSCOverlapsBeamSplashCut::beginJob
virtual void beginJob()
Definition:
CSCOverlapsBeamSplashCut.cc:103
CSCOverlapsBeamSplashCut::endJob
virtual void endJob()
Definition:
CSCOverlapsBeamSplashCut.cc:106
edm::InputTag
Definition:
InputTag.h:17
TFileDirectory::make
T * make() const
make new ROOT object
Definition:
TFileDirectory.h:55
edm::ParameterSet
Definition:
ParameterSet.h:35
CSCOverlapsBeamSplashCut::m_src
edm::InputTag m_src
Definition:
CSCOverlapsBeamSplashCut.cc:51
cscSegments_cfi.cscSegments
tuple cscSegments
Definition:
cscSegments_cfi.py:9
edm::Event
Definition:
Event.h:56
Generated for CMSSW Reference Manual by
1.8.5