152 name =
"EERDT event type pre calibration BX";
179 name =
"EERDT event type calibration BX";
206 name =
"EERDT event type post calibration BX";
233 name =
"EERDT CRC errors";
235 for (
int i = 0;
i < 18;
i++) {
239 name =
"EERDT run number errors";
241 for (
int i = 0;
i < 18;
i++) {
245 name =
"EERDT orbit number errors";
247 for (
int i = 0;
i < 18;
i++) {
251 name =
"EERDT trigger type errors";
253 for (
int i = 0;
i < 18;
i++) {
257 name =
"EERDT calibration event errors";
259 for (
int i = 0;
i < 18;
i++) {
263 name =
"EERDT L1A DCC errors";
265 for (
int i = 0;
i < 18;
i++) {
269 name =
"EERDT bunch crossing DCC errors";
271 for (
int i = 0;
i < 18;
i++) {
275 name =
"EERDT L1A FE errors";
277 for (
int i = 0;
i < 18;
i++) {
281 name =
"EERDT bunch crossing FE errors";
283 for (
int i = 0;
i < 18;
i++) {
287 name =
"EERDT L1A TCC errors";
289 for (
int i = 0;
i < 18;
i++) {
293 name =
"EERDT bunch crossing TCC errors";
295 for (
int i = 0;
i < 18;
i++) {
299 name =
"EERDT L1A SRP errors";
301 for (
int i = 0;
i < 18;
i++) {
305 name =
"EERDT bunch crossing SRP errors";
307 for (
int i = 0;
i < 18;
i++) {
311 name =
"EERDT FE synchronization errors by lumi";
314 for (
int i = 0;
i < 18;
i++) {
318 name =
"EERDT accumulated FE synchronization errors";
328 if ( !
init_ )
return;
398 for(
int ix(1); ix <= 50; ix++)
422 float errorsInEvent(0.);
424 int evt_runNumber = e.
id().
run();
426 int GT_L1A=0, GT_OrbitNumber=0, GT_BunchCrossing=0, GT_TriggerType=0;
430 int gtFedDataSize = 0;
432 int ECALDCC_L1A_MostFreqId = -1;
433 int ECALDCC_OrbitNumber_MostFreqId = -1;
434 int ECALDCC_BunchCrossing_MostFreqId = -1;
435 int ECALDCC_TriggerType_MostFreqId = -1;
440 const FEDRawData& gtFedData = allFedRawData->FEDData(812);
444 if ( gtFedDataSize > 0 ) {
448 #define H_L1_MASK 0xFFFFFF
449 #define H_ORBITCOUNTER_MASK 0xFFFFFFFF
450 #define H_BX_MASK 0xFFF
451 #define H_TTYPE_MASK 0xF
462 std::map<int,int> ECALDCC_L1A_FreqMap;
463 std::map<int,int> ECALDCC_OrbitNumber_FreqMap;
464 std::map<int,int> ECALDCC_BunchCrossing_FreqMap;
465 std::map<int,int> ECALDCC_TriggerType_FreqMap;
467 int ECALDCC_L1A_MostFreqCounts = 0;
468 int ECALDCC_OrbitNumber_MostFreqCounts = 0;
469 int ECALDCC_BunchCrossing_MostFreqCounts = 0;
470 int ECALDCC_TriggerType_MostFreqCounts = 0;
480 int ECALDCC_L1A = dcchItr->getLV1();
481 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
482 int ECALDCC_BunchCrossing = dcchItr->getBX();
483 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
485 ++ECALDCC_L1A_FreqMap[ECALDCC_L1A];
486 ++ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
487 ++ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
488 ++ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
490 if ( ECALDCC_L1A_FreqMap[ECALDCC_L1A] > ECALDCC_L1A_MostFreqCounts ) {
491 ECALDCC_L1A_MostFreqCounts = ECALDCC_L1A_FreqMap[ECALDCC_L1A];
492 ECALDCC_L1A_MostFreqId = ECALDCC_L1A;
495 if ( ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber] > ECALDCC_OrbitNumber_MostFreqCounts ) {
496 ECALDCC_OrbitNumber_MostFreqCounts = ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
497 ECALDCC_OrbitNumber_MostFreqId = ECALDCC_OrbitNumber;
500 if ( ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing] > ECALDCC_BunchCrossing_MostFreqCounts ) {
501 ECALDCC_BunchCrossing_MostFreqCounts = ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
502 ECALDCC_BunchCrossing_MostFreqId = ECALDCC_BunchCrossing;
505 if ( ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType] > ECALDCC_TriggerType_MostFreqCounts ) {
506 ECALDCC_TriggerType_MostFreqCounts = ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
507 ECALDCC_TriggerType_MostFreqId = ECALDCC_TriggerType;
513 edm::LogWarning(
"EERawDataTask") <<
"EcalRawDataCollection not available";
522 for(
int zside=0; zside<2; zside++) {
524 int firstFedOnSide=EEFirstFED[zside];
526 for(
int i=0;
i<9;
i++) {
528 const FEDRawData& fedData = allFedRawData->FEDData(firstFedOnSide+
i);
535 uint64_t * fedTrailer = pData + (length - 1);
536 bool crcError = (*fedTrailer >> 2 ) & 0x1;
547 edm::LogWarning(
"EERawDataTask") <<
"FEDRawDataCollection not available";
559 float xism = ism+0.5;
561 int ECALDCC_runNumber = dcchItr->getRunNumber();
563 int ECALDCC_L1A = dcchItr->getLV1();
564 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
565 int ECALDCC_BunchCrossing = dcchItr->getBX();
566 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
570 if ( gtFedDataSize > 0 ) {
588 if ( gtFedDataSize > 0 ) {
599 const std::vector<short> feBxs = dcchItr->getFEBxs();
600 const std::vector<short> tccBx = dcchItr->getTCCBx();
601 const short srpBx = dcchItr->getSRPBx();
602 const std::vector<short>
status = dcchItr->getFEStatus();
604 std::vector<int> BxSynchStatus;
605 BxSynchStatus.reserve((
int)feBxs.size());
607 for(
int fe=0; fe<(int)feBxs.size(); fe++) {
609 if(status[fe] != 0)
continue;
610 if(feBxs[fe] != ECALDCC_BunchCrossing && feBxs[fe] != -1 && ECALDCC_BunchCrossing != -1) {
612 BxSynchStatus[fe] = 0;
613 }
else BxSynchStatus[fe] = 1;
620 if(tccBx[tcc] != ECALDCC_BunchCrossing && tccBx[tcc] != -1 && ECALDCC_BunchCrossing != -1)
meEEBunchCrossingTCCErrors_->
Fill( xism, 1/(
float)tccBx.size());
626 const std::vector<short> feLv1 = dcchItr->getFELv1();
627 const std::vector<short> tccLv1 = dcchItr->getTCCLv1();
628 const short srpLv1 = dcchItr->getSRPLv1();
631 int ECALDCC_L1A_12bit = ECALDCC_L1A & 0xfff;
634 for(
int fe=0; fe<(int)feLv1.size(); fe++) {
636 if(status[fe] != 0)
continue;
637 if(feLv1[fe]+feLv1Offset != ECALDCC_L1A_12bit && feLv1[fe] != -1 && ECALDCC_L1A_12bit - 1 != -1) {
640 errorsInEvent += 1. / feLv1.size();
641 }
else if( BxSynchStatus[fe]==0 ){
643 errorsInEvent += 1. / feLv1.size();
651 if(tccLv1[tcc] != ECALDCC_L1A_12bit && tccLv1[tcc] != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEEL1ATCCErrors_->
Fill( xism, 1/(
float)tccLv1.size());
655 if(srpLv1 != ECALDCC_L1A_12bit && srpLv1 != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEEL1ASRPErrors_->
Fill( xism );
657 if ( gtFedDataSize > 0 ) {
667 float evtType = dcchItr->getRunType();
669 if ( evtType < 0 || evtType > 22 ) evtType = -1;
695 edm::LogWarning(
"EERawDataTask") <<
"EcalRawDataCollection not available";
698 if(errorsInEvent > 0.){
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
static std::string sEE(const unsigned ism)
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meEECalibrationEventErrors_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Some "id" conversions.
MonitorElement * meEETriggerTypeErrors_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
int bunchCrossing() const
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void beginJob(void)
BeginJob.
MonitorElement * meEEL1ATCCErrors_
size_t size() const
Lenght of the data buffer in bytes.
LuminosityBlockNumber_t luminosityBlock() const
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
MonitorElement * meEECRCErrors_
EERawDataTask(const edm::ParameterSet &ps)
Constructor.
void removeElement(const std::string &name)
MonitorElement * meEEEventTypePreCalibrationBX_
#define H_ORBITCOUNTER_MASK
MonitorElement * meEEOrbitNumberErrors_
MonitorElement * meEEL1AFEErrors_
MonitorElement * meEEL1ASRPErrors_
MonitorElement * meEEEventTypePostCalibrationBX_
MonitorElement * meEEBunchCrossingSRPErrors_
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
unsigned long long uint64_t
MonitorElement * meEEBunchCrossingTCCErrors_
virtual ~EERawDataTask()
Destructor.
MonitorElement * meEESynchronizationErrorsTrend_
MonitorElement * meEEL1ADCCErrors_
void cleanup(void)
Cleanup.
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * meEESynchronizationErrorsByLumi_
MonitorElement * meEEEventTypeCalibrationBX_
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
edm::EventAuxiliary::ExperimentType experimentType() const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
EndLuminosityBlock.
static EcalSubdetector subDet(const EBDetId &id)
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
MonitorElement * meEERunNumberErrors_
int ism(int ieta, int iphi)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
BeginLuminosityBlock.
MonitorElement * meEEBunchCrossingFEErrors_
MonitorElement * meEEBunchCrossingDCCErrors_