// ----------------------------------------------------------------------------- // ----- Create_TOF_Geometry_v15h.C ----- // ----- ----- // ----- created by C. Simon on 2020-01-21 ----- // ----- ----- // ----- geometrical description of the upper counter branch ----- // ----- 3-0-0, 9-0-0, 7-0-0, 4-0-0 ----- // ----- including two plastic scintillators ----- // ----- 2-0-0, 2-1-0 ----- // ----- and two strip-diamond start counters ----- // ----- 5-2-0, 5-1-0 ----- // ----- of the setup used at CERN/SPS in February/March 2015 ----- // ----- ----- // ----------------------------------------------------------------------------- #include "FairGeoLoader.h" #include "FairGeoInterface.h" #include "FairGeoBuilder.h" #include "FairGeoMedia.h" #include "FairGeoMedium.h" #include "TSystem.h" #include "TGeoManager.h" #include "TGeoVolume.h" #include "TGeoMaterial.h" #include "TGeoMedium.h" #include "TGeoPgon.h" #include "TGeoMatrix.h" #include "TGeoCompositeShape.h" #include "TFile.h" #include "TString.h" #include "TList.h" #include "TROOT.h" #include "TMath.h" #include // geometry version and output file name const TString gtGeoVersion = "tof_v14a_n"; const TString gtFileName = "tof_v14a.root"; // for compatibility reasons // names of materials used in this geometry (defined in media.geo) const TString gtKeepingVolumeMedium = "air"; const TString gtBoxVolumeMedium = "aluminium"; const TString gtNoActivGasMedium = "RPCgas_noact"; const TString gtActivGasMedium = "RPCgas"; const TString gtGlasMedium = "RPCglass"; const TString gtElectronicsMedium = "carbon"; const TString gtScintillationMedium = "Scintillator"; // list of counter types used in this geometry // 0 strip DD // 1 HD P2 (low-resistive glass) // 2 THU (low-resistive glass) // 3 USTC (thin float glass) // 4 HD P5 (low-resistive glass) const Int_t giNCounterTypes = 5; const Double_t gdGlass_X[giNCounterTypes] = { 2. , 32. , 25. , 32. , 15.04 }; const Double_t gdGlass_Y[giNCounterTypes] = { 2. , 26.9 , 26.7 , 27. , 4. }; const Double_t gdGlass_Z[giNCounterTypes] = { 0.1, 0.07, 0.07, 0.033 , 0.1 }; const Double_t gdGasGap_X[giNCounterTypes] = { 2. , 32. , 25. , 32. , 15.04 }; const Double_t gdGasGap_Y[giNCounterTypes] = { 2. , 26.9 , 26.7 , 27. , 4. }; const Double_t gdGasGap_Z[giNCounterTypes] = { 0.03, 0.022, 0.025, 0.022, 0.022 }; const Int_t giNGaps[giNCounterTypes] = { 1, 8, 8, 10, 6 }; const Int_t giNReadoutStrips[giNCounterTypes] = { 16, 32, 24, 16, 16 }; const Double_t gdElectronics_X[giNCounterTypes] = { 2. , 34. , 26. , 34. , 15.5 }; const Double_t gdElectronics_Y[giNCounterTypes] = { 0.1, 5. , 5. , 5. , 5. }; const Double_t gdElectronics_Z[giNCounterTypes] = { 0.1, 0.3, 0.3, 0.3, 0.3 }; const Double_t gdBoundaryDistance = 0.1; // list of module box types used in this geometry // 0 strip DD // 1 HD P2 // 2 THU // 3 USTC // 4 HD P5 const Int_t giNModuleTypes = 5; const Double_t gdModule_X[giNModuleTypes] = { 5., 72.5, 60.0, 65.6, 54.5 }; const Double_t gdModule_Y[giNModuleTypes] = { 5., 51.5, 50.0, 41.6, 29.5 }; const Double_t gdModule_Z[giNModuleTypes] = { 1., 10.5, 7.2, 8.8, 6.5 }; const Double_t gdModuleWallWidth_Xplus[giNModuleTypes] = { 0.1, 0.5, 0.5, 0.5, 0.5 }; const Double_t gdModuleWallWidth_Xminus[giNModuleTypes] = { 0.1, 0.5, 0.5, 0.5, 0.5 }; const Double_t gdModuleWallWidth_Y[giNModuleTypes] = { 0.1, 0.1, 0.1, 0.1, 0.1 }; const Double_t gdModuleWallWidth_Z[giNModuleTypes] = { 0.1, 0.1, 0.1, 0.1, 0.1 }; // placement of counters inside the module boxes const Int_t giMaxNCountersInModule = 1; const Int_t giNCountersInModule[giNModuleTypes] = { 1, 1, 1, 1, 1 }; const Int_t giCountersInModule[giNModuleTypes][giMaxNCountersInModule] = { 0, 1, 2, 3, 4 }; const Double_t gdCounterXPosition[giNModuleTypes][giMaxNCountersInModule] = { 0., 0. , 0., 0., 0. }; const Double_t gdCounterYPosition[giNModuleTypes][giMaxNCountersInModule] = { 0., 0. , 0., 0., 0. }; const Double_t gdCounterZPosition[giNModuleTypes][giMaxNCountersInModule] = { 0., -2.5, 0., 0., 0. }; const Double_t gdCounterXRotation[giNModuleTypes][giMaxNCountersInModule] = { 0., 0., 0., 0., 0. }; const Double_t gdCounterYRotation[giNModuleTypes][giMaxNCountersInModule] = { 0., 0., 0., 0., 0. }; const Double_t gdCounterZRotation[giNModuleTypes][giMaxNCountersInModule] = { 0., 90., 90., 90., 0. }; // placement of modules in the setup const Int_t giMaxNModulesInSetup = 2; const Int_t giNModulesInSetup[giNModuleTypes] = { 2, 1, 1, 1, 1 }; /* ORIGINAL const Double_t gdModuleXPosition[giNModuleTypes][giMaxNModulesInSetup] = { { 0., 0. }, { 0. , 0. }, { 2.2, 0. }, { 0. , 0. }, { 1.5, 0. } }; const Double_t gdModuleYPosition[giNModuleTypes][giMaxNModulesInSetup] = { { 0., 0. }, { 48.9, 0. }, { 55. , 0. }, { 59. , 0. }, { 67. , 0. } }; const Double_t gdModuleZPosition[giNModuleTypes][giMaxNModulesInSetup] = { { -3., -1. }, { 268.4, 0. }, { 297.5, 0. }, { 332.3, 0. }, { 367.4, 0. } }; */ const Double_t gdModuleXPosition[giNModuleTypes][giMaxNModulesInSetup] = { { 0., 0. }, { 0. , 0. }, { 2.8, 0. }, { -0.4, 0. }, { 3.1, 0. } }; const Double_t gdModuleYPosition[giNModuleTypes][giMaxNModulesInSetup] = { { 0., 0. }, { 48.9, 0. }, { 55. , 0. }, { 58.2, 0. }, { 66.8, 0. } }; const Double_t gdModuleZPosition[giNModuleTypes][giMaxNModulesInSetup] = { { -3., -1. }, { 268.4, 0. }, { 297.5, 0. }, { 332.3, 0. }, { 367.4, 0. } }; const Double_t gdModuleXRotation[giNModuleTypes][giMaxNModulesInSetup] = { { 0., 0. }, { 0., 0. }, { 0., 0. }, { 0., 0. }, { 0., 0. } }; const Double_t gdModuleYRotation[giNModuleTypes][giMaxNModulesInSetup] = { { 0., 0. }, { 0., 0. }, { 0., 0. }, { 0., 0. }, { 0., 0. } }; const Double_t gdModuleZRotation[giNModuleTypes][giMaxNModulesInSetup] = { { 90., 0. }, { 0., 0. }, { 0., 0. }, { 0., 0. }, { 0., 0. } }; const Int_t giModuleTypeIdentifier[giNModuleTypes][giMaxNModulesInSetup] = { { 5, 5 }, { 3, -1 }, { 9, -1 }, { 7, -1 }, { 4, -1 } }; const Int_t giModuleIndexIdentifier[giNModuleTypes][giMaxNModulesInSetup] = { { 2, 1 }, { 0, -1 }, { 0, -1 }, { 0, -1 }, { 0, -1 } }; // list of scintillator types used in this geometry // 0 BC-408 small // 1 BC-408 big const Int_t giNScintillatorTypes = 2; const Int_t giMaxNScintillatorsInSetup = 1; const Int_t giNScintillatorsInSetup[giNScintillatorTypes] = { 1, 1 }; const Double_t gdScintillatorXSize[giNScintillatorTypes] = { 8., 11. }; const Double_t gdScintillatorYSize[giNScintillatorTypes] = { 2., 4. }; const Double_t gdScintillatorZSize[giNScintillatorTypes] = { 1., 2. }; const Double_t gdScintillatorXPosition[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { -3. , -0.5 }; const Double_t gdScintillatorYPosition[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { 40.5, 67. }; const Double_t gdScintillatorZPosition[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { 258.4, 375.8 }; const Double_t gdScintillatorXRotation[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { 0., 0. }; const Double_t gdScintillatorYRotation[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { 0., 0. }; const Double_t gdScintillatorZRotation[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { 0., 0. }; const Int_t giScintillatorTypeIdentifier[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { 2, 2 }; const Int_t giScintillatorIndexIdentifier[giNScintillatorTypes][giMaxNScintillatorsInSetup] = { 0, 1 }; TGeoVolume* gModules[giNModuleTypes]; TGeoVolume* gCounters[giNCounterTypes]; TGeoVolume* gScintillators[giNScintillatorTypes]; TGeoVolume* gtTofVolume; void create_materials_from_media_file(); TGeoVolume* create_counter(Int_t); TGeoVolume* create_module(Int_t); void place_modules(Int_t); TGeoVolume* create_scintillator(Int_t); void place_scintillators(Int_t); void Create_TOF_Geometry_v15h() { // load material definitions from media.geo create_materials_from_media_file(); gROOT->FindObject("FAIRGeom"); gGeoManager->SetVisLevel(5); gGeoManager->SetVisOption(0); TGeoVolume* tTopVolume = new TGeoVolumeAssembly("TOP"); gGeoManager->SetTopVolume(tTopVolume); gtTofVolume = new TGeoVolumeAssembly(gtGeoVersion); tTopVolume->AddNode(gtTofVolume, 1); // NOTE: The order of creating counters first and scintillators thereafter // must be strictly kept! for(Int_t iCounterType = 0; iCounterType < giNCounterTypes; iCounterType++) { cout << "create counter " << iCounterType << endl; gCounters[iCounterType] = create_counter(iCounterType); } for(Int_t iModuleType = 0; iModuleType < giNModuleTypes; iModuleType++) { cout << "create module " << iModuleType << endl; gModules[iModuleType] = create_module(iModuleType); gModules[iModuleType]->SetVisContainers(1); place_modules(iModuleType); } for(Int_t iScintillatorType = 0; iScintillatorType < giNScintillatorTypes; iScintillatorType++) { cout << "create scintillator " << iScintillatorType << endl; gScintillators[iScintillatorType] = create_scintillator(iScintillatorType); gScintillators[iScintillatorType]->SetVisContainers(1); place_scintillators(iScintillatorType); } gGeoManager->CloseGeometry(); gGeoManager->CheckOverlaps(0.001); gGeoManager->PrintOverlaps(); gGeoManager->Test(); TFile* tOutputFile = new TFile(gtFileName, "RECREATE"); tTopVolume->Write(); // gGeoManager->Write(); tOutputFile->Close(); tTopVolume->SetVisContainers(1); gGeoManager->SetVisLevel(5); if(!gROOT->IsBatch()) tTopVolume->Draw("ogl"); } void create_materials_from_media_file() { // use the FairRoot geometry interface to load the required media FairGeoLoader* tGeoLoader = new FairGeoLoader("TGeo", "FairGeoLoader"); FairGeoInterface* tGeoInterface = tGeoLoader->getGeoInterface(); TString tGeoPath = gSystem->Getenv("VMCWORKDIR"); TString tGeoFile = tGeoPath + "/geometry/media.geo"; tGeoInterface->setMediaFile(tGeoFile); tGeoInterface->readMedia(); // read the required media and create them in the TGeoManager FairGeoMedia* tGeoMedia = tGeoInterface->getMedia(); FairGeoBuilder* tGeoBuilder = tGeoLoader->getGeoBuilder(); FairGeoMedium* air = tGeoMedia->getMedium("air"); FairGeoMedium* aluminium = tGeoMedia->getMedium("aluminium"); FairGeoMedium* RPCgas = tGeoMedia->getMedium("RPCgas"); FairGeoMedium* RPCgas_noact = tGeoMedia->getMedium("RPCgas_noact"); FairGeoMedium* RPCglass = tGeoMedia->getMedium("RPCglass"); FairGeoMedium* carbon = tGeoMedia->getMedium("carbon"); FairGeoMedium* scintillator = tGeoMedia->getMedium("Scintillator"); tGeoBuilder->createMedium(air); tGeoBuilder->createMedium(aluminium); tGeoBuilder->createMedium(RPCgas); tGeoBuilder->createMedium(RPCgas_noact); tGeoBuilder->createMedium(RPCglass); tGeoBuilder->createMedium(carbon); tGeoBuilder->createMedium(scintillator); } TGeoVolume* create_counter(Int_t iCounterType) { Double_t dElectronicsPosition_Y = gdGlass_Y[iCounterType]/2. + gdElectronics_Y[iCounterType]/2.; // counter volume dimensions Double_t dCounter_X = TMath::Max(TMath::Max(gdGlass_X[iCounterType], gdGasGap_X[iCounterType]), gdElectronics_X[iCounterType]) + 2.*gdBoundaryDistance; Double_t dCounter_Y = TMath::Max(gdGlass_Y[iCounterType], gdGasGap_Y[iCounterType]) + 2.*gdElectronics_Y[iCounterType] + 2.*gdBoundaryDistance; Double_t dCounter_Z = giNGaps[iCounterType]*(gdGlass_Z[iCounterType] + gdGasGap_Z[iCounterType]) + gdGlass_Z[iCounterType] + 2.*gdBoundaryDistance; Double_t dGapDistance = gdGlass_Z[iCounterType] + gdGasGap_Z[iCounterType]; Double_t dGlassZStartPosition = -dCounter_Z/2. + gdBoundaryDistance + gdGlass_Z[iCounterType]/2.; Double_t dGapZStartPosition = dGlassZStartPosition + dGapDistance/2.; // needed materials TGeoMedium* tGlassPlateVolMed = gGeoManager->GetMedium(gtGlasMedium); TGeoMedium* tNoActiveGasVolMed = gGeoManager->GetMedium(gtNoActivGasMedium); TGeoMedium* tActiveGasVolMed = gGeoManager->GetMedium(gtActivGasMedium); TGeoMedium* tElectronicsVolMed = gGeoManager->GetMedium(gtElectronicsMedium); // create counter volume TGeoBBox* tCounterShape = new TGeoBBox("", dCounter_X/2., dCounter_Y/2., dCounter_Z/2.); TGeoVolume* tCounterVolume = new TGeoVolume("counter", tCounterShape, tNoActiveGasVolMed); // create glass plate volume TGeoBBox* tGlassPlateShape = new TGeoBBox("", gdGlass_X[iCounterType]/2., gdGlass_Y[iCounterType]/2., gdGlass_Z[iCounterType]/2.); TGeoVolume* tGlassPlateVolume = new TGeoVolume("tof_glass", tGlassPlateShape, tGlassPlateVolMed); // create gas gap volume TGeoBBox* tGasGapShape = new TGeoBBox("", gdGasGap_X[iCounterType]/2., gdGasGap_Y[iCounterType]/2., gdGasGap_Z[iCounterType]/2.); TGeoVolume* tGasGapVolume = new TGeoVolume("Gap", tGasGapShape, tActiveGasVolMed); // divide the gas gap volume into readout strips ("cells") tGasGapVolume->Divide("Cell", 1, giNReadoutStrips[iCounterType], -gdGasGap_X[iCounterType]/2., 0); // position all glass plates and gas gaps in the counter except for the final glass plate for(Int_t iGap = 0; iGap < giNGaps[iCounterType]; iGap++) { Double_t dZPositionGlass = dGlassZStartPosition + iGap*dGapDistance; Double_t dZPositionGap = dGapZStartPosition + iGap*dGapDistance; tCounterVolume->AddNode(tGlassPlateVolume, iGap, new TGeoTranslation("", 0., 0., dZPositionGlass)); tCounterVolume->AddNode(tGasGapVolume, iGap, new TGeoTranslation("", 0., 0., dZPositionGap)); } // position the final glass plate in the counter Double_t dZPositionGlass = dGlassZStartPosition + giNGaps[iCounterType]*dGapDistance; tCounterVolume->AddNode(tGlassPlateVolume, giNGaps[iCounterType], new TGeoTranslation("", 0., 0., dZPositionGlass)); // create electronics volume TGeoBBox* tElectronicsShape = new TGeoBBox("", gdElectronics_X[iCounterType]/2., gdElectronics_Y[iCounterType]/2., gdElectronics_Z[iCounterType]/2.); TGeoVolume* tElectronicsVolume = new TGeoVolume("pcb", tElectronicsShape, tElectronicsVolMed); // position both electronics PCBs in the counter tCounterVolume->AddNode(tElectronicsVolume, 0, new TGeoTranslation("", 0., -dElectronicsPosition_Y, 0.)); tCounterVolume->AddNode(tElectronicsVolume, 1, new TGeoTranslation("", 0., dElectronicsPosition_Y, 0.)); // drawing style tCounterVolume->SetLineColor(kCyan); tCounterVolume->SetTransparency(70); tGlassPlateVolume->SetLineColor(kYellow); tGlassPlateVolume->SetTransparency(0); tGasGapVolume->SetLineColor(kRed); tGasGapVolume->SetTransparency(50); tElectronicsVolume->SetLineColor(kGreen); tElectronicsVolume->SetTransparency(10); return tCounterVolume; } TGeoVolume* create_module(Int_t iModuleType) { TGeoMedium* tBoxVolMed = gGeoManager->GetMedium(gtBoxVolumeMedium); TGeoMedium* tNoActiveGasVolMed = gGeoManager->GetMedium(gtNoActivGasMedium); // create module volume TGeoBBox* tModuleShape = new TGeoBBox("", gdModule_X[iModuleType]/2., gdModule_Y[iModuleType]/2., gdModule_Z[iModuleType]/2.); TGeoVolume* tModuleVolume = new TGeoVolume(Form("module_%d", iModuleType), tModuleShape, tBoxVolMed); // create gas box volume TGeoBBox* tGasBoxShape = new TGeoBBox("", (gdModule_X[iModuleType] - (gdModuleWallWidth_Xplus[iModuleType] + gdModuleWallWidth_Xminus[iModuleType]))/2., (gdModule_Y[iModuleType] - 2.*gdModuleWallWidth_Y[iModuleType])/2., (gdModule_Z[iModuleType] - 2.*gdModuleWallWidth_Z[iModuleType])/2.); TGeoVolume* tGasBoxVolume = new TGeoVolume("gas_box", tGasBoxShape, tNoActiveGasVolMed); // position gas box in the module tModuleVolume->AddNode(tGasBoxVolume, 0, new TGeoTranslation("", (gdModuleWallWidth_Xminus[iModuleType] - gdModuleWallWidth_Xplus[iModuleType])/2., 0., 0.)); // position all counters in the gas box for(Int_t iCounter = 0; iCounter < giNCountersInModule[iModuleType]; iCounter++) { TGeoTranslation* tTranslationMatrix = new TGeoTranslation(); tTranslationMatrix->SetDx(gdCounterXPosition[iModuleType][iCounter]); tTranslationMatrix->SetDy(gdCounterYPosition[iModuleType][iCounter]); tTranslationMatrix->SetDz(gdCounterZPosition[iModuleType][iCounter]); TGeoRotation* tRotationMatrix = new TGeoRotation(); tRotationMatrix->RotateX(gdCounterXRotation[iModuleType][iCounter]); tRotationMatrix->RotateY(gdCounterYRotation[iModuleType][iCounter]); tRotationMatrix->RotateZ(gdCounterZRotation[iModuleType][iCounter]); tGasBoxVolume->AddNode(gCounters[giCountersInModule[iModuleType][iCounter]], iCounter, new TGeoCombiTrans(*tTranslationMatrix, *tRotationMatrix)); } // drawing style tModuleVolume->SetLineColor(kGreen); tModuleVolume->SetTransparency(20); tGasBoxVolume->SetLineColor(kBlue); tGasBoxVolume->SetTransparency(50); return tModuleVolume; } void place_modules(Int_t iModuleType) { for(Int_t iModule = 0; iModule < giNModulesInSetup[iModuleType]; iModule++) { TGeoTranslation* tTranslationMatrix = new TGeoTranslation(); tTranslationMatrix->SetDx(gdModuleXPosition[iModuleType][iModule]); tTranslationMatrix->SetDy(gdModuleYPosition[iModuleType][iModule]); tTranslationMatrix->SetDz(gdModuleZPosition[iModuleType][iModule]); TGeoRotation* tRotationMatrix = new TGeoRotation(); tRotationMatrix->RotateX(gdModuleXRotation[iModuleType][iModule]); tRotationMatrix->RotateY(gdModuleYRotation[iModuleType][iModule]); tRotationMatrix->RotateZ(gdModuleZRotation[iModuleType][iModule]); gtTofVolume->AddNode(gModules[iModuleType], iModule, new TGeoCombiTrans(*tTranslationMatrix, *tRotationMatrix)); TGeoNode* tModuleNode = gtTofVolume->GetNode(gtTofVolume->GetNdaughters() - 1); tModuleNode->SetName(TString::Format("module_%d_%d", giModuleTypeIdentifier[iModuleType][iModule], giModuleIndexIdentifier[iModuleType][iModule])); tModuleNode->SetNumber(giModuleIndexIdentifier[iModuleType][iModule]); } } TGeoVolume* create_scintillator(Int_t iScintillatorType) { TGeoMedium* tKeepingVolMed = gGeoManager->GetMedium(gtKeepingVolumeMedium); TGeoMedium* tScintillationVolMed = gGeoManager->GetMedium(gtScintillationMedium); // create scintillator shapes TGeoBBox* tModuleShape = new TGeoBBox("", gdScintillatorXSize[iScintillatorType]/2., gdScintillatorYSize[iScintillatorType]/2., gdScintillatorZSize[iScintillatorType]/2. + gdBoundaryDistance); TGeoBBox* tGlassPlateShape = new TGeoBBox("", gdScintillatorXSize[iScintillatorType]/2., gdScintillatorYSize[iScintillatorType]/2., gdBoundaryDistance/2.); TGeoBBox* tScintillatorShape = new TGeoBBox("", gdScintillatorXSize[iScintillatorType]/2., gdScintillatorYSize[iScintillatorType]/2., gdScintillatorZSize[iScintillatorType]/2.); // create scintillator volumes TGeoVolume* tModuleVolume = new TGeoVolume(Form("module_%d", giNModuleTypes + iScintillatorType), tModuleShape, tKeepingVolMed); TGeoVolume* tGasBoxVolume = new TGeoVolume("gas_box", tModuleShape, tKeepingVolMed); TGeoVolume* tCounterVolume = new TGeoVolume("counter", tModuleShape, tKeepingVolMed); TGeoVolume* tGlassPlateVolume = new TGeoVolume("tof_glass", tGlassPlateShape, tKeepingVolMed); TGeoVolume* tGasGapVolume = new TGeoVolume("Gap", tScintillatorShape, tScintillationVolMed); // divide the gas gap volume into one readout strip ("cell") tGasGapVolume->Divide("Cell", 1, 1, -gdScintillatorXSize[iScintillatorType]/2., 0); // position volumes inside each other tModuleVolume->AddNode(tGasBoxVolume, 0, new TGeoTranslation("", 0., 0., 0.)); tGasBoxVolume->AddNode(tCounterVolume, 0, new TGeoTranslation("", 0., 0., 0.)); tCounterVolume->AddNode(tGlassPlateVolume, 0, new TGeoTranslation("", 0., 0., -gdScintillatorZSize[iScintillatorType]/2. - gdBoundaryDistance/2.)); tCounterVolume->AddNode(tGasGapVolume, 0, new TGeoTranslation("", 0., 0., 0.)); tCounterVolume->AddNode(tGlassPlateVolume, 1, new TGeoTranslation("", 0., 0., gdScintillatorZSize[iScintillatorType]/2. + gdBoundaryDistance/2.)); // drawing style tModuleVolume->SetLineColor(kGreen); tModuleVolume->SetTransparency(20); tGasBoxVolume->SetLineColor(kBlue); tGasBoxVolume->SetTransparency(50); tCounterVolume->SetLineColor(kCyan); tCounterVolume->SetTransparency(70); tGlassPlateVolume->SetLineColor(kYellow); tGlassPlateVolume->SetTransparency(0); tGasGapVolume->SetLineColor(kRed); tGasGapVolume->SetTransparency(50); return tModuleVolume; } void place_scintillators(Int_t iScintillatorType) { for(Int_t iScintillator = 0; iScintillator < giNScintillatorsInSetup[iScintillatorType]; iScintillator++) { TGeoTranslation* tTranslationMatrix = new TGeoTranslation(); tTranslationMatrix->SetDx(gdScintillatorXPosition[iScintillatorType][iScintillator]); tTranslationMatrix->SetDy(gdScintillatorYPosition[iScintillatorType][iScintillator]); tTranslationMatrix->SetDz(gdScintillatorZPosition[iScintillatorType][iScintillator]); TGeoRotation* tRotationMatrix = new TGeoRotation(); tRotationMatrix->RotateX(gdScintillatorXRotation[iScintillatorType][iScintillator]); tRotationMatrix->RotateY(gdScintillatorYRotation[iScintillatorType][iScintillator]); tRotationMatrix->RotateZ(gdScintillatorZRotation[iScintillatorType][iScintillator]); gtTofVolume->AddNode(gScintillators[iScintillatorType], iScintillator, new TGeoCombiTrans(*tTranslationMatrix, *tRotationMatrix)); TGeoNode* tScintillatorNode = gtTofVolume->GetNode(gtTofVolume->GetNdaughters() - 1); tScintillatorNode->SetName(TString::Format("module_%d_%d", giScintillatorTypeIdentifier[iScintillatorType][iScintillator], giScintillatorIndexIdentifier[iScintillatorType][iScintillator])); tScintillatorNode->SetNumber(giScintillatorIndexIdentifier[iScintillatorType][iScintillator]); } }