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 Attributes
cond::service::DTHVCheckByAbsoluteValues Class Reference

#include <DTHVCheckByAbsoluteValues.h>

Inheritance diagram for cond::service::DTHVCheckByAbsoluteValues:
DTHVAbstractCheck

Public Member Functions

virtual DTHVAbstractCheck::flag checkCurrentStatus (int rawId, int type, float valueA, float valueC, float valueS, const std::map< int, timedMeasurement > &snapshotValues, const std::map< int, int > &aliasMap, const std::map< int, int > &layerMap)
 check HV status More...
 
 DTHVCheckByAbsoluteValues ()
 
 DTHVCheckByAbsoluteValues (const edm::ParameterSet &iConfig, edm::ActivityRegistry &iAR)
 
virtual ~DTHVCheckByAbsoluteValues ()
 
- Public Member Functions inherited from DTHVAbstractCheck
 DTHVAbstractCheck ()
 
virtual void setStatus (int rawId, int flagA, int flagC, int flagS, const std::map< int, timedMeasurement > &snapshotValues, const std::map< int, int > &aliasMap, const std::map< int, int > &layerMap)
 
virtual void setValue (int rawId, int type, float valueA, float valueC, float valueS, const std::map< int, timedMeasurement > &snapshotValues, const std::map< int, int > &aliasMap, const std::map< int, int > &layerMap)
 
virtual ~DTHVAbstractCheck ()
 

Private Attributes

float maxCurrent
 
float * maxHV
 
float * minHV
 

Additional Inherited Members

- Public Types inherited from DTHVAbstractCheck
typedef std::pair< long long
int, float > 
timedMeasurement
 check HV status More...
 
- Static Public Member Functions inherited from DTHVAbstractCheck
static bool chkFlag (const DTHVAbstractCheck::flag &f)
 
static bool compare (const DTHVAbstractCheck::flag &fl, const DTHVAbstractCheck::flag &fr)
 
static DTHVAbstractCheckgetInstance ()
 check HV status More...
 
- Static Protected Attributes inherited from DTHVAbstractCheck
static DTHVAbstractCheckinstance = 0
 

Detailed Description

Definition at line 39 of file DTHVCheckByAbsoluteValues.h.

Constructor & Destructor Documentation

cond::service::DTHVCheckByAbsoluteValues::DTHVCheckByAbsoluteValues ( )

Constructor

DTHVCheckByAbsoluteValues::DTHVCheckByAbsoluteValues ( const edm::ParameterSet iConfig,
edm::ActivityRegistry iAR 
)

Definition at line 37 of file DTHVCheckByAbsoluteValues.cc.

References gather_cfg::cout, DTHVAbstractCheck::instance, maxCurrent, maxHV, and minHV.

39  {
40  if ( instance == 0 ) {
41  std::cout << "create DTHVCheckByAbsoluteValues" << std::endl;
42  minHV = new float[4];
43  maxHV = new float[4];
44 // minHV[0] = 3500.0;
45 // minHV[1] = 3500.0;
46 // minHV[2] = 1400.0;
47 // minHV[3] = 800.0;
48  minHV[0] = 3500.0;
49  minHV[1] = 3500.0;
50  minHV[2] = 1700.0;
51  minHV[3] = 1100.0;
52  maxHV[0] = 4000.0;
53  maxHV[1] = 4000.0;
54  maxHV[2] = 2200.0;
55  maxHV[3] = 1600.0;
56  maxCurrent = 30.0;
57  instance = this;
58  }
59 }
static DTHVAbstractCheck * instance
tuple cout
Definition: gather_cfg.py:121
DTHVCheckByAbsoluteValues::~DTHVCheckByAbsoluteValues ( )
virtual

Destructor

Definition at line 64 of file DTHVCheckByAbsoluteValues.cc.

64  {
65 }

Member Function Documentation

DTHVAbstractCheck::flag DTHVCheckByAbsoluteValues::checkCurrentStatus ( int  rawId,
int  type,
float  valueA,
float  valueC,
float  valueS,
const std::map< int, timedMeasurement > &  snapshotValues,
const std::map< int, int > &  aliasMap,
const std::map< int, int > &  layerMap 
)
virtual

check HV status

Operations

Implements DTHVAbstractCheck.

Definition at line 70 of file DTHVCheckByAbsoluteValues.cc.

References DTHVAbstractCheck::flag::a, DTHVAbstractCheck::flag::c, DTWireId::layerId(), maxCurrent, maxHV, minHV, DetId::rawId(), DTHVAbstractCheck::flag::s, and DTWireId::wire().

