CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Friends
MagFieldConfig Class Reference

#include <MagFieldConfig.h>

Public Member Functions

std::vector< unsigned > expandList (const std::string &list)
 
 MagFieldConfig ()
 
 MagFieldConfig (const edm::ParameterSet &pset, bool debug=false)
 Constructor. More...
 

Public Attributes

int geometryVersion
 Version of the geometry to be used. More...
 
magneticfield::TableFileMap gridFiles
 Specification of which data table is to be used for each volume. More...
 
std::vector< int > keys
 Scaling factors for the field in specific volumes. More...
 
std::vector< double > slaveFieldParameters
 
std::string slaveFieldVersion
 Label or type of the tracker parametrization. More...
 
std::vector< double > values
 
std::string version
 Version of the data tables to be used. More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

No description available.

Author
N. Amapane - Torino

Definition at line 25 of file MagFieldConfig.h.

Constructor & Destructor Documentation

MagFieldConfig::MagFieldConfig ( )
inline

Definition at line 28 of file MagFieldConfig.h.

28 {}
MagFieldConfig::MagFieldConfig ( const edm::ParameterSet pset,
bool  debug = false 
)

Constructor.

Definition at line 21 of file MagFieldConfig.cc.

References filterCSVwithJSON::copy, gather_cfg::cout, Exception, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), i, j, relativeConstraints::keys, autoMagneticFieldProducer_cfi::master, fed_dqm_sourceclient-live_cfg::path, mergeVDriftHistosByStation::sectors, AlCaHLTBitMon_QueryRunRegistry::string, makeHLTPrescaleTable::values, relval_steps::version, and autoMagneticFieldProducer_cfi::volumes.

21  {
22 
23  version = pset.getParameter<std::string>("version");
24  geometryVersion = pset.getParameter<int>("geometryVersion");
25 
26 
27  // Get specification for the grid tables to be used.
28  typedef vector<edm::ParameterSet> VPSet;
29 
30  VPSet fileSpec = pset.getParameter<VPSet>("gridFiles");
31  if (fileSpec.size()!=0) {
32  for(VPSet::const_iterator rule = fileSpec.begin(); rule != fileSpec.end(); ++rule){
33  string s_volumes = rule->getParameter<string>("volumes");
34  string s_sectors = rule->getParameter<string>("sectors"); // 0 means all volumes
35  int master = rule->getParameter<int>("master");
36  string path = rule->getParameter<string>("path");
37 
38  vector<unsigned> volumes = expandList(s_volumes);
39  vector<unsigned> sectors = expandList(s_sectors);
40 
41  if (debug) {
42  cout << "Volumes: " << s_volumes <<" Sectors: " << s_sectors
43  << " Master: " << master << " Path: " << path << endl;
44  cout << " Expanded volumes: ";
45  copy(volumes.begin(), volumes.end(), ostream_iterator<unsigned>(cout, " "));
46  cout << endl;
47  cout << " Expanded sectors: ";
48  copy(sectors.begin(), sectors.end(), ostream_iterator<unsigned>(cout, " "));
49  cout << endl;
50  }
51 
52  for (vector<unsigned>::iterator i = volumes.begin(); i!=volumes.end(); ++i){
53  for (vector<unsigned>::iterator j = sectors.begin(); j!=sectors.end(); ++j){
54  unsigned vpacked = (*i)*100+(*j);
55  if (gridFiles.find(vpacked)==gridFiles.end()) {
56  gridFiles[vpacked] = make_pair(path, master);
57  } else {
58  throw cms::Exception("ConfigurationError") << "VolumeBasedMagneticFieldESProducer: malformed gridFiles config parameter" << endl;
59  }
60  }
61  }
62  }
63  }
64 
65  // Get scaling factors
66  keys = pset.getParameter<vector<int> >("scalingVolumes");
67  values = pset.getParameter<vector<double> >("scalingFactors");
68 
69 
70  // Slave field label. Either a label of an existing map (legacy support), or the
71  // type of parametrization to be constructed with the "paramData" parameters.
72  slaveFieldVersion = pset.getParameter<string>("paramLabel");
73  // Check for compatibility with older configurations
74  if (pset.existsAs<vector<double> >("paramData")) {
75  slaveFieldParameters = pset.getParameter<vector<double> >("paramData");
76  }
77 
78 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
std::vector< double > values
magneticfield::TableFileMap gridFiles
Specification of which data table is to be used for each volume.
std::string slaveFieldVersion
Label or type of the tracker parametrization.
int j
Definition: DBlmapReader.cc:9
std::vector< int > keys
Scaling factors for the field in specific volumes.
#define debug
Definition: HDRShower.cc:19
std::string version
Version of the data tables to be used.
int geometryVersion
Version of the geometry to be used.
tuple cout
Definition: gather_cfg.py:145
std::vector< unsigned > expandList(const std::string &list)
std::vector< double > slaveFieldParameters

Member Function Documentation

vector< unsigned > MagFieldConfig::expandList ( const std::string &  list)

Definition at line 80 of file MagFieldConfig.cc.

References end, Exception, i, relval_2017::k, split, dqm_diff::start, and makeHLTPrescaleTable::values.

80  {
81  typedef vector<string> vstring;
82  vector<unsigned> values;
83  vstring v1;
84  boost::split(v1, list, boost::is_any_of(","));
85  for (vstring::const_iterator i= v1.begin(); i!=v1.end(); ++i){
86  vstring v2;
87  boost::split(v2, *i, boost::is_any_of("-"));
88  unsigned start = boost::lexical_cast<unsigned>(v2.front());
89  unsigned end = boost::lexical_cast<unsigned>(v2.back());
90  if ((v2.size()>2) || (start>end)) {
91  throw cms::Exception("ConfigurationError") << "VolumeBasedMagneticFieldESProducerFromDB: malformed configuration" << list << endl;
92  }
93  for (unsigned k = start; k<=end; ++k){
94  values.push_back(k);
95  }
96  }
97  return values;
98 }
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
vector< string > vstring
Definition: ExoticaDQM.cc:8
std::vector< double > values
#define end
Definition: vmac.h:37
double split
Definition: MVATrainer.cc:139
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
template<class Archive >
void MagFieldConfig::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 58 of file MagFieldConfig.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 58 of file MagFieldConfig.h.

Member Data Documentation

int MagFieldConfig::geometryVersion
magneticfield::TableFileMap MagFieldConfig::gridFiles

Specification of which data table is to be used for each volume.

Definition at line 44 of file MagFieldConfig.h.

Referenced by magneticfield::VolumeBasedMagneticFieldESProducer::produce(), and magneticfield::VolumeBasedMagneticFieldESProducerFromDB::produce().

std::vector<int> MagFieldConfig::keys
std::vector<double> MagFieldConfig::slaveFieldParameters

Parameters for the tracker parametrization (not used in legacy producers where slaveFieldVersion is the label of the parametrization in the EventSetup)

Definition at line 56 of file MagFieldConfig.h.

Referenced by magneticfield::VolumeBasedMagneticFieldESProducerFromDB::produce().

std::string MagFieldConfig::slaveFieldVersion

Label or type of the tracker parametrization.

Definition at line 51 of file MagFieldConfig.h.

Referenced by magneticfield::VolumeBasedMagneticFieldESProducerFromDB::produce().

std::vector<double> MagFieldConfig::values
std::string MagFieldConfig::version