1 #include "../interface/RawDataTask.h" 41 MEs_.at(
"DesyncByLumi").reset();
42 MEs_.at(
"FEByLumi").reset();
43 MEs_.at(
"FEStatusErrMapByLumi").reset();
64 uint32_t *halfHeader((uint32_t *)gtFED.data());
65 l1A_ = *(halfHeader + 1) & 0xffffff;
68 for(
int iFED(601); iFED <= 654; iFED++){
70 unsigned length(fedData.size() /
sizeof(
uint64_t));
72 const uint64_t* pData(reinterpret_cast<uint64_t const*>(fedData.data()));
73 if((pData[length - 1] & 0x4) != 0) meCRC.fill(iFED - 600);
86 MESet& meTriggerType(
MEs_.at(
"TriggerType"));
92 MESet& meBXFEInvalid(
MEs_.at(
"BXFEInvalid"));
95 MESet& meFEStatusErrMapByLumi(
MEs_.at(
"FEStatusErrMapByLumi"));
96 MESet& meDesyncByLumi(
MEs_.at(
"DesyncByLumi"));
97 MESet& meDesyncTotal(
MEs_.at(
"DesyncTotal"));
103 MESet& meTrendNSyncErrors(
MEs_.at(
"L1ATCC"));
104 MESet& meEventTypePreCalib(
MEs_.at(
"EventTypePreCalib"));
105 MESet& meEventTypeCalib(
MEs_.at(
"EventTypeCalib"));
106 MESet& meEventTypePostCalib(
MEs_.at(
"EventTypePostCalib"));
110 map<int, int> l1aCounts;
112 l1aCounts[dcchItr->getLV1()]++;
115 for(map<int, int>::iterator l1aItr(l1aCounts.begin()); l1aItr != l1aCounts.end(); ++l1aItr){
116 if(l1aItr->second > maxVote){
117 maxVote = l1aItr->second;
118 l1A_ = l1aItr->first;
124 int dccId(dcchItr->id());
126 int dccL1A(dcchItr->getLV1());
127 short dccL1AShort(dccL1A & 0xfff);
128 int dccBX(dcchItr->getBX());
130 meOrbitDiff.fill(
dccId, dcchItr->getOrbit() -
orbit_);
131 meBXDCCDiff.fill(
dccId, dccBX -
bx_);
132 if(dccBX == -1) meBXFEInvalid.fill(
dccId, 68.5);
135 if(dcchItr->getOrbit() !=
orbit_) meOrbit.fill(
dccId);
138 if(dccBX !=
bx_) meBXDCC.fill(
dccId);
140 const vector<short> &feStatus(dcchItr->getFEStatus());
141 const vector<short> &feBxs(dcchItr->getFEBxs());
142 const vector<short> &feL1s(dcchItr->getFELv1());
145 double statusError(0.);
147 for(
unsigned iFE(0); iFE < feStatus.size(); iFE++){
150 short status(feStatus[iFE]);
152 if(feBxs[iFE] != -1 && dccBX != -1){
153 meBXFEDiff.fill(
dccId, feBxs[iFE] - dccBX);
155 if(feBxs[iFE] == -1) meBXFEInvalid.fill(
dccId, iFE + 0.5);
158 if(feBxs[iFE] != dccBX && feBxs[iFE] != -1 && dccBX != -1){
159 meBXFE.fill(
dccId, iFE + 0.5);
165 if(feL1s[iFE] +
feL1Offset_ != dccL1AShort && feL1s[iFE] != -1 && dccL1AShort != 0){
166 meL1AFE.fill(
dccId, iFE + 0.5);
171 if(iFE >= 68)
continue;
174 meFEStatus.fill(
id, status);
178 meFEStatusErrMapByLumi.fill(
id, status);
199 meDesyncByLumi.fill(
dccId, feDesync);
200 meDesyncTotal.fill(
dccId, feDesync);
204 meFEByLumi.fill(
dccId, statusError);
206 const vector<short> &tccBx(dcchItr->getTCCBx());
207 const vector<short> &tccL1(dcchItr->getTCCLv1());
209 if(tccBx.size() == 4){
210 if(dccId <= kEEmHigh + 1 || dccId >=
kEEpLow + 1){
211 for(
int iTCC(0); iTCC < 4; iTCC++){
213 if(tccBx[iTCC] != dccBX && tccBx[iTCC] != -1 && dccBX != -1)
216 if(tccL1[iTCC] != dccL1AShort && tccL1[iTCC] != -1 && dccL1AShort != 0)
217 meL1ATCC.fill(
dccId);
222 if(tccBx[0] != dccBX && tccBx[0] != -1 && dccBX != -1)
225 if(tccL1[0] != dccL1AShort && tccL1[0] != -1 && dccL1AShort != 0)
226 meL1ATCC.fill(
dccId);
231 short srpBx(dcchItr->getSRPBx());
232 short srpL1(dcchItr->getSRPLv1());
234 if(srpBx != dccBX && srpBx != -1 && dccBX != -1)
237 if(srpL1 != dccL1AShort && srpL1 != -1 && dccL1AShort != 0)
238 meL1ASRP.fill(
dccId);
240 const int calibBX(3490);
242 short runType(dcchItr->getRunType() + 1);
243 if(runType < 0 || runType > 22) runType = 0;
244 if(dccBX < calibBX) meEventTypePreCalib.fill(
dccId, runType, 1. / 54.);
245 else if(dccBX == calibBX) meEventTypeCalib.fill(
dccId, runType, 1. / 54.);
246 else meEventTypePostCalib.fill(
dccId, runType, 1. / 54.);
static const char runNumber_[]
#define DEFINE_ECALDQM_WORKER(TYPE)
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
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