1 #include "marlin/MarlinConfig.h"
3 #ifdef MARLIN_CLHEP // only if CLHEP is available !
7 #include "CLHEP/Random/RandGauss.h"
8 #include "CLHEP/Random/RandEngine.h"
22 const unsigned int size = resVec.
size() / (
sizeof( ClusterResolution) /
sizeof(
float) );
23 _resVec.reserve(size);
27 for(
unsigned int i=0 ; i < size ; i++ ){
29 float A = resVec[ index++ ] ;
30 float B = resVec[ index++ ] ;
31 float thMin = resVec[ index++ ] ;
32 float thMax = resVec[ index++ ] ;
34 _resVec.
push_back( ClusterResolution( A, B , thMin, thMax ) );
43 double theta = v.theta() ;
45 if( theta > M_PI_2 ) theta =
M_PI - theta ;
49 for(
unsigned int i=0 ; i < _resVec.size() ; i++ ){
51 if( theta <= _resVec[i].ThMax && theta > _resVec[i].ThMin ) {
52 resolution.
first = _resVec[i].A ;
53 resolution.
second = _resVec[i].B ;
59 if( resolution.
first > - 1e-10 ) {
68 double deltaE = RandGauss::shoot( 0.0 , E*Eres ) ;
73 Hep3Vector n3v( v.vect() ) ;
75 n3v.setMag( E + deltaE ) ;
79 sv.setVectM( n3v , mass ) ;
89 #endif // MARLIN_CLHEP