CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
edm::VParameterSetEntry Class Reference

#include <VParameterSetEntry.h>

Public Member Functions

std::string dump (unsigned int indent=0) const
 
void fillVPSet () const
 reconstitutes the VPSet from the registry More...
 
bool isTracked () const
 
VParameterSetEntryoperator= (VParameterSetEntry const &)=default
 
VParameterSetEntryoperator= (VParameterSetEntry &&)=default
 
ParameterSetpsetInVector (int i)
 
void registerPsetsAndUpdateIDs ()
 
std::vector< ParameterSet >::size_type size () const
 
void toDigest (cms::Digest &digest) const
 
std::string toString () const
 
void toString (std::string &result) const
 
 VParameterSetEntry ()
 
 VParameterSetEntry (std::vector< ParameterSet > const &vpset, bool isTracked)
 
 VParameterSetEntry (std::string const &rep)
 
 VParameterSetEntry (VParameterSetEntry const &)=default
 
 VParameterSetEntry (VParameterSetEntry &&)=default
 
std::vector< ParameterSet > const & vpset () const
 returns the VPSet More...
 
std::vector< ParameterSet > & vpsetForUpdate ()
 
 ~VParameterSetEntry ()=default
 

Private Attributes

value_ptr< std::vector< ParameterSetID > > theIDs_
 
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
 
bool tracked_
 

Friends

std::ostream & operator<< (std::ostream &os, VParameterSetEntry const &vpsetEntry)
 

Detailed Description

Definition at line 23 of file VParameterSetEntry.h.

Constructor & Destructor Documentation

edm::VParameterSetEntry::VParameterSetEntry ( )

Definition at line 12 of file VParameterSetEntry.cc.

12  :
13  tracked_(false),
14  theVPSet_(),
15  theIDs_() {
16  }
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
edm::VParameterSetEntry::VParameterSetEntry ( std::vector< ParameterSet > const &  vpset,
bool  isTracked 
)

Definition at line 18 of file VParameterSetEntry.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, and theVPSet_.

18  :
20  theVPSet_(new std::vector<ParameterSet>),
21  theIDs_() {
22  for (std::vector<ParameterSet>::const_iterator i = vpset.begin(), e = vpset.end(); i != e; ++i) {
23  theVPSet_->push_back(*i);
24  }
25  }
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
std::vector< ParameterSet > const & vpset() const
returns the VPSet
edm::VParameterSetEntry::VParameterSetEntry ( std::string const &  rep)

Definition at line 27 of file VParameterSetEntry.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, edm::split(), AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and theIDs_.

27  :
28  tracked_(rep[0] == '+'),
29  theVPSet_(),
30  theIDs_(new std::vector<ParameterSetID>) {
31  assert(rep[0] == '+' || rep[0] == '-');
32  std::vector<std::string> temp;
33  // need a substring that starts at the '{'
34  std::string bracketedRepr(rep.begin()+2, rep.end());
35  split(std::back_inserter(temp), bracketedRepr, '{', ',', '}');
36  theIDs_->reserve(temp.size());
37  for (std::vector<std::string>::const_iterator i = temp.begin(), e = temp.end(); i != e; ++i) {
38  theIDs_->push_back(ParameterSetID(*i));
39  }
40  }
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
bool split(OutIter result, std::string const &string_to_split, char first, char sep, char last)
Definition: split.h:88
rep
Definition: cuy.py:1190
Hash< ParameterSetType > ParameterSetID
edm::VParameterSetEntry::~VParameterSetEntry ( )
default
edm::VParameterSetEntry::VParameterSetEntry ( VParameterSetEntry const &  )
default
edm::VParameterSetEntry::VParameterSetEntry ( VParameterSetEntry &&  )
default

Member Function Documentation

std::string edm::VParameterSetEntry::dump ( unsigned int  indent = 0) const

Definition at line 131 of file VParameterSetEntry.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, isTracked(), command_line::start, AlCaHLTBitMon_QueryRunRegistry::string, and vpset().

