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 std::unique_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.

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

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:121
const Shape & castorShape() const

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.

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

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:121
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:70
static const double tmax[3]

◆ 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 std::unique_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.