CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DTHVStatus Class Reference

#include <DTHVStatus.h>

Public Types

typedef std::vector< std::pair< DTHVStatusId, DTHVStatusData > >::const_iterator const_iterator
 Access methods to data. More...
 

Public Member Functions

int badChannelsNumber () const
 
int badChannelsNumber (const DTChamberId &id) const
 
const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTHVStatus ()
 
 DTHVStatus (const std::string &version)
 
const_iterator end () const
 
int get (const DTLayerId &id, int partId, int &fCell, int &lCell, int &flagA, int &flagC, int &flagS) const
 
int get (const DTWireId &id, int &flagA, int &flagC, int &flagS) const
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int &fCell, int &lCell, int &flagA, int &flagC, int &flagS) const
 get content More...
 
void initialize ()
 
int offChannelsNumber () const
 
int offChannelsNumber (const DTChamberId &id) const
 
int set (const DTLayerId &id, int partId, int fCell, int lCell, int flagA, int flagC, int flagS)
 
int set (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int fCell, int lCell, int flagA, int flagC, int flagS)
 
int setFlagA (const DTLayerId &id, int partId, int flag)
 
int setFlagA (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
 
int setFlagC (const DTLayerId &id, int partId, int flag)
 
int setFlagC (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
 
int setFlagS (const DTLayerId &id, int partId, int flag)
 
int setFlagS (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
 
std::string & version ()
 
const std::string & version () const
 access version More...
 
 ~DTHVStatus ()
 

Private Member Functions

 DTHVStatus (DTHVStatus const &)=delete
 
std::string mapName () const
 read and store full content More...
 
DTHVStatusoperator= (DTHVStatus const &)=delete
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
 
std::string dataVersion
 
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Description: Class to hold high voltage status ( half layer by half layer )

Author
Paolo Ronchese INFN Padova

Definition at line 70 of file DTHVStatus.h.

Member Typedef Documentation

◆ const_iterator

Access methods to data.

Definition at line 128 of file DTHVStatus.h.

Constructor & Destructor Documentation

◆ DTHVStatus() [1/3]

DTHVStatus::DTHVStatus ( )

Constructor

Definition at line 34 of file DTHVStatus.cc.

34 : dataVersion(" "), dBuf(new DTBufferTree<int, int>) { dataList.reserve(10); }

References dataList.

◆ DTHVStatus() [2/3]

DTHVStatus::DTHVStatus ( const std::string &  version)

Definition at line 36 of file DTHVStatus.cc.

37  dataList.reserve(10);
38 }

References dataList.

◆ ~DTHVStatus()

DTHVStatus::~DTHVStatus ( )

Destructor

Definition at line 47 of file DTHVStatus.cc.

47 {}

◆ DTHVStatus() [3/3]

DTHVStatus::DTHVStatus ( DTHVStatus const &  )
privatedelete

Member Function Documentation

◆ badChannelsNumber() [1/2]

int DTHVStatus::badChannelsNumber ( ) const

Definition at line 153 of file DTHVStatus.cc.

153  {
154  int offNum = 0;
157  while (iter != iend) {
158  const std::pair<DTHVStatusId, DTHVStatusData>& entry = *iter++;
159  DTHVStatusId hvId = entry.first;
160  DTHVStatusData data = entry.second;
161  if (data.flagA || data.flagC || data.flagS)
162  offNum += (1 + data.lCell - data.fCell);
163  }
164  return offNum;
165 }

References begin(), data, end(), and mps_splice::entry.

◆ badChannelsNumber() [2/2]

int DTHVStatus::badChannelsNumber ( const DTChamberId id) const

Definition at line 167 of file DTHVStatus.cc.

167  {
168  int offNum = 0;
171  while (iter != iend) {
172  const std::pair<DTHVStatusId, DTHVStatusData>& entry = *iter++;
173  DTHVStatusId hvId = entry.first;
174  DTHVStatusData data = entry.second;
175  if (hvId.wheelId != id.wheel())
176  continue;
177  if (hvId.stationId != id.station())
178  continue;
179  if (hvId.sectorId != id.sector())
180  continue;
181  if (data.flagA || data.flagC || data.flagS)
182  offNum += (1 + data.lCell - data.fCell);
183  }
184  return offNum;
185 }

References begin(), data, end(), mps_splice::entry, DTHVStatusId::sectorId, DTHVStatusId::stationId, and DTHVStatusId::wheelId.

◆ begin()

DTHVStatus::const_iterator DTHVStatus::begin ( void  ) const

◆ clear()

void DTHVStatus::clear ( void  )

reset content

Definition at line 191 of file DTHVStatus.cc.

191  {
192  dataList.clear();
193  dataList.reserve(10);
194  initialize();
195  return;
196 }

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

◆ end()

DTHVStatus::const_iterator DTHVStatus::end ( void  ) const

◆ get() [1/3]

int DTHVStatus::get ( const DTLayerId id,
int  partId,
int &  fCell,
int &  lCell,
int &  flagA,
int &  flagC,
int &  flagS 
) const

◆ get() [2/3]

int DTHVStatus::get ( const DTWireId id,
int &  flagA,
int &  flagC,
int &  flagS 
) const

Definition at line 96 of file DTHVStatus.cc.

96  {
97  flagA = flagC = flagS = 0;
98  int iCell = id.wire();
99  int fCell;
100  int lCell;
101  int fCheck =
102  get(id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), 0, fCell, lCell, flagA, flagC, flagS);
103  if ((fCheck == 0) && (fCell <= iCell) && (lCell >= iCell))
104  return 0;
105  fCheck =
106  get(id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), 1, fCell, lCell, flagA, flagC, flagS);
107  if ((fCheck == 0) && (fCell <= iCell) && (lCell >= iCell))
108  return 0;
109  flagA = flagC = flagS = 0;
110  return 1;
111 }

