Main Page
Namespaces
Classes
Package Documentation
EventFilter
CSCRawToDigi
src
CSCChamberDataItr.cc
Go to the documentation of this file.
1
#include "
EventFilter/CSCRawToDigi/interface/CSCChamberDataItr.h
"
2
#include "
EventFilter/CSCRawToDigi/interface/CSCDCCEventData.h
"
3
4
CSCChamberDataItr::CSCChamberDataItr
(
const
char
* buf) :
5
theDCCData(
nullptr
),
6
theCurrentDDU(0)
7
{
8
// first try if it's DCC data.
9
const
CSCDCCHeader
* dccHeader
10
=
reinterpret_cast<
const
CSCDCCHeader
*
>
(buf);
11
if
(dccHeader->
check
())
12
{
13
theDCCData
=
new
CSCDCCEventData
((
const
uint16_t *)buf);
14
theNumberOfDDUs
=
theDCCData
->
dduData
().size();
15
theDDUItr
=
new
CSCDDUDataItr
( &(
theDCCData
->
dduData
()[
theCurrentDDU
]) );
16
}
17
else
18
{
19
// it's DDU data, with only one DDU
20
theDDUItr
=
new
CSCDDUDataItr
(buf);
21
theNumberOfDDUs
= 1;
22
}
23
}
24
25
26
CSCChamberDataItr::~CSCChamberDataItr
()
27
{
28
// safe, even if it's zero
29
delete
theDCCData
;
30
}
31
32
33
bool
CSCChamberDataItr::next
()
34
{
35
bool
result
=
true
;
36
if
(!
theDDUItr
->
next
())
37
{
38
if
(++
theCurrentDDU
>=
theNumberOfDDUs
)
39
{
40
result =
false
;
41
}
42
else
43
{
44
// the next DDU exists, so initialize an itr
45
assert(
theDCCData
!=
nullptr
);
46
delete
theDDUItr
;
47
theDDUItr
=
new
CSCDDUDataItr
( &(
theDCCData
->
dduData
()[
theCurrentDDU
]) );
48
}
49
}
50
return
result
;
51
}
52
53
54
const
CSCEventData
&
CSCChamberDataItr::operator*
()
55
{
56
return
**
theDDUItr
;
57
}
58
59
CSCDCCEventData
01/20/05 A.Tumanov
Definition:
CSCDCCEventData.h:13
mps_fire.result
result
Definition:
mps_fire.py:291
CSCChamberDataItr::theDCCData
const CSCDCCEventData * theDCCData
make a new vector of DDUs (length 1).
Definition:
CSCChamberDataItr.h:39
nullptr
#define nullptr
Definition:
GCC11Compatibility.h:37
CSCDCCEventData::dduData
const std::vector< CSCDDUEventData > & dduData() const
accessor to dduData
Definition:
CSCDCCEventData.h:25
CSCDDUDataItr
Definition:
CSCDDUDataItr.h:13
CSCChamberDataItr::operator*
const CSCEventData & operator*()
Definition:
CSCChamberDataItr.cc:54
CSCChamberDataItr.h
CSCChamberDataItr::next
bool next()
Definition:
CSCChamberDataItr.cc:33
CSCDCCEventData.h
CSCChamberDataItr::theDDUItr
CSCDDUDataItr * theDDUItr
Definition:
CSCChamberDataItr.h:40
CSCChamberDataItr::CSCChamberDataItr
CSCChamberDataItr(const char *buf)
Definition:
CSCChamberDataItr.cc:4
CSCDCCHeader
Definition:
CSCDCCHeader.h:13
CSCDCCHeader::check
bool check() const
Definition:
CSCDCCHeader.h:30
CSCChamberDataItr::theCurrentDDU
unsigned theCurrentDDU
Definition:
CSCChamberDataItr.h:41
CSCChamberDataItr::theNumberOfDDUs
unsigned theNumberOfDDUs
Definition:
CSCChamberDataItr.h:42
CSCChamberDataItr::~CSCChamberDataItr
~CSCChamberDataItr()
Definition:
CSCChamberDataItr.cc:26
CSCDDUDataItr::next
bool next()
Definition:
CSCDDUDataItr.cc:90
CSCEventData
Definition:
CSCEventData.h:28
Generated for CMSSW Reference Manual by
1.8.11