Hello Root-users!
I’m going to explain you my problem.
I’ve a generic class in which I’ve defined this two methods
[quote]class Instrument {
public:
virtual Int_t getNumber() = 0;
virtual TTree *getData(Double_t RUN, Int_t Inst_Number){};
virtual void plotChannel(TTree *T, Int_t Number)=0;
};
[/quote]
After this definition, there’s another class derivated from Instrument. This class overrides the method getData in this way.
This is the class
[quote]class Instrument2:public Instrument
{
private:
Int_t Instrument_Number = 0;
public:
Instrument2();
Instrument2(Int_t Number);
Int_t getNumber() { return this->Instrument_Number; }
void setNumber(Int_t Number) { this->Instrument_Number = Number; }
virtual getData(Double_t RUN, Int_t Inst_Number);
virtual void plotChannel(TTree *T, Int_t Number);
};[/quote]
And this is the getData method override:
[quote]Instrument2::getData(Double_t RUN, Int_t Instr_Number)
{
TFile f(Form("blabla%f.root", RUN));
TTree *inTree = (TTree*)f.Get("GenInfos");
TTree *Tpoint = (TTree*)f.Get(Form("LS_%i", Instr_Number));
return Tpoint;
};[/quote]
When i test this derivate class in a void Instrument2 class
[quote]void Instrument2(){
Instrument *a = new Instrument2(12);
TTree *T1=a->getData( 3.0, 12);
T1->Show(3);
}
[/quote]
CINT says that there’s a wrong assignment in T1. ‘int’ type. I’ve tryed also a (TTree*) casting before a->getData but nothing.
Any ideas?
Thanks
Salvatore Uttaro