156 name =
"EERDT event type pre calibration BX";
183 name =
"EERDT event type calibration BX";
210 name =
"EERDT event type post calibration BX";
237 name =
"EERDT CRC errors";
239 for (
int i = 0;
i < 18;
i++) {
243 name =
"EERDT run number errors";
245 for (
int i = 0;
i < 18;
i++) {
249 name =
"EERDT orbit number errors";
251 for (
int i = 0;
i < 18;
i++) {
255 name =
"EERDT trigger type errors";
257 for (
int i = 0;
i < 18;
i++) {
261 name =
"EERDT calibration event errors";
263 for (
int i = 0;
i < 18;
i++) {
267 name =
"EERDT L1A DCC errors";
269 for (
int i = 0;
i < 18;
i++) {
273 name =
"EERDT bunch crossing DCC errors";
275 for (
int i = 0;
i < 18;
i++) {
279 name =
"EERDT L1A FE errors";
281 for (
int i = 0;
i < 18;
i++) {
285 name =
"EERDT bunch crossing FE errors";
287 for (
int i = 0;
i < 18;
i++) {
291 name =
"EERDT L1A TCC errors";
293 for (
int i = 0;
i < 18;
i++) {
297 name =
"EERDT bunch crossing TCC errors";
299 for (
int i = 0;
i < 18;
i++) {
303 name =
"EERDT L1A SRP errors";
305 for (
int i = 0;
i < 18;
i++) {
309 name =
"EERDT bunch crossing SRP errors";
311 for (
int i = 0;
i < 18;
i++) {
315 name =
"EERDT FE synchronization errors by lumi";
318 for (
int i = 0;
i < 18;
i++) {
322 name =
"EERDT accumulated FE synchronization errors";
332 if ( !
init_ )
return;
402 for(
int ix(1); ix <= 50; ix++)
426 float errorsInEvent(0.);
428 int evt_runNumber = e.
id().
run();
430 int GT_L1A=0, GT_OrbitNumber=0, GT_BunchCrossing=0, GT_TriggerType=0;
434 int gtFedDataSize = 0;
436 int ECALDCC_L1A_MostFreqId = -1;
437 int ECALDCC_OrbitNumber_MostFreqId = -1;
438 int ECALDCC_BunchCrossing_MostFreqId = -1;
439 int ECALDCC_TriggerType_MostFreqId = -1;
444 const FEDRawData& gtFedData = allFedRawData->FEDData(812);
448 if ( gtFedDataSize > 0 ) {
452 #define H_L1_MASK 0xFFFFFF
453 #define H_ORBITCOUNTER_MASK 0xFFFFFFFF
454 #define H_BX_MASK 0xFFF
455 #define H_TTYPE_MASK 0xF
466 std::map<int,int> ECALDCC_L1A_FreqMap;
467 std::map<int,int> ECALDCC_OrbitNumber_FreqMap;
468 std::map<int,int> ECALDCC_BunchCrossing_FreqMap;
469 std::map<int,int> ECALDCC_TriggerType_FreqMap;
471 int ECALDCC_L1A_MostFreqCounts = 0;
472 int ECALDCC_OrbitNumber_MostFreqCounts = 0;
473 int ECALDCC_BunchCrossing_MostFreqCounts = 0;
474 int ECALDCC_TriggerType_MostFreqCounts = 0;
484 int ECALDCC_L1A = dcchItr->getLV1();
485 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
486 int ECALDCC_BunchCrossing = dcchItr->getBX();
487 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
489 ++ECALDCC_L1A_FreqMap[ECALDCC_L1A];
490 ++ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
491 ++ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
492 ++ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
494 if ( ECALDCC_L1A_FreqMap[ECALDCC_L1A] > ECALDCC_L1A_MostFreqCounts ) {
495 ECALDCC_L1A_MostFreqCounts = ECALDCC_L1A_FreqMap[ECALDCC_L1A];
496 ECALDCC_L1A_MostFreqId = ECALDCC_L1A;
499 if ( ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber] > ECALDCC_OrbitNumber_MostFreqCounts ) {
500 ECALDCC_OrbitNumber_MostFreqCounts = ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
501 ECALDCC_OrbitNumber_MostFreqId = ECALDCC_OrbitNumber;
504 if ( ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing] > ECALDCC_BunchCrossing_MostFreqCounts ) {
505 ECALDCC_BunchCrossing_MostFreqCounts = ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
506 ECALDCC_BunchCrossing_MostFreqId = ECALDCC_BunchCrossing;
509 if ( ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType] > ECALDCC_TriggerType_MostFreqCounts ) {
510 ECALDCC_TriggerType_MostFreqCounts = ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
511 ECALDCC_TriggerType_MostFreqId = ECALDCC_TriggerType;
526 for(
int zside=0; zside<2; zside++) {
528 int firstFedOnSide=EEFirstFED[zside];
530 for(
int i=0;
i<9;
i++) {
532 const FEDRawData& fedData = allFedRawData->FEDData(firstFedOnSide+
i);
539 uint64_t * fedTrailer = pData + (length - 1);
540 bool crcError = (*fedTrailer >> 2 ) & 0x1;
563 float xism = ism+0.5;
565 int ECALDCC_runNumber = dcchItr->getRunNumber();
567 int ECALDCC_L1A = dcchItr->getLV1();
568 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
569 int ECALDCC_BunchCrossing = dcchItr->getBX();
570 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
574 if ( gtFedDataSize > 0 ) {
592 if ( gtFedDataSize > 0 ) {
603 const std::vector<short> feBxs = dcchItr->getFEBxs();
604 const std::vector<short> tccBx = dcchItr->getTCCBx();
605 const short srpBx = dcchItr->getSRPBx();
606 const std::vector<short>
status = dcchItr->getFEStatus();
608 std::vector<int> BxSynchStatus;
609 BxSynchStatus.reserve((
int)feBxs.size());
611 for(
int fe=0; fe<(int)feBxs.size(); fe++) {
613 if(status[fe] != 0)
continue;
614 if(feBxs[fe] != ECALDCC_BunchCrossing && feBxs[fe] != -1 && ECALDCC_BunchCrossing != -1) {
616 BxSynchStatus[fe] = 0;
617 }
else BxSynchStatus[fe] = 1;
624 if(tccBx[tcc] != ECALDCC_BunchCrossing && tccBx[tcc] != -1 && ECALDCC_BunchCrossing != -1)
meEEBunchCrossingTCCErrors_->
Fill( xism, 1/(
float)tccBx.size());
630 const std::vector<short> feLv1 = dcchItr->getFELv1();
631 const std::vector<short> tccLv1 = dcchItr->getTCCLv1();
632 const short srpLv1 = dcchItr->getSRPLv1();
635 int ECALDCC_L1A_12bit = ECALDCC_L1A & 0xfff;
638 for(
int fe=0; fe<(int)feLv1.size(); fe++) {
640 if(status[fe] != 0)
continue;
641 if(feLv1[fe]+feLv1Offset != ECALDCC_L1A_12bit && feLv1[fe] != -1 && ECALDCC_L1A_12bit - 1 != -1) {
644 errorsInEvent += 1. / feLv1.size();
645 }
else if( BxSynchStatus[fe]==0 ){
647 errorsInEvent += 1. / feLv1.size();
655 if(tccLv1[tcc] != ECALDCC_L1A_12bit && tccLv1[tcc] != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEEL1ATCCErrors_->
Fill( xism, 1/(
float)tccLv1.size());
659 if(srpLv1 != ECALDCC_L1A_12bit && srpLv1 != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEEL1ASRPErrors_->
Fill( xism );
661 if ( gtFedDataSize > 0 ) {
671 float evtType = dcchItr->getRunType();
673 if ( evtType < 0 || evtType > 22 ) evtType = -1;
702 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)
Some "id" conversions.
MonitorElement * meEETriggerTypeErrors_
std::vector< T >::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
MonitorElement * meEECRCErrors_
EERawDataTask(const edm::ParameterSet &ps)
Constructor.
void removeElement(const std::string &name)
edm::InputTag EcalRawDataCollection_
MonitorElement * meEEEventTypePreCalibrationBX_
#define H_ORBITCOUNTER_MASK
MonitorElement * meEEOrbitNumberErrors_
MonitorElement * meEEL1AFEErrors_
MonitorElement * meEEL1ASRPErrors_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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::InputTag FEDRawDataCollection_
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_