CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GaussEvtVtxGenerator Class Reference

#include <GaussEvtVtxGenerator.h>

Inheritance diagram for GaussEvtVtxGenerator:
BaseEvtVtxGenerator edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 GaussEvtVtxGenerator (const edm::ParameterSet &p)
 
virtual TMatrixD * GetInvLorentzBoost ()
 
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...
 
virtual HepMC::FourVector * newVertex ()
 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...
 
virtual ~GaussEvtVtxGenerator ()
 
- Public Member Functions inherited from BaseEvtVtxGenerator
 BaseEvtVtxGenerator (const edm::ParameterSet &)
 
virtual void beginRun (edm::Run &, const edm::EventSetup &)
 
virtual HepMC::FourVector * lastVertex ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~BaseEvtVtxGenerator ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

double fMeanX
 
double fMeanY
 
double fMeanZ
 
CLHEP::RandGaussQ * fRandom
 
double fSigmaX
 
double fSigmaY
 
double fSigmaZ
 
double fTimeOffset
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from BaseEvtVtxGenerator
CLHEP::HepRandomEngine & getEngine ()
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from BaseEvtVtxGenerator
TMatrixD * boost_
 
double fTimeOffset
 
HepMC::FourVector * fVertex
 

Detailed Description

Definition at line 17 of file GaussEvtVtxGenerator.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file GaussEvtVtxGenerator.cc.

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

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

Definition at line 46 of file GaussEvtVtxGenerator.cc.

References fRandom.

47 {
48  delete fRandom;
49 }
CLHEP::RandGaussQ * fRandom
GaussEvtVtxGenerator::GaussEvtVtxGenerator ( const GaussEvtVtxGenerator p)
private

Copy constructor

Member Function Documentation

virtual TMatrixD* GaussEvtVtxGenerator::GetInvLorentzBoost ( )
inlinevirtual

Implements BaseEvtVtxGenerator.

Definition at line 27 of file GaussEvtVtxGenerator.h.

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

set mean in X in cm

Definition at line 40 of file GaussEvtVtxGenerator.h.

References fMeanX, and m.

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

set mean in Y in cm

Definition at line 42 of file GaussEvtVtxGenerator.h.

References fMeanY, and m.

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

set mean in Z in cm

Definition at line 44 of file GaussEvtVtxGenerator.h.

References fMeanZ, and m.

HepMC::FourVector * GaussEvtVtxGenerator::newVertex ( )
virtual

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 53 of file GaussEvtVtxGenerator.cc.

References fMeanX, fMeanY, fMeanZ, fRandom, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, BaseEvtVtxGenerator::fVertex, X, and Gflash::Z.

53  {
54  double X,Y,Z;
55  X = fSigmaX * fRandom->fire() + fMeanX ;
56  Y = fSigmaY * fRandom->fire() + fMeanY ;
57  Z = fSigmaZ * fRandom->fire() + fMeanZ ;
58 
59  //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector;
60  if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ;
61  fVertex->set( X, Y, Z, fTimeOffset ) ;
62 
63  return fVertex;
64 }
const double Z[kNumberCalorimeter]
HepMC::FourVector * fVertex
#define X(str)
Definition: MuonsGrabber.cc:49
CLHEP::RandGaussQ * fRandom
GaussEvtVtxGenerator& GaussEvtVtxGenerator::operator= ( const GaussEvtVtxGenerator rhs)
private

Copy assignment operator

void GaussEvtVtxGenerator::sigmaX ( double  s = 1.0)

set resolution in X in cm

Definition at line 66 of file GaussEvtVtxGenerator.cc.

References edm::hlt::Exception, fSigmaX, and alignCSCRings::s.

67 {
68  if (s>=0 ) {
69  fSigmaX=s;
70  }
71  else {
72  throw cms::Exception("LogicError")
73  << "Error in GaussEvtVtxGenerator::sigmaX: "
74  << "Illegal resolution in X (negative)";
75  }
76 }
void GaussEvtVtxGenerator::sigmaY ( double  s = 1.0)

set resolution in Y in cm

Definition at line 78 of file GaussEvtVtxGenerator.cc.

References edm::hlt::Exception, fSigmaY, and alignCSCRings::s.

79 {
80  if (s>=0 ) {
81  fSigmaY=s;
82  }
83  else {
84  throw cms::Exception("LogicError")
85  << "Error in GaussEvtVtxGenerator::sigmaY: "
86  << "Illegal resolution in Y (negative)";
87  }
88 }
void GaussEvtVtxGenerator::sigmaZ ( double  s = 1.0)

set resolution in Z in cm

Definition at line 90 of file GaussEvtVtxGenerator.cc.

References edm::hlt::Exception, fSigmaZ, and alignCSCRings::s.

91 {
92  if (s>=0 ) {
93  fSigmaZ=s;
94  }
95  else {
96  throw cms::Exception("LogicError")
97  << "Error in GaussEvtVtxGenerator::sigmaZ: "
98  << "Illegal resolution in Z (negative)";
99  }
100 }

Member Data Documentation

double GaussEvtVtxGenerator::fMeanX
private

Definition at line 53 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fMeanY
private

Definition at line 53 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fMeanZ
private

Definition at line 53 of file GaussEvtVtxGenerator.h.

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

CLHEP::RandGaussQ* GaussEvtVtxGenerator::fRandom
private

Definition at line 54 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fSigmaX
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fSigmaY
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fSigmaZ
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fTimeOffset
private

Definition at line 55 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().