CMS 3D CMS Logo

reco::BeamSpot Class Reference

Reconstructed beam spot object which provides position, error, and width of the beam position. More...

#include <DataFormats/BeamSpot/interface/BeamSpot.h>

List of all members.

Public Types

enum  { dimension = 7 }
enum  { dim3 = 3 }
enum  { resdim = 2 }
typedef math::Error< dim3 >::type Covariance3DMatrix
typedef math::Error< dimension >
::type 
CovarianceMatrix
typedef math::XYZPoint Point
 point in the space
typedef math::Error< resdim >::type ResCovMatrix

Public Member Functions

 BeamSpot (const Point &point, double sigmaZ, double dxdz, double dydz, double BeamWidth, const CovarianceMatrix &error)
 constructor from values
 BeamSpot ()
 default constructor
double BeamWidth () const
 beam width
double BeamWidthError () const
 error on beam width
CovarianceMatrix covariance () const
 return full covariance matrix of dim 7
double covariance (int i, int j) const
 (i,j)-th element of error matrix
Covariance3DMatrix covariance3D () const
 return only 3D position covariance matrix
void dummy ()
 dummy beam spot
double dxdz () const
 dxdz slope
double dxdzError () const
 error on dxdz
double dydz () const
 dydz slope
double dydzError () const
 error on dydz
const Pointposition () const
 position
void print (std::stringstream &ss) const
 print information
Covariance3DMatrix rotatedCovariance3D () const
double sigmaZ () const
 sigma z
double sigmaZ0Error () const
 error on sigma z
double x0 () const
 x coordinate
double x0Error () const
 error on x
double y0 () const
 y coordinate
double y0Error () const
 error on y
double z0 () const
 z coordinate
double z0Error () const
 error on z

Private Attributes

Double32_t BeamWidth_
Double32_t dxdz_
Double32_t dydz_
CovarianceMatrix error_
 errors
Point position_
 position
Double32_t sigmaZ_


Detailed Description

Reconstructed beam spot object which provides position, error, and width of the beam position.

Author:
Francisco Yumiceva, Fermilab (yumiceva@fnal.gov)
Version:
Id
BeamSpot.h,v 1.4 2007/08/21 20:45:27 ratnik Exp

Definition at line 23 of file BeamSpot.h.


Member Typedef Documentation

typedef math::Error<dim3>::type reco::BeamSpot::Covariance3DMatrix

Definition at line 30 of file BeamSpot.h.

typedef math::Error<dimension>::type reco::BeamSpot::CovarianceMatrix

Definition at line 28 of file BeamSpot.h.

typedef math::XYZPoint reco::BeamSpot::Point

point in the space

Definition at line 26 of file BeamSpot.h.

typedef math::Error<resdim>::type reco::BeamSpot::ResCovMatrix

Definition at line 32 of file BeamSpot.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
dimension 

Definition at line 27 of file BeamSpot.h.

00027 { dimension = 7 };

anonymous enum

Enumerator:
dim3 

Definition at line 29 of file BeamSpot.h.

00029 { dim3 = 3 };

anonymous enum

Enumerator:
resdim 

Definition at line 31 of file BeamSpot.h.

00031 { resdim = 2 };


Constructor & Destructor Documentation

reco::BeamSpot::BeamSpot (  ) 

default constructor

Definition at line 25 of file BeamSpot.cc.

References BeamWidth_, dxdz_, dydz_, position_, and sigmaZ_.

00025                      {
00026     // initialize
00027     position_ = Point(0.,0.,0.);
00028     sigmaZ_ = 0.;
00029     dxdz_ = 0.;
00030     dydz_ = 0.;
00031     BeamWidth_ = 0.;
00032 
00033   }

reco::BeamSpot::BeamSpot ( const Point point,
double  sigmaZ,
double  dxdz,
double  dydz,
double  BeamWidth,
const CovarianceMatrix error 
) [inline]

constructor from values

Definition at line 38 of file BeamSpot.h.

References BeamWidth_, dxdz_, dydz_, error_, position_, and sigmaZ_.

00043                                              { 
00044       position_ = point;
00045       sigmaZ_ = sigmaZ;
00046       dxdz_ = dxdz;
00047       dydz_ = dydz;
00048       BeamWidth_ = BeamWidth;
00049       error_ = error;
00050     };


Member Function Documentation

double reco::BeamSpot::BeamWidth (  )  const [inline]

beam width

Definition at line 69 of file BeamSpot.h.

References BeamWidth_.

Referenced by PrimaryVertexMonitor::analyze(), BeamSpotAnalyzer::endJob(), BSFitter::Fit(), print(), and rotatedCovariance3D().

00069 { return BeamWidth_; }

