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, constexpr, DEFINE_EDM_PLUGIN, RemoveAddSevLevel::flag, FTLDataFrameT< D, S >::id(), LogDebug, funct::pow(), simplePhotonAnalyzer_cfi::sample, FTLDataFrameT< D, S >::sample(), ntuplemaker::time, timeCorr_p0_, timeCorr_p1_, timeCorr_p2_, timeError_, and toaLSBToNS_.

Referenced by getEventSetup().

44  {
45  constexpr int iSample=2; //only in-time sample
46  const auto& sample = dataFrame.sample(iSample);
47 
48  double amplitude = double(sample.data()) * adcLSB_;
49  double time = double(sample.toa()) * toaLSBToNS_;
50 
51  // --- Correct the time for the time-walk and the constant delays
52  if ( amplitude > 0. )
53  time -= timeCorr_p0_*pow(amplitude,timeCorr_p1_) + timeCorr_p2_;
54 
55  unsigned char flag = 0;
56 
57  LogDebug("BTLUncalibRecHit") << "ADC+: set the charge to: " << amplitude << ' ' << sample.data()
58  << ' ' << adcLSB_ << ' ' << std::endl;
59  LogDebug("BTLUncalibRecHit") << "ADC+: set the time to: " << time << ' ' << sample.toa()
60  << ' ' << toaLSBToNS_ << ' ' << std::endl;
61  LogDebug("BTLUncalibRecHit") << "Final uncalibrated amplitude : " << amplitude << std::endl;
62 
63  return FTLUncalibratedRecHit( dataFrame.id(), amplitude, time, timeError_, flag);
64 }
#define LogDebug(id)
const D & id() const
det id
Definition: FTLDataFrameT.h:32
#define constexpr
const S & sample(int i) const
Definition: FTLDataFrameT.h:48
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

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().