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
()
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 ---------------------------
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"
)), 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
73
CSCOverlapsBeamSplashCut::~CSCOverlapsBeamSplashCut
() {
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 ------------
83
bool
CSCOverlapsBeamSplashCut::filter
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
84
edm::Handle<CSCSegmentCollection>
cscSegments
;
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 ------------
100
void
CSCOverlapsBeamSplashCut::beginJob
() {}
101
102
// ------------ method called once each job just after ending the event loop ------------
103
void
CSCOverlapsBeamSplashCut::endJob
() {}
104
105
//define this as a plug-in
106
DEFINE_FWK_MODULE
(
CSCOverlapsBeamSplashCut
);
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
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
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
edm::Service< TFileService >
createfilelist.int
int
Definition:
createfilelist.py:10
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EDFilter
Definition:
EDFilter.h:39
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
Generated for CMSSW Reference Manual by
1.8.16