CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HGCalSciNoiseMap Class Reference

derives from HGCalRadiation map to parse fluence parameters, provides Sci-specific functions More...

#include <HGCalSciNoiseMap.h>

Inheritance diagram for HGCalSciNoiseMap:
HGCalRadiationMap

Public Member Functions

 HGCalSciNoiseMap ()
 
std::pair< double, double > scaleByDose (const HGCScintillatorDetId &, const double)
 
double scaleBySipmArea (const HGCScintillatorDetId &, const double)
 
double scaleByTileArea (const HGCScintillatorDetId &, const double)
 returns the signal scaling and the noise More...
 
void setSipmMap (const std::string &)
 
 ~HGCalSciNoiseMap ()
 
- Public Member Functions inherited from HGCalRadiationMap
const unsigned int & algo ()
 
double computeRadius (const HGCScintillatorDetId &)
 
const HGCalDDDConstantsddd ()
 
const HGCalGeometrygeom ()
 
const doseParametersMapgetDoseMap ()
 
double getDoseValue (const int, const int, const double, bool logVal=false)
 
double getFluenceValue (const int, const int, const double, bool logVal=false)
 
 HGCalRadiationMap ()
 
void setDoseMap (const std::string &, const unsigned int)
 
void setFluenceScaleFactor (double val)
 
void setGeometry (const CaloSubdetectorGeometry *)
 
const HGCalTopologytopo ()
 
 ~HGCalRadiationMap ()
 

Private Member Functions

std::unordered_map< int, float > readSipmPars (const std::string &)
 

Private Attributes

const double refEdge_
 
std::unordered_map< int, float > sipmMap_
 

Additional Inherited Members

- Public Types inherited from HGCalRadiationMap
typedef std::map< std::pair< int, int >, DoseParametersdoseParametersMap
 

Detailed Description

derives from HGCalRadiation map to parse fluence parameters, provides Sci-specific functions

Definition at line 13 of file HGCalSciNoiseMap.h.

Constructor & Destructor Documentation

◆ HGCalSciNoiseMap()

HGCalSciNoiseMap::HGCalSciNoiseMap ( )

Definition at line 6 of file HGCalSciNoiseMap.cc.

6 : refEdge_(3.) {}

◆ ~HGCalSciNoiseMap()

HGCalSciNoiseMap::~HGCalSciNoiseMap ( )
inline

Definition at line 16 of file HGCalSciNoiseMap.h.

16 {};

Member Function Documentation

◆ readSipmPars()

std::unordered_map< int, float > HGCalSciNoiseMap::readSipmPars ( const std::string &  fullpath)
private

Definition at line 12 of file HGCalSciNoiseMap.cc.

12  {
13  std::unordered_map<int, float> result;
14  //no file means default sipm size
15  if (fullpath.empty())
16  return result;
17 
19  std::ifstream infile(fp.fullPath());
20  if (!infile.is_open()) {
21  throw cms::Exception("FileNotFound") << "Unable to open '" << fullpath << "'" << std::endl;
22  }
24  while (getline(infile, line)) {
25  int layer;
26  float boundary;
27 
28  //space-separated
29  std::stringstream linestream(line);
30  linestream >> layer >> boundary;
31 
32  result[layer] = boundary;
33  }
34  return result;
35 }

References Exception, personalPlayback::fp, reco_skim_cfg_mod::fullpath, timingPdfMaker::infile, phase1PixelTopology::layer, mps_splice::line, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by setSipmMap().

◆ scaleByDose()

std::pair< double, double > HGCalSciNoiseMap::scaleByDose ( const HGCScintillatorDetId cellId,
const double  radius 
)

Definition at line 38 of file HGCalSciNoiseMap.cc.

38  {
39  if (getDoseMap().empty())
40  return std::make_pair(1., 0.);
41 
42  //formula is: A = A0 * exp( -D^0.65 / 199.6)
43  //where A0 is the response of the undamaged detector, D is the dose
44  int layer = cellId.layer();
45  double cellDose = getDoseValue(DetId::HGCalHSc, layer, radius); //in kRad
46  constexpr double expofactor = 1. / 199.6;
47  const double dosespower = 0.65;
48  double scaleFactor = std::exp(-std::pow(cellDose, dosespower) * expofactor);
49 
50  //formula is: N = 2.18 * sqrt(F * A / 2e13)
51  //where F is the fluence and A is the SiPM area
52  double cellFluence = getFluenceValue(DetId::HGCalHSc, layer, radius); //in 1-Mev-equivalent neutrons per cm2
53 
54  constexpr double fluencefactor = 2. / (2 * 1e13); //SiPM area = 2mm^2
55  const double normfactor = 2.18;
56  double noise = normfactor * sqrt(cellFluence * fluencefactor);
57 
58  return std::make_pair(scaleFactor, noise);
59 }

