CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

reco::BeamSpot Class Reference

#include <BeamSpot.h>

List of all members.

Public Types

enum  { dimension = 7 }
enum  { dim3 = 3 }
enum  { resdim = 2 }
enum  BeamType { Unknown = -1, Fake = 0, LHC = 1, Tracker = 2 }
 

beam spot flags

More...
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 ()
 default constructor
 BeamSpot (const Point &point, double sigmaZ, double dxdz, double dydz, double BeamWidthX, const CovarianceMatrix &error, BeamType type=Unknown)
 constructor from values
double beamWidthFromBeta (double z, double e) const
double BeamWidthX () const
 beam width X
double BeamWidthXError () const
 error on beam width X, assume error in X = Y
double BeamWidthY () const
 beam width Y
double BeamWidthYError () const
 error on beam width Y, assume error in X = Y
double betaStar () const
double covariance (int i, int j) const
 (i,j)-th element of error matrix
CovarianceMatrix covariance () const
 return full covariance matrix of dim 7
Covariance3DMatrix covariance3D () const
 return only 3D position covariance matrix
double dxdz () const
 dxdz slope
double dxdzError () const
 error on dxdz
double dydz () const
 dydz slope
double dydzError () const
 error on dydz
double emittanceX () const
 additional information
double emittanceY () const
const Pointposition () const
 position
void print (std::stringstream &ss) const
 print information
Covariance3DMatrix rotatedCovariance3D () const
void setBeamWidthX (double v)
void setBeamWidthY (double v)
void setbetaStar (double v)
void setEmittanceX (double v)
void setEmittanceY (double v)
void setType (BeamType type)
 set beam type
double sigmaZ () const
 sigma z
double sigmaZ0Error () const
 error on sigma z
BeamType type () const
 return beam type
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 BeamWidthX_
Double32_t BeamWidthY_
Double32_t betaStar_
Double32_t dxdz_
Double32_t dydz_
Double32_t emittanceX_
Double32_t emittanceY_
CovarianceMatrix error_
 errors
Point position_
 position
Double32_t sigmaZ_
BeamType type_

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.11 2009/09/08 22:02:55 yumiceva Exp

Definition at line 23 of file BeamSpot.h.


Member Typedef Documentation

Definition at line 34 of file BeamSpot.h.

Definition at line 32 of file BeamSpot.h.

point in the space

Definition at line 30 of file BeamSpot.h.

Definition at line 36 of file BeamSpot.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
dimension 

Definition at line 31 of file BeamSpot.h.

{ dimension = 7 };
anonymous enum
Enumerator:
dim3 

Definition at line 33 of file BeamSpot.h.

{ dim3 = 3 };
anonymous enum
Enumerator:
resdim 

Definition at line 35 of file BeamSpot.h.

{ resdim = 2 };

beam spot flags

Enumerator:
Unknown 
Fake 
LHC 
Tracker 

Definition at line 27 of file BeamSpot.h.

{ Unknown=-1, Fake=0, LHC=1, Tracker=2 };

Constructor & Destructor Documentation

reco::BeamSpot::BeamSpot ( )

default constructor

Definition at line 25 of file BeamSpot.cc.

References j, gen::k, and Unknown.

                     {
          // initialize
          position_ = Point(0.,0.,0.);
          sigmaZ_ = 0.;
          dxdz_ = 0.;
          dydz_ = 0.;
          BeamWidthX_ = 0.; BeamWidthY_ = 0;
          for (int j=0; j<7; j++) {
                        for (int k=j; k<7; k++) {
                                error_(j,k) = 0.;
                        }
          }
          type_ = Unknown;
          emittanceX_ = 0;
          emittanceY_ = 0;
          betaStar_ = 0;
  }
reco::BeamSpot::BeamSpot ( const Point point,
double  sigmaZ,
double  dxdz,
double  dydz,
double  BeamWidthX,
const CovarianceMatrix error,
BeamType  type = Unknown 
) [inline]

Member Function Documentation

double reco::BeamSpot::beamWidthFromBeta ( double  z,
double  e 
) const [inline]

Definition at line 130 of file BeamSpot.h.

References betaStar_, position_, funct::pow(), and mathSSE::sqrt().

                                                             {
                return sqrt( e*betaStar_*(1 + pow((z-position_.Z())/betaStar_,2) ) );
        }
