KaliVeda
Toolkit for HIC analysis
KVFAZIABeltConfig.cpp
1 //Created by KVClassFactory on Wed Mar 18 15:02:46 2020
2 //Author: John Frankland,,,
3 
4 #include "KVFAZIABeltConfig.h"
5 #include "KVFAZIABlock.h"
6 #include <TVector3.h>
7 #include "KVFAZIA.h"
8 
10 
11 // BEGIN_HTML <!--
13 /* -->
14 <h2>KVFAZIABeltConfig</h2>
15 <h4>blocks of FAZIA in a belt of NxM blocks</h4>
16 <!-- */
17 // --> END_HTML
19 
20 
21 
24 void KVFAZIABeltConfig::BuildBelt(int nblocsX, int nblocsY, double distance_correction)
25 {
26  // set up blocks in grid
27 
28  SetMedium(gGeoManager->GetMedium("Vacuum"));//to avoid warnings about STRUCT_BLOCK has dummy medium
29  KVFAZIABlock* blocco = new KVFAZIABlock;
30  blocco->Build();
31 
32  Int_t block_no(0);
33  double ymin = -(nblocsY - 1.) / 2.;
34  double ymax = -ymin;
35  for (int x = nblocsX - 1; x >= -(nblocsX - 1); x -= 2) {
36  for (double y = ymin; y <= ymax; ++y) {
37  double distance_to_block = fDist + y * distance_correction;
38  double inter_block_Y = fInterBlock + (10 * (fDist - distance_to_block) / fDist) * fInterBlock;
39  //std::cout << "distance = " << fDist-distance_to_block << " inter_block = " << inter_block_Y << std::endl;
40  TVector3 center(x * 0.5 * (blocco->GetTotalSideWithBlindage() + fInterBlock),
41  y * (blocco->GetTotalSideWithBlindage() + inter_block_Y),
42  fDist);
43  //center.Print();
44  TGeoTranslation invZ(0, 0, -distance_to_block);
45  AddNode(blocco, block_no,
47  TMath::RadToDeg()*center.Theta(),
48  TMath::RadToDeg()*center.Phi(), &invZ));
49  ++block_no;
50  }
51  }
52  // default visibility level (3) is not enough to see detectors
54 }
55 
56 
57 
58 
int Int_t
R__EXTERN TGeoManager * gGeoManager
float ymin
float ymax
A rectangular array of FAZIA blocks.
Standard geometry of 16-telescope FAZIA block.
Definition: KVFAZIABlock.h:17
virtual void Build()
Set default dimensions for all parts of geometry.
Double_t GetNominalDistanceTargetBlockCentre(double dist_SI1=100.) const
Definition: KVFAZIABlock.h:76
Double_t GetTotalSideWithBlindage() const
Definition: KVFAZIABlock.h:71
static TGeoHMatrix * GetFAZIAVolumePositioningMatrix(Double_t distance, Double_t theta, Double_t phi, TGeoTranslation *postTrans=nullptr)
Definition: KVFAZIA.h:273
void SetVisLevel(Int_t level=3)
TGeoMedium * GetMedium(const char *medium) const
Double_t Phi() const
Double_t Theta() const
Double_t y[n]
Double_t x[n]
constexpr Double_t RadToDeg()
ClassImp(TPyArg)