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) : theDCCData(
nullptr
), theCurrentDDU(0) {
5
// first try if it's DCC data.
6
const
CSCDCCHeader
*dccHeader =
reinterpret_cast<
const
CSCDCCHeader
*
>
(buf);
7
if
(dccHeader->
check
()) {
8
theDCCData
=
new
CSCDCCEventData
((
const
uint16_t *)buf);
9
theNumberOfDDUs
=
theDCCData
->
dduData
().size();
10
theDDUItr
=
new
CSCDDUDataItr
(&(
theDCCData
->
dduData
()[
theCurrentDDU
]));
11
}
else
{
12
// it's DDU data, with only one DDU
13
theDDUItr
=
new
CSCDDUDataItr
(buf);
14
theNumberOfDDUs
= 1;
15
}
16
}
17
18
CSCChamberDataItr::~CSCChamberDataItr
() {
19
// safe, even if it's zero
20
delete
theDCCData
;
21
}
22
23
bool
CSCChamberDataItr::next
() {
24
bool
result
=
true
;
25
if
(!
theDDUItr
->
next
()) {
26
if
(++
theCurrentDDU
>=
theNumberOfDDUs
) {
27
result =
false
;
28
}
else
{
29
// the next DDU exists, so initialize an itr
30
assert(
theDCCData
!=
nullptr
);
31
delete
theDDUItr
;
32
theDDUItr
=
new
CSCDDUDataItr
(&(
theDCCData
->
dduData
()[
theCurrentDDU
]));
33
}
34
}
35
return
result
;
36
}
37
38
const
CSCEventData
&
CSCChamberDataItr::operator*
() {
return
**
theDDUItr
; }
CSCDCCEventData
01/20/05 A.Tumanov
Definition:
CSCDCCEventData.h:13
mps_fire.result
result
Definition:
mps_fire.py:294
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:38
CSCChamberDataItr.h
CSCChamberDataItr::next
bool next()
Definition:
CSCChamberDataItr.cc:23
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:27
CSCChamberDataItr::theCurrentDDU
unsigned theCurrentDDU
Definition:
CSCChamberDataItr.h:41
CSCChamberDataItr::theNumberOfDDUs
unsigned theNumberOfDDUs
Definition:
CSCChamberDataItr.h:42
CSCChamberDataItr::~CSCChamberDataItr
~CSCChamberDataItr()
Definition:
CSCChamberDataItr.cc:18
CSCDDUDataItr::next
bool next()
Definition:
CSCDDUDataItr.cc:59
CSCEventData
Definition:
CSCEventData.h:28
Generated for CMSSW Reference Manual by
1.8.11