Material properties issue

I am simulating a module as follows:
Gagg-PBf2-EJ262-PBF2-EJ228

I am giving the beam as electron 1GeV, and I see no light pr shower propagation after the first Pbf2, that is my EJ262, which is a plastic scintillator, is not propagating light.

The material properties for EJ262, i am using is:
G4Material* MyMaterials::EJ262(double user_lightyield, double scaleFactor) {
G4double a, z, density;
G4Element* H = new G4Element(“Hydrogen”, “H”, z = 1., a = 1.01 * g / mole);
G4Element* C = new G4Element(“Carbon”, “C”, z = 6., a = 12.01 * g / mole);

G4Material* mat = new G4Material("EJ-262", density = 1.023 * g / cm3, 2);
mat->AddElement(H, 10);
mat->AddElement(C, 9);

double standard_light_yield = 8700; // photons/1 MeV e-
double lightyield = (user_lightyield < 0) ? standard_light_yield : user_lightyield;

const G4int nEntries = 100;
G4double PhotonEnergy[nEntries] = {
    2 * eV, 2.0303 * eV, 2.0606 * eV, 2.0909 * eV, 2.1212 * eV, 2.1515 * eV, 2.1818 * eV, 2.2121 * eV, 2.2424 * eV, 2.2727 * eV,
    2.303 * eV, 2.3333 * eV, 2.3636 * eV, 2.3939 * eV, 2.4242 * eV, 2.4545 * eV, 2.4848 * eV, 2.5152 * eV, 2.5455 * eV, 2.5758 * eV,
    2.6061 * eV, 2.6364 * eV, 2.6667 * eV, 2.697 * eV, 2.7273 * eV, 2.7576 * eV, 2.7879 * eV, 2.8182 * eV, 2.8485 * eV, 2.8788 * eV,
    2.9091 * eV, 2.9394 * eV, 2.9697 * eV, 3 * eV, 3.0303 * eV, 3.0606 * eV, 3.0909 * eV, 3.1212 * eV, 3.1515 * eV, 3.1818 * eV,
    3.2121 * eV, 3.2424 * eV, 3.2727 * eV, 3.303 * eV, 3.3333 * eV, 3.3636 * eV, 3.3939 * eV, 3.4242 * eV, 3.4545 * eV, 3.4848 * eV,
    3.5152 * eV, 3.5455 * eV, 3.5758 * eV, 3.6061 * eV, 3.6364 * eV, 3.6667 * eV, 3.697 * eV, 3.7273 * eV, 3.7576 * eV, 3.7879 * eV,
    3.8182 * eV, 3.8485 * eV, 3.8788 * eV, 3.9091 * eV, 3.9394 * eV, 3.9697 * eV, 4 * eV, 4.0303 * eV, 4.0606 * eV, 4.0909 * eV,
    4.1212 * eV, 4.1515 * eV, 4.1818 * eV, 4.2121 * eV, 4.2424 * eV, 4.2727 * eV, 4.303 * eV, 4.3333 * eV, 4.3636 * eV, 4.3939 * eV,
    4.4242 * eV, 4.4545 * eV, 4.4848 * eV, 4.5152 * eV, 4.5455 * eV, 4.5758 * eV, 4.6061 * eV, 4.6364 * eV, 4.6667 * eV, 4.697 * eV,
    4.7273 * eV, 4.7576 * eV, 4.7879 * eV, 4.8182 * eV, 4.8485 * eV, 4.8788 * eV, 4.9091 * eV, 4.9394 * eV, 4.9697 * eV, 5 * eV
};

G4double AbsLength[nEntries] = {
    0.8618, 0.8618, 0.9778, 0.8618, 0.8618, 0.8618, 0.8618, 0.8618, 0.8634, 0.8618,
    0.8618, 0.8618, 0.8618, 0.8618, 0.8618, 0.8618, 0.8528, 0.8618, 0.8618, 0.8618,
    0.7287, 0.6155, 0.4051, 0.2227, 0.1249, 0.0789, 0.0588, 0.0498, 0.045, 0.0419,
    0.0389, 0.0362, 0.0346, 0.0338, 0.0334, 0.0327, 0.0313, 0.0298, 0.0289, 0.0286,
    0.029, 0.0296, 0.0302, 0.0309, 0.0318, 0.0331, 0.0344, 0.0349, 0.0351, 0.0353,
    0.0355, 0.0357, 0.0359, 0.0361, 0.0363, 0.0365, 0.0368, 0.037, 0.0372, 0.0374,
    0.0377, 0.0379, 0.0382, 0.0384, 0.0386, 0.0389, 0.0391, 0.0394, 0.0397, 0.0399,
    0.0402, 0.0405, 0.0407, 0.041, 0.0413, 0.0416, 0.0419, 0.0422, 0.0425, 0.0428,
    0.0431, 0.0434, 0.0437, 0.044, 0.0443, 0.0446, 0.045, 0.0453, 0.0457, 0.046,
    0.0464, 0.0467, 0.0471, 0.0475, 0.0478, 0.0482, 0.0486, 0.049, 0.0494, 0.0498
};

G4double Emission[nEntries] = {
    0.0206, 0.0272, 0.0385, 0.0553, 0.0773, 0.1017, 0.1259, 0.1533, 0.1927, 0.2542,
    0.3247, 0.3903, 0.4494, 0.4926, 0.5817, 0.7021, 0.8438, 0.9381, 0.9688, 0.9367,
    0.8862, 0.8412, 0.7779, 0.6201, 0.42, 0.2738, 0.1792, 0.1333, 0.1073, 0.0979,
    0.0987, 0.0959, 0.0966, 0.1003, 0.0977, 0.0899, 0.0838, 0.0756, 0.0722, 0.0741,
    0.0725, 0.0759, 0.078, 0.0807, 0.0785, 0.0825, 0.0818, 0.0824, 0.0854, 0.0824,
    0.0848, 0.0853, 0.0821, 0.083, 0.0803, 0.079, 0.0792, 0.0769, 0.0775, 0.0782,
    0.0748, 0.0739, 0.073, 0.0706, 0.0708, 0.0687, 0.0656, 0.0641, 0.063, 0.0621,
    0.0595, 0.0576, 0.0563, 0.0546, 0.0512, 0.0503, 0.0495, 0.0469, 0.0443, 0.0437,
    0.041, 0.0404, 0.0385, 0.0377, 0.0355, 0.0339, 0.0323, 0.0305, 0.0296, 0.0272,
    0.0259, 0.0246, 0.0228, 0.0206, 0.0185, 0.0168, 0.0153, 0.0142, 0.0135, 0.013
};

G4double RefractiveIndex[nEntries] = {
    1.5849, 1.5854, 1.5859, 1.5864, 1.5869, 1.5874, 1.5879, 1.5884, 1.5889, 1.5894,
    1.5899, 1.5904, 1.5909, 1.5914, 1.5919, 1.5924, 1.5929, 1.5934, 1.5939, 1.5944,
    1.5949, 1.5954, 1.5959, 1.5964, 1.5969, 1.5974, 1.5979, 1.5984, 1.5989, 1.5994,
    1.5999, 1.6004, 1.6009, 1.6014, 1.6019, 1.6024, 1.6029, 1.6034, 1.6039, 1.6044,
    1.6049, 1.6054, 1.6059, 1.6064, 1.6069, 1.6074, 1.6079, 1.6084, 1.6089, 1.6094,
    1.6099, 1.6104, 1.6109, 1.6114, 1.6119, 1.6124, 1.6129, 1.6134, 1.6139, 1.6144,
    1.6149, 1.6154, 1.6159, 1.6164, 1.6169, 1.6174, 1.6179, 1.6184, 1.6189, 1.6194,
    1.6199, 1.6204, 1.6209, 1.6214, 1.6219, 1.6224, 1.6229, 1.6234, 1.6239, 1.6244,
    1.6249, 1.6254, 1.6259, 1.6264, 1.6269, 1.6274, 1.6279, 1.6284, 1.6289, 1.6294,
    1.6299, 1.6304, 1.6309, 1.6314, 1.6319, 1.6324, 1.6329, 1.6334, 1.6339, 1.6344
};

G4MaterialPropertiesTable* MPT = new G4MaterialPropertiesTable();

MPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
MPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsLength, nEntries);
MPT->AddProperty("SCINTILLATIONCOMPONENT1", PhotonEnergy, Emission, nEntries);
MPT->AddConstProperty("SCINTILLATIONYIELD", lightyield / MeV);
MPT->AddConstProperty("RESOLUTIONSCALE", 1.0);
MPT->AddConstProperty("SCINTILLATIONTIMECONSTANT1", 2.1 * ns);
MPT->AddConstProperty("SCINTILLATIONYIELD1", 1.0);
MPT->AddConstProperty("SCINTILLATIONYIELD2", 0.0);

