CMS 3D CMS Logo

Classes | Typedefs | Functions
GEMDQMStatusDigi.cc File Reference
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "Geometry/GEMGeometry/interface/GEMGeometry.h"
#include "CondFormats/GEMObjects/interface/GEMeMap.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "EventFilter/GEMRawToDigi/interface/GEMVfatStatusDigiCollection.h"
#include "EventFilter/GEMRawToDigi/interface/GEMGEBdataCollection.h"
#include "EventFilter/GEMRawToDigi/interface/GEMAMCdataCollection.h"
#include "DataFormats/GEMDigi/interface/GEMDigiCollection.h"
#include <string>
#include <fstream>
#include <TFile.h>
#include <TDirectoryFile.h>

Go to the source code of this file.

Classes

class  GEMDQMStatusDigi
 
struct  tagTimeStoreItem
 

Typedefs

typedef struct tagTimeStoreItem TimeStoreItem
 

Functions

std::string printfWithMap (std::string strFmt, std::unordered_map< std::string, Int_t > mapArg)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< GEMDQMStatusDigi > > s_filler__LINE__ ("GEMDQMStatusDigi")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< GEMDQMStatusDigi > > s_maker__LINE__ ("GEMDQMStatusDigi")
 

Typedef Documentation

◆ TimeStoreItem

Function Documentation

◆ printfWithMap()

std::string printfWithMap ( std::string  strFmt,
std::unordered_map< std::string, Int_t >  mapArg 
)

Definition at line 609 of file GEMDQMStatusDigi.cc.

609  {
610  std::string strRes = strFmt;
611  char szOutFmt[64];
612  size_t unPos, unPosEnd;
613 
614  for (unPos = strRes.find('%'); unPos != std::string::npos; unPos = strRes.find('%', unPos + 1)) {
615  unPosEnd = strRes.find(')', unPos);
616  if (strRes[unPos + 1] != '(' || unPosEnd == std::string::npos)
617  break; // Syntax error
618 
619  // Extracting the key
620  std::string strKey = strRes.substr(unPos + 2, unPosEnd - (unPos + 2));
621 
622  // To treat formats like '%5i' or '%02i', extracting '5' or '02'
623  // After do this,
624  std::string strOptNum = "%";
625  unPosEnd++;
626 
627  for (;; unPosEnd++) {
628  if (!('0' <= strRes[unPosEnd] && strRes[unPosEnd] <= '9') && strRes[unPosEnd] != '+')
629  break;
630  strOptNum += strRes[unPosEnd];
631  }
632 
633  if (strRes[unPosEnd] != 'i' && strRes[unPosEnd] != 'd')
634  break; // Syntax error
635  strOptNum += strRes[unPosEnd];
636  unPosEnd++;
637 
638  sprintf(szOutFmt, strOptNum.c_str(), mapArg[strKey]);
639  strRes = strRes.substr(0, unPos) + szOutFmt + strRes.substr(unPosEnd);
640  }
641 
642  if (unPos != std::string::npos) { // It means... an syntax error occurs!
643  std::cerr << "ERROR: Syntax error on printfWithMap(); " << std::endl;
644  return "";
645  }
646 
647  return strRes;
648 }

References beam_dqm_sourceclient-live_cfg::cerr, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GEMDQMStatusDigi::bookHistograms().

◆ s_filler__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< GEMDQMStatusDigi > > s_filler__LINE__ ( "GEMDQMStatusDigi"  )
static

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< GEMDQMStatusDigi > > s_maker__LINE__ ( "GEMDQMStatusDigi"  )
static
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17