CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SteppingHelixPropagatorESProducer Class Reference
Inheritance diagram for SteppingHelixPropagatorESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

std::unique_ptr< Propagatorproduce (const TrackingComponentsRecord &)
 
 SteppingHelixPropagatorESProducer (const edm::ParameterSet &p)
 
 ~SteppingHelixPropagatorESProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagToken_
 
const edm::ParameterSet pset_
 
const bool setVBFPointer_
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordvbMagToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy >>>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 19 of file SteppingHelixPropagatorESProducer.cc.

Constructor & Destructor Documentation

SteppingHelixPropagatorESProducer::SteppingHelixPropagatorESProducer ( const edm::ParameterSet p)

Definition at line 34 of file SteppingHelixPropagatorESProducer.cc.

References HltBtagPostValidation_cff::c, edm::ParameterSet::getParameter(), magToken_, AlCaHLTBitMon_ParallelJobs::p, pset_, setVBFPointer_, edm::ESProducer::setWhatProduced(), AlCaHLTBitMon_QueryRunRegistry::string, and vbMagToken_.

35  : pset_{p}, setVBFPointer_{pset_.getParameter<bool>("SetVBFPointer")} {
36  std::string myname = p.getParameter<std::string>("ComponentName");
37  auto c = setWhatProduced(this, myname);
38  c.setConsumes(magToken_);
39  if (setVBFPointer_) {
40  c.setConsumes(vbMagToken_, edm::ESInputTag("", pset_.getParameter<std::string>("VBFName")));
41  }
42 }
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > vbMagToken_
SteppingHelixPropagatorESProducer::~SteppingHelixPropagatorESProducer ( )
override

Definition at line 44 of file SteppingHelixPropagatorESProducer.cc.

44 {}

Member Function Documentation

std::unique_ptr< Propagator > SteppingHelixPropagatorESProducer::produce ( const TrackingComponentsRecord iRecord)

Definition at line 46 of file SteppingHelixPropagatorESProducer.cc.

References alongMomentum, anyDirection, beampixel_dqm_sourceclient-live_cfg::debugMode, DEFINE_FWK_EVENTSETUP_MODULE, DeadROC_duringRun::dir, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::ParameterSet::getParameter(), volumeBasedMagneticField_1103l_cfi::magfield, magToken_, oppositeToMomentum, pset_, HLT_2018_cff::returnTangentPlane, HLT_2018_cff::sendLogWarning, setVBFPointer_, SteppingHelixPropagator_cfi::SteppingHelixPropagator, AlCaHLTBitMon_QueryRunRegistry::string, HLT_2018_cff::useInTeslaFromMagField, HLT_2018_cff::useIsYokeFlag, HLT_2018_cff::useMagVolumes, HLT_2018_cff::useMatVolumes, HLT_2018_cff::useTuningForL2Speed, and vbMagToken_.

46  {
47  // if (_propagator){
48  // delete _propagator;
49  // _propagator = 0;
50  // }
51  auto const& magfield = iRecord.get(magToken_);
52 
53  std::string pdir = pset_.getParameter<std::string>("PropagationDirection");
54 
56 
57  if (pdir == "oppositeToMomentum")
58  dir = oppositeToMomentum;
59  if (pdir == "alongMomentum")
60  dir = alongMomentum;
61  if (pdir == "anyDirection")
62  dir = anyDirection;
63 
64  std::unique_ptr<SteppingHelixPropagator> shProp;
65  shProp.reset(new SteppingHelixPropagator(&magfield, dir));
66 
67  bool useInTeslaFromMagField = pset_.getParameter<bool>("useInTeslaFromMagField");
68  bool useMagVolumes = pset_.getParameter<bool>("useMagVolumes");
69 
70  // if useMagVolumes == true and an alternate VBF field is not specified with setVBFPointer_,
71  // Force "useInTeslaFromMagField=true" for a B=0 VBF map.
72  if (useMagVolumes == true && !useInTeslaFromMagField && !setVBFPointer_ && magfield.nominalValue() == 0) {
73  const VolumeBasedMagneticField* vbfCPtr = dynamic_cast<const VolumeBasedMagneticField*>(&magfield);
74  if (vbfCPtr == nullptr) {
75  edm::LogWarning("SteppingHelixPropagator")
76  << "Config specifies useMagVolumes==True but no VBF field available: SHP has no access to yoke material "
77  "properties. Use setVBFPointer=true and VBFName cards to set a VBF field, otherwise set "
78  "useMagVolumes==False."
79  << std::endl;
80  } else {
81  edm::LogInfo("SteppingHelixPropagator")
82  << "Config specifies useMagVolumes==true and VBF field available: Forcing useInTeslaFromMagField = True."
83  << std::endl;
84  useInTeslaFromMagField = true;
85  }
86  }
87 
88  if (setVBFPointer_) {
89  auto const& vbfField = iRecord.get(vbMagToken_);
90  const VolumeBasedMagneticField* vbfCPtr = dynamic_cast<const VolumeBasedMagneticField*>(&vbfField);
91  shProp->setVBFPointer(vbfCPtr);
92  }
93 
94  shProp->setUseInTeslaFromMagField(useInTeslaFromMagField);
95 
96  bool haveX0Corr = pset_.getParameter<bool>("ApplyRadX0Correction");
97  shProp->applyRadX0Correction(haveX0Corr);
98 
99  bool assumeNoMaterial = pset_.getParameter<bool>("AssumeNoMaterial");
100  shProp->setMaterialMode(assumeNoMaterial);
101 
102  bool noErrorPropagation = pset_.getParameter<bool>("NoErrorPropagation");
103  shProp->setNoErrorPropagation(noErrorPropagation);
104 
105  bool debugMode = pset_.getParameter<bool>("debug");
106  shProp->setDebug(debugMode);
107 
108  shProp->setUseMagVolumes(useMagVolumes);
109 
110  bool useMatVolumes = pset_.getParameter<bool>("useMatVolumes");
111  shProp->setUseMatVolumes(useMatVolumes);
112 
113  bool useIsYokeFlag = pset_.getParameter<bool>("useIsYokeFlag");
114  shProp->setUseIsYokeFlag(useIsYokeFlag);
115 
116  bool returnTangentPlane = pset_.getParameter<bool>("returnTangentPlane");
117  shProp->setReturnTangentPlane(returnTangentPlane);
118 
119  bool sendLogWarning = pset_.getParameter<bool>("sendLogWarning");
120  shProp->setSendLogWarning(sendLogWarning);
121 
122  bool useTuningForL2Speed = pset_.getParameter<bool>("useTuningForL2Speed");
123  shProp->setUseTuningForL2Speed(useTuningForL2Speed);
124 
125  bool useECoffsets = pset_.getParameter<bool>("useEndcapShiftsInZ");
126  if (useECoffsets) {
127  double valPos = pset_.getParameter<double>("endcapShiftInZPos");
128  double valNeg = pset_.getParameter<double>("endcapShiftInZNeg");
129  shProp->setEndcapShiftsInZPosNeg(valPos, valNeg);
130  }
131 
132  return shProp;
133 }
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
T getParameter(std::string const &) const
PropagationDirection
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > vbMagToken_

Member Data Documentation

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SteppingHelixPropagatorESProducer::magToken_
private
const edm::ParameterSet SteppingHelixPropagatorESProducer::pset_
private
const bool SteppingHelixPropagatorESProducer::setVBFPointer_
private
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SteppingHelixPropagatorESProducer::vbMagToken_
private