ATLAS Offline Software
LayerMaterialRecord.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // LayerMaterialRecord.h, (c) ATLAS Detector software
8 
9 #ifndef TRKGEOMETRY_LAYERMATERIALRECORD_H
10 #define TRKGEOMETRY_LAYERMATERIALRECORD_H
11 
12 #include <climits>
13 
18 
19 #ifndef UCHARCONV
20 #define UCHARCONV
21 #define ucharbin 0.00392157 // 1./double(1.*UCHAR_MAX)
22 // int to unsigned char and vv
23 #define uchar2uint(uchar) static_cast<unsigned int>(uchar)
24 #define uint2uchar(unint) static_cast<unsigned char>(unint)
25 // double to unsigned char and vv
26 #define uchar2dfrac(uchar) double(uchar * ucharbin)
27 #define dfrac2uchar(dfrac) lrint(dfrac* UCHAR_MAX)
28 #endif
29 
30 namespace Trk {
31 
39 class Layer;
40 class AssociatedMaterial;
41 
43  public:
46 
48  LayerMaterialRecord(double tlayer, const BinUtility* binutils,
49  double minFraction,
51 
54 
57 
60 
62  void associateGeantinoHit(const Amg::Vector3D& pos, double s,
63  const Trk::Material& mat);
64 
67  void associateEmptyHit(const Amg::Vector3D& pos);
68 
71  bool fullHit = false);
72 
74  void finalizeRun(bool recordElements = true);
75 
78 
80  const std::vector<std::vector<unsigned int> >& binCounts() const;
81 
83  const Trk::BinUtility* binUtility() const;
84 
85  private:
88  int m_bins0;
89  int m_bins1;
90  double m_minFraction;
91 
93  int m_steps;
95 
98  double m_s;
99  double m_s_in_x0;
100  double m_s_in_l0;
101  double m_a;
102  double m_z;
103  double m_rho;
104  std::map<unsigned int, double> m_elements;
106 
108  std::vector<std::vector<unsigned int> > m_run_events;
109  std::vector<std::vector<Amg::Vector3D> > m_run_pos;
110  std::vector<std::vector<double> > m_run_s;
111  std::vector<std::vector<double> > m_run_s_in_x0;
112  std::vector<std::vector<double> > m_run_s_in_l0;
113  std::vector<std::vector<double> > m_run_a;
114  std::vector<std::vector<double> > m_run_z;
115  std::vector<std::vector<double> > m_run_rho;
116 
117  std::vector<std::vector<std::map<unsigned int, double> > > m_run_elements;
118 
121 
123  void clearMaterial();
126 };
127 
128 inline const MaterialPropertiesMatrix&
131 }
132 
133 inline const std::vector<std::vector<unsigned int> >&
135  return m_run_events;
136 }
137 
139  return m_binUtility;
140 }
141 
142 } // namespace Trk
143 
144 #endif // TRKGEOMETRY_LAYERMATERIALRECORD_H
145 
Trk::LayerMaterialRecord::m_binUtility
BinUtility * m_binUtility
record the BinnedArray
Definition: LayerMaterialRecord.h:87
Trk::LayerMaterialRecord::associateGeantinoHit
void associateGeantinoHit(const Amg::Vector3D &pos, double s, const Trk::Material &mat)
adding the information about the Geantino hit
Definition: LayerMaterialRecord.cxx:154
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Trk::LayerMaterialRecord::m_run_pos
std::vector< std::vector< Amg::Vector3D > > m_run_pos
Definition: LayerMaterialRecord.h:109
Trk::LayerMaterialRecord::m_run_elements
std::vector< std::vector< std::map< unsigned int, double > > > m_run_elements
the final material properties
Definition: LayerMaterialRecord.h:117
MaterialProperties.h
Trk::LayerMaterialRecord::m_minFraction
double m_minFraction
minimum element fraction to be recorded
Definition: LayerMaterialRecord.h:90
Trk::LayerMaterialRecord::~LayerMaterialRecord
~LayerMaterialRecord()
Destructor.
Definition: LayerMaterialRecord.cxx:149
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
Trk::LayerMaterialRecord::m_associatedLayerMaterial
MaterialPropertiesMatrix m_associatedLayerMaterial
clear the material -> calls delete
Definition: LayerMaterialRecord.h:120
BinUtility.h
Trk::LayerMaterialRecord::m_s
double m_s
Definition: LayerMaterialRecord.h:98
Trk::LayerMaterialRecord::LayerMaterialRecord
LayerMaterialRecord()
Default Constructor.
Definition: LayerMaterialRecord.cxx:24
Trk::LayerMaterialRecord::m_run_s_in_x0
std::vector< std::vector< double > > m_run_s_in_x0
Definition: LayerMaterialRecord.h:111
Trk::LayerMaterialRecord::m_s_in_l0
double m_s_in_l0
Definition: LayerMaterialRecord.h:100
Trk::LayerMaterialRecord::m_a
double m_a
Definition: LayerMaterialRecord.h:101
python.RingerConstants.Layer
Layer
Definition: RingerConstants.py:42
Trk::LayerMaterialRecord::m_run_a
std::vector< std::vector< double > > m_run_a
Definition: LayerMaterialRecord.h:113
Trk::LayerMaterialRecord::m_rho
double m_rho
Definition: LayerMaterialRecord.h:103
GeoPrimitives.h
Trk::LayerMaterialRecord::m_s_in_x0
double m_s_in_x0
Definition: LayerMaterialRecord.h:99
Trk::LayerMaterialRecord::m_z
double m_z
Definition: LayerMaterialRecord.h:102
Trk::LayerMaterialRecord::m_assoc
MaterialAssociationType m_assoc
type of hit association
Definition: LayerMaterialRecord.h:105
Trk::LayerMaterialRecord::associatedLayerMaterial
const MaterialPropertiesMatrix & associatedLayerMaterial() const
return method for the LayerMaterial
Definition: LayerMaterialRecord.h:129
Trk::LayerMaterialRecord::binUtility
const Trk::BinUtility * binUtility() const
return the BinUtility
Definition: LayerMaterialRecord.h:138
Trk::LayerMaterialRecord::m_emptyHitCase
bool m_emptyHitCase
Definition: LayerMaterialRecord.h:97
Trk::LayerMaterialRecord::associateEmptyHit
void associateEmptyHit(const Amg::Vector3D &pos)
adding the information about an empty hit scaling- particle crossed layer, but no mapping information
Definition: LayerMaterialRecord.cxx:188
Trk::LayerMaterialRecord::clearMaterial
void clearMaterial()
copy from another vector
Definition: LayerMaterialRecord.cxx:361
Trk::LayerMaterialRecord::m_bins1
int m_bins1
number of bins in coordinate 2
Definition: LayerMaterialRecord.h:89
Trk::LayerMaterialRecord::operator=
LayerMaterialRecord & operator=(const LayerMaterialRecord &lmr)
Assignment operator.
Definition: LayerMaterialRecord.cxx:113
Trk::LayerMaterialRecord::m_steps
int m_steps
Definition: LayerMaterialRecord.h:93
Trk::LayerMaterialRecord::m_run_s
std::vector< std::vector< double > > m_run_s
Definition: LayerMaterialRecord.h:110
Trk::AssociatedMaterial
Definition: AssociatedMaterial.h:33
Trk::BinUtility
Definition: BinUtility.h:39
Trk::LayerMaterialRecord::m_elements
std::map< unsigned int, double > m_elements
Definition: LayerMaterialRecord.h:104
Trk::LayerMaterialRecord
Definition: LayerMaterialRecord.h:42
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::LayerMaterialRecord::m_run_rho
std::vector< std::vector< double > > m_run_rho
Definition: LayerMaterialRecord.h:115
Trk::LayerMaterialRecord::binCounts
const std::vector< std::vector< unsigned int > > & binCounts() const
return method for the events used for this
Definition: LayerMaterialRecord.h:134
Trk::MaterialAssociationType
MaterialAssociationType
Definition: MaterialAssociationType.h:13
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::LayerMaterialRecord::finalizeRun
void finalizeRun(bool recordElements=true)
finalize the Run
Definition: LayerMaterialRecord.cxx:285
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::LayerMaterialRecord::m_pos
Amg::Vector3D m_pos
event related information
Definition: LayerMaterialRecord.h:94
Trk::MaterialPropertiesMatrix
std::vector< std::vector< const MaterialProperties * > > MaterialPropertiesMatrix
Definition: ILayerMaterialAnalyser.h:23
Trk::LayerMaterialRecord::m_run_s_in_l0
std::vector< std::vector< double > > m_run_s_in_l0
Definition: LayerMaterialRecord.h:112
Trk::EffectiveNumAtoms
@ EffectiveNumAtoms
Definition: MaterialAssociationType.h:15
Trk::LayerMaterialRecord::m_layerThickness
double m_layerThickness
record the layerThickness
Definition: LayerMaterialRecord.h:86
Trk::Material
Definition: Material.h:116
Trk::LayerMaterialRecord::m_run_z
std::vector< std::vector< double > > m_run_z
Definition: LayerMaterialRecord.h:114
MaterialAssociationType.h
Trk::LayerMaterialRecord::finalizeEvent
AssociatedMaterial * finalizeEvent(const Trk::Layer &lay, bool fullHit=false)
finalize the Event
Definition: LayerMaterialRecord.cxx:195
Trk::LayerMaterialRecord::copyMaterial
void copyMaterial(const MaterialPropertiesMatrix &mat)
Definition: LayerMaterialRecord.cxx:377
Trk::LayerMaterialRecord::m_bins0
int m_bins0
number of bins in coordinate 1
Definition: LayerMaterialRecord.h:88
Trk::Layer
Definition: Layer.h:73
Trk::LayerMaterialRecord::m_run_events
std::vector< std::vector< unsigned int > > m_run_events
Definition: LayerMaterialRecord.h:108