133 name =
"EERDT event type pre calibration BX";
160 name =
"EERDT event type calibration BX";
187 name =
"EERDT event type post calibration BX";
214 name =
"EERDT CRC errors";
216 for (
int i = 0;
i < 18;
i++) {
220 name =
"EERDT run number errors";
222 for (
int i = 0;
i < 18;
i++) {
226 name =
"EERDT orbit number errors";
228 for (
int i = 0;
i < 18;
i++) {
232 name =
"EERDT trigger type errors";
234 for (
int i = 0;
i < 18;
i++) {
238 name =
"EERDT calibration event errors";
240 for (
int i = 0;
i < 18;
i++) {
244 name =
"EERDT L1A DCC errors";
246 for (
int i = 0;
i < 18;
i++) {
250 name =
"EERDT bunch crossing DCC errors";
252 for (
int i = 0;
i < 18;
i++) {
256 name =
"EERDT L1A FE errors";
258 for (
int i = 0;
i < 18;
i++) {
262 name =
"EERDT bunch crossing FE errors";
264 for (
int i = 0;
i < 18;
i++) {
268 name =
"EERDT L1A TCC errors";
270 for (
int i = 0;
i < 18;
i++) {
274 name =
"EERDT bunch crossing TCC errors";
276 for (
int i = 0;
i < 18;
i++) {
280 name =
"EERDT L1A SRP errors";
282 for (
int i = 0;
i < 18;
i++) {
286 name =
"EERDT bunch crossing SRP errors";
288 for (
int i = 0;
i < 18;
i++) {
292 name =
"EERDT FE synchronization errors by lumi";
295 for (
int i = 0;
i < 18;
i++) {
305 if ( !
init_ )
return;
387 int evt_runNumber = e.
id().
run();
389 int GT_L1A=0, GT_OrbitNumber=0, GT_BunchCrossing=0, GT_TriggerType=0;
393 int gtFedDataSize = 0;
395 int ECALDCC_L1A_MostFreqId = -1;
396 int ECALDCC_OrbitNumber_MostFreqId = -1;
397 int ECALDCC_BunchCrossing_MostFreqId = -1;
398 int ECALDCC_TriggerType_MostFreqId = -1;
403 const FEDRawData& gtFedData = allFedRawData->FEDData(812);
407 if ( gtFedDataSize > 0 ) {
411 #define H_L1_MASK 0xFFFFFF
412 #define H_ORBITCOUNTER_MASK 0xFFFFFFFF
413 #define H_BX_MASK 0xFFF
414 #define H_TTYPE_MASK 0xF
425 std::map<int,int> ECALDCC_L1A_FreqMap;
426 std::map<int,int> ECALDCC_OrbitNumber_FreqMap;
427 std::map<int,int> ECALDCC_BunchCrossing_FreqMap;
428 std::map<int,int> ECALDCC_TriggerType_FreqMap;
430 int ECALDCC_L1A_MostFreqCounts = 0;
431 int ECALDCC_OrbitNumber_MostFreqCounts = 0;
432 int ECALDCC_BunchCrossing_MostFreqCounts = 0;
433 int ECALDCC_TriggerType_MostFreqCounts = 0;
443 int ECALDCC_L1A = dcchItr->getLV1();
444 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
445 int ECALDCC_BunchCrossing = dcchItr->getBX();
446 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
448 ++ECALDCC_L1A_FreqMap[ECALDCC_L1A];
449 ++ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
450 ++ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
451 ++ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
453 if ( ECALDCC_L1A_FreqMap[ECALDCC_L1A] > ECALDCC_L1A_MostFreqCounts ) {
454 ECALDCC_L1A_MostFreqCounts = ECALDCC_L1A_FreqMap[ECALDCC_L1A];
455 ECALDCC_L1A_MostFreqId = ECALDCC_L1A;
458 if ( ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber] > ECALDCC_OrbitNumber_MostFreqCounts ) {
459 ECALDCC_OrbitNumber_MostFreqCounts = ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
460 ECALDCC_OrbitNumber_MostFreqId = ECALDCC_OrbitNumber;
463 if ( ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing] > ECALDCC_BunchCrossing_MostFreqCounts ) {
464 ECALDCC_BunchCrossing_MostFreqCounts = ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
465 ECALDCC_BunchCrossing_MostFreqId = ECALDCC_BunchCrossing;
468 if ( ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType] > ECALDCC_TriggerType_MostFreqCounts ) {
469 ECALDCC_TriggerType_MostFreqCounts = ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
470 ECALDCC_TriggerType_MostFreqId = ECALDCC_TriggerType;
485 for(
int zside=0; zside<2; zside++) {
487 int firstFedOnSide=EEFirstFED[zside];
489 for(
int i=0;
i<9;
i++) {
491 const FEDRawData& fedData = allFedRawData->FEDData(firstFedOnSide+
i);
498 uint64_t * fedTrailer = pData + (length - 1);
499 bool crcError = (*fedTrailer >> 2 ) & 0x1;
522 float xism = ism+0.5;
524 int ECALDCC_runNumber = dcchItr->getRunNumber();
526 int ECALDCC_L1A = dcchItr->getLV1();
527 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
528 int ECALDCC_BunchCrossing = dcchItr->getBX();
529 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
533 if ( gtFedDataSize > 0 ) {
551 if ( gtFedDataSize > 0 ) {
562 const std::vector<short> feBxs = dcchItr->getFEBxs();
563 const std::vector<short> tccBx = dcchItr->getTCCBx();
564 const short srpBx = dcchItr->getSRPBx();
565 const std::vector<short>
status = dcchItr->getFEStatus();
567 std::vector<int> BxSynchStatus;
568 BxSynchStatus.reserve((
int)feBxs.size());
570 for(
int fe=0; fe<(int)feBxs.size(); fe++) {
572 if( ( status[fe] == 10 || status[fe] == 11 ))
continue;
573 if(feBxs[fe] != ECALDCC_BunchCrossing && feBxs[fe] != -1 && ECALDCC_BunchCrossing != -1) {
575 BxSynchStatus[fe] = 0;
576 }
else BxSynchStatus[fe] = 1;
583 if(tccBx[tcc] != ECALDCC_BunchCrossing && tccBx[tcc] != -1 && ECALDCC_BunchCrossing != -1)
meEEBunchCrossingTCCErrors_->
Fill( xism, 1/(
float)tccBx.size());
589 const std::vector<short> feLv1 = dcchItr->getFELv1();
590 const std::vector<short> tccLv1 = dcchItr->getTCCLv1();
591 const short srpLv1 = dcchItr->getSRPLv1();
594 int ECALDCC_L1A_12bit = ECALDCC_L1A & 0xfff;
597 for(
int fe=0; fe<(int)feLv1.size(); fe++) {
599 if( ( status[fe] == 9 || status[fe] == 11 ))
continue;
600 if(feLv1[fe]+feLv1Offset != ECALDCC_L1A_12bit && feLv1[fe] != -1 && ECALDCC_L1A_12bit - 1 != -1) {
610 if(tccLv1[tcc] != ECALDCC_L1A_12bit && tccLv1[tcc] != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEEL1ATCCErrors_->
Fill( xism, 1/(
float)tccLv1.size());
614 if(srpLv1 != ECALDCC_L1A_12bit && srpLv1 != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEEL1ASRPErrors_->
Fill( xism );
616 if ( gtFedDataSize > 0 ) {
626 float evtType = dcchItr->getRunType();
628 if ( evtType < 0 || evtType > 22 ) evtType = -1;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
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_
static std::string sEE(const int ism)
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.
MonitorElement * meEECRCErrors_
static int iSM(const int ism, const EcalSubdetector subdet)
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 * meEEL1ADCCErrors_
void cleanup(void)
Cleanup.
MonitorElement * meEESynchronizationErrorsByLumi_
MonitorElement * meEEEventTypeCalibrationBX_
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 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_