CMS 3D CMS Logo

Classes | 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
 

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")
 

Function Documentation

◆ printfWithMap()

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

Definition at line 416 of file GEMDQMStatusDigi.cc.

416  {
417  std::string strRes = strFmt;
418  char szOutFmt[64];
419  size_t unPos, unPosEnd;
420 
421  for (unPos = strRes.find('%'); unPos != std::string::npos; unPos = strRes.find('%', unPos + 1)) {
422  unPosEnd = strRes.find(')', unPos);
423  if (strRes[unPos + 1] != '(' || unPosEnd == std::string::npos)
424  break; // Syntax error
425 
426  // Extracting the key
427  std::string strKey = strRes.substr(unPos + 2, unPosEnd - (unPos + 2));
428 
429  // To treat formats like '%5i' or '%02i', extracting '5' or '02'
430  // After do this,
431  std::string strOptNum = "%";
432  unPosEnd++;
433 
434  for (;; unPosEnd++) {
435  if (!('0' <= strRes[unPosEnd] && strRes[unPosEnd] <= '9') && strRes[unPosEnd] != '+')
436  break;
437  strOptNum += strRes[unPosEnd];
438  }
439 
440  if (strRes[unPosEnd] != 'i' && strRes[unPosEnd] != 'd')
441  break; // Syntax error
442  strOptNum += strRes[unPosEnd];
443  unPosEnd++;
444 
445  sprintf(szOutFmt, strOptNum.c_str(), mapArg[strKey]);
446  strRes = strRes.substr(0, unPos) + szOutFmt + strRes.substr(unPosEnd);
447  }
448 
449  if (unPos != std::string::npos) { // It means... an syntax error occurs!
450  std::cerr << "ERROR: Syntax error on printfWithMap(); " << std::endl;
451  return "";
452  }
453 
454  return strRes;
455 }

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