CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HFFibre Class Reference

#include <HFFibre.h>

Public Member Functions

double attLength (double lambda)
 
 HFFibre (const std::string &name, const HcalDDDSimConstants *hcons, const HcalSimulationParameters *hps, edm::ParameterSet const &p)
 
double tShift (const G4ThreeVector &point, int depth, int fromEndAbs=0)
 
double zShift (const G4ThreeVector &point, int depth, int fromEndAbs=0)
 
 ~HFFibre ()=default
 

Private Attributes

std::vector< double > attL
 
double cFibre
 
std::vector< double > gpar
 
const HcalDDDSimConstantshcalConstant_
 
const HcalSimulationParametershcalsimpar_
 
double lambLim [2]
 
std::vector< double > longFL
 
int nBinAtt
 
int nBinR
 
std::vector< double > radius
 
std::vector< double > shortFL
 

Detailed Description

Definition at line 18 of file HFFibre.h.

Constructor & Destructor Documentation

◆ HFFibre()

HFFibre::HFFibre ( const std::string &  name,
const HcalDDDSimConstants hcons,
const HcalSimulationParameters hps,
edm::ParameterSet const &  p 
)

Definition at line 16 of file HFFibre.cc.

20  : hcalConstant_(hcons), hcalsimpar_(hps) {
21  edm::ParameterSet m_HF =
22  (p.getParameter<edm::ParameterSet>("HFShower")).getParameter<edm::ParameterSet>("HFShowerBlock");
23  cFibre = c_light * (m_HF.getParameter<double>("CFibre"));
24 
25  edm::LogVerbatim("HFShower") << "HFFibre:: Speed of light in fibre " << cFibre << " m/ns";
26 
27  // Attenuation length
29  nBinAtt = static_cast<int>(attL.size());
30 #ifdef EDM_ML_DEBUG
31  std::stringstream ss1;
32  for (int it = 0; it < nBinAtt; it++) {
33  if (it / 10 * 10 == it) {
34  ss1 << "\n";
35  }
36  ss1 << " " << attL[it] * CLHEP::cm;
37  }
38  edm::LogVerbatim("HFShower") << "HFFibre: " << nBinAtt << " attL(1/cm): " << ss1.str();
39 #endif
40  // Limits on Lambda
41  std::vector<int> nvec = hcalsimpar_->lambdaLimits_;
42  lambLim[0] = nvec[0];
43  lambLim[1] = nvec[1];
44 #ifdef EDM_ML_DEBUG
45  edm::LogVerbatim("HFShower") << "HFFibre: Limits on lambda " << lambLim[0] << " and " << lambLim[1];
46 #endif
47  // Fibre Lengths
49 #ifdef EDM_ML_DEBUG
50  std::stringstream ss2;
51  for (unsigned int it = 0; it < longFL.size(); it++) {
52  if (it / 10 * 10 == it) {
53  ss2 << "\n";
54  }
55  ss2 << " " << longFL[it] / CLHEP::cm;
56  }
57  edm::LogVerbatim("HFShower") << "HFFibre: " << longFL.size() << " Long Fibre Length(cm):" << ss2.str();
58 #endif
60 #ifdef EDM_ML_DEBUG
61  std::stringstream ss3;
62  for (unsigned int it = 0; it < shortFL.size(); it++) {
63  if (it / 10 * 10 == it) {
64  ss3 << "\n";
65  }
66  ss3 << " " << shortFL[it] / CLHEP::cm;
67  }
68  edm::LogVerbatim("HFShower") << "HFFibre: " << shortFL.size() << " Short Fibre Length(cm):" << ss3.str();
69 #endif
70 
71  // Now geometry parameters
74 
75  nBinR = static_cast<int>(radius.size());
76 #ifdef EDM_ML_DEBUG
77  std::stringstream sss;
78  for (int i = 0; i < nBinR; ++i) {
79  if (i / 10 * 10 == i) {
80  sss << "\n";
81  }
82  sss << " " << radius[i] / CLHEP::cm;
83  }
84  edm::LogVerbatim("HFShower") << "HFFibre: " << radius.size() << " rTable(cm):" << sss.str();
85 #endif
86 }

