FlyoDoc_2011 Pisa 2011 by GmP --- 011

flyopunta/src/src_main/tempo.cpp

00001 /***************************************************************************
00002                           tempo.cpp  -  description
00003                              -------------------
00004     begin                : Sat May 26 2001
00005     copyright            : (C) 2001 by Giuseppe Pierazzini
00006     email                : peppe@unipi.it
00007   ***************************************************************************
00008   *                                                                         *
00009   *   NA48  simulation program.                                             *
00010   *                                                                         *
00011   ***************************************************************************/
00012 #include "parm.h"
00013 #include "tempo.h"
00014 #include "evento.h"
00015  using namespace GmpConst;
00016 
00017 // using namespace std;
00018 //=========================== T e  m p o============
00019 //   Genera il tempo dell'evento simulando il burst
00020 //===================================================
00021  Tempo::Tempo()
00022     {
00023                         Nburst=0;
00024      Tblgt=2.4e+9;  // Durata default del burst in nsec
00025      TotTime=Tnow=Tmed=tdif=tlast=0.0;
00026      Icalls=0;
00027     }
00028 Tempo::~Tempo(){
00029 }
00030   void Tempo::PrintTempo()
00031     { 
00032      Gout<<"\n Ev = "<<evento_.Gen.Event<<" Tnow = "<<Tnow
00033                <<" from last = "<<tdif;}
00034 //-----------------------------------
00035 
00036   double Tempo::Get_ProdTempo()
00037    {
00038      Tnow+=tdif= -Tmed*log(Pran()+EPSI);
00039  
00040      if(Tnow >Tblgt){Nburst++; Tnow-=Tblgt; }  //struttura a burst
00041      TotTime+=tdif;
00042      tlast+=tdif;
00043      Icalls++;
00044      return Tnow;
00045    }
 All Classes Namespaces Files Functions Variables