CMS 3D CMS Logo

List of all members | Public 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)
 
 GaussEvtVtxGenerator (const GaussEvtVtxGenerator &p)=delete
 
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...
 
GaussEvtVtxGeneratoroperator= (const GaussEvtVtxGenerator &rhs)=delete
 
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 16 of file GaussEvtVtxGenerator.h.

Constructor & Destructor Documentation

◆ GaussEvtVtxGenerator() [1/2]

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

Definition at line 14 of file GaussEvtVtxGenerator.cc.

References Exception, fMeanX, fMeanY, fMeanZ, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, and AlCaHLTBitMon_ParallelJobs::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 }
BaseEvtVtxGenerator(const edm::ParameterSet &)

◆ GaussEvtVtxGenerator() [2/2]

GaussEvtVtxGenerator::GaussEvtVtxGenerator ( const GaussEvtVtxGenerator p)
delete

Copy constructor

◆ ~GaussEvtVtxGenerator()

GaussEvtVtxGenerator::~GaussEvtVtxGenerator ( )
override

Definition at line 37 of file GaussEvtVtxGenerator.cc.

37 {}

Member Function Documentation

◆ GetInvLorentzBoost()

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 29 of file GaussEvtVtxGenerator.h.

29 { return nullptr; }

◆ meanX()

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

◆ meanY()

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

◆ meanZ()

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

◆ newVertex()

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, BeamSpotPI::Y, and BeamSpotPI::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

◆ operator=()

GaussEvtVtxGenerator& GaussEvtVtxGenerator::operator= ( const GaussEvtVtxGenerator rhs)
delete

Copy assignment operator

◆ sigmaX()

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 }

◆ sigmaY()

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 }

◆ sigmaZ()

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

◆ fMeanX

double GaussEvtVtxGenerator::fMeanX
private

Definition at line 47 of file GaussEvtVtxGenerator.h.

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

◆ fMeanY

double GaussEvtVtxGenerator::fMeanY
private

Definition at line 47 of file GaussEvtVtxGenerator.h.

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

◆ fMeanZ

double GaussEvtVtxGenerator::fMeanZ
private

Definition at line 47 of file GaussEvtVtxGenerator.h.

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

◆ fSigmaX

double GaussEvtVtxGenerator::fSigmaX
private

Definition at line 46 of file GaussEvtVtxGenerator.h.

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

◆ fSigmaY

double GaussEvtVtxGenerator::fSigmaY
private

Definition at line 46 of file GaussEvtVtxGenerator.h.

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

◆ fSigmaZ

double GaussEvtVtxGenerator::fSigmaZ
private

Definition at line 46 of file GaussEvtVtxGenerator.h.

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

◆ fTimeOffset

double GaussEvtVtxGenerator::fTimeOffset
private

Definition at line 48 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().