Skip to content
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

Run3-hcx320 Use of ESGetToken in RecoLocalCalo/HcalRecAlgos #35234

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updating the Tracker Phase2 Digitizer framework to include Bricked Pi…
…xel algorithm for the inner pixel tracker
  • Loading branch information
Suchandra authored and Sunanda committed Sep 11, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b1c15db70665d998ade78d7ca9f620206deba81f
25 changes: 19 additions & 6 deletions SimTracker/SiPhase2Digitizer/plugins/Phase2TrackerDigitizer.cc
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
#include "SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h"
#include "SimTracker/SiPhase2Digitizer/plugins/PixelDigitizerAlgorithm.h"
#include "SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.h"
#include "SimTracker/SiPhase2Digitizer/plugins/PixelBrickedDigitizerAlgorithm.h"
#include "SimTracker/SiPhase2Digitizer/plugins/DigitizerUtility.h"

#include "FWCore/Framework/interface/EDProducer.h"
@@ -91,6 +92,7 @@ namespace cms {
}
// creating algorithm objects and pushing them into the map
algomap_[AlgorithmType::InnerPixel] = std::make_unique<PixelDigitizerAlgorithm>(iConfig, iC);
algomap_[AlgorithmType::InnerPixelBricked] = std::make_unique<PixelBrickedDigitizerAlgorithm>(iConfig, iC);
algomap_[AlgorithmType::InnerPixel3D] = std::make_unique<Pixel3DDigitizerAlgorithm>(iConfig, iC);
algomap_[AlgorithmType::PixelinPS] = std::make_unique<PSPDigitizerAlgorithm>(iConfig, iC);
algomap_[AlgorithmType::StripinPS] = std::make_unique<PSSDigitizerAlgorithm>(iConfig, iC);
@@ -234,6 +236,9 @@ namespace cms {
moduleTypeCache_.emplace(detId_raw, mType);
}

