1 #include "../interface/RawDataTask.h"
40 MEs_.at(
"DesyncByLumi").reset();
41 MEs_.at(
"FEByLumi").reset();
62 uint32_t *halfHeader((uint32_t *)gtFED.data());
63 l1A_ = *(halfHeader + 1) & 0xffffff;
66 for(
int iFED(601); iFED <= 654; iFED++){
68 unsigned length(fedData.size() /
sizeof(
uint64_t));
70 const uint64_t* pData(reinterpret_cast<uint64_t const*>(fedData.data()));
71 if((pData[length - 1] & 0x4) != 0) meCRC.fill(iFED - 600);
84 MESet& meTriggerType(
MEs_.at(
"TriggerType"));
90 MESet& meBXFEInvalid(
MEs_.at(
"BXFEInvalid"));
93 MESet& meDesyncByLumi(
MEs_.at(
"DesyncByLumi"));
94 MESet& meDesyncTotal(
MEs_.at(
"DesyncTotal"));
100 MESet& meTrendNSyncErrors(
MEs_.at(
"L1ATCC"));
101 MESet& meEventTypePreCalib(
MEs_.at(
"EventTypePreCalib"));
102 MESet& meEventTypeCalib(
MEs_.at(
"EventTypeCalib"));
103 MESet& meEventTypePostCalib(
MEs_.at(
"EventTypePostCalib"));
107 map<int, int> l1aCounts;
109 l1aCounts[dcchItr->getLV1()]++;
112 for(map<int, int>::iterator l1aItr(l1aCounts.begin()); l1aItr != l1aCounts.end(); ++l1aItr){
113 if(l1aItr->second > maxVote){
114 maxVote = l1aItr->second;
115 l1A_ = l1aItr->first;
121 int dccId(dcchItr->id());
123 int dccL1A(dcchItr->getLV1());
124 short dccL1AShort(dccL1A & 0xfff);
125 int dccBX(dcchItr->getBX());
127 meOrbitDiff.fill(
dccId, dcchItr->getOrbit() -
orbit_);
128 meBXDCCDiff.fill(
dccId, dccBX -
bx_);
129 if(dccBX == -1) meBXFEInvalid.fill(
dccId, 68.5);
131 if(dcchItr->getRunNumber() != int(
runNumber_)) meRunNumber.fill(
dccId);
132 if(dcchItr->getOrbit() !=
orbit_) meOrbit.fill(
dccId);
135 if(dccBX !=
bx_) meBXDCC.fill(
dccId);
137 const vector<short> &feStatus(dcchItr->getFEStatus());
138 const vector<short> &feBxs(dcchItr->getFEBxs());
139 const vector<short> &feL1s(dcchItr->getFELv1());
142 double statusError(0.);
144 for(
unsigned iFE(0); iFE < feStatus.size(); iFE++){
147 short status(feStatus[iFE]);
149 if(feBxs[iFE] != -1 && dccBX != -1){
150 meBXFEDiff.fill(
dccId, feBxs[iFE] - dccBX);
152 if(feBxs[iFE] == -1) meBXFEInvalid.fill(
dccId, iFE + 0.5);
155 if(feBxs[iFE] != dccBX && feBxs[iFE] != -1 && dccBX != -1){
156 meBXFE.fill(
dccId, iFE + 0.5);
162 if(feL1s[iFE] +
feL1Offset_ != dccL1AShort && feL1s[iFE] != -1 && dccL1AShort != 0){
163 meL1AFE.fill(
dccId, iFE + 0.5);
168 if(iFE >= 68)
continue;
171 meFEStatus.fill(
id, status);
192 meDesyncByLumi.fill(
dccId, feDesync);
193 meDesyncTotal.fill(
dccId, feDesync);
197 meFEByLumi.fill(
dccId, statusError);
199 const vector<short> &tccBx(dcchItr->getTCCBx());
200 const vector<short> &tccL1(dcchItr->getTCCLv1());
202 if(tccBx.size() == 4){
203 if(dccId <= kEEmHigh + 1 || dccId >=
kEEpLow + 1){
204 for(
int iTCC(0); iTCC < 4; iTCC++){
206 if(tccBx[iTCC] != dccBX && tccBx[iTCC] != -1 && dccBX != -1)
209 if(tccL1[iTCC] != dccL1AShort && tccL1[iTCC] != -1 && dccL1AShort != 0)
210 meL1ATCC.fill(
dccId);
215 if(tccBx[0] != dccBX && tccBx[0] != -1 && dccBX != -1)
218 if(tccL1[0] != dccL1AShort && tccL1[0] != -1 && dccL1AShort != 0)
219 meL1ATCC.fill(
dccId);
224 short srpBx(dcchItr->getSRPBx());
225 short srpL1(dcchItr->getSRPLv1());
227 if(srpBx != dccBX && srpBx != -1 && dccBX != -1)
230 if(srpL1 != dccL1AShort && srpL1 != -1 && dccL1AShort != 0)
231 meL1ASRP.fill(
dccId);
233 const int calibBX(3490);
235 short runType(dcchItr->getRunType() + 1);
236 if(runType < 0 || runType > 22)
runType = 0;
237 if(dccBX < calibBX) meEventTypePreCalib.fill(
dccId,
runType, 1. / 54.);
238 else if(dccBX == calibBX) meEventTypeCalib.fill(
dccId,
runType, 1. / 54.);
239 else meEventTypePostCalib.fill(
dccId,
runType, 1. / 54.);
static const char runNumber_[]
edm::LuminosityBlockNumber_t iLumi
void runOnRawData(EcalRawDataCollection const &)
EcalElectronicsMapping const * getElectronicsMap()
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
int bunchCrossing() const
bool ccuExists(unsigned, unsigned)
void addDependencies(DependencySet &) override
DEFINE_ECALDQM_WORKER(CalibrationSummaryClient)
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::RunNumber_t runNumber_
void beginRun(edm::Run const &, edm::EventSetup const &) override
void runOnSource(FEDRawDataCollection const &)
void beginEvent(edm::Event const &, edm::EventSetup const &) override
const_iterator end() const
unsigned long long uint64_t
edm::EventAuxiliary::ExperimentType experimentType() const
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void push_back(Dependency const &_d)
unsigned dccId(DetId const &)
const_iterator begin() const