References HcalSimulationParameters::attenuationLength_, attL, cFibre, HcalDDDSimConstants::getGparHF(), edm::ParameterSet::getParameter(), HcalDDDSimConstants::getRTableHF(), gpar, hcalConstant_, hcalsimpar_, mps_fire::i, HcalSimulationParameters::lambdaLimits_, lambLim, HcalSimulationParameters::longFiberLength_, longFL, nBinAtt, nBinR, AlCaHLTBitMon_ParallelJobs::p, radius, HcalSimulationParameters::shortFiberLength_, and shortFL.

◆ ~HFFibre()

HFFibre::~HFFibre ( )
default

Member Function Documentation

◆ attLength()

double HFFibre::attLength ( double  lambda)

Definition at line 88 of file HFFibre.cc.

88  {
89  int i = int(nBinAtt * (lambda - lambLim[0]) / (lambLim[1] - lambLim[0]));
90 
91  int j = i;
92  if (i >= nBinAtt)
93  j = nBinAtt - 1;
94  else if (i < 0)
95  j = 0;
96  double att = attL[j];
97 #ifdef EDM_ML_DEBUG
98  edm::LogVerbatim("HFShower") << "HFFibre::attLength for Lambda " << lambda << " index " << i << " " << j
99  << " Att. Length " << att;
100 #endif
101  return att;
102 }

References attL, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, lambLim, and nBinAtt.

◆ tShift()

double HFFibre::tShift ( const G4ThreeVector &  point,
int  depth,
int  fromEndAbs = 0 
)

Definition at line 104 of file HFFibre.cc.

104  {
105  double zFibre = zShift(point, depth, fromEndAbs);
106  double time = zFibre / cFibre;
107 #ifdef EDM_ML_DEBUG
108  edm::LogVerbatim("HFShower") << "HFFibre::tShift for point " << point << " ( depth = " << depth
109  << ", traversed length = " << zFibre / CLHEP::cm << " cm) = " << time / CLHEP::ns
110  << " ns";
111 #endif
112  return time;
113 }

References cFibre, LEDCalibrationChannels::depth, point, protons_cff::time, and zShift().

◆ zShift()

double HFFibre::zShift ( const G4ThreeVector &  point,
int  depth,
int  fromEndAbs = 0 
)

Definition at line 115 of file HFFibre.cc.

115  { // point is z-local
116 
117  double zFibre = 0;
118  double hR = sqrt((point.x()) * (point.x()) + (point.y()) * (point.y()));
119  int ieta = 0;
120  double length = 250 * CLHEP::cm;
121  if (fromEndAbs < 0) {
122  zFibre = 0.5 * gpar[1] - point.z(); // Never, as fromEndAbs=0 (?)
123  } else {
124  // Defines the Radius bin by radial subdivision
125  for (int i = nBinR - 1; i > 0; --i)
126  if (hR < radius[i])
127  ieta = nBinR - i - 1;
128  // define the length of the fibre
129  if (depth == 2) {
130  if ((int)(shortFL.size()) > ieta)
131  length = shortFL[ieta];
132  } else {
133  if ((int)(longFL.size()) > ieta)
134  length = longFL[ieta];
135  }
136  zFibre = length;
137  if (fromEndAbs > 0) {
138  zFibre -= gpar[1]; // Never, as fromEndAbs=0 (M.K. ?)
139  } else {
140  double zz = 0.5 * gpar[1] + point.z();
141  zFibre -= zz;
142  }
143  if (depth == 2)
144  zFibre += gpar[0]; // here zFibre is reduced for Short
145  }
146 
147 #ifdef EDM_ML_DEBUG
148  edm::LogVerbatim("HFShower") << "HFFibre::zShift for point " << point << " (R = " << hR / CLHEP::cm
149  << " cm, Index = " << ieta << ", depth = " << depth
150  << ", Fibre Length = " << length / CLHEP::cm << " cm = " << zFibre / CLHEP::cm << " cm)";
151 #endif
152  return zFibre;
153 }

