New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MTD RECO code update #24241
MTD RECO code update #24241
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" ); |
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" ); |
This file was deleted.
This file was deleted.
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"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoLocalFastTime.FTLCommonAlgos.mtdUncalibRecHitAlgo_cff import mtdUncalibRecHitAlgo | ||
|
||
from SimFastTiming.FastTimingCommon.mtdDigitizer_cfi import mtdDigitizer | ||
|
||
_barrelAlgo = mtdUncalibRecHitAlgo.clone() | ||
_barrelAlgo.adcNbits = mtdDigitizer.barrelDigitizer.ElectronicsSimulation.adcNbits | ||
_barrelAlgo.adcSaturation = mtdDigitizer.barrelDigitizer.ElectronicsSimulation.adcSaturation_MIP | ||
_barrelAlgo.toaLSB_ns = mtdDigitizer.barrelDigitizer.ElectronicsSimulation.toaLSB_ns | ||
_endcapAlgo = mtdUncalibRecHitAlgo.clone() | ||
_endcapAlgo.adcNbits = mtdDigitizer.endcapDigitizer.ElectronicsSimulation.adcNbits | ||
_endcapAlgo.adcSaturation = mtdDigitizer.endcapDigitizer.ElectronicsSimulation.adcSaturation_MIP | ||
_endcapAlgo.toaLSB_ns = mtdDigitizer.endcapDigitizer.ElectronicsSimulation.toaLSB_ns | ||
|
||
_barrelAlgo = cms.PSet( | ||
algoName = cms.string("BTLUncalibRecHitAlgo"), | ||
adcNbits = mtdDigitizer.barrelDigitizer.ElectronicsSimulation.adcNbits, | ||
adcSaturation = mtdDigitizer.barrelDigitizer.ElectronicsSimulation.adcSaturation_MIP, | ||
toaLSB_ns = mtdDigitizer.barrelDigitizer.ElectronicsSimulation.toaLSB_ns, | ||
timeResolutionInNs = cms.double(0.025), | ||
timeCorr_p0 = cms.double(24.8997), | ||
timeCorr_p1 = cms.double(-0.911385), | ||
#timeCorr_p2 = cms.double( 4.19755) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this commented out code needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it isn't, that was an oversight. I've removed the line. Thanks. |
||
timeCorr_p2 = cms.double( 3.3744717) | ||
) | ||
|
||
|
||
_endcapAlgo = cms.PSet( | ||
algoName = cms.string("ETLUncalibRecHitAlgo"), | ||
adcNbits = mtdDigitizer.endcapDigitizer.ElectronicsSimulation.adcNbits, | ||
adcSaturation = mtdDigitizer.endcapDigitizer.ElectronicsSimulation.adcSaturation_MIP, | ||
toaLSB_ns = mtdDigitizer.endcapDigitizer.ElectronicsSimulation.toaLSB_ns, | ||
tofDelay = mtdDigitizer.endcapDigitizer.DeviceSimulation.tofDelay, | ||
timeResolutionInNs = cms.double(0.025) | ||
) | ||
|
||
|
||
mtdUncalibratedRecHits = cms.EDProducer( | ||
"MTDUncalibratedRecHitProducer", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may be better to define these parameters in a common place and pick them up from that one place by the digitizer and reco.
What is the plan to put all these calibration constants in the DB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plan is to put all the calibration constants in the DB. For what concerns the hardware specs, like the number of ADC bits, TDC bits, there range and so on, once the hardware is defined, I think I will follow the example of the other systems .