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 (DTHVStatus const &)=delete
 
 DTHVStatus (const std::string &version)
 
const_iterator end () 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...
 
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
 
void initialize ()
 
int offChannelsNumber () const
 
int offChannelsNumber (const DTChamberId &id) const
 
DTHVStatusoperator= (DTHVStatus const &)=delete
 
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 set (const DTLayerId &id, int partId, int fCell, int lCell, int flagA, int flagC, int flagS)
 
int setFlagA (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
 
int setFlagA (const DTLayerId &id, int partId, int flag)
 
int setFlagC (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
 
int setFlagC (const DTLayerId &id, int partId, int flag)
 
int setFlagS (int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag)
 
int setFlagS (const DTLayerId &id, int partId, int flag)
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTHVStatus ()
 

Private Member Functions

std::string mapName () const
 read and store full content More...
 
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 130 of file DTHVStatus.h.

Constructor & Destructor Documentation

◆ DTHVStatus() [1/3]

DTHVStatus::DTHVStatus ( )

Constructor

Definition at line 34 of file DTHVStatus.cc.

References dataList.

34 : dataVersion(" "), dBuf(new DTBufferTree<int, int>) { dataList.reserve(10); }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139
std::string dataVersion
Definition: DTHVStatus.h:137
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTHVStatus.h:141

◆ DTHVStatus() [2/3]

DTHVStatus::DTHVStatus ( DTHVStatus const &  )
delete

◆ DTHVStatus() [3/3]

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

Definition at line 36 of file DTHVStatus.cc.

References dataList.

37  dataList.reserve(10);
38 }
const std::string & version() const
access version
Definition: DTHVStatus.cc:187
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139
std::string dataVersion
Definition: DTHVStatus.h:137
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTHVStatus.h:141

◆ ~DTHVStatus()

DTHVStatus::~DTHVStatus ( )

Destructor

Definition at line 47 of file DTHVStatus.cc.

47 {}

Member Function Documentation

◆ badChannelsNumber() [1/2]

int DTHVStatus::badChannelsNumber ( ) const

Definition at line 153 of file DTHVStatus.cc.

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

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 }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > >::const_iterator const_iterator
Access methods to data.
Definition: DTHVStatus.h:130
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const_iterator begin() const
Definition: DTHVStatus.cc:298
const_iterator end() const
Definition: DTHVStatus.cc:300

◆ badChannelsNumber() [2/2]

int DTHVStatus::badChannelsNumber ( const DTChamberId id) const

Definition at line 167 of file DTHVStatus.cc.

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

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 }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > >::const_iterator const_iterator
Access methods to data.
Definition: DTHVStatus.h:130
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const_iterator begin() const
Definition: DTHVStatus.cc:298
const_iterator end() const
Definition: DTHVStatus.cc:300

◆ begin()

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

Definition at line 298 of file DTHVStatus.cc.

References dataList.

Referenced by badChannelsNumber(), DTHVStatusHandler::checkForPeriod(), DTHVStatusHandler::filterData(), DTHVHandler::offChannelsNumber(), and offChannelsNumber().

298 { return dataList.begin(); }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139

◆ clear()

void DTHVStatus::clear ( void  )

reset content

Definition at line 191 of file DTHVStatus.cc.

References dataList, and initialize().

191  {
192  dataList.clear();
193  dataList.reserve(10);
194  initialize();
195  return;
196 }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139
void initialize()
Definition: DTHVStatus.cc:308

◆ end()

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

Definition at line 300 of file DTHVStatus.cc.

References dataList.

Referenced by badChannelsNumber(), DTHVStatusHandler::checkForPeriod(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), DTHVStatusHandler::filterData(), DTHVHandler::offChannelsNumber(), and offChannelsNumber().

300 { return dataList.end(); }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139

◆ get() [1/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.

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

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), util.rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), util.rrapi.RRApi::data(), rrapi.RRApi::data(), DTDCSByLumiTask::dqmEndLuminosityBlock(), DTHVHandler::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(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), util.rrapi.RRApi::templates(), rrapi.RRApi::templates(), rrapi.RRApi::workspaces(), and util.rrapi.RRApi::workspaces().

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 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTHVStatus.h:141

◆ get() [2/3]

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

◆ get() [3/3]

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

Definition at line 96 of file DTHVStatus.cc.

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

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 }

◆ initialize()

void DTHVStatus::initialize ( )

Definition at line 308 of file DTHVStatus.cc.

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

Referenced by clear().

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 }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
int insert(ElementKey fKey, ElementKey lKey, Content cont)
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTHVStatus.h:141

◆ mapName()

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

read and store full content

Definition at line 302 of file DTHVStatus.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

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

◆ offChannelsNumber() [1/2]

int DTHVStatus::offChannelsNumber ( ) const

Definition at line 113 of file DTHVStatus.cc.

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

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 }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > >::const_iterator const_iterator
Access methods to data.
Definition: DTHVStatus.h:130
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const_iterator begin() const
Definition: DTHVStatus.cc:298
const_iterator end() const
Definition: DTHVStatus.cc:300

◆ offChannelsNumber() [2/2]

int DTHVStatus::offChannelsNumber ( const DTChamberId id) const

Definition at line 130 of file DTHVStatus.cc.

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

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 }
std::vector< std::pair< DTHVStatusId, DTHVStatusData > >::const_iterator const_iterator
Access methods to data.
Definition: DTHVStatus.h:130
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const_iterator begin() const
Definition: DTHVStatus.cc:298
const_iterator end() const
Definition: DTHVStatus.cc:300

◆ operator=()

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

◆ serialize()

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

◆ set() [1/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.

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

Referenced by DTHVStatusHandler::setChannelFlag().

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 }
U second(std::pair< T, U > const &p)
key
prepare the HTCondor submission files and eventually submit them
std::vector< std::pair< DTHVStatusId, DTHVStatusData > > dataList
Definition: DTHVStatus.h:139
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int insert(ElementKey fKey, ElementKey lKey, Content cont)
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTHVStatus.h:141

◆ set() [2/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 }

◆ setFlagA() [1/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.

References RemoveAddSevLevel::flag.

Referenced by setFlagA().

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 }

◆ setFlagA() [2/2]

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

◆ setFlagC() [1/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.

References RemoveAddSevLevel::flag.

Referenced by setFlagC().

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 }

◆ setFlagC() [2/2]

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

◆ setFlagS() [1/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.

References RemoveAddSevLevel::flag.

Referenced by setFlagS().

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 }

◆ setFlagS() [2/2]

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

◆ version() [1/2]

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

access version

Definition at line 187 of file DTHVStatus.cc.

References dataVersion.

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

187 { return dataVersion; }
std::string dataVersion
Definition: DTHVStatus.h:137

◆ version() [2/2]

std::string & DTHVStatus::version ( )

Definition at line 189 of file DTHVStatus.cc.

References dataVersion.

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

189 { return dataVersion; }
std::string dataVersion
Definition: DTHVStatus.h:137

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 146 of file DTHVStatus.h.

◆ cond::serialization::access

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

Definition at line 146 of file DTHVStatus.h.

Member Data Documentation

◆ dataList

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

Definition at line 139 of file DTHVStatus.h.

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

◆ dataVersion

std::string DTHVStatus::dataVersion
private

Definition at line 137 of file DTHVStatus.h.

Referenced by mapName(), and version().

◆ dBuf

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

Definition at line 141 of file DTHVStatus.h.

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