Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DQM
HcalMonitorModule
src
LumiblockFilter.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: LumiblockFilter
4
// Class: LumiblockFilter
5
//
13
//
14
// Original Author: Jeff Temple
15
// Created: Mon May 12 15:38:09 CEST 2008
16
// $Id: LumiblockFilter.cc,v 1.3 2010/03/25 11:17:15 temple Exp $
17
//
18
//
19
20
21
// system include files
22
#include <memory>
23
24
// user include files
25
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
26
#include "
FWCore/Framework/interface/EDFilter.h
"
27
28
#include "
FWCore/Framework/interface/Event.h
"
29
#include "
FWCore/Framework/interface/MakerMacros.h
"
30
31
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
32
33
34
#include "TH1.h"
35
36
//
37
// class declaration
38
//
39
40
class
LumiblockFilter
:
public
edm::EDFilter
{
41
public
:
42
explicit
LumiblockFilter
(
const
edm::ParameterSet
&);
43
~LumiblockFilter
();
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
52
/* Set values of start, end lum'y
53
each event's lum'y block X must be >=startblock and <endblock
54
if startblock, endblock values are <= 0, then
55
they are not used in the lum'y block checking.
56
*/
57
58
int
startblock
;
59
int
endblock
;
60
bool
debug
;
61
62
/*
63
// don't bother with histograms yet
64
TH1F* alllumis;
65
TH1F* lumihist;
66
*/
67
};
68
69
//
70
// constants, enums and typedefs
71
//
72
73
//
74
// static data member definitions
75
//
76
77
//
78
// constructors and destructor
79
//
80
LumiblockFilter::LumiblockFilter
(
const
edm::ParameterSet
& iConfig)
81
{
82
//now do what ever initialization is needed
83
startblock
=iConfig.
getUntrackedParameter
<
int
> (
"startblock"
,0);
84
endblock
=iConfig.
getUntrackedParameter
<
int
> (
"endblock"
,0);
85
debug
= iConfig.
getUntrackedParameter
<
bool
> (
"debug"
,
false
);
86
87
/*
88
if (debug)
89
{
90
alllumis = new TH1F("allLumiBlocks", "All luminosity blocks found in run",500,0,500);
91
lumihist = new TH1F("lumiBlockRange","selected luminosity block range",500,0,500);
92
}
93
*/
94
}
95
96
97
LumiblockFilter::~LumiblockFilter
()
98
{
99
100
// do anything here that needs to be done at desctruction time
101
// (e.g. close files, deallocate resources etc.)
102
103
}
104
105
106
//
107
// member functions
108
//
109
110
// ------------ method called on each new Event ------------
111
bool
112
LumiblockFilter::filter
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
113
{
114
int
lumi
= iEvent.
luminosityBlock
();
115
/*
116
if (debug)
117
alllumis->Fill(lumi);
118
*/
119
if
(
debug
)
std::cout
<<
" LUMI BLOCK = "
<<lumi<<std::endl;
120
if
(
startblock
>0 and lumi<
startblock
)
121
return
false
;
122
if
(
endblock
>0 and lumi>=
endblock
)
123
return
false
;
124
/*
125
if (debug)
126
lumihist->Fill(lumi);
127
*/
128
if
(
debug
)
std::cout
<<
" LUMI BLOCK WITHIN RANGE "
<<
startblock
<<
" - "
<<
endblock
<<std::endl;
129
return
true
;
130
}
131
132
// ------------ method called once each job just before starting event loop ------------
133
void
134
LumiblockFilter::beginJob
()
135
{
136
}
137
138
// ------------ method called once each job just after ending the event loop ------------
139
void
140
LumiblockFilter::endJob
() {
141
}
142
143
//define this as a plug-in
144
DEFINE_FWK_MODULE
(
LumiblockFilter
);
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
fjr2json.lumi
tuple lumi
Definition:
fjr2json.py:35
Event.h
MakerMacros.h
LumiblockFilter::debug
bool debug
Definition:
LumiblockFilter.cc:60
edm::EventBase::luminosityBlock
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition:
EventBase.h:59
LumiblockFilter::filter
virtual bool filter(edm::Event &, const edm::EventSetup &)
Definition:
LumiblockFilter.cc:112
LumiblockFilter
Definition:
LumiblockFilter.cc:40
Frameworkfwd.h
ParameterSet.h
iEvent
int iEvent
Definition:
GenABIO.cc:243
EDFilter.h
edm::EventSetup
Definition:
EventSetup.h:44
LumiblockFilter::endblock
int endblock
Definition:
LumiblockFilter.cc:59
edm::EDFilter
Definition:
EDFilter.h:24
LumiblockFilter::beginJob
virtual void beginJob()
Definition:
LumiblockFilter.cc:134
LumiblockFilter::endJob
virtual void endJob()
Definition:
LumiblockFilter.cc:140
edm::ParameterSet
Definition:
ParameterSet.h:35
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
edm::Event
Definition:
Event.h:50
LumiblockFilter::startblock
int startblock
Definition:
LumiblockFilter.cc:58
LumiblockFilter::LumiblockFilter
LumiblockFilter(const edm::ParameterSet &)
Definition:
LumiblockFilter.cc:80
LumiblockFilter::~LumiblockFilter
~LumiblockFilter()
Definition:
LumiblockFilter.cc:97
Generated for CMSSW Reference Manual by
1.8.5