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 (CLHEP::HepRandomEngine *)
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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
 
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 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, 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* 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
void GaussEvtVtxGenerator::meanY ( double  m = 0)
inline
void GaussEvtVtxGenerator::meanZ ( double  m = 0)
inline
HepMC::FourVector * GaussEvtVtxGenerator::newVertex ( CLHEP::HepRandomEngine *  engine)
virtual

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 48 of file GaussEvtVtxGenerator.cc.

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

48  {
49  double X,Y,Z,T;
50  X = CLHEP::RandGaussQ::shoot(engine, fMeanX, fSigmaX);
51  Y = CLHEP::RandGaussQ::shoot(engine, fMeanY, fSigmaY);
52  Z = CLHEP::RandGaussQ::shoot(engine, fMeanZ, fSigmaZ);
53  T = CLHEP::RandGaussQ::shoot(engine, fTimeOffset, fSigmaZ);
54 
55  //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector;
56  if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ;
57  fVertex->set( X, Y, Z, T);
58 
59  return fVertex;
60 }
const double Z[kNumberCalorimeter]
HepMC::FourVector * fVertex
#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 62 of file GaussEvtVtxGenerator.cc.

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

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

set resolution in Y in cm

Definition at line 74 of file GaussEvtVtxGenerator.cc.

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

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

set resolution in Z in cm

Definition at line 86 of file GaussEvtVtxGenerator.cc.

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

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

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

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