4#include "INDRAGeometryBuilder.h"
35 for (
int i = 0; i < 8; i++) {
37 offY += coo[2 * i + 1];
41 for (
int i = 0; i < 8; i++) {
43 coo[2 * i + 1] -= offY;
132 for (
int i = 0; i < 4; i++) {
133 Double_t rap = (planeDist + depth) / planeDist;
134 backcoords[i] = rap * frontcoords[i];
171 for (
int i = 0; i <= 3; i++) {
191 for (
int i = 0; i <= 3; i++) {
234 printf(
"Frame centre:\n");
236 printf(
"Inner centre:\n");
238 printf(
"Outer centre: \n");
240 printf(
"Coordinates of outer pads :\n");
242 printf(
"Coordinates of inner pads :\n");
272 for (
int i = 0; i < 8; i++) {
273 vertices[2 * i] = corners[i].
X();
274 vertices[2 * i + 1] = corners[i].
Y();
279 vol_name.
Form(
"STRUCT_%s_%02d", det_type.
Data(), ring_num);
282 vol_name.
Form(
"DEADZONE_%s_%02d", det_type.
Data(), ring_num);
308 for (
int i = 0; i < 4; i++) {
309 ownframe[i] = rot_to_frame * orig[i] - displZ;
360 if (!thisdetector || !thisdetector->
IsPresent()) {
389 if (!strcmp(det,
"PHOS"))
411 for (i = 1; i <=
Ndets; i++) {
412 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
420 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
425 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
433 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
440 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, outerMod);
446 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, outerMod);
456 Info(
"MakeRing",
"Detector type %s ring number %d : ABSENT", det, ring);
459 Info(
"MakeRing",
"Detector type %s ring number %d : %d/%d detectors present", det, ring, npresent, ntotal);
468 for (i = 1; i <=
Ndets; i++) {
476 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
484 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
489 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
497 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, innerMod);
504 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, outerMod);
510 if (!strcmp(det,
"PHOS"))
fDetName.
Form(
"%s_%02d", det, outerMod);
518 if (!npresent)
Info(
"MakeRing",
"\tBlock %d: ABSENT", i);
519 else if (npresent < ntotal) {
520 Info(
"MakeRing",
"\tBlock %d: %d/%d detectors present", i, npresent, ntotal);
521 Info(
"MakeRing",
"\tCASE NOT TREATED. ALL DETECTORS PRESENT.");
529 Info(
"MakeRing",
"DET:%s RING:%d Making new prototype group for i=%d/%d",
530 det, ring, i,
Ndets);
576 if (((ring > 9 && ring < 13) && i == 1) || (ring > 12 && i == 2)) {
610 if (thick > 0.0) no_abs++;
612 multi_layer = (no_abs > 1);
618 TVector3 frontPlane[4], backPlane[4], frontCentre, backCentre;
620 for (
int i = 0; i < 4; i++) frontPlane[i] = som[i];
649 for (
int i = 0; i < 8; i++) {
650 vertices[2 * i] = corners[i].
X();
651 vertices[2 * i + 1] = corners[i].
Y();
658 else vol_name =
Form(
"%s_%d_%s", det, no_abs,
abs->GetName());
661 vol_name =
Form(
"DET_%s", det);
678 depth_in_det += thick;
682 for (
int i = 0; i < 4; i++) frontPlane[i] = backPlane[i];
683 frontCentre = backCentre;
708 TVector3 a10 = corners[1] - corners[0];
709 TVector3 a21 = corners[2] - corners[1];
745 corners[3] =
l * (d0 / (
l * normal));
747 corners[2] =
l * (d0 / (
l * normal));
749 corners[1] =
l * (d0 / (
l * normal));
751 corners[0] =
l * (d0 / (
l * normal));
772 for (
int i = 0; i < 4; i++) {
773 newpad[3 - i].
SetMagThetaPhi(orig[i].
Mag(), orig[i].Theta(), 2.*phicentre - orig[i].Phi());
789 new TGeoBBox(
"TARGET_FRAME", 3., 3., 0.1 / 2.);
790 new TGeoEltu(
"TARGET_HOLE", 2., 2., 0.1 / 2.);
812 Error(
"Build",
"You must build the geometry with gDataSet->BuildMultiDetector() before calling this method");
817 Error(
"Build",
"You must defined gGeoManager with KVMultiDetArray::CreateGeoManager before calling this method");
826 for (
int ring = 2; ring <= 16; ring += 2) {
828 if (ring > 1 && ring < 10)
MakeRing(
"SI", ring);
835 for (
int ring = 10; ring <= 17; ring++) {
889 Error(
"Build",
"You must build the geometry with gDataSet->BuildMultiDetector() before calling this method");
894 Error(
"Build",
"You must defined gGeoManager with KVMultiDetArray::CreateGeoManager before calling this method");
903 for (
int ring = 2; ring <= 16; ring += 2) {
905 if (ring > 1 && ring < 10) {
914 for (
int ring = 10; ring <= 17; ring++) {
926void INDRAGeometryBuilder::BuildEtalonVolumes()
935 Double_t sili_diameter_total = 2.54;
938 Double_t sili_diameter_active = 2.36;
939 Double_t sili_silicon_thickness = 0.22;
940 Double_t sili_lithium_thickness = 0.0044;
942 Double_t si75_diameter_active = 2.2;
948 (sili_diameter_total) / 2., (sili_diameter_total + 2 * holder_thickness) / 2., holder_length / 2.);
952 Double_t w = sili_silicon_thickness + sili_lithium_thickness;
954 sili_diameter_active / 2., (sili_diameter_total) / 2., w / 2.);
962 0., (sili_diameter_active) / 2., (sili_silicon_thickness) / 2.);
964 0., (sili_diameter_active) / 2., (sili_lithium_thickness) / 2.);
972 0., (si75_diameter_active) / 2., (si75_thickness) / 2.);
974 (si75_diameter_active) / 2., (sili_diameter_total) / 2., (si75_thickness) / 2.);
993 Double_t dist[] = {17.4005, 17.4005, 17.4005, 16.7005, 16.7005, 16.7005, 17.4005, 17.4005,};
1014 h = rot2 * trans *
p * rot1;
1016 else if (RING == 11) {
1018 h = rot2 * trans *
p * rot1;
1020 else if (RING == 12) {
1022 h = rot2 * trans *
p * rot1;
1024 else if (RING == 13) {
1026 h = rot2 * trans *
p * rot1;
1028 else if (RING == 14) {
1030 h = rot2 * trans *
p * rot1;
1032 else if (RING == 15) {
1034 h = rot2 * trans *
p * rot1;
1036 else if (RING == 16) {
1038 h = rot2 * trans *
p * rot1;
1042 h = rot2 * trans *
p * rot1;
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
R__EXTERN TGeoManager * gGeoManager
char * Form(const char *fmt,...)
Build INDRA geometry from Huguet CAO infos.
void CorrectCoordinates(Double_t *, Double_t &, Double_t &)
void MakeDetector(const Char_t *det, TVector3 *som, TVector3 cen)
make volume corresponding to the actual detector
INDRAGeometryBuilder()
Default constructor.
Int_t Ndets
number of detectors in ring
void Copy(TObject &) const
void CalculateBackPlaneCoordinates(TVector3 *frontcoords, TVector3 centre, Double_t depth, TVector3 *backcoords)
TGeoVolume * fDetVolume
geo volume representing frame
void CalculateCentre(TVector3 *corners, TVector3 ¢re)
Double_t fTotalThickness
sum of thicknesses of layers of current detector
Double_t fEtalonTheta[10]
void ReadDetCAO(const Char_t *detname, Int_t ring)
Int_t fActiveLayer
index of active layer of current detector
TString fDetName
name of detector
TVector3 fInnerCentre
centre of inner face
void PlaceFrame(Double_t phi, Int_t copy_no)
position frame (dead zone) volume in geometry
KVMaterial fFrameMat
material of outer frame
void ReflectPad(TVector3 *orig, Double_t phicentre, TVector3 *newpad)
Double_t phi0
theoretical geometry
TVector3 fInnerFront[4]
coords of inner front face
void MakeEtalon(int RING)
void CalculateCornersInPlane(TVector3 *plane, Double_t thetamin, Double_t thetamax, Double_t phimin, Double_t phimax, TVector3 *corners)
TVector3 fOuterFront[4]
coords of outer front face
TVector3 fOuterCentre
centre of outer face
void Print(Option_t *="") const
Bool_t CheckDetectorPresent(TString detname)
void TransformToOwnFrame(TVector3 *orig, TVector3 ¢re, TVector3 *ownframe)
KVDetector * fProtoDetector
detector used for last fLayers look up
TVector3 fFrameFront[4]
coords of outer front face
virtual ~INDRAGeometryBuilder()
Destructor.
void Build(Bool_t withTarget=kTRUE, Bool_t closeGeometry=kTRUE)
void MakeRing(const Char_t *det, int ring)
KVList * fLayers
list of materials making up layers of current detector
void MakeFrame(TString det_type, Int_t ring_num)
TVector3 fFrameCentre
centre of frame
TGeoVolume * fFrameVolume
geo volume representing frame
void PlaceDetector()
position detector inside frame
TGeoTranslation * fDetectorPosition
TGeoVolumeAssembly * fEtalonVol
Base class for KaliVeda framework.
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Base class for detector geometry description.
KVList * GetListOfAbsorbers() const
KVMaterial * GetActiveLayer() const
Bool_t HasSameStructureAs(const KVDetector *) const
Double_t GetTotalThicknessInCM()
virtual Bool_t IsPresent() const
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
Description of physical materials used to construct detectors & targets; interface to range tables.
virtual Double_t GetThickness() const
virtual TGeoMedium * GetGeoMedium(const Char_t *="")
virtual void SetMaterial(const Char_t *type)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Bool_t HasParameter(const Char_t *name) const
Strings used to represent a set of ranges of values.
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
virtual Int_t GetSize() const
Calculation/correction of energy losses of particles through an experimental target.
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=nullptr)
void CloseGeometry(Option_t *option="d")
TGeoMedium * GetMedium(const char *medium) const
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
TGeoVolume * GetTopVolume() const
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
virtual Int_t GetDefaultColor() const
TGeoMaterial * GetMaterial() const
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
void SetDz(Double_t dz) override
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="") override
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
void Draw(Option_t *option="") override
TGeoMaterial * GetMaterial() const
TGeoNode * GetNode(const char *name) const
virtual void SetMedium(TGeoMedium *medium)
void SetLineColor(Color_t lcolor) override
const char * GetName() const override
const char * GetTitle() const override
virtual void SetName(const char *name)
virtual void Copy(TObject &object) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
TRotation & SetYEulerAngles(Double_t phi, Double_t theta, Double_t psi)
virtual Int_t IndexOf(const TObject *obj) const
const char * Data() const
void Form(const char *fmt,...)
void SetMagThetaPhi(Double_t mag, Double_t theta, Double_t phi)
void Print(Option_t *option="") const override
TVector3 Cross(const TVector3 &) const
T Mag(const SVector< T, D > &rhs)
RVec< PromoteType< T > > abs(const RVec< T > &v)
double dist(AxisAngle const &r1, AxisAngle const &r2)
constexpr Double_t DegToRad()
constexpr Double_t RadToDeg()