ATLAS Offline Software
Loading...
Searching...
No Matches
TileCondDCS_Data.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5//Implementation file for the data object class
6//The object is a map of channel number<->vector<string>
7//Each string is the name of the guilty DCS parameter
8
11#include <utility>
12
13
14using namespace std;
15//constructor
19
20//destructor
23
24
25//To clean
26StatusCode
28{
29 m_pModulesHV = new map<CondAttrListCollection::ChanNum, float >;
30 return StatusCode::SUCCESS;
31}
32
33StatusCode
35{
36 return StatusCode::SUCCESS;
37}
38
40
41//add map entries
42void TileCondDCS_Data::fill(const CondAttrListCollection::ChanNum & chanNum, const string& param)
43{
44 if (m_bad_channels.find(chanNum) != m_bad_channels.end()) {
45 vector<string> par= (*m_bad_channels.find(chanNum)).second;
46 vector<string>::iterator par_itr=find(par.begin(),par.end(),param);
47 if (par_itr == par.end()){
48 par.push_back(param);
49 m_bad_channels.insert(make_pair(chanNum, par));
50 }
51 }
52 else {
53 vector<string> par;
54 par.push_back(param);
55 m_bad_channels.insert(make_pair(chanNum, par));
56 }
57}
58
60//remove entries in map vector
61void TileCondDCS_Data::remove(const CondAttrListCollection::ChanNum & chanNum, const string& param)
62{
63 map< CondAttrListCollection::ChanNum,vector<string> >::iterator itr=m_bad_channels.find(chanNum);
64 if (itr != m_bad_channels.end()) {
65 vector<string>::iterator vec_itr=find((*itr).second.begin(),(*itr).second.end(),param);
66 if (vec_itr != (*itr).second.end()){
67 (*itr).second.erase(vec_itr);
68 }
69 }
70}
71
72//output map vector
73int TileCondDCS_Data::output(const CondAttrListCollection::ChanNum & chanNum, vector< string > & usersVector){
74 DCSConditions::const_iterator pPair(m_bad_channels.find(chanNum) );
75 if ( pPair != m_bad_channels.end()){
76 const vector< string > & v(pPair->second);
77 usersVector.insert(usersVector.begin(), v.begin(), v.end() );
78 }
79 return usersVector.size();
80}
81
82//output map size
84 DCSConditions::const_iterator pPair(m_bad_channels.find(chanNum) );
85 return (pPair != m_bad_channels.end() )? (pPair->second.size()) : 0;
86}
87
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
DCSConditions m_bad_channels
virtual StatusCode finalize()
void fill(const CondAttrListCollection::ChanNum &chanNum, const std::string &param)
add defect
int output(const CondAttrListCollection::ChanNum &chanNum, std::vector< std::string > &usersVector)
copy all defects to a users vector, the return value is the size
virtual StatusCode initialize()
void remove(const CondAttrListCollection::ChanNum &chanNum, const std::string &param)
remove a defect
std::map< CondAttrListCollection::ChanNum, float > * m_pModulesHV
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138
STL namespace.