Skip to content

Commit

Permalink
Merge pull request #41215 from bsunanda/Run3-sim140
Browse files Browse the repository at this point in the history
Run3-sim140 Small fix to SimG4CMS/Calo to enable builiding debug library
  • Loading branch information
cmsbuild authored Mar 29, 2023
2 parents 72d0199 + c245915 commit d95ace5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 34 deletions.
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/src/CaloSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <memory>
#include <sstream>

// #define EDM_ML_DEBUG
//#define EDM_ML_DEBUG

CaloSD::CaloSD(const std::string& name,
const SensitiveDetectorCatalog& clg,
Expand Down Expand Up @@ -707,7 +707,7 @@ void CaloSD::update(const EndOfTrack* trk) {
if (trkH->trackID() == (unsigned int)(id)) {
tkMap[id] = trkH;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("CaloSim") << "CaloSD: get track " << it << " from Container of size "
edm::LogVerbatim("CaloSim") << "CaloSD: get track " << id << " from Container of size "
<< trksForThisEvent->size() << " with ID " << trkH->trackID();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/CaloTrkProcessing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "DD4hep/Filter.h"

#include <sstream>
// #define EDM_ML_DEBUG
//#define EDM_ML_DEBUG

CaloTrkProcessing::CaloTrkProcessing(const std::string& name,
const CaloSimulationParameters& csps,
Expand Down
60 changes: 29 additions & 31 deletions SimG4CMS/Calo/src/HFDarkening.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

using namespace edm;

HFDarkening::HFDarkening(const edm::ParameterSet& pset) {
//HF area of consideration is 1115 cm from interaction point to 1280cm in z-axis
//Radius (cm) - 13 cm from Beam pipe to 130cm (the top of HF active area)
Expand All @@ -31,45 +29,45 @@ HFDarkening::HFDarkening(const edm::ParameterSet& pset) {

HFDarkening::~HFDarkening() {}

double HFDarkening::dose(unsigned int layer, double Radius) {
double HFDarkening::dose(unsigned int layer, double radius) {
// Radii are 13-17, 17-20, 20-24, 24-29, 29-34, 34-41, 41-48, 48-58, 58-69, 69-82, 82-98, 98-116, 116-130
// These radii are specific to the geometry of the dose map, which closely matches HF Tower Geometry,
// but not exactly.
if (layer > (_numberOfZLayers - 1)) {
return 0.;
}

int radius = 0;
if (Radius <= 17.0)
radius = 0;
else if (Radius <= 20.0)
radius = 1;
else if (Radius <= 24.0)
radius = 2;
else if (Radius <= 29.0)
radius = 3;
else if (Radius <= 34.0)
radius = 4;
else if (Radius <= 41.0)
radius = 5;
else if (Radius <= 48.0)
radius = 6;
else if (Radius <= 58.0)
radius = 7;
else if (Radius <= 69.0)
radius = 8;
else if (Radius <= 82.0)
radius = 9;
else if (Radius <= 98.0)
radius = 10;
else if (Radius <= 116.0)
radius = 11;
else if (Radius <= 130.0)
radius = 12;
int radiusIndex = 0;
if (radius <= 17.0)
radiusIndex = 0;
else if (radius <= 20.0)
radiusIndex = 1;
else if (radius <= 24.0)
radiusIndex = 2;
else if (radius <= 29.0)
radiusIndex = 3;
else if (radius <= 34.0)
radiusIndex = 4;
else if (radius <= 41.0)
radiusIndex = 5;
else if (radius <= 48.0)
radiusIndex = 6;
else if (radius <= 58.0)
radiusIndex = 7;
else if (radius <= 69.0)
radiusIndex = 8;
else if (radius <= 82.0)
radiusIndex = 9;
else if (radius <= 98.0)
radiusIndex = 10;
else if (radius <= 116.0)
radiusIndex = 11;
else if (radius <= 130.0)
radiusIndex = 12;
else
return 0.;

return HFDoseLayerDarkeningPars[layer][radius];
return HFDoseLayerDarkeningPars[layer][radiusIndex];
}

double HFDarkening::degradation(double mrad) { return (exp(-1.44 * pow(mrad / 100, 0.44) * 0.2 / 4.343)); }
Expand Down

0 comments on commit d95ace5

Please sign in to comment.