1 /**************************************************************************
2 * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Per Thomas Hille for the ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 #include "AliPHOSPulseGenerator.h"
24 AliPHOSPulseGenerator::AliPHOSPulseGenerator()
26 cout << "You cannot invoke the Pulsgenerator without parameters" << endl;
30 AliPHOSPulseGenerator::~AliPHOSPulseGenerator()
36 AliPHOSPulseGenerator::AliPHOSPulseGenerator(double a, double t0, int N, double t, double fs)
38 fDataPtr = new double[N];
45 // dT=tau/fs; //Function values are calculated at intervals dT
46 // fDT=1/fs; //Function values are calculated at intervals dT
47 fDataPtr = new double[N];
52 AliPHOSPulseGenerator::AddBaseline(double baselineLevel, double *samples)
54 cout << "AddBaseline not implemented yet" << endl;
58 AliPHOSPulseGenerator::AddNoise(double *dataPtr, double *sigma)
60 cout << "AddNoise is not implemented yet" << endl;
64 AliPHOSPulseGenerator::AddNoise(double *dataPtr, double *sigma, double cutoff)
66 cout << "AddNoise is not implemeted yet" << endl;
71 AliPHOSPulseGenerator::AddPretriggerSamples(double baslineLevel, double *samples)
73 cout << "AddPretriggerSamples not implemented yet" << endl;
79 AliPHOSPulseGenerator::GetPulse()
85 AliPHOSPulseGenerator::Quantisize(double *dataPtr)
87 // cout << "Quantisize is not implemented yet" << endl;
91 AliPHOSPulseGenerator::SetAmplitude(double a)
97 AliPHOSPulseGenerator::SetDT(double fs)
103 AliPHOSPulseGenerator::SetTZero(double t0)
105 fTZero = -t0/1000; // Since time is in nanoseconds and the samplingfrequency is in MHz -> divide by 1000
110 AliPHOSPulseGenerator::MakePulse(double *dtaPtr)
113 for(int i=0; i<fNSamples; i++)
115 dtaPtr[i]=fAmplitude*exp(2)*pow((i*fDT-fTZero)/fTau, 2)*exp(-2*(i*fDT-fTZero)/fTau);