CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ETLUncalibRecHitAlgo Class Reference
Inheritance diagram for ETLUncalibRecHitAlgo:
MTDUncalibratedRecHitAlgoBase< DataFrame >

Public Member Functions

 ETLUncalibRecHitAlgo (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 Constructor. More...
 
void getEvent (const edm::Event &) final
 get event and eventsetup information More...
 
void getEventSetup (const edm::EventSetup &) final
 
FTLUncalibratedRecHit makeRecHit (const ETLDataFrame &dataFrame) const final
 make the rec hit More...
 
 ~ETLUncalibRecHitAlgo () override
 Destructor. More...
 
- Public Member Functions inherited from MTDUncalibratedRecHitAlgoBase< DataFrame >
virtual FTLUncalibratedRecHit makeRecHit (const DataFrame &dataFrame) const =0
 make the rec hit More...
 
 MTDUncalibratedRecHitAlgoBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 Constructor. More...
 
const std::string & name () const
 
virtual ~MTDUncalibratedRecHitAlgoBase ()
 Destructor. More...
 

Private Attributes

const double adcLSB_
 
const uint32_t adcNBits_
 
const double adcSaturation_
 
const double timeCorr_p0_
 
const double timeCorr_p1_
 
const double timeCorr_p2_
 
const double timeCorr_p3_
 
const reco::FormulaEvaluator timeError_
 
const double toaLSBToNS_
 
const double tofDelay_
 

Detailed Description

Definition at line 6 of file ETLUncalibRecHitAlgo.cc.

Constructor & Destructor Documentation

◆ ETLUncalibRecHitAlgo()

ETLUncalibRecHitAlgo::ETLUncalibRecHitAlgo ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)
inline

Constructor.

Definition at line 9 of file ETLUncalibRecHitAlgo.cc.

11  adcNBits_(conf.getParameter<uint32_t>("adcNbits")),
12  adcSaturation_(conf.getParameter<double>("adcSaturation")),
14  toaLSBToNS_(conf.getParameter<double>("toaLSB_ns")),
15  tofDelay_(conf.getParameter<double>("tofDelay")),
16  timeError_(conf.getParameter<std::string>("timeResolutionInNs")),
17  timeCorr_p0_(conf.getParameter<double>("timeCorr_p0")),
18  timeCorr_p1_(conf.getParameter<double>("timeCorr_p1")),
19  timeCorr_p2_(conf.getParameter<double>("timeCorr_p2")),
20  timeCorr_p3_(conf.getParameter<double>("timeCorr_p3")) {}
const reco::FormulaEvaluator timeError_

◆ ~ETLUncalibRecHitAlgo()

ETLUncalibRecHitAlgo::~ETLUncalibRecHitAlgo ( )
inlineoverride

Destructor.

Definition at line 22 of file ETLUncalibRecHitAlgo.cc.

22 {}

Member Function Documentation

◆ getEvent()

void ETLUncalibRecHitAlgo::getEvent ( const edm::Event )
inlinefinalvirtual

get event and eventsetup information

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 25 of file ETLUncalibRecHitAlgo.cc.

25 {}

◆ getEventSetup()

void ETLUncalibRecHitAlgo::getEventSetup ( const edm::EventSetup )
inlinefinalvirtual

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 26 of file ETLUncalibRecHitAlgo.cc.

26 {}

◆ makeRecHit()

FTLUncalibratedRecHit ETLUncalibRecHitAlgo::makeRecHit ( const ETLDataFrame dataFrame) const
final

make the rec hit

Definition at line 44 of file ETLUncalibRecHitAlgo.cc.

References FTLDataFrameT< D, S, DECODE >::column(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), reco::FormulaEvaluator::evaluate(), RemoveAddSevLevel::flag, FTLDataFrameT< D, S, DECODE >::id(), LogDebug, FTLDataFrameT< D, S, DECODE >::row(), ecalGpuTask_cfi::sample, FTLDataFrameT< D, S, DECODE >::sample(), hcalRecHitTable_cff::time, timeCorr_p0_, timeCorr_p1_, timeCorr_p2_, timeCorr_p3_, timeError_, toaLSBToNS_, and tofDelay_.

44  {
45  constexpr int iSample = 2; //only in-time sample
46  const auto& sample = dataFrame.sample(iSample);
47 
48  double time = double(sample.toa()) * toaLSBToNS_ - tofDelay_;
49  double time_over_threshold = double(sample.tot()) * toaLSBToNS_;
50  const std::array<double, 1> time_over_threshold_V = {{time_over_threshold}};
51 
52  unsigned char flag = 0;
53 
54  LogDebug("ETLUncalibRecHit") << "ADC+: set the charge to: " << time_over_threshold << ' ' << sample.tot() << ' '
55  << toaLSBToNS_;
56 
57  if (time_over_threshold == 0) {
58  LogDebug("ETLUncalibRecHit") << "ADC+: set the time to: " << time << ' ' << sample.toa() << ' ' << toaLSBToNS_;
59 
60  } else {
61  // Time-walk correction for toa
62  double timeWalkCorr = timeCorr_p0_ + timeCorr_p1_ * time_over_threshold +
63  timeCorr_p2_ * time_over_threshold * time_over_threshold +
64  timeCorr_p3_ * time_over_threshold * time_over_threshold * time_over_threshold;
65 
66  time -= timeWalkCorr;
67 
68  LogDebug("ETLUncalibRecHit") << "ADC+: set the time to: " << time << ' ' << sample.toa() << ' ' << toaLSBToNS_
69  << " .Timewalk correction: " << timeWalkCorr;
70  }
71 
72  LogDebug("ETLUncalibRecHit") << "Final uncalibrated time_over_threshold: " << time_over_threshold;
73 
74  const std::array<double, 1> emptyV = {{0.}};
75 
76  double timeError = timeError_.evaluate(time_over_threshold_V, emptyV);
77 
78  return FTLUncalibratedRecHit(dataFrame.id(),
79  dataFrame.row(),
80  dataFrame.column(),
81  {time_over_threshold_V[0], 0.f},
82  {time, 0.f},
83  timeError,
84  -1.f,
85  -1.f,
86  flag);
87 }
double evaluate(V const &iVariables, P const &iParameters) const
const reco::FormulaEvaluator timeError_
const D & id() const
det id
Definition: FTLDataFrameT.h:30
const S & sample(int i) const
Definition: FTLDataFrameT.h:56
const int column() const
column
Definition: FTLDataFrameT.h:40
const int row() const
row
Definition: FTLDataFrameT.h:35
#define LogDebug(id)

Member Data Documentation

◆ adcLSB_

const double ETLUncalibRecHitAlgo::adcLSB_
private

Definition at line 34 of file ETLUncalibRecHitAlgo.cc.

◆ adcNBits_

const uint32_t ETLUncalibRecHitAlgo::adcNBits_
private

Definition at line 32 of file ETLUncalibRecHitAlgo.cc.

◆ adcSaturation_

const double ETLUncalibRecHitAlgo::adcSaturation_
private

Definition at line 33 of file ETLUncalibRecHitAlgo.cc.

◆ timeCorr_p0_

const double ETLUncalibRecHitAlgo::timeCorr_p0_
private

Definition at line 38 of file ETLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeCorr_p1_

const double ETLUncalibRecHitAlgo::timeCorr_p1_
private

Definition at line 39 of file ETLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeCorr_p2_

const double ETLUncalibRecHitAlgo::timeCorr_p2_
private

Definition at line 40 of file ETLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeCorr_p3_

const double ETLUncalibRecHitAlgo::timeCorr_p3_
private

Definition at line 41 of file ETLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeError_

const reco::FormulaEvaluator ETLUncalibRecHitAlgo::timeError_
private

Definition at line 37 of file ETLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ toaLSBToNS_

const double ETLUncalibRecHitAlgo::toaLSBToNS_
private

Definition at line 35 of file ETLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ tofDelay_

const double ETLUncalibRecHitAlgo::tofDelay_
private

Definition at line 36 of file ETLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().