mat->SetMaterialPropertiesTable(MPT);

return mat;

}

if someone has suggestion on why i have this issue, please let me know!

What PhysicsList are you using?

i a using the G4Material MyMaterials properties of the materials

Sorry, I meant in your application, how are you constructing the user physics list, which is separate from materials, e.g.

// Physics list
  auto physicsList = new QBBC;
  physicsList->SetVerboseLevel(1);
  runManager->SetUserInitialization(physicsList);

i.e. just to check that the appropriate optical physics processes are being used.

physName = Parameters::Instance()->main_config.physics_list;

std::cout << "Using physics list: " << physName << std::endl;

// UserInitialization classes - mandatory
//

G4cout << “>>> Define physics list::begin <<<” << G4endl;
double defaultCutValue = Parameters::Instance()->main_config.defaultCut;
G4double defaultCut = defaultCutValue * mm;
G4cout << “> Default production cut set to " << defaultCut << " mm” << G4endl;
G4VModularPhysicsList* physics = factory.GetReferencePhysList(physName);
physics->SetVerboseLevel(0);
physics->SetDefaultCutValue(defaultCut);
physics->RegisterPhysics(new G4EmUserPhysics(Parameters::Instance()->main_config.switchOnScintillation,Parameters::Instance()->main_config.switchOnCerenkov));

