CMS 3D CMS Logo

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

Public Types

typedef std::shared_ptr< BeamSpotObjectsReturnType
 
- 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
 

Public Member Functions

 BeamSpotFakeConditions (const edm::ParameterSet &params)
 
ReturnType produce (const BeamSpotObjectsRcd &record)
 
virtual ~BeamSpotFakeConditions ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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)
 

Private Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &key, const edm::IOVSyncValue &syncValue, edm::ValidityInterval &oValidity) override
 

Private Attributes

double beamWidthX
 
double beamWidthY
 
double betastar
 
double cov [7][7]
 
double dxdz
 
double dydz
 
double emittanceX
 
double emittanceY
 
bool getDataFromFile_
 
edm::FileInPath inputFilename_
 
double sigmaZ
 
std::string tag
 
int type
 
double x
 
double y
 
double z
 

Additional Inherited Members

- 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::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())
 
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 &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Detailed Description

Definition at line 25 of file BeamSpotFakeConditions.cc.

Member Typedef Documentation

Definition at line 27 of file BeamSpotFakeConditions.cc.

Constructor & Destructor Documentation

BeamSpotFakeConditions::BeamSpotFakeConditions ( const edm::ParameterSet params)

Definition at line 42 of file BeamSpotFakeConditions.cc.

References beamWidthX, beamWidthY, betastar, cov, dxdz, dydz, emittanceX, emittanceY, edm::FileInPath::fullPath(), getDataFromFile_, edm::ParameterSet::getParameter(), mps_fire::i, inputFilename_, funct::pow(), edm::ESProducer::setWhatProduced(), sigmaZ, tag, type, x, y, and z.

43 {
44  setWhatProduced(this);
45  findingRecord<BeamSpotObjectsRcd>();
46  getDataFromFile_ = params.getParameter<bool>("getDataFromFile");
47  if (getDataFromFile_) {
48  inputFilename_ = params.getParameter<edm::FileInPath>("InputFilename");
49  std::ifstream fasciiFile(inputFilename_.fullPath().c_str() );
50  fasciiFile >> tag >> type;
51  fasciiFile >> tag >> x;
52  fasciiFile >> tag >> y;
53  fasciiFile >> tag >> z;
54  fasciiFile >> tag >> sigmaZ;
55  fasciiFile >> tag >> dxdz;
56  fasciiFile >> tag >> dydz;
57  fasciiFile >> tag >> beamWidthX;
58  fasciiFile >> tag >> beamWidthY;
59  fasciiFile >> tag >> cov[0][0] >> cov[0][1] >> cov[0][2]>> cov[0][3] >> cov[0][4]>> cov[0][5] >> cov[0][6]
60  ;
61  fasciiFile >> tag >> cov[1][0] >> cov[1][1] >> cov[1][2] >> cov[1][3]>> cov[1][4] >> cov[1][5]>> cov[1][6]
62  ;
63  fasciiFile >> tag >> cov[2][0] >> cov[2][1] >> cov[2][2] >> cov[2][3]>> cov[2][4] >> cov[2][5]>> cov[2][6
64  ];
65  fasciiFile >> tag >> cov[3][0] >> cov[3][1] >> cov[3][2] >> cov[3][3]>> cov[3][4] >> cov[3][5]>> cov[3][6
66  ];
67  fasciiFile >> tag >> cov[4][0] >> cov[4][1] >> cov[4][2] >> cov[4][3]>> cov[4][4] >> cov[4][5]>> cov[4][6]
68  ;
69  fasciiFile >> tag >> cov[5][0] >> cov[5][1] >> cov[5][2] >> cov[5][3]>> cov[5][4] >> cov[5][5]>> cov[5][6]
70  ;
71  fasciiFile >> tag >> cov[6][0] >> cov[6][1] >> cov[6][2] >> cov[6][3]>> cov[6][4] >> cov[6][5]>> cov[6][6]
72  ;
73  fasciiFile >> tag >> emittanceX;
74  fasciiFile >> tag >> emittanceY;
75  fasciiFile >> tag >> betastar;
76 
77  }
78  // input values by hand
79  else {
80  x = params.getParameter<double>( "X0" );
81  y = params.getParameter<double>( "Y0" );
82  z = params.getParameter<double>( "Z0" );
83  dxdz = params.getParameter<double>( "dxdz" );
84  dydz = params.getParameter<double>( "dydz" );
85  sigmaZ = params.getParameter<double>( "sigmaZ" );
86  beamWidthX = params.getParameter<double>( "widthX" );
87  beamWidthY = params.getParameter<double>( "widthY" );
88  emittanceX = params.getParameter<double>( "emittanceX" );
89  emittanceY = params.getParameter<double>( "emittanceY" );
90  betastar = params.getParameter<double>( "betaStar" );
91 
92  // first set all elements (esp. off-diagonal elements to zero)
93  for (int i=0; i<7; i++ ) {
94  for (int j=0; j<7; j++) cov[i][j] = 0.0;
95  }
96 
97  // we ignore correlations when values are given by hand
98  cov[0][0] = pow( params.getParameter<double>( "errorX0" ), 2 );
99  cov[1][1] = pow( params.getParameter<double>( "errorY0" ), 2 );
100  cov[2][2] = pow( params.getParameter<double>( "errorZ0" ), 2 );
101  cov[3][3] = pow( params.getParameter<double>( "errorSigmaZ" ), 2 );
102  cov[4][4] = pow( params.getParameter<double>( "errordxdz" ), 2 );
103  cov[5][5] = pow( params.getParameter<double>( "errordydz" ), 2 );
104  cov[6][6] = pow( params.getParameter<double>( "errorWidth" ), 2 );
105 
106  }
107 }
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::string fullPath() const
Definition: FileInPath.cc:184
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
BeamSpotFakeConditions::~BeamSpotFakeConditions ( )
virtual

