Skip to content
Snippets Groups Projects
Commit f1dd0498 authored by ShengYang.b@gmail.com's avatar ShengYang.b@gmail.com
Browse files

Add DRS4 response

parent 243fc1d8
No related branches found
No related tags found
No related merge requests found
......@@ -321,6 +321,9 @@ void PMTcuts(string fileName, int PMTmodel = 6091){
}//end PMTcuts
/* (experimental)
* Generate a waveform as the sum of single photon responses
* Pulse integral to amplitude conversion factor is a result of the following
......@@ -344,6 +347,7 @@ void generateWaveform(string fileName, bool DRAW){
TF1 *testPulse = new TF1("testPulse", PMTpulseFunction, 0.0, timeWindow, 2);
testPulse->SetParameters(1.0,triggerDelay);
float unitPulseIntegral = testPulse->Integral( 0.0, timeWindow, 1e-4 );
TF1* DRS4_response = new TF1("DRS4Response", "(x<700)*(0.27698+0.965037*x) + \(x>700 && x<780)*( -9.63227511e+6 + 5.24719827e4*x -107.112621*pow(x,2) + 9.71101289e-2*pow(x,3) - (3.29905732e-5)*pow(x,4) ) + \(x>780)*( -6.29891342e+4 + 2.31093738e+2*x -2.78617584e-1*pow(x,2) + 1.11952166e-4*pow(x,3) )", 0, 1000);
////////////////////// PMT constants //////////////////////
// Will probably make a PMT object when appropriate
......@@ -456,7 +460,7 @@ void generateWaveform(string fileName, bool DRAW){
// Evaluate the TF1s for each time bin + gaussian noise
for(int bin = 0; bin < 1024; bin ++){
waveforms[tile]->push_back(evaluateSum( pulses[tile], timeBinWidth*bin ) + rnd.Gaus(mean,sigma) );
waveforms[tile]->push_back(DRS4_response->Eval(evaluateSum( pulses[tile], timeBinWidth*bin ) + rnd.Gaus(mean,sigma) ));
}//end waveform loop
if(DRAW){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment