152 name =
"EBRDT event type pre calibration BX";
179 name =
"EBRDT event type calibration BX";
206 name =
"EBRDT event type post calibration BX";
233 name =
"EBRDT CRC errors";
235 for (
int i = 0;
i < 36;
i++) {
239 name =
"EBRDT run number errors";
241 for (
int i = 0;
i < 36;
i++) {
245 name =
"EBRDT orbit number errors";
247 for (
int i = 0;
i < 36;
i++) {
251 name =
"EBRDT trigger type errors";
253 for (
int i = 0;
i < 36;
i++) {
257 name =
"EBRDT calibration event errors";
259 for (
int i = 0;
i < 36;
i++) {
263 name =
"EBRDT L1A DCC errors";
265 for (
int i = 0;
i < 36;
i++) {
269 name =
"EBRDT bunch crossing DCC errors";
271 for (
int i = 0;
i < 36;
i++) {
275 name =
"EBRDT L1A FE errors";
277 for (
int i = 0;
i < 36;
i++) {
281 name =
"EBRDT bunch crossing FE errors";
283 for (
int i = 0;
i < 36;
i++) {
287 name =
"EBRDT L1A TCC errors";
289 for (
int i = 0;
i < 36;
i++) {
293 name =
"EBRDT bunch crossing TCC errors";
295 for (
int i = 0;
i < 36;
i++) {
299 name =
"EBRDT L1A SRP errors";
301 for (
int i = 0;
i < 36;
i++) {
305 name =
"EBRDT bunch crossing SRP errors";
307 for (
int i = 0;
i < 36;
i++) {
311 name =
"EBRDT FE synchronization errors by lumi";
314 for (
int i = 0;
i < 36;
i++) {
318 name =
"EBRDT accumulated FE synchronization errors";
328 if ( !
init_ )
return;
399 for(
int ix(1); ix <= 50; ix++)
421 float errorsInEvent(0.);
423 int evt_runNumber = e.
id().
run();
425 int GT_L1A=0, GT_OrbitNumber=0, GT_BunchCrossing=0, GT_TriggerType=0;
429 int gtFedDataSize = 0;
431 int ECALDCC_L1A_MostFreqId = -1;
432 int ECALDCC_OrbitNumber_MostFreqId = -1;
433 int ECALDCC_BunchCrossing_MostFreqId = -1;
434 int ECALDCC_TriggerType_MostFreqId = -1;
439 const FEDRawData& gtFedData = allFedRawData->FEDData(812);
443 if ( gtFedDataSize > 0 ) {
447 #define H_L1_MASK 0xFFFFFF
448 #define H_ORBITCOUNTER_MASK 0xFFFFFFFF
449 #define H_BX_MASK 0xFFF
450 #define H_TTYPE_MASK 0xF
461 std::map<int,int> ECALDCC_L1A_FreqMap;
462 std::map<int,int> ECALDCC_OrbitNumber_FreqMap;
463 std::map<int,int> ECALDCC_BunchCrossing_FreqMap;
464 std::map<int,int> ECALDCC_TriggerType_FreqMap;
466 int ECALDCC_L1A_MostFreqCounts = 0;
467 int ECALDCC_OrbitNumber_MostFreqCounts = 0;
468 int ECALDCC_BunchCrossing_MostFreqCounts = 0;
469 int ECALDCC_TriggerType_MostFreqCounts = 0;
479 int ECALDCC_L1A = dcchItr->getLV1();
480 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
481 int ECALDCC_BunchCrossing = dcchItr->getBX();
482 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
484 ++ECALDCC_L1A_FreqMap[ECALDCC_L1A];
485 ++ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
486 ++ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
487 ++ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
489 if ( ECALDCC_L1A_FreqMap[ECALDCC_L1A] > ECALDCC_L1A_MostFreqCounts ) {
490 ECALDCC_L1A_MostFreqCounts = ECALDCC_L1A_FreqMap[ECALDCC_L1A];
491 ECALDCC_L1A_MostFreqId = ECALDCC_L1A;
494 if ( ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber] > ECALDCC_OrbitNumber_MostFreqCounts ) {
495 ECALDCC_OrbitNumber_MostFreqCounts = ECALDCC_OrbitNumber_FreqMap[ECALDCC_OrbitNumber];
496 ECALDCC_OrbitNumber_MostFreqId = ECALDCC_OrbitNumber;
499 if ( ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing] > ECALDCC_BunchCrossing_MostFreqCounts ) {
500 ECALDCC_BunchCrossing_MostFreqCounts = ECALDCC_BunchCrossing_FreqMap[ECALDCC_BunchCrossing];
501 ECALDCC_BunchCrossing_MostFreqId = ECALDCC_BunchCrossing;
504 if ( ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType] > ECALDCC_TriggerType_MostFreqCounts ) {
505 ECALDCC_TriggerType_MostFreqCounts = ECALDCC_TriggerType_FreqMap[ECALDCC_TriggerType];
506 ECALDCC_TriggerType_MostFreqId = ECALDCC_TriggerType;
512 edm::LogWarning(
"EBRawDataTask") <<
"EcalRawDataCollection not available";
519 for(
int i=0;
i<36;
i++) {
521 const FEDRawData& fedData = allFedRawData->FEDData(EBFirstFED+
i);
528 uint64_t * fedTrailer = pData + (length - 1);
529 bool crcError = (*fedTrailer >> 2 ) & 0x1;
538 edm::LogWarning(
"EBRawDataTask") <<
"FEDRawDataCollection not available";
550 float xism = ism+0.5;
552 int ECALDCC_runNumber = dcchItr->getRunNumber();
554 int ECALDCC_L1A = dcchItr->getLV1();
555 int ECALDCC_OrbitNumber = dcchItr->getOrbit();
556 int ECALDCC_BunchCrossing = dcchItr->getBX();
557 int ECALDCC_TriggerType = dcchItr->getBasicTriggerType();
561 if ( gtFedDataSize > 0 ) {
579 if ( gtFedDataSize == 0 ) {
590 const std::vector<short> feBxs = dcchItr->getFEBxs();
591 const std::vector<short> tccBx = dcchItr->getTCCBx();
592 const short srpBx = dcchItr->getSRPBx();
593 const std::vector<short>
status = dcchItr->getFEStatus();
595 std::vector<int> BxSynchStatus;
596 BxSynchStatus.reserve((
int)feBxs.size());
598 for(
int fe=0; fe<(int)feBxs.size(); fe++) {
600 if(status[fe] != 0)
continue;
601 if(feBxs[fe] != ECALDCC_BunchCrossing && feBxs[fe] != -1 && ECALDCC_BunchCrossing != -1) {
603 BxSynchStatus[fe] = 0;
604 }
else BxSynchStatus[fe] = 1;
615 const std::vector<short> feLv1 = dcchItr->getFELv1();
616 const std::vector<short> tccLv1 = dcchItr->getTCCLv1();
617 const short srpLv1 = dcchItr->getSRPLv1();
620 int ECALDCC_L1A_12bit = ECALDCC_L1A & 0xfff;
623 for(
int fe=0; fe<(int)feLv1.size(); fe++) {
625 if(status[fe] != 0)
continue;
626 if(feLv1[fe]+feLv1Offset != ECALDCC_L1A_12bit && feLv1[fe] != -1 && ECALDCC_L1A_12bit - 1 != -1) {
629 errorsInEvent += 1. / feLv1.size();
630 }
else if( BxSynchStatus[fe]==0 ){
632 errorsInEvent += 1. / feLv1.size();
639 if(tccLv1[0] != ECALDCC_L1A_12bit && tccLv1[0] != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEBL1ATCCErrors_->
Fill( xism );
642 if(srpLv1 != ECALDCC_L1A_12bit && srpLv1 != -1 && ECALDCC_L1A_12bit - 1 != -1)
meEBL1ASRPErrors_->
Fill( xism );
644 if ( gtFedDataSize == 0 ) {
654 float evtType = dcchItr->getRunType();
656 if ( evtType < 0 || evtType > 22 ) evtType = -1;
682 edm::LogWarning(
"EBRawDataTask") <<
"EcalRawDataCollection not available";
685 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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Some "id" conversions.
MonitorElement * meEBCalibrationEventErrors_
static std::string sEB(const unsigned ism)
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)
MonitorElement * meEBL1ATCCErrors_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
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)
MonitorElement * meEBL1AFEErrors_
#define H_ORBITCOUNTER_MASK
void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
EndLuminosityBlock.
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
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
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)