Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- duplicated the BTL and ETL code for the reconstruction of uncalibrated hits; - introduced a global correction for BTL time (time-walk + constant offset); - converted ETL energy from MIPs to MeV.
- Loading branch information
Showing
9 changed files
with
165 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
RecoLocalFastTime/FTLCommonAlgos/plugins/BTLUncalibRecHitAlgo.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include "RecoLocalFastTime/FTLCommonAlgos/interface/MTDUncalibratedRecHitAlgoBase.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
class BTLUncalibRecHitAlgo : public BTLUncalibratedRecHitAlgoBase { | ||
public: | ||
/// Constructor | ||
BTLUncalibRecHitAlgo( const edm::ParameterSet& conf, | ||
edm::ConsumesCollector& sumes ) : | ||
MTDUncalibratedRecHitAlgoBase<BTLDataFrame>( conf, sumes ), | ||
adcNBits_( conf.getParameter<uint32_t>("adcNbits") ), | ||
adcSaturation_( conf.getParameter<double>("adcSaturation") ), | ||
adcLSB_( adcSaturation_/(1<<adcNBits_) ), | ||
toaLSBToNS_( conf.getParameter<double>("toaLSB_ns") ), | ||
timeError_( conf.getParameter<double>("timeResolutionInNs") ), | ||
timeCorr_p0_( conf.getParameter<double>("timeCorr_p0") ), | ||
timeCorr_p1_( conf.getParameter<double>("timeCorr_p1") ), | ||
timeCorr_p2_( conf.getParameter<double>("timeCorr_p2") ) | ||
{ } | ||
|
||
/// Destructor | ||
~BTLUncalibRecHitAlgo() override { } | ||
|
||
/// get event and eventsetup information | ||
void getEvent(const edm::Event&) final {} | ||
void getEventSetup(const edm::EventSetup&) final {} | ||
|
||
/// make the rec hit | ||
FTLUncalibratedRecHit makeRecHit(const BTLDataFrame& dataFrame ) const final; | ||
|
||
private: | ||
|
||
const uint32_t adcNBits_; | ||
const double adcSaturation_; | ||
const double adcLSB_; | ||
const double toaLSBToNS_; | ||
const double timeError_; | ||
const double timeCorr_p0_; | ||
const double timeCorr_p1_; | ||
const double timeCorr_p2_; | ||
|
||
}; | ||
|
||
FTLUncalibratedRecHit | ||
BTLUncalibRecHitAlgo::makeRecHit(const BTLDataFrame& dataFrame ) const { | ||
constexpr int iSample=2; //only in-time sample | ||
const auto& sample = dataFrame.sample(iSample); | ||
|
||
double amplitude = double(sample.data()) * adcLSB_; | ||
double time = double(sample.toa()) * toaLSBToNS_; | ||
|
||
// --- Correct the time for the time-walk and the constant delays | ||
if ( amplitude > 0. ) | ||
time -= timeCorr_p0_*pow(amplitude,timeCorr_p1_) + timeCorr_p2_; | ||
|
||
unsigned char flag = 0; | ||
|
||
LogDebug("BTLUncalibRecHit") << "ADC+: set the charge to: " << amplitude << ' ' << sample.data() | ||
<< ' ' << adcLSB_ << ' ' << std::endl; | ||
LogDebug("BTLUncalibRecHit") << "ADC+: set the time to: " << time << ' ' << sample.toa() | ||
<< ' ' << toaLSBToNS_ << ' ' << std::endl; | ||
LogDebug("BTLUncalibRecHit") << "Final uncalibrated amplitude : " << amplitude << std::endl; | ||
|
||
return FTLUncalibratedRecHit( dataFrame.id(), amplitude, time, timeError_, flag); | ||
} | ||
|
||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
DEFINE_EDM_PLUGIN( BTLUncalibratedRecHitAlgoFactory, BTLUncalibRecHitAlgo, "BTLUncalibRecHitAlgo" ); |
58 changes: 58 additions & 0 deletions
58
RecoLocalFastTime/FTLCommonAlgos/plugins/ETLUncalibRecHitAlgo.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "RecoLocalFastTime/FTLCommonAlgos/interface/MTDUncalibratedRecHitAlgoBase.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
class ETLUncalibRecHitAlgo : public ETLUncalibratedRecHitAlgoBase { | ||
public: | ||
/// Constructor | ||
ETLUncalibRecHitAlgo( const edm::ParameterSet& conf, | ||
edm::ConsumesCollector& sumes ) : | ||
MTDUncalibratedRecHitAlgoBase<ETLDataFrame>( conf, sumes ), | ||
adcNBits_( conf.getParameter<uint32_t>("adcNbits") ), | ||
adcSaturation_( conf.getParameter<double>("adcSaturation") ), | ||
adcLSB_( adcSaturation_/(1<<adcNBits_) ), | ||
toaLSBToNS_( conf.getParameter<double>("toaLSB_ns") ), | ||
tofDelay_( conf.getParameter<double>("tofDelay") ), | ||
timeError_( conf.getParameter<double>("timeResolutionInNs") ) | ||
{ } | ||
|
||
/// Destructor | ||
~ETLUncalibRecHitAlgo() override { } | ||
|
||
/// get event and eventsetup information | ||
void getEvent(const edm::Event&) final {} | ||
void getEventSetup(const edm::EventSetup&) final {} | ||
|
||
/// make the rec hit | ||
FTLUncalibratedRecHit makeRecHit(const ETLDataFrame& dataFrame ) const final; | ||
|
||
private: | ||
|
||
const uint32_t adcNBits_; | ||
const double adcSaturation_; | ||
const double adcLSB_; | ||
const double toaLSBToNS_; | ||
const double tofDelay_; | ||
const double timeError_; | ||
|
||
}; | ||
|
||
FTLUncalibratedRecHit | ||
ETLUncalibRecHitAlgo::makeRecHit(const ETLDataFrame& dataFrame ) const { | ||
constexpr int iSample=2; //only in-time sample | ||
const auto& sample = dataFrame.sample(iSample); | ||
|
||
double amplitude = double(sample.data()) * adcLSB_; | ||
double time = double(sample.toa()) * toaLSBToNS_ - tofDelay_; | ||
unsigned char flag = 0; | ||
|
||
LogDebug("ETLUncalibRecHit") << "ADC+: set the charge to: " << amplitude << ' ' << sample.data() | ||
<< ' ' << adcLSB_ << ' ' << std::endl; | ||
LogDebug("ETLUncalibRecHit") << "ADC+: set the time to: " << time << ' ' << sample.toa() | ||
<< ' ' << toaLSBToNS_ << ' ' << std::endl; | ||
LogDebug("ETLUncalibRecHit") << "Final uncalibrated amplitude : " << amplitude << std::endl; | ||
|
||
return FTLUncalibratedRecHit( dataFrame.id(), amplitude, time, timeError_, flag); | ||
} | ||
|
||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
DEFINE_EDM_PLUGIN( ETLUncalibratedRecHitAlgoFactory, ETLUncalibRecHitAlgo, "ETLUncalibRecHitAlgo" ); |
76 changes: 0 additions & 76 deletions
76
RecoLocalFastTime/FTLCommonAlgos/plugins/MTDUncalibRecHitAlgo.cc
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
RecoLocalFastTime/FTLCommonAlgos/python/mtdUncalibRecHitAlgo_cff.py
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
RecoLocalFastTime/FTLCommonAlgos/src/MTDUncalibratedRecHitAlgoBase.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "RecoLocalFastTime/FTLCommonAlgos/interface/MTDUncalibratedRecHitAlgoBase.h" | ||
|
||
EDM_REGISTER_PLUGINFACTORY(MTDUncalibratedRecHitAlgoFactory, | ||
"MTDUncalibratedRecHitAlgoFactory"); | ||
EDM_REGISTER_PLUGINFACTORY(BTLUncalibratedRecHitAlgoFactory, "BTLUncalibratedRecHitAlgoFactory"); | ||
EDM_REGISTER_PLUGINFACTORY(ETLUncalibratedRecHitAlgoFactory, "ETLUncalibratedRecHitAlgoFactory"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 23 additions & 10 deletions
33
RecoLocalFastTime/FTLRecProducers/python/mtdUncalibratedRecHits_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters