Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
EventFilter
CSCRawToDigi
src
CSCDDUHeader.cc
Go to the documentation of this file.
1
#include "
EventFilter/CSCRawToDigi/interface/CSCDDUHeader.h
"
2
#include <string.h>
// for bzero
3
#include <iostream>
4
5
CSCDDUHeader::CSCDDUHeader
()
6
{
7
bzero(
this
,
sizeInWords
()*2);
8
init
();
9
}
10
11
12
CSCDDUHeader::CSCDDUHeader
(
unsigned
bx,
unsigned
l1num,
unsigned
sourceId,
unsigned
fmt_version)
13
: format_version_(fmt_version&0xF)
14
, source_id_(sourceId)
15
, bxnum_(bx)
16
, lvl1num_(l1num)
17
{
18
bzero(
this
,
sizeInWords
()*2);
19
source_id_
= sourceId;
20
bxnum_
= bx;
21
lvl1num_
= l1num;
22
format_version_
= fmt_version & 0xF;
23
init
();
24
}
25
26
27
void
CSCDDUHeader::init
()
28
{
29
bit64_
= 5;
30
header2_2_
= 0x0001;
31
header2_1_
=
header2_3_
= 0x8000;
32
}
33
34
35
void
CSCDDUHeader::setDMBDAV
(
int
dduInput)
36
{
37
// Set appropriate bit in dmb_dav_
38
39
dmb_dav_
|= ((1 << dduInput) & 0x7FFF);
// dduInput is 0-14
40
41
live_cscs_
|= ((1 << dduInput) & 0x7FFF);
// Set DDU Inputs Connected to "Live" CSCs
42
43
// Count bits set in dmb_dav_... for the trick used see
44
// http://en.wikipedia.org/wiki/Hamming_weight or http://graphics.stanford.edu/~seander/bithacks.html
45
46
ncsc_
= 0;
47
unsigned
short
dmbdav =
dmb_dav_
;
48
for
( ; dmbdav; ++
ncsc_
)
49
{
50
dmbdav &= dmbdav - 1;
51
}
52
}
53
54
bool
CSCDDUHeader::check
()
const
55
{
56
//std::cout <<"SANDRIK"<<std::hex <<header2_1_<<" "<<header2_2_ <<" "<<header2_3_<<std::endl;
57
return
bit64_
== 5 &&
header2_1_
== 0x8000 &&
header2_3_
== 0x8000
58
&&
header2_2_
== 0x0001;
59
}
60
CSCDDUHeader::source_id_
unsigned source_id_
Definition:
CSCDDUHeader.h:56
CSCDDUHeader::dmb_dav_
unsigned dmb_dav_
Definition:
CSCDDUHeader.h:74
CSCDDUHeader::lvl1num_
unsigned lvl1num_
Definition:
CSCDDUHeader.h:59
CSCDDUHeader::check
bool check() const
Definition:
CSCDDUHeader.cc:54
CSCDDUHeader.h
CSCDDUHeader::setDMBDAV
void setDMBDAV(int dduInput)
Definition:
CSCDDUHeader.cc:35
CSCDDUHeader::CSCDDUHeader
CSCDDUHeader()
Definition:
CSCDDUHeader.cc:5
CSCDDUHeader::header2_3_
unsigned header2_3_
Definition:
CSCDDUHeader.h:68
CSCDDUHeader::header2_2_
unsigned header2_2_
Definition:
CSCDDUHeader.h:67
CSCDDUHeader::ncsc_
unsigned ncsc_
Definition:
CSCDDUHeader.h:71
CSCDDUHeader::header2_1_
unsigned header2_1_
Definition:
CSCDDUHeader.h:66
CSCDDUHeader::live_cscs_
unsigned live_cscs_
Definition:
CSCDDUHeader.h:76
CSCDDUHeader::format_version_
unsigned format_version_
Definition:
CSCDDUHeader.h:55
CSCDDUHeader::bit64_
unsigned bit64_
should always be 5
Definition:
CSCDDUHeader.h:62
CSCDDUHeader::init
void init()
initializes constants
Definition:
CSCDDUHeader.cc:27
CSCDDUHeader::sizeInWords
static unsigned sizeInWords()
Definition:
CSCDDUHeader.h:32
CSCDDUHeader::bxnum_
unsigned bxnum_
Definition:
CSCDDUHeader.h:57
Generated for CMSSW Reference Manual by
1.8.5