src
EventFilter
L1TRawToDigi
plugins
implementations_stage2
CICADAUnpacker.cc
Go to the documentation of this file.
1
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
2
#include "
EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h
"
3
4
#include "
CICADAUnpacker.h
"
5
6
#include <cmath>
7
8
using namespace
edm
;
9
10
namespace
l1t
{
11
namespace
stage2
{
12
bool
CICADAUnpacker::unpack
(
const
Block
&
block
,
UnpackerCollections
* coll) {
13
LogDebug
(
"L1T"
) <<
"Block Size = "
<<
block
.header().getSize();
14
LogDebug
(
"L1T"
) <<
"Board ID = "
<<
block
.amc().getBoardID();
15
16
auto
res
=
static_cast<
CaloLayer1Collections
*
>
(coll)->getCICADABxCollection();
17
// default BX range to trigger standard -2 to 2
18
// Even though CICADA will never have BX information
19
// And everything gets put in BX 0
20
res
->setBXRange(-2, 2);
21
22
int
amc_slot =
block
.amc().getAMCNumber();
23
if
(not(amc_slot == 7)) {
24
throw
cms::Exception
(
"CICADAUnpacker"
)
25
<<
"Calo Summary (CICADA) unpacker is unpacking an unexpected AMC. Expected AMC number 7, got AMC number "
26
<< amc_slot << std::endl;
27
return
false
;
28
}
else
{
29
const
uint32_t*
base
=
block
.payload().data();
30
//First 4 bits of the first 4 words are CICADA bits
31
uint32_t
word
= (caloCrateCicadaBitsPattern &
base
[0]) >> 16 | (caloCrateCicadaBitsPattern &
base
[1]) >> 20 |
32
(caloCrateCicadaBitsPattern &
base
[2]) >> 24 | (caloCrateCicadaBitsPattern &
base
[3]) >> 28;
33
float
score
=
static_cast<
float
>
(
word
) / 256.
f
;
34
res
->push_back(0,
score
);
35
return
true
;
36
}
37
}
38
39
}
// namespace stage2
40
}
// namespace l1t
41
42
DEFINE_L1T_UNPACKER
(
l1t::stage2::CICADAUnpacker
);
CICADAUnpacker.h
Exception
Definition:
hltDiff.cc:245
MessageLogger.h
UnpackerFactory.h
edmMakeDummyCfis.base
base
Definition:
edmMakeDummyCfis.py:22
offlineSlimmedPrimaryVertices_cfi.score
score
Definition:
offlineSlimmedPrimaryVertices_cfi.py:6
l1t
delete x;
Definition:
CaloConfig.h:22
res
Definition:
Electron.h:6
l1t::UnpackerCollections
Definition:
UnpackerCollections.h:9
l1t::stage2::CaloLayer1Collections
Definition:
CaloLayer1Collections.h:13
word
uint64_t word
Definition:
CTPPSTotemDataFormatter.cc:29
l1t::stage2::CICADAUnpacker
Definition:
CICADAUnpacker.h:9
beamSpotPI::unpack
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
Definition:
BeamSpotPayloadInspectorHelper.h:28
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
groupFilesInBlocks.block
block
Definition:
groupFilesInBlocks.py:150
SiStripSourceConfigTier0_cff.stage2
stage2
Definition:
SiStripSourceConfigTier0_cff.py:74
edm
HLT enums.
Definition:
AlignableModifier.h:19
DEFINE_L1T_UNPACKER
#define DEFINE_L1T_UNPACKER(type)
Definition:
UnpackerFactory.h:23
l1t::Block
Definition:
Block.h:70
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:241
Generated for CMSSW Reference Manual by
1.8.14