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

 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
 
- 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 FlatEvtVtxGenerator.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file FlatEvtVtxGenerator.cc.

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

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

Definition at line 45 of file FlatEvtVtxGenerator.cc.

References fRandom.

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

Copy constructor

Member Function Documentation

virtual TMatrixD* FlatEvtVtxGenerator::GetInvLorentzBoost ( )
inlinevirtual

Implements BaseEvtVtxGenerator.

Definition at line 26 of file FlatEvtVtxGenerator.h.

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

set max in X in cm

Definition at line 81 of file FlatEvtVtxGenerator.cc.

References fMaxX, and max().

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

set max in Y in cm

Definition at line 86 of file FlatEvtVtxGenerator.cc.

References fMaxY, and max().

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

set max in Z in cm

Definition at line 91 of file FlatEvtVtxGenerator.cc.

References fMaxZ, and max().

92 {
93  fMaxZ = max;
94 }
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 66 of file FlatEvtVtxGenerator.cc.

References fMinX, and bookConverter::min.

67 {
68  fMinX = min;
69 }
void FlatEvtVtxGenerator::minY ( double  m = 0.0)

set min in Y in cm

Definition at line 71 of file FlatEvtVtxGenerator.cc.

References fMinY, and bookConverter::min.

72 {
73  fMinY = min;
74 }
void FlatEvtVtxGenerator::minZ ( double  m = 0.0)

set min in Z in cm

Definition at line 76 of file FlatEvtVtxGenerator.cc.

References fMinZ, and bookConverter::min.

77 {
78  fMinZ = min;
79 }
HepMC::FourVector * FlatEvtVtxGenerator::newVertex ( )
virtual

return a new event vertex

Implements BaseEvtVtxGenerator.

Definition at line 52 of file FlatEvtVtxGenerator.cc.

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

52  {
53  double aX,aY,aZ;
54  aX = fRandom->fire(fMinX,fMaxX) ;
55  aY = fRandom->fire(fMinY,fMaxY) ;
56  aZ = fRandom->fire(fMinZ,fMaxZ) ;
57 
58  //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector;
59  //fVertex->set(aX,aY,aZ);
60  if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ;
61  fVertex->set(aX,aY,aZ,fTimeOffset);
62 
63  return fVertex;
64 }
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 52 of file FlatEvtVtxGenerator.h.

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

double FlatEvtVtxGenerator::fMaxY
private

Definition at line 52 of file FlatEvtVtxGenerator.h.

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

double FlatEvtVtxGenerator::fMaxZ
private

Definition at line 52 of file FlatEvtVtxGenerator.h.

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

double FlatEvtVtxGenerator::fMinX
private

Definition at line 51 of file FlatEvtVtxGenerator.h.

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

double FlatEvtVtxGenerator::fMinY
private

Definition at line 51 of file FlatEvtVtxGenerator.h.

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

double FlatEvtVtxGenerator::fMinZ
private

Definition at line 51 of file FlatEvtVtxGenerator.h.

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

CLHEP::RandFlat* FlatEvtVtxGenerator::fRandom
private

Definition at line 53 of file FlatEvtVtxGenerator.h.

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

double FlatEvtVtxGenerator::fTimeOffset
private

Definition at line 54 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), and newVertex().