Referenced by edm::ParameterSet::dump(), isTracked(), and edm::operator<<().

131  {
132  std::string indentation(indent, ' ');
133  std::ostringstream os;
134  std::vector<ParameterSet> const& vps = vpset();
135  os << "VPSet "<<(isTracked()?"tracked":"untracked")<<" = ({" << std::endl;
137  std::string const between(",\n");
138  for(std::vector<ParameterSet>::const_iterator i = vps.begin(), e = vps.end(); i != e; ++i) {
139  os << start << indentation << i->dump(indent);
140  start = between;
141  }
142  if (!vps.empty()) {
143  os << std::endl;
144  }
145  os << indentation << "})";
146  return os.str();
147  }
std::vector< ParameterSet > const & vpset() const
returns the VPSet
void edm::VParameterSetEntry::fillVPSet ( ) const

reconstitutes the VPSet from the registry

Definition at line 91 of file VParameterSetEntry.cc.

References edm::getParameterSet(), theIDs_, theVPSet_, and tmp.

Referenced by isTracked(), registerPsetsAndUpdateIDs(), vpset(), and vpsetForUpdate().

91  {
92  if(nullptr == theVPSet_.load()) {
93  auto tmp = std::make_unique<std::vector<ParameterSet>>();
94  tmp->reserve(theIDs_->size());
95  for (auto const& theID : *theIDs_) {
96  tmp->push_back(getParameterSet(theID));
97  }
98  VParameterSet* expected = nullptr;
99  if(theVPSet_.compare_exchange_strong(expected, tmp.get())) {
100  // theVPSet_ was equal to nullptr and now is equal to tmp.get()
101  tmp.release();
102  }
103  }
104  }
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool edm::VParameterSetEntry::isTracked ( ) const
inline

Definition at line 40 of file VParameterSetEntry.h.

References dump(), fillVPSet(), mps_fire::i, summarizeEdmComparisonLogfiles::indent, operator<<, psetInVector(), registerPsetsAndUpdateIDs(), size(), AlCaHLTBitMon_QueryRunRegistry::string, tracked_, vpset(), and vpsetForUpdate().

