VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
E02
src
Ex02ChamberParameterisation.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Virtual Monte Carlo examples
3
// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4
// All rights reserved.
5
//
6
// For the licensing terms see geant4_vmc/LICENSE.
7
// Contact: root-vmc@cern.ch
8
//-------------------------------------------------
9
10
/// \file Ex02ChamberParameterisation.cxx
11
/// \brief Implementation of the Ex02ChamberParameterisation class
12
///
13
/// Geant4 ExampleN02 adapted to Virtual Monte Carlo \n
14
/// Id: Ex02ChamberParameterisation.cc,v 1.7 2002/01/09 17:24:09 ranjard Exp \n
15
/// GEANT4 tag Name: geant4-04-00-patch-02
16
///
17
/// \date 21/04/2002
18
/// \author I. Hrivnacova; IPN, Orsay
19
20
#include <TError.h>
21
22
#include "
Ex02ChamberParameterisation.h
"
23
24
/// \cond CLASSIMP
25
ClassImp(
Ex02ChamberParameterisation
)
26
/// \endcond
27
28
//_____________________________________________________________________________
29
Ex02ChamberParameterisation
::
Ex02ChamberParameterisation
(Int_t noChambers,
30
Double_t startZ, Double_t spacingZ, Double_t widthChamber,
31
Double_t lengthInitial, Double_t lengthFinal)
32
:
TObject
(),
33
fNoChambers
(noChambers),
34
fStartZ
(startZ),
35
fHalfWidth
(widthChamber * 0.5),
36
fSpacing
(spacingZ),
37
fHalfLengthFirst
(lengthInitial * 0.5),
38
fHalfLengthIncr
(0)
39
{
40
/// Standard constructor
41
/// \param noChambers Number of chambers
42
/// \param startZ The Z of the center of first chamber
43
/// \param spacingZ The distance between the chambers' centers
44
/// \param widthChamber The width of each tracker chamber
45
/// \param lengthInitial The first chamber length
46
/// \param lengthFinal The last chamber length
47
48
if
(noChambers > 0) {
49
fHalfLengthIncr
= 0.5 * (lengthFinal - lengthInitial) / noChambers;
50
if
(spacingZ < widthChamber) {
51
Fatal(
"Ex02ChamberParameterisation"
,
52
"Ex02ChamberParameterisation construction: Width>Spacing"
);
53
}
54
}
55
}
56
57
//_____________________________________________________________________________
58
Ex02ChamberParameterisation::~Ex02ChamberParameterisation
()
59
{
60
/// Destructor
61
}
62
63
//_____________________________________________________________________________
64
void
Ex02ChamberParameterisation::ComputeTransformation
(
65
Int_t copyNo, Double_t* position)
const
66
{
67
/// Compute the chamber position
68
/// \param copyNo The chamber copy number
69
/// \param position The computed chamber position
70
71
position[0] = 0.;
72
position[1] = 0.;
73
position[2] =
fStartZ
+ (copyNo + 1) *
fSpacing
;
74
}
75
76
//_____________________________________________________________________________
77
void
Ex02ChamberParameterisation::ComputeDimensions
(
78
Int_t copyNo, Double_t* dimension)
const
79
{
80
81
/// Compute the chamber dimensions
82
/// \param copyNo The chamber copy number
83
/// \param dimension The computed chamber dimensions
84
85
Double_t halfLength =
fHalfLengthFirst
+ copyNo *
fHalfLengthIncr
;
86
dimension[0] = halfLength;
87
dimension[1] = halfLength;
88
dimension[2] =
fHalfWidth
;
89
}
Ex02ChamberParameterisation.h
Definition of the Ex02ChamberParameterisation class.
Ex02ChamberParameterisation
The chamber parameterisation.
Definition
Ex02ChamberParameterisation.h:35
Ex02ChamberParameterisation::ComputeTransformation
void ComputeTransformation(Int_t copyNo, Double_t *position) const
Definition
Ex02ChamberParameterisation.cxx:64
Ex02ChamberParameterisation::fNoChambers
Int_t fNoChambers
Number of chambers.
Definition
Ex02ChamberParameterisation.h:48
Ex02ChamberParameterisation::fSpacing
Double_t fSpacing
The distance between the chambers' centers.
Definition
Ex02ChamberParameterisation.h:51
Ex02ChamberParameterisation::Ex02ChamberParameterisation
Ex02ChamberParameterisation(Int_t noChambers, Double_t startZ, Double_t spacingZ, Double_t widthChamber, Double_t lengthInitial, Double_t lengthFinal)
Definition
Ex02ChamberParameterisation.cxx:29
Ex02ChamberParameterisation::fStartZ
Double_t fStartZ
The Z of the center of first chamber.
Definition
Ex02ChamberParameterisation.h:49
Ex02ChamberParameterisation::fHalfLengthFirst
Double_t fHalfLengthFirst
The first half-length.
Definition
Ex02ChamberParameterisation.h:52
Ex02ChamberParameterisation::fHalfLengthIncr
Double_t fHalfLengthIncr
The Increment for the half-length.
Definition
Ex02ChamberParameterisation.h:53
Ex02ChamberParameterisation::ComputeDimensions
void ComputeDimensions(Int_t copyNo, Double_t *dimension) const
Definition
Ex02ChamberParameterisation.cxx:77
Ex02ChamberParameterisation::~Ex02ChamberParameterisation
virtual ~Ex02ChamberParameterisation()
Definition
Ex02ChamberParameterisation.cxx:58
Ex02ChamberParameterisation::fHalfWidth
Double_t fHalfWidth
The half-width of each tracker chamber.
Definition
Ex02ChamberParameterisation.h:50
TObject
Generated on
for VMC Examples by
1.17.0