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.

8  :
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  { }
BTLUncalibRecHitAlgo::~BTLUncalibRecHitAlgo ( )
inlineoverride

Destructor.

Definition at line 21 of file BTLUncalibRecHitAlgo.cc.

21 { }

Member Function Documentation

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

get event and eventsetup information

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 24 of file BTLUncalibRecHitAlgo.cc.

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

Implements MTDUncalibratedRecHitAlgoBase< DataFrame >.

Definition at line 25 of file BTLUncalibRecHitAlgo.cc.

References makeRecHit().

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

make the rec hit

Definition at line 44 of file BTLUncalibRecHitAlgo.cc.

References adcLSB_, CustomPhysics_cfi::amplitude, FTLDataFrameT< D, S, DECODE >::column(), DEFINE_EDM_PLUGIN, RemoveAddSevLevel::flag, objects.autophobj::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().

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

Member Data Documentation

const double BTLUncalibRecHitAlgo::adcLSB_
private

Definition at line 34 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const uint32_t BTLUncalibRecHitAlgo::adcNBits_
private

Definition at line 32 of file BTLUncalibRecHitAlgo.cc.

const double BTLUncalibRecHitAlgo::adcSaturation_
private

Definition at line 33 of file BTLUncalibRecHitAlgo.cc.

const double BTLUncalibRecHitAlgo::timeCorr_p0_
private

Definition at line 37 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::timeCorr_p1_
private

Definition at line 38 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::timeCorr_p2_
private

Definition at line 39 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::timeError_
private

Definition at line 36 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().

const double BTLUncalibRecHitAlgo::toaLSBToNS_
private

Definition at line 35 of file BTLUncalibRecHitAlgo.cc.

Referenced by makeRecHit().