CMS 3D CMS Logo

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

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) override
 check HV status More...
 
 DTHVCheckByAbsoluteValues ()
 
 DTHVCheckByAbsoluteValues (const edm::ParameterSet &iConfig, edm::ActivityRegistry &iAR)
 
 ~DTHVCheckByAbsoluteValues () override
 
- 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 = nullptr
 

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.

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

Destructor

Definition at line 62 of file DTHVCheckByAbsoluteValues.cc.

62 {}

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

check HV status

Operations

Implements DTHVAbstractCheck.

Definition at line 67 of file DTHVCheckByAbsoluteValues.cc.

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

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

Member Data Documentation

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

Definition at line 66 of file DTHVCheckByAbsoluteValues.h.

Referenced by checkCurrentStatus(), and DTHVCheckByAbsoluteValues().

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

Definition at line 65 of file DTHVCheckByAbsoluteValues.h.

Referenced by checkCurrentStatus(), and DTHVCheckByAbsoluteValues().

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

Definition at line 64 of file DTHVCheckByAbsoluteValues.h.

Referenced by checkCurrentStatus(), and DTHVCheckByAbsoluteValues().