| 34 |
#include "TProfile.h" |
#include "TProfile.h" |
| 35 |
#include "TGraph.h" |
#include "TGraph.h" |
| 36 |
#include "TMath.h" |
#include "TMath.h" |
| 37 |
#include "../gpevent.h" |
//#include "../gpevent.h" |
| 38 |
#include "pBlockPointer.h" |
#include "pBlockPointer.h" |
| 39 |
#include "pEvent.h" |
#include "pEvent.h" |
| 40 |
|
|
| 241 |
Int_t optcwn = 1; |
Int_t optcwn = 1; |
| 242 |
|
|
| 243 |
|
|
| 244 |
struct gdata{ |
// struct gdata{ |
| 245 |
int irun; |
// int irun; |
| 246 |
int iev; |
// int iev; |
| 247 |
int ipa; |
// int ipa; |
| 248 |
float x0; |
// float x0; |
| 249 |
float y0; |
// float y0; |
| 250 |
float z0; |
// float z0; |
| 251 |
float theta; |
// float theta; |
| 252 |
float phi; |
// float phi; |
| 253 |
float p0; |
// float p0; |
| 254 |
}; |
// }; |
| 255 |
|
|
| 256 |
union gcdata{ |
// union gcdata{ |
| 257 |
gdata data; |
// gdata data; |
| 258 |
char c[36]; |
// char c[36]; |
| 259 |
}; |
// }; |
| 260 |
|
|
| 261 |
|
|
| 262 |
struct general{ |
// struct general{ |
| 263 |
|
|
| 264 |
gcdata dat; |
// gcdata dat; |
| 265 |
|
|
| 266 |
|
|
| 267 |
void SetIt(char * buf){ |
// void SetIt(char * buf){ |
| 268 |
for(int i=0;i<36;++i) dat.c[i]=*(buf+i); |
// for(int i=0;i<36;++i) dat.c[i]=*(buf+i); |
| 269 |
// irun=*(int *)buf++; |
// // irun=*(int *)buf++; |
| 270 |
// iev =(int) *buf++; |
// // iev =(int) *buf++; |
| 271 |
// ipa =(int) *buf++; |
// // ipa =(int) *buf++; |
| 272 |
// x0 =(float) *buf++; |
// // x0 =(float) *buf++; |
| 273 |
// y0 =(float) *buf++; |
// // y0 =(float) *buf++; |
| 274 |
// z0 =(float) *buf++; |
// // z0 =(float) *buf++; |
| 275 |
// theta =(float) *buf++; |
// // theta =(float) *buf++; |
| 276 |
// phi =(float) *buf++; |
// // phi =(float) *buf++; |
| 277 |
// p0 =(float) *buf++; |
// // p0 =(float) *buf++; |
| 278 |
|
|
| 279 |
} |
// } |
| 280 |
|
|
| 281 |
void Print(){ |
// void Print(){ |
| 282 |
std::cout << dat.data.irun << ", " << |
// std::cout << dat.data.irun << ", " << |
| 283 |
dat.data.iev << ", " << |
// dat.data.iev << ", " << |
| 284 |
dat.data.ipa << ", " << |
// dat.data.ipa << ", " << |
| 285 |
dat.data.x0 << ", " << |
// dat.data.x0 << ", " << |
| 286 |
dat.data.y0 << ", " << |
// dat.data.y0 << ", " << |
| 287 |
dat.data.z0 << ", " << |
// dat.data.z0 << ", " << |
| 288 |
dat.data.theta << ", " << |
// dat.data.theta << ", " << |
| 289 |
dat.data.phi << ", " << |
// dat.data.phi << ", " << |
| 290 |
dat.data.p0 << std::endl; |
// dat.data.p0 << std::endl; |
| 291 |
|
|
| 292 |
} |
// } |
| 293 |
}; |
// }; |
| 294 |
|
|
| 295 |
|
|
| 296 |
struct cascwn { |
// struct cascwn { |
| 297 |
int nthcas; |
// int nthcas; |
| 298 |
int iparcas[50]; |
// int iparcas[50]; |
| 299 |
int icas[50]; |
// int icas[50]; |
| 300 |
float x0[50]; |
// float x0[50]; |
| 301 |
float y0[50]; |
// float y0[50]; |
| 302 |
float z0[50]; |
// float z0[50]; |
| 303 |
float x1[50]; |
// float x1[50]; |
| 304 |
float y1[50]; |
// float y1[50]; |
| 305 |
float z1[50]; |
// float z1[50]; |
| 306 |
float erel[50]; |
// float erel[50]; |
| 307 |
float time[50]; |
// float time[50]; |
| 308 |
float path[50]; |
// float path[50]; |
| 309 |
float p0[50]; |
// float p0[50]; |
| 310 |
|
|
| 311 |
}; |
// }; |
| 312 |
|
|
| 313 |
struct structcas{ |
// struct structcas{ |
| 314 |
|
|
| 315 |
cascwn *cas; //= new cascwn; |
// cascwn *cas; //= new cascwn; |
| 316 |
|
|
| 317 |
void SetIt(char * buf){ |
// void SetIt(char * buf){ |
| 318 |
cas = (cascwn *) buf; |
// cas = (cascwn *) buf; |
| 319 |
} |
// } |
| 320 |
|
|
| 321 |
void Print(){ |
// void Print(){ |
| 322 |
std::cout << cas->nthcas << ", " << |
// std::cout << cas->nthcas << ", " << |
| 323 |
// iparcas[0] << ", " << |
// // iparcas[0] << ", " << |
| 324 |
// x0[0] << ", " << |
// // x0[0] << ", " << |
| 325 |
// y0[0] << ", " << |
// // y0[0] << ", " << |
| 326 |
// z0[0] << ", " << |
// // z0[0] << ", " << |
| 327 |
// erel[0] << ", " << |
// // erel[0] << ", " << |
| 328 |
// p0[0] << |
// // p0[0] << |
| 329 |
std::endl; |
// std::endl; |
| 330 |
|
|
| 331 |
} |
// } |
| 332 |
|
|
| 333 |
gpcasdat GetCas(int &i){ |
// gpcasdat GetCas(int &i){ |
| 334 |
gpcasdat temp; |
// gpcasdat temp; |
| 335 |
temp.pathcas=(double *)&cas->path[i]; |
// temp.pathcas=(double *)&cas->path[i]; |
| 336 |
temp.icas=&cas->icas[i]; |
// temp.icas=&cas->icas[i]; |
| 337 |
temp.dat = new gpdat(); |
// temp.dat = new gpdat(); |
| 338 |
temp.dat->ipart=&cas->iparcas[i]; |
// temp.dat->ipart=&cas->iparcas[i]; |
| 339 |
temp.dat->xyzin = new coord(); |
// temp.dat->xyzin = new coord(); |
| 340 |
temp.dat->xyzout = new coord(); |
// temp.dat->xyzout = new coord(); |
| 341 |
temp.dat->xyzin->x=(double )cas->x0[i]; |
// temp.dat->xyzin->x=(double )cas->x0[i]; |
| 342 |
temp.dat->xyzin->y=(double )cas->y0[i]; |
// temp.dat->xyzin->y=(double )cas->y0[i]; |
| 343 |
temp.dat->xyzin->z=(double )cas->z0[i]; |
// temp.dat->xyzin->z=(double )cas->z0[i]; |
| 344 |
temp.dat->xyzout->x=(double )cas->x1[i]; |
// temp.dat->xyzout->x=(double )cas->x1[i]; |
| 345 |
temp.dat->xyzout->y=(double )cas->y1[i]; |
// temp.dat->xyzout->y=(double )cas->y1[i]; |
| 346 |
temp.dat->xyzout->z=(double )cas->z1[i]; |
// temp.dat->xyzout->z=(double )cas->z1[i]; |
| 347 |
temp.dat->erel=(double *)&cas->erel[i]; |
// temp.dat->erel=(double *)&cas->erel[i]; |
| 348 |
temp.dat->time=(double *)&cas->time[i]; |
// temp.dat->time=(double *)&cas->time[i]; |
| 349 |
temp.dat->p=(double *)&cas->p0[i]; |
// temp.dat->p=(double *)&cas->p0[i]; |
| 350 |
return temp; |
// return temp; |
| 351 |
} |
// } |
| 352 |
}; |
// }; |
| 353 |
|
|
| 354 |
|
|
| 355 |
int main(int argc, char **argv) |
int main(int argc, char **argv) |
| 513 |
myevent.AddDetector(p->name); |
myevent.AddDetector(p->name); |
| 514 |
} |
} |
| 515 |
myevent.Print(); |
myevent.Print(); |
| 516 |
general mygen; |
// general mygen; |
| 517 |
structcas mycas; |
// structcas mycas; |
| 518 |
// t=(char *) &mygen; |
// t=(char *) &mygen; |
| 519 |
// hbnam(id,PASSCHAR(" "),(int) *t,PASSCHAR("$CLEAR"),0,1,6); |
// hbnam(id,PASSCHAR(" "),(int) *t,PASSCHAR("$CLEAR"),0,1,6); |
| 520 |
// t=(char *) &mycas; |
// t=(char *) &mycas; |
| 539 |
strlen( p->name.c_str() ),4); |
strlen( p->name.c_str() ),4); |
| 540 |
} |
} |
| 541 |
} |
} |
| 542 |
Long_t add= (Long_t)&mygen; |
// Long_t add= (Long_t)&mygen; |
| 543 |
// Int_t lblock = strlen("GENERAL"); |
// Int_t lblock = strlen("GENERAL"); |
| 544 |
|
|
| 545 |
// hbnam(id,PASSCHAR("GENERAL"),add,PASSCHAR("$SET"),ischar,lblock,4); |
// hbnam(id,PASSCHAR("GENERAL"),add,PASSCHAR("$SET"),ischar,lblock,4); |
| 560 |
// hbnam(id,PASSCHAR("CAS"),(Long_t) m.BlockAddress("CAS"), |
// hbnam(id,PASSCHAR("CAS"),(Long_t) m.BlockAddress("CAS"), |
| 561 |
// PASSCHAR("$SET"),ischar,lblock,4); |
// PASSCHAR("$SET"),ischar,lblock,4); |
| 562 |
|
|
| 563 |
gpcasdat ttt; |
// gpcasdat ttt; |
| 564 |
gpcas *tc; |
// gpcas *tc; |
| 565 |
char * junk; |
char * junk; |
| 566 |
for(int i=0;i<nentries;++i){ |
for(int i=0;i<nentries;++i){ |
| 567 |
hgnt(id,i+1,ierr); |
hgnt(id,i+1,ierr); |