75  {
76 
77 // find all values for this channel
78 // ind dpid = 0;
79 // std::map<int,int>::const_iterator lpartIter;
80 // std::map<int,int>::const_iterator lpartIend = layerMap.end();
81 // if ( ( layerIter = layerMap.find( chp0 ) ) != layerIend )
82 // dpid = layerIter.second;
83 // std::map<int,timedMeasurement>::const_iterator snapIter;
84 // std::map<int,timedMeasurement>::const_iterator snapIend =
85 // snapshotValues.end();
86 // float val1 = -999999.0;
87 // float val2 = -999999.0;
88 // int chan = dpId * 10;
89 // if ( ( snapIter = snapshotValues.find( chan + 1 ) ) != snapIend )
90 // val1 = snapIter->second.second;
91 // if ( ( snapIter = snapshotValues.find( chan + 2 ) ) != snapIend )
92 // val2 = snapIter->second.second;
93 
94 // find dp identifier for all channels in this layer
95 // DTLayerId lay = chlId.layerId();
96 // int chp0 = DTWireId( lay, 10 ).rawId();
97 // int chp1 = DTWireId( lay, 11 ).rawId();
98 // int chp2 = DTWireId( lay, 12 ).rawId();
99 // int chp3 = DTWireId( lay, 13 ).rawId();
100 // ind dpi0 = 0;
101 // ind dpi1 = 0;
102 // ind dpi2 = 0;
103 // ind dpi3 = 0;
104 // std::map<int,int>::const_iterator layerIter;
105 // std::map<int,int>::const_iterator layerIend = layerMap.end();
106 // if ( ( layerIter = layerMap.find( chp0 ) ) != layerIend )
107 // dpi0 = layerIter.second;
108 // if ( ( layerIter = layerMap.find( chp1 ) ) != layerIend )
109 // dpi1 = layerIter.second;
110 // if ( ( layerIter = layerMap.find( chp2 ) ) != layerIend )
111 // dpi2 = layerIter.second;
112 // if ( ( layerIter = layerMap.find( chp3 ) ) != layerIend )
113 // dpi3 = layerIter.second;
114 
115  DTWireId chlId( rawId );
116  int part = chlId.wire() - 10;
118  flag.a = flag.c = flag.s = 0;
119  if ( type == 1 ) {
120  if ( valueA < minHV[part] ) flag.a = 1;
121  if ( valueA > maxHV[part] ) flag.a = 2;
122  if ( valueS < minHV[ 2] ) flag.s = 1;
123  if ( valueS > maxHV[ 2] ) flag.s = 2;
124  if ( valueC < minHV[ 3] ) flag.c = 1;
125  if ( valueC > maxHV[ 3] ) flag.c = 2;
126  }
127  if ( type == 2 ) {
128  float voltA = 0.0;
129  float voltS = 0.0;
130  float voltC = 0.0;
131  DTLayerId lay = chlId.layerId();
132  int l_p = chlId.wire();
133  DTWireId chA( lay, l_p );
134  DTWireId chS( lay, 12 );
135  DTWireId chC( lay, 13 );
136  std::map<int,int>::const_iterator layerIter;
137  std::map<int,int>::const_iterator layerIend = layerMap.end();
138  std::map<int,timedMeasurement>::const_iterator snapIter;
139  std::map<int,timedMeasurement>::const_iterator snapIend =
140  snapshotValues.end();
141  int chan;
142  if ( ( layerIter = layerMap.find( chA.rawId() ) ) != layerIend ) {
143  chan = ( layerIter->second * 10 ) + l_p;
144  if ( ( snapIter = snapshotValues.find( chan ) ) != snapIend ) {
145  voltA = snapIter->second.second;
146  }
147  }
148  if ( ( layerIter = layerMap.find( chS.rawId() ) ) != layerIend ) {
149  chan = ( layerIter->second * 10 ) + 2;
150  if ( ( snapIter = snapshotValues.find( chan ) ) != snapIend ) {
151  voltS = snapIter->second.second;
152  }
153  }
154  if ( ( layerIter = layerMap.find( chC.rawId() ) ) != layerIend ) {
155  chan = ( layerIter->second * 10 ) + 3;
156  if ( ( snapIter = snapshotValues.find( chan ) ) != snapIend ) {
157  voltC = snapIter->second.second;
158  }
159  }
160  if ( ( valueA > maxCurrent ) &&
161  ( voltA >= minHV[part] ) ) flag.a = 4;
162  if ( ( valueS > maxCurrent ) &&
163  ( voltS >= minHV[ 2] ) ) flag.s = 4;
164  if ( ( valueC > maxCurrent ) &&
165  ( voltC >= minHV[ 3] ) ) flag.c = 4;
166  }
167  return flag;
168 
169 }
type
Definition: HCALResponse.h:22
long int flag
Definition: mlp_lapack.h:47
part
Definition: HCALResponse.h:21

Member Data Documentation

float cond::service::DTHVCheckByAbsoluteValues::maxCurrent
private

Definition at line 68 of file DTHVCheckByAbsoluteValues.h.

Referenced by checkCurrentStatus(), and DTHVCheckByAbsoluteValues().

float* cond::service::DTHVCheckByAbsoluteValues::maxHV
private

Definition at line 67 of file DTHVCheckByAbsoluteValues.h.

Referenced by checkCurrentStatus(), and DTHVCheckByAbsoluteValues().

float* cond::service::DTHVCheckByAbsoluteValues::minHV
private

Definition at line 66 of file DTHVCheckByAbsoluteValues.h.

Referenced by checkCurrentStatus(), and DTHVCheckByAbsoluteValues().