Skip to content

Commit beefc3a

Browse files
ihrivnacsawenzel
authored andcommitted
Fixes for Geant4 simulation plus one update:
Fixes for Geant4 simulation plus one update: - in fit::Detector - moved definition of optical properties in ConstructOpGeometry(); fixed copy ctor - in zdc::Detector - fixed materials definitions - in phos::Detector - moved difition of sensitive volumes to InitO2Detector() - in g4config.in - fixed the media names for setting SpecialUrbanMsc model - in g4Config.C - added commented lines for entering in Geant4 UI (useful for debugging) - in Data::Stack - added more info in printing about a nonconform detector
1 parent cb35102 commit beefc3a

File tree

8 files changed

+39
-19
lines changed

8 files changed

+39
-19
lines changed

DataFormats/simulation/src/Stack.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ void Stack::UpdateTrackIndex(TRefArray* detList)
368368
if (o2det) {
369369
mActiveDetectors.emplace_back(o2det);
370370
} else {
371-
LOG(INFO) << "Found nonconforming detector" << FairLogger::endl;
371+
LOG(INFO) << "Found nonconforming detector " << det->GetName() << FairLogger::endl;
372372
}
373373
}
374374
}

Detectors/FIT/simulation/include/FITSimulation/Detector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class Detector : public o2::Base::DetImpl<Detector>
8181
/// Base class to create the detector geometry
8282
void CreateMaterials();
8383
void ConstructGeometry() override;
84+
void ConstructOpGeometry() override;
8485
void SetOneMCP(TGeoVolume* stl);
8586

8687
// Optical properties reader: e-Energy, abs-AbsorptionLength[cm], n-refractive index

Detectors/FIT/simulation/src/Detector.cxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Detector::Detector(Bool_t Active)
4242
}
4343

4444
Detector::Detector(const Detector& rhs)
45-
: o2::Base::DetImpl<Detector>(rhs), mIdSens1(rhs.mIdSens1), mPMTeff(nullptr), mHits(new std::vector<o2::fit::HitType>)
45+
: o2::Base::DetImpl<Detector>(rhs), mIdSens1(rhs.mIdSens1), mPMTeff(rhs.mPMTeff), mHits(new std::vector<o2::fit::HitType>)
4646
{
4747
}
4848

@@ -203,6 +203,13 @@ void Detector::ConstructGeometry()
203203
SetOneMCP(ins);
204204
}
205205

206+
void Detector::ConstructOpGeometry()
207+
{
208+
LOG(DEBUG) << "Creating FIT optical geometry properties";
209+
210+
DefineOpticalProperties();
211+
}
212+
206213
//_________________________________________
207214
void Detector::SetOneMCP(TGeoVolume* ins)
208215
{
@@ -362,8 +369,6 @@ void Detector::CreateMaterials()
362369
Medium(16, "OpticalGlass$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003);
363370
Medium(19, "OpticalGlassCathode$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003);
364371
Medium(22, "SensAir$", 2, 1, isxfld, sxmgmx, 10., .1, 1., .003, .003);
365-
366-
DefineOpticalProperties();
367372
}
368373

369374
//-------------------------------------------------------------------

Detectors/PHOS/simulation/include/PHOSSimulation/Detector.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ class Detector : public o2::Base::DetImpl<Detector>
173173
Detector(const Detector& rhs);
174174
Detector& operator=(const Detector&);
175175

176+
/// Define the sensitive volumes of the geometry
177+
void defineSensitiveVolumes();
178+
176179
// Geometry parameters
177180
Bool_t mCreateHalfMod; // Should we create 1/2 filled module
178181
Bool_t mActiveModule[6]; // list of modules to create

Detectors/PHOS/simulation/src/Detector.cxx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ Detector::Detector(const Detector& rhs)
5757
void Detector::InitializeO2Detector()
5858
{
5959
Reset();
60+
61+
// Define sensitive volumes
62+
defineSensitiveVolumes();
6063
}
6164

6265
void Detector::EndOfEvent()
@@ -283,16 +286,6 @@ void Detector::ConstructGeometry()
283286
}
284287

285288
gGeoManager->CheckGeometry();
286-
287-
// Define sensitive volume
288-
if (fActive) {
289-
TGeoVolume* vsense = gGeoManager->GetVolume("PXTL");
290-
if (vsense) {
291-
AddSensitiveVolume(vsense);
292-
} else {
293-
LOG(ERROR) << "PHOS Sensitive volume PXTL not found ... No hit creation!\n";
294-
}
295-
}
296289
}
297290
//-----------------------------------------
298291
void Detector::CreateMaterials()
@@ -907,3 +900,16 @@ void Detector::ConstructSupportGeometry()
907900
}
908901
}
909902
}
903+
904+
//-----------------------------------------
905+
void Detector::defineSensitiveVolumes()
906+
{
907+
if (fActive) {
908+
TGeoVolume* vsense = gGeoManager->GetVolume("PXTL");
909+
if (vsense) {
910+
AddSensitiveVolume(vsense);
911+
} else {
912+
LOG(ERROR) << "PHOS Sensitive volume PXTL not found ... No hit creation!\n";
913+
}
914+
}
915+
}

