When I run this in CINT:
TFile *_file0 = TFile::Open("wood_2.7_0.55_48mln.root");
if(gDirectory->Get("scan")!=NULL) {
scan->SetAlias("costh","-(z-z1v)/sqrt((x-x1v)**2+(y-y1v)**2+(z-z1v)**2)");
}
it runs fine and sets the alias.
However, if I place the IF condition in my .rootlogon.C, and then do (from the command line)
root wood_2.7_0.55_48mln.root
it doesn’t get executed.
My guess is – it’s probably because the .root file gets loaded AFTER .rootlogon.C is executed.
Well, is there a way to reverse this? To force TFile::Open() to go first?
p.s. I realize that this is somewhat confusing…my final goal is to get an alias set up for the TTree scan, IF that tree is present.