CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
CTPPSBeamParametersESSource Class Reference

Loads CTPPSBeamParameters from a config file. More...

Inheritance diagram for CTPPSBeamParametersESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 CTPPSBeamParametersESSource (const edm::ParameterSet &)
 
std::unique_ptr< CTPPSBeamParametersproduce (const CTPPSBeamParametersRcd &)
 
 ~CTPPSBeamParametersESSource () override=default
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~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)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 sets infinite validity of this data More...
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 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 &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Member Functions

std::unique_ptr< CTPPSBeamParametersfillBeamParameters ()
 Fill CTPPSBeamParameters object with BP. More...
 
void setBeamParameters (const edm::ParameterSet &)
 Set BP to their values from config. More...
 

Private Attributes

double beamDivX45_
 
double beamDivX56_
 
double beamDivY45_
 
double beamDivY56_
 
double beamMom45_
 
double beamMom56_
 
double betaStarX45_
 
double betaStarX56_
 
double betaStarY45_
 
double betaStarY56_
 
double halfXangleX45_
 
double halfXangleX56_
 
double halfXangleY45_
 
double halfXangleY56_
 
bool setBeamPars_
 
double vtxOffsetX45_
 
double vtxOffsetX56_
 
double vtxOffsetY45_
 
double vtxOffsetY56_
 
double vtxOffsetZ45_
 
double vtxOffsetZ56_
 
double vtxStddevX_
 
double vtxStddevY_
 
double vtxStddevZ_
 

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
 

Detailed Description

Loads CTPPSBeamParameters from a config file.

Definition at line 42 of file CTPPSBeamParametersESSource.cc.

Constructor & Destructor Documentation

CTPPSBeamParametersESSource::CTPPSBeamParametersESSource ( const edm::ParameterSet iConfig)

Definition at line 79 of file CTPPSBeamParametersESSource.cc.

References setBeamParameters(), setBeamPars_, and edm::ESProducer::setWhatProduced().