double reco::BeamSpot::BeamWidthError (  )  const [inline]

error on beam width

Definition at line 84 of file BeamSpot.h.

References error_, and funct::sqrt().

Referenced by print().

00084 { return sqrt ( error_(6,6) );}

CovarianceMatrix reco::BeamSpot::covariance ( void   )  const [inline]

return full covariance matrix of dim 7

Definition at line 90 of file BeamSpot.h.

References error_.

00090 { return error_; }

double reco::BeamSpot::covariance ( int  i,
int  j 
) const [inline]

(i,j)-th element of error matrix

Definition at line 86 of file BeamSpot.h.

References error_.

Referenced by BeamSpotAnalyzer::endJob(), and BSFitter::Fit().

00086                                            {
00087       return error_(i,j);
00088     }

Covariance3DMatrix reco::BeamSpot::covariance3D (  )  const [inline]

return only 3D position covariance matrix

Definition at line 92 of file BeamSpot.h.

References error_, j, k, and matrix.

Referenced by rotatedCovariance3D(), and TrajectoryStateClosestToBeamLine::transverseImpactParameter().

00092                                             {
00093 
00094       Covariance3DMatrix matrix;
00095       for (int j=0; j<3; j++) {
00096         for (int k=j; k<3; k++) {
00097           matrix(j,k) = error_(j,k);
00098         }
00099       }
00100       return matrix;
00101     };

void reco::BeamSpot::dummy (  ) 

dummy beam spot

Definition at line 35 of file BeamSpot.cc.

References BeamWidth_, dxdz_, dydz_, position_, and sigmaZ_.

Referenced by PrimaryVertexProducer::produce(), KalmanAlignmentTrackRefitter::refitSingleTracklet(), and PrimaryVertexProducerAlgorithm::vertices().

00035                        {
00036     // dummy beam spot
00037     position_ = Point(0.,0.,0.);
00038     sigmaZ_ = 7.55; //cm
00039     dxdz_ = 0.;
00040     dydz_ = 0.;
00041     BeamWidth_ = 0.0015; //cm
00042 //     error_(0,0) = BeamWidth_*BeamWidth_;
00043 //     error_(1,1) = error_(0,0);
00044 //     error_(2,2) = sigmaZ_*sigmaZ_;
00045 
00046   }

double reco::BeamSpot::dxdz (  )  const [inline]

dxdz slope

Definition at line 65 of file BeamSpot.h.

References dxdz_.

Referenced by PrimaryVertexMonitor::analyze(), BeamSpotAnalyzer::endJob(), GsfTrackProducerBase::fillMode(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), BSFitter::Fit(), print(), PixelVertexProducer::produce(), SteppingHelixPropagator::propagateWithPath(), rotatedCovariance3D(), and PrimaryVertexMonitor::vertexPlots().

00065 { return dxdz_; }

double reco::BeamSpot::dxdzError (  )  const [inline]

error on dxdz

Definition at line 79 of file BeamSpot.h.

References error_, and funct::sqrt().

Referenced by print().

00079 { return sqrt ( error_(4,4) ); }

double reco::BeamSpot::dydz (  )  const [inline]

dydz slope

Definition at line 67 of file BeamSpot.h.

References dydz_.

Referenced by PrimaryVertexMonitor::analyze(), BeamSpotAnalyzer::endJob(), GsfTrackProducerBase::fillMode(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), BSFitter::Fit(), print(), PixelVertexProducer::produce(), SteppingHelixPropagator::propagateWithPath(), rotatedCovariance3D(), and PrimaryVertexMonitor::vertexPlots().

00067 { return dydz_; }

double reco::BeamSpot::dydzError (  )  const [inline]

error on dydz

Definition at line 81 of file BeamSpot.h.

References error_, and funct::sqrt().

Referenced by print().

00081 { return sqrt ( error_(5,5) ); }

const Point& reco::BeamSpot::position (  )  const [inline]

position

Definition at line 55 of file BeamSpot.h.

References position_.

Referenced by MultiTrackValidator::analyze(), HLTMuonDQMSource::analyze(), HLTMuonRecoDQMSource::analyze(), TrackAssociatorByChi2::associateRecoToSim(), TrackAssociatorByChi2::associateSimToReco(), BeamSpotAnalyzer::endJob(), GsfTrackProducerBase::fillMode(), HLTMuonL1toL3TkPreFilter::filter(), HLTMuonL3PreFilter::filter(), HLTMuonDimuonL3Filter::filter(), HLTMuonDimuonL2Filter::filter(), HLTMuonL2PreFilter::filter(), RecoTrackSelector::operator()(), PrimaryVertexProducer::produce(), TrackAlgoCompareUtil::produce(), reco::modules::AnalyticalTrackSelector::select(), and reco::modules::TrackMultiSelector::testVtx().

