4 int problemCounter = 0;
5 gSystem->Load(
"libTable");
14 memset(&a,0,
sizeof(a));
16 for (i=0; i<100; i++) {
17 a.energy = sin(i*0.1);
23 allHits->Draw(
"energy");
25 printf(
"\n\n Print out the hit table descriptor: \n");
27 TFile ff(
"generic.root",
"RECREATE");
36 if ( indxRandom.
GetRowSize() !=
sizeof(int) ) {
37 printf(
" The empty index table has been created. The row size = %d\n",indxRandom.
GetRowSize());
40 for (i=0; i<100; i++) {
41 indxRandom.push_back(rndIndex.Integer(100));
48 for (;first != last; ++first,i++) {
49 if ( (
int)first != ((
hit *)*first)->detectorId )
51 printf(
" *** Error ***. %d-th index does point to right row of %s table. It points to %d:%d row instead\n",
52 i,indxRandom.GetName(),((
hit *)*first)->detectorId,(int)first);
57 first = indxSeq.begin();
61 for (;first != last; ++first,i++) {
62 if ( i != ((
hit *)*first)->detectorId )
64 printf(
" *** Error ***. %d-th index does point to right row of %s table. It points to energy= %f; id=%d:%d row instead\n",
65 i,indxSeq.GetName(),((
hit *)*first)->energy, ((
hit *)*first)->detectorId,(int)first);
70 if (problemCounter) printf(
"There were several problem detected !!!\n");
71 else printf(
" no problem have been found\n");
virtual Long_t GetRowSize() const
Returns the size (in bytes) of one table row.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
virtual Int_t AddAt(const void *c)
TTableDescriptor * GetTableDescriptors() const
protected: create a new TTableDescriptor descriptor for this table
virtual Char_t * Print(Char_t *buf, Int_t n) const
Create IDL table defintion (to be used for XDF I/O)