double reco::BeamSpot::BeamWidthX ( ) const [inline]
double reco::BeamSpot::BeamWidthXError ( ) const [inline]

error on beam width X, assume error in X = Y

Definition at line 94 of file BeamSpot.h.

References error_, and mathSSE::sqrt().

Referenced by BeamFitter::dumpBWTxtFile(), BeamMonitorBx::FillTables(), BeamMonitorBx::FillTrendHistos(), BeamMonitor::FitAndFill(), BeamFitter::runFitterNoTxt(), and BeamMonitorBx::weight().

{ return sqrt ( error_(6,6) );}
double reco::BeamSpot::BeamWidthY ( ) const [inline]
double reco::BeamSpot::BeamWidthYError ( ) const [inline]

error on beam width Y, assume error in X = Y

Definition at line 96 of file BeamSpot.h.

References error_, and mathSSE::sqrt().

Referenced by BeamMonitorBx::FillTables(), BeamMonitorBx::FillTrendHistos(), BeamMonitor::FitAndFill(), BeamFitter::runFitterNoTxt(), and BeamMonitorBx::weight().

{ return sqrt ( error_(6,6) );}
double reco::BeamSpot::betaStar ( ) const [inline]

Definition at line 129 of file BeamSpot.h.

References betaStar_.

Referenced by BeamFitter::dumpTxtFile().

{ return betaStar_; }
double reco::BeamSpot::covariance ( int  i,
int  j 
) const [inline]

(i,j)-th element of error matrix

Definition at line 103 of file BeamSpot.h.

References error_.

Referenced by BeamFitter::dumpTxtFile(), BSFitter::Fit(), BeamFitter::runPVandTrkFitter(), and BeamFitter::write2DB().

                                           {
      return error_(i,j);
    }
CovarianceMatrix reco::BeamSpot::covariance ( void  ) const [inline]

return full covariance matrix of dim 7

Definition at line 107 of file BeamSpot.h.

References error_.

{ return error_; }
Covariance3DMatrix reco::BeamSpot::covariance3D ( ) const [inline]

return only 3D position covariance matrix

Definition at line 109 of file BeamSpot.h.

References error_, j, and gen::k.

Referenced by GsfConstraintAtVertex::constrainAtBeamSpot(), pat::PATMuonProducer::embedHighLevel(), and TrajectoryStateClosestToBeamLine::transverseImpactParameter().

                                            {

                Covariance3DMatrix matrix;
                for (int j=0; j<3; j++) {
                        for (int k=j; k<3; k++) {
                                matrix(j,k) = error_(j,k);
                        }
                }
      return matrix;
    };
double reco::BeamSpot::dxdz ( ) const [inline]
double reco::BeamSpot::dxdzError ( ) const [inline]

error on dxdz

Definition at line 89 of file BeamSpot.h.

References error_, and mathSSE::sqrt().

Referenced by BeamMonitor::FitAndFill(), BeamFitter::runFitterNoTxt(), and BeamMonitorBx::weight().

{ return sqrt ( error_(4,4) ); }
double reco::BeamSpot::dydz ( ) const [inline]
double reco::BeamSpot::dydzError ( ) const [inline]

error on dydz

Definition at line 91 of file BeamSpot.h.

References error_, and mathSSE::sqrt().

Referenced by BeamMonitor::FitAndFill(), BeamFitter::runFitterNoTxt(), and BeamMonitorBx::weight().

{ return sqrt ( error_(5,5) ); }
double reco::BeamSpot::emittanceX ( ) const [inline]

additional information

Definition at line 127 of file BeamSpot.h.

References emittanceX_.

Referenced by BeamFitter::dumpTxtFile().

{ return emittanceX_; }
double reco::BeamSpot::emittanceY ( ) const [inline]

Definition at line 128 of file BeamSpot.h.

References emittanceY_.

Referenced by BeamFitter::dumpTxtFile().

{ return emittanceY_; }
const Point& reco::BeamSpot::position ( ) const [inline]

position

Definition at line 63 of file BeamSpot.h.

References position_.

