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