References get(), phase1PixelTopology::layer, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

◆ get() [3/3]

int DTHVStatus::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  partId,
int &  fCell,
int &  lCell,
int &  flagA,
int &  flagC,
int &  flagS 
) const

get content

Operations

Definition at line 56 of file DTHVStatus.cc.

66  {
67  fCell = lCell = flagA = flagC = flagS = 0;
68 
69  std::vector<int> chanKey;
70  chanKey.reserve(6);
71  chanKey.push_back(wheelId);
72  chanKey.push_back(stationId);
73  chanKey.push_back(sectorId);
74  chanKey.push_back(slId);
75  chanKey.push_back(layerId);
76  chanKey.push_back(partId);
77  int ientry;
78  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
79  if (!searchStatus) {
80  const DTHVStatusData& data(dataList[ientry].second);
81  fCell = data.fCell;
82  lCell = data.lCell;
83  flagA = data.flagA;
84  flagC = data.flagC;
85  flagS = data.flagS;
86  }
87 
88  return searchStatus;
89 }

References data, dataList, dBuf, DTBufferTree< Key, Content >::find(), and edm::second().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), util.rrapi.RRApi::data(), rrapi.RRApi::data(), DTDCSByLumiTask::dqmEndLuminosityBlock(), DTHVHandler::get(), get(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), DTHVStatusHandler::setChannelFlag(), setFlagA(), setFlagC(), setFlagS(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), util.rrapi.RRApi::templates(), rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

◆ initialize()

void DTHVStatus::initialize ( )

Definition at line 308 of file DTHVStatus.cc.

308  {
309  dBuf->clear();
310 
311  int entryNum = 0;
312  int entryMax = dataList.size();
313  std::vector<int> chanKey;
314  chanKey.reserve(6);
315  while (entryNum < entryMax) {
316  const DTHVStatusId& chan = dataList[entryNum].first;
317 
318  chanKey.clear();
319  chanKey.push_back(chan.wheelId);
320  chanKey.push_back(chan.stationId);
321  chanKey.push_back(chan.sectorId);
322  chanKey.push_back(chan.slId);
323  chanKey.push_back(chan.layerId);
324  chanKey.push_back(chan.partId);
325  dBuf->insert(chanKey.begin(), chanKey.end(), entryNum++);
326  }
327 
328  return;
329 }

References officialStyle::chan, DTBufferTree< Key, Content >::clear(), dataList, dBuf, and DTBufferTree< Key, Content >::insert().

Referenced by clear().

◆ mapName()

std::string DTHVStatus::mapName ( ) const
private

read and store full content

Definition at line 302 of file DTHVStatus.cc.

302  {
303  std::stringstream name;
304  name << dataVersion << "_map_HV" << this;
305  return name.str();
306 }

References dataVersion, and Skims_PA_cff::name.

◆ offChannelsNumber() [1/2]

int DTHVStatus::offChannelsNumber ( ) const

Definition at line 113 of file DTHVStatus.cc.

113  {
114  int offNum = 0;
117  while (iter != iend) {
118  const std::pair<DTHVStatusId, DTHVStatusData>& entry = *iter++;
119  DTHVStatusId hvId = entry.first;
120  DTHVStatusData data = entry.second;
121  int offA = data.flagA & 1;
122  int offC = data.flagC & 1;
123  int offS = data.flagS & 1;
124  if (offA || offC || offS)
125  offNum += (1 + data.lCell - data.fCell);
126  }
127  return offNum;
128 }

References begin(), data, end(), and mps_splice::entry.

◆ offChannelsNumber() [2/2]

