ROOT logo

Simulate currents and convolute them with transfer functions - requires KDetSim

{
  ////////////////////////////////////////////////////////////////////////////
  // This is a demonstrator for getting the measured waveforms from         //
  // simulated waveforms taking into account the transfer function          //
  // The comparisson between measured and simulated curves are shown        //
  //////////////////////////////////////////////////////////////////////////// 
  gSystem->Load("SupportFuntions.C");


 PSTCT stct("NTypeDiode-300um_R.rtct", 11.5,2);
  stct.CorrectBaseLine();   // Baseline correction 
  stct.PrintInfo();         // Information about the read data 
  // group a set of votlages into a MeasureWF structure
  // basically this can be done for any set x,y,z,U1 and U2 parameters
  MeasureWF *wf= stct->Projection(0,3,0,0,0,0,0, stct->NU1); //get measurements

  //Simulation of the current drift;
  TF1 *neff=new TF1("neff","[0]+x[0]*0",0,1000);
  neff->SetParameter(0,0.2);
  TGraph *gr[10];
  TH1F *Is[10],*Im[10];

  TCTConv *jj=new TCTConv(2000,0.1);      //init class
  jj->Load("TestTransferFunc-1500.dat");  //load transfer functions

for(Int_t i=0;i<6;i++) 
{
  KPad *det=new KPad(50,300);     //simulated currents for different voltages
  det->Neff=neff;
  det->Voltage=50+i*20;
  det->SetUpVolume(1);
  det->SetUpElectrodes();
  det->SetEntryPoint(25,299.5,0.5);
  det->SetExitPoint(25,287.5,0.5);
  det->Temperature=300;
  det->SStep=1;
  det->diff=1;
  det->average=1;
  det->SStep=0.25;
  det->MipIR(200,3.3);
  Is[i]=RebinHistoX(det.sum,1e9);
  //  det->ShowMipIR(100,1);

 
  gr[i]=jj->Convolute(Is[i],true); 
  ShiftGraph(gr[i],0,-11.5);  // shift graphs so that the WF are aligned
  gr[i]->SetLineColor(colori[i]);
  ScaleGraph(gr[i],-0.0005);  // normalize graphs
  if(i==0) gr[i]->Draw("AL"); else  gr[i]->Draw("L"); 

  Im[i]=wf.GetHA(10+i*4);
  Im[i]->Scale(-1);
  Im[i]->SetLineColor(colori[i]);
  Im[i]->SetLineStyle(2);
  Im[i]->Draw("SAME");
 }

 

}
 Get_I_to_Im_multi.C:1
 Get_I_to_Im_multi.C:2
 Get_I_to_Im_multi.C:3
 Get_I_to_Im_multi.C:4
 Get_I_to_Im_multi.C:5
 Get_I_to_Im_multi.C:6
 Get_I_to_Im_multi.C:7
 Get_I_to_Im_multi.C:8
 Get_I_to_Im_multi.C:9
 Get_I_to_Im_multi.C:10
 Get_I_to_Im_multi.C:11
 Get_I_to_Im_multi.C:12
 Get_I_to_Im_multi.C:13
 Get_I_to_Im_multi.C:14
 Get_I_to_Im_multi.C:15
 Get_I_to_Im_multi.C:16
 Get_I_to_Im_multi.C:17
 Get_I_to_Im_multi.C:18
 Get_I_to_Im_multi.C:19
 Get_I_to_Im_multi.C:20
 Get_I_to_Im_multi.C:21
 Get_I_to_Im_multi.C:22
 Get_I_to_Im_multi.C:23
 Get_I_to_Im_multi.C:24
 Get_I_to_Im_multi.C:25
 Get_I_to_Im_multi.C:26
 Get_I_to_Im_multi.C:27
 Get_I_to_Im_multi.C:28
 Get_I_to_Im_multi.C:29
 Get_I_to_Im_multi.C:30
 Get_I_to_Im_multi.C:31
 Get_I_to_Im_multi.C:32
 Get_I_to_Im_multi.C:33
 Get_I_to_Im_multi.C:34
 Get_I_to_Im_multi.C:35
 Get_I_to_Im_multi.C:36
 Get_I_to_Im_multi.C:37
 Get_I_to_Im_multi.C:38
 Get_I_to_Im_multi.C:39
 Get_I_to_Im_multi.C:40
 Get_I_to_Im_multi.C:41
 Get_I_to_Im_multi.C:42
 Get_I_to_Im_multi.C:43
 Get_I_to_Im_multi.C:44
 Get_I_to_Im_multi.C:45
 Get_I_to_Im_multi.C:46
 Get_I_to_Im_multi.C:47
 Get_I_to_Im_multi.C:48
 Get_I_to_Im_multi.C:49
 Get_I_to_Im_multi.C:50
 Get_I_to_Im_multi.C:51
 Get_I_to_Im_multi.C:52
 Get_I_to_Im_multi.C:53
 Get_I_to_Im_multi.C:54
 Get_I_to_Im_multi.C:55
 Get_I_to_Im_multi.C:56
 Get_I_to_Im_multi.C:57
 Get_I_to_Im_multi.C:58
 Get_I_to_Im_multi.C:59
 Get_I_to_Im_multi.C:60
 Get_I_to_Im_multi.C:61