EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MediaLayer.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MediaLayer.cxx
1 //
2 // AYK (ayk@bnl.gov), shaped up in Nov'2015;
3 //
4 // Single media layer definition;
5 //
6 
7 #include <htclib.h>
8 
9 #include <MediaLayer.h>
10 
11 // ---------------------------------------------------------------------------------------
12 
13 MediaLayer::MediaLayer(TGeoMaterial *material, double z0): mMaterial(material), mZ0(z0)
14 {
15  mThickness = 0.0;
16 
17  unsigned nmat = material->GetNelements();
18  float omc, chc, af[nmat], zf[nmat], wf[nmat];
19 
20  for(unsigned el=0; el<nmat; el++) {
21  double ad, zd, wd;
22 
23  material->GetElementProp(ad, zd, wd, el);
24  af[el] = ad; zf[el] = zd; wf[el] = wd;
25  } //for el
26 
27  G3MOLI(af, zf, wf, nmat, material->GetDensity(), omc, chc);
28 
29  // Prefer to store double value;
30  mMoliereChc = chc;
31 } // MediaLayer::MediaLayer()
32 
33 // ---------------------------------------------------------------------------------------