CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FlatEvtVtxGenerator Class Reference

#include <FlatEvtVtxGenerator.h>

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

List of all members.

Public Member Functions

 FlatEvtVtxGenerator (const edm::ParameterSet &p)
virtual TMatrixD * GetInvLorentzBoost ()
void maxX (double m=0)
 set max in X in cm
void maxY (double m=0)
 set max in Y in cm
void maxZ (double m=0)
 set max in Z in cm
void minX (double m=0.0)
 set min in X in cm
void minY (double m=0.0)
 set min in Y in cm
void minZ (double m=0.0)
 set min in Z in cm
virtual HepMC::FourVector * newVertex ()
 return a new event vertex
virtual ~FlatEvtVtxGenerator ()

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

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 Exception, fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fRandom, fTimeOffset, BaseEvtVtxGenerator::getEngine(), and edm::ParameterSet::getParameter().

: BaseEvtVtxGenerator(p)
{ 
  
  fRandom = new CLHEP::RandFlat(getEngine()) ;
  
  fMinX = p.getParameter<double>("MinX")*cm;
  fMinY = p.getParameter<double>("MinY")*cm;
  fMinZ = p.getParameter<double>("MinZ")*cm;
  fMaxX = p.getParameter<double>("MaxX")*cm;
  fMaxY = p.getParameter<double>("MaxY")*cm;
  fMaxZ = p.getParameter<double>("MaxZ")*cm;     
  fTimeOffset = p.getParameter<double>("TimeOffset")*ns*c_light;
  
  if (fMinX > fMaxX) {
    throw cms::Exception("Configuration")
      << "Error in FlatEvtVtxGenerator: "
      << "MinX is greater than MaxX";
  }
  if (fMinY > fMaxY) {
    throw cms::Exception("Configuration")
      << "Error in FlatEvtVtxGenerator: "
      << "MinY is greater than MaxY";
  }
  if (fMinZ > fMaxZ) {
    throw cms::Exception("Configuration")
      << "Error in FlatEvtVtxGenerator: "
      << "MinZ is greater than MaxZ";
  }
}
FlatEvtVtxGenerator::~FlatEvtVtxGenerator ( ) [virtual]

Definition at line 46 of file FlatEvtVtxGenerator.cc.

References fRandom.

{
  delete fRandom; 
}
FlatEvtVtxGenerator::FlatEvtVtxGenerator ( const FlatEvtVtxGenerator p) [private]

Copy constructor


Member Function Documentation

virtual TMatrixD* FlatEvtVtxGenerator::GetInvLorentzBoost ( ) [inline, virtual]

Implements BaseEvtVtxGenerator.

Definition at line 27 of file FlatEvtVtxGenerator.h.

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

set max in X in cm

Definition at line 82 of file FlatEvtVtxGenerator.cc.

References fMaxX, and max().

{
  fMaxX = max;
}
void FlatEvtVtxGenerator::maxY ( double  m = 0)

set max in Y in cm

Definition at line 87 of file FlatEvtVtxGenerator.cc.

References fMaxY, and max().

{
  fMaxY = max;
}
void FlatEvtVtxGenerator::maxZ ( double  m = 0)

set max in Z in cm

Definition at line 92 of file FlatEvtVtxGenerator.cc.

References fMaxZ, and max().

{
  fMaxZ = max;
}
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.

{
  fMinX = min;
}
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.

{
  fMinY = min;
}
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.

{
  fMinZ = min;
}
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.

                                                {
  double aX,aY,aZ;
  aX = fRandom->fire(fMinX,fMaxX) ;
  aY = fRandom->fire(fMinY,fMaxY) ;
  aZ = fRandom->fire(fMinZ,fMaxZ) ;

  //if (fVertex == 0) fVertex = new CLHEP::Hep3Vector;
  //fVertex->set(aX,aY,aZ);
  if ( fVertex == 0 ) fVertex = new HepMC::FourVector() ;
  fVertex->set(aX,aY,aZ,fTimeOffset);

  return fVertex;
}
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().

Reimplemented from BaseEvtVtxGenerator.

Definition at line 55 of file FlatEvtVtxGenerator.h.

Referenced by FlatEvtVtxGenerator(), and newVertex().