CMS 3D CMS Logo

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

List of all members.

Public Types

typedef boost::shared_ptr
< BeamSpotObjects
ReturnType

Public Member Functions

 BeamSpotFakeConditions (const edm::ParameterSet &params)
ReturnType produce (const BeamSpotObjectsRcd &record)
virtual ~BeamSpotFakeConditions ()

Private Member Functions

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

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

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.

{       
                setWhatProduced(this);
                findingRecord<BeamSpotObjectsRcd>();
                getDataFromFile_ = params.getParameter<bool>("getDataFromFile");
                if (getDataFromFile_) {
                  inputFilename_   = params.getParameter<edm::FileInPath>("InputFilename");
                  std::ifstream fasciiFile(inputFilename_.fullPath().c_str() );
                  fasciiFile >> tag >> type;
                  fasciiFile >> tag >> x;
                  fasciiFile >> tag >> y;
                  fasciiFile >> tag >> z;
                  fasciiFile >> tag >> sigmaZ;
                  fasciiFile >> tag >> dxdz;
                  fasciiFile >> tag >> dydz;
                  fasciiFile >> tag >> beamWidthX;
                  fasciiFile >> tag >> beamWidthY;
                  fasciiFile >> tag >> cov[0][0] >> cov[0][1] >> cov[0][2]>> cov[0][3] >> cov[0][4]>> cov[0][5] >> cov[0][6]
                    ;
                  fasciiFile >> tag >> cov[1][0] >> cov[1][1] >> cov[1][2] >> cov[1][3]>> cov[1][4] >> cov[1][5]>> cov[1][6]
                    ;
                  fasciiFile >> tag >> cov[2][0]  >> cov[2][1] >> cov[2][2] >> cov[2][3]>> cov[2][4] >> cov[2][5]>> cov[2][6
                                                                                                                           ];
                  fasciiFile >> tag >> cov[3][0]  >> cov[3][1] >> cov[3][2] >> cov[3][3]>> cov[3][4] >> cov[3][5]>> cov[3][6
                                                                                                                           ];
                  fasciiFile >> tag >> cov[4][0] >> cov[4][1] >> cov[4][2] >> cov[4][3]>> cov[4][4] >> cov[4][5]>> cov[4][6]
                    ;
                  fasciiFile >> tag >> cov[5][0] >> cov[5][1] >> cov[5][2] >> cov[5][3]>> cov[5][4] >> cov[5][5]>> cov[5][6]
                    ;
                  fasciiFile >> tag >> cov[6][0] >> cov[6][1] >> cov[6][2] >> cov[6][3]>> cov[6][4] >> cov[6][5]>> cov[6][6]
                    ;
                  fasciiFile >> tag >> emittanceX;
                  fasciiFile >> tag >> emittanceY;
                  fasciiFile >> tag >> betastar;

                }
                // input values by hand
                else {
                  x =              params.getParameter<double>(  "X0" );
                  y =              params.getParameter<double>(  "Y0" );
                  z =              params.getParameter<double>(  "Z0" );
                  dxdz =           params.getParameter<double>(  "dxdz" );
                  dydz =           params.getParameter<double>(  "dydz" );
                  sigmaZ =         params.getParameter<double>(  "sigmaZ" );
                  beamWidthX =     params.getParameter<double>(  "widthX" );
                  beamWidthY =     params.getParameter<double>(  "widthY" );
                  emittanceX =     params.getParameter<double>(  "emittanceX" );
                  emittanceY =     params.getParameter<double>(  "emittanceY" );
                  betastar =       params.getParameter<double>(  "betaStar"  );

                  // first set all elements (esp. off-diagonal elements to zero)
                  for (int i=0; i<7; i++ ) {
                    for (int j=0; j<7; j++) cov[i][j] = 0.0;
                  }

                  // we ignore correlations when values are given by hand
                  cov[0][0] =       pow( params.getParameter<double>(  "errorX0" ), 2 );
                  cov[1][1] =       pow(    params.getParameter<double>(  "errorY0" ), 2 );
                  cov[2][2] =       pow(    params.getParameter<double>(  "errorZ0" ), 2 );
                  cov[3][3] =       pow( params.getParameter<double>(  "errorSigmaZ" ), 2 );
                  cov[4][4] =       pow( params.getParameter<double>(  "errordxdz" ), 2 );
                  cov[5][5] =       pow( params.getParameter<double>(  "errordydz" ), 2 );
                  cov[6][6] =       pow( params.getParameter<double>(  "errorWidth" ), 2 );
                  
                }
}
BeamSpotFakeConditions::~BeamSpotFakeConditions ( ) [virtual]

Definition at line 111 of file BeamSpotFakeConditions.cc.

{}

Member Function Documentation

BeamSpotFakeConditions::ReturnType BeamSpotFakeConditions::produce ( const BeamSpotObjectsRcd record)
void BeamSpotFakeConditions::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue syncValue,
edm::ValidityInterval oValidity 
) [private, virtual]

Member Data Documentation

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::cov[7][7] [private]

Definition at line 39 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::dxdz [private]

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::dydz [private]

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

Definition at line 36 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

Definition at line 35 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

std::string BeamSpotFakeConditions::tag [private]

Definition at line 38 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

Definition at line 40 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions().

double BeamSpotFakeConditions::x [private]

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::y [private]

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().

double BeamSpotFakeConditions::z [private]

Definition at line 37 of file BeamSpotFakeConditions.cc.

Referenced by BeamSpotFakeConditions(), and produce().