Referenced by Types.PSet::clone(), Mixins._ParameterTypeBase::configTypeName(), dump(), FWPSetTableManager::handleVPSetEntry(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Types.double::insertInto(), Mixins.UsingBlock::insertInto(), Types.bool::insertInto(), Types.string::insertInto(), Types.EventID::insertInto(), Types.LuminosityBlockID::insertInto(), Types.LuminosityBlockRange::insertInto(), Types.EventRange::insertInto(), Types.InputTag::insertInto(), Types.ESInputTag::insertInto(), Types.FileInPath::insertInto(), Types.PSet::insertInto(), Types.vint32::insertInto(), Types.vuint32::insertInto(), Types.vint64::insertInto(), Types.vuint64::insertInto(), Types.vdouble::insertInto(), Types.vbool::insertInto(), Types.vstring::insertInto(), Types.VLuminosityBlockID::insertInto(), Types.VInputTag::insertInto(), Types.VESInputTag::insertInto(), Types.VEventID::insertInto(), Types.VLuminosityBlockRange::insertInto(), Types.VEventRange::insertInto(), Types.VPSet::insertInto(), prettyPrint(), and Mixins._ParameterTypeBase::pythonTypeName().

VParameterSetEntry& edm::VParameterSetEntry::operator= ( VParameterSetEntry const &  )
default
VParameterSetEntry& edm::VParameterSetEntry::operator= ( VParameterSetEntry &&  )
default
ParameterSet & edm::VParameterSetEntry::psetInVector ( int  i)
void edm::VParameterSetEntry::registerPsetsAndUpdateIDs ( )

Definition at line 119 of file VParameterSetEntry.cc.

References MillePedeFileConverter_cfg::e, fillVPSet(), mps_fire::i, theIDs_, and theVPSet_.

Referenced by isTracked().

119  {
120  fillVPSet();
121  theIDs_ = value_ptr<std::vector<ParameterSetID> >(new std::vector<ParameterSetID>);
122  theIDs_->resize(theVPSet_->size());
123  for (std::vector<ParameterSet>::iterator i = theVPSet_->begin(), e = theVPSet_->end(); i != e; ++i) {
124  if (!i->isRegistered()) {
125  i->registerIt();
126  }
127  theIDs_->at(i - theVPSet_->begin()) = i->id();
128  }
129  }
void fillVPSet() const
reconstitutes the VPSet from the registry
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
std::vector< ParameterSet >::size_type edm::VParameterSetEntry::size ( void  ) const
void edm::VParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 58 of file VParameterSetEntry.cc.

References cms::Digest::append(), MillePedeFileConverter_cfg::e, mps_fire::i, theIDs_, and tracked_.

58  {
59  assert(theIDs_);
60  digest.append(tracked_ ? "+q{" : "-q{", 3);
61  bool started = false;
62  for (std::vector<ParameterSetID>::const_iterator i = theIDs_->begin(), e = theIDs_->end(); i != e; ++i) {
63  if (started)
64  digest.append(",", 1);
65  i->toDigest(digest);
66  started = true;
67  }
68  digest.append("}",1);
69  }
value_ptr< std::vector< ParameterSetID > > theIDs_
void append(std::string const &s)
Definition: Digest.cc:182
std::string edm::VParameterSetEntry::toString ( ) const
void edm::VParameterSetEntry::toString ( std::string &  result) const

Definition at line 43 of file VParameterSetEntry.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, command_line::start, AlCaHLTBitMon_QueryRunRegistry::string, theIDs_, and tracked_.

43  {
44  assert(theIDs_);
45  result += tracked_ ? "+q" : "-q";
46  result += '{';
48  std::string const between(",");
49  for (std::vector<ParameterSetID>::const_iterator i = theIDs_->begin(), e = theIDs_->end(); i != e; ++i) {
50  result += start;
51  i->toString(result);
52  start = between;
53  }
54  result += '}';
55  }
value_ptr< std::vector< ParameterSetID > > theIDs_
std::vector< ParameterSet > const & edm::VParameterSetEntry::vpset ( ) const

returns the VPSet

Definition at line 77 of file VParameterSetEntry.cc.

References fillVPSet(), and theVPSet_.

Referenced by dump(), edm::ParameterSet::getParameterSetVector(), edm::ParameterSet::getUntrackedParameterSetVector(), FWPSetTableManager::handleVPSetEntry(), isTracked(), prettyPrint(), and size().

77  {
78  fillVPSet();
79  return *theVPSet_;
80  }
void fillVPSet() const
reconstitutes the VPSet from the registry
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
std::vector< ParameterSet > & edm::VParameterSetEntry::vpsetForUpdate ( )

Definition at line 86 of file VParameterSetEntry.cc.

References fillVPSet(), and theVPSet_.

Referenced by FWPSetTableManager::handleVPSetEntry(), and isTracked().

86  {
87  fillVPSet();
88  return *theVPSet_;
89  }
void fillVPSet() const
reconstitutes the VPSet from the registry
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
VParameterSetEntry const &  vpsetEntry 
)
friend

Definition at line 149 of file VParameterSetEntry.cc.

Referenced by isTracked().

149  {
150  os << vpsetEntry.dump();
151  return os;
152  }

Member Data Documentation

value_ptr<std::vector<ParameterSetID> > edm::VParameterSetEntry::theIDs_
private
atomic_value_ptr<std::vector<ParameterSet> > edm::VParameterSetEntry::theVPSet_
mutableprivate
bool edm::VParameterSetEntry::tracked_
private

Definition at line 58 of file VParameterSetEntry.h.

Referenced by isTracked(), toDigest(), and toString().