You might use the train during your stay to go to the Barcelona surrounding area such as Sitges or even go to other big cities such as Girona or Tarragona. Rodalies is what we call the regional rail system in Catalonia that goes around the Barcelona metropolitan area and Renfe is what the train company who runs to mid-distance or long-distance. There are 17 lines that are centered in Barcelona area and serve more than 200 stations all around *Catalonia.
To be honest with you and as a local, the service in Rodalaies is not the best it could be, with many incidents in the lines causing delays, but sometimes is the fastest way to get to some places in Catalonia since the bus will take a lot longer and it will stop in every single town on the way.
Rodalies: Barcelona surrounding area
FGC (Ferrocarrils de la Generalitat): Barcelona surrounding area
Renfe: trains to other parts of Catalonia and main cities such as Girona and Tarragona. Renfe also runs long distance trains that connect with other parts of Spain.
AVE: is the high-speed train in Spain by Renfe too that runs through the main cities in Catalonia, Barcelona-Girona-Tarragona- Lleida and also connects with Madrid, Málaga, Zaragoza and San Sebastián as an example.
Tickets can be bought online for Renfe and AVE and Rodalies and FGC need to be bought in the ticket offices in the station, they work pretty much the same as the metro system in Barcelona.