00055 { return position_; }

void reco::BeamSpot::print ( std::stringstream &  ss  )  const

print information

Definition at line 48 of file BeamSpot.cc.

References BeamWidth(), BeamWidthError(), dxdz(), dxdzError(), dydz(), dydzError(), sigmaZ(), sigmaZ0Error(), x0(), x0Error(), y0(), y0Error(), z0(), and z0Error().

Referenced by reco::operator<<().

00048                                                 {
00049 
00050     ss << "-----------------------------------------------------\n"
00051        << "            Calculated Beam Spot\n\n"
00052        << "   X0 = " << x0() << " +/- " << x0Error() << " [cm]\n"
00053        << "   Y0 = " << y0() << " +/- " << y0Error() << " [cm]\n"
00054        << "   Z0 = " << z0() << " +/- " << z0Error() << " [cm]\n"
00055        << " Sigma Z0 = " << sigmaZ() << " +/- " << sigmaZ0Error() << " [cm]\n"
00056        << " dxdz = " << dxdz() << " +/- " << dxdzError() << " [radians]\n"
00057        << " dydz = " << dydz() << " +/- " << dydzError() << " [radians]\n"
00058        << " Beam Width = " << BeamWidth() << " +/- " << BeamWidthError() << " [cm]\n"
00059        << "-----------------------------------------------------\n\n";
00060 
00061   }

BeamSpot::Covariance3DMatrix reco::BeamSpot::rotatedCovariance3D (  )  const

Definition at line 71 of file BeamSpot.cc.

References a, aa, asHepVector(), BeamWidth(), covariance3D(), dxdz(), dydz(), matrix, funct::pow(), sigmaZ(), TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

Referenced by PrimaryVertexProducer::produce().

00072   {
00073       AlgebraicVector3 newZ(dxdz(), dydz(), 1.);
00074       AlgebraicVector3 globalZ(0.,0.,1.);
00075       AlgebraicVector3 rotationAxis = ROOT::Math::Cross(globalZ.Unit(), newZ.Unit());
00076       float rotationAngle = -acos( ROOT::Math::Dot(globalZ.Unit(),newZ.Unit()));
00077       AlgebraicVector a = asHepVector(rotationAxis);
00078       Basic3DVector<float> aa(a[0], a[1], a[2]);
00079       TkRotation<float> rotation(aa ,rotationAngle);
00080       AlgebraicMatrix33 rotationMatrix;
00081       rotationMatrix(0,0) = rotation.xx();
00082       rotationMatrix(0,1) = rotation.xy();
00083       rotationMatrix(0,2) = rotation.xz();
00084       rotationMatrix(1,0) = rotation.yx();
00085       rotationMatrix(1,1) = rotation.yy();
00086       rotationMatrix(1,2) = rotation.yz();
00087       rotationMatrix(2,0) = rotation.zx();
00088       rotationMatrix(2,1) = rotation.zy();
00089       rotationMatrix(2,2) = rotation.zz();
00090 
00091       AlgebraicSymMatrix33 diagError ;
00092       diagError(0,0) = pow(BeamWidth(),2);
00093       diagError(1,1) = pow(BeamWidth(),2);
00094       diagError(2,2) = pow(sigmaZ(),2);
00095 
00096       Covariance3DMatrix matrix;
00097       matrix = ROOT::Math::Similarity(rotationMatrix, diagError) + covariance3D();
00098       return matrix;
00099   }

double reco::BeamSpot::sigmaZ (  )  const [inline]

sigma z

Definition at line 63 of file BeamSpot.h.

References sigmaZ_.

Referenced by PrimaryVertexMonitor::analyze(), BeamSpotAnalyzer::endJob(), BSFitter::Fit(), print(), GlobalTrackingRegionWithVerticesProducer::regions(), GlobalTrackingRegionProducerFromBeamSpot::regions(), rotatedCovariance3D(), reco::modules::AnalyticalTrackSelector::select(), and reco::modules::TrackMultiSelector::testVtx().

00063 { return sigmaZ_; }

double reco::BeamSpot::sigmaZ0Error (  )  const [inline]

error on sigma z

Definition at line 77 of file BeamSpot.h.

References error_, and funct::sqrt().

Referenced by print().

00077 { return sqrt ( error_(3,3) ); }

double reco::BeamSpot::x0 (  )  const [inline]

x coordinate

Definition at line 57 of file BeamSpot.h.

References position_.

