CMS 3D CMS Logo

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

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () 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::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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::SteppingHelixPropagatorESProducer ( const edm::ParameterSet p)

Definition at line 34 of file SteppingHelixPropagatorESProducer.cc.

References AlCaHLTBitMon_ParallelJobs::p.

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

◆ ~SteppingHelixPropagatorESProducer()

SteppingHelixPropagatorESProducer::~SteppingHelixPropagatorESProducer ( )
override

Definition at line 44 of file SteppingHelixPropagatorESProducer.cc.

44 {}

Member Function Documentation

◆ produce()

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, DeadROC_duringRun::dir, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::ParameterSet::getParameter(), volumeBasedMagneticField_160812_cfi::magfield, magToken_, oppositeToMomentum, pset_, HLT_2024v11_cff::returnTangentPlane, HLT_2024v11_cff::sendLogWarning, setVBFPointer_, AlCaHLTBitMon_QueryRunRegistry::string, HLT_2024v11_cff::useInTeslaFromMagField, HLT_2024v11_cff::useIsYokeFlag, HLT_2024v11_cff::useMagVolumes, HLT_2024v11_cff::useMatVolumes, HLT_2024v11_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")
59  if (pdir == "alongMomentum")
61  if (pdir == "anyDirection")
62  dir = anyDirection;
63 
64  std::unique_ptr<SteppingHelixPropagator> shProp;
65  shProp = std::make_unique<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;
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
Definition: ParameterSet.h:307
PropagationDirection
Log< level::Info, false > LogInfo
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > vbMagToken_
Log< level::Warning, false > LogWarning
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ magToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SteppingHelixPropagatorESProducer::magToken_
private

Definition at line 27 of file SteppingHelixPropagatorESProducer.cc.

Referenced by produce().

◆ pset_

const edm::ParameterSet SteppingHelixPropagatorESProducer::pset_
private

Definition at line 26 of file SteppingHelixPropagatorESProducer.cc.

Referenced by produce().

◆ setVBFPointer_

const bool SteppingHelixPropagatorESProducer::setVBFPointer_
private

Definition at line 29 of file SteppingHelixPropagatorESProducer.cc.

Referenced by produce().

◆ vbMagToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SteppingHelixPropagatorESProducer::vbMagToken_
private

Definition at line 28 of file SteppingHelixPropagatorESProducer.cc.

Referenced by produce().