Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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/one/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::one::EDFilter
<edm::one::SharedResources> {
41
public
:
42
explicit
CSCOverlapsBeamSplashCut
(
const
edm::ParameterSet
&);
43
~CSCOverlapsBeamSplashCut
()
override
=
default
;
44
45
private
:
46
bool
filter
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
47
// ----------member data ---------------------------
48
edm::InputTag
m_src
;
49
int
m_maxSegments
;
50
TH1F*
m_numSegments
;
51
};
52
53
//
54
// constructors and destructor
55
//
56
CSCOverlapsBeamSplashCut::CSCOverlapsBeamSplashCut
(
const
edm::ParameterSet
&
iConfig
)
57
: m_src(iConfig.getParameter<edm::
InputTag
>(
"src"
)), m_maxSegments(iConfig.getParameter<int>(
"maxSegments"
)) {
58
usesResource(
TFileService::kSharedResource
);
59
edm::Service<TFileService>
tFileService;
60
m_numSegments
= tFileService->
make
<TH1F>(
"numSegments"
,
""
, 201, -0.5, 200.5);
61
}
62
63
//
64
// member functions
65
//
66
67
// ------------ method called to produce the data ------------
68
bool
CSCOverlapsBeamSplashCut::filter
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
69
edm::Handle<CSCSegmentCollection>
cscSegments
;
70
iEvent.
getByLabel
(
m_src
, cscSegments);
71
72
m_numSegments
->Fill(cscSegments->size());
73
74
if
(
m_maxSegments
< 0)
75
return
true
;
76
77
else
if
(
int
(cscSegments->size()) <=
m_maxSegments
)
78
return
true
;
79
80
else
81
return
false
;
82
}
83
84
//define this as a plug-in
85
DEFINE_FWK_MODULE
(
CSCOverlapsBeamSplashCut
);
TFileService::kSharedResource
static const std::string kSharedResource
Definition:
TFileService.h:76
edm::Service< TFileService >
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Event.h
MakerMacros.h
edm::Handle< CSCSegmentCollection >
EventSetup.h
CSCOverlapsBeamSplashCut
Definition:
CSCOverlapsBeamSplashCut.cc:40
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:50
Frameworkfwd.h
TFileService.h
ParameterSet.h
CSCOverlapsBeamSplashCut::CSCOverlapsBeamSplashCut
CSCOverlapsBeamSplashCut(const edm::ParameterSet &)
Definition:
CSCOverlapsBeamSplashCut.cc:56
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::one::EDFilter
Definition:
EDFilter.h:30
CSCOverlapsBeamSplashCut::m_maxSegments
int m_maxSegments
Definition:
CSCOverlapsBeamSplashCut.cc:49
ESHandle.h
EDFilter.h
Service.h
edm::EventSetup
Definition:
EventSetup.h:59
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:500
CSCOverlapsBeamSplashCut::~CSCOverlapsBeamSplashCut
~CSCOverlapsBeamSplashCut() override=default
CSCSegmentCollection.h
CSCOverlapsBeamSplashCut::filter
bool filter(edm::Event &, const edm::EventSetup &) override
Definition:
CSCOverlapsBeamSplashCut.cc:68
HLT_FULL_cff.InputTag
tuple InputTag
Definition:
HLT_FULL_cff.py:86956
edm::InputTag
Definition:
InputTag.h:15
edm::ParameterSet
Definition:
ParameterSet.h:47
CSCOverlapsBeamSplashCut::m_src
edm::InputTag m_src
Definition:
CSCOverlapsBeamSplashCut.cc:48
cscSegments_cfi.cscSegments
tuple cscSegments
Definition:
cscSegments_cfi.py:9
edm::Event
Definition:
Event.h:73
iConfig
iConfig
Definition:
TSGFromPropagation.cc:56
Generated for CMSSW Reference Manual by
1.8.5