Hi rooters,
I have a strange problem with a TList.
I wrote the following very simple macro:
#include “TFile.h”
#include “TList.h”
#include “TCut.h”
#include “TCutG.h”
#include “TTree.h”
#include “TString.h”
#include “TCollection.h”
TCut detA = new TCut(“DetA”,“ModuleID==0”);
TList myCutList = new TList();
myCutList->Add(detA);
myCutList->Print();
but when I try to load it with:
.L macro.C
I get the following errors:
root [0] .L Session.C
In file included from input_line_8:1:
/home/mimmi/Session.C:16:1: error: unknown type name ‘myCutList’
myCutList->Add(detA);
^
/home/mimmi/Session.C:16:10: error: cannot use arrow operator on a type
myCutList->Add(detA);
^
/home/mimmi/Session.C:17:1: error: unknown type name ‘myCutList’
myCutList->Add(particle);
^
/home/mimmi/Session.C:17:10: error: cannot use arrow operator on a type
myCutList->Add(particle);
^
/home/mimmi/Session.C:18:1: error: unknown type name ‘myCutList’
myCutList->Add(testPulses);
^
/home/mimmi/Session.C:18:10: error: cannot use arrow operator on a type
myCutList->Add(testPulses);
^
/home/mimmi/Session.C:19:1: error: unknown type name ‘myCutList’
myCutList->Print();
^
/home/mimmi/Session.C:19:10: error: cannot use arrow operator on a type
myCutList->Print();
^
The strange thing is that if I copy&paste each single line fron the macro to the root interactive session, everything works fine!
Can anyone help me?
Thanks in advance!
ROOT Version: 6.10/08
Platform, compiler: Linux Fedora 4.13.16-100.fc25.x86_64, gcc version 6.4.1