References relativeConstraints::empty, JetChargeProducer_cfi::exp, HGCalRadiationMap::getDoseMap(), HGCalRadiationMap::getDoseValue(), HGCalRadiationMap::getFluenceValue(), DetId::HGCalHSc, HGCScintillatorDetId::layer(), phase1PixelTopology::layer, gpuVertexFinder::noise, funct::pow(), CosmicsPD_Skims::radius, multiplicitycorr_cfi::scaleFactor, and mathSSE::sqrt().

Referenced by HGCHEbackDigitizer::runRealisticDigitizer().

◆ scaleBySipmArea()

double HGCalSciNoiseMap::scaleBySipmArea ( const HGCScintillatorDetId cellId,
const double  radius 
)

Definition at line 76 of file HGCalSciNoiseMap.cc.

76  {
77  if (sipmMap_.empty())
78  return 1.;
79 
80  int layer = cellId.layer();
81  if (radius < sipmMap_[layer])
82  return 2.;
83  else
84  return 1.;
85 }

References HGCScintillatorDetId::layer(), phase1PixelTopology::layer, CosmicsPD_Skims::radius, and sipmMap_.

Referenced by HGCHEbackDigitizer::runRealisticDigitizer().

◆ scaleByTileArea()

double HGCalSciNoiseMap::scaleByTileArea ( const HGCScintillatorDetId cellId,
const double  radius 
)

returns the signal scaling and the noise

Definition at line 61 of file HGCalSciNoiseMap.cc.

61  {
62  double edge;
63  if (cellId.type() == 0) {
64  constexpr double factor = 2 * M_PI * 1. / 360.;
65  edge = radius * factor; //1 degree
66  } else {
67  constexpr double factor = 2 * M_PI * 1. / 288.;
68  edge = radius * factor; //1.25 degrees
69  }
70 
71  double scaleFactor = refEdge_ / edge; //assume reference 3cm of edge
72 
73  return scaleFactor;
74 }

References DQMScaleToClient_cfi::factor, M_PI, CosmicsPD_Skims::radius, refEdge_, multiplicitycorr_cfi::scaleFactor, and HGCScintillatorDetId::type().

Referenced by HGCHEbackDigitizer::runRealisticDigitizer().

◆ setSipmMap()

void HGCalSciNoiseMap::setSipmMap ( const std::string &  fullpath)

Member Data Documentation

◆ refEdge_

const double HGCalSciNoiseMap::refEdge_
private

Definition at line 31 of file HGCalSciNoiseMap.h.

Referenced by scaleByTileArea().

◆ sipmMap_

std::unordered_map<int, float> HGCalSciNoiseMap::sipmMap_
private

Definition at line 34 of file HGCalSciNoiseMap.h.

Referenced by scaleBySipmArea(), and setSipmMap().

HGCalSciNoiseMap::refEdge_
const double refEdge_
Definition: HGCalSciNoiseMap.h:31
reco_skim_cfg_mod.fullpath
fullpath
Definition: reco_skim_cfg_mod.py:202
HGCalSciNoiseMap::sipmMap_
std::unordered_map< int, float > sipmMap_
Definition: HGCalSciNoiseMap.h:34
HGCalRadiationMap::getDoseValue
double getDoseValue(const int, const int, const double, bool logVal=false)
Definition: HGCalRadiationMap.cc:28
personalPlayback.fp
fp
Definition: personalPlayback.py:523
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
edm::FileInPath
Definition: FileInPath.h:64
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCScintillatorDetId::type
int type() const
get/set the type
Definition: HGCScintillatorDetId.h:43
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
gpuVertexFinder::noise
__shared__ int noise
Definition: gpuFitVertices.h:50
HGCalSciNoiseMap::readSipmPars
std::unordered_map< int, float > readSipmPars(const std::string &)
Definition: HGCalSciNoiseMap.cc:12
HGCalRadiationMap::getFluenceValue
double getFluenceValue(const int, const int, const double, bool logVal=false)
Definition: HGCalRadiationMap.cc:43
DetId::HGCalHSc
Definition: DetId.h:34
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:245
multiplicitycorr_cfi.scaleFactor
scaleFactor
Definition: multiplicitycorr_cfi.py:7
HGCalRadiationMap::getDoseMap
const doseParametersMap & getDoseMap()
Definition: HGCalRadiationMap.h:40
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
timingPdfMaker.infile
infile
Definition: timingPdfMaker.py:350
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
mps_fire.result
result
Definition: mps_fire.py:311
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
mps_splice.line
line
Definition: mps_splice.py:76