CMS 3D CMS Logo

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

#include <VolumeBasedMagneticFieldESProducer.h>

Inheritance diagram for magneticfield::VolumeBasedMagneticFieldESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

std::auto_ptr< MagneticFieldproduce (const IdealMagneticFieldRecord &iRecord)
 
 VolumeBasedMagneticFieldESProducer (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Member Functions

std::vector< unsigned > expandList (const std::string &list)
 
const
VolumeBasedMagneticFieldESProducer
operator= (const VolumeBasedMagneticFieldESProducer &)
 
 VolumeBasedMagneticFieldESProducer (const VolumeBasedMagneticFieldESProducer &)
 

Private Attributes

edm::ParameterSet pset
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 21 of file VolumeBasedMagneticFieldESProducer.h.

Constructor & Destructor Documentation

VolumeBasedMagneticFieldESProducer::VolumeBasedMagneticFieldESProducer ( const edm::ParameterSet iConfig)

Definition at line 29 of file VolumeBasedMagneticFieldESProducer.cc.

References edm::ParameterSet::getUntrackedParameter(), pset, edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

29  : pset(iConfig)
30 {
32 }
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
magneticfield::VolumeBasedMagneticFieldESProducer::VolumeBasedMagneticFieldESProducer ( const VolumeBasedMagneticFieldESProducer )
private

Member Function Documentation

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

Definition at line 108 of file VolumeBasedMagneticFieldESProducer.cc.

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

Referenced by produce().

108  {
109  typedef vector<string> vstring;
110  vector<unsigned> values;
111  vstring v1;
112  boost::split(v1, list, boost::is_any_of(","));
113  for (vstring::const_iterator i= v1.begin(); i!=v1.end(); ++i){
114  vstring v2;
115  boost::split(v2, *i, boost::is_any_of("-"));
116  unsigned start = boost::lexical_cast<unsigned>(v2.front());
117  unsigned end = boost::lexical_cast<unsigned>(v2.back());
118  if ((v2.size()>2) || (start>end)) {
119  edm::LogError("BADconfiguration") << "VolumeBasedMagneticFieldESProducer: malformed configuration" << list << endl;
120  abort();
121  }
122  for (unsigned k = start; k<=end; ++k){
123  values.push_back(k);
124  }
125  }
126  return values;
127 }
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
vector< string > vstring
Definition: ExoticaDQM.cc:75
#define end
Definition: vmac.h:37
int k[5][pyjets_maxn]
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
const VolumeBasedMagneticFieldESProducer& magneticfield::VolumeBasedMagneticFieldESProducer::operator= ( const VolumeBasedMagneticFieldESProducer )
private
std::auto_ptr< MagneticField > VolumeBasedMagneticFieldESProducer::produce ( const IdealMagneticFieldRecord iRecord)

Definition at line 35 of file VolumeBasedMagneticFieldESProducer.cc.

References MagGeoBuilderFromDDD::barrelLayers(), MagGeoBuilderFromDDD::barrelVolumes(), MagGeoBuilderFromDDD::build(), filterCSVwithJSON::copy, gather_cfg::cout, debug, MagGeoBuilderFromDDD::endcapSectors(), MagGeoBuilderFromDDD::endcapVolumes(), expandList(), edm::eventsetup::EventSetupRecord::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, j, relativeConstraints::keys, autoMagneticFieldProducer_cfi::master, MagGeoBuilderFromDDD::maxR(), MagGeoBuilderFromDDD::maxZ(), cmsHarvester::path, edm::ESHandle< class >::product(), pset, alignCSCRings::s, mergeVDriftHistosByStation::sectors, MagGeoBuilderFromDDD::setGridFiles(), MagGeoBuilderFromDDD::setScaling(), AlCaHLTBitMon_QueryRunRegistry::string, makeHLTPrescaleTable::values, and autoMagneticFieldProducer_cfi::volumes.

36 {
37  bool debug = pset.getUntrackedParameter<bool>("debugBuilder", false);
38  if (debug) {
39  cout << "VolumeBasedMagneticFieldESProducer::produce() " << pset.getParameter<std::string>("version") << endl;
40  }
41 
43  iRecord.get("magfield",cpv );
45  pset.getParameter<int>("geometryVersion"),
46  debug);
47 
48  // Get scaling factors
49  vector<int> keys = pset.getParameter<vector<int> >("scalingVolumes");
50  vector<double> values = pset.getParameter<vector<double> >("scalingFactors");
51 
52  if (keys.size() != 0) {
53  builder.setScaling(keys, values);
54  }
55 
56  // Get specification for the grid tables to be used.
57  typedef vector<edm::ParameterSet> VPSet;
58  {
59  VPSet fileSpec = pset.getParameter<VPSet>("gridFiles");
60  if (fileSpec.size()!=0) {
61  auto_ptr<TableFileMap> gridFiles(new TableFileMap);
62  for(VPSet::const_iterator rule = fileSpec.begin(); rule != fileSpec.end(); ++rule){
63  string s_volumes = rule->getParameter<string>("volumes");
64  string s_sectors = rule->getParameter<string>("sectors"); // 0 means all volumes
65  int master = rule->getParameter<int>("master");
66  string path = rule->getParameter<string>("path");
67 
68  vector<unsigned> volumes = expandList(s_volumes);
69  vector<unsigned> sectors = expandList(s_sectors);
70 
71  if (debug) {
72  cout << s_volumes << endl;
73  copy(volumes.begin(), volumes.end(), ostream_iterator<unsigned>(cout, " "));
74  cout << endl;
75  cout << s_sectors << endl;
76  copy(sectors.begin(), sectors.end(), ostream_iterator<unsigned>(cout, " "));
77  cout << endl;
78  }
79 
80  for (vector<unsigned>::iterator i = volumes.begin(); i!=volumes.end(); ++i){
81  for (vector<unsigned>::iterator j = sectors.begin(); j!=sectors.end(); ++j){
82  unsigned vpacked = (*i)*100+(*j);
83  if (gridFiles->find(vpacked)==gridFiles->end()) {
84  (*gridFiles)[vpacked] = make_pair(path, master);
85  } else {
86  edm::LogError("BADconfiguration") << "ERROR: VolumeBasedMagneticFieldESProducer: malformed gridFiles config parameter";
87  abort();
88  }
89  }
90  }
91  }
92  builder.setGridFiles(gridFiles); // gridFiles passed by reference, which is required to exist until
93  }
94  }
95 
96  builder.build(*cpv);
97 
98 
99  // Get slave field
100  edm::ESHandle<MagneticField> paramField;
101  if (pset.getParameter<bool>("useParametrizedTrackerField")) {;
102  iRecord.get(pset.getParameter<string>("paramLabel"),paramField);
103  }
104  std::auto_ptr<MagneticField> s(new VolumeBasedMagneticField(pset,builder.barrelLayers(), builder.endcapSectors(), builder.barrelVolumes(), builder.endcapVolumes(), builder.maxR(), builder.maxZ(), paramField.product(), false));
105  return s;
106 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
tuple path
else: Piece not in the list, fine.
void get(HolderT &iHolder) const
int j
Definition: DBlmapReader.cc:9
std::vector< unsigned > expandList(const std::string &list)
#define debug
Definition: HDRShower.cc:19
T const * product() const
Definition: ESHandle.h:86
tuple cout
Definition: gather_cfg.py:121
std::map< unsigned, std::pair< std::string, int > > TableFileMap

Member Data Documentation

edm::ParameterSet magneticfield::VolumeBasedMagneticFieldESProducer::pset
private