CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripGaussianSmearingRecHitConverterAlgorithm.cc
Go to the documentation of this file.
1 
10 // SiStrip Gaussian Smearing
12 
13 // Famos
15 
16 // STL
17 
18 // #define FAMOS_DEBUG
19 
21 (const RandomEngine* engine) : random(engine) {}
22 
23 
24 void
26  double localPositionResolutionX,
27  double localPositionResolutionY,
28  double localPositionResolutionZ,
29  double boundX,
30  double boundY)
31 {
32 
33  // Gaussian Smearing
34  // x is smeared,
35  // y fixed at the centre of the strip,
36  // z fixed at the centre of the active area
37  // For the double-sided modules it will be a problem
38  // for the RecHit matcher (starting from these PSimHits)
39  //
40  do {
41  thePosition =
42  Local3DPoint(random->gaussShoot((double)simHit.localPosition().x(), localPositionResolutionX),
43  (double)simHit.localPosition().y(),
44  0.);
45 #ifdef FAMOS_DEBUG
46  std::cout << " Detector bounds: "
47  << "\t\tx = " << boundX
48  << "\ty = " << boundY
49  << std::endl;
50  std::cout << " Generated local position "
51  << "\tx = " << thePosition.x()
52  << "\ty = " << thePosition.y()
53  << std::endl;
54 #endif
55  } while(fabs(thePosition.x()) > boundX);
56 
57  //
61  //
62  theErrorX = localPositionResolutionX;
63  theErrorY = localPositionResolutionY;
64  theErrorZ = localPositionResolutionZ;
65 
67  0.0,
68  theErrorY * theErrorY );
69  // Local Error is 2D: (xx,xy,yy), square of sigma
70  // in first an third position as for resolution matrix
71  //
72 }
void smearHit(const PSimHit &simHit, double localPositionResolutionX, double localPositionResolutionY, double localPositionResolutionZ, double boundX, double boundY)
T y() const
Definition: PV3DBase.h:57
TRandom random
Definition: MVATrainer.cc:138
double gaussShoot(double mean=0.0, double sigma=1.0) const
Definition: RandomEngine.h:37
Local3DPoint localPosition() const
Definition: PSimHit.h:44
T z() const
Definition: PV3DBase.h:58
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
tuple cout
Definition: gather_cfg.py:41
T x() const
Definition: PV3DBase.h:56