CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProcessConfiguration.cc
Go to the documentation of this file.
4 
5 #include <ostream>
6 #include <cassert>
7 #include <sstream>
8 
9 /*----------------------------------------------------------------------
10 
11 ----------------------------------------------------------------------*/
12 
13 namespace edm {
14 
15 
16  ProcessConfiguration::ProcessConfiguration() : processName_(), parameterSetID_(), releaseVersion_(), passID_() {}
17 
19  std::string const& procName,
20  ParameterSetID const& pSetID,
21  ReleaseVersion const& relVersion,
22  PassID const& pass) :
23  processName_(procName),
24  parameterSetID_(pSetID),
25  releaseVersion_(relVersion),
26  passID_(pass) { }
27 
29  std::string const& procName,
30  ReleaseVersion const& relVersion,
31  PassID const& pass) :
32  processName_(procName),
33  parameterSetID_(),
34  releaseVersion_(relVersion),
35  passID_(pass) { isCurrentProcess() = true; }
36 
37  ParameterSetID const&
41  << "Illegal attempt to access the process top level parameter set ID\n"
42  << "from the ProcessConfiguration before that parameter\n"
43  << "set has been frozen and registered. The parameter set\n"
44  << "can be changed during module validation, which occurs\n"
45  << "concurrently with module construction. The ID of the\n"
46  << "ProcessConfiguration itself also depends on that parameter\n"
47  << "set ID. It is illegal to access either before they are frozen.\n";
48  }
49  return parameterSetID_;
50  }
51 
54  if(pcid().isValid()) {
55  return pcid();
56  }
57  // This implementation is ripe for optimization.
58  std::ostringstream oss;
59  oss << *this;
60  std::string stringrep = oss.str();
61  cms::Digest md5alg(stringrep);
63  pcid().swap(tmp);
64  return pcid();
65  }
66 
67  void
69  assert(parameterSetID_ == ParameterSetID());
70  parameterSetID_ = pSetID;
71  }
72 
74  if (a.processName() < b.processName()) return true;
75  if (b.processName() < a.processName()) return false;
76  if (a.parameterSetID() < b.parameterSetID()) return true;
77  if (b.parameterSetID() < a.parameterSetID()) return false;
78  if (a.releaseVersion() < b.releaseVersion()) return true;
79  if (b.releaseVersion() < a.releaseVersion()) return false;
80  if (a.passID() < b.passID()) return true;
81  return false;
82  }
83 
84  std::ostream&
85  operator<< (std::ostream& os, ProcessConfiguration const& pc) {
86  os << pc.processName() << ' '
87  << pc.parameterSetID() << ' '
88  << pc.releaseVersion() << ' '
89  << pc.passID();
90  return os;
91  }
92 }
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:77
ProcessConfigurationID id() const
void setParameterSetID(ParameterSetID const &pSetID)
void swap(Hash< I > &other)
Definition: Hash.h:185
MD5Result digest() const
Definition: Digest.cc:188
PassID const & passID() const
ProcessConfigurationID & pcid() const
std::string const & processName() const
ParameterSetID const & parameterSetID() const
Hash< ParameterSetType > ParameterSetID
ReleaseVersion const & releaseVersion() const
std::string toString() const
Definition: Digest.cc:87
double b
Definition: hdecay.h:120
std::string ReleaseVersion
Definition: ReleaseVersion.h:7
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double a
Definition: hdecay.h:121
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
std::string PassID
Definition: PassID.h:8