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

Public Member Functions

 TkVoltageMapCreator (const edm::ParameterSet &)
 
 ~TkVoltageMapCreator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

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

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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

Implements edm::EDAnalyzer.

Definition at line 89 of file TkVoltageMapCreator.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 96 of file TkVoltageMapCreator.cc.

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

97 {
98  TrackerMap lvmap,hvmap;
99 
100  TkHistoMap lvhisto("LV_Status","LV_Status",-1);
101  TkHistoMap hvhisto("HV_Status","HV_Status",-1);
102 
103  ifstream lvdata(_lvfile.c_str());
104  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:68
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:632
const std::string _lvfile
void TkVoltageMapCreator::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file TkVoltageMapCreator.cc.

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

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().