CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
edm::ProcessConfiguration Class Reference

#include <ProcessConfiguration.h>

Classes

struct  Transients
 

Public Member Functions

ProcessConfigurationID id () const
 
void initializeTransients ()
 
bool isParameterSetValid () const
 
ParameterSetID const & parameterSetID () const
 
PassID const & passID () const
 
 ProcessConfiguration ()
 
 ProcessConfiguration (std::string const &procName, ParameterSetID const &pSetID, ReleaseVersion const &relVersion, PassID const &pass)
 
 ProcessConfiguration (std::string const &procName, ReleaseVersion const &relVersion, PassID const &pass)
 
std::string const & processName () const
 
void reduce ()
 
ReleaseVersion const & releaseVersion () const
 
void setParameterSetID (ParameterSetID const &pSetID)
 
ProcessConfigurationID setProcessConfigurationID ()
 

Private Member Functions

bool isCurrentProcess () const
 
void setCurrentProcess ()
 
void setPCID (ProcessConfigurationID const &pcid)
 

Private Attributes

ParameterSetID parameterSetID_
 
PassID passID_
 
std::string processName_
 
ReleaseVersion releaseVersion_
 
Transients transient_
 

Detailed Description

Definition at line 14 of file ProcessConfiguration.h.

Constructor & Destructor Documentation

◆ ProcessConfiguration() [1/3]

edm::ProcessConfiguration::ProcessConfiguration ( )

Definition at line 16 of file ProcessConfiguration.cc.

◆ ProcessConfiguration() [2/3]

edm::ProcessConfiguration::ProcessConfiguration ( std::string const &  procName,
ReleaseVersion const &  relVersion,
PassID const &  pass 
)

Definition at line 24 of file ProcessConfiguration.cc.

27  : processName_(procName), parameterSetID_(), releaseVersion_(relVersion), passID_(pass) {
29  }

References setCurrentProcess().

◆ ProcessConfiguration() [3/3]

edm::ProcessConfiguration::ProcessConfiguration ( std::string const &  procName,
ParameterSetID const &  pSetID,
ReleaseVersion const &  relVersion,
PassID const &  pass 
)

Definition at line 18 of file ProcessConfiguration.cc.

22  : processName_(procName), parameterSetID_(pSetID), releaseVersion_(relVersion), passID_(pass) {}

Member Function Documentation

◆ id()

ProcessConfigurationID edm::ProcessConfiguration::id ( ) const

Definition at line 44 of file ProcessConfiguration.cc.

44  {
45  if (transient_.pcid_.isValid()) {
46  return transient_.pcid_;
47  }
48  // This implementation is ripe for optimization.
49  std::ostringstream oss;
50  oss << *this;
51  std::string stringrep = oss.str();
52  cms::Digest md5alg(stringrep);
53  ProcessConfigurationID pcid(md5alg.digest().toString());
54  return pcid;
55  }

References cms::Digest::digest(), edm::Hash< I >::isValid(), edm::ProcessConfiguration::Transients::pcid_, AlCaHLTBitMon_QueryRunRegistry::string, cms::MD5Result::toString(), and transient_.

Referenced by setProcessConfigurationID().

◆ initializeTransients()

void edm::ProcessConfiguration::initializeTransients ( )
inline

◆ isCurrentProcess()

bool edm::ProcessConfiguration::isCurrentProcess ( ) const
inlineprivate

◆ isParameterSetValid()

bool edm::ProcessConfiguration::isParameterSetValid ( ) const
inline

Definition at line 26 of file ProcessConfiguration.h.

26 { return parameterSetID_.isValid(); }

References edm::Hash< I >::isValid(), and parameterSetID_.

◆ parameterSetID()

ParameterSetID const & edm::ProcessConfiguration::parameterSetID ( ) const

Definition at line 31 of file ProcessConfiguration.cc.

31  {
33  throw edm::Exception(errors::LogicError) << "Illegal attempt to access the process top level parameter set ID\n"
34  << "from the ProcessConfiguration before that parameter\n"
35  << "set has been frozen and registered. The parameter set\n"
36  << "can be changed during module validation, which occurs\n"
37  << "concurrently with module construction. The ID of the\n"
38  << "ProcessConfiguration itself also depends on that parameter\n"
39  << "set ID. It is illegal to access either before they are frozen.\n";
40  }
41  return parameterSetID_;
42  }

References Exception, isCurrentProcess(), edm::errors::LogicError, and parameterSetID_.

Referenced by edm::ModuleDescription::mainParameterSetID(), edm::operator<<(), edm::parameterSet(), and edm::ProcessContext::parameterSetID().

◆ passID()

PassID const& edm::ProcessConfiguration::passID ( ) const
inline

◆ processName()

std::string const& edm::ProcessConfiguration::processName ( ) const
inline

◆ reduce()

void edm::ProcessConfiguration::reduce ( )

