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 timeCorr_p0_
 
const double timeCorr_p1_
 
const double timeCorr_p2_
 
const double timeError_
 
const double toaLSBToNS_
 

Detailed Description

Definition at line 4 of file BTLUncalibRecHitAlgo.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 7 of file BTLUncalibRecHitAlgo.cc.

9  adcNBits_(conf.getParameter<uint32_t>("adcNbits")),
10  adcSaturation_(conf.getParameter<double>("adcSaturation")),
12  toaLSBToNS_(conf.getParameter<double>("toaLSB_ns")),
13  timeError_(conf.getParameter<double>("timeResolutionInNs")),
14  timeCorr_p0_(conf.getParameter<double>("timeCorr_p0")),
15  timeCorr_p1_(conf.getParameter<double>("timeCorr_p1")),
16  timeCorr_p2_(conf.getParameter<double>("timeCorr_p2")) {}
BTLUncalibRecHitAlgo::~BTLUncalibRecHitAlgo ( )
inlineoverride

Destructor.

Definition at line 19 of file BTLUncalibRecHitAlgo.cc.

19 {}

Member Function Documentation

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

get event and eventsetup information

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 22 of file BTLUncalibRecHitAlgo.cc.

22 {}
void BTLUncalibRecHitAlgo::getEventSetup ( const edm::EventSetup )
inlinefinalvirtual

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 23 of file BTLUncalibRecHitAlgo.cc.

References makeRecHit().

23 {}
FTLUncalibratedRecHit BTLUncalibRecHitAlgo::makeRecHit ( const BTLDataFrame dataFrame) const
final

make the rec hit

Definition at line 39 of file BTLUncalibRecHitAlgo.cc.

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

Referenced by getEventSetup().

39  {
40  // The reconstructed amplitudes and times are saved in a std::pair
41  // BTL tile geometry (1 SiPM): only the first value of the amplitude
42  // and time pairs is used.
43  // BTL bar geometry (2 SiPMs): both values of the amplitude and
44  // time pairs are filled.
45 
46  std::pair<float, float> amplitude(0., 0.);
47  std::pair<float, float> time(0., 0.);
48 
49  unsigned char flag = 0;
50 
51  const auto& sampleLeft = dataFrame.sample(0);
52  const auto& sampleRight = dataFrame.sample(1);
53 
54  if (sampleLeft.data() > 0) {
55  amplitude.first = float(sampleLeft.data()) * adcLSB_;
56  time.first = float(sampleLeft.toa()) * toaLSBToNS_;
57 
58  // Correct the time of the left SiPM for the time-walk
60  flag |= 0x1;
61  }
62 
63  // --- If available, reconstruct the amplitude and time of the second SiPM
64  if (sampleRight.data() > 0) {
65  amplitude.second = sampleRight.data() * adcLSB_;
66  time.second = sampleRight.toa() * toaLSBToNS_;
67 
68  // Correct the time of the right SiPM for the time-walk
69  time.second -= timeCorr_p0_ * pow(amplitude.second, timeCorr_p1_) + timeCorr_p2_;
70  flag |= (0x1 << 1);
71  }
72 
73  LogDebug("BTLUncalibRecHit") << "ADC+: set the charge to: (" << amplitude.first << ", " << amplitude.second << ") ("
74  << sampleLeft.data() << ", " << sampleRight.data() << " " << adcLSB_ << ' '
75  << std::endl;
76  LogDebug("BTLUncalibRecHit") << "TDC+: set the time to: (" << time.first << ", " << time.second << ") ("
77  << sampleLeft.toa() << ", " << sampleRight.toa() << " " << toaLSBToNS_ << ' '
78  << std::endl;
79 
80  return FTLUncalibratedRecHit(dataFrame.id(), dataFrame.row(), dataFrame.column(), amplitude, time, timeError_, flag);
81 }
#define LogDebug(id)
const int row() const
row
Definition: FTLDataFrameT.h:36
const S & sample(int i) const
Definition: FTLDataFrameT.h:57
const int column() const
column
Definition: FTLDataFrameT.h:41
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
const D & id() const
det id
Definition: FTLDataFrameT.h:31

Member Data Documentation

const double BTLUncalibRecHitAlgo::adcLSB_
private

Definition at line 31 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const uint32_t BTLUncalibRecHitAlgo::adcNBits_
private

Definition at line 29 of file BTLUncalibRecHitAlgo.cc.

const double BTLUncalibRecHitAlgo::adcSaturation_
private

Definition at line 30 of file BTLUncalibRecHitAlgo.cc.

const double BTLUncalibRecHitAlgo::timeCorr_p0_
private

Definition at line 34 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::timeCorr_p1_
private

Definition at line 35 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::timeCorr_p2_
private

Definition at line 36 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::timeError_
private

Definition at line 33 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::toaLSBToNS_
private

Definition at line 32 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().