VMC Examples Version 6.6
Loading...
Searching...
No Matches
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
23
24/// \cond CLASSIMP
26 /// \endcond
27
28 //_____________________________________________________________________________
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//_____________________________________________________________________________
62
63//_____________________________________________________________________________
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//_____________________________________________________________________________
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}
Definition of the Ex02ChamberParameterisation class.
The chamber parameterisation.
void ComputeTransformation(Int_t copyNo, Double_t *position) const
Double_t fSpacing
The distance between the chambers' centers.
Double_t fStartZ
The Z of the center of first chamber.
Double_t fHalfLengthFirst
The first half-length.
Double_t fHalfLengthIncr
The Increment for the half-length.
void ComputeDimensions(Int_t copyNo, Double_t *dimension) const
Double_t fHalfWidth
The half-width of each tracker chamber.