diff --git a/CuFluo_analysis_sc.cpp b/CuFluo_analysis_sc.cpp index a57498f..7625a52 100644 --- a/CuFluo_analysis_sc.cpp +++ b/CuFluo_analysis_sc.cpp @@ -119,21 +119,23 @@ int main(int argc, char* argv[]) { jungfrauFile *thisfile = new jungfrauFile(); - jungfrauPedestal *pedestalObject_SC[16]; - TH2F *pedestalsG0[16]; - TH2F *pedeRMSG0[16]; + vector pedestalObject_SC(16); //should call default constructor 16 times + vector pedestalsG0; + pedestalsG0.reserve(16); + vector pedeRMSG0; + pedeRMSG0.reserve(16); for (int sci = 0; sci < 16; ++sci) { - pedestalObject_SC[sci] = new jungfrauPedestal(); + //pedestalObject_SC[sci] = new jungfrauPedestal(); pedestalObject_SC[sci]->pedestalSetNFrames(100); Char_t *pedehistoname = new Char_t[50]; snprintf( pedehistoname, 50, "pedestalsG0_sc%d", sci ); - pedestalsG0[sci] = new TH2F( pedehistoname, "", NC, -0.5, NC-0.5, NR, -0.5, NR-0.5 ); + pedestalsG0.push_back( new TH2F( pedehistoname, "", NC, -0.5, NC-0.5, NR, -0.5, NR-0.5 ) ); snprintf( pedehistoname, 50, "pedeRMSG0_sc%d", sci ); - pedeRMSG0[sci] = new TH2F( pedehistoname, "", NC, -0.5, NC-0.5, NR, -0.5, NR-0.5 ); + pedeRMSG0.push_back( new TH2F( pedehistoname, "", NC, -0.5, NC-0.5, NR, -0.5, NR-0.5 ) ); } - static uint16_t pedestals16_G0_start[16][NCH]; //I suppose, this is to track pedestal shifting over the course of data taking - static double pedeRMS16_G0[16][NCH]; + static vector< vector > pedestals16_G0_start( 16, vector(NCH) ); //I suppose, this is to track pedestal shifting over the course of data taking + static vector< vector > pedeRMS16_G0( 16, vector(NCH) ); for (int pedefilei = 0; pedefilei < pedefilen; ++pedefilei) { @@ -168,7 +170,7 @@ int main(int argc, char* argv[]) { } } pedestalObject_SC[sci]->pedestalData((uint16_t*)(&pedestals16_G0_start[sci])); //this loads the pedestal data into the array pedestals16_G0_start - pedestalObject_SC[sci]->pedestalRMSData(pedeRMS16_G0[sci]); //same here + pedestalObject_SC[sci]->pedestalRMSData(pedeRMS16_G0[sci].data()); //same here pedestalObject_SC[sci]->pedestalResetUpdates(); //pedestalObject[sci]->pedestalClear(); //I don't need to clear if I only calculate pedestal once. } @@ -200,6 +202,8 @@ int main(int argc, char* argv[]) { int adc2d_nbin= 1200; if (isJF11) adc2d_nbin= 1600; + + //HERE!!! TH2I *adc2d[8][16]; @@ -242,7 +246,7 @@ int main(int argc, char* argv[]) { uint16_t* imagedptr = thisfile->getFrameDataHandle(); uint64_t scnumber = thisfile->currentSCnumber(); - pedestalObject_SC[scnumber]->addG0FrameToPedestalCalculationWThreshold( imagedptr, pedestalObject_SC[scnumber], pedeRMS16_G0[scnumber] ); + pedestalObject_SC[scnumber]->addG0FrameToPedestalCalculationWThreshold( imagedptr, pedestalObject_SC[scnumber], pedeRMS16_G0[scnumber].data() ); for (int i = 0; i < NCH; i++) {