How to overlap two different histograms of two different root files but its not working

Many of us are not at CERN. I know very little about this “lxplus”, but have inferred that they are computers at CERN and as such I doubt I have access to them.

How is it not working? Do you get an error? Are you expecting a different result?

You have included your code inline which makes it difficult to read. Could you follow the suggestions in the following post and edit your post accordingly? Also, it appears that your code is still not following the normal tabbing where items of the same scope are at the same indentation, this also make it difficult to read and can help identify mistakes.

You should compile this script until you have improved your programming skills so that your errors are caught (you have a line with a missing semicolon, there are missing statements, missing curly brackets…). Use the following command to compile your scripts and get messages about errors.

root [0] .L script.C+

Please read through all my comments in your script above as you still have not addressed all of these. Finally, some of your code is out of order. Checking if the histograms are valid after trying to do something with them seems counterproductive. Printing the canvas before drawing on it will also leave you with a blank canvas.