Universita' di GenovaINFN Sezione di Genova  
AIRWATCH / EUSO Genova

PmtSignal - source file

// $Id: PmtSignal.cc,v 1.8 2005/10/02 14:17:55 thea Exp $
// Description of a PMT analog signal
// M. Pallavicini - created
// 
#include <math.h>
#include <iostream>
#include <TMath.h>
#include "euso.hh"
#include "PmtSignal.hh"

using namespace TMath;

ClassImp(PmtSignal)

Int_t PmtSignal::gSigCounter = 0;

//______________________________________________________________________________
 PmtSignal::PmtSignal(Double_t t, Double_t c, Double_t s,Int_t pmt,Int_t ch) 
  : fTime(t),fCharge(c),fWidth(s),fPmt(pmt),fCh(ch) {
    // ctor
      
    fId = gSigCounter++;
    SetMadeCount( kFALSE );
    SetMadeFastOR( kFALSE );
}

//______________________________________________________________________________
 PmtSignal::~PmtSignal() {
    // dtor

}

//______________________________________________________________________________
 Double_t PmtSignal::Current(Double_t t) const {
    // compute the current at time t
    // signal shape assumed to be a gaussian 

    Double_t b = ( t - fTime);
    b /= fWidth;
    b *= b;
    b /= 2.;
    if (b>20.) return 0.;
    Double_t a = fCharge / ( sqrt( 2. * Pi() ) * fWidth );
    a *= 1.e9;                // sigma is in ns, I want Amperes
    return a*exp(-b);
}

//______________________________________________________________________________
// voltage over a resistor R (Ohm)
 Double_t PmtSignal::Voltage(Double_t t, Double_t R) const {
    return R*Current(t);
}

//______________________________________________________________________________
 void PmtSignal::Dump() const {
    // dump on stdout

    fprintf(stdout,"PmtSignal: Charge=%6.2f Time=%6.2f Sigma=%6.2f Peak=%6.2fn",
          Charge(),Time(),Sigma(),Current(Time()));
}

//______________________________________________________________________________
Bool_t operator < ( PmtSignal& s1, PmtSignal& s2 ) {
    // comparison operator
    // used by SortVector function

    return (s1.Time() < s2.Time());
}

//______________________________________________________________________________
ostream& operator << (ostream& os, PmtSignal& s) {
    // dump on stream

    os << "PmtSignal in Pmt=" << s.Pmt() << "  Channel="<< s.Ch() << endl;
    os << "Charge="<<(s.Charge()*1.0E12)<<" pC  Time="<<s.Time()<<" ns  ";
    os << "Peak Current="<< (s.Current(s.Time())*1.e9) << " nA" << endl;
    return os;
}
About Us | EUSO Official Website | Web pages created by Roberto Pesce and Alessandro Thea - Last Update Wed Nov 16 16:57:39 2005 Wed Nov 16 16:29:22 2005