How to add code in Readme of chem

Dear friends,
I noticed a hint in the Readme file for chem4:

I have access to a track. How do I access to its molecular information?
#include “G4Molecule.hh”
G4Track* thisIsMytrack = …
G4Molecule* thisIsMyMolecule = GetMolecule(thisIsMyTrack);
If the pointer thisIsMyMolecule is null, then this is NOT a chemical species

How do I get the molecule’s name?
G4Molecule* thisIsMyMolecule = …
const G4String& moleculeName = thisIsMyMolecule->GetName();

I want to know in which file I need to add this code? Just copy the past?

Dear, please see chem3 example. there are some examples