Referenced by ElectronMcFakeValidator::analyze(), ElectronAnalyzer::analyze(), GsfElectronDataAnalyzer::analyze(), ElectronGeneralAnalyzer::analyze(), TrackAnalyzer::analyze(), GsfElectronMCFakeAnalyzer::analyze(), GenPurposeSkimmerData::analyze(), ElectronTagProbeAnalyzer::analyze(), HLTMuonDQMSource::analyze(), DQMAnalyzer::analyze(), GsfElectronFakeAnalyzer::analyze(), TrackAssociatorByChi2::associateRecoToSim(), TrackAssociatorByChi2::associateSimToReco(), GsfElectronAlgo::beginEvent(), FWBeamSpotProxyBuilder::build(), ElectronEnergyCorrector::correct(), GsfElectronAlgo::createElectron(), KalmanAlignmentTrackRefitter::debugTrackData(), pat::PATMuonProducer::embedHighLevel(), GsfTrackProducerBase::fillMode(), PrimaryVertexAnalyzer4PU::fillTrackHistos(), CSCEfficiency::filter(), WZInterestingEventSelector::filter(), HLTMuonL1toL3TkPreFilter::filter(), HLTMuonL3PreFilter::filter(), HLTMuonDimuonL3Filter::filter(), HLTMuonDimuonL2Filter::filter(), ElectronSeedProducer::filterClusters(), ConversionSeedFinder::findLayers(), OutInConversionSeedFinder::makeTrackState(), HIProtoTrackFilter::operator()(), RecoTrackSelector::operator()(), HIBestVertexProducer::produce(), TrackAlgoCompareUtil::produce(), BeamFitter::readEvent(), CutBasedElectronID::robustSelection(), reco::modules::CosmicTrackSelector::select(), reco::modules::AnalyticalTrackSelector::select(), HIProtoTrackSelector::select(), GsfElectronAlgo::setAmbiguityData(), GsfElectronAlgo::setCutBasedPreselectionFlag(), reco::modules::TrackMultiSelector::testVtx(), QcdUeDQM::trackSelection(), and BeamFitter::write2DB().

{ return position_; }
void reco::BeamSpot::print ( std::stringstream &  ss) const

print information

Definition at line 43 of file BeamSpot.cc.

Referenced by reco::operator<<().

                                                {

    ss << "-----------------------------------------------------\n"
       << "              Beam Spot Data\n\n"
           << " Beam type    = " << type() << "\n"
       << "       X0     = " << x0() << " +/- " << x0Error() << " [cm]\n"
       << "       Y0     = " << y0() << " +/- " << y0Error() << " [cm]\n"
       << "       Z0     = " << z0() << " +/- " << z0Error() << " [cm]\n"
       << " Sigma Z0     = " << sigmaZ() << " +/- " << sigmaZ0Error() << " [cm]\n"
       << " dxdz         = " << dxdz() << " +/- " << dxdzError() << " [radians]\n"
       << " dydz         = " << dydz() << " +/- " << dydzError() << " [radians]\n"
       << " Beam width X = " << BeamWidthX() << " +/- " << BeamWidthXError() << " [cm]\n"
           << " Beam width Y = " << BeamWidthY() << " +/- " << BeamWidthYError() << " [cm]\n"
           << " EmittanceX   = " << emittanceX() << " [cm]\n"
           << " EmittanceY   = " << emittanceY() << " [cm]\n"
           << " beta-star    = " << betaStar() << " [cm]\n"
       << "-----------------------------------------------------\n\n";
        
  }
BeamSpot::Covariance3DMatrix reco::BeamSpot::rotatedCovariance3D ( ) const

Definition at line 71 of file BeamSpot.cc.

