CMS 3D CMS Logo

Pythia6Random Class Reference

#include <FastSimulation/ParticleDecay/interface/Pythia6Random.h>

List of all members.

Public Member Functions

void get (int i)
intmrpy (int i)
 Pythia6Random (int seed)
double & rrpy (int i)
void save (int i)
 ~Pythia6Random (void)

Private Member Functions

void init (void)

Private Attributes

_pythia6randommyPythia6Random [2]

Static Private Attributes

static struct _pythia6random__pythia6random = 0
static double dDummy = 0.0
static int nDummy = 0

Classes

struct  _pythia6random


Detailed Description

Definition at line 7 of file Pythia6Random.h.


Constructor & Destructor Documentation

Pythia6Random::Pythia6Random ( int  seed  ) 

Definition at line 23 of file Pythia6Random.cc.

References j, Pythia6Random::_pythia6random::mrpy, myPythia6Random, and rrpy().

00023                                      {
00024 
00025   myPythia6Random[0] = new _pythia6random;
00026   myPythia6Random[1] = new _pythia6random;
00027 
00028   // Initialize current state of the decay random generation
00029   myPythia6Random[1]->mrpy[0] = seed;
00030   myPythia6Random[1]->mrpy[1] = 0;
00031   myPythia6Random[1]->mrpy[2] = 0;
00032   myPythia6Random[1]->mrpy[3] = 0;
00033   myPythia6Random[1]->mrpy[4] = 0;
00034   myPythia6Random[1]->mrpy[5] = 0;
00035   for ( int j=0; j<100; ++j ) myPythia6Random[1]->rrpy[j] = 0.;
00036 
00037 }

Pythia6Random::~Pythia6Random ( void   ) 

Definition at line 39 of file Pythia6Random.cc.

References myPythia6Random.

00039                                   {
00040 
00041   delete myPythia6Random[0];
00042   delete myPythia6Random[1];
00043 
00044 }


Member Function Documentation

void Pythia6Random::get ( int  i  ) 

Definition at line 90 of file Pythia6Random.cc.

References j, Pythia6Random::_pythia6random::mrpy, mrpy(), myPythia6Random, rrpy(), and Pythia6Random::_pythia6random::rrpy.

Referenced by Pythia6Decays::getRandom(), and Pythia6Decays::saveRandom().

00090                         {
00091 
00092   for ( int j=1; j<7; ++j ) {
00093     mrpy(j) = myPythia6Random[i]->mrpy[j-1];
00094     //    std::cout << "Get " << i << " mrpy(" << j << ") = " << mrpy(j) << std::endl;
00095   }
00096   for ( int j=1; j<101; ++j ) { 
00097     rrpy(j) = myPythia6Random[i]->rrpy[j-1];
00098     //    std::cout << "Get " << i << " rrpy(" << j << ") = " << rrpy(j) << std::endl;
00099   }
00100 
00101 }

void Pythia6Random::init ( void   )  [private]

Definition at line 47 of file Pythia6Random.cc.

References __pythia6random, getAddr(), and PYDATR.

Referenced by mrpy(), and rrpy().

00048 {
00049   __pythia6random = 
00050     static_cast<struct Pythia6Random::_pythia6random *>(getAddr(&PYDATR.mrpy[0]));
00051 }

int & Pythia6Random::mrpy ( int  i  ) 

Definition at line 54 of file Pythia6Random.cc.

References __pythia6random, init(), m_length, Pythia6Random::_pythia6random::mrpy, and nDummy.

Referenced by get(), and save().

00055 {
00056   if (__pythia6random == 0) init();
00057   if ( i<1 || i>m_length ) {
00058     nDummy = -999;
00059     return nDummy;
00060   }
00061   return __pythia6random->mrpy[i-1];
00062 }

double & Pythia6Random::rrpy ( int  i  ) 

Definition at line 65 of file Pythia6Random.cc.

References __pythia6random, dDummy, init(), r_length, and Pythia6Random::_pythia6random::rrpy.

Referenced by get(), Pythia6Random(), and save().

00066 {
00067   if (__pythia6random == 0) init();
00068   if ( i<1 || i>r_length ) {
00069     dDummy = -999.0;
00070     return dDummy;
00071   }
00072   return __pythia6random->rrpy[i-1];
00073 }

void Pythia6Random::save ( int  i  ) 

Definition at line 76 of file Pythia6Random.cc.

References j, mrpy(), Pythia6Random::_pythia6random::mrpy, myPythia6Random, rrpy(), and Pythia6Random::_pythia6random::rrpy.

Referenced by Pythia6Decays::getRandom(), and Pythia6Decays::saveRandom().

00076                          {
00077 
00078   for ( int j=1; j<7; ++j ) {
00079     myPythia6Random[i]->mrpy[j-1] =  mrpy(j);
00080     //    std::cout << "Save " << i << " mrpy(" << j << ") = " << mrpy(j) << std::endl;
00081   }
00082   for ( int j=1; j<101; ++j ) {
00083     myPythia6Random[i]->rrpy[j-1] =  rrpy(j);
00084     //    std::cout << "Save " << i << " rrpy(" << j << ") = " << rrpy(j) << std::endl;
00085   }
00086 
00087 }


Member Data Documentation

struct Pythia6Random::_pythia6random * Pythia6Random::__pythia6random = 0 [static, read, private]

Definition at line 32 of file Pythia6Random.h.

Referenced by init(), mrpy(), and rrpy().

double Pythia6Random::dDummy = 0.0 [static, private]

Definition at line 24 of file Pythia6Random.h.

Referenced by rrpy().

_pythia6random* Pythia6Random::myPythia6Random[2] [private]

Definition at line 36 of file Pythia6Random.h.

Referenced by get(), Pythia6Random(), save(), and ~Pythia6Random().

int Pythia6Random::nDummy = 0 [static, private]

Definition at line 23 of file Pythia6Random.h.

Referenced by mrpy().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:30 2009 for CMSSW by  doxygen 1.5.4