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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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().

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

Definition at line 37 of file GaussEvtVtxGenerator.cc.

37 {}
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 25 of file GaussEvtVtxGenerator.h.

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

25 { return nullptr; }
void GaussEvtVtxGenerator::meanX ( double  m = 0)
inline
void GaussEvtVtxGenerator::meanY ( double  m = 0)
inline
void GaussEvtVtxGenerator::meanZ ( double  m = 0)
inline
HepMC::FourVector GaussEvtVtxGenerator::newVertex ( CLHEP::HepRandomEngine *  engine) const
overridevirtual

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 39 of file GaussEvtVtxGenerator.cc.

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

39  {
40  double X, Y, Z, T;
41  X = CLHEP::RandGaussQ::shoot(engine, fMeanX, fSigmaX);
42  Y = CLHEP::RandGaussQ::shoot(engine, fMeanY, fSigmaY);
43  Z = CLHEP::RandGaussQ::shoot(engine, fMeanZ, fSigmaZ);
44  T = CLHEP::RandGaussQ::shoot(engine, fTimeOffset, fSigmaZ);
45 
46  return HepMC::FourVector(X, Y, Z, T);
47 }
#define X(str)
Definition: MuonsGrabber.cc:38
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 49 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaX, and alignCSCRings::s.

49  {
50  if (s >= 0) {
51  fSigmaX = s;
52  } else {
53  throw cms::Exception("LogicError") << "Error in GaussEvtVtxGenerator::sigmaX: "
54  << "Illegal resolution in X (negative)";
55  }
56 }
void GaussEvtVtxGenerator::sigmaY ( double  s = 1.0)

set resolution in Y in cm

Definition at line 58 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaY, and alignCSCRings::s.

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

set resolution in Z in cm

Definition at line 67 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaZ, and alignCSCRings::s.

67  {
68  if (s >= 0) {
69  fSigmaZ = s;
70  } else {
71  throw cms::Exception("LogicError") << "Error in GaussEvtVtxGenerator::sigmaZ: "
72  << "Illegal resolution in Z (negative)";
73  }
74 }

Member Data Documentation

double GaussEvtVtxGenerator::fMeanX
private

Definition at line 49 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fMeanY
private

Definition at line 49 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fMeanZ
private

Definition at line 49 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fSigmaX
private

Definition at line 48 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fSigmaY
private

Definition at line 48 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fSigmaZ
private

Definition at line 48 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fTimeOffset
private

Definition at line 50 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().