int DTHVStatus::offChannelsNumber ( const DTChamberId id) const

Definition at line 130 of file DTHVStatus.cc.

130  {
131  int offNum = 0;
134  while (iter != iend) {
135  const std::pair<DTHVStatusId, DTHVStatusData>& entry = *iter++;
136  DTHVStatusId hvId = entry.first;
137  DTHVStatusData data = entry.second;
138  if (hvId.wheelId != id.wheel())
139  continue;
140  if (hvId.stationId != id.station())
141  continue;
142  if (hvId.sectorId != id.sector())
143  continue;
144  int offA = data.flagA & 1;
145  int offC = data.flagC & 1;
146  int offS = data.flagS & 1;
147  if (offA || offC || offS)
148  offNum += (1 + data.lCell - data.fCell);
149  }
150  return offNum;
151 }

References begin(), data, end(), mps_splice::entry, DTHVStatusId::sectorId, DTHVStatusId::stationId, and DTHVStatusId::wheelId.

◆ operator=()

DTHVStatus& DTHVStatus::operator= ( DTHVStatus const &  )
privatedelete

◆ serialize()

template<class Archive >
void DTHVStatus::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ set() [1/2]

int DTHVStatus::set ( const DTLayerId id,
int  partId,
int  fCell,
int  lCell,
int  flagA,
int  flagC,
int  flagS 
)

Definition at line 251 of file DTHVStatus.cc.

251  {
252  return set(
253  id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), partId, fCell, lCell, flagA, flagC, flagS);
254 }

References phase1PixelTopology::layer, set(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

◆ set() [2/2]

int DTHVStatus::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  partId,
int  fCell,
int  lCell,
int  flagA,
int  flagC,
int  flagS 
)

Definition at line 198 of file DTHVStatus.cc.

208  {
209  std::vector<int> chanKey;
210  chanKey.reserve(6);
211  chanKey.push_back(wheelId);
212  chanKey.push_back(stationId);
213  chanKey.push_back(sectorId);
214  chanKey.push_back(slId);
215  chanKey.push_back(layerId);
216  chanKey.push_back(partId);
217  int ientry;
218  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
219 
220  if (!searchStatus) {
222  data.fCell = fCell;
223  data.lCell = lCell;
224  data.flagA = flagA;
225  data.flagC = flagC;
226  data.flagS = flagS;
227  return -1;
228  } else {
230  key.wheelId = wheelId;
231  key.stationId = stationId;
232  key.sectorId = sectorId;
233  key.slId = slId;
234  key.layerId = layerId;
235  key.partId = partId;
237  data.fCell = fCell;
238  data.lCell = lCell;
239  data.flagA = flagA;
240  data.flagC = flagC;
241  data.flagS = flagS;
242  ientry = dataList.size();
243  dataList.push_back(std::pair<DTHVStatusId, DTHVStatusData>(key, data));
244  dBuf->insert(chanKey.begin(), chanKey.end(), ientry);
245  return 0;
246  }
247 
248  return 99;
249 }

References data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), crabWrapper::key, and edm::second().

Referenced by set(), DTHVStatusHandler::setChannelFlag(), setFlagA(), setFlagC(), and setFlagS().

◆ setFlagA() [1/2]

int DTHVStatus::setFlagA ( const DTLayerId id,
int  partId,
int  flag 
)

Definition at line 266 of file DTHVStatus.cc.

266  {
267  return setFlagA(id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), partId, flag);
268 }

References RemoveAddSevLevel::flag, phase1PixelTopology::layer, setFlagA(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

◆ setFlagA() [2/2]

int DTHVStatus::setFlagA ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  partId,
int  flag 
)

Definition at line 256 of file DTHVStatus.cc.

256  {
257  int fCell;
258  int lCell;
259  int flagA;
260  int flagC;
261  int flagS;
262  get(wheelId, stationId, sectorId, slId, layerId, partId, fCell, lCell, flagA, flagC, flagS);
263  return set(wheelId, stationId, sectorId, slId, layerId, partId, fCell, lCell, flag, flagC, flagS);
264 }

References RemoveAddSevLevel::flag, get(), and set().

Referenced by setFlagA().

◆ setFlagC() [1/2]

int DTHVStatus::setFlagC ( const DTLayerId id,
int  partId,
int  flag 
)

Definition at line 280 of file DTHVStatus.cc.

280  {
281  return setFlagC(id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), partId, flag);
282 }

References RemoveAddSevLevel::flag, phase1PixelTopology::layer, setFlagC(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

◆ setFlagC() [2/2]

int DTHVStatus::setFlagC ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  partId,
int  flag 
)

Definition at line 270 of file DTHVStatus.cc.

