KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVFAZIETO.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Fri Feb 26 14:22:01 2016
2 //Author: bonnet,,,
3 
4 #include "KVFAZIETO.h"
5 #include "KVUnits.h"
6 #include "KVFAZIABlock.h"
7 
8 #include <KVDataSet.h>
9 
11 
12 // BEGIN_HTML <!--
14 /* -->
15 <h2>KVFAZIETO</h2>
16 <h4>description of the FAZIA-12B demonstrator</h4>
17 <!-- */
18 // --> END_HTML
20 
21 
22 
26  : KVFAZIA()
27 {
28  // Default constructor
29  SetTitle(ClassName());
30 }
31 
32 
33 
36 
38 {
39  // Destructor
40 }
41 
42 
43 
46 
48 {
49  //defined configuration of the blocks
50  fNblocks = KVBase::GetDataSetEnv(fDataSet, "FAZIETO.NBlocks", 12.0);
51  fFDist = KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceZ", 100.0);
52  fFThetaMin = KVBase::GetDataSetEnv(fDataSet, "FAZIETO.ThetaMinCompactGeo", 1.4);
53  // if distance FAZIA-target is not the nominal distance of 100cm, telescopes
54  // will not be aligned with the target position at (0,0,0).
55  // Therefore we use the theoretical origin for FAZIA in its real position,
56  // which is (0,0,fFDist-100.0)
57  SetGeometryImportParameters(.25, 1, 1, 0, 13, 360,
58  KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceX", 0.0),
59  KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceY", 0.0),
60  fFDist - 100.0);
61 }
62 
63 
64 
65 
66 
90 
92 {
93  // Build the FAZIA demonstrator geometry.
94  //
95  // Distance from target and minimum polar angle between innermost blocks
96  // can be changed for different datasets using:
97  //
98  // [dataset].FAZIETO.DistanceZ: 95.4
99  // [dataset].FAZIETO.DistanceX: 1.
100  // [dataset].FAZIETO.DistanceY: 0.
101  // [dataset].FAZIETO.ThetaMinCompactGeo: 2.3
102  // [dataset].FAZIETO.InterBlockPadding: 2.3
103  //
104  // Number of blocks in demonstrator, their numbers, and positions can be modified for
105  // different datasets using the following environment variables:
106  //
107  // [dataset].FAZIETO.NBlocks: 3
108  // [dataset].FAZIETO.BlockNumbers: 0,1,4
109  // [dataset].FAZIETO.BlockPositions: 11,9,5
110  //
111  // This will build a 3 block demonstrator with blocks numbered 0, 1, and 4
112  // which will be placed at the given block positions in the standard
113  // 12-block geometry (where blocks are numbered clockwise starting from
114  // the innermost block placed at roughly 12 o'clock)
115 
116  Info("BuildFAZIA", "Compact geometry, %f cm from target, theta-min=%f deg.",
117  fFDist, fFThetaMin);
118 
120 
121  Double_t distance_block_cible = fFDist * KVUnits::cm;
122  Double_t nominal_distance_block_cible = 100.0 * KVUnits::cm;
123 
124  KVFAZIABlock* block = new KVFAZIABlock;
125 
126  TGeoTranslation final_trans;
127  final_trans.SetDz(distance_block_cible - nominal_distance_block_cible);
128  if (KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceX", 0.0) != 0.) final_trans.SetDx(KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceX", 0.0));
129  if (KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceY", 0.0) != 0.) final_trans.SetDy(KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceY", 0.0));
130  Double_t theta = 0;
131  Double_t phi = 0;
132 
133  Double_t theta_min = fFThetaMin;//smallest lab polar angle in degrees
134  Double_t centre_hole = 2.*tan(theta_min * TMath::DegToRad()) * nominal_distance_block_cible;
135  Double_t dx = (block->GetTotalSideWithBlindage() + KVBase::GetDataSetEnv(fDataSet, "FAZIETO.InterBlockPadding", 0.0)) / 2.;
136 
137  TVector3 centre;
138  // block numbering and positions
139  KVString block_numbers = KVBase::GetDataSetEnv(fDataSet, "FAZIETO.BlockNumbers", "0,1,2,3,4,5,6,7,8,9,10,11");
140  block_numbers.Begin(",");
141  KVString block_positions = KVBase::GetDataSetEnv(fDataSet, "FAZIETO.BlockPositions", "0,1,2,3,4,5,6,7,8,9,10,11");
142  block_positions.Begin(",");
143 
144  for (Int_t i = 0; i < fNblocks; i += 1) {
145 
146  Int_t block_number = block_numbers.Next().Atoi();
147  Int_t bb = block_positions.Next().Atoi();
148 
149  //for FAZIASYM ordering
150  if (bb == 3) centre.SetXYZ(-1 * (dx - centre_hole / 2), 1 * (-dx - centre_hole / 2), nominal_distance_block_cible);
151  else if (bb == 2) centre.SetXYZ(-1 * (dx + centre_hole / 2), 1 * (dx - centre_hole / 2), nominal_distance_block_cible);
152  else if (bb == 1) centre.SetXYZ(-1 * (-dx + centre_hole / 2), 1 * (dx + centre_hole / 2), nominal_distance_block_cible);
153  else if (bb == 0) centre.SetXYZ(-1 * (-dx - centre_hole / 2), 1 * (-dx + centre_hole / 2), nominal_distance_block_cible);
154  else if (bb == 10) centre.SetXYZ(-1 * (3 * dx - centre_hole / 2), 1 * (-dx - centre_hole / 2), nominal_distance_block_cible);
155  else if (bb == 11) centre.SetXYZ(-1 * (dx - centre_hole / 2), 1 * (-3 * dx - centre_hole / 2), nominal_distance_block_cible);
156  else if (bb == 9) centre.SetXYZ(-1 * (3 * dx + centre_hole / 2), 1 * (dx - centre_hole / 2), nominal_distance_block_cible);
157  else if (bb == 8) centre.SetXYZ(-1 * (dx + centre_hole / 2), 1 * (3 * dx - centre_hole / 2), nominal_distance_block_cible);
158  else if (bb == 7) centre.SetXYZ(-1 * (-dx + centre_hole / 2), 1 * (3 * dx + centre_hole / 2), nominal_distance_block_cible);
159  else if (bb == 6) centre.SetXYZ(-1 * (-3 * dx + centre_hole / 2), 1 * (dx + centre_hole / 2), nominal_distance_block_cible);
160  else if (bb == 5)centre.SetXYZ(-1 * (-3 * dx - centre_hole / 2), 1 * (-dx + centre_hole / 2), nominal_distance_block_cible);
161  else if (bb == 4)centre.SetXYZ(-1 * (-dx - centre_hole / 2), 1 * (-3 * dx + centre_hole / 2), nominal_distance_block_cible);
162 
163 
164  else {
165  Warning("BuildFAZIA", "Block position definition is done only for %d blocks", fNblocks);
166  }
167  theta = centre.Theta() * TMath::RadToDeg();
168  phi = centre.Phi() * TMath::RadToDeg();
169  printf("BLK #%d => (theoretical) theta=%1.2lf - phi=%1.2lf\n", block_number, theta, phi);
170  TVector3 offset(KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceX", 0.0),
171  KVBase::GetDataSetEnv(fDataSet, "FAZIETO.DistanceY", 0.0),
172  distance_block_cible - nominal_distance_block_cible);
173  TVector3 real_centre = offset + centre;
174  fBlocCentreTheta[block_number] = real_centre.Theta() * TMath::RadToDeg();
175  fBlocCentrePhi[block_number] = real_centre.Phi() * TMath::RadToDeg();
176  top->AddNode(block, block_number,
178  theta, phi, &final_trans));
179  }
180 
181 }
182 
183 
184 
int Int_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
double Double_t
R__EXTERN TGeoManager * gGeoManager
double tan(double)
static const Char_t * GetDataSetEnv(const Char_t *dataset, const Char_t *type, const Char_t *defval)
Definition: KVBase.cpp:1619
Standard geometry of 16-telescope FAZIA block.
Definition: KVFAZIABlock.h:16
Double_t GetNominalDistanceTargetBlockCentre(double dist_SI1=100.) const
Definition: KVFAZIABlock.h:73
Double_t GetTotalSideWithBlindage() const
Definition: KVFAZIABlock.h:68
Description of a FAZIA detector geometry.
Definition: KVFAZIA.h:32
Double_t fFDist
distance of FAZIA detectors from target (in cm)
Definition: KVFAZIA.h:35
void SetGeometryImportParameters(Double_t dt=0.25, Double_t dp=1.0, Double_t tmin=2., Double_t pmin=0, Double_t tmax=20., Double_t pmax=360., Double_t xorg=0, Double_t yorg=0, Double_t zorg=0)
Definition: KVFAZIA.h:233
Double_t fFThetaMin
minimum polar angle for compact geometry (in degrees)
Definition: KVFAZIA.h:36
Int_t fNblocks
number of blocks
Definition: KVFAZIA.h:37
FAZIA 12-block demonstrator.
Definition: KVFAZIETO.h:15
virtual void GetGeometryParameters()
defined configuration of the blocks
Definition: KVFAZIETO.cpp:47
std::map< int, double > fBlocCentrePhi
phi angle of block centres
Definition: KVFAZIETO.h:20
std::map< int, double > fBlocCentreTheta
polar angle of block centres
Definition: KVFAZIETO.h:19
virtual ~KVFAZIETO()
Destructor.
Definition: KVFAZIETO.cpp:37
virtual void BuildFAZIA()
Definition: KVFAZIETO.cpp:91
static TGeoHMatrix * GetVolumePositioningMatrix(Double_t distance, Double_t theta, Double_t phi, TGeoTranslation *postTrans=nullptr)
TString fDataSet
name of associated dataset, used with MakeMultiDetector()
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
void Begin(TString delim) const
Definition: KVString.cpp:565
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:695
TGeoVolume * GetTopVolume() const
virtual void SetDy(Double_t dy)
virtual void SetDz(Double_t dz)
virtual void SetDx(Double_t dx)
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
Int_t Atoi() const
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t Phi() const
Double_t Theta() const
RooCmdArg ClassName(const char *name)
const long double cm
Definition: KVUnits.h:66
constexpr Double_t DegToRad()
constexpr Double_t RadToDeg()