src
SimDataFormats
ValidationFormats
interface
MaterialAccountingDetector.h
Go to the documentation of this file.
1
#ifndef MaterialAccountingDetector_h
2
#define MaterialAccountingDetector_h
3
4
#include <iostream>
5
#include <sstream>
6
#include <string>
7
#include <vector>
8
#include <cmath>
9
10
// CMSSW
11
#include "
DataFormats/GeometryVector/interface/GlobalPoint.h
"
12
#include "
SimDataFormats/ValidationFormats/interface/MaterialAccountingStep.h
"
13
14
// struct to keep material accounting and geometrical informations on a per-detector basis, along a track
15
class
MaterialAccountingDetector
{
16
friend
class
MaterialAccountingTrack
;
17
friend
class
TrackingMaterialAnalyser
;
18
friend
class
DD4hep_TrackingMaterialAnalyser
;
19
20
public
:
21
MaterialAccountingDetector
(
void
)
22
:
m_position
(),
m_curvilinearIn
(0.),
m_curvilinearOut
(0.),
m_cosThetaIn
(0.),
m_cosThetaOut
(0.),
m_accounting
() {}
23
24
void
clear
(
void
) {
25
m_position
=
GlobalPoint
(),
m_curvilinearIn
= 0.;
26
m_curvilinearOut
= 0.;
27
m_cosThetaIn
= 0.;
28
m_cosThetaOut
= 0.;
29
m_accounting
.
clear
();
30
}
31
32
const
GlobalPoint
&
position
()
const
{
return
m_position
; }
33
34
const
MaterialAccountingStep
&
material
()
const
{
return
m_accounting
; }
35
36
// step holds the length and material infos for a step
37
// begin and end are the curviliniear coordinates
38
void
account
(
const
MaterialAccountingStep
&
step
,
double
begin
,
double
end
) {
39
if
(
end
<=
m_curvilinearIn
)
40
// step before detector
41
m_accounting
+=
m_cosThetaIn
*
step
;
42
else
if
(
begin
>=
m_curvilinearOut
)
43
// step after detector
44
m_accounting
+=
m_cosThetaOut
*
step
;
45
else
46
// step inside detector
47
m_accounting
+= (
m_cosThetaIn
+
m_cosThetaOut
) / 2. *
step
;
48
}
49
50
private
:
51
GlobalPoint
m_position
;
// roughly the center of the detector
52
double
m_curvilinearIn
;
// beginning of detector coordinate along the track
53
double
m_curvilinearOut
;
// end of detector coordinate along the track
54
double
m_cosThetaIn
;
55
double
m_cosThetaOut
;
56
MaterialAccountingStep
m_accounting
;
57
};
58
59
#endif // MaterialAccountingDetector_h
MaterialAccountingDetector::m_curvilinearOut
double m_curvilinearOut
Definition:
MaterialAccountingDetector.h:53
GlobalPoint
Global3DPoint GlobalPoint
Definition:
GlobalPoint.h:10
SplitLinear.begin
begin
Definition:
SplitLinear.py:25
MaterialAccountingDetector::m_accounting
MaterialAccountingStep m_accounting
Definition:
MaterialAccountingDetector.h:56
MaterialAccountingDetector
Definition:
MaterialAccountingDetector.h:15
MaterialAccountingDetector::m_cosThetaIn
double m_cosThetaIn
Definition:
MaterialAccountingDetector.h:54
MaterialAccountingDetector::m_cosThetaOut
double m_cosThetaOut
Definition:
MaterialAccountingDetector.h:55
MaterialAccountingStep.h
mps_fire.end
end
Definition:
mps_fire.py:242
MaterialAccountingStep
Definition:
MaterialAccountingStep.h:9
MaterialAccountingDetector::clear
void clear(void)
Definition:
MaterialAccountingDetector.h:24
MaterialAccountingDetector::material
const MaterialAccountingStep & material() const
Definition:
MaterialAccountingDetector.h:34
MaterialAccountingDetector::account
void account(const MaterialAccountingStep &step, double begin, double end)
Definition:
MaterialAccountingDetector.h:38
Point3DBase< float, GlobalTag >
MaterialAccountingDetector::MaterialAccountingDetector
MaterialAccountingDetector(void)
Definition:
MaterialAccountingDetector.h:21
DD4hep_TrackingMaterialAnalyser
Definition:
DD4hep_TrackingMaterialAnalyser.h:16
MaterialAccountingStep::clear
void clear(void)
Definition:
MaterialAccountingStep.h:16
MaterialAccountingDetector::m_position
GlobalPoint m_position
Definition:
MaterialAccountingDetector.h:51
step
step
Definition:
StallMonitor.cc:83
TrackingMaterialAnalyser
Definition:
TrackingMaterialAnalyser.h:16
MaterialAccountingDetector::m_curvilinearIn
double m_curvilinearIn
Definition:
MaterialAccountingDetector.h:52
MaterialAccountingDetector::position
const GlobalPoint & position() const
Definition:
MaterialAccountingDetector.h:32
MaterialAccountingTrack
Definition:
MaterialAccountingTrack.h:10
GlobalPoint.h
Generated for CMSSW Reference Manual by
1.8.14