CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
CEF Class Reference

#include <InductionGar.h>

Public Member Functions

 CEF ()
 
 ~CEF ()
 
TH1D Convolution_Ebranch_fft (const double *Input_Curr_plot_001)
 return convolve of Input_Curr_plot_001 and T_Branch2, a function; tries to mimic Convolution_Ebranch has a option to test correctness.
 

Public Attributes

ConvolveWithConstconv
 
std::vector< double > EBranch
 

Detailed Description

Definition at line 27 of file InductionGar.h.

Constructor & Destructor Documentation

◆ CEF()

CEF::CEF ( )

Definition at line 415 of file InductionGar.cxx.

415 {
416 double xmin(0), xmax(1000);
417 const int Npx(2000);
418 EBranch.resize(Npx);// EBranch at x<0 is 0
419 double *p_EBranch=&(EBranch.front());
420 for (int i = 0; i < Npx; i++) {
421 double x=xmin+(xmax-xmin)*i/Npx;
422 EBranch[i]=E_branch2(x);
423 }// set initial EBranch values.
424 // basically, a N and a (2N-1) needs (3N-2) bins to avoid overlap.
425 conv=new ConvolveWithConst( p_EBranch,Npx,Npx);
426 //EBranch_fft.resize(Npx*3-2);
427
428 //conv.convolve
429}
Double_t x[10]
double E_branch2(double t)
std::vector< double > EBranch
ConvolveWithConst * conv
basically, convolve with fft. convolves 1-d. if size of 2 inputs are fixed, it may yield optimal spee...

◆ ~CEF()

CEF::~CEF ( )

Definition at line 430 of file InductionGar.cxx.

430 {
431 delete conv;
432}

Member Function Documentation

◆ Convolution_Ebranch_fft()

TH1D CEF::Convolution_Ebranch_fft ( const double * Input_Curr_plot_001)

return convolve of Input_Curr_plot_001 and T_Branch2, a function; tries to mimic Convolution_Ebranch has a option to test correctness.

Parameters
Input_Curr_plot_001
Returns
TH1D

Definition at line 440 of file InductionGar.cxx.

441{
442 double xmin(0), xmax(1000);
443 const int Npx(2000);
444
445 TH1D h_signal("h_signalE", "", Npx, xmin, xmax);
446 double *p_signal=h_signal.GetArray()+1;//considering underflow.
447 this->conv->convolve(p_signal,Input_Curr_plot_001,0,Npx,-0.5);
448
449#ifdef INDUCTIONGAR_DEBUG_CONVOLUTION_TBRANCH_FFT_TEST
450 const double dx_abs_threhold=1e-6;// think about the accurancy of float; warn if |x| > threhold
451 const double dx_ref_threhold=1e-6;//think about the accurancy of float; warn if |dx/x| > threhold
452 TH1F h_signal_ref=Convolution_Ebranch_noskip(Input_Curr_plot_001);
453 bool found_mismatch=false;
454 for (int i=1; i<=Npx; i++){
455 if (abs((h_signal[i]-h_signal_ref[i])/h_signal_ref[i]) > dx_ref_threhold
456 and abs(h_signal[i]-h_signal_ref[i]) > dx_abs_threhold ) {
457 if (not found_mismatch){
458 std::cout<<"CgemDigitizerSvc::InductionGar::Convolution_Ebranch_fft found results not match: ";
459 found_mismatch=true;
460 }
461 std::cout<<"ref: "<<h_signal_ref[i]<<"; this: "<<h_signal[i]<<"; at i="<<i<<";threhold abs="<<dx_abs_threhold<<"; ref="<<dx_ref_threhold<<std::endl;
462 }
463 }
464#endif
465
466 return h_signal;
467}
double abs(const EvtComplex &c)
void convolve(double *output, const double *B, const int leftIndex, const int sizeofOut, double factor=1) const
do a convolve of stored const A and B, and put results to output.

Referenced by InductionGar::setMultiElectrons().

Member Data Documentation

◆ conv

ConvolveWithConst* CEF::conv

Definition at line 30 of file InductionGar.h.

Referenced by CEF(), Convolution_Ebranch_fft(), and ~CEF().

◆ EBranch

std::vector<double> CEF::EBranch

Definition at line 31 of file InductionGar.h.

Referenced by CEF().


The documentation for this class was generated from the following files: