CMS 3D CMS Logo

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

Public Member Functions

 BTLUncalibRecHitAlgo (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 BTLDataFrame &dataFrame) const final
 make the rec hit More...
 
 ~BTLUncalibRecHitAlgo () 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 c_LYSO_
 
const double timeCorr_p0_
 
const double timeCorr_p1_
 
const double timeCorr_p2_
 
const double timeError_
 
const double toaLSBToNS_
 

Detailed Description

Definition at line 5 of file BTLUncalibRecHitAlgo.cc.

Constructor & Destructor Documentation

◆ BTLUncalibRecHitAlgo()

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

Constructor.

Definition at line 8 of file BTLUncalibRecHitAlgo.cc.

10  adcNBits_(conf.getParameter<uint32_t>("adcNbits")),
11  adcSaturation_(conf.getParameter<double>("adcSaturation")),
13  toaLSBToNS_(conf.getParameter<double>("toaLSB_ns")),
14  timeError_(conf.getParameter<double>("timeResolutionInNs")),
15  timeCorr_p0_(conf.getParameter<double>("timeCorr_p0")),
16  timeCorr_p1_(conf.getParameter<double>("timeCorr_p1")),
17  timeCorr_p2_(conf.getParameter<double>("timeCorr_p2")),
18  c_LYSO_(conf.getParameter<double>("c_LYSO")) {}

◆ ~BTLUncalibRecHitAlgo()

BTLUncalibRecHitAlgo::~BTLUncalibRecHitAlgo ( )
inlineoverride

Destructor.

Definition at line 21 of file BTLUncalibRecHitAlgo.cc.

21 {}

Member Function Documentation

◆ getEvent()

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

get event and eventsetup information

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 24 of file BTLUncalibRecHitAlgo.cc.

24 {}

◆ getEventSetup()

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

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 25 of file BTLUncalibRecHitAlgo.cc.

25 {}

◆ makeRecHit()

FTLUncalibratedRecHit BTLUncalibRecHitAlgo::makeRecHit ( const BTLDataFrame dataFrame) const
final

make the rec hit

Definition at line 42 of file BTLUncalibRecHitAlgo.cc.

42  {
43  // The reconstructed amplitudes and times are saved in a std::pair
44  // BTL tile geometry (1 SiPM): only the first value of the amplitude
45  // and time pairs is used.
46  // BTL bar geometry (2 SiPMs): both values of the amplitude and
47  // time pairs are filled.
48 
49  std::pair<float, float> amplitude(0., 0.);
50  std::pair<float, float> time(0., 0.);
51 
52  unsigned char flag = 0;
53 
54  const auto& sampleLeft = dataFrame.sample(0);
55  const auto& sampleRight = dataFrame.sample(1);
56 
57  if (sampleLeft.data() > 0) {
58  amplitude.first = float(sampleLeft.data()) * adcLSB_;
59  time.first = float(sampleLeft.toa()) * toaLSBToNS_;
60 
61  // Correct the time of the left SiPM for the time-walk
63  flag |= 0x1;
64  }
65 
66  // --- If available, reconstruct the amplitude and time of the second SiPM
67  if (sampleRight.data() > 0) {
68  amplitude.second = sampleRight.data() * adcLSB_;
69  time.second = sampleRight.toa() * toaLSBToNS_;
70 
71  // Correct the time of the right SiPM for the time-walk
72  time.second -= timeCorr_p0_ * pow(amplitude.second, timeCorr_p1_) + timeCorr_p2_;
73  flag |= (0x1 << 1);
74  }
75 
76  // Calculate the position
77  // Distance from center of bar to hit
78  float position = 0.5f * (c_LYSO_ * (time.second - time.first));
79  float positionError = BTLRecHitsErrorEstimatorIM::positionError();
80 
81  LogDebug("BTLUncalibRecHit") << "ADC+: set the charge to: (" << amplitude.first << ", " << amplitude.second << ") ("
82  << sampleLeft.data() << ", " << sampleRight.data() << " " << adcLSB_ << ' '
83  << std::endl;
84  LogDebug("BTLUncalibRecHit") << "TDC+: set the time to: (" << time.first << ", " << time.second << ") ("
85  << sampleLeft.toa() << ", " << sampleRight.toa() << " " << toaLSBToNS_ << ' '
86  << std::endl;
87 
88  return FTLUncalibratedRecHit(
89  dataFrame.id(), dataFrame.row(), dataFrame.column(), amplitude, time, timeError_, position, positionError, flag);
90 }

