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 12 of file CastorPulseContainmentCorrection.cc.

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

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

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

52  {
53  double timeslew_ns = CastorTimeSlew::delay(std::max(0.0, (double)truefc), CastorTimeSlew::Medium);
54  double shift_ns = fixedphasens_ - time0shiftns_ + timeslew_ns;
55 
56  double tmin = -shift_ns;
57  double tmax = tmin + integrationwindowns_;
58 
59  double integral = shape_.integrate(tmin, tmax);
60  double corfactor = 1.0 / integral;
61  double recofc = (double)truefc * integral;
62 
63 #if 0
64  char s[80];
65  sprintf (s, "%8.2f %8.4f %8.4f %8.5f %8.5f %8.5f ",
66  truefc, tmin, tmax, integral, corfactor, recofc);
67  cout << s;
68 #endif
69 
70  std::pair<double, double> thepair(recofc, corfactor);
71  return thepair;
72 }
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.