Referenced by PrimaryVertexMonitor::analyze(), MultiTrackValidator::analyze(), TrackerSeedValidator::analyze(), TrackProducerAlgorithm< reco::Track >::buildTrack(), TrackProducerAlgorithm< reco::GsfTrack >::buildTrack(), TrackerSeedCleaner::clean(), BeamSpotAnalyzer::endJob(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), ElectronSiStripSeedGenerator::findSeedsFromCluster(), BSFitter::Fit(), print(), ConeIsolation::produce(), PixelVertexProducer::produce(), SteppingHelixPropagator::propagateWithPath(), MuonTrackingRegionBuilder::region(), GlobalTrackingRegionWithVerticesProducer::regions(), GlobalTrackingRegionProducerFromBeamSpot::regions(), MuonUpdatorAtVertex::update(), and PrimaryVertexMonitor::vertexPlots().

00057 { return position_.X(); }

double reco::BeamSpot::x0Error (  )  const [inline]

error on x

Definition at line 71 of file BeamSpot.h.

References error_, and funct::sqrt().

Referenced by print().

00071 { return sqrt( error_(0,0) ); }

double reco::BeamSpot::y0 (  )  const [inline]

y coordinate

Definition at line 59 of file BeamSpot.h.

References position_.

Referenced by PrimaryVertexMonitor::analyze(), MultiTrackValidator::analyze(), TrackerSeedValidator::analyze(), TrackProducerAlgorithm< reco::Track >::buildTrack(), TrackProducerAlgorithm< reco::GsfTrack >::buildTrack(), TrackerSeedCleaner::clean(), BeamSpotAnalyzer::endJob(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), ElectronSiStripSeedGenerator::findSeedsFromCluster(), BSFitter::Fit(), print(), ConeIsolation::produce(), PixelVertexProducer::produce(), SteppingHelixPropagator::propagateWithPath(), MuonTrackingRegionBuilder::region(), GlobalTrackingRegionWithVerticesProducer::regions(), GlobalTrackingRegionProducerFromBeamSpot::regions(), MuonUpdatorAtVertex::update(), and PrimaryVertexMonitor::vertexPlots().

00059 { return position_.Y(); }

double reco::BeamSpot::y0Error (  )  const [inline]

error on y

Definition at line 73 of file BeamSpot.h.

References error_, and funct::sqrt().

Referenced by print().

00073 { return sqrt( error_(1,1) ); }

double reco::BeamSpot::z0 (  )  const [inline]

z coordinate

Definition at line 61 of file BeamSpot.h.

References position_.

Referenced by PrimaryVertexMonitor::analyze(), MultiTrackValidator::analyze(), TrackerSeedValidator::analyze(), TrackProducerAlgorithm< reco::Track >::buildTrack(), TrackProducerAlgorithm< reco::GsfTrack >::buildTrack(), TrackerSeedCleaner::clean(), BeamSpotAnalyzer::endJob(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), ElectronSiStripSeedGenerator::findSeedsFromCluster(), BSFitter::Fit(), print(), PixelVertexProducer::produce(), SteppingHelixPropagator::propagateWithPath(), MuonTrackingRegionBuilder::region(), GlobalTrackingRegionWithVerticesProducer::regions(), GlobalTrackingRegionProducerFromBeamSpot::regions(), MuonUpdatorAtVertex::update(), and PrimaryVertexMonitor::vertexPlots().

00061 { return position_.Z(); }

double reco::BeamSpot::z0Error (  )  const [inline]

error on z

Definition at line 75 of file BeamSpot.h.

References error_, and funct::sqrt().

Referenced by print().

00075 { return sqrt( error_(2,2) ); }


Member Data Documentation

Double32_t reco::BeamSpot::BeamWidth_ [private]

Definition at line 115 of file BeamSpot.h.

Referenced by BeamSpot(), BeamWidth(), and dummy().

Double32_t reco::BeamSpot::dxdz_ [private]

Definition at line 116 of file BeamSpot.h.

Referenced by BeamSpot(), dummy(), and dxdz().

Double32_t reco::BeamSpot::dydz_ [private]

Definition at line 117 of file BeamSpot.h.

Referenced by BeamSpot(), dummy(), and dydz().

CovarianceMatrix reco::BeamSpot::error_ [private]

errors

Definition at line 112 of file BeamSpot.h.

Referenced by BeamSpot(), BeamWidthError(), covariance(), covariance3D(), dxdzError(), dydzError(), sigmaZ0Error(), x0Error(), y0Error(), and z0Error().

Point reco::BeamSpot::position_ [private]

position

Definition at line 110 of file BeamSpot.h.

Referenced by BeamSpot(), dummy(), position(), x0(), y0(), and z0().

Double32_t reco::BeamSpot::sigmaZ_ [private]

Definition at line 114 of file BeamSpot.h.

Referenced by BeamSpot(), dummy(), and sigmaZ().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:50:59 2009 for CMSSW by  doxygen 1.5.4