79  :
80  setBeamPars_( iConfig.getParameter<bool>( "setBeamPars" ) ),
81  beamMom45_( 0. ), beamMom56_( 0. ),
82  betaStarX45_( 0. ), betaStarY45_( 0. ), betaStarX56_( 0. ), betaStarY56_( 0. ),
83  beamDivX45_( 0. ), beamDivY45_( 0. ), beamDivX56_( 0. ), beamDivY56_( 0. ),
84  halfXangleX45_( 0. ), halfXangleY45_( 0. ),
85  halfXangleX56_( 0. ), halfXangleY56_( 0. ),
86  vtxOffsetX45_( 0. ), vtxOffsetY45_( 0. ), vtxOffsetZ45_( 0. ),
87  vtxOffsetX56_( 0. ), vtxOffsetY56_( 0. ), vtxOffsetZ56_( 0. ),
88  vtxStddevX_( 0. ), vtxStddevY_( 0. ), vtxStddevZ_( 0. )
89 {
90  if ( setBeamPars_ )
91  setBeamParameters( iConfig );
92 
93  setWhatProduced(this);
94  findingRecord<CTPPSBeamParametersRcd>();
95 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
void setBeamParameters(const edm::ParameterSet &)
Set BP to their values from config.
CTPPSBeamParametersESSource::~CTPPSBeamParametersESSource ( )
overridedefault

Member Function Documentation

std::unique_ptr< CTPPSBeamParameters > CTPPSBeamParametersESSource::fillBeamParameters ( )
private

Fill CTPPSBeamParameters object with BP.

Definition at line 145 of file CTPPSBeamParametersESSource.cc.

References beamDivX45_, beamDivX56_, beamDivY45_, beamDivY56_, beamMom45_, beamMom56_, betaStarX45_, betaStarX56_, betaStarY45_, betaStarY56_, halfXangleX45_, halfXangleX56_, halfXangleY45_, halfXangleY56_, AlCaHLTBitMon_ParallelJobs::p, vtxOffsetX45_, vtxOffsetX56_, vtxOffsetY45_, vtxOffsetY56_, vtxOffsetZ45_, vtxOffsetZ56_, vtxStddevX_, vtxStddevY_, and vtxStddevZ_.

Referenced by produce().

146 {
147  auto p = std::make_unique<CTPPSBeamParameters>();
148 
149  p->setBeamMom45( beamMom45_ );
150  p->setBeamMom56( beamMom56_ );
151 
152  p->setBetaStarX45( betaStarX45_ );
153  p->setBetaStarY45( betaStarY45_ );
154  p->setBetaStarX56( betaStarX56_ );
155  p->setBetaStarY56( betaStarY56_ );
156 
157  p->setBeamDivergenceX45( beamDivX45_ );
158  p->setBeamDivergenceY45( beamDivY45_ );
159  p->setBeamDivergenceX56( beamDivX56_ );
160  p->setBeamDivergenceY56( beamDivY56_ );
161 
162  p->setHalfXangleX45( halfXangleX45_ );
163  p->setHalfXangleY45( halfXangleY45_ );
164  p->setHalfXangleX56( halfXangleX56_ );
165  p->setHalfXangleY56( halfXangleY56_ );
166 
167  p->setVtxOffsetX45( vtxOffsetX45_ );
168  p->setVtxOffsetY45( vtxOffsetY45_ );
169  p->setVtxOffsetZ45( vtxOffsetZ45_ );
170  p->setVtxOffsetX56( vtxOffsetX56_ );
171  p->setVtxOffsetY56( vtxOffsetY56_ );
172  p->setVtxOffsetZ56( vtxOffsetZ56_ );
173 
174  p->setVtxStddevX( vtxStddevX_ );
175  p->setVtxStddevY( vtxStddevY_ );
176  p->setVtxStddevZ( vtxStddevZ_ );
177 
178  return p;
179 }
void CTPPSBeamParametersESSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 198 of file CTPPSBeamParametersESSource.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_EVENTSETUP_SOURCE, and funct::true.

199 {
201  desc.add<bool>( "setBeamPars", true );
202  // beam momentum (GeV)
203  desc.add<double>( "beamMom45", 6500. );
204  desc.add<double>( "beamMom56", 6500. );
205  // beta* (cm)
206  desc.add<double>( "betaStarX45", 30. );
207  desc.add<double>( "betaStarY45", 30. );
208  desc.add<double>( "betaStarX56", 30. );
209  desc.add<double>( "betaStarY56", 30. );
210  // beam divergence (rad)
211  desc.add<double>( "beamDivX45", 0.1 );
212  desc.add<double>( "beamDivY45", 0.1 );
213  desc.add<double>( "beamDivX56", 0.1 );
214  desc.add<double>( "beamDivY56", 0.1 );
215  // half crossing angle (rad)
216  desc.add<double>( "halfXangleX45", 80.e-6 );
217  desc.add<double>( "halfXangleY45", 80.e-6 );
218  desc.add<double>( "halfXangleX56", 80.e-6 );
219  desc.add<double>( "halfXangleY56", 80.e-6 );
220  // vertex offset (cm)
221  desc.add<double>( "vtxOffsetX45", 1.e-2 );
222  desc.add<double>( "vtxOffsetY45", 1.e-2 );
223  desc.add<double>( "vtxOffsetZ45", 1.e-2 );
224  desc.add<double>( "vtxOffsetX56", 1.e-2 );
225  desc.add<double>( "vtxOffsetY56", 1.e-2 );
226  desc.add<double>( "vtxOffsetZ56", 1.e-2 );
227  // vertex sigma (cm)
228  desc.add<double>( "vtxStddevX", 2.e-2 );
229  desc.add<double>( "vtxStddevY", 2.e-2 );
230  desc.add<double>( "vtxStddevZ", 2.e-2 );
231 
232  descriptions.add( "ctppsBeamParametersESSource", desc );
233 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< CTPPSBeamParameters > CTPPSBeamParametersESSource::produce ( const CTPPSBeamParametersRcd )

Definition at line 100 of file CTPPSBeamParametersESSource.cc.

References fillBeamParameters(), and setBeamPars_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

101 {
102  // If beam parameters are available from the config file, fill their values into CTPPSBeamParameters object
103  auto bp = ( setBeamPars_ )
105  : std::make_unique<CTPPSBeamParameters>();
106 
107  edm::LogInfo("CTPPSBeamParametersESSource::produce") << "\n" << *bp;
108 
109  return bp;
110 }
std::unique_ptr< CTPPSBeamParameters > fillBeamParameters()
Fill CTPPSBeamParameters object with BP.
void CTPPSBeamParametersESSource::setBeamParameters ( const edm::ParameterSet iConfig)
private

Set BP to their values from config.

Definition at line 115 of file CTPPSBeamParametersESSource.cc.

References beamDivX45_, beamDivX56_, beamDivY45_, beamDivY56_, beamMom45_, beamMom56_, betaStarX45_, betaStarX56_, betaStarY45_, betaStarY56_, edm::ParameterSet::getParameter(), halfXangleX45_, halfXangleX56_, halfXangleY45_, halfXangleY56_, vtxOffsetX45_, vtxOffsetX56_, vtxOffsetY45_, vtxOffsetY56_, vtxOffsetZ45_, vtxOffsetZ56_, vtxStddevX_, vtxStddevY_, and vtxStddevZ_.

Referenced by CTPPSBeamParametersESSource().

116 {
117  beamMom45_ = iConfig.getParameter<double>( "beamMom45" );
118  beamMom56_ = iConfig.getParameter<double>( "beamMom56" );
119  betaStarX45_ = iConfig.getParameter<double>( "betaStarX45" );
120  betaStarX56_ = iConfig.getParameter<double>( "betaStarX56" );
121  betaStarY45_ = iConfig.getParameter<double>( "betaStarY45" );
122  betaStarY56_ = iConfig.getParameter<double>( "betaStarY56" );
123  beamDivX45_ = iConfig.getParameter<double>( "beamDivX45" );
124  beamDivX56_ = iConfig.getParameter<double>( "beamDivX56" );
125  beamDivY45_ = iConfig.getParameter<double>( "beamDivY45" );
126  beamDivY56_ = iConfig.getParameter<double>( "beamDivY56" );
127  halfXangleX45_ = iConfig.getParameter<double>( "halfXangleX45" );
128  halfXangleX56_ = iConfig.getParameter<double>( "halfXangleX56" );
129  halfXangleY45_ = iConfig.getParameter<double>( "halfXangleY45" );
130  halfXangleY56_ = iConfig.getParameter<double>( "halfXangleY56" );
131  vtxOffsetX45_ = iConfig.getParameter<double>( "vtxOffsetX45" );
132  vtxOffsetY45_ = iConfig.getParameter<double>( "vtxOffsetY45" );
133  vtxOffsetZ45_ = iConfig.getParameter<double>( "vtxOffsetZ45" );
134  vtxOffsetX56_ = iConfig.getParameter<double>( "vtxOffsetX56" );
135  vtxOffsetY56_ = iConfig.getParameter<double>( "vtxOffsetY56" );
136  vtxOffsetZ56_ = iConfig.getParameter<double>( "vtxOffsetZ56" );
137  vtxStddevX_ = iConfig.getParameter<double>( "vtxStddevX" );
138  vtxStddevY_ = iConfig.getParameter<double>( "vtxStddevY" );
139  vtxStddevZ_ = iConfig.getParameter<double>( "vtxStddevZ" );
140 }
T getParameter(std::string const &) const
void CTPPSBeamParametersESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

sets infinite validity of this data

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 184 of file CTPPSBeamParametersESSource.cc.

References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), edm::EventID::event(), edm::IOVSyncValue::eventID(), infinity, edm::eventsetup::EventSetupRecordKey::name(), and edm::EventID::run().

186 {
187  edm::LogInfo("CTPPSBeamParametersESSource")
188  << ">> CTPPSBeamParametersESSource::setIntervalFor(" << key.name() << ")\n"
189  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
190 
192  oValidity = infinity;
193 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
const EventID & eventID() const
Definition: IOVSyncValue.h:40
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
const double infinity

Member Data Documentation

double CTPPSBeamParametersESSource::beamDivX45_
private

Definition at line 64 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamDivX56_
private

Definition at line 64 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamDivY45_
private

Definition at line 64 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamDivY56_
private

Definition at line 64 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamMom45_
private

Definition at line 62 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamMom56_
private

Definition at line 62 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarX45_
private

Definition at line 63 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarX56_
private

Definition at line 63 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarY45_
private

Definition at line 63 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarY56_
private

Definition at line 63 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleX45_
private

Definition at line 65 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleX56_
private

Definition at line 66 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleY45_
private

Definition at line 65 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleY56_
private

Definition at line 66 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

bool CTPPSBeamParametersESSource::setBeamPars_
private

Definition at line 54 of file CTPPSBeamParametersESSource.cc.

Referenced by CTPPSBeamParametersESSource(), and produce().

double CTPPSBeamParametersESSource::vtxOffsetX45_
private

Definition at line 67 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetX56_
private

Definition at line 68 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetY45_
private

Definition at line 67 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetY56_
private

Definition at line 68 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetZ45_
private

Definition at line 67 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetZ56_
private

Definition at line 68 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxStddevX_
private

Definition at line 69 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxStddevY_
private

Definition at line 69 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxStddevZ_
private

Definition at line 69 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().