CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
HGCalRadiationMap Class Reference

parses a txt file with dose/fluence parameters and provides functions for noise, etc. More...

#include <HGCalRadiationMap.h>

Inheritance diagram for HGCalRadiationMap:
HGCalSciNoiseMap HGCalSiNoiseMap

Classes

struct  DoseParameters
 

Public Types

typedef std::map< std::pair< int, int >, DoseParametersdoseParametersMap
 

Public Member Functions

const unsigned int & algo ()
 
const HGCalDDDConstantsddd ()
 
const HGCalGeometrygeom ()
 
const doseParametersMapgetDoseMap ()
 
double getDoseValue (const int, const int, const radiiVec &, bool logVal=false)
 
double getFluenceValue (const int, const int, const radiiVec &, bool logVal=false)
 
 HGCalRadiationMap ()
 
void setDoseMap (const std::string &, const unsigned int)
 
void setGeometry (const CaloSubdetectorGeometry *)
 
const HGCalTopologytopo ()
 
 ~HGCalRadiationMap ()
 

Private Member Functions

doseParametersMap readDosePars (const std::string &)
 

Private Attributes

unsigned int algo_
 
doseParametersMap doseMap_
 
const double grayToKrad_ = 0.1
 
const HGCalDDDConstantshgcalDDD_
 
const HGCalGeometryhgcalGeom_
 
const HGCalTopologyhgcalTopology_
 

Detailed Description

parses a txt file with dose/fluence parameters and provides functions for noise, etc.

Definition at line 16 of file HGCalRadiationMap.h.

Member Typedef Documentation

◆ doseParametersMap

typedef std::map<std::pair<int, int>, DoseParameters> HGCalRadiationMap::doseParametersMap

Definition at line 24 of file HGCalRadiationMap.h.

Constructor & Destructor Documentation

◆ HGCalRadiationMap()

HGCalRadiationMap::HGCalRadiationMap ( )
inline

Definition at line 23 of file HGCalRadiationMap.h.

23 {};

◆ ~HGCalRadiationMap()

HGCalRadiationMap::~HGCalRadiationMap ( )
inline

Definition at line 24 of file HGCalRadiationMap.h.

24 {};

Member Function Documentation

◆ algo()

const unsigned int& HGCalRadiationMap::algo ( )
inline

Definition at line 34 of file HGCalRadiationMap.h.

34 { return algo_; }

References algo_.

Referenced by setDoseMap(), and HGCalSiNoiseMap::setDoseMap().

◆ ddd()

const HGCalDDDConstants* HGCalRadiationMap::ddd ( )
inline

Definition at line 37 of file HGCalRadiationMap.h.

37 { return hgcalDDD_; }

References hgcalDDD_.

Referenced by HGCalSiNoiseMap::getSiCellOpCharacteristics().

◆ geom()

const HGCalGeometry* HGCalRadiationMap::geom ( )
inline

Definition at line 35 of file HGCalRadiationMap.h.

35 { return hgcalGeom_; }

References hgcalGeom_.

Referenced by HGCalSciNoiseMap::computeRadius(), and setGeometry().

◆ getDoseMap()

const doseParametersMap& HGCalRadiationMap::getDoseMap ( )
inline

Definition at line 39 of file HGCalRadiationMap.h.

39 { return doseMap_; }

References doseMap_.

Referenced by HGCalSiNoiseMap::getSiCellOpCharacteristics(), and HGCalSciNoiseMap::scaleByDose().

◆ getDoseValue()

double HGCalRadiationMap::getDoseValue ( const int  subdet,
const int  layer,
const radiiVec radius,
bool  logVal = false 
)

Definition at line 19 of file HGCalRadiationMap.cc.

19  {
20  std::pair<int, int> key(subdet, layer);
21  double cellDoseLog10 = doseMap_[key].a_ + doseMap_[key].b_ * radius[4] + doseMap_[key].c_ * radius[5] +
22  doseMap_[key].d_ * radius[6] + doseMap_[key].e_ * radius[7];
23  return logVal ? cellDoseLog10 * M_LN10 + log(grayToKrad_) : std::pow(10, cellDoseLog10) * grayToKrad_;
24 }

References doseMap_, grayToKrad_, crabWrapper::key, dqm-mbProfile::log, funct::pow(), and CosmicsPD_Skims::radius.

Referenced by HGCalSciNoiseMap::scaleByDose().

◆ getFluenceValue()

double HGCalRadiationMap::getFluenceValue ( const int  subdet,
const int  layer,
const radiiVec radius,
bool  logVal = false 
)

Definition at line 27 of file HGCalRadiationMap.cc.

27  {
28  std::pair<int, int> key(subdet, layer);
29  double cellFluenceLog10 = doseMap_[key].f_ + doseMap_[key].g_ * radius[0] + doseMap_[key].h_ * radius[1] +
30  doseMap_[key].i_ * radius[2] + doseMap_[key].j_ * radius[3];
31  return logVal ? cellFluenceLog10 * M_LN10 : std::pow(10, cellFluenceLog10);
32 }

References doseMap_, crabWrapper::key, funct::pow(), and CosmicsPD_Skims::radius.

Referenced by HGCalSiNoiseMap::getSiCellOpCharacteristics(), and HGCalSciNoiseMap::scaleByDose().

◆ readDosePars()

std::map< std::pair< int, int >, HGCalRadiationMap::DoseParameters > HGCalRadiationMap::readDosePars ( const std::string &  fullpath)
private

Definition at line 35 of file HGCalRadiationMap.cc.

