Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CaloOnlineTools
HcalOnlineDb
src
HcalLutGenerator.cc
Go to the documentation of this file.
1
#include "
CaloOnlineTools/HcalOnlineDb/interface/HcalLutGenerator.h
"
2
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
#include "
Geometry/CaloTopology/interface/HcalTopology.h
"
5
#include "
DataFormats/HcalDetId/interface/HcalDetId.h
"
6
#include "
CalibFormats/HcalObjects/interface/HcalTPGRecord.h
"
7
#include "
CalibFormats/HcalObjects/interface/HcalTPGCoder.h
"
8
#include "
CaloOnlineTools/HcalOnlineDb/interface/HcalLutManager.h
"
9
#include "
CalibFormats/CaloTPG/interface/CaloTPGRecord.h
"
10
//#include "CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h"
11
#include "
CondFormats/HcalObjects/interface/HcalElectronicsMap.h
"
12
13
#include "
CaloOnlineTools/HcalOnlineDb/interface/LMap.h
"
14
15
16
#include <iostream>
17
using
std::cerr
;
18
using
std::cout
;
19
using
std::endl;
20
21
HcalLutGenerator::HcalLutGenerator
(
const
edm::ParameterSet
& iConfig)
22
{
23
std::cout
<<
" --> HcalLutGenerator::HcalLutGenerator()"
<< std::endl;
24
_tag
= iConfig.
getParameter
<std::string>(
"tag"
);
25
_lin_file
= iConfig.
getParameter
<std::string>(
"HO_master_file"
);
26
_status_word_to_mask
= iConfig.
getParameter
<uint32_t>(
"status_word_to_mask"
);
27
}
28
29
HcalLutGenerator::~HcalLutGenerator
()
30
{
31
}
32
33
34
void
HcalLutGenerator::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
35
{
36
37
std::cout
<<
" --> HcalLutGenerator::analyze()"
<< std::endl;
38
39
//
40
//_____ get the coders from Event Setup _______________________________
41
//
42
edm::ESHandle<HcalTPGCoder>
inputCoder;
43
iSetup.
get
<
HcalTPGRecord
>().
get
(inputCoder);
44
HcalTopology
theTopo;
45
HcalDetId
did;
46
//
47
edm::ESHandle<CaloTPGTranscoder>
outTranscoder;
48
iSetup.
get
<
CaloTPGRecord
>().
get
(outTranscoder);
49
outTranscoder->setup(iSetup,
CaloTPGTranscoder::HcalTPG
);
50
edm::ESHandle<CaloTPGTranscoderULUT>
transcoder;
51
transcoder.
swap
(outTranscoder);
52
53
//
54
//_____ get EMAP from Event Setup _____________________________________
55
//
56
edm::ESHandle<HcalElectronicsMap>
hEmap;
57
iSetup.
get
<
HcalElectronicsMapRcd
>().
get
(hEmap);
58
std::vector<HcalGenericDetId> vEmap = hEmap->allPrecisionId();
59
std::cout
<<
"EMAP from Event Setup has "
<< vEmap.size() <<
" entries"
<< std::endl;
60
61
//
62
//_____ get Channel Quality conditions from Event Setup (example)______
63
//
64
edm::ESHandle<HcalChannelQuality>
hCQ;
65
iSetup.
get
<
HcalChannelQualityRcd
>().
get
(hCQ);
66
const
HcalChannelQuality
* _cq = &(*hCQ);
67
//
68
/*
69
// Here's how one gets channel status from the Channel Quality condition.
70
// One can use their own loop over channels or get a vector of all
71
// channels from the conditions object
72
//
73
//_____ get list of all channels
74
//
75
std::vector<DetId> _channels = _cq->getAllChannels();
76
std::cout << "Channel Quality available for " << _channels.size() << " channels" << std::endl;
77
//
78
//_____ loop over channels
79
//
80
for (std::vector<DetId>::const_iterator _ch = _channels.begin();
81
_ch != _channels.end();
82
_ch++){
83
//
84
//_____ select only HBEF logical channels
85
//
86
HcalGenericDetId _gid( *_ch );
87
if ( !(_gid.null()) &&
88
(_gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
89
_gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
90
_gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
91
_gid.genericSubdet()==HcalGenericDetId::HcalGenOuter
92
)
93
){
94
const HcalChannelStatus * _cs = _cq->getValues( *_ch );
95
96
// get the full 32-bit channel status word
97
uint32_t status_word = _cs->getValue();
98
99
// get the 15th bit (which is supposed to mean hot channel)
100
bool is_hot = _cs->isBitSet(15);
101
//edm::LogInfo("LUT") << "HCAL channel ID: " << _ch->rawId()
102
//std::cout << "HCAL channel ID: " << _ch->rawId()
103
// << ", status word: " << status_word
104
// << ", hot flag: " << is_hot << std::endl;
105
}
106
}
107
*/
108
//_____end of Channel Quality example_____________________
109
110
//
111
//_____ generate LUTs _________________________________________________
112
//
113
//HcalLutManager * manager = new HcalLutManager(); // old ways
114
//HcalLutManager * manager = new HcalLutManager(&(*hEmap));
115
HcalLutManager
* manager =
new
HcalLutManager
(&(*hEmap), _cq,
_status_word_to_mask
);
116
bool
split_by_crate =
true
;
117
std::cout
<<
" tag name: "
<<
_tag
<< std::endl;
118
std::cout
<<
" HO master file: "
<<
_lin_file
<< std::endl;
119
120
// default
121
//manager -> createLutXmlFiles_HBEFFromCoder_HOFromAscii( _tag, *inputCoder, *transcoder, _lin_file, split_by_crate );
122
123
// with ZDC (experimental)
124
manager -> createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC(
_tag
, *inputCoder, *transcoder,
_lin_file
, split_by_crate );
125
delete
manager;
126
127
transcoder->releaseSetup();
128
129
}
130
131
132
void
HcalLutGenerator::endJob
() {
133
134
}
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HcalLutGenerator::endJob
void endJob()
Definition:
HcalLutGenerator.cc:132
HcalChannelQualityRcd
Definition:
HcalChannelQualityRcd.h:6
HcalLutManager
Various manipulations with trigger Lookup Tables.
Definition:
HcalLutManager.h:43
HcalTopology
Definition:
HcalTopology.h:24
HcalElectronicsMapRcd
Definition:
HcalElectronicsMapRcd.h:6
iEvent
int iEvent
Definition:
GenABIO.cc:243
HcalLutGenerator::_status_word_to_mask
uint32_t _status_word_to_mask
Definition:
HcalLutGenerator.h:19
HcalDetId
Definition:
HcalDetId.h:18
HcalDetId.h
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
HcalChannelQuality
Definition:
HcalChannelQuality.h:15
edm::EventSetup
Definition:
EventSetup.h:44
CaloTPGTranscoder::HcalTPG
Definition:
CaloTPGTranscoder.h:31
HcalElectronicsMap.h
HcalTPGRecord.h
CaloTPGRecord
Definition:
CaloTPGRecord.h:24
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
HcalLutManager.h
LMap.h
HcalLutGenerator::_tag
std::string _tag
Definition:
HcalLutGenerator.h:17
dtNoiseDBValidation_cfg.cerr
tuple cerr
Definition:
dtNoiseDBValidation_cfg.py:22
HcalLutGenerator::_lin_file
std::string _lin_file
Definition:
HcalLutGenerator.h:18
HcalTPGRecord
Definition:
HcalTPGRecord.h:25
edm::ParameterSet
Definition:
ParameterSet.h:35
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
HcalTPGCoder.h
HcalLutGenerator::~HcalLutGenerator
~HcalLutGenerator()
Definition:
HcalLutGenerator.cc:29
HcalLutGenerator.h
edm::Event
Definition:
Event.h:50
HcalLutGenerator::HcalLutGenerator
HcalLutGenerator(const edm::ParameterSet &)
Definition:
HcalLutGenerator.cc:21
edm::ESHandleBase::swap
void swap(ESHandleBase &iOther)
Definition:
ESHandle.h:39
HcalLutGenerator::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
HcalLutGenerator.cc:34
CaloTPGRecord.h
HcalTopology.h
Generated for CMSSW Reference Manual by
1.8.5