Definition at line 69 of file ProcessConfiguration.cc.

69  {
70  // Skip to the part of the release version just after
71  // the first two numbers and erase the rest of it.
72  std::string::iterator iter = releaseVersion_.begin();
73  std::string::iterator iEnd = releaseVersion_.end();
74  while (iter != iEnd && isdigit(*iter) == 0)
75  ++iter;
76  while (iter != iEnd && isdigit(*iter) != 0)
77  ++iter;
78  while (iter != iEnd && isdigit(*iter) == 0)
79  ++iter;
80  while (iter != iEnd && isdigit(*iter) != 0)
81  ++iter;
82  if (iter == iEnd)
83  return;
85  releaseVersion_.erase(iter, iEnd);
86  }

References edm::ProcessConfiguration::Transients::pcid_, releaseVersion_, and transient_.

◆ releaseVersion()

ReleaseVersion const& edm::ProcessConfiguration::releaseVersion ( ) const
inline

◆ setCurrentProcess()

void edm::ProcessConfiguration::setCurrentProcess ( )
inlineprivate

◆ setParameterSetID()

void edm::ProcessConfiguration::setParameterSetID ( ParameterSetID const &  pSetID)

Definition at line 57 of file ProcessConfiguration.cc.

57  {
59  parameterSetID_ = pSetID;
60  }

References cms::cuda::assert(), and parameterSetID_.

◆ setPCID()

void edm::ProcessConfiguration::setPCID ( ProcessConfigurationID const &  pcid)
inlineprivate

Definition at line 51 of file ProcessConfiguration.h.

51 { transient_.pcid_ = pcid; }

References edm::ProcessConfiguration::Transients::pcid_, and transient_.

◆ setProcessConfigurationID()

ProcessConfigurationID edm::ProcessConfiguration::setProcessConfigurationID ( )

Definition at line 62 of file ProcessConfiguration.cc.

62  {
63  if (!transient_.pcid_.isValid()) {
64  transient_.pcid_ = id();
65  }
66  return transient_.pcid_;
67  }

References id(), edm::Hash< I >::isValid(), edm::ProcessConfiguration::Transients::pcid_, and transient_.

Member Data Documentation

◆ parameterSetID_

ParameterSetID edm::ProcessConfiguration::parameterSetID_
private

Definition at line 56 of file ProcessConfiguration.h.

Referenced by isParameterSetValid(), parameterSetID(), and setParameterSetID().

◆ passID_

PassID edm::ProcessConfiguration::passID_
private

Definition at line 58 of file ProcessConfiguration.h.

Referenced by passID().

◆ processName_

std::string edm::ProcessConfiguration::processName_
private

Definition at line 55 of file ProcessConfiguration.h.

Referenced by processName().

◆ releaseVersion_

ReleaseVersion edm::ProcessConfiguration::releaseVersion_
private

Definition at line 57 of file ProcessConfiguration.h.

Referenced by reduce(), and releaseVersion().

◆ transient_

Transients edm::ProcessConfiguration::transient_
private
edm::ParameterSetID
Hash< ParameterSetType > ParameterSetID
Definition: ParameterSetID.h:21
edm::errors::LogicError
Definition: EDMException.h:37
edm::ProcessConfiguration::isCurrentProcess
bool isCurrentProcess() const
Definition: ProcessConfiguration.h:52
edm::ProcessConfiguration::setCurrentProcess
void setCurrentProcess()
Definition: ProcessConfiguration.h:53
cms::cuda::assert
assert(be >=bs)
edm::ProcessConfiguration::id
ProcessConfigurationID id() const
Definition: ProcessConfiguration.cc:44
edm::ProcessConfiguration::passID_
PassID passID_
Definition: ProcessConfiguration.h:58
edm::Hash::isValid
bool isValid() const
Definition: Hash.h:141
cms::Digest
Definition: Digest.h:46
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProcessConfigurationID
Hash< ProcessConfigurationType > ProcessConfigurationID
Definition: ProcessConfigurationID.h:8
edm::ProcessConfiguration::processName_
std::string processName_
Definition: ProcessConfiguration.h:55
edm::ProcessConfiguration::parameterSetID_
ParameterSetID parameterSetID_
Definition: ProcessConfiguration.h:56
Exception
Definition: hltDiff.cc:246
edm::ProcessConfiguration::releaseVersion_
ReleaseVersion releaseVersion_
Definition: ProcessConfiguration.h:57
edm::ProcessConfiguration::Transients::isCurrentProcess_
bool isCurrentProcess_
Definition: ProcessConfiguration.h:47
edm::ProcessConfiguration::Transients::reset
void reset()
Definition: ProcessConfiguration.h:42
edm::ProcessConfiguration::transient_
Transients transient_
Definition: ProcessConfiguration.h:59
edm::ProcessConfiguration::Transients::pcid_
ProcessConfigurationID pcid_
Definition: ProcessConfiguration.h:46