CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
GaussEvtVtxGenerator Class Reference

#include <GaussEvtVtxGenerator.h>

Inheritance diagram for GaussEvtVtxGenerator:
BaseEvtVtxGenerator edm::stream::EDProducer<>

Public Member Functions

 GaussEvtVtxGenerator (const edm::ParameterSet &p)
 
TMatrixD const * GetInvLorentzBoost () const override
 
void meanX (double m=0)
 set mean in X in cm More...
 
void meanY (double m=0)
 set mean in Y in cm More...
 
void meanZ (double m=0)
 set mean in Z in cm More...
 
HepMC::FourVector newVertex (CLHEP::HepRandomEngine *) const override
 return a new event vertex More...
 
void sigmaX (double s=1.0)
 set resolution in X in cm More...
 
void sigmaY (double s=1.0)
 set resolution in Y in cm More...
 
void sigmaZ (double s=1.0)
 set resolution in Z in cm More...
 
 ~GaussEvtVtxGenerator () override
 
- Public Member Functions inherited from BaseEvtVtxGenerator
 BaseEvtVtxGenerator (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~BaseEvtVtxGenerator () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Member Functions

 GaussEvtVtxGenerator (const GaussEvtVtxGenerator &p)=delete
 
GaussEvtVtxGeneratoroperator= (const GaussEvtVtxGenerator &rhs)=delete
 

Private Attributes

double fMeanX
 
double fMeanY
 
double fMeanZ
 
double fSigmaX
 
double fSigmaY
 
double fSigmaZ
 
double fTimeOffset
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 16 of file GaussEvtVtxGenerator.h.

Constructor & Destructor Documentation

GaussEvtVtxGenerator::GaussEvtVtxGenerator ( const edm::ParameterSet p)

Definition at line 14 of file GaussEvtVtxGenerator.cc.

References Exception, fMeanX, fMeanY, fMeanZ, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, and edm::ParameterSet::getParameter().

16 {
17  fMeanX = p.getParameter<double>("MeanX")*cm;
18  fMeanY = p.getParameter<double>("MeanY")*cm;
19  fMeanZ = p.getParameter<double>("MeanZ")*cm;
20  fSigmaX = p.getParameter<double>("SigmaX")*cm;
21  fSigmaY = p.getParameter<double>("SigmaY")*cm;
22  fSigmaZ = p.getParameter<double>("SigmaZ")*cm;
23  fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light;
24 
25  if (fSigmaX < 0) {
26  throw cms::Exception("Configuration")
27  << "Error in GaussEvtVtxGenerator: "
28  << "Illegal resolution in X (SigmaX is negative)";
29  }
30  if (fSigmaY < 0) {
31  throw cms::Exception("Configuration")
32  << "Error in GaussEvtVtxGenerator: "
33  << "Illegal resolution in Y (SigmaY is negative)";
34  }
35  if (fSigmaZ < 0) {
36  throw cms::Exception("Configuration")
37  << "Error in GaussEvtVtxGenerator: "
38  << "Illegal resolution in Z (SigmaZ is negative)";
39  }
40 }
T getParameter(std::string const &) const
BaseEvtVtxGenerator(const edm::ParameterSet &)
GaussEvtVtxGenerator::~GaussEvtVtxGenerator ( )
override

Definition at line 42 of file GaussEvtVtxGenerator.cc.

43 {
44 }
GaussEvtVtxGenerator::GaussEvtVtxGenerator ( const GaussEvtVtxGenerator p)
privatedelete

Copy constructor

Member Function Documentation

TMatrixD const* GaussEvtVtxGenerator::GetInvLorentzBoost ( ) const
inlineoverridevirtual

This method - and the comment - is a left-over from COBRA-OSCAR time : return the last generated event vertex. If no vertex has been generated yet, a NULL pointer is returned.

Implements BaseEvtVtxGenerator.

Definition at line 26 of file GaussEvtVtxGenerator.h.

References alignCSCRings::s, fftjetvertexadder_cfi::sigmaX, fftjetvertexadder_cfi::sigmaY, and fftjetvertexadder_cfi::sigmaZ.

26  {
27  return nullptr;
28  }
void GaussEvtVtxGenerator::meanX ( double  m = 0)
inline

set mean in X in cm

Definition at line 39 of file GaussEvtVtxGenerator.h.

References funct::m.

void GaussEvtVtxGenerator::meanY ( double  m = 0)
inline

set mean in Y in cm

Definition at line 41 of file GaussEvtVtxGenerator.h.

References funct::m.

void GaussEvtVtxGenerator::meanZ ( double  m = 0)
inline

set mean in Z in cm

Definition at line 43 of file GaussEvtVtxGenerator.h.

References funct::m.

HepMC::FourVector GaussEvtVtxGenerator::newVertex ( CLHEP::HepRandomEngine *  engine) const
overridevirtual

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 47 of file GaussEvtVtxGenerator.cc.

References fMeanX, fMeanY, fMeanZ, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, X, DOFs::Y, and DOFs::Z.

47  {
48  double X,Y,Z,T;
49  X = CLHEP::RandGaussQ::shoot(engine, fMeanX, fSigmaX);
50  Y = CLHEP::RandGaussQ::shoot(engine, fMeanY, fSigmaY);
51  Z = CLHEP::RandGaussQ::shoot(engine, fMeanZ, fSigmaZ);
52  T = CLHEP::RandGaussQ::shoot(engine, fTimeOffset, fSigmaZ);
53 
54  return HepMC::FourVector( X, Y, Z, T);
55 }
#define X(str)
Definition: MuonsGrabber.cc:48
long double T
GaussEvtVtxGenerator& GaussEvtVtxGenerator::operator= ( const GaussEvtVtxGenerator rhs)
privatedelete

Copy assignment operator

void GaussEvtVtxGenerator::sigmaX ( double  s = 1.0)

set resolution in X in cm

Definition at line 57 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaX, and alignCSCRings::s.

58 {
59  if (s>=0 ) {
60  fSigmaX=s;
61  }
62  else {
63  throw cms::Exception("LogicError")
64  << "Error in GaussEvtVtxGenerator::sigmaX: "
65  << "Illegal resolution in X (negative)";
66  }
67 }
void GaussEvtVtxGenerator::sigmaY ( double  s = 1.0)

set resolution in Y in cm

Definition at line 69 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaY, and alignCSCRings::s.

70 {
71  if (s>=0 ) {
72  fSigmaY=s;
73  }
74  else {
75  throw cms::Exception("LogicError")
76  << "Error in GaussEvtVtxGenerator::sigmaY: "
77  << "Illegal resolution in Y (negative)";
78  }
79 }
void GaussEvtVtxGenerator::sigmaZ ( double  s = 1.0)

set resolution in Z in cm

Definition at line 81 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaZ, and alignCSCRings::s.

82 {
83  if (s>=0 ) {
84  fSigmaZ=s;
85  }
86  else {
87  throw cms::Exception("LogicError")
88  << "Error in GaussEvtVtxGenerator::sigmaZ: "
89  << "Illegal resolution in Z (negative)";
90  }
91 }

Member Data Documentation

double GaussEvtVtxGenerator::fMeanX
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fMeanY
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fMeanZ
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fSigmaX
private

Definition at line 51 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), newVertex(), and sigmaX().

double GaussEvtVtxGenerator::fSigmaY
private

Definition at line 51 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), newVertex(), and sigmaY().

double GaussEvtVtxGenerator::fSigmaZ
private

Definition at line 51 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), newVertex(), and sigmaZ().

double GaussEvtVtxGenerator::fTimeOffset
private

Definition at line 53 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().