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, ReleaseVersion const &relVersion, PassID const &pass)
 
 ProcessConfiguration (std::string const &procName, ParameterSetID const &pSetID, 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 ( )

◆ ProcessConfiguration() [2/3]

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

Definition at line 24 of file ProcessConfiguration.cc.

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.

Member Function Documentation

◆ id()

ProcessConfigurationID edm::ProcessConfiguration::id ( ) const

Definition at line 44 of file ProcessConfiguration.cc.

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

Referenced by setProcessConfigurationID().

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  }
bool isValid() const
Definition: Hash.h:141
Hash< ProcessConfigurationType > ProcessConfigurationID

◆ 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.

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

26 { return parameterSetID_.isValid(); }
bool isValid() const
Definition: Hash.h:141

◆ parameterSetID()

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

Definition at line 31 of file ProcessConfiguration.cc.

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

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

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  }
Hash< ParameterSetType > 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.

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

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  }
Hash< ProcessConfigurationType > ProcessConfigurationID

◆ 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.

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

Referenced by edm::RepeatingCachedRootSource::beginJob().

57  {
59  parameterSetID_ = pSetID;
60  }
assert(be >=bs)
Hash< ParameterSetType > ParameterSetID

◆ setPCID()

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

◆ setProcessConfigurationID()

ProcessConfigurationID edm::ProcessConfiguration::setProcessConfigurationID ( )

Definition at line 62 of file ProcessConfiguration.cc.

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

Referenced by edm::RepeatingCachedRootSource::beginJob().

62  {
63  if (!transient_.pcid_.isValid()) {
64  transient_.pcid_ = id();
65  }
66  return transient_.pcid_;
67  }
ProcessConfigurationID id() const
bool isValid() const
Definition: Hash.h:141

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