ATLAS Offline Software
TPCnvTokenList_p1.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TPCnvTokenList_p1_h
6 #define TPCnvTokenList_p1_h
7 
8 #include <vector>
9 #include <string>
10 #include <sstream>
11 #include <stdexcept>
12 
25 public:
30  TPCnvToken_p1(unsigned short cnvID=0, const std::string& token="")
31  : m_converterID(cnvID), m_token(token) {}
32 
34  unsigned short converterID() const { return m_converterID; }
35 
37  const std::string& token() const { return m_token; }
38 
39 protected:
40  unsigned short m_converterID;
41  std::string m_token;
42 };
43 
44 
45 
54  : public std::vector<TPCnvToken_p1>
55 {
56 public:
61  void addToken( unsigned short cnvID, const std::string& token) {
62  push_back( TPCnvToken_p1(cnvID, token) );
63  }
64 
69  const std::string& findToken(unsigned short id) {
70  for( const_iterator it = begin(); it != end(); ++it ) {
71  if( it->converterID() == id )
72  return it->token();
73  }
74  std::ostringstream error;
75  error << "TPCnvTokenList_p1::findToken(): could not find a token for converter ID=" << id << std::ends;
76  throw std::runtime_error( error.str() );
77  }
78 };
79 
80 
81 
82 #endif
TPCnvTokenList_p1
Definition: TPCnvTokenList_p1.h:55
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TPCnvToken_p1::m_converterID
unsigned short m_converterID
ID of the top-level TP converter.
Definition: TPCnvTokenList_p1.h:40
TPCnvToken_p1::m_token
std::string m_token
token to the extending object
Definition: TPCnvTokenList_p1.h:41
TPCnvTokenList_p1::addToken
void addToken(unsigned short cnvID, const std::string &token)
Stores a new reference to an extending object.
Definition: TPCnvTokenList_p1.h:61
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TPCnvToken_p1::token
const std::string & token() const
Returns token.
Definition: TPCnvTokenList_p1.h:37
TPCnvToken_p1::converterID
unsigned short converterID() const
Returns the topl level TP converter ID.
Definition: TPCnvTokenList_p1.h:34
TPCnvToken_p1
Definition: TPCnvTokenList_p1.h:24
TPCnvToken_p1::TPCnvToken_p1
TPCnvToken_p1(unsigned short cnvID=0, const std::string &token="")
Constructor.
Definition: TPCnvTokenList_p1.h:30
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
TPCnvTokenList_p1::findToken
const std::string & findToken(unsigned short id)
Retrieves token of the extending object given the converter ID.
Definition: TPCnvTokenList_p1.h:69
get_generator_info.error
error
Definition: get_generator_info.py:40
error
Definition: IImpactPoint3dEstimator.h:70