CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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

Definition at line 24 of file ProcessConfiguration.cc.

References setCurrentProcess().

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

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  }
Hash< ProcessConfigurationType > ProcessConfigurationID
bool isValid() const
Definition: Hash.h:141
void edm::ProcessConfiguration::initializeTransients ( )
inline
bool edm::ProcessConfiguration::isCurrentProcess ( ) const
inlineprivate
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 const & edm::ProcessConfiguration::parameterSetID ( ) const

Definition at line 31 of file ProcessConfiguration.cc.

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

Referenced by getHLTConfigData(), edm::Event::getProcessParameterSet(), edm::ModuleDescription::mainParameterSetID(), edm::operator<(), edm::operator<<(), edm::operator==(), edm::parameterSet(), edm::ProcessContext::parameterSetID(), and pat::PATTriggerProducer::produce().

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 const& edm::ProcessConfiguration::passID ( ) const
inline
std::string const& edm::ProcessConfiguration::processName ( ) const
inline
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 const& edm::ProcessConfiguration::releaseVersion ( ) const
inline
void edm::ProcessConfiguration::setCurrentProcess ( )
inlineprivate
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
void edm::ProcessConfiguration::setPCID ( ProcessConfigurationID const &  pcid)
inlineprivate
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 edm::ProcessConfiguration::parameterSetID_
private

Definition at line 56 of file ProcessConfiguration.h.

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

PassID edm::ProcessConfiguration::passID_
private

Definition at line 58 of file ProcessConfiguration.h.

Referenced by passID().

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

Definition at line 55 of file ProcessConfiguration.h.

Referenced by processName().

ReleaseVersion edm::ProcessConfiguration::releaseVersion_
private

Definition at line 57 of file ProcessConfiguration.h.

Referenced by reduce(), and releaseVersion().

Transients edm::ProcessConfiguration::transient_
private