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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GaussEvtVtxGenerator (const edm::ParameterSet &p)
 
virtual 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...
 
virtual 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...
 
virtual ~GaussEvtVtxGenerator ()
 
- Public Member Functions inherited from BaseEvtVtxGenerator
 BaseEvtVtxGenerator (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~BaseEvtVtxGenerator ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 

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().

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

Definition at line 42 of file GaussEvtVtxGenerator.cc.

43 {
44 }
GaussEvtVtxGenerator::GaussEvtVtxGenerator ( const GaussEvtVtxGenerator p)
private

Copy constructor

Member Function Documentation

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

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

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 funct::m.

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

set mean in Y in cm

Definition at line 41 of file GaussEvtVtxGenerator.h.

References funct::m.

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

set mean in Z in cm

Definition at line 43 of file GaussEvtVtxGenerator.h.

References funct::m.

HepMC::FourVector GaussEvtVtxGenerator::newVertex ( CLHEP::HepRandomEngine *  engine) const
overridevirtual

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 47 of file GaussEvtVtxGenerator.cc.

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

47  {
48  double X,Y,Z,T;
49  X = CLHEP::RandGaussQ::shoot(engine, fMeanX, fSigmaX);
50  Y = CLHEP::RandGaussQ::shoot(engine, fMeanY, fSigmaY);
51  Z = CLHEP::RandGaussQ::shoot(engine, fMeanZ, fSigmaZ);
52  T = CLHEP::RandGaussQ::shoot(engine, fTimeOffset, fSigmaZ);
53 
54  return HepMC::FourVector( X, Y, Z, T);
55 }
#define X(str)
Definition: MuonsGrabber.cc:48
long double T
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 57 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaX, and alignCSCRings::s.

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

set resolution in Y in cm

Definition at line 69 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaY, and alignCSCRings::s.

70 {
71  if (s>=0 ) {
72  fSigmaY=s;
73  }
74  else {
75  throw cms::Exception("LogicError")
76  << "Error in GaussEvtVtxGenerator::sigmaY: "
77  << "Illegal resolution in Y (negative)";
78  }
79 }
void GaussEvtVtxGenerator::sigmaZ ( double  s = 1.0)

set resolution in Z in cm

Definition at line 81 of file GaussEvtVtxGenerator.cc.

References Exception, fSigmaZ, and alignCSCRings::s.

82 {
83  if (s>=0 ) {
84  fSigmaZ=s;
85  }
86  else {
87  throw cms::Exception("LogicError")
88  << "Error in GaussEvtVtxGenerator::sigmaZ: "
89  << "Illegal resolution in Z (negative)";
90  }
91 }

Member Data Documentation

double GaussEvtVtxGenerator::fMeanX
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fMeanY
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

double GaussEvtVtxGenerator::fMeanZ
private

Definition at line 52 of file GaussEvtVtxGenerator.h.

Referenced by GaussEvtVtxGenerator(), and newVertex().

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

Referenced by GaussEvtVtxGenerator(), and newVertex().