Detectors/ZDC/simulation/src/Detector.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ void Detector::createMaterials()
455455
// ******** MATERIAL DEFINITION ********
456456
Mixture(0, "Walloy$", aW, zW, dW, 3, wW);
457457
Mixture(1, "CuZn$", aCuZn, zCuZn, dCuZn, 2, wCuZn);
458-
Mixture(2, "SiO2$", aq, zq, dq, 2, wq);
458+
Mixture(2, "SiO2$", aq, zq, dq, -2, wq);
459459
Material(3, "Pb $", aPb, zPb, dPb, radPb, absPb);
460460
Material(4, "Cu $", aCu, zCu, dCu, radCu, absCu);
461461
Material(5, "Fe $", aFe, zFe, dFe, radFe, absFe);
@@ -1479,7 +1479,7 @@ void Detector::createCsideBeamLine()
14791479
// Inner trousers
14801480
TGeoCompositeShape* pIntTrousersC = new TGeoCompositeShape("intTrousersC", "QCLint:ZDCC_c1+QCLint:ZDCC_c2");
14811481
// Volume: QCLint
1482-
TGeoMedium* medZDCvoid = gGeoManager->GetMedium("ZDC_VoidNoField");
1482+
TGeoMedium* medZDCvoid = gGeoManager->GetMedium("ZDC_VoidNoField$");
14831483
TGeoVolume* pQCLint = new TGeoVolume("QCLint", pIntTrousersC, medZDCvoid);
14841484
pQCLint->SetLineColor(kTeal);
14851485
pQCLint->SetVisLeaves(kTRUE);

Detectors/gconfig/g4Config.C

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,8 @@ void Config()
6969
/// (verbose level, global range cut, ..)
7070
geant4->ProcessGeantMacro(configm1.Data());
7171

72+
// Enter in Geant4 Interactive mode
73+
// geant4->StartGeantUI();
74+
7275
cout << "g4Config.C finished" << endl;
7376
}

Detectors/gconfig/g4config.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
/mcVerbose/geometryManager 1
66
/mcVerbose/opGeometryManager 1
77
/mcTracking/loopVerbose 1
8-
/mcPhysics/rangeCuts 0.01 mm
9-
108
/mcVerbose/composedPhysicsList 2
9+
#/tracking/verbose 1
10+
#//control/cout/ignoreThreadsExcept 0
11+
12+
/mcPhysics/rangeCuts 0.01 mm
1113
/mcTracking/skipNeutrino true
1214
/mcDet/setIsMaxStepInLowDensityMaterials true
1315
/mcDet/setMaxStepInLowDensityMaterials 10 m
@@ -33,5 +35,5 @@
3335
#
3436
# Geant4 VMC >= v3.2
3537
/mcPhysics/emModel/setEmModel SpecialUrbanMsc
36-
/mcPhysics/emModel/setRegions EMCAL_Lead$ EMCAL_Scintillator$
38+
/mcPhysics/emModel/setRegions EMC_Lead$ EMC_Scintillator$
3739
/mcPhysics/emModel/setParticles e- e+

0 commit comments

Comments
 (0)