DPGAnalysis
SiStripTools
plugins
EventWithHistoryProducer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: EventWithHistoryProducer
4
// Class: EventWithHistoryProducer
5
//
13
//
14
// Original Author: Andrea Venturi
15
// Created: Sun Nov 30 19:05:41 CET 2008
16
// $Id: EventWithHistoryProducer.cc,v 1.2 2010/01/12 09:13:04 venturia Exp $
17
//
18
//
19
20
// system include files
21
#include <memory>
22
23
// user include files
24
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
25
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
26
27
#include "
FWCore/Framework/interface/Event.h
"
28
#include "
FWCore/Framework/interface/MakerMacros.h
"
29
30
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
31
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
32
33
//#include "DPGAnalysis/SiStripTools/interface/TinyEvent.h"
34
#include "
DPGAnalysis/SiStripTools/interface/EventWithHistory.h
"
35
36
//
37
// class decleration
38
//
39
40
class
EventWithHistoryProducer
:
public
edm::stream::EDProducer
<> {
41
public
:
42
explicit
EventWithHistoryProducer
(
const
edm::ParameterSet
&);
43
~EventWithHistoryProducer
()
override
;
44
45
private
:
46
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
47
48
// ----------member data ---------------------------
49
50
const
unsigned
int
_depth
;
51
EventWithHistory
_prevHE
;
52
};
53
54
//
55
// constants, enums and typedefs
56
//
57
58
//
59
// static data member definitions
60
//
61
62
//
63
// constructors and destructor
64
//
65
EventWithHistoryProducer::EventWithHistoryProducer
(
const
edm::ParameterSet
& iConfig)
66
: _depth(iConfig.getUntrackedParameter<unsigned
int
>(
"historyDepth"
)), _prevHE() {
67
produces<EventWithHistory>();
68
69
//now do what ever other initialization is needed
70
}
71
72
EventWithHistoryProducer::~EventWithHistoryProducer
() {
73
// do anything here that needs to be done at desctruction time
74
// (e.g. close files, deallocate resources etc.)
75
}
76
77
//
78
// member functions
79
//
80
81
// ------------ method called to produce the data ------------
82
void
EventWithHistoryProducer::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
83
using namespace
edm
;
84
85
std::unique_ptr<EventWithHistory> heOut(
86
new
EventWithHistory
(
iEvent
.id().event(),
iEvent
.orbitNumber(),
iEvent
.bunchCrossing()));
87
heOut->add(
_prevHE
,
_depth
);
88
89
if
(*heOut <
_prevHE
)
90
edm::LogInfo
(
"EventsNotInOrder"
) <<
" Events not in order "
<<
_prevHE
.
_event
;
91
92
_prevHE
= *heOut;
93
iEvent
.put(
std::move
(heOut));
94
}
95
96
//define this as a plug-in
97
DEFINE_FWK_MODULE
(
EventWithHistoryProducer
);
EventWithHistoryProducer
Definition:
EventWithHistoryProducer.cc:40
EventWithHistoryProducer::EventWithHistoryProducer
EventWithHistoryProducer(const edm::ParameterSet &)
Definition:
EventWithHistoryProducer.cc:65
MessageLogger.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Event.h
EventWithHistory
Definition:
EventWithHistory.h:17
MakerMacros.h
EventWithHistoryProducer::_depth
const unsigned int _depth
Definition:
EventWithHistoryProducer.cc:50
EventWithHistoryProducer::~EventWithHistoryProducer
~EventWithHistoryProducer() override
Definition:
EventWithHistoryProducer.cc:72
EventWithHistoryProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
EventWithHistoryProducer.cc:82
Frameworkfwd.h
ParameterSet.h
EDProducer.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
createfilelist.int
int
Definition:
createfilelist.py:10
EventWithHistoryProducer::_prevHE
EventWithHistory _prevHE
Definition:
EventWithHistoryProducer.cc:51
edm::EventSetup
Definition:
EventSetup.h:59
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
edm::stream::EDProducer
Definition:
EDProducer.h:36
EventWithHistory.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
TinyEvent::_event
edm::EventNumber_t _event
Definition:
TinyEvent.h:64
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::Event
Definition:
Event.h:73
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Generated for CMSSW Reference Manual by
1.8.14