Error: cannot convert ‘TBranch*’ to

Hello all,
I have an ana.cxx. I want to run that file with a make file but I encountered with the following error:

How can I fix this error?
Thanks.

Here is the ana.cxx.

[code]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <TROOT.h>
#include <TDirectory.h>
#include <TRint.h>
#include <TThread.h>
#include <TBenchmark.h>
#include “BINAEvent.h”
#include “mwpc_software.h”

int server_portnr=1237;
char server_hostname[500]=“localhost”;
extern unsigned long ourscaler[10];
void* Ana(void* ptr) {

Double_t X[41];
Double_t Y[48];
Double_t BallDet[160];
Double_t BallE[160];
Double_t BalldE[160];
Double_t Balltheta[160];
Double_t Ballphi[160];

TThread::Printf(“Start of Ana %d \n”, ptr);
gBenchmark->Start(“Ana”);
// instantiation of Event and HistogramManager objects
gDirectory->cd("/");
TThread::Lock();
BINAEvent *event = new BINAEvent(server_hostname,server_portnr);
SelectEvent *btree=new SelectEvent();

TFile *nt = new TFile("/media/Transcend/BINA/Ntuples/ElasticLmds/ntupleNov2015_.root",“RECREATE”);

btree->his=new TH2D(“his”,"",100,0,200,100,0,200);
btree->his2=new TH2D(“his2”,"",100,0,200,100,0,200);

TTree *pdelastic = new TTree(“pdelastic”,“BINA p-d Elastic”);
TTree *pdbreakup = new TTree(“pdbreakup”,“BINA p-d Breakup”);

TBranch *b2 = pdelastic->Branch(“b2”,X,“ID/D:WLE:WLtdc:WLdet:WRE:WRtdc:WRdet:WDdE:WDtdc:WDdet:WUdE:WUtdc:WUdet:MWPCX:MWPCY:MWPCU:MWPCtheta:MWPCphi:T1:T2:T3:T4:LiveTime:FC:Pol:pureT1:pureT2:pureT3:pureT4:Time:10kHz:10kHzDT:TotFera:TotFeraDT:BeamCurrent:T2DT:T2DTDsc:EFW:wallhits:EventType:ballhits”);

TBranch *b3 = pdelastic->Branch(“b3”,BallDet,“Bnr[160]/D”);
TBranch *b4 = pdelastic->Branch(“b4”,BallE,“BLE[160]/D”);
TBranch *b5 = pdelastic->Branch(“b5”,BalldE,“BSE[160]/D”);
TBranch *b6 = pdelastic->Branch(“b6”,Balltheta,“Btheta[160]/D”);
TBranch *b7 = pdelastic->Branch(“b7”,Ballphi,“Bphi[160]/D”);

TBranch *b8 = pdbreakup->Branch(“b8”,Y,“ID/D:WLE1:WLtdc1:WLdet1:WRE1:WRtdc1:WRdet1:WDdE1:WDtdc1:WDdet1:WUdE1:WUtdc1:WUdet1:MWPCX1:MWPCY1:MWPCU1:MWPCtheta1:MWPCphi1:WLE2:WLtdc2:WLdet2:WRE2:WRtdc2:WRdet2:WDdE2:WDtdc2:WDdet2:WUdE2:WUtdc2:WUdet2:MWPCX2:MWPCY2:MWPCU2:MWPCtheta2:MWPCphi2:Bnr:BLE:BSE:Btheta:Bphi:ballhits:T1:T2:T3:T4:LiveTime:FC:Pol”);

event->SetName(“BINAEvent”);
gDirectory->Add(event);
TThread::UnLock();
btree->convert();
fprintf(stdout,"\n If you like to inquire about the ntuples type \n ‘pdelastic->Print()’ for elastic channels and \n ‘pdbreakup->Print()’ for breakup channels.\n");
/* main loop to receive information */
int size;
do {

size = event->ReadIn();
TThread::Lock();

if (event->eventType==BINA_EVE)    btree->Wallpoints(event);
else if (event->eventType==BINA_SCALER) btree->Scalerevent(event);
else fprintf(stdout,"Unknown event type\n");

Elasticntuple(b2,b3,b4,b5,b6,b7,btree,pdelastic,X,BallDet,BallE,BalldE,Balltheta,Ballphi,event);
Breakupntuple(b8,btree,pdbreakup,Y);
TThread::UnLock();

if (size==-1) break;

} while(1);
pdelastic->Print(); pdelastic->Write(); delete pdelastic;
pdbreakup->Print(); pdbreakup->Write(); delete pdbreakup;
nt->Write(); nt->Close(); delete nt;

TThread::Printf(“End of Ana\n”);
gBenchmark->Show(“Ana”);

return 0;
}

void print_options()
{
printf("\n Usage: ana [OPTIONS]\n\n") ;
printf(" with following OPTIONS:\n\n");
printf(" -? — This message\n");
printf(" -a [host] — Set server host (default=%s)\n",server_hostname);
printf(" -p [prtno] — Set server port (default=%i)\n",server_portnr);
printf("\n");
return;
}

void read_arguments(unsigned int argc,
char **argv)
{
unsigned int i;

for (i=1;i<argc;i++)
{
if (!(strcmp(argv[i],"-?")))
{
print_options();
exit(0);
}
else if (!(strcmp(argv[i],"-a")))
{
strcpy(server_hostname,argv[i+1]);
i++;
}
else if (!(strcmp(argv[i],"-p")))
{
server_portnr=atoi(argv[i+1]);
i++;
}
}
return;
}

int main(int argc, char **argv)
{
(void) read_arguments(argc,argv);

TRint *theApp = new TRint(“BINA Online analysis”, &argc, argv);
theApp->SetPrompt("BINA Exp.] ");

TThread th = new TThread(“th”, Ana, (void) 0);
th->Run();

theApp->Run();

return 0;
}

[/code]

Hi,

the function “Elasticntuple” expects a pointer of type “SelectEvent” as second argument, while you are passing a pointer to a TBranch, “b3”, which you create like this:

TBranch *b3 = pdelastic->Branch("b3",BallDet,"Bnr[160]/D");

Not being SelectEvent a root class, I cannot help you further.

D