auto detUnit = detectorUnits_.find(detId_raw);
const Phase2TrackerGeomDetUnit* pixdet = dynamic_cast<const Phase2TrackerGeomDetUnit*>(detUnit->second);
const Phase2TrackerTopology* topol = &pixdet->specificTopology();
AlgorithmType algotype = AlgorithmType::Unknown;
switch (mType) {
case TrackerGeometry::ModuleType::Ph1PXB:
@@ -243,10 +248,16 @@ namespace cms {
algotype = AlgorithmType::InnerPixel;
break;
case TrackerGeometry::ModuleType::Ph2PXB:
algotype = AlgorithmType::InnerPixel;
if (topol->isBricked())
algotype = AlgorithmType::InnerPixelBricked;
else
algotype = AlgorithmType::InnerPixel;
break;
case TrackerGeometry::ModuleType::Ph2PXF:
algotype = AlgorithmType::InnerPixel;
if (topol->isBricked())
algotype = AlgorithmType::InnerPixelBricked;
else
algotype = AlgorithmType::InnerPixel;
break;
case TrackerGeometry::ModuleType::Ph2PXB3D:
algotype = AlgorithmType::InnerPixel3D;
@@ -282,9 +293,10 @@ namespace cms {
continue;

// Decide if we want analog readout for Outer Tracker.
if (!ot_analog && (algotype != AlgorithmType::InnerPixel && algotype != AlgorithmType::InnerPixel3D)) {
if (!ot_analog && algotype != AlgorithmType::InnerPixel && algotype != AlgorithmType::InnerPixel3D &&
algotype != AlgorithmType::InnerPixelBricked)
continue;
}

std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
fiter->second->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u), digi_map, tTopo_);

@@ -345,9 +357,10 @@ namespace cms {
auto algotype = getAlgoType(rawId);

auto fiter = algomap_.find(algotype);
if (fiter == algomap_.end() || algotype == AlgorithmType::InnerPixel || algotype == AlgorithmType::InnerPixel3D) {
if (fiter == algomap_.end() || algotype == AlgorithmType::InnerPixel || algotype == AlgorithmType::InnerPixel3D ||
algotype == AlgorithmType::InnerPixelBricked)
continue;
}

std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
fiter->second->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u), digi_map, tTopo_);

Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ namespace cms {
using vstring = std::vector<std::string>;

// constants of different algorithm types
enum class AlgorithmType { InnerPixel, InnerPixel3D, PixelinPS, StripinPS, TwoStrip, Unknown };
enum class AlgorithmType { InnerPixel, InnerPixelBricked, InnerPixel3D, PixelinPS, StripinPS, TwoStrip, Unknown };
AlgorithmType getAlgoType(uint32_t idet);

void accumulatePixelHits(edm::Handle<std::vector<PSimHit> >, size_t globalSimHitIndex, const uint32_t tofBin);
Original file line number Diff line number Diff line change
@@ -37,25 +37,14 @@
using namespace edm;
using namespace sipixelobjects;

namespace {
namespace Ph2TkDigiAlgo {
// Mass in MeV
constexpr double m_pion = 139.571;
constexpr double m_kaon = 493.677;
constexpr double m_electron = 0.511;
constexpr double m_muon = 105.658;
constexpr double m_proton = 938.272;
float calcQ(float x);
} // namespace
namespace {
float calcQ(float x) {
constexpr float p1 = 12.5f;
constexpr float p2 = 0.2733f;
constexpr float p3 = 0.147f;

auto xx = std::min(0.5f * x * x, p1);
return 0.5f * (1.f - std::copysign(std::sqrt(1.f - unsafe_expf<4>(-xx * (1.f + p2 / (1.f + p3 * xx)))), x));
}
} // namespace
} // namespace Ph2TkDigiAlgo
Phase2TrackerDigitizerAlgorithm::Phase2TrackerDigitizerAlgorithm(const edm::ParameterSet& conf_common,
const edm::ParameterSet& conf_specific,
edm::ConsumesCollector iC)
@@ -279,17 +268,17 @@ std::vector<DigitizerUtility::EnergyDepositUnit> Phase2TrackerDigitizerAlgorithm
//==============================================================================
std::vector<float> Phase2TrackerDigitizerAlgorithm::fluctuateEloss(
int pid, float particleMomentum, float eloss, float length, int NumberOfSegs) const {
double particleMass = ::m_pion; // Mass in MeV, assume pion
double particleMass = Ph2TkDigiAlgo::m_pion; // Mass in MeV, assume pion
pid = std::abs(pid);
if (pid != 211) { // Mass in MeV
if (pid == 11)
particleMass = ::m_electron;
particleMass = Ph2TkDigiAlgo::m_electron;
else if (pid == 13)
particleMass = ::m_muon;
particleMass = Ph2TkDigiAlgo::m_muon;
else if (pid == 321)
particleMass = ::m_kaon;
particleMass = Ph2TkDigiAlgo::m_kaon;
else if (pid == 2212)
particleMass = ::m_proton;
particleMass = Ph2TkDigiAlgo::m_proton;
}
// What is the track segment length.
float segmentLength = length / NumberOfSegs;
@@ -513,7 +502,7 @@ void Phase2TrackerDigitizerAlgorithm::induce_signal(
} else {
mp = MeasurementPoint(ix, 0.0);
xLB = topol->localPosition(mp).x();
LowerBound = 1 - ::calcQ((xLB - CloudCenterX) / SigmaX);
LowerBound = 1 - calcQ((xLB - CloudCenterX) / SigmaX);
}

float xUB, UpperBound;
@@ -522,7 +511,7 @@ void Phase2TrackerDigitizerAlgorithm::induce_signal(
} else {
mp = MeasurementPoint(ix + 1, 0.0);
xUB = topol->localPosition(mp).x();
UpperBound = 1. - ::calcQ((xUB - CloudCenterX) / SigmaX);
UpperBound = 1. - calcQ((xUB - CloudCenterX) / SigmaX);
}
float TotalIntegrationRange = UpperBound - LowerBound; // get strip
x.emplace(ix, TotalIntegrationRange); // save strip integral
@@ -537,7 +526,7 @@ void Phase2TrackerDigitizerAlgorithm::induce_signal(
} else {
mp = MeasurementPoint(0.0, iy);
yLB = topol->localPosition(mp).y();
LowerBound = 1. - ::calcQ((yLB - CloudCenterY) / SigmaY);
LowerBound = 1. - calcQ((yLB - CloudCenterY) / SigmaY);
}

float yUB, UpperBound;
@@ -546,7 +535,7 @@ void Phase2TrackerDigitizerAlgorithm::induce_signal(
} else {
mp = MeasurementPoint(0.0, iy + 1);
yUB = topol->localPosition(mp).y();
UpperBound = 1. - ::calcQ((yUB - CloudCenterY) / SigmaY);
UpperBound = 1. - calcQ((yUB - CloudCenterY) / SigmaY);
}

float TotalIntegrationRange = UpperBound - LowerBound;
@@ -1041,3 +1030,11 @@ int Phase2TrackerDigitizerAlgorithm::convertSignalToAdc(uint32_t detID, float si
}
return signal_in_adc;
}
float Phase2TrackerDigitizerAlgorithm::calcQ(float x) {
constexpr float p1 = 12.5f;
constexpr float p2 = 0.2733f;
constexpr float p3 = 0.147f;

auto xx = std::min(0.5f * x * x, p1);
return 0.5f * (1.f - std::copysign(std::sqrt(1.f - unsafe_expf<4>(-xx * (1.f + p2 / (1.f + p3 * xx)))), x));
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


#ifndef __SimTracker_SiPhase2Digitizer_Phase2TrackerDigitizerAlgorithm_h
#define __SimTracker_SiPhase2Digitizer_Phase2TrackerDigitizerAlgorithm_h

@@ -218,6 +220,7 @@ class Phase2TrackerDigitizerAlgorithm {
const Phase2TrackerGeomDetUnit* pixdet); // remove dead modules uisng the list in the DB

const SubdetEfficiencies subdetEfficiencies_;
float calcQ(float x);

// For random numbers
std::unique_ptr<CLHEP::RandGaussQ> gaussDistribution_;
Loading