runManager-> SetUserInitialization(physics);
G4cout << “>>> Define physics list::end <<<” << G4endl;

G4cout << “>>> Define DetectorConstruction::begin <<<” << G4endl;
DetectorConstruction* detector = new DetectorConstruction(argv[1]);
runManager-> SetUserInitialization(detector);
G4cout << “>>> Define DetectorConstruction::end <<<” << G4endl;

G4cout << “>>> Define PrimaryGeneratorAction::begin <<<” << G4endl;

, i suppose you mean this?

Thanks, yes, just to clarify

what is the value of physName here as that determines the actual list used.

also to clarify, what version of Geant4 is this being built against? G4EmUserPhysics is only in rather old versions IIRC.

physName = Parameters::Instance()->main_config.physics_list;

std::cout << "Using physics list: " << physName << std::endl;

std::string physName(“”);

G4PhysListFactory factory;
const std::vector& names = factory.AvailablePhysLists();

// structures for main config file and for module config files
Data_t main_config;
std::vector<Data_t> module_config;

#define G4VERSION_TAG "$Name: geant4-10-06-patch-02

this all i suppose?

is there anything else?

Do you have a refractive index defined for PbF2?

yes,

//--------------------------//
// PbF2 //
//--------------------------//
G4Material *MyMaterials::PbF2(G4double lightyield,G4double resolutionScale)
{
G4double density;
G4int nelements;
//PbF2

G4Material *mat = new G4Material (“PbF2”, density = 7.77 *g/cm3, 2, kStateSolid);
mat->AddElement(Pb,1);
mat->AddElement(F,2);

//PbF2
const G4int PbF2_NUMENTRIES_1 = 82;
G4double PbF2_FAST_Energy[PbF2_NUMENTRIES_1] = {3.77040860233365eV, 3.61585235867366eV, 3.53140914873929eV, 3.45082003941488eV, 3.37382797640524eV, 3.30019563221144eV, 3.23959353408589eV, 3.21011952704912eV, 3.17164484535450eV, 3.14338888200161eV, 3.10648875072251eV, 3.07937684280798eV, 3.05273407926177eV, 3.03522639841588eV, 3.01791912298039eV, 3.00080810535235eV, 2.99232479188995eV, 2.98388930803080eV, 2.95886652908419eV, 2.94241676857188eV, 2.91808189363016eV, 2.90208126436090eV, 2.89414623386354eV, 2.87840631146125eV, 2.87060004547027eV, 2.85511450968779eV, 2.83979450139379eV, 2.83219663242935eV, 2.81712093376006eV, 2.80220551360321eV, 2.79480656012035eV, 2.78012587810855eV, 2.76559862083641eV, 2.74408988238856eV, 2.72291311954838eV, 2.68833523989256eV, 2.65462511529282eV, 2.62174993085634eV, 2.58335857867149eV, 2.55221449223097eV, 2.50985297957746eV, 2.48627176540535eV, 2.45741150672681eV, 2.44041463626819eV, 2.42921357075978eV, 2.41811438564507eV, 2.39621846230377eV, 2.38541807149944eV, 2.36410766328197eV, 2.35883919770931eV, 2.34317419881547eV, 2.32771588912495eV, 2.31246020475876eV, 2.30240050181524eV, 2.28747377956199eV, 2.27273935387774eV, 2.25819353259492eV, 2.24383271746619eV, 2.22965340119699eV, 2.21102394892551eV, 2.19270322692913eV, 2.17022518952495eV, 2.14385233614028eV, 2.11811275965203eV, 2.09298392087343eV, 2.06441012881293eV, 2.04053218738336eV, 2.01336364231269eV, 1.99064545944511eV, 1.96114003938097eV, 1.93249680644733eV, 1.89445158995505eV, 1.86442015991700eV, 1.83214918680001eV, 1.79791749561215eV, 1.75324804790486eV, 1.71629203956926eV, 1.67554054054054eV, 1.65458786830393eV, 1.64225165562914eV};
G4double PbF2_FAST_COMPONENT[PbF2_NUMENTRIES_1] = {0.002041054182111, 0.002219269223948, 0.009306690784171, 0.017049024956026, 0.035679677835476, 0.058594494072484, 0.085689649997522, 0.115419170773643, 0.144187811114547, 0.182030090942073, 0.216438371499533, 0.253915993265593, 0.292607006633558, 0.318039236557389, 0.350360039139377, 0.376922558513944, 0.388774626135172, 0.41704676738375, 0.457262675199632, 0.495893419979575, 0.551893642684025, 0.592447977140537, 0.630331781138524, 0.661748455280689, 0.686479417669235, 0.715303019136405, 0.744618692337455, 0.773940296285538, 0.804171678771895, 0.834926126581869, 0.857915322012682, 0.89327832355784, 0.929231443516381, 0.96697544598151, 1.00555566103964, 1.05165135618158, 1.09911711197258, 1.13107580839577, 1.16059577034025, 1.18463907821213, 1.21575319428376, 1.22014873336624, 1.22496661876872, 1.22260134565886, 1.21423414140848, 1.20061004996834, 1.18222520202002, 1.16237489297545, 1.15227568459528, 1.12614005973959, 1.10427044496425, 1.08151597124141, 1.05242461864591, 1.0178691516744, 0.98683474211791, 0.954749645526535, 0.921569354792846, 0.887316438523992, 0.857782078713543, 0.818897621360131, 0.754203111068263, 0.702159272294626, 0.650115831695716, 0.607805349841931, 0.549647113475471, 0.483288487364082, 0.431968931438889, 0.386442288077889, 0.344079370268331, 0.294156892073653, 0.233039005628303, 0.177815311598429, 0.158572967031361, 0.120988788026388, 0.080758881004827, 0.056636432724791, 0.049251447274109, 0.03100578584872, 0.031796033968499, 0};
const G4int PbF2_NUMENTRIES_2 = 101;
G4double PbF2_RIND_Energy[PbF2_NUMENTRIES_2] = {4.13280624776999eV, 3.98406771957261eV, 3.83970849901207eV, 3.70102052039104eV, 3.56686385020425eV, 3.43827474856072eV, 3.31419907599839eV, 3.19382244804481eV, 3.07882263305438eV, 2.96754876575155eV, 2.86007352786851eV, 2.75704219330887eV, 2.65718361408272eV, 2.56112760655029eV, 2.46882093654121eV, 2.37927820827288eV, 2.29345518744173eV, 2.2104508367463eV, 2.130678594829eV, 2.05373840372867eV, 1.97962936984033eV, 1.90803612547091eV, 1.83898231137793eV, 1.77246872670621eV, 1.70847715906159eV, 1.64675504626245eV, 1.58730236119703eV, 1.52991346783193eV, 1.47459785243934eV, 1.42134801597042eV, 1.36999102136022eV, 1.3205260137725eV, 1.27280759093625eV, 1.22635200230564eV, 1.18192743024881eV, 1.13956054626011eV, 1.0981770366085eV, 1.05878896185397eV, 1.0204459871037eV, 0.984001487564283eV, 0.947891341231649eV, 0.913663872019895eV, 0.880569513019174eV, 0.849206763240409eV, 0.818377474805939eV, 0.788703482398853eV, 0.760172823011034eV, 0.732767065207445eV, 0.706462606456409eV, 0.680857701444809eV, 0.656348265924297eV, 0.632572384862754eV, 0.609558443623892eV, 0.587602784043127eV, 0.5663964706857eV, 0.545945343166445eV, 0.526248673315364eV, 0.507092791137422eV, 0.488896638143138eV, 0.471243585834663eV, 0.454154532721977eV, 0.437797272009533eV, 0.421858412497787eV, 0.406638856782879eV, 0.391982887869427eV, 0.377770223744972eV, 0.364123898481937eV, 0.351031108247734eV, 0.338292462300408eV, 0.326102544537348eV, 0.314281843936881eV, 0.302917633601514eV, 0.292002325560762eV, 0.281462400529171eV, 0.271300191319693eV, 0.261459695135174eV, 0.252000380961585eV, 0.242915727729427eV, 0.234153328485552eV, 0.225671982950673eV, 0.217516118303684eV, 0.209645227313324eV, 0.202093215049877eV, 0.194790553704791eV, 0.187741046991368eV, 0.180972394443293eV, 0.174429076298677eV, 0.168114152451661eV, 0.16204965028506eV, 0.156190712311791eV, 0.150539324226687eV, 0.145095596761966eV, 0.139858079450761eV, 0.134809380703599eV, 0.129935220533536eV, 0.125236552962727eV, 0.120724622622298eV, 0.116307868136116eV, 0.112101435292134eV, 0.108094322086399eV, 0.104188392800924*eV};
G4double PbF2_RIND_INDEX[PbF2_NUMENTRIES_2] = {1.9366477482629, 1.907713837029, 1.8870285413917, 1.870522047389, 1.8565876645108, 1.8446346232466, 1.8341555602979, 1.8248299379479, 1.8165989012136, 1.8091991228596, 1.8025312116485, 1.7965456267547, 1.7910968854074, 1.7861617965912, 1.7816854577206, 1.7775788314559, 1.7738497142031, 1.7704267603292, 1.7672999274694, 1.7644291641612, 1.7617935623815, 1.75936375557, 1.7571246899808, 1.7550618288605, 1.7531612869023, 1.7514038155844, 1.7497790167024, 1.7482719679248, 1.7468745746446, 1.7455788691476, 1.7443736238006, 1.7432524703986, 1.7422063257775, 1.7412197915605, 1.7403043697981, 1.7394553734885, 1.7386472186123, 1.7378959030175, 1.7371796597281, 1.7365110824583, 1.7358585724556, 1.7352473370788, 1.7346610637039, 1.7341077137205, 1.7335636842575, 1.7330375633959, 1.7325268608535, 1.7320290952581, 1.7315418165302, 1.7310554130296, 1.7305753111046, 1.7300923952015, 1.7296049007058, 1.7291172553709, 1.7286208502831, 1.7281136604105, 1.7275935803667, 1.7270523709363, 1.7264999569353, 1.725921892021, 1.7253157498993, 1.7246851741899, 1.7240151111927, 1.7233153021148, 1.722576651744, 1.7217894951148, 1.7209571280423, 1.7200763435196, 1.7191294205286, 1.7181265965972, 1.7170490474021, 1.7158996312319, 1.714673833708, 1.7133585796608, 1.7119481996885, 1.7104277939989, 1.7087995713843, 1.7070570931233, 1.7051836947417, 1.7031610140419, 1.7009902723178, 1.6986515745354, 1.6961460875363, 1.6934402968031, 1.690521539094, 1.6873894445811, 1.6840047347376, 1.6803512960725, 1.6764266733359, 1.6721846292197, 1.6676047056206, 1.6626653252172, 1.6573437317915, 1.6515982712367, 1.6453830690953, 1.6386667305904, 1.6314358563797, 1.6234911983637, 1.6149933418593, 1.6059097514272, 1.5959699135076};
G4MaterialPropertiesTable *MPT_PbF2 = new G4MaterialPropertiesTable();
const G4int NUMENTRIES_3 = 9;
G4double ABS_Energy[NUMENTRIES_3] = { 1.00 * eV , 2.82 * eV , 2.88 * eV , 2.95 * eV , 3.02 * eV , 3.10 * eV , 3.18 * eV , 3.26 * eV , 4.08 * eV };
G4double ABS_LENGTH[NUMENTRIES_3] = { 438.*m , 438.*m , 413.*m , 375.*m , 263.*m , 87.5 * m , 11.5 * m , 1.0 * m , 1.0 * m };
MPT_PbF2->AddProperty (“FASTCOMPONENT”, PbF2_FAST_Energy , PbF2_FAST_COMPONENT, PbF2_NUMENTRIES_1);
MPT_PbF2->AddProperty (“RINDEX”, PbF2_RIND_Energy , PbF2_RIND_INDEX, PbF2_NUMENTRIES_2);
MPT_PbF2->AddProperty (“ABSLENGTH”, ABS_Energy , ABS_LENGTH, NUMENTRIES_3);
// MPT_BGO->AddProperty (“RAYLEIGH”, RayleighEner, Rayleigh, NUMENTRIES_4);
MPT_PbF2->AddConstProperty (“SCINTILLATIONYIELD”, lightyield / MeV);
MPT_PbF2->AddConstProperty (“RESOLUTIONSCALE”, resolutionScale);
MPT_PbF2->AddConstProperty (“FASTTIMECONSTANT”, 0.001 * ns);
MPT_PbF2->AddConstProperty (“YIELDRATIO”, 1.0);
MPT_PbF2->AddConstProperty (“FASTSCINTILLATIONRISETIME”, 0.001 * ns);
mat->SetMaterialPropertiesTable (MPT_PbF2);
AddMaterialToList(mat->GetName()); // always save the material in the list (function will check if it is not already there)

return mat;
}
//--------------------------//

refractive index highlighted in bold, which is in the range: of 1.5 to 1.9

One point is that the values and energies in material properties need to be arranged in order of increasing energy.

Other than that, I’m not clear what is not propagating light. Are scintillation photons generated? In which material? In which material do they not propagate? How do you know (vis, verbosity, …)

I arranged the energy in the increasing order, still I don’t get any light from EJ262 (properties I listed above)
I have yes switched on scintillation light, light propagates from PbF2, but does not exit EJ262, which is my whole issue.

I’d suggest choosing either the new style, with up to 3 components numbered 1,2,3, or the old style with FAST and SLOW components (and times, etc.) In 10.7 the idea was to select one or the other. In 11.0 and after there is only the 3 component version. If you use the 3 component version in 10.7, you need to specify setEnhancedTimeConstants.