14 uint32_t wordEventOffset,
15 uint32_t expectedTowerID)
16 :
DCCTBBlockPrototype(parser,
"TOWERHEADER", buffer, numbBytes, wordsToEnd, wordEventOffset),
18 expectedTowerID_(expectedTowerID) {
22 errors_[
"FE::BLOCK LENGTH"] = 0;
38 uint32_t numbOfXtalBlocks = 0;
41 numbOfXtalBlocks = (length - 1) / numbDWInXtalBlock;
43 uint32_t xtalBlockSize = numbDWInXtalBlock * 8;
52 if (!zs && numbOfXtalBlocks != 25) {
53 (
errors_[
"FE::BLOCK LENGTH"])++;
54 errorString_ +=
"\n ======================================================================\n";
57 "\n Tower Length is : " + (
parser_->
getDecString(numbBytes / 8)) + std::string(
" , while it should be : ");
61 errorString_ +=
"\n ======================================================================";
64 if (numbOfXtalBlocks > 25) {
65 if (
errors_[
"FE::BLOCK LENGTH"] == 0)
66 (
errors_[
"FE::BLOCK LENGTH"])++;
67 errorString_ +=
"\n ======================================================================\n";
72 errorString_ +=
"\n Action -> data after the xtal 25 is ignored... ";
73 errorString_ +=
"\n ======================================================================";
81 uint32_t stripID, xtalID;
83 for (uint32_t numbXtal = 1; numbXtal <= numbOfXtalBlocks && numbXtal <= 25; numbXtal++) {
86 stripID = (numbXtal - 1) / 5 + 1;
87 xtalID = numbXtal - (stripID - 1) * 5;
109 std::vector<DCCTBXtalBlock *>::iterator it;
119 std::pair<bool, std::string> res;
130 checkErrors += res.second;
137 checkErrors += res.second;
142 if (!checkErrors.empty()) {
145 errorString_ +=
"\n ======================================================================\n";
149 errorString_ +=
"\n ======================================================================";
155 std::vector<DCCTBXtalBlock *> myVector;
156 std::vector<DCCTBXtalBlock *>::iterator it;
160 std::pair<bool, std::string> stripIdCheck = (*it)->checkDataField(
"STRIP ID", stripId);
161 std::pair<bool, std::string> xtalIdCheck = (*it)->checkDataField(
"XTAL ID", xtalId);
163 if (xtalIdCheck.first && stripIdCheck.first) {
164 myVector.push_back((*it));
177 for (std::set<DCCTBDataField *, DCCTBDataFieldComparator>::iterator it =
mapperFields_->begin();
180 if ((*it)->name() ==
"TT/SC ID")
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
virtual uint32_t getDataField(std::string name)
virtual void increment(uint32_t numb, std::string msg="")
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
DCCTBDataParser * parser_
~DCCTBTowerBlock() override
std::string getDecString(uint32_t data)
std::map< std::string, uint32_t > errors_
uint32_t numbXtalSamples()
uint32_t wordEventOffset_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * towerFields()
std::vector< DCCTBXtalBlock * > xtalBlocks_
DCCTBDataMapper * mapper()
uint32_t expectedTowerID_
DCCTBEventBlock * dccBlock_
uint32_t wordsToEndOfEvent_
std::vector< DCCTBXtalBlock * > xtalBlocksById(uint32_t stripId, uint32_t xtalId)
DCCTBTowerBlock(DCCTBEventBlock *dccBlock, DCCTBDataParser *parser, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEnd, uint32_t wordEventOffset, uint32_t expectedTowerID)