36  {
38 
39  //no dose file means no aging
40  if (fullpath.empty())
41  return result;
42 
44  std::ifstream infile(fp.fullPath());
45  if (!infile.is_open()) {
46  throw cms::Exception("FileNotFound") << "Unable to open '" << fullpath << "'" << std::endl;
47  }
49  while (getline(infile, line)) {
50  int subdet;
51  int layer;
52  DoseParameters dosePars;
53 
54  //space-separated
55  std::stringstream linestream(line);
56  linestream >> subdet >> layer >> dosePars.a_ >> dosePars.b_ >> dosePars.c_ >> dosePars.d_ >> dosePars.e_ >>
57  dosePars.f_ >> dosePars.g_ >> dosePars.h_ >> dosePars.i_ >> dosePars.j_;
58 
59  std::pair<int, int> key(subdet, layer);
60  result[key] = dosePars;
61  }
62  return result;
63 }

References HGCalRadiationMap::DoseParameters::a_, HGCalRadiationMap::DoseParameters::b_, HGCalRadiationMap::DoseParameters::c_, HGCalRadiationMap::DoseParameters::d_, HGCalRadiationMap::DoseParameters::e_, Exception, HGCalRadiationMap::DoseParameters::f_, personalPlayback::fp, reco_skim_cfg_mod::fullpath, HGCalRadiationMap::DoseParameters::g_, HGCalRadiationMap::DoseParameters::h_, HGCalRadiationMap::DoseParameters::i_, timingPdfMaker::infile, HGCalRadiationMap::DoseParameters::j_, crabWrapper::key, mps_splice::line, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by setDoseMap().

◆ setDoseMap()

void HGCalRadiationMap::setDoseMap ( const std::string &  fullpath,
const unsigned int  algo 
)

◆ setGeometry()

void HGCalRadiationMap::setGeometry ( const CaloSubdetectorGeometry geom)

Definition at line 12 of file HGCalRadiationMap.cc.

12  {
13  hgcalGeom_ = static_cast<const HGCalGeometry*>(geom);
16 }

References HGCalTopology::dddConstants(), geom(), hgcalDDD_, hgcalGeom_, hgcalTopology_, and HGCalGeometry::topology().

Referenced by HGCHEbackDigitizer::runRealisticDigitizer().

◆ topo()

const HGCalTopology* HGCalRadiationMap::topo ( )
inline

Definition at line 36 of file HGCalRadiationMap.h.

36 { return hgcalTopology_; }

References hgcalTopology_.

Member Data Documentation

◆ algo_

unsigned int HGCalRadiationMap::algo_
private

Definition at line 44 of file HGCalRadiationMap.h.

Referenced by algo(), and setDoseMap().

◆ doseMap_

doseParametersMap HGCalRadiationMap::doseMap_
private

Definition at line 48 of file HGCalRadiationMap.h.

Referenced by getDoseMap(), getDoseValue(), getFluenceValue(), and setDoseMap().

◆ grayToKrad_

const double HGCalRadiationMap::grayToKrad_ = 0.1
private

Definition at line 50 of file HGCalRadiationMap.h.

Referenced by getDoseValue().

◆ hgcalDDD_

const HGCalDDDConstants* HGCalRadiationMap::hgcalDDD_
private

Definition at line 47 of file HGCalRadiationMap.h.

Referenced by ddd(), and setGeometry().

◆ hgcalGeom_

const HGCalGeometry* HGCalRadiationMap::hgcalGeom_
private

Definition at line 45 of file HGCalRadiationMap.h.

Referenced by geom(), and setGeometry().

◆ hgcalTopology_

const HGCalTopology* HGCalRadiationMap::hgcalTopology_
private

Definition at line 46 of file HGCalRadiationMap.h.

Referenced by setGeometry(), and topo().

HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalRadiationMap::readDosePars
doseParametersMap readDosePars(const std::string &)
Definition: HGCalRadiationMap.cc:35
HGCalRadiationMap::doseMap_
doseParametersMap doseMap_
Definition: HGCalRadiationMap.h:48
reco_skim_cfg_mod.fullpath
fullpath
Definition: reco_skim_cfg_mod.py:202
HGCalRadiationMap::doseParametersMap
std::map< std::pair< int, int >, DoseParameters > doseParametersMap
Definition: HGCalRadiationMap.h:24
HGCalRadiationMap::algo
const unsigned int & algo()
Definition: HGCalRadiationMap.h:34
HGCalRadiationMap::geom
const HGCalGeometry * geom()
Definition: HGCalRadiationMap.h:35
HGCalRadiationMap::hgcalGeom_
const HGCalGeometry * hgcalGeom_
Definition: HGCalRadiationMap.h:45
personalPlayback.fp
fp
Definition: personalPlayback.py:523
HGCalRadiationMap::hgcalDDD_
const HGCalDDDConstants * hgcalDDD_
Definition: HGCalRadiationMap.h:47
edm::FileInPath
Definition: FileInPath.h:64
HGCalGeometry::topology
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalRadiationMap::grayToKrad_
const double grayToKrad_
Definition: HGCalRadiationMap.h:50
std
Definition: JetResolutionObject.h:76
HGCalRadiationMap::algo_
unsigned int algo_
Definition: HGCalRadiationMap.h:44
Exception
Definition: hltDiff.cc:246
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
HGCalRadiationMap::hgcalTopology_
const HGCalTopology * hgcalTopology_
Definition: HGCalRadiationMap.h:46
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
timingPdfMaker.infile
infile
Definition: timingPdfMaker.py:350
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
mps_fire.result
result
Definition: mps_fire.py:303
mps_splice.line
line
Definition: mps_splice.py:76
crabWrapper.key
key
Definition: crabWrapper.py:19