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 ( const std::string &  name,
const HcalDDDSimConstants hcons,
const HcalSimulationParameters hps,
edm::ParameterSet const &  p 
)

Definition at line 16 of file HFFibre.cc.

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, radius, HcalSimulationParameters::shortFiberLength_, and shortFL.

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

Member Function Documentation

double HFFibre::attLength ( double  lambda)

Definition at line 87 of file HFFibre.cc.

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

87  {
88  int i = int(nBinAtt * (lambda - lambLim[0]) / (lambLim[1] - lambLim[0]));
89 
90  int j = i;
91  if (i >= nBinAtt)
92  j = nBinAtt - 1;
93  else if (i < 0)
94  j = 0;
95  double att = attL[j];
96 #ifdef EDM_ML_DEBUG
97  edm::LogVerbatim("HFShower") << "HFFibre::attLength for Lambda " << lambda << " index " << i << " " << j
98  << " Att. Length " << att;
99 #endif
100  return att;
101 }
double lambLim[2]
Definition: HFFibre.h:39
int nBinAtt
Definition: HFFibre.h:38
std::vector< double > attL
Definition: HFFibre.h:37
double HFFibre::tShift ( const G4ThreeVector &  point,
int  depth,
int  fromEndAbs = 0 
)

Definition at line 103 of file HFFibre.cc.

References cFibre, ntuplemaker::time, and zShift().

103  {
104  double zFibre = zShift(point, depth, fromEndAbs);
105  double time = zFibre / cFibre;
106 #ifdef EDM_ML_DEBUG
107  edm::LogVerbatim("HFShower") << "HFFibre::tShift for point " << point << " ( depth = " << depth
108  << ", traversed length = " << zFibre / CLHEP::cm << " cm) = " << time / CLHEP::ns
109  << " ns";
110 #endif
111  return time;
112 }
double zShift(const G4ThreeVector &point, int depth, int fromEndAbs=0)
Definition: HFFibre.cc:114
double cFibre
Definition: HFFibre.h:34
*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
double HFFibre::zShift ( const G4ThreeVector &  point,
int  depth,
int  fromEndAbs = 0 
)

Definition at line 114 of file HFFibre.cc.

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

Referenced by tShift().

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

Member Data Documentation

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

Definition at line 37 of file HFFibre.h.

Referenced by attLength(), and HFFibre().

double HFFibre::cFibre
private

Definition at line 34 of file HFFibre.h.

Referenced by HFFibre(), and tShift().

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

Definition at line 35 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

const HcalDDDSimConstants* HFFibre::hcalConstant_
private

Definition at line 32 of file HFFibre.h.

Referenced by HFFibre().

const HcalSimulationParameters* HFFibre::hcalsimpar_
private

Definition at line 33 of file HFFibre.h.

Referenced by HFFibre().

double HFFibre::lambLim[2]
private

Definition at line 39 of file HFFibre.h.

Referenced by attLength(), and HFFibre().

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

Definition at line 36 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

int HFFibre::nBinAtt
private

Definition at line 38 of file HFFibre.h.

Referenced by attLength(), and HFFibre().

int HFFibre::nBinR
private

Definition at line 38 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

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

Definition at line 35 of file HFFibre.h.

Referenced by HFFibre(), and zShift().

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

Definition at line 36 of file HFFibre.h.

Referenced by HFFibre(), and zShift().