27 namespace cond {
namespace service {
41 std::cout <<
"create DTHVCheckWithHysteresis" << std::endl;
77 float valueA,
float valueC,
float valueS,
78 const std::map<int,timedMeasurement>& snapshotValues,
79 const std::map<int,int>& aliasMap,
80 const std::map<int,int>& layerMap ) {
130 flag.
a = flag.
c = flag.
s = 0;
132 std::map<int,int>::iterator chanIter;
134 ( chanIter->second % 2 ) ) minHV[part] =
minHVh[part];
137 ( chanIter->second % 2 ) ) minHV[ 2] =
minHVh[ 2];
138 else minHV[ 2] =
minHVl[ 2];
140 ( chanIter->second % 2 ) ) minHV[ 3] =
minHVh[ 3];
141 else minHV[ 3] =
minHVl[ 3];
144 if ( valueA < minHV[part] ) flag.
a = 1;
145 if ( valueA >
maxHV[part] ) flag.
a = 2;
146 if ( valueS < minHV[ 2] ) flag.
s = 1;
147 if ( valueS >
maxHV[ 2] ) flag.
s = 2;
148 if ( valueC < minHV[ 3] ) flag.
c = 1;
149 if ( valueC >
maxHV[ 3] ) flag.
c = 2;
151 oldStatusA->insert( std::pair<int,int>( rawId, flag.
a ) );
152 else chanIter->second = flag.
a;
154 oldStatusC->insert( std::pair<int,int>( rawId, flag.
c ) );
155 else chanIter->second = flag.
c;
157 oldStatusS->insert( std::pair<int,int>( rawId, flag.
s ) );
158 else chanIter->second = flag.
s;
165 int l_p = chlId.
wire();
170 std::map<int,int>::const_iterator layerIter;
171 std::map<int,int>::const_iterator layerIend = layerMap.end();
172 std::map<int,timedMeasurement>::const_iterator snapIter;
173 std::map<int,timedMeasurement>::const_iterator snapIend =
174 snapshotValues.end();
176 if ( ( layerIter = layerMap.find( chA.
rawId() ) ) != layerIend ) {
177 chan = ( layerIter->second * 10 ) + l_p;
178 if ( ( snapIter = snapshotValues.find( chan ) ) != snapIend ) {
179 voltA = snapIter->second.second;
182 if ( ( layerIter = layerMap.find( chS.
rawId() ) ) != layerIend ) {
183 chan = ( layerIter->second * 10 ) + 2;
184 if ( ( snapIter = snapshotValues.find( chan ) ) != snapIend ) {
185 voltS = snapIter->second.second;
188 if ( ( layerIter = layerMap.find( chC.
rawId() ) ) != layerIend ) {
189 chan = ( layerIter->second * 10 ) + 3;
190 if ( ( snapIter = snapshotValues.find( chan ) ) != snapIend ) {
191 voltC = snapIter->second.second;
195 ( voltA >= minHV[
part] ) ) flag.
a = 4;
197 ( voltS >= minHV[ 2] ) ) flag.
s = 4;
199 ( voltC >= minHV[ 3] ) ) flag.
c = 4;
209 int flagA,
int flagC,
int flagS,
210 const std::map<int,timedMeasurement>& snapshotValues,
211 const std::map<int,int>& aliasMap,
212 const std::map<int,int>& layerMap ) {
215 std::map<int,int>::iterator chanIter;
217 oldStatusA->insert( std::pair<int,int>( rawId, flagA ) );
218 else chanIter->second = flagA;
220 oldStatusC->insert( std::pair<int,int>( rawId, flagC ) );
221 else chanIter->second = flagC;
223 oldStatusS->insert( std::pair<int,int>( rawId, flagS ) );
224 else chanIter->second = flagS;
std::map< int, int > * oldStatusC
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
uint32_t rawId() const
get the raw id
virtual ~DTHVCheckWithHysteresis()
int wire() const
Return the wire number.
static DTHVAbstractCheck * instance
#define DEFINE_FWK_SERVICE(type)
DTHVCheckWithHysteresis()
DTLayerId layerId() const
Return the corresponding LayerId.
std::map< int, int > * oldStatusS
std::map< int, int > * oldStatusA
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)