Error in Add Property section in scintillator

I am facing error while running my code which is attached below. Kindly help me in resolving it
Code:

      G4double fraction[2] = {1.0, 1.0};
      G4double rindexNaI[2] = {1.78, 1.78};
      G4double energy[2] = {1.0*MeV,7.0*MeV};
      
   G4MaterialPropertiesTable *mptNaI = new G4MaterialPropertiesTable();
    mptNaI->AddProperty("RINDEX", energy, rindexNaI, 2);
   mptNaI->AddProperty("SCINTILLATIONCOMPONENT1 ", energy, fraction,2);
    mptNaI->AddConstProperty("SCINTILLATIONYIELD",38./keV);
    mptNaI->AddConstProperty("RESOLUTIONSCALE",1.0);
    mptNaI->AddConstProperty("SCINTILLATIONTIMECONSTANT1", 250.*ns);
    mptNaI->AddConstProperty("SCINTILLATIONYIELD1",1.);
    NaI->SetMaterialPropertiesTable(mptNaI);code here

I am getting the following error
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : mat205
issued by : G4MaterialPropertiesTable::AddProperty()
Attempting to create a new material property key SCINTILLATIONCOMPONENT1 without setting
createNewKey parameter of AddProperty to true.
*** Fatal Exception *** core dump ***
**** Track information is not available at this moment
**** Step information is not available at this moment

-------- EEEE -------- G4Exception-END --------- EEEE -------

Try deleting the space between SCINTILLATIONCOMPONENT1 and "

Resolved!
Thank you so much

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.