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
FlatEvtVtxGenerator Class Reference

#include <FlatEvtVtxGenerator.h>

Inheritance diagram for FlatEvtVtxGenerator:
BaseEvtVtxGenerator edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 FlatEvtVtxGenerator (const edm::ParameterSet &p)
 
virtual TMatrixD * GetInvLorentzBoost ()
 
void maxX (double m=0)
 set max in X in cm More...
 
void maxY (double m=0)
 set max in Y in cm More...
 
void maxZ (double m=0)
 set max in Z in cm More...
 
void minX (double m=0.0)
 set min in X in cm More...
 
void minY (double m=0.0)
 set min in Y in cm More...
 
void minZ (double m=0.0)
 set min in Z in cm More...
 
virtual HepMC::FourVector * newVertex ()
 return a new event vertex More...
 
virtual ~FlatEvtVtxGenerator ()
 
- 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 ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

 FlatEvtVtxGenerator (const FlatEvtVtxGenerator &p)
 
FlatEvtVtxGeneratoroperator= (const FlatEvtVtxGenerator &rhs)
 

Private Attributes

double fMaxX
 
double fMaxY
 
double fMaxZ
 
double fMinX
 
double fMinY
 
double fMinZ
 
CLHEP::RandFlat * fRandom
 
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
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 17 of file FlatEvtVtxGenerator.h.

Constructor & Destructor Documentation

FlatEvtVtxGenerator::FlatEvtVtxGenerator ( const edm::ParameterSet p)

Definition at line 15 of file FlatEvtVtxGenerator.cc.

References edm::hlt::Exception, fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fRandom, fTimeOffset, BaseEvtVtxGenerator::getEngine(), and edm::ParameterSet::getParameter().

17 {
18 
19  fRandom = new CLHEP::RandFlat(getEngine()) ;
20 
21  fMinX = p.getParameter<double>("MinX")*cm;
22  fMinY = p.getParameter<double>("MinY")*cm;
23  fMinZ = p.getParameter<double>("MinZ")*cm;
24  fMaxX = p.getParameter<double>("MaxX")*cm;
25  fMaxY = p.getParameter<double>("MaxY")*cm;
26  fMaxZ = p.getParameter<double>("MaxZ")*cm;
27  fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light;
28 
29  if (fMinX > fMaxX) {
30  throw cms::Exception("Configuration")
31  << "Error in FlatEvtVtxGenerator: "
32  << "MinX is greater than MaxX";
33  }
34  if (fMinY > fMaxY) {
35  throw cms::Exception("Configuration")
36  << "Error in FlatEvtVtxGenerator: "
37  << "MinY is greater than MaxY";
38  }
39  if (fMinZ > fMaxZ) {
40  throw cms::Exception("Configuration")
41  << "Error in FlatEvtVtxGenerator: "
42  << "MinZ is greater than MaxZ";
43  }
44 }
T getParameter(std::string const &) const
CLHEP::HepRandomEngine & getEngine()
BaseEvtVtxGenerator(const edm::ParameterSet &)
CLHEP::RandFlat * fRandom
FlatEvtVtxGenerator::~FlatEvtVtxGenerator ( )
virtual

Definition at line 46 of file FlatEvtVtxGenerator.cc.

References fRandom.

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

Copy constructor

Member Function Documentation

virtual TMatrixD* FlatEvtVtxGenerator::GetInvLorentzBoost ( )
inlinevirtual

Implements BaseEvtVtxGenerator.

Definition at line 27 of file FlatEvtVtxGenerator.h.

27  {
28  return 0;
29  }
void FlatEvtVtxGenerator::maxX ( double  m = 0)

set max in X in cm

Definition at line 82 of file FlatEvtVtxGenerator.cc.

References fMaxX, and max().

83 {
84  fMaxX = max;
85 }
const T & max(const T &a, const T &b)
void FlatEvtVtxGenerator::maxY ( double  m = 0)

set max in Y in cm

Definition at line 87 of file FlatEvtVtxGenerator.cc.

References fMaxY, and max().

88 {
89  fMaxY = max;
90 }
const T & max(const T &a, const T &b)
void FlatEvtVtxGenerator::maxZ ( double  m = 0)

set max in Z in cm

Definition at line 92 of file FlatEvtVtxGenerator.cc.

References fMaxZ, and max().

93 {
94  fMaxZ = max;
95 }
const T & max(const T &a, const T &b)
void FlatEvtVtxGenerator::minX ( double  m = 0.0)

set min in X in cm

Definition at line 67 of file FlatEvtVtxGenerator.cc.

References fMinX, and min.

68 {
69  fMinX = min;
70 }
#define min(a, b)
Definition: mlp_lapack.h:161
void FlatEvtVtxGenerator::minY ( double  m = 0.0)

set min in Y in cm

Definition at line 72 of file FlatEvtVtxGenerator.cc.

References fMinY, and min.

73 {
74  fMinY = min;
75 }
#define min(a, b)
Definition: mlp_lapack.h:161
void FlatEvtVtxGenerator::minZ ( double  m = 0.0)

set min in Z in cm

Definition at line 77 of file FlatEvtVtxGenerator.cc.

References fMinZ, and min.

78 {
79  fMinZ = min;
80 }
#define min(a, b)
Definition: mlp_lapack.h:161
HepMC::FourVector * FlatEvtVtxGenerator::newVertex ( )
virtual

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 53 of file FlatEvtVtxGenerator.cc.

References fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fRandom, fTimeOffset, and BaseEvtVtxGenerator::fVertex.

53  {
54  double aX,aY,aZ;
55  aX = fRandom->fire(fMinX,fMaxX) ;
56  aY = fRandom->fire(fMinY,fMaxY) ;
57  aZ = fRandom->fire(fMinZ,fMaxZ) ;
58 
59  //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector;
60  //fVertex->set(aX,aY,aZ);
61  if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ;
62  fVertex->set(aX,aY,aZ,fTimeOffset);
63 
64  return fVertex;
65 }
HepMC::FourVector * fVertex
CLHEP::RandFlat * fRandom
FlatEvtVtxGenerator& FlatEvtVtxGenerator::operator= ( const FlatEvtVtxGenerator rhs)
private

Copy assignment operator

Member Data Documentation

double FlatEvtVtxGenerator::fMaxX
private

Definition at line 53 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), maxX(), and newVertex().

double FlatEvtVtxGenerator::fMaxY
private

Definition at line 53 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), maxY(), and newVertex().

double FlatEvtVtxGenerator::fMaxZ
private

Definition at line 53 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), maxZ(), and newVertex().

double FlatEvtVtxGenerator::fMinX
private

Definition at line 52 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), minX(), and newVertex().

double FlatEvtVtxGenerator::fMinY
private

Definition at line 52 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), minY(), and newVertex().

double FlatEvtVtxGenerator::fMinZ
private

Definition at line 52 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), minZ(), and newVertex().

CLHEP::RandFlat* FlatEvtVtxGenerator::fRandom
private

Definition at line 54 of file FlatEvtVtxGenerator.h.

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

double FlatEvtVtxGenerator::fTimeOffset
private

Definition at line 55 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), and newVertex().