Go to the documentation of this file.00001
00010
00011 #include "SiStripGaussianSmearingRecHitConverterAlgorithm.h"
00012
00013
00014 #include "FastSimulation/Utilities/interface/RandomEngine.h"
00015
00016
00017
00018
00019
00020 SiStripGaussianSmearingRecHitConverterAlgorithm::SiStripGaussianSmearingRecHitConverterAlgorithm
00021 (const RandomEngine* engine) : random(engine) {}
00022
00023
00024 void
00025 SiStripGaussianSmearingRecHitConverterAlgorithm::smearHit(const PSimHit& simHit,
00026 double localPositionResolutionX,
00027 double localPositionResolutionY,
00028 double localPositionResolutionZ,
00029 double boundX,
00030 double boundY)
00031 {
00032
00033
00034
00035
00036
00037
00038
00039
00040 do {
00041 thePosition =
00042 Local3DPoint(random->gaussShoot((double)simHit.localPosition().x(), localPositionResolutionX),
00043 (double)simHit.localPosition().y(),
00044 0.);
00045 #ifdef FAMOS_DEBUG
00046 std::cout << " Detector bounds: "
00047 << "\t\tx = " << boundX
00048 << "\ty = " << boundY
00049 << std::endl;
00050 std::cout << " Generated local position "
00051 << "\tx = " << thePosition.x()
00052 << "\ty = " << thePosition.y()
00053 << std::endl;
00054 #endif
00055 } while(fabs(thePosition.x()) > boundX);
00056
00057
00058 thePositionX = thePosition.x();
00059 thePositionY = thePosition.y();
00060 thePositionZ = thePosition.z();
00061
00062 theErrorX = localPositionResolutionX;
00063 theErrorY = localPositionResolutionY;
00064 theErrorZ = localPositionResolutionZ;
00065
00066 theError = LocalError( theErrorX * theErrorX,
00067 0.0,
00068 theErrorY * theErrorY );
00069
00070
00071
00072 }