Double_t dif_p2e_t(Double_t *t, Double_t *par) // decay-in-flight p2e pdf { double yield = 0.; double tau_pi = 26.03; double tau_mu = 2197.; double pg_start = -69.70; // opening of PiGate double pg_close = 222.50; // closing of PiGate double sigma = 1.; // gate edge resolution, ns if ( t[0] > 0 && t[0] < pg_close ) { if ( t[0]>0. ) // causality yield = exp( -t[0]/tau_mu); return par[0]*yield; } // end if else if ( t[0] < 0 && fabs(t[0] )< 3*sigma ) { yield = exp(0./tau_mu)* exp( -0.5*t[0]*t[0]/(sigma*sigma) ); return par[0]*yield; } // end else if else if ( t[0] > pg_close && fabs(t[0]- pg_close )< 3*sigma ) { yield = exp(0./tau_mu)* exp( -0.5*( t[0] -pg_close )*( t[0] - pg_close ) /(sigma*sigma) ); return par[0]*yield; } // end else if else return yield ; }