156 name =
"EBRDT event type pre calibration BX";
183 name =
"EBRDT event type calibration BX";
210 name =
"EBRDT event type post calibration BX";
237 name =
"EBRDT CRC errors";
239 for (
int i = 0;
i < 36;
i++) {
243 name =
"EBRDT run number errors";
245 for (
int i = 0;
i < 36;
i++) {
249 name =
"EBRDT orbit number errors";
251 for (
int i = 0;
i < 36;
i++) {
255 name =
"EBRDT trigger type errors";
257 for (
int i = 0;
i < 36;
i++) {
261 name =
"EBRDT calibration event errors";
263 for (
int i = 0;
i < 36;
i++) {
267 name =
"EBRDT L1A DCC errors";
269 for (
int i = 0;
i < 36;
i++) {
273 name =
"EBRDT bunch crossing DCC errors";
275 for (
int i = 0;
i < 36;
i++) {
279 name =
"EBRDT L1A FE errors";
281 for (
int i = 0;
i < 36;
i++) {
285 name =
"EBRDT bunch crossing FE errors";
287 for (
int i = 0;
i < 36;
i++) {
291 name =
"EBRDT L1A TCC errors";
293 for (
int i = 0;
i < 36;
i++) {
297 name =
"EBRDT bunch crossing TCC errors";
299 for (
int i = 0;
i < 36;
i++) {
303 name =
"EBRDT L1A SRP errors";
305 for (
int i = 0;
i < 36;
i++) {
309 name =
"EBRDT bunch crossing SRP errors";
311 for (
int i = 0;
i < 36;
i++) {
315 name =
"EBRDT FE synchronization errors by lumi";
318 for (
int i = 0;
i < 36;
i++) {
322 name =
"EBRDT accumulated FE synchronization errors";
332 if ( !
init_ )
return;
403 for(
int ix(1); ix <= 50; ix++)
425 float errorsInEvent(0.);
427 int evt_runNumber = e.
id().
run();
429 int GT_L1A=0, GT_OrbitNumber=0, GT_BunchCrossing=0, GT_TriggerType=0;
433 int gtFedDataSize = 0;
435 int ECALDCC_L1A_MostFreqId = -1;
436 int ECALDCC_OrbitNumber_MostFreqId = -1;
437 int ECALDCC_BunchCrossing_MostFreqId = -1;
438 int ECALDCC_TriggerType_MostFreqId = -1;
443 const FEDRawData& gtFedData = allFedRawData->FEDData(812);
447 if ( gtFedDataSize > 0 ) {
451 #define H_L1_MASK 0xFFFFFF
452 #define H_ORBITCOUNTER_MASK 0xFFFFFFFF
453 #define H_BX_MASK 0xFFF
454 #define H_TTYPE_MASK 0xF
465 std::map<int,int> ECALDCC_L1A_FreqMap;
466 std::map<int,int> ECALDCC_OrbitNumber_FreqMap;
467 std::map<int,int> ECALDCC_BunchCrossing_FreqMap;
468 std::map<int,int> ECALDCC_TriggerType_FreqMap;
470 int ECALDCC_L1A_MostFreqCounts = 0;
471 int ECALDCC_OrbitNumber_MostFreqCounts = 0;
472 int ECALDCC_BunchCrossing_MostFreqCounts = 0;
473 int ECALDCC_TriggerType_MostFreqCounts = 0;
483 int ECALDCC_L1A = dcchItr->getLV1();
484 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
485 int ECALDCC_BunchCrossing = dcchItr->getBX();
486 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
488 ++ECALDCC_L1A_FreqMap[ECALDCC_L1A];
489 ++ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
490 ++ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
491 ++ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
493 if ( ECALDCC_L1A_FreqMap[ECALDCC_L1A] > ECALDCC_L1A_MostFreqCounts ) {
494 ECALDCC_L1A_MostFreqCounts = ECALDCC_L1A_FreqMap[ECALDCC_L1A];
495 ECALDCC_L1A_MostFreqId = ECALDCC_L1A;
498 if ( ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber] > ECALDCC_OrbitNumber_MostFreqCounts ) {
499 ECALDCC_OrbitNumber_MostFreqCounts = ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
500 ECALDCC_OrbitNumber_MostFreqId = ECALDCC_OrbitNumber;
503 if ( ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing] > ECALDCC_BunchCrossing_MostFreqCounts ) {
504 ECALDCC_BunchCrossing_MostFreqCounts = ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
505 ECALDCC_BunchCrossing_MostFreqId = ECALDCC_BunchCrossing;
508 if ( ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType] > ECALDCC_TriggerType_MostFreqCounts ) {
509 ECALDCC_TriggerType_MostFreqCounts = ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
510 ECALDCC_TriggerType_MostFreqId = ECALDCC_TriggerType;
523 for(
int i=0;
i<36;
i++) {
525 const FEDRawData& fedData = allFedRawData->FEDData(EBFirstFED+
i);
532 uint64_t * fedTrailer = pData + (length - 1);
533 bool crcError = (*fedTrailer >> 2 ) & 0x1;
554 float xism = ism+0.5;
556 int ECALDCC_runNumber = dcchItr->getRunNumber();
558 int ECALDCC_L1A = dcchItr->getLV1();
559 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
560 int ECALDCC_BunchCrossing = dcchItr->getBX();
561 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
565 if ( gtFedDataSize > 0 ) {
583 if ( gtFedDataSize == 0 ) {
594 const std::vector<short> feBxs = dcchItr->getFEBxs();
595 const std::vector<short> tccBx = dcchItr->getTCCBx();
596 const short srpBx = dcchItr->getSRPBx();
597 const std::vector<short>
status = dcchItr->getFEStatus();
599 std::vector<int> BxSynchStatus;
600 BxSynchStatus.reserve((
int)feBxs.size());
602 for(
int fe=0; fe<(int)feBxs.size(); fe++) {
604 if(status[fe] != 0)
continue;
605 if(feBxs[fe] != ECALDCC_BunchCrossing && feBxs[fe] != -1 && ECALDCC_BunchCrossing != -1) {
607 BxSynchStatus[fe] = 0;
608 }
else BxSynchStatus[fe] = 1;
619 const std::vector<short> feLv1 = dcchItr->getFELv1();
620 const std::vector<short> tccLv1 = dcchItr->getTCCLv1();
621 const short srpLv1 = dcchItr->getSRPLv1();
624 int ECALDCC_L1A_12bit = ECALDCC_L1A & 0xfff;
627 for(
int fe=0; fe<(int)feLv1.size(); fe++) {
629 if(status[fe] != 0)
continue;
630 if(feLv1[fe]+feLv1Offset != ECALDCC_L1A_12bit && feLv1[fe] != -1 && ECALDCC_L1A_12bit - 1 != -1) {
633 errorsInEvent += 1. / feLv1.size();
634 }
else if( BxSynchStatus[fe]==0 ){
636 errorsInEvent += 1. / feLv1.size();
643 if(tccLv1[0] != ECALDCC_L1A_12bit && tccLv1[0] != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEBL1ATCCErrors_->
Fill( xism );
646 if(srpLv1 != ECALDCC_L1A_12bit && srpLv1 != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEBL1ASRPErrors_->
Fill( xism );
648 if ( gtFedDataSize == 0 ) {
658 float evtType = dcchItr->getRunType();
660 if ( evtType < 0 || evtType > 22 ) evtType = -1;
689 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
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meEBSynchronizationErrorsByLumi_
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
EBRawDataTask(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meEBTriggerTypeErrors_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * meEBEventTypePreCalibrationBX_
MonitorElement * meEBCRCErrors_
void rmdir(const std::string &fullpath)
Some "id" conversions.
MonitorElement * meEBCalibrationEventErrors_
static std::string sEB(const unsigned 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)
MonitorElement * meEBL1ATCCErrors_
MonitorElement * meEBOrbitNumberErrors_
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
BeginLuminosityBlock.
MonitorElement * meEBRunNumberErrors_
size_t size() const
Lenght of the data buffer in bytes.
MonitorElement * meEBL1ADCCErrors_
MonitorElement * meEBBunchCrossingDCCErrors_
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * meEBL1ASRPErrors_
void beginJob(void)
BeginJob.
MonitorElement * meEBEventTypePostCalibrationBX_
MonitorElement * meEBBunchCrossingTCCErrors_
void removeElement(const std::string &name)
edm::InputTag EcalRawDataCollection_
MonitorElement * meEBL1AFEErrors_
#define H_ORBITCOUNTER_MASK
void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
EndLuminosityBlock.
edm::InputTag FEDRawDataCollection_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * meEBSynchronizationErrorsTrend_
MonitorElement * meEBBunchCrossingFEErrors_
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
unsigned long long uint64_t
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
virtual ~EBRawDataTask()
Destructor.
void cleanup(void)
Cleanup.
double getBinContent(int binx) const
get content of bin (1-D)
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
MonitorElement * meEBEventTypeCalibrationBX_
edm::EventAuxiliary::ExperimentType experimentType() const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
MonitorElement * meEBBunchCrossingSRPErrors_
static EcalSubdetector subDet(const EBDetId &id)
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
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)