ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
SCT_DCSStatCondData Class Reference

Classs for data object used in SCT_DCSConditionsStatCondAlg, SCT_DCSConditionsTool, SCT_Silicon{HV,Temp}CondAlg. More...

#include <SCT_DCSStatCondData.h>

Collaboration diagram for SCT_DCSStatCondData:

Public Types

typedef std::map< CondAttrListCollection::ChanNum, std::vector< std::string > > DCSConditions
 

Public Member Functions

 SCT_DCSStatCondData ()
 Constructor. More...
 
virtual ~SCT_DCSStatCondData ()=default
 Destructor. More...
 
void fill (const CondAttrListCollection::ChanNum &chanNum, const std::string &param)
 Add defect. More...
 
void remove (const CondAttrListCollection::ChanNum &chanNum, const std::string &param)
 Remove a defect. More...
 
int output (const CondAttrListCollection::ChanNum &chanNum, std::vector< std::string > &usersVector) const
 Copy all defects to a users vector, the return value is the size. More...
 
int output (const CondAttrListCollection::ChanNum &chanNum) const
 Return the number of defects. More...
 
const DCSConditionsbadChannelsMap () const
 

Private Attributes

DCSConditions m_bad_channels
 

Detailed Description

Classs for data object used in SCT_DCSConditionsStatCondAlg, SCT_DCSConditionsTool, SCT_Silicon{HV,Temp}CondAlg.

Definition at line 29 of file SCT_DCSStatCondData.h.

Member Typedef Documentation

◆ DCSConditions

typedef std::map<CondAttrListCollection::ChanNum, std::vector<std::string> > SCT_DCSStatCondData::DCSConditions

Definition at line 31 of file SCT_DCSStatCondData.h.

Constructor & Destructor Documentation

◆ SCT_DCSStatCondData()

SCT_DCSStatCondData::SCT_DCSStatCondData ( )

Constructor.

Definition at line 16 of file SCT_DCSStatCondData.cxx.

16  :
18 {
19 }

◆ ~SCT_DCSStatCondData()

virtual SCT_DCSStatCondData::~SCT_DCSStatCondData ( )
virtualdefault

Destructor.

Member Function Documentation

◆ badChannelsMap()

const DCSConditions& SCT_DCSStatCondData::badChannelsMap ( ) const
inline

Definition at line 48 of file SCT_DCSStatCondData.h.

48 { return m_bad_channels; }

◆ fill()

void SCT_DCSStatCondData::fill ( const CondAttrListCollection::ChanNum chanNum,
const std::string &  param 
)

Add defect.

Definition at line 22 of file SCT_DCSStatCondData.cxx.

22  {
23  if (m_bad_channels.find(chanNum)!=m_bad_channels.end()) {
24  // chan num has an entry already
25  //get the parameter list for this chan num
26 
27  std::vector<std::string> par{(*m_bad_channels.find(chanNum)).second};
28 
29  std::vector<std::string>::iterator par_itr{std::find(par.begin(), par.end(), param)};
30  if (par_itr==par.end()) {
31  // if this parameter (hv, chanstat etc) doesn't exist in the list add it to the param std::vector
32  par.push_back(param);
33  //don't insert! not a new map entry, just update the std::vector
34  (*m_bad_channels.find(chanNum)).second = par;
35  }
36  } else {
37  // no entry yet for this chan num, so start fresh
38  std::vector<std::string> par;
39  par.push_back(param);
40  std::pair<std::map<CondAttrListCollection::ChanNum, std::vector<std::string> >::iterator, bool> successfulInsert{m_bad_channels.insert(make_pair(chanNum, par))};
41  if (not successfulInsert.second) std::cout << "WARNING: SCT_ConditionsData map insert failed" << std::endl;
42  }
43 }

◆ output() [1/2]

int SCT_DCSStatCondData::output ( const CondAttrListCollection::ChanNum chanNum) const

Return the number of defects.

Definition at line 68 of file SCT_DCSStatCondData.cxx.

68  {
69  DCSConditions::const_iterator pPair{m_bad_channels.find(chanNum)};
70  return (pPair!=m_bad_channels.end()) ? (pPair->second.size()) : 0;
71 }

◆ output() [2/2]

int SCT_DCSStatCondData::output ( const CondAttrListCollection::ChanNum chanNum,
std::vector< std::string > &  usersVector 
) const

Copy all defects to a users vector, the return value is the size.

Definition at line 58 of file SCT_DCSStatCondData.cxx.

58  {
59  DCSConditions::const_iterator pPair{m_bad_channels.find(chanNum)};
60  if (pPair!=m_bad_channels.end()) {
61  const std::vector<std::string>& v{pPair->second};
62  usersVector.insert(usersVector.begin(), v.begin(), v.end());
63  }
64  return usersVector.size();
65 }

◆ remove()

void SCT_DCSStatCondData::remove ( const CondAttrListCollection::ChanNum chanNum,
const std::string &  param 
)

Remove a defect.

Definition at line 46 of file SCT_DCSStatCondData.cxx.

46  {
47  std::map<CondAttrListCollection::ChanNum, std::vector<std::string> >::iterator itr{m_bad_channels.find(chanNum)};
48  if (itr!=m_bad_channels.end()) {
49  std::vector<std::string>::iterator vec_itr{std::find((*itr).second.begin(), (*itr).second.end(), param)};
50  if (vec_itr!=(*itr).second.end()) {
51  if ((*itr).second.size()>1) (*itr).second.erase(vec_itr);
52  else m_bad_channels.erase(itr);
53  }
54  }
55 }

Member Data Documentation

◆ m_bad_channels

DCSConditions SCT_DCSStatCondData::m_bad_channels
private

Definition at line 51 of file SCT_DCSStatCondData.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
SCT_DCSStatCondData::m_bad_channels
DCSConditions m_bad_channels
Definition: SCT_DCSStatCondData.h:51
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
python.PyAthena.v
v
Definition: PyAthena.py:154