--- gp2root/gp2root.cpp 2006/04/19 23:35:57 1.1 +++ gp2root/gp2root.cpp 2006/10/22 08:26:36 1.2 @@ -34,7 +34,7 @@ #include "TProfile.h" #include "TGraph.h" #include "TMath.h" -#include "../gpevent.h" +//#include "../gpevent.h" #include "pBlockPointer.h" #include "pEvent.h" @@ -241,115 +241,115 @@ Int_t optcwn = 1; -struct gdata{ - int irun; - int iev; - int ipa; - float x0; - float y0; - float z0; - float theta; - float phi; - float p0; -}; - -union gcdata{ - gdata data; - char c[36]; -}; +// struct gdata{ +// int irun; +// int iev; +// int ipa; +// float x0; +// float y0; +// float z0; +// float theta; +// float phi; +// float p0; +// }; + +// union gcdata{ +// gdata data; +// char c[36]; +// }; -struct general{ +// struct general{ - gcdata dat; +// gcdata dat; - void SetIt(char * buf){ - for(int i=0;i<36;++i) dat.c[i]=*(buf+i); -// irun=*(int *)buf++; -// iev =(int) *buf++; -// ipa =(int) *buf++; -// x0 =(float) *buf++; -// y0 =(float) *buf++; -// z0 =(float) *buf++; -// theta =(float) *buf++; -// phi =(float) *buf++; -// p0 =(float) *buf++; +// void SetIt(char * buf){ +// for(int i=0;i<36;++i) dat.c[i]=*(buf+i); +// // irun=*(int *)buf++; +// // iev =(int) *buf++; +// // ipa =(int) *buf++; +// // x0 =(float) *buf++; +// // y0 =(float) *buf++; +// // z0 =(float) *buf++; +// // theta =(float) *buf++; +// // phi =(float) *buf++; +// // p0 =(float) *buf++; - } +// } - void Print(){ - std::cout << dat.data.irun << ", " << - dat.data.iev << ", " << - dat.data.ipa << ", " << - dat.data.x0 << ", " << - dat.data.y0 << ", " << - dat.data.z0 << ", " << - dat.data.theta << ", " << - dat.data.phi << ", " << - dat.data.p0 << std::endl; - - } -}; - - -struct cascwn { - int nthcas; - int iparcas[50]; - int icas[50]; - float x0[50]; - float y0[50]; - float z0[50]; - float x1[50]; - float y1[50]; - float z1[50]; - float erel[50]; - float time[50]; - float path[50]; - float p0[50]; - -}; - -struct structcas{ - - cascwn *cas; //= new cascwn; - - void SetIt(char * buf){ - cas = (cascwn *) buf; - } - - void Print(){ - std::cout << cas->nthcas << ", " << -// iparcas[0] << ", " << -// x0[0] << ", " << -// y0[0] << ", " << -// z0[0] << ", " << -// erel[0] << ", " << -// p0[0] << - std::endl; - - } - - gpcasdat GetCas(int &i){ - gpcasdat temp; - temp.pathcas=(double *)&cas->path[i]; - temp.icas=&cas->icas[i]; - temp.dat = new gpdat(); - temp.dat->ipart=&cas->iparcas[i]; - temp.dat->xyzin = new coord(); - temp.dat->xyzout = new coord(); - temp.dat->xyzin->x=(double )cas->x0[i]; - temp.dat->xyzin->y=(double )cas->y0[i]; - temp.dat->xyzin->z=(double )cas->z0[i]; - temp.dat->xyzout->x=(double )cas->x1[i]; - temp.dat->xyzout->y=(double )cas->y1[i]; - temp.dat->xyzout->z=(double )cas->z1[i]; - temp.dat->erel=(double *)&cas->erel[i]; - temp.dat->time=(double *)&cas->time[i]; - temp.dat->p=(double *)&cas->p0[i]; - return temp; - } -}; +// void Print(){ +// std::cout << dat.data.irun << ", " << +// dat.data.iev << ", " << +// dat.data.ipa << ", " << +// dat.data.x0 << ", " << +// dat.data.y0 << ", " << +// dat.data.z0 << ", " << +// dat.data.theta << ", " << +// dat.data.phi << ", " << +// dat.data.p0 << std::endl; + +// } +// }; + + +// struct cascwn { +// int nthcas; +// int iparcas[50]; +// int icas[50]; +// float x0[50]; +// float y0[50]; +// float z0[50]; +// float x1[50]; +// float y1[50]; +// float z1[50]; +// float erel[50]; +// float time[50]; +// float path[50]; +// float p0[50]; + +// }; + +// struct structcas{ + +// cascwn *cas; //= new cascwn; + +// void SetIt(char * buf){ +// cas = (cascwn *) buf; +// } + +// void Print(){ +// std::cout << cas->nthcas << ", " << +// // iparcas[0] << ", " << +// // x0[0] << ", " << +// // y0[0] << ", " << +// // z0[0] << ", " << +// // erel[0] << ", " << +// // p0[0] << +// std::endl; + +// } + +// gpcasdat GetCas(int &i){ +// gpcasdat temp; +// temp.pathcas=(double *)&cas->path[i]; +// temp.icas=&cas->icas[i]; +// temp.dat = new gpdat(); +// temp.dat->ipart=&cas->iparcas[i]; +// temp.dat->xyzin = new coord(); +// temp.dat->xyzout = new coord(); +// temp.dat->xyzin->x=(double )cas->x0[i]; +// temp.dat->xyzin->y=(double )cas->y0[i]; +// temp.dat->xyzin->z=(double )cas->z0[i]; +// temp.dat->xyzout->x=(double )cas->x1[i]; +// temp.dat->xyzout->y=(double )cas->y1[i]; +// temp.dat->xyzout->z=(double )cas->z1[i]; +// temp.dat->erel=(double *)&cas->erel[i]; +// temp.dat->time=(double *)&cas->time[i]; +// temp.dat->p=(double *)&cas->p0[i]; +// return temp; +// } +// }; int main(int argc, char **argv) @@ -513,8 +513,8 @@ myevent.AddDetector(p->name); } myevent.Print(); - general mygen; - structcas mycas; +// general mygen; +// structcas mycas; // t=(char *) &mygen; // hbnam(id,PASSCHAR(" "),(int) *t,PASSCHAR("$CLEAR"),0,1,6); // t=(char *) &mycas; @@ -539,7 +539,7 @@ strlen( p->name.c_str() ),4); } } - Long_t add= (Long_t)&mygen; + // Long_t add= (Long_t)&mygen; // Int_t lblock = strlen("GENERAL"); // hbnam(id,PASSCHAR("GENERAL"),add,PASSCHAR("$SET"),ischar,lblock,4); @@ -560,8 +560,8 @@ // hbnam(id,PASSCHAR("CAS"),(Long_t) m.BlockAddress("CAS"), // PASSCHAR("$SET"),ischar,lblock,4); - gpcasdat ttt; - gpcas *tc; +// gpcasdat ttt; +// gpcas *tc; char * junk; for(int i=0;i