CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 29 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 19 of file ProcessConfiguration.cc.

23  :
24  processName_(procName),
25  parameterSetID_(pSetID),
26  releaseVersion_(relVersion),
27  passID_(pass) { }

Member Function Documentation

ProcessConfigurationID edm::ProcessConfiguration::id ( void  ) const

Definition at line 54 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().

54  {
55  if(transient_.pcid_.isValid()) {
56  return transient_.pcid_;
57  }
58  // This implementation is ripe for optimization.
59  std::ostringstream oss;
60  oss << *this;
61  std::string stringrep = oss.str();
62  cms::Digest md5alg(stringrep);
63  ProcessConfigurationID pcid(md5alg.digest().toString());
64  return pcid;
65  }
Hash< ProcessConfigurationType > ProcessConfigurationID
bool isValid() const
Definition: Hash.h:150
void edm::ProcessConfiguration::initializeTransients ( )
inline
bool edm::ProcessConfiguration::isCurrentProcess ( ) const
inlineprivate
bool edm::ProcessConfiguration::isParameterSetValid ( ) const
inline

Definition at line 28 of file ProcessConfiguration.h.

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

28 {return parameterSetID_.isValid();}
bool isValid() const
Definition: Hash.h:150
ParameterSetID const & edm::ProcessConfiguration::parameterSetID ( ) const

Definition at line 39 of file ProcessConfiguration.cc.

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

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

39  {
42  << "Illegal attempt to access the process top level parameter set ID\n"
43  << "from the ProcessConfiguration before that parameter\n"
44  << "set has been frozen and registered. The parameter set\n"
45  << "can be changed during module validation, which occurs\n"
46  << "concurrently with module construction. The ID of the\n"
47  << "ProcessConfiguration itself also depends on that parameter\n"
48  << "set ID. It is illegal to access either before they are frozen.\n";
49  }
50  return parameterSetID_;
51  }
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 82 of file ProcessConfiguration.cc.

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

82  {
83  // Skip to the part of the release version just after
84  // the first two numbers and erase the rest of it.
85  std::string::iterator iter = releaseVersion_.begin();
86  std::string::iterator iEnd = releaseVersion_.end();
87  while(iter != iEnd && isdigit(*iter) == 0) ++iter;
88  while(iter != iEnd && isdigit(*iter) != 0) ++iter;
89  while(iter != iEnd && isdigit(*iter) == 0) ++iter;
90  while(iter != iEnd && isdigit(*iter) != 0) ++iter;
91  if (iter == iEnd) return;
93  releaseVersion_.erase(iter,iEnd);
94  }
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 68 of file ProcessConfiguration.cc.

References assert(), and parameterSetID_.

68  {
70  parameterSetID_ = pSetID;
71  }
assert(m_qm.get())
Hash< ParameterSetType > ParameterSetID
void edm::ProcessConfiguration::setPCID ( ProcessConfigurationID const &  pcid)
inlineprivate
ProcessConfigurationID edm::ProcessConfiguration::setProcessConfigurationID ( )

Definition at line 74 of file ProcessConfiguration.cc.

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

74  {
75  if(!transient_.pcid_.isValid()) {
76  transient_.pcid_ = id();
77  }
78  return transient_.pcid_;
79  }
ProcessConfigurationID id() const
bool isValid() const
Definition: Hash.h:150

Member Data Documentation

ParameterSetID edm::ProcessConfiguration::parameterSetID_
private

Definition at line 58 of file ProcessConfiguration.h.

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

PassID edm::ProcessConfiguration::passID_
private

Definition at line 60 of file ProcessConfiguration.h.

Referenced by passID().

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

Definition at line 57 of file ProcessConfiguration.h.

Referenced by processName().

ReleaseVersion edm::ProcessConfiguration::releaseVersion_
private

Definition at line 59 of file ProcessConfiguration.h.

Referenced by reduce(), and releaseVersion().

Transients edm::ProcessConfiguration::transient_
private