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 ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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 () noexcept(false)
 

Private Attributes

edm::ParameterSet pset_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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 19 of file SteppingHelixPropagatorESProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 39 of file SteppingHelixPropagatorESProducer.cc.

39 {}

Member Function Documentation

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

Definition at line 42 of file SteppingHelixPropagatorESProducer.cc.

References alongMomentum, anyDirection, pfDeepBoostedJet_cff::debugMode, DEFINE_FWK_EVENTSETUP_MODULE, dir, edm::ParameterSet::getParameter(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), MagneticField::nominalValue(), oppositeToMomentum, pset_, SteppingHelixPropagator_cfi::returnTangentPlane, SteppingHelixPropagator_cfi::sendLogWarning, SteppingHelixPropagator_cfi::SteppingHelixPropagator, AlCaHLTBitMon_QueryRunRegistry::string, SteppingHelixPropagator_cfi::useInTeslaFromMagField, SteppingHelixPropagator_cfi::useIsYokeFlag, SteppingHelixPropagator_cfi::useMagVolumes, SteppingHelixPropagator_cfi::useMatVolumes, and SteppingHelixPropagator_cfi::useTuningForL2Speed.

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

Member Data Documentation

edm::ParameterSet SteppingHelixPropagatorESProducer::pset_
private