Re: [BLAST_ANAWARE] root question

From: Chris Crawford (chris2@lns.mit.edu)
Date: Sun Jul 13 2003 - 18:17:52 EDT


Tancredi Botto wrote:

>I guess this shows my C++ ignorance.. too bad, I started to believe
>that cint was an OK surrogate. I understand the message. If somebody
>knows a more elegant work around to my obvious fix (32 extra lines),
>many thanks...
>
>
>...........
>Electronics map is for real data.
>Calibration file: /home/blast/blast/pro2003/Blast_Params/blast.sc_cal
>Error: Non-static-const variable in array dimension FILE:macros/adc_bckg.C
>LINE:50
> (cint allows this only in interactive command and special form macro
>which
> is special extension. It is not allowed in source code. Please ignore
> subsequent errors.)
>
>
>line50:....
>// for(int k=0;k<16;k++) {
>// //Initializing histograms...
>// sprintf(title,"adc_left[%d]",k);
>// TH1F *adc_left[k] = new TH1F(title,title,500,1000,6000);
>
  you are mixing up declarations and '=' statements here. you only
declare the array once outside the loop with 'TH1F* adc_left[16]'
then in the loop, you don't need the 'TH1F*'
  not going to make the bold assumption that this will restore your
faith in root, but at least it will make life a little easier for this
script!
--chris

>// sprintf(title,"adc_right[%d]",k);
>// TH1F *adc_right[k] = new TH1F(title,title,500,1000,6000);
>// }
>
>
>



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:29 EST