|
|
#include <RecoTracker/DeDxEstimatorProducer/src/DeDxEstimatorProducer.cc>
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 45 of file DeDxEstimatorProducer.h.
◆ DeDxEstimatorProducer()
Definition at line 48 of file DeDxEstimatorProducer.cc.
49 :
tkGeomToken(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()) {
50 produces<ValueMap<DeDxData>>();
52 auto cCollector = consumesCollector();
53 string estimatorName = iConfig.
getParameter<
string>(
"estimator");
54 if (estimatorName ==
"median")
55 m_estimator = std::make_unique<MedianDeDxEstimator>(iConfig);
56 else if (estimatorName ==
"generic")
57 m_estimator = std::make_unique<GenericAverageDeDxEstimator>(iConfig);
58 else if (estimatorName ==
"truncated")
59 m_estimator = std::make_unique<TruncatedAverageDeDxEstimator>(iConfig);
60 else if (estimatorName ==
"genericTruncated")
61 m_estimator = std::make_unique<GenericTruncatedAverageDeDxEstimator>(iConfig);
62 else if (estimatorName ==
"unbinnedFit")
63 m_estimator = std::make_unique<UnbinnedFitDeDxEstimator>(iConfig);
64 else if (estimatorName ==
"productDiscrim")
65 m_estimator = std::make_unique<ProductDeDxDiscriminator>(iConfig, cCollector);
66 else if (estimatorName ==
"btagDiscrim")
67 m_estimator = std::make_unique<BTagLikeDeDxDiscriminator>(iConfig, cCollector);
68 else if (estimatorName ==
"smirnovDiscrim")
69 m_estimator = std::make_unique<SmirnovDeDxDiscriminator>(iConfig, cCollector);
70 else if (estimatorName ==
"asmirnovDiscrim")
71 m_estimator = std::make_unique<ASmirnovDeDxDiscriminator>(iConfig, cCollector);
89 <<
"Pixel Hits AND Strip Hits will not be used to estimate dEdx --> BUG, Please Update the config file";
References edm::BeginRun, edm::ParameterSet::getParameter(), m_calibrationPath, m_estimator, m_tracksTag, meVperADCPixel, meVperADCStrip, shapetest, useCalibration, usePixel, and useStrip.
◆ ~DeDxEstimatorProducer()
DeDxEstimatorProducer::~DeDxEstimatorProducer |
( |
| ) |
|
|
override |
◆ beginRun()
Definition at line 95 of file DeDxEstimatorProducer.cc.
References calibGains, edm::EventSetup::getData(), m_calibrationPath, m_estimator, m_off, DeDxTools::makeCalibrationMap(), TrackerGeometry::offsetDU(), GeomDetEnumerators::PixelBarrel, writedatasetfile::run, tkGeom, tkGeomToken, and useCalibration.
◆ fillDescriptions()
Definition at line 29 of file DeDxEstimatorProducer.cc.
31 desc.add<
string>(
"estimator",
"generic");
33 desc.add<
bool>(
"UsePixel",
false);
34 desc.add<
bool>(
"UseStrip",
true);
35 desc.add<
double>(
"MeVperADCPixel", 3.61e-06);
36 desc.add<
double>(
"MeVperADCStrip", 3.61e-06 * 265);
37 desc.add<
bool>(
"ShapeTest",
true);
38 desc.add<
bool>(
"UseCalibration",
false);
39 desc.add<
string>(
"calibrationPath",
"");
40 desc.add<
string>(
"Reccord",
"SiStripDeDxMip_3D_Rcd");
41 desc.add<
string>(
"ProbabilityMode",
"Accumulation");
42 desc.add<
double>(
"fraction", 0.4);
43 desc.add<
double>(
"exponent", -2.0);
45 descriptions.
add(
"DeDxEstimatorProducer",
desc);
References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.
◆ makeCalibrationMap()
void DeDxEstimatorProducer::makeCalibrationMap |
( |
const TrackerGeometry & |
tkGeom | ) |
|
|
private |
◆ processHit()
Definition at line 152 of file DeDxEstimatorProducer.cc.
157 auto const& thit = static_cast<BaseTrackerRecHit const&>(*
recHit);
161 auto const& clus = thit.firstClusterRef();
165 if (clus.isPixel()) {
169 const auto* detUnit =
recHit->detUnit();
170 if (detUnit ==
nullptr)
173 float chargeAbs = clus.pixelCluster().charge();
176 }
else if (clus.isStrip() && !thit.isMatched()) {
180 const auto* detUnit =
recHit->detUnit();
181 if (detUnit ==
nullptr)
190 NClusterSaturating++;
192 }
else if (clus.isStrip() && thit.isMatched()) {
198 const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(matchedHit->
det());
200 gdet = static_cast<const GluedGeomDet*>(
tkGeom->
idToDet(thit.geographicalId()));
202 auto& detUnitM = *(gdet->
monoDet());
204 float pathLen = detUnitM.surface().bounds().thickness() / fabs(cosine);
210 NClusterSaturating++;
215 pathLen = detUnitS.surface().bounds().thickness() / fabs(cosine);
221 NClusterSaturating++;
References Surface::bounds(), calibGains, ALCARECOTkAlJpsiMuMu_cff::charge, TrackingRecHit::det(), DeDxTools::getCharge(), TrackerGeometry::idToDet(), m_off, meVperADCPixel, meVperADCStrip, SiStripMatchedRecHit2D::monoCluster(), GluedGeomDet::monoDet(), SiStripMatchedRecHit2D::monoId(), rpcPointValidation_cfi::recHit, DeDxTools::shapeSelection(), shapetest, SiStripMatchedRecHit2D::stereoCluster(), GluedGeomDet::stereoDet(), SiStripMatchedRecHit2D::stereoId(), GeomDet::surface(), Bounds::thickness(), tkGeom, reco::btau::trackMomentum, usePixel, and useStrip.
Referenced by produce().
◆ produce()
Definition at line 106 of file DeDxEstimatorProducer.cc.
107 auto trackDeDxEstimateAssociation = std::make_unique<ValueMap<DeDxData>>();
113 std::vector<DeDxData> dedxEstimate(trackCollectionHandle->size());
115 for (
unsigned int j = 0;
j < trackCollectionHandle->size();
j++) {
118 int NClusterSaturating = 0;
121 auto const& trajParams =
track->extra()->trajParams();
123 auto hb =
track->recHitsBegin();
124 dedxHits.reserve(
track->recHitsSize() / 2);
125 for (
unsigned int h = 0;
h <
track->recHitsSize();
h++) {
130 auto trackDirection = trajParams[
h].direction();
131 float cosine = trackDirection.z() / trackDirection.mag();
135 sort(dedxHits.begin(), dedxHits.end(), less<DeDxHit>());
136 std::pair<float, float> val_and_error =
m_estimator->dedx(dedxHits);
140 val_and_error.second = NClusterSaturating;
141 dedxEstimate[
j] =
DeDxData(val_and_error.first, val_and_error.second, dedxHits.size());
145 filler.insert(trackCollectionHandle, dedxEstimate.begin(), dedxEstimate.end());
References cms::cuda::assert(), trigObjTnPSource_cfi::filler, h, hcalSimParameters_cfi::hb, iEvent, trackerHitRTTI::isFromDet(), dqmiolumiharvest::j, m_estimator, m_tracksTag, eostools::move(), processHit(), edm::Handle< T >::product(), rpcPointValidation_cfi::recHit, jetUpdater_cfi::sort, and HLT_FULL_cff::track.
◆ calibGains
std::vector<std::vector<float> > DeDxEstimatorProducer::calibGains |
|
private |
◆ m_calibrationPath
std::string DeDxEstimatorProducer::m_calibrationPath |
|
private |
◆ m_estimator
◆ m_off
unsigned int DeDxEstimatorProducer::m_off |
|
private |
◆ m_tracksTag
◆ MaxNrStrips
unsigned int DeDxEstimatorProducer::MaxNrStrips |
|
private |
◆ meVperADCPixel
float DeDxEstimatorProducer::meVperADCPixel |
|
private |
◆ meVperADCStrip
float DeDxEstimatorProducer::meVperADCStrip |
|
private |
◆ shapetest
bool DeDxEstimatorProducer::shapetest |
|
private |
◆ tkGeom
◆ tkGeomToken
◆ useCalibration
bool DeDxEstimatorProducer::useCalibration |
|
private |
◆ usePixel
bool DeDxEstimatorProducer::usePixel |
|
private |
◆ useStrip
bool DeDxEstimatorProducer::useStrip |
|
private |
const TrackerGeomDet * idToDet(DetId) const override
unsigned int monoId() const
T const * product() const
SiStripCluster const & stereoCluster() const
std::vector< std::vector< float > > calibGains
std::string m_calibrationPath
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const GeomDet * det() const
std::vector< DeDxHit > DeDxHitCollection
const GeomDetUnit * monoDet() const
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< reco::TrackCollection > m_tracksTag
const Plane & surface() const
The nominal surface of the GeomDet.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< BaseDeDxEstimator > m_estimator
const Bounds & bounds() const
const TrackerGeometry * tkGeom
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
virtual float thickness() const =0
unsigned int stereoId() const
bool isFromDet(TrackingRecHit const &hit)
bool getData(T &iHolder) const
const GeomDetUnit * stereoDet() const
SiStripCluster const & monoCluster() const
T getParameter(std::string const &) const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken
void processHit(const TrackingRecHit *recHit, float trackMomentum, float &cosine, reco::DeDxHitCollection &dedxHits, int &NClusterSaturating)
unsigned int offsetDU(SubDetector sid) const