References a, asHepVector(), funct::pow(), 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().

  {
      AlgebraicVector3 newZ(dxdz(), dydz(), 1.);
      AlgebraicVector3 globalZ(0.,0.,1.);
      AlgebraicVector3 rotationAxis = ROOT::Math::Cross(globalZ.Unit(), newZ.Unit());
      float rotationAngle = -acos( ROOT::Math::Dot(globalZ.Unit(),newZ.Unit()));
      AlgebraicVector a = asHepVector(rotationAxis);
      Basic3DVector<float> aa(a[0], a[1], a[2]);
      TkRotation<float> rotation(aa ,rotationAngle);
      AlgebraicMatrix33 rotationMatrix;
      rotationMatrix(0,0) = rotation.xx();
      rotationMatrix(0,1) = rotation.xy();
      rotationMatrix(0,2) = rotation.xz();
      rotationMatrix(1,0) = rotation.yx();
      rotationMatrix(1,1) = rotation.yy();
      rotationMatrix(1,2) = rotation.yz();
      rotationMatrix(2,0) = rotation.zx();
      rotationMatrix(2,1) = rotation.zy();
      rotationMatrix(2,2) = rotation.zz();

      AlgebraicSymMatrix33 diagError ;
      diagError(0,0) = pow(BeamWidthX(),2);
      diagError(1,1) = pow(BeamWidthY(),2);
      diagError(2,2) = pow(sigmaZ(),2);

      Covariance3DMatrix matrix;
      matrix = ROOT::Math::Similarity(rotationMatrix, diagError) + covariance3D();
      return matrix;
  }
void reco::BeamSpot::setBeamWidthX ( double  v) [inline]

Definition at line 99 of file BeamSpot.h.

References BeamWidthX_, and v.

Referenced by PVFitter::runBXFitter(), and PVFitter::runFitter().

{ BeamWidthX_ = v; }
void reco::BeamSpot::setBeamWidthY ( double  v) [inline]
void reco::BeamSpot::setbetaStar ( double  v) [inline]

Definition at line 136 of file BeamSpot.h.

References betaStar_, and v.

Referenced by AlcaBeamSpotFromDB::endLuminosityBlock(), and BeamSpotOnlineProducer::produce().

{ betaStar_ = v; }
void reco::BeamSpot::setEmittanceX ( double  v) [inline]

Definition at line 134 of file BeamSpot.h.

References emittanceX_, and v.

Referenced by AlcaBeamSpotFromDB::endLuminosityBlock(), and BeamSpotOnlineProducer::produce().

{ emittanceX_ = v; }
void reco::BeamSpot::setEmittanceY ( double  v) [inline]

Definition at line 135 of file BeamSpot.h.

References emittanceY_, and v.

Referenced by AlcaBeamSpotFromDB::endLuminosityBlock(), and BeamSpotOnlineProducer::produce().

{ emittanceY_ = v; }
void reco::BeamSpot::setType ( BeamType  type) [inline]
double reco::BeamSpot::sigmaZ ( ) const [inline]
double reco::BeamSpot::sigmaZ0Error ( ) const [inline]
BeamType reco::BeamSpot::type ( ) const [inline]
double reco::BeamSpot::x0 ( ) const [inline]

x coordinate

Definition at line 65 of file BeamSpot.h.

References position_.

Referenced by PrimaryVertexAnalyzer4PU::analyze(), PrimaryVertexMonitor::analyze(), TrackBuildingAnalyzer::analyze(), PrimaryVertexAnalyzer4PU::analyzeVertexCollection(), BeamSpotTransientTrackingRecHit::BeamSpotTransientTrackingRecHit(), TrackProducerAlgorithm< reco::Track >::buildTrack(), TrackProducerAlgorithm< reco::GsfTrack >::buildTrack(), PhotonIsolationCalculator::calculateTrackIso(), TrackerSeedCleaner::clean(), GsfConstraintAtVertex::constrainAtBeamSpot(), ReferenceTrajectory::construct(), BeamFitter::dumpTxtFile(), BeamMonitorBx::FillTables(), PrimaryVertexAnalyzer4PU::fillTrackHistos(), BeamMonitorBx::FillTrendHistos(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), BSFitter::Fit(), BeamMonitor::FitAndFill(), getVertexD0(), pat::PATElectronProducer::produce(), MuonSeedGenerator::produce(), pat::PATMuonProducer::produce(), SETMuonSeedProducer::produce(), HIBestVertexProducer::produce(), PixelVertexProducer::produce(), SteppingHelixPropagator::propagateWithPath(), MuonTrackingRegionBuilder::region(), GlobalTrackingRegionWithVerticesProducer::regions(), HITrackingRegionForPrimaryVtxProducer::regions(), GlobalTrackingRegionProducerFromBeamSpot::regions(), BeamFitter::runFitterNoTxt(), BeamFitter::runPVandTrkFitter(), MuonVPlusJetsIDSelectionFunctor::spring10Cuts(), QcdUeDQM::trackSelection(), MuonUpdatorAtVertex::update(), HIProtoTrackFilter::update(), PrimaryVertexMonitor::vertexPlots(), BeamMonitorBx::weight(), and FWBeamSpot::x0().