Definition at line 109 of file BeamSpotFakeConditions.cc.

109 {}

Member Function Documentation

BeamSpotFakeConditions::ReturnType BeamSpotFakeConditions::produce ( const BeamSpotObjectsRcd record)

Definition at line 112 of file BeamSpotFakeConditions.cc.

References beamWidthX, beamWidthY, betastar, cov, dxdz, dydz, emittanceX, emittanceY, mps_fire::i, BeamSpotObjects::SetBeamWidthX(), BeamSpotObjects::SetBeamWidthY(), BeamSpotObjects::SetBetaStar(), BeamSpotObjects::SetCovariance(), BeamSpotObjects::Setdxdz(), BeamSpotObjects::Setdydz(), BeamSpotObjects::SetEmittanceX(), BeamSpotObjects::SetEmittanceY(), BeamSpotObjects::SetPosition(), BeamSpotObjects::SetSigmaZ(), sigmaZ, x, y, and z.

112  {
113 
114 
115  BeamSpotObjects *adummy = new BeamSpotObjects();
116 
117  adummy->SetPosition( x, y , z );
118  adummy->SetSigmaZ( sigmaZ);
119  adummy->Setdxdz( dxdz );
120  adummy->Setdydz( dydz );
121  adummy->SetBeamWidthX( beamWidthX );
122  adummy->SetBeamWidthY( beamWidthY );
123  for (int i=0; i<7; i++ ) {
124  for (int j=0; j<7; j++) {
125 
126  adummy->SetCovariance( i, j, cov[i][j] );
127  }
128  }
129  adummy->SetEmittanceX( emittanceX );
130  adummy->SetEmittanceY( emittanceY );
131  adummy->SetBetaStar( betastar);
132 
133  return ReturnType(adummy);
134 }
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
void SetCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
void Setdydz(double val)
set dydz slope, crossing angle in XZ
void SetEmittanceX(double val)
set emittance
void Setdxdz(double val)
set dxdz slope, crossing angle
void SetBetaStar(double val)
set beta star
void SetEmittanceY(double val)
set emittance
void SetBeamWidthX(double val)
set average transverse beam width X
void SetBeamWidthY(double val)
set average transverse beam width Y
std::shared_ptr< BeamSpotObjects > ReturnType
void SetPosition(double x, double y, double z)
set XYZ position
void BeamSpotFakeConditions::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue syncValue,
edm::ValidityInterval oValidity 
)
overrideprivatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 136 of file BeamSpotFakeConditions.cc.

References edm::IOVSyncValue::beginOfTime(), DEFINE_FWK_EVENTSETUP_SOURCE, and edm::IOVSyncValue::endOfTime().

138  {
141 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
static const IOVSyncValue & beginOfTime()

Member Data Documentation

double BeamSpotFakeConditions::beamWidthX
private
double BeamSpotFakeConditions::beamWidthY
private
double BeamSpotFakeConditions::betastar
private
double BeamSpotFakeConditions::cov[7][7]
private

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::dxdz
private
double BeamSpotFakeConditions::dydz
private
double BeamSpotFakeConditions::emittanceX
private

Definition at line 35 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::emittanceY
private

Definition at line 35 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

bool BeamSpotFakeConditions::getDataFromFile_
private

Definition at line 34 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

edm::FileInPath BeamSpotFakeConditions::inputFilename_
private

Definition at line 33 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

double BeamSpotFakeConditions::sigmaZ
private
std::string BeamSpotFakeConditions::tag
private

Definition at line 36 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

int BeamSpotFakeConditions::type
private
double BeamSpotFakeConditions::x
private
double BeamSpotFakeConditions::y
private
double BeamSpotFakeConditions::z
private