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< T > HGCalSiNoiseMap< HFNoseDetId > HGCalSiNoiseMap< HGCSiliconDetId >

Classes

struct  DoseParameters
 

Public Types

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

Public Member Functions

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

doseParametersMap readDosePars (const std::string &)
 

Private Attributes

unsigned int algo_
 
doseParametersMap doseMap_
 
double fluenceSFlog10_
 
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 14 of file HGCalRadiationMap.h.

Member Typedef Documentation

◆ doseParametersMap

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

Definition at line 23 of file HGCalRadiationMap.h.

Constructor & Destructor Documentation

◆ HGCalRadiationMap()

HGCalRadiationMap::HGCalRadiationMap ( )

Definition at line 6 of file HGCalRadiationMap.cc.

6 : fluenceSFlog10_(0.) {}

◆ ~HGCalRadiationMap()

HGCalRadiationMap::~HGCalRadiationMap ( )
inline

Definition at line 23 of file HGCalRadiationMap.h.

23 {};

Member Function Documentation

◆ algo()

const unsigned int& HGCalRadiationMap::algo ( )
inline

Definition at line 35 of file HGCalRadiationMap.h.

35 { return algo_; }

References algo_.

Referenced by setDoseMap().

◆ computeRadius()

double HGCalRadiationMap::computeRadius ( const HGCScintillatorDetId cellId)

◆ ddd()

const HGCalDDDConstants* HGCalRadiationMap::ddd ( )
inline

Definition at line 38 of file HGCalRadiationMap.h.

38 { return hgcalDDD_; }

References hgcalDDD_.

◆ geom()

const HGCalGeometry* HGCalRadiationMap::geom ( )
inline

Definition at line 36 of file HGCalRadiationMap.h.

36 { return hgcalGeom_; }

References hgcalGeom_.

Referenced by computeRadius(), and setGeometry().

◆ getDoseMap()

const doseParametersMap& HGCalRadiationMap::getDoseMap ( )
inline

Definition at line 40 of file HGCalRadiationMap.h.

40 { return doseMap_; }

References doseMap_.

Referenced by HGCalSciNoiseMap::scaleByDose().

◆ getDoseValue()

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

Definition at line 28 of file HGCalRadiationMap.cc.

28  {
29  std::pair<int, int> key(subdet, layer);
30 
31  double r(radius - doseMap_[key].doff_);
32  double r2(r * r);
33  double r3(r2 * r);
34  double r4(r3 * r);
35 
36  double cellDoseLog10 =
37  doseMap_[key].a_ + doseMap_[key].b_ * r + doseMap_[key].c_ * r2 + doseMap_[key].d_ * r3 + doseMap_[key].e_ * r4;
38 
39  return logVal ? cellDoseLog10 * M_LN10 + log(grayToKrad_) : std::pow(10, cellDoseLog10) * grayToKrad_;
40 }

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

Referenced by HGCalSciNoiseMap::scaleByDose().

◆ getFluenceValue()

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

Definition at line 43 of file HGCalRadiationMap.cc.

43  {
44  std::pair<int, int> key(subdet, layer);
45 
46  double r(radius - doseMap_[key].foff_);
47  double r2(r * r);
48  double r3(r2 * r);
49  double r4(r3 * r);
50 
51  double cellFluenceLog10 =
52  doseMap_[key].f_ + doseMap_[key].g_ * r + doseMap_[key].h_ * r2 + doseMap_[key].i_ * r3 + doseMap_[key].j_ * r4;
53  cellFluenceLog10 += fluenceSFlog10_;
54 
55  return logVal ? cellFluenceLog10 * M_LN10 : std::pow(10, cellFluenceLog10);
56 }

References doseMap_, fluenceSFlog10_, crabWrapper::key, funct::pow(), alignCSCRings::r, diffTwoXMLs::r2, and CosmicsPD_Skims::radius.

Referenced by HGCalSciNoiseMap::scaleByDose().

◆ readDosePars()

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

Definition at line 59 of file HGCalRadiationMap.cc.

60  {
62 
63  //no dose file means no aging
64  if (fullpath.empty())
65  return result;
66 
68  std::ifstream infile(fp.fullPath());
69  if (!infile.is_open()) {
70  throw cms::Exception("FileNotFound") << "Unable to open '" << fullpath << "'" << std::endl;
71  }
73  while (getline(infile, line)) {
74  int subdet;
75  int layer;
76  DoseParameters dosePars;
77 
78  //space-separated
79  std::stringstream linestream(line);
80  linestream >> subdet >> layer >> dosePars.a_ >> dosePars.b_ >> dosePars.c_ >> dosePars.d_ >> dosePars.e_ >>
81  dosePars.doff_ >> dosePars.f_ >> dosePars.g_ >> dosePars.h_ >> dosePars.i_ >> dosePars.j_ >> dosePars.foff_;
82 
83  std::pair<int, int> key(subdet, layer);
84  result[key] = dosePars;
85  }
86  return result;
87 }