{ return position_.X(); }
double reco::BeamSpot::x0Error ( ) const [inline]
double reco::BeamSpot::y0 ( ) const [inline]

y coordinate

Definition at line 67 of file BeamSpot.h.

References position_.

Referenced by PrimaryVertexAnalyzer4PU::analyze(), PrimaryVertexMonitor::analyze(), TrackBuildingAnalyzer::analyze(), PrimaryVertexAnalyzer4PU::analyzeVertexCollection(), BeamSpotTransientTrackingRecHit::BeamSpotTransientTrackingRecHit(), TrackProducerAlgorithm< reco::Track >::buildTrack(), TrackProducerAlgorithm< reco::GsfTrack >::buildTrack(), PhotonIsolationCalculator::calculateTrackIso(), TrackerSeedCleaner::clean(), GsfConstraintAtVertex::constrainAtBeamSpot(), ReferenceTrajectory::construct(), BeamFitter::dumpTxtFile(), BeamMonitorBx::FillTables(), PrimaryVertexAnalyzer4PU::fillTrackHistos(), BeamMonitorBx::FillTrendHistos(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), BSFitter::Fit(), BeamMonitor::FitAndFill(), getVertexD0(), pat::PATElectronProducer::produce(), MuonSeedGenerator::produce(), pat::PATMuonProducer::produce(), SETMuonSeedProducer::produce(), HIBestVertexProducer::produce(), PixelVertexProducer::produce(), SteppingHelixPropagator::propagateWithPath(), MuonTrackingRegionBuilder::region(), GlobalTrackingRegionWithVerticesProducer::regions(), HITrackingRegionForPrimaryVtxProducer::regions(), GlobalTrackingRegionProducerFromBeamSpot::regions(), BeamFitter::runFitterNoTxt(), BeamFitter::runPVandTrkFitter(), MuonVPlusJetsIDSelectionFunctor::spring10Cuts(), QcdUeDQM::trackSelection(), MuonUpdatorAtVertex::update(), HIProtoTrackFilter::update(), PrimaryVertexMonitor::vertexPlots(), BeamMonitorBx::weight(), and FWBeamSpot::y0().

{ return position_.Y(); }
double reco::BeamSpot::y0Error ( ) const [inline]
double reco::BeamSpot::z0 ( ) const [inline]
double reco::BeamSpot::z0Error ( ) const [inline]

Member Data Documentation

Double32_t reco::BeamSpot::BeamWidthX_ [private]

Definition at line 148 of file BeamSpot.h.

Referenced by BeamSpot(), BeamWidthX(), and setBeamWidthX().

Double32_t reco::BeamSpot::BeamWidthY_ [private]

Definition at line 149 of file BeamSpot.h.

Referenced by BeamSpot(), BeamWidthY(), and setBeamWidthY().

Double32_t reco::BeamSpot::betaStar_ [private]

Definition at line 154 of file BeamSpot.h.

Referenced by BeamSpot(), beamWidthFromBeta(), betaStar(), and setbetaStar().

Double32_t reco::BeamSpot::dxdz_ [private]

Definition at line 150 of file BeamSpot.h.

Referenced by BeamSpot(), and dxdz().

Double32_t reco::BeamSpot::dydz_ [private]

Definition at line 151 of file BeamSpot.h.

Referenced by BeamSpot(), and dydz().

Double32_t reco::BeamSpot::emittanceX_ [private]

Definition at line 152 of file BeamSpot.h.

Referenced by BeamSpot(), emittanceX(), and setEmittanceX().

Double32_t reco::BeamSpot::emittanceY_ [private]

Definition at line 153 of file BeamSpot.h.

Referenced by BeamSpot(), emittanceY(), and setEmittanceY().

position

Definition at line 143 of file BeamSpot.h.

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

Double32_t reco::BeamSpot::sigmaZ_ [private]

Definition at line 147 of file BeamSpot.h.

Referenced by BeamSpot(), and sigmaZ().

Definition at line 156 of file BeamSpot.h.

Referenced by BeamSpot(), setType(), and type().