270  {
271  int fCell;
272  int lCell;
273  int flagA;
274  int flagC;
275  int flagS;
276  get(wheelId, stationId, sectorId, slId, layerId, partId, fCell, lCell, flagA, flagC, flagS);
277  return set(wheelId, stationId, sectorId, slId, layerId, partId, fCell, lCell, flagA, flag, flagS);
278 }

References RemoveAddSevLevel::flag, get(), and set().

Referenced by setFlagC().

◆ setFlagS() [1/2]

int DTHVStatus::setFlagS ( const DTLayerId id,
int  partId,
int  flag 
)

Definition at line 294 of file DTHVStatus.cc.

294  {
295  return setFlagS(id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), partId, flag);
296 }

References RemoveAddSevLevel::flag, phase1PixelTopology::layer, setFlagS(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

◆ setFlagS() [2/2]

int DTHVStatus::setFlagS ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  partId,
int  flag 
)

Definition at line 284 of file DTHVStatus.cc.

284  {
285  int fCell;
286  int lCell;
287  int flagA;
288  int flagC;
289  int flagS;
290  get(wheelId, stationId, sectorId, slId, layerId, partId, fCell, lCell, flagA, flagC, flagS);
291  return set(wheelId, stationId, sectorId, slId, layerId, partId, fCell, lCell, flagA, flagC, flag);
292 }

References RemoveAddSevLevel::flag, get(), and set().

Referenced by setFlagS().

◆ version() [1/2]

std::string & DTHVStatus::version ( )

Definition at line 189 of file DTHVStatus.cc.

189 { return dataVersion; }

References dataVersion.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

◆ version() [2/2]

const std::string & DTHVStatus::version ( ) const

access version

Definition at line 187 of file DTHVStatus.cc.

187 { return dataVersion; }

References dataVersion.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 147 of file DTHVStatus.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 147 of file DTHVStatus.h.

Member Data Documentation

◆ dataList

std::vector<std::pair<DTHVStatusId, DTHVStatusData> > DTHVStatus::dataList
private

Definition at line 140 of file DTHVStatus.h.

Referenced by begin(), clear(), DTHVStatus(), end(), get(), initialize(), and set().

◆ dataVersion

std::string DTHVStatus::dataVersion
private

Definition at line 138 of file DTHVStatus.h.

Referenced by mapName(), and version().

◆ dBuf

edm::ConstRespectingPtr<DTBufferTree<int, int> > DTHVStatus::dBuf
private

Definition at line 142 of file DTHVStatus.h.

Referenced by get(), initialize(), and set().

DTHVStatus::setFlagA
int setFlagA(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
Definition: DTHVStatus.cc:256
DTHVStatusId::wheelId
int wheelId
Definition: DTHVStatus.h:46
relativeConstraints.station
station
Definition: relativeConstraints.py:67
mps_splice.entry
entry
Definition: mps_splice.py:68
DTBufferTree::clear
void clear()
DTHVStatus::initialize
void initialize()
Definition: DTHVStatus.cc:308
DTHVStatus::dataList
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:140
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DTHVStatusId::stationId
int stationId
Definition: DTHVStatus.h:47
DTHVStatus::const_iterator
std::vector< std::pair< DTHVStatusId, DTHVStatusData > >::const_iterator const_iterator
Access methods to data.
Definition: DTHVStatus.h:128
DTHVStatus::dBuf
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTHVStatus.h:142
DTHVStatus::set
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int fCell, int lCell, int flagA, int flagC, int flagS)
Definition: DTHVStatus.cc:198
DTBufferTree::insert
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTHVStatus::begin
const_iterator begin() const
Definition: DTHVStatus.cc:298
DTHVStatus::dataVersion
std::string dataVersion
Definition: DTHVStatus.h:138
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
DTHVStatus::setFlagS
int setFlagS(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
Definition: DTHVStatus.cc:284
DTHVStatus::end
const_iterator end() const
Definition: DTHVStatus.cc:300
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTBufferTree< int, int >
DTHVStatus::version
const std::string & version() const
access version
Definition: DTHVStatus.cc:187
DTHVStatus::setFlagC
int setFlagC(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
Definition: DTHVStatus.cc:270
officialStyle.chan
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi....
Definition: officialStyle.py:106
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DTHVStatus::get
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int &fCell, int &lCell, int &flagA, int &flagC, int &flagS) const
get content
Definition: DTHVStatus.cc:56
DTBufferTree::find
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
crabWrapper.key
key
Definition: crabWrapper.py:19
DTHVStatusId
Definition: DTHVStatus.h:41
DTHVStatusData
Definition: DTHVStatus.h:56
DTHVStatusId::sectorId
int sectorId
Definition: DTHVStatus.h:48
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117