References adcLSB_, CustomPhysics_cfi::amplitude, c_LYSO_, FTLDataFrameT< D, S, DECODE >::column(), RemoveAddSevLevel::flag, dqmMemoryStats::float, FTLDataFrameT< D, S, DECODE >::id(), LogDebug, position, BTLRecHitsErrorEstimatorIM::positionError(), funct::pow(), FTLDataFrameT< D, S, DECODE >::row(), FTLDataFrameT< D, S, DECODE >::sample(), ntuplemaker::time, timeCorr_p0_, timeCorr_p1_, timeCorr_p2_, timeError_, and toaLSBToNS_.

Member Data Documentation

◆ adcLSB_

const double BTLUncalibRecHitAlgo::adcLSB_
private

Definition at line 33 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ adcNBits_

const uint32_t BTLUncalibRecHitAlgo::adcNBits_
private

Definition at line 31 of file BTLUncalibRecHitAlgo.cc.

◆ adcSaturation_

const double BTLUncalibRecHitAlgo::adcSaturation_
private

Definition at line 32 of file BTLUncalibRecHitAlgo.cc.

◆ c_LYSO_

const double BTLUncalibRecHitAlgo::c_LYSO_
private

Definition at line 39 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeCorr_p0_

const double BTLUncalibRecHitAlgo::timeCorr_p0_
private

Definition at line 36 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeCorr_p1_

const double BTLUncalibRecHitAlgo::timeCorr_p1_
private

Definition at line 37 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeCorr_p2_

const double BTLUncalibRecHitAlgo::timeCorr_p2_
private

Definition at line 38 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ timeError_

const double BTLUncalibRecHitAlgo::timeError_
private

Definition at line 35 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

◆ toaLSBToNS_

const double BTLUncalibRecHitAlgo::toaLSBToNS_
private

Definition at line 34 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

FTLDataFrameT::id
const D & id() const
det id
Definition: FTLDataFrameT.h:31
BTLUncalibRecHitAlgo::adcNBits_
const uint32_t adcNBits_
Definition: BTLUncalibRecHitAlgo.cc:31
CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
BTLUncalibRecHitAlgo::timeCorr_p0_
const double timeCorr_p0_
Definition: BTLUncalibRecHitAlgo.cc:36
BTLUncalibRecHitAlgo::timeCorr_p2_
const double timeCorr_p2_
Definition: BTLUncalibRecHitAlgo.cc:38
BTLUncalibRecHitAlgo::timeCorr_p1_
const double timeCorr_p1_
Definition: BTLUncalibRecHitAlgo.cc:37
FTLDataFrameT::column
const int column() const
column
Definition: FTLDataFrameT.h:41
BTLUncalibRecHitAlgo::adcLSB_
const double adcLSB_
Definition: BTLUncalibRecHitAlgo.cc:33
MTDUncalibratedRecHitAlgoBase
Definition: MTDUncalibratedRecHitAlgoBase.h:16
FTLDataFrameT::sample
const S & sample(int i) const
Definition: FTLDataFrameT.h:57
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
BTLUncalibRecHitAlgo::adcSaturation_
const double adcSaturation_
Definition: BTLUncalibRecHitAlgo.cc:32
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
FTLDataFrameT::row
const int row() const
row
Definition: FTLDataFrameT.h:36
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
FTLUncalibratedRecHit
Definition: FTLUncalibratedRecHit.h:7
ntuplemaker.time
time
Definition: ntuplemaker.py:310
BTLRecHitsErrorEstimatorIM::positionError
static float positionError()
Definition: BTLRecHitsErrorEstimatorIM.h:42
BTLUncalibRecHitAlgo::c_LYSO_
const double c_LYSO_
Definition: BTLUncalibRecHitAlgo.cc:39
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
BTLUncalibRecHitAlgo::timeError_
const double timeError_
Definition: BTLUncalibRecHitAlgo.cc:35
BTLUncalibRecHitAlgo::toaLSBToNS_
const double toaLSBToNS_
Definition: BTLUncalibRecHitAlgo.cc:34