padsley / k600analyser

Code for the K600 analyser including plugin codes for silicon, clover and HAGAR data
1 stars 4 forks source link

fixing up problem with fixed array size in histogram declaration #107

Closed neveling closed 8 years ago

neveling commented 8 years ago

In reponse to issue 100 on padsley/k600analyser I did the following:

in main.c replaced in the histogram definition

static TH2F *hTDC2DModule[NR_OF_TDCS];

and the definition/initialization:

for(int counter=0;counter<TDCModules;counter++){ sprintf(name,"hTDC2DModule%d",counter); sprintf(title,"hTDC2DModule %d ",counter); hTDC2DModule[counter]=new H2_BOOK(name,title, 4000, -8000, 14999,128,0,128); }

with

TH2F **hTDC2DModule;

and

hTDC2DModule = new TH2F*[TDCModules]; for(int counter=0;counter<TDCModules;counter++){ sprintf(name,"hTDC2DModule%d",counter); sprintf(title,"hTDC2DModule %d ",counter); hTDC2DModule[counter]=new TH2F(name,title, 4000, -8000, 14999,128,0,128);
}

Similarly in adc.c replaced

static TH2F *hADC2DModule[5];

and

for(int counter=0;counter<5;counter++){ sprintf(name,"hADC2DModule%d",counter); sprintf(title,"hADC2DModule %d ",counter); hADC2DModule[counter]=H2_BOOK(name,title,4096,0,4096,32,0,32); }

with

TH2F **hADC2DModule;

and

hADC2DModule = new TH2F*[ADCModules];
for(int counter=0;counter<ADCModules;counter++){ sprintf(name,"hADC2DModule%d",counter); sprintf(title,"hADC2DModule %d ",counter); hADC2DModule[counter]=new TH2F(name,title,4096,0,4096,32,0,32); }

Also I changed all instances of H1_BOOK and H2_BOOK to TH1F new and TH2F new

and placed the parameters to change from thetaFP to thetaSCAT in the config file, so it is no longer hardcoded in the routine in FocalPlane.c. This bit needs more work, as I limit us at present to the number of parameters for theta and y correction. Just a matter of time to fix this....