CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr
< BeamSpotObjects
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

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 ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const
eventsetup::ComponentDescription
descriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set
< eventsetup::EventSetupRecordKey
findingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder ()
 

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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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 27 of file BeamSpotFakeConditions.cc.

Member Typedef Documentation

Definition at line 29 of file BeamSpotFakeConditions.cc.

Constructor & Destructor Documentation

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

Definition at line 44 of file BeamSpotFakeConditions.cc.

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

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

Definition at line 111 of file BeamSpotFakeConditions.cc.

111 {}

Member Function Documentation

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

Definition at line 114 of file BeamSpotFakeConditions.cc.

References beamWidthX, beamWidthY, betastar, cov, dxdz, dydz, emittanceX, emittanceY, i, j, 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.

114  {
115 
116 
117  BeamSpotObjects *adummy = new BeamSpotObjects();
118 
119  adummy->SetPosition( x, y , z );
120  adummy->SetSigmaZ( sigmaZ);
121  adummy->Setdxdz( dxdz );
122  adummy->Setdydz( dydz );
123  adummy->SetBeamWidthX( beamWidthX );
124  adummy->SetBeamWidthY( beamWidthY );
125  for (int i=0; i<7; i++ ) {
126  for (int j=0; j<7; j++) {
127 
128  adummy->SetCovariance( i, j, cov[i][j] );
129  }
130  }
131  adummy->SetEmittanceX( emittanceX );
132  adummy->SetEmittanceY( emittanceY );
133  adummy->SetBetaStar( betastar);
134 
135  return ReturnType(adummy);
136 }
int i
Definition: DBlmapReader.cc:9
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
int j
Definition: DBlmapReader.cc:9
void Setdxdz(double val)
set dxdz slope, crossing angle
void SetBetaStar(double val)
set beta star
boost::shared_ptr< BeamSpotObjects > ReturnType
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
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 138 of file BeamSpotFakeConditions.cc.

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

140  {
143 }
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 39 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

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

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::emittanceY
private

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

bool BeamSpotFakeConditions::getDataFromFile_
private

Definition at line 36 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

edm::FileInPath BeamSpotFakeConditions::inputFilename_
private

Definition at line 35 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

double BeamSpotFakeConditions::sigmaZ
private
std::string BeamSpotFakeConditions::tag
private
int BeamSpotFakeConditions::type
private
double BeamSpotFakeConditions::x
private
double BeamSpotFakeConditions::y
private
double BeamSpotFakeConditions::z
private