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::EDConsumerBase 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 HepMC::FourVector * lastVertex ()
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~BaseEvtVtxGenerator ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from BaseEvtVtxGenerator
TMatrixD * boost_
 
double fTimeOffset
 
HepMC::FourVector * fVertex
 

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 edm::hlt::Exception, fMeanX, fMeanY, fMeanZ, fRandom, fSigmaX, fSigmaY, fSigmaZ, fTimeOffset, BaseEvtVtxGenerator::getEngine(), and edm::ParameterSet::getParameter().

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

Definition at line 45 of file GaussEvtVtxGenerator.cc.

References fRandom.

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

Copy constructor

Member Function Documentation

virtual TMatrixD* GaussEvtVtxGenerator::GetInvLorentzBoost ( )
inlinevirtual

Implements BaseEvtVtxGenerator.

Definition at line 26 of file GaussEvtVtxGenerator.h.

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

set mean in X in cm

Definition at line 39 of file GaussEvtVtxGenerator.h.

References fMeanX, and m.

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

set mean in Y in cm

Definition at line 41 of file GaussEvtVtxGenerator.h.

References fMeanY, and m.

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

set mean in Z in cm

Definition at line 43 of file GaussEvtVtxGenerator.h.

References fMeanZ, and m.

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

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 52 of file GaussEvtVtxGenerator.cc.

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

52  {
53  double X,Y,Z;
54  X = fSigmaX * fRandom->fire() + fMeanX ;
55  Y = fSigmaY * fRandom->fire() + fMeanY ;
56  Z = fSigmaZ * fRandom->fire() + fMeanZ ;
57 
58  //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector;
59  if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ;
60  fVertex->set( X, Y, Z, fTimeOffset ) ;
61 
62  return fVertex;
63 }
const double Z[kNumberCalorimeter]
HepMC::FourVector * fVertex
#define X(str)
Definition: MuonsGrabber.cc:48
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 65 of file GaussEvtVtxGenerator.cc.

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

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

set resolution in Y in cm

Definition at line 77 of file GaussEvtVtxGenerator.cc.

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

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

set resolution in Z in cm

Definition at line 89 of file GaussEvtVtxGenerator.cc.

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

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

Member Data Documentation

double GaussEvtVtxGenerator::fMeanX
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fMeanY
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

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

double GaussEvtVtxGenerator::fMeanZ
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

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

CLHEP::RandGaussQ* GaussEvtVtxGenerator::fRandom
private

Definition at line 53 of file GaussEvtVtxGenerator.h.

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

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

Referenced by GaussEvtVtxGenerator(), and newVertex().