References LEDCalibrationChannels::depth, gpar, mps_fire::i, LEDCalibrationChannels::ieta, longFL, nBinR, point, radius, shortFL, mathSSE::sqrt(), and geometryCSVtoXML::zz.

Referenced by tShift().

Member Data Documentation

◆ attL

std::vector<double> HFFibre::attL
private

Definition at line 37 of file HFFibre.h.

Referenced by attLength(), and HFFibre().

◆ cFibre

double HFFibre::cFibre
private

Definition at line 34 of file HFFibre.h.

Referenced by HFFibre(), and tShift().

◆ gpar

std::vector<double> HFFibre::gpar
private

Definition at line 35 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

◆ hcalConstant_

const HcalDDDSimConstants* HFFibre::hcalConstant_
private

Definition at line 32 of file HFFibre.h.

Referenced by HFFibre().

◆ hcalsimpar_

const HcalSimulationParameters* HFFibre::hcalsimpar_
private

Definition at line 33 of file HFFibre.h.

Referenced by HFFibre().

◆ lambLim

double HFFibre::lambLim[2]
private

Definition at line 39 of file HFFibre.h.

Referenced by attLength(), and HFFibre().

◆ longFL

std::vector<double> HFFibre::longFL
private

Definition at line 36 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

◆ nBinAtt

int HFFibre::nBinAtt
private

Definition at line 38 of file HFFibre.h.

Referenced by attLength(), and HFFibre().

◆ nBinR

int HFFibre::nBinR
private

Definition at line 38 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

◆ radius

std::vector<double> HFFibre::radius
private

Definition at line 35 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

◆ shortFL

std::vector<double> HFFibre::shortFL
private

Definition at line 36 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

HFFibre::shortFL
std::vector< double > shortFL
Definition: HFFibre.h:36
mps_fire.i
i
Definition: mps_fire.py:428
HcalSimulationParameters::longFiberLength_
std::vector< double > longFiberLength_
Definition: HcalSimulationParameters.h:14
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
HFFibre::gpar
std::vector< double > gpar
Definition: HFFibre.h:35
HcalDDDSimConstants::getRTableHF
const std::vector< double > & getRTableHF() const
Definition: HcalDDDSimConstants.h:61
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
protons_cff.time
time
Definition: protons_cff.py:39
HcalDDDSimConstants::getGparHF
const std::vector< double > & getGparHF() const
Definition: HcalDDDSimConstants.h:45
HcalSimulationParameters::lambdaLimits_
std::vector< int > lambdaLimits_
Definition: HcalSimulationParameters.h:12
HFFibre::attL
std::vector< double > attL
Definition: HFFibre.h:37
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HFFibre::hcalConstant_
const HcalDDDSimConstants * hcalConstant_
Definition: HFFibre.h:32
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HFFibre::nBinR
int nBinR
Definition: HFFibre.h:38
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
edm::ParameterSet
Definition: ParameterSet.h:47
createfilelist.int
int
Definition: createfilelist.py:10
HFFibre::longFL
std::vector< double > longFL
Definition: HFFibre.h:36
HcalSimulationParameters::shortFiberLength_
std::vector< double > shortFiberLength_
Definition: HcalSimulationParameters.h:13
HFFibre::zShift
double zShift(const G4ThreeVector &point, int depth, int fromEndAbs=0)
Definition: HFFibre.cc:115
HFFibre::radius
std::vector< double > radius
Definition: HFFibre.h:35
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HFFibre::hcalsimpar_
const HcalSimulationParameters * hcalsimpar_
Definition: HFFibre.h:33
HFFibre::cFibre
double cFibre
Definition: HFFibre.h:34
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HFFibre::nBinAtt
int nBinAtt
Definition: HFFibre.h:38
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
HFFibre::lambLim
double lambLim[2]
Definition: HFFibre.h:39
HcalSimulationParameters::attenuationLength_
std::vector< double > attenuationLength_
Definition: HcalSimulationParameters.h:11