19 fPedestalSubFxn_=pedSubFxn_;
22 std::vector<double> corrCharge;
23 std::vector<double> inputCharge;
24 std::vector<double> inputPedestal;
25 const unsigned int cssize = cs.
size();
27 for(
unsigned int ip=0; ip<cssize; ++ip){
28 if( ip >= (
unsigned) 10 )
continue;
29 const int capid = capidvec[ip];
30 double charge = cs[ip];
34 inputCharge.push_back(charge);
35 inputPedestal.push_back(ped);
38 fPedestalSubFxn_.calculate(inputCharge, inputPedestal, corrCharge);
48 getLandauFrac(-tsShift3,-tsShift3+25,i3);
50 getLandauFrac(-tsShift3+25,-tsShift3+50,n3);
52 getLandauFrac(-tsShift3+50,-tsShift3+75,nn3);
55 getLandauFrac(-tsShift4,-tsShift4+25,i4);
57 getLandauFrac(-tsShift4+25,-tsShift4+50,n4);
60 getLandauFrac(-tsShift5,-tsShift5+25,i5);
62 getLandauFrac(-tsShift5+25,-tsShift5+50,n5);
64 float ch3=corrCharge[3]/i3;
65 float ch4=(i3*corrCharge[4]-n3*corrCharge[3])/(i3*i4);
66 float ch5=(n3*n4*corrCharge[3]-i4*nn3*corrCharge[3]-i3*n4*corrCharge[4]+i3*i4*corrCharge[5])/(i3*i4*i5);
71 ch5=(i4*corrCharge[5]-n4*corrCharge[4])/(i4*i5);
83 ch5=(i4*corrCharge[5]-n4*corrCharge[4])/(i4*i5);
85 if (ch5<-3 && ch4>15) {
86 double ratio = (corrCharge[4]-ch3*i3)/(corrCharge[5]+3*i5);
87 if (ratio < 5 && ratio > 0.5) {
88 double invG = -13.11+11.29*TMath::Sqrt(2*TMath::Log(5.133/ratio));
90 getLandauFrac(-invG,-invG+25,iG);
91 ch4=(corrCharge[4]-ch3*n3)/(iG);
110 HLTOutput.push_back(ch4*gainCorr);
111 HLTOutput.push_back(tsShift4);
112 HLTOutput.push_back(ch5);
116 void HcalDeterministicFit::applyXM(
const std::vector<double> & inputCharge,
const std::vector<double> & inputPedestal, std::vector<double> & HLTOutput)
const {
118 std::vector<double> corrCharge;
119 fPedestalSubFxn_.calculate(inputCharge, inputPedestal, corrCharge);
124 pulseFraction(inputCharge[3], TS35);
125 pulseFraction(inputCharge[4], TS46);
126 pulseFraction(inputCharge[5], TS57);
128 double a3[3] = {TS35[0], TS35[1], TS35[2]};
129 double b3[3] = {0., TS46[0], TS46[1]};
130 double c3[3] = {0., 0., TS57[0]};
131 double d3[3] = {corrCharge[3], corrCharge[4], corrCharge[5]};
133 double deno3 = det3(a3, b3, c3);
135 double A3 = det3(d3, b3, c3) / deno3;
136 double A4 = det3(a3, d3, c3) / deno3;
137 double A5 = det3(a3, b3, d3) / deno3;
140 HLTOutput.push_back(A3);
141 HLTOutput.push_back(A4);
142 HLTOutput.push_back(A5);
157 sum= landauFrac[int(ceil(tStart+25))];
169 TS46[0] = TS4par[0] * TMath::Gaus(tslew,TS4par[1],TS4par[2]);
170 TS46[1] = TS5par[0] + TS5par[1]*tslew + TS5par[2]*tslew*tslew;
171 TS46[2] = TS6par[0] + TS6par[1]*tslew + TS6par[2]*tslew*tslew + TS6par[3]*tslew*tslew*tslew;
177 return b[1]*c[2]-b[2]*c[1];
181 return a[0]*(b[1]*c[2]-b[2]*c[1])-a[1]*(b[0]*c[2]-b[2]*c[0])+a[2]*(b[0]*c[1]-b[1]*c[0]);
double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
auto_ptr< ClusterSequence > cs
double pedestal(int fCapId) const
get pedestal for capid=0..3
void applyXM(const std::vector< double > &inputCharge, const std::vector< double > &inputPedestal, std::vector< double > &HLTOutput) const
double det2(double *b, double *c) const
void apply(const CaloSamples &cs, const std::vector< int > &capidvec, const HcalCalibrations &calibs, std::vector< double > &HLTOutput) const
Abs< T >::type abs(const T &t)
void getLandauFrac(float tStart, float tEnd, float &sum) const
double det3(double *a, double *b, double *c) const
void init(HcalTimeSlew::ParaSource tsParam, HcalTimeSlew::BiasSetting bias, NegStrategy nStrat, PedestalSub pedSubFxn_)
void pulseFraction(const double fC, double *TS46) const
int size() const
get the size
static double delay(double fC, BiasSetting bias=Medium)
Returns the amount (ns) by which a pulse of the given number of fC will be delayed by the timeslew ef...
static float landauFrac[]