CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RecoFCcorFactorAlgo< S > Class Template Reference

#include <genlkupmap.h>

Public Member Functions

template<>
std::pair< double, double > calcpair (double truefc)
 
std::pair< double, double > calcpair (double)
 
template<>
 RecoFCcorFactorAlgo (int num_samples, double fixedphase_ns)
 
 RecoFCcorFactorAlgo (int num_samples, double fixedphase_ns)
 

Private Attributes

double fixedphasens_
 
double integrationwindowns_
 
const boost::scoped_ptr< HcalShapeIntegratorintegrator_
 
S shape_
 
double time0shiftns_
 

Detailed Description

template<class S>
class RecoFCcorFactorAlgo< S >

Definition at line 124 of file genlkupmap.h.

Constructor & Destructor Documentation

template<class S>
RecoFCcorFactorAlgo< S >::RecoFCcorFactorAlgo ( int  num_samples,
double  fixedphase_ns 
)
template<>
RecoFCcorFactorAlgo< CastorPulseShapes::Shape >::RecoFCcorFactorAlgo ( int  num_samples,
double  fixedphase_ns 
)

Definition at line 13 of file CastorPulseContainmentCorrection.cc.

References CastorPulseShapes::castorShape(), gather_cfg::cout, CastorPulseShapes::Shape::integrate(), and alignCSCRings::s.

14 {
15  fixedphasens_ = fixedphase_ns;
16  CastorPulseShapes shapes;
17  shape_=shapes.castorShape();
18  const int binsize_ns = 25;
19 
20  // First set up controlling parameters for calculating the correction factor:
21  // Integration window size...
22  //
23  integrationwindowns_ = (double)(binsize_ns*num_samples);
24 
25  // First find the point at which time bin "1" exceeds time bin "0",
26  // and call that point "time 0".
27  //
28  for (int shift_ns=0; shift_ns<binsize_ns; shift_ns++) {
29 
30  // Digitize by integrating to find all time sample
31  // bin values for this shift.
32  //
33  double tmin = -(double)shift_ns;
34  double bin0val = (double)shape_.integrate(tmin, tmin+binsize_ns);
35  double bin1val = (double)shape_.integrate(tmin+binsize_ns, tmin+2*binsize_ns);
36 
37 #if 0
38  char s[80];
39  sprintf (s, "%7.3f %8.5f %8.5f\n", tmin, bin0val, bin1val);
40  cout << s;
41 #endif
42 
43  if (bin1val > bin0val) {
44  time0shiftns_ = shift_ns;
45  break;
46  }
47  }
48 
49 #if 0
50  cout << "time0shiftns_ = " << time0shiftns_ << endl;
51 #endif
52 }
double integrationwindowns_
Definition: genlkupmap.h:131
const Shape & castorShape() const

Member Function Documentation

template<>
std::pair< double, double > RecoFCcorFactorAlgo< CastorPulseShapes::Shape >::calcpair ( double  truefc)

Definition at line 55 of file CastorPulseContainmentCorrection.cc.

References gather_cfg::cout, CastorTimeSlew::delay(), funct::integral(), hpstanc_transforms::max, CastorTimeSlew::Medium, alignCSCRings::s, and tmax.

56 {
57  double timeslew_ns = CastorTimeSlew::delay(std::max(0.0,(double)truefc),
59  double shift_ns = fixedphasens_ - time0shiftns_ + timeslew_ns;
60 
61  double tmin = -shift_ns;
62  double tmax = tmin+integrationwindowns_;
63 
64  double integral = shape_.integrate( tmin, tmax );
65  double corfactor = 1.0/integral;
66  double recofc = (double)truefc * integral;
67 
68 #if 0
69  char s[80];
70  sprintf (s, "%8.2f %8.4f %8.4f %8.5f %8.5f %8.5f ",
71  truefc, tmin, tmax, integral, corfactor, recofc);
72  cout << s;
73 #endif
74 
75  std::pair<double,double> thepair(recofc,corfactor);
76  return thepair;
77 }
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...
double integrationwindowns_
Definition: genlkupmap.h:131
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:69
static const double tmax[3]
template<class S>
std::pair<double,double> RecoFCcorFactorAlgo< S >::calcpair ( double  )

Member Data Documentation

template<class S>
double RecoFCcorFactorAlgo< S >::fixedphasens_
private

Definition at line 130 of file genlkupmap.h.

template<class S>
double RecoFCcorFactorAlgo< S >::integrationwindowns_
private

Definition at line 131 of file genlkupmap.h.

template<class S>
const boost::scoped_ptr<HcalShapeIntegrator> RecoFCcorFactorAlgo< S >::integrator_
private

Definition at line 134 of file genlkupmap.h.

template<class S>
S RecoFCcorFactorAlgo< S >::shape_
private

Definition at line 133 of file genlkupmap.h.

template<class S>
double RecoFCcorFactorAlgo< S >::time0shiftns_
private

Definition at line 132 of file genlkupmap.h.