#include #include #include #include #include #include #include #include #include #ifndef ROOT_HEADER #define ROOT_HEADER #include #include #include #include #include #include #include #endif void show_usage(char **argv); int main (int argc, char *argv[]){ int pmod1 = 16; int pmod2 = 48; int Detector = 40; int XtalIndex1, XtalIndex2,moduleindex; int HistPerDetector=pmod2*pmod1; int debugevents=0; TH1I *TimeHist[Detector][HistPerDetector][HistPerDetector];//[HistPerDetector][HistPerDetector]; int ***HistogramIndex; // Allocate memory HistogramIndex = new int**[HistPerDetector]; for (int i = 0; i < HistPerDetector; ++i) { HistogramIndex[i] = new int*[HistPerDetector]; for (int j = 0; j < HistPerDetector; ++j) HistogramIndex[i][j] = new int[Detector]; } // Assign values HistogramIndex[0][0][0] = 3.6; HistogramIndex[1][2][4] = 4.0; // De-Allocate memory to prevent memory leak for (int i = 0; i < HistPerDetector; ++i) { for (int j = 0; j < HistPerDetector; ++j) delete [] HistogramIndex[i][j]; delete [] HistogramIndex[i]; } delete [] HistogramIndex; return EXIT_SUCCESS; }