src
RecoJets
JetAnalyzers
src
myRawAna.cc
Go to the documentation of this file.
1
// myRawAna.cc
2
// Description: Access raw data, specifically event fragment size per FED
3
// Author: Jim Hirschauer
4
// Date: 28 - July - 2009
5
//
6
#include "
RecoJets/JetAnalyzers/interface/myRawAna.h
"
7
8
#include "
DataFormats/Common/interface/Handle.h
"
9
#include "
DataFormats/Candidate/interface/Candidate.h
"
10
#include "
FWCore/Framework/interface/Event.h
"
11
12
#include "
DataFormats/FEDRawData/interface/FEDRawDataCollection.h
"
13
14
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
15
#include <TROOT.h>
16
#include <TSystem.h>
17
#include <TFile.h>
18
#include <TCanvas.h>
19
#include <cmath>
20
21
using namespace
edm
;
22
using namespace
reco
;
23
using namespace
std
;
24
25
#define DEBUG 1
26
#define MAXJETS 100
27
28
// Nothing passed from .cfg yet, but I leave the syntax here for
29
// future reference.
30
31
myRawAna::myRawAna
(
const
ParameterSet
&
cfg
) { usesResource(
TFileService::kSharedResource
); }
32
33
// ************************
34
// ************************
35
36
void
myRawAna::beginJob
() {
37
edm::Service<TFileService>
fs
;
38
39
fedSize =
fs
->make<TH2F>(
"fedSize"
,
"fedSize"
, 901, -0.5, 900.5, 20000, 0., 20000.);
40
totFedSize =
fs
->make<TH1F>(
"totFedSize"
,
"totFedSize"
, 200, 0., 20000.);
41
}
42
43
// ************************
44
// ************************
45
void
myRawAna::analyze
(
const
edm::Event
& evt,
const
edm::EventSetup
& es) {
46
// **************************************************************
47
// ** Access FED Information
48
// **************************************************************
49
50
edm::Handle<FEDRawDataCollection>
theRaw;
51
bool
getFed = evt.
getByLabel
(
"source"
, theRaw);
52
53
if
(!getFed) {
54
std::cout
<<
"fedRawData not available"
<< std::endl;
55
}
else
{
// got the fed raw data
56
unsigned
int
totalFEDsize = 0;
57
58
// HCAL FEDs are 700-730
59
unsigned
int
fedStart_ = 0;
60
unsigned
int
fedStop_ = 900;
61
62
for
(
unsigned
int
i
= fedStart_;
i
<= fedStop_; ++
i
) {
63
fedSize->Fill(
i
, theRaw->
FEDData
(
i
).
size
());
64
totalFEDsize += theRaw->
FEDData
(
i
).
size
();
65
}
66
totFedSize->Fill(totalFEDsize);
67
}
68
}
69
70
// ***********************************
71
// ***********************************
72
void
myRawAna::endJob
() {}
73
#include "
FWCore/Framework/interface/MakerMacros.h
"
74
DEFINE_FWK_MODULE
(
myRawAna
);
TFileService::kSharedResource
static const std::string kSharedResource
Definition:
TFileService.h:76
myRawAna::myRawAna
myRawAna(const edm::ParameterSet &)
Definition:
myRawAna.cc:31
mps_fire.i
i
Definition:
mps_fire.py:429
edm::Service< TFileService >
Event.h
edm::Handle< FEDRawDataCollection >
myRawAna::beginJob
void beginJob() override
Definition:
myRawAna.cc:36
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition:
FEDRawData.h:48
myRawAna.h
FEDRawDataCollection.h
std
Definition:
JetResolutionObject.h:76
myRawAna
Definition:
myRawAna.h:21
ParameterSet.h
Candidate.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::EventSetup
Definition:
EventSetup.h:56
looper.cfg
cfg
Definition:
looper.py:296
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition:
FEDRawDataCollection.cc:19
compareTotals.fs
fs
Definition:
compareTotals.py:52
myRawAna::endJob
void endJob() override
Definition:
myRawAna.cc:72
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSet
Definition:
ParameterSet.h:48
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
myRawAna::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
myRawAna.cc:45
edm::Event
Definition:
Event.h:73
MakerMacros.h
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:498
Handle.h
Generated for CMSSW Reference Manual by
1.8.14