-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Energy threshold update for new MTD geometry #31654
Changes from 5 commits
2390bc2
ce31890
7f999d4
506a52f
1814869
cb56598
98c389f
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 |
---|---|---|
|
@@ -3,12 +3,16 @@ | |
#include "RecoLocalFastTime/Records/interface/MTDTimeCalibRecord.h" | ||
#include "RecoLocalFastTime/FTLCommonAlgos/interface/MTDTimeCalib.h" | ||
|
||
#include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h" | ||
#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h" | ||
#include <iostream> | ||
|
||
class MTDRecHitAlgo : public MTDRecHitAlgoBase { | ||
public: | ||
/// Constructor | ||
MTDRecHitAlgo(const edm::ParameterSet& conf, edm::ConsumesCollector& sumes) | ||
: MTDRecHitAlgoBase(conf, sumes), | ||
thresholdToKeep_(conf.getParameter<double>("thresholdToKeep")), | ||
thresholdToKeep_(conf.getParameter<std::vector<double>>("thresholdToKeep")), | ||
calibration_(conf.getParameter<double>("calibrationConstant")) {} | ||
|
||
/// Destructor | ||
|
@@ -22,14 +26,20 @@ class MTDRecHitAlgo : public MTDRecHitAlgoBase { | |
FTLRecHit makeRecHit(const FTLUncalibratedRecHit& uRecHit, uint32_t& flags) const final; | ||
|
||
private: | ||
double thresholdToKeep_, calibration_; | ||
std::vector<double> thresholdToKeep_; | ||
double calibration_; | ||
const MTDTimeCalib* time_calib_; | ||
const MTDTopology* topology_; | ||
static constexpr int topologycode1Disk_ = 4; | ||
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. @gsorrentino18 @casarsa there is no need to define hardcoded thresholds, you may simply use the MTDTopologyMode enum class with something like
as we are doing elsewhere in the code (and I am using in the RecoMTD/DetLayers code I am preparing) |
||
}; | ||
|
||
void MTDRecHitAlgo::getEventSetup(const edm::EventSetup& es) { | ||
edm::ESHandle<MTDTimeCalib> pTC; | ||
es.get<MTDTimeCalibRecord>().get("MTDTimeCalib", pTC); | ||
time_calib_ = pTC.product(); | ||
edm::ESHandle<MTDTopology> topologyHandle; | ||
es.get<MTDTopologyRcd>().get(topologyHandle); | ||
topology_ = topologyHandle.product(); | ||
} | ||
|
||
FTLRecHit MTDRecHitAlgo::makeRecHit(const FTLUncalibratedRecHit& uRecHit, uint32_t& flags) const { | ||
|
@@ -39,6 +49,11 @@ FTLRecHit MTDRecHitAlgo::makeRecHit(const FTLUncalibratedRecHit& uRecHit, uint32 | |
float energy = 0.; | ||
float time = 0.; | ||
|
||
// MTD topology | ||
unsigned int index_topology = 0; //1Disks geometry | ||
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. it looks like this index can be computed in |
||
if (topology_->getMTDTopologyMode() > topologycode1Disk_) | ||
index_topology = 1; //2Disk geometry | ||
|
||
/// position and positionError in unit cm | ||
float position = -1.f; | ||
float positionError = -1.f; | ||
|
@@ -80,7 +95,7 @@ FTLRecHit MTDRecHitAlgo::makeRecHit(const FTLUncalibratedRecHit& uRecHit, uint32 | |
|
||
// Now fill flags | ||
// all rechits from the digitizer are "good" at present | ||
if (energy > thresholdToKeep_) { | ||
if (energy > thresholdToKeep_[index_topology]) { | ||
flags = FTLRecHit::kGood; | ||
rh.setFlag(flags); | ||
} else { | ||
|
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.
this include should not be needed, because cout is not allowed.