CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TkVoltageMapCreator Class Reference
Inheritance diagram for TkVoltageMapCreator:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 TkVoltageMapCreator (const edm::ParameterSet &)
 
 ~TkVoltageMapCreator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void endJob () override
 
virtual void endRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

const std::string _hvfile
 
const std::string _hvtkmapname
 
const std::string _lvfile
 
const std::string _lvtkmapname
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 30 of file TkVoltageMapCreator.cc.

Constructor & Destructor Documentation

TkVoltageMapCreator::TkVoltageMapCreator ( const edm::ParameterSet iConfig)
explicit

Definition at line 63 of file TkVoltageMapCreator.cc.

63  :
64  _lvfile(iConfig.getParameter<std::string>("LVStatusFile")),
65  _lvtkmapname(iConfig.getParameter<std::string>("LVTkMapName")),
66  _hvfile(iConfig.getParameter<std::string>("HVStatusFile")),
67  _hvtkmapname(iConfig.getParameter<std::string>("HVTkMapName"))
68 
69 {
70  //now do what ever initialization is needed
71 }
T getParameter(std::string const &) const
const std::string _hvfile
const std::string _lvtkmapname
const std::string _hvtkmapname
const std::string _lvfile
TkVoltageMapCreator::~TkVoltageMapCreator ( )

Definition at line 74 of file TkVoltageMapCreator.cc.

75 {
76 
77  // do anything here that needs to be done at desctruction time
78  // (e.g. close files, deallocate resources etc.)
79 
80 }

Member Function Documentation

void TkVoltageMapCreator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 89 of file TkVoltageMapCreator.cc.

90 {
91  using namespace edm;
92 
93 }
void TkVoltageMapCreator::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 150 of file TkVoltageMapCreator.cc.

151 {
152 
153 }
void TkVoltageMapCreator::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 96 of file TkVoltageMapCreator.cc.

References _hvfile, _hvtkmapname, _lvfile, _lvtkmapname, cond::rpcobgas::detid, TkHistoMap::dumpInTkMap(), TkHistoMap::fill(), TkHistoMap::save(), TrackerMap::save(), TrackerMap::setPalette(), and AlCaHLTBitMon_QueryRunRegistry::string.

97 {
98  TrackerMap lvmap,hvmap;
99 
100  TkHistoMap lvhisto("LV_Status","LV_Status",-1);
101  TkHistoMap hvhisto("HV_Status","HV_Status",-1);
102 
103  std::ifstream lvdata(_lvfile.c_str());
104  std::ifstream hvdata(_hvfile.c_str());
105 
106  // HV channel map filling
107 
108  unsigned int detid;
109  std::string lvstatus;
110 
111  while(lvdata >> detid >> lvstatus) {
112  double cha =0.;
113  if(lvstatus=="ON") cha = 0.5; //GREEN
114  if(lvstatus=="OFF") cha = 1.; //RED
115  lvhisto.fill(detid,cha);
116  }
117 
118  std::string hvstatus;
119 
120  while(hvdata >> detid >> hvstatus) {
121  double cha =0.;
122  if(hvstatus=="ON") cha = 0.5; //GREEN
123  if(hvstatus=="OFF") cha = 1.; //RED
124  hvhisto.fill(detid,cha);
125  }
126 
127  lvmap.setPalette(1);
128  hvmap.setPalette(1);
129 
130  lvhisto.dumpInTkMap(&lvmap);
131  hvhisto.dumpInTkMap(&hvmap);
132 
133  lvmap.save(true,0,0,_lvtkmapname);
134  hvmap.save(true,0,0,_hvtkmapname);
135 
136  //TODO could make the root file name a parameter to avoid overwriting everytime...
137  std::string rootmapname = "VoltageStatus.root";
138  lvhisto.save(rootmapname);
139  hvhisto.save(rootmapname);
140 }
const std::string _hvfile
const std::string _lvtkmapname
const std::string _hvtkmapname
void setPalette(int numpalette)
Definition: TrackerMap.h:124
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:699
const std::string _lvfile
void TkVoltageMapCreator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file TkVoltageMapCreator.cc.

157 {}
void TkVoltageMapCreator::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file TkVoltageMapCreator.cc.

144 {
145 }

Member Data Documentation

const std::string TkVoltageMapCreator::_hvfile
private

Definition at line 47 of file TkVoltageMapCreator.cc.

Referenced by beginRun().

const std::string TkVoltageMapCreator::_hvtkmapname
private

Definition at line 48 of file TkVoltageMapCreator.cc.

Referenced by beginRun().

const std::string TkVoltageMapCreator::_lvfile
private

Definition at line 45 of file TkVoltageMapCreator.cc.

Referenced by beginRun().

const std::string TkVoltageMapCreator::_lvtkmapname
private

Definition at line 46 of file TkVoltageMapCreator.cc.

Referenced by beginRun().