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 114 of file genlkupmap.h.

Constructor & Destructor Documentation

◆ RecoFCcorFactorAlgo() [1/2]

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

◆ RecoFCcorFactorAlgo() [2/2]

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

Definition at line 12 of file CastorPulseContainmentCorrection.cc.

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 }

References CastorPulseShapes::castorShape(), gather_cfg::cout, alignCSCRings::s, and muonTiming_cfi::tmin.

Member Function Documentation

◆ calcpair() [1/2]

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

Definition at line 52 of file CastorPulseContainmentCorrection.cc.

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 }

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

◆ calcpair() [2/2]

template<class S>
std::pair<double, double> RecoFCcorFactorAlgo< S >::calcpair ( double  )

Member Data Documentation

◆ fixedphasens_

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

Definition at line 120 of file genlkupmap.h.

◆ integrationwindowns_

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

Definition at line 121 of file genlkupmap.h.

◆ integrator_

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

Definition at line 124 of file genlkupmap.h.

◆ shape_

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

Definition at line 123 of file genlkupmap.h.

◆ time0shiftns_

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

Definition at line 122 of file genlkupmap.h.

CastorPulseShapes
Definition: CastorPulseShapes.h:10
CastorTimeSlew::delay
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...
Definition: CastorTimeSlew.cc:9
muonTiming_cfi.tmin
tmin
Definition: muonTiming_cfi.py:24
gather_cfg.cout
cout
Definition: gather_cfg.py:144
tmax
static const double tmax[3]
Definition: CastorTimeSlew.cc:7
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RecoFCcorFactorAlgo::integrationwindowns_
double integrationwindowns_
Definition: genlkupmap.h:121
funct::integral
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:70
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CastorTimeSlew::Medium
Definition: CastorTimeSlew.h:19
RecoFCcorFactorAlgo::time0shiftns_
double time0shiftns_
Definition: genlkupmap.h:122
RecoFCcorFactorAlgo::shape_
S shape_
Definition: genlkupmap.h:123
RecoFCcorFactorAlgo::fixedphasens_
double fixedphasens_
Definition: genlkupmap.h:120
CastorPulseShapes::castorShape
const Shape & castorShape() const
Definition: CastorPulseShapes.h:30