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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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() [1/2]

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

Definition at line 14 of file GaussEvtVtxGenerator.cc.

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 }

References Exception, fMeanX, fMeanY, fMeanZ, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, and AlCaHLTBitMon_ParallelJobs::p.

◆ ~GaussEvtVtxGenerator()

GaussEvtVtxGenerator::~GaussEvtVtxGenerator ( )
override

Definition at line 37 of file GaussEvtVtxGenerator.cc.

37 {}

◆ GaussEvtVtxGenerator() [2/2]

GaussEvtVtxGenerator::GaussEvtVtxGenerator ( const GaussEvtVtxGenerator p)
privatedelete

Copy constructor

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

25 { return nullptr; }

◆ meanX()

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

set mean in X in cm

Definition at line 35 of file GaussEvtVtxGenerator.h.

35 { fMeanX = m; }

References fMeanX, and visualization-live-secondInstance_cfg::m.

◆ meanY()

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

set mean in Y in cm

Definition at line 37 of file GaussEvtVtxGenerator.h.

37 { fMeanY = m; }

References fMeanY, and visualization-live-secondInstance_cfg::m.

◆ meanZ()

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

set mean in Z in cm

Definition at line 39 of file GaussEvtVtxGenerator.h.

39 { fMeanZ = m; }

References fMeanZ, and visualization-live-secondInstance_cfg::m.

◆ 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.

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 }

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

◆ operator=()

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

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.

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 }

References Exception, fSigmaX, and alignCSCRings::s.

◆ sigmaY()

void GaussEvtVtxGenerator::sigmaY ( double  s = 1.0)

set resolution in Y in cm

Definition at line 58 of file GaussEvtVtxGenerator.cc.

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 }

References Exception, fSigmaY, and alignCSCRings::s.

◆ sigmaZ()

void GaussEvtVtxGenerator::sigmaZ ( double  s = 1.0)

set resolution in Z in cm

Definition at line 67 of file GaussEvtVtxGenerator.cc.

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 }

References Exception, fSigmaZ, and alignCSCRings::s.

Member Data Documentation

◆ fMeanX

double GaussEvtVtxGenerator::fMeanX
private

Definition at line 49 of file GaussEvtVtxGenerator.h.

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

◆ fMeanY

double GaussEvtVtxGenerator::fMeanY
private

Definition at line 49 of file GaussEvtVtxGenerator.h.

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

◆ fMeanZ

double GaussEvtVtxGenerator::fMeanZ
private

Definition at line 49 of file GaussEvtVtxGenerator.h.

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

◆ fSigmaX

double GaussEvtVtxGenerator::fSigmaX
private

Definition at line 48 of file GaussEvtVtxGenerator.h.

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

◆ fSigmaY

double GaussEvtVtxGenerator::fSigmaY
private

Definition at line 48 of file GaussEvtVtxGenerator.h.

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

◆ fSigmaZ

double GaussEvtVtxGenerator::fSigmaZ
private

Definition at line 48 of file GaussEvtVtxGenerator.h.

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

◆ fTimeOffset

double GaussEvtVtxGenerator::fTimeOffset
private

Definition at line 50 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

GaussEvtVtxGenerator::fMeanY
double fMeanY
Definition: GaussEvtVtxGenerator.h:49
X
#define X(str)
Definition: MuonsGrabber.cc:38
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GaussEvtVtxGenerator::fSigmaX
double fSigmaX
Definition: GaussEvtVtxGenerator.h:48
GaussEvtVtxGenerator::fMeanX
double fMeanX
Definition: GaussEvtVtxGenerator.h:49
GaussEvtVtxGenerator::fSigmaY
double fSigmaY
Definition: GaussEvtVtxGenerator.h:48
alignCSCRings.s
s
Definition: alignCSCRings.py:92
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
BaseEvtVtxGenerator::BaseEvtVtxGenerator
BaseEvtVtxGenerator(const edm::ParameterSet &)
Definition: BaseEvtVtxGenerator.cc:29
GaussEvtVtxGenerator::fSigmaZ
double fSigmaZ
Definition: GaussEvtVtxGenerator.h:48
GaussEvtVtxGenerator::fTimeOffset
double fTimeOffset
Definition: GaussEvtVtxGenerator.h:50
T
long double T
Definition: Basic3DVectorLD.h:48
Exception
Definition: hltDiff.cc:246
GaussEvtVtxGenerator::fMeanZ
double fMeanZ
Definition: GaussEvtVtxGenerator.h:49
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:31
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:32