Hi all,
I am currently trying to simulate the optical process in scint bar. I keep getting this error that includes “NoRINDEX”
*** NoRINDEX ***
** Photon absorbed! **
Photon at Boundary!
thePrePV: Sensor
thePostPV: World
Old Momentum Direction: (0.693987,-0.330524,0.639637)
Old Polarization: (0.577768,-0.274447,-0.768677)
*** NoRINDEX ***
** Photon absorbed! **
** Photon absorbed! **
** Photon absorbed! **
** Photon absorbed! **
Photon at Boundary!
thePrePV: Sensor
thePostPV: World
Old Momentum Direction: (0.173195,0.751267,0.636868)
Old Polarization: (0.147362,0.619594,-0.770965)
*** NoRINDEX ***
** Photon absorbed! **
Photon at Boundary!
thePrePV: Sensor
thePostPV: World
Old Momentum Direction: (-0.624366,0.455517,0.634564)
Old Polarization: (-0.511779,0.375173,-0.77287)
I followed the framework and suggestion based on this forum discussion https://geant4-forum.web.cern.ch/t/optical-photon-at-boundary-lut-unified/5640 however I still keep getting that error.
Here is my code in DetectorConstruction.cc that defines optical properties:
G4Material* scintMat = new G4Material ("plasticScint", 1.03*g/cm3, 1, kStateSolid);
scintMat->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial("G4_POLYSTYRENE"), 1.0);
// ------------ Generate & Add Material Properties Table ------------
// Refractive index needed for Cherenkov process
const G4int nEntries = 32;
G4double photonEnergy[nEntries] ={2.034 * eV, 2.068 * eV, 2.103 * eV, 2.139 * eV,
2.177 * eV, 2.216 * eV, 2.256 * eV, 2.298 * eV,
2.341 * eV, 2.386 * eV, 2.433 * eV, 2.481 * eV,
2.532 * eV, 2.585 * eV, 2.640 * eV, 2.697 * eV,
2.757 * eV, 2.820 * eV, 2.885 * eV, 2.954 * eV,
3.026 * eV, 3.102 * eV, 3.181 * eV, 3.265 * eV,
3.353 * eV, 3.446 * eV, 3.545 * eV, 3.649 * eV,
3.760 * eV, 3.877 * eV, 4.002 * eV, 4.136 * eV};
G4double absorption[nEntries]={3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m, 3.5*m};
G4double refractiveIndex[nEntries] ={1.57 , 1.57 , 1.57 , 1.57 , 1.57 ,
1.57 , 1.57 , 1.57 , 1.57 ,1.57 ,
1.57 , 1.57 , 1.57 , 1.57 ,1.57 ,
1.57 , 1.57 , 1.57 , 1.57 ,1.57 ,
1.57 , 1.57 , 1.57 , 1.57 , 1.57 ,
1.57 , 1.57 , 1.57 , 1.57 , 1.57 ,
1.57 , 1.57 };
G4double ScintilFast[nEntries]={0.019, 0.037, 0.074, 0.111, 0.148, 0.185, 0.148,
0.110, 0.074, 0.037, 0.033, 0.018, 0.006};
G4MaterialPropertiesTable* myMPT1 = new G4MaterialPropertiesTable();
myMPT1->AddProperty("RINDEX", photonEnergy, refractiveIndex, nEntries)->SetSpline(true); // myMPT1->AddProperty("RINDEX", photonEnergy, refractiveIndex, nEntries); makes no difference
myMPT1->AddProperty("ABSLENGTH",photonEnergy,absorption, nEntries); // kept same because of similarity to General G4_POLYSTERENE
// .................................//
// Below are lines taken from scint frame however it crashes the simulation -> overload
// myMPT1->AddProperty("FASTCOMPONENT",photonEnergy, ScintilFast, nEntries);
// myMPT1->AddConstProperty("SCINTILLATIONYIELD",7100./MeV);
// myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
// myMPT1->AddConstProperty("FASTTIMECONSTANT", 7.0*ns);
scintMat->SetMaterialPropertiesTable(myMPT1);
scintMat->GetIonisation()->SetBirksConstant(0.126*mm/MeV); // Accounts for Birks effect in hits
And in my physics list I enabled optical process:
// Optical Physics
G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
RegisterPhysics(opticalPhysics);
opticalPhysics->SetScintillationYieldFactor(1.);
opticalPhysics->SetScintillationExcitationRatio(0.);
opticalPhysics->SetTrackSecondariesFirst(kScintillation,false);
What am I missing? I added RINDEX with AddProperty() over increasing specified range however it still shows RINDEX error when I use muon particle gun. Also the code which I commented regarding myMPT1
// myMPT1->AddProperty("FASTCOMPONENT",photonEnergy, ScintilFast, nEntries);
// myMPT1->AddConstProperty("SCINTILLATIONYIELD",7100./MeV);
// myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
// myMPT1->AddConstProperty("FASTTIMECONSTANT", 7.0*ns);
when ran crashes/ stalls the GEANT4 Visualization. Any help advice would be greatly appreciated!