References HGCalRadiationMap::DoseParameters::a_, HGCalRadiationMap::DoseParameters::b_, HGCalRadiationMap::DoseParameters::c_, HGCalRadiationMap::DoseParameters::d_, HGCalRadiationMap::DoseParameters::doff_, HGCalRadiationMap::DoseParameters::e_, Exception, HGCalRadiationMap::DoseParameters::f_, HGCalRadiationMap::DoseParameters::foff_, 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 
)

Definition at line 9 of file HGCalRadiationMap.cc.

9  {
11  algo_ = algo;
12 }

References algo(), algo_, doseMap_, reco_skim_cfg_mod::fullpath, and readDosePars().

Referenced by HGCHEbackDigitizer::HGCHEbackDigitizer().

◆ setFluenceScaleFactor()

void HGCalRadiationMap::setFluenceScaleFactor ( double  val)
inline

◆ setGeometry()

void HGCalRadiationMap::setGeometry ( const CaloSubdetectorGeometry geom)

Definition at line 15 of file HGCalRadiationMap.cc.

15  {
16  hgcalGeom_ = static_cast<const HGCalGeometry*>(geom);
19 }

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

Referenced by HGCHEbackDigitizer::runRealisticDigitizer().

◆ topo()

const HGCalTopology* HGCalRadiationMap::topo ( )
inline

Definition at line 37 of file HGCalRadiationMap.h.

37 { return hgcalTopology_; }

References hgcalTopology_.

Member Data Documentation

◆ algo_

unsigned int HGCalRadiationMap::algo_
private

Definition at line 46 of file HGCalRadiationMap.h.

Referenced by algo(), and setDoseMap().

◆ doseMap_

doseParametersMap HGCalRadiationMap::doseMap_
private

Definition at line 50 of file HGCalRadiationMap.h.

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

◆ fluenceSFlog10_

double HGCalRadiationMap::fluenceSFlog10_
private

Definition at line 53 of file HGCalRadiationMap.h.

Referenced by getFluenceValue(), and setFluenceScaleFactor().

◆ grayToKrad_

const double HGCalRadiationMap::grayToKrad_ = 0.1
private

Definition at line 52 of file HGCalRadiationMap.h.

Referenced by getDoseValue().

◆ hgcalDDD_

const HGCalDDDConstants* HGCalRadiationMap::hgcalDDD_
private

Definition at line 49 of file HGCalRadiationMap.h.

Referenced by ddd(), and setGeometry().

◆ hgcalGeom_

const HGCalGeometry* HGCalRadiationMap::hgcalGeom_
private

Definition at line 47 of file HGCalRadiationMap.h.

Referenced by geom(), and setGeometry().

◆ hgcalTopology_

const HGCalTopology* HGCalRadiationMap::hgcalTopology_
private

Definition at line 48 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:59
HGCalRadiationMap::doseMap_
doseParametersMap doseMap_
Definition: HGCalRadiationMap.h:50
reco_skim_cfg_mod.fullpath
fullpath
Definition: reco_skim_cfg_mod.py:202
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
HGCalRadiationMap::doseParametersMap
std::map< std::pair< int, int >, DoseParameters > doseParametersMap
Definition: HGCalRadiationMap.h:23
HGCalRadiationMap::algo
const unsigned int & algo()
Definition: HGCalRadiationMap.h:35
HGCalRadiationMap::geom
const HGCalGeometry * geom()
Definition: HGCalRadiationMap.h:36
HGCalRadiationMap::hgcalGeom_
const HGCalGeometry * hgcalGeom_
Definition: HGCalRadiationMap.h:47
personalPlayback.fp
fp
Definition: personalPlayback.py:523
HGCalRadiationMap::hgcalDDD_
const HGCalDDDConstants * hgcalDDD_
Definition: HGCalRadiationMap.h:49
edm::FileInPath
Definition: FileInPath.h:64
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HGCalRadiationMap::fluenceSFlog10_
double fluenceSFlog10_
Definition: HGCalRadiationMap.h:53
Point3DBase< float, GlobalTag >
HGCalGeometry::topology
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:111
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalRadiationMap::grayToKrad_
const double grayToKrad_
Definition: HGCalRadiationMap.h:52
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
HGCalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HGCalGeometry.cc:191
alignCSCRings.r
r
Definition: alignCSCRings.py:93
heppy_batch.val
val
Definition: heppy_batch.py:351
std
Definition: JetResolutionObject.h:76
HGCalRadiationMap::algo_
unsigned int algo_
Definition: HGCalRadiationMap.h:46
Exception
Definition: hltDiff.cc:246
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
HGCalRadiationMap::hgcalTopology_
const HGCalTopology * hgcalTopology_
Definition: HGCalRadiationMap.h:48
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:29
mps_fire.result
result
Definition: mps_fire.py:311
mps_splice.line
line
Definition: mps_splice.py:76
crabWrapper.key
key
Definition: crabWrapper.py:19