/[PAMELA software]/quicklook/tof/src/TofScan.cpp
ViewVC logotype

Diff of /quicklook/tof/src/TofScan.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by campana, Tue May 23 10:51:21 2006 UTC revision 1.4 by pam-de, Mon Oct 8 12:28:54 2007 UTC
# Line 4  Line 4 
4  * Version 1.2  * Version 1.2
5  * Modified by G.De Rosa  * Modified by G.De Rosa
6  * Date 27 Apr 2006  * Date 27 Apr 2006
7    * Modified by G.De Rosa
8    * Date 03 Jul 2006
9    * Modified by W. Menn to select helium particles for PMT gain check
10    * Date 09 Aug 2007
11    * Last version 08 Oct 2007
12  *  *
13  * Description:  * Description:
14  * Describe the performance of the TOF.  * Describe the performance of the TOF.
# Line 14  Line 19 
19  *       TString format          - the format which will be used fo rsave the produced images (Default = "gif")  *       TString format          - the format which will be used fo rsave the produced images (Default = "gif")
20  */  */
21    
22    #include <TROOT.h>
23    #include <TH1.h>
24    #include <TFile.h>
25    #include <TObjArray.h>
26  #include <TString.h>  #include <TString.h>
27  #include <TObjString.h>  #include <TObjString.h>
28  #include <TTree.h>  #include <TTree.h>
# Line 25  Line 34 
34  #include <TCanvas.h>  #include <TCanvas.h>
35  #include <physics/tof/TofEvent.h>  #include <physics/tof/TofEvent.h>
36    
   
37  #include <iostream>  #include <iostream>
38    #include <fstream>
39    
40  using namespace std;  using namespace std;
41    
42  void TofScan(TString base, TString outDirectory = "", TString format = ""){  void TofScan(TString base, TString outDirectory = "", TString format = ""){
# Line 52  void TofScan(TString base, TString outDi Line 62  void TofScan(TString base, TString outDi
62       file->Close();       file->Close();
63       return;       return;
64     }     }
     
    TH2S *tdcHisto      = new TH2S("tdcHisto", sst.str().c_str(), 409, 0, 4096, 48, 0, 48);  
    TH2S *adcHisto      = new TH2S("adcHisto", sst.str().c_str(), 409, 0, 4096, 48, 0, 48);  
     
65    
66     /*     /*
67      * Array to convert hdc/adc to the real Photomultiplier      * Array to convert hdc/adc to the real Photomultiplier
# Line 94  void TofScan(TString base, TString outDi Line 100  void TofScan(TString base, TString outDi
100       "S32_1A", "S32_1B", "S32_2A", "S32_2B", "S32_3A", "S32_3B"       "S32_1A", "S32_1B", "S32_2A", "S32_2B", "S32_3A", "S32_3B"
101     };     };
102        
103     int i  = 0;     const Int_t nh = 48;
104       TH1F *htdc[nh];
105       TH1F *hadc[nh];
106      
107       TObjArray *hhtdc = new TObjArray(nh);
108       TObjArray *hhadc = new TObjArray(nh);
109       char tdcname[48]="";
110       char adcname[48]="";
111    
112       char htitle[50];
113       TH1F *adche[48];
114       for(int i=0;i<48;i++) {
115       sprintf(htitle, "adche_%d",(i+1));
116       adche[i] = new TH1F(htitle,htitle,100,0.,1500.);
117                             }
118    
119    
120       Float_t adca[48];  // vector with adc values according to "ind"=pmt_id
121       Float_t tdca[48];  // the same for tdc
122      
123     int j  = 0;     int j  = 0;
124     int k  = 0;     int k  = 0;
125     int z  = 0;     int z  = 0;
126     int ch = 0;     int ch = 0;
127     int hb = 0;     int hb = 0;
128         int ind =0;
129     while(i < nevents){  
130       int heevent =0;
131    
132    // upper and lower limits  for the helium selection
133    Float_t A_l[24]={200,190,300,210,220,200,210,60, 60, 120,220,120,160,50, 300,200,120,250,350,300,350,250,280,300};
134    Float_t A_h[24]={550,490,800,600,650,600,600,260,200,380,620,380,550,200,850,560,400,750,900,800,880,800,750,800};
135    
136    // The k1 constants for the beta calculation, only for S1-S3
137    // k2 constant is taken to be the standard 2D/c
138    Float_t k1[72] = {50,59.3296,28.4328,-26.0818,5.91253,-19.588,-9.26316,24.7544,2.32465,
139    -50.5058,-15.3195,-39.1443,-91.2546,-58.6243,-84.5641,-63.1516,-32.2091,
140    -58.3358,13.8084,45.5322,33.2416,-11.5313,51.3271,75,-14.1141,
141    42.8466,15.1794,-63.6672,-6.07739,-32.164,-41.771,10.5274,-9.46096,
142    -81.7404,-28.783,-52.7167,-127.394,-69.6166,-93.4655,-98.9543,-42.863,
143    -67.8244,-19.3238,31.1221,8.7319,-43.1627,5.55573,-14.4078,-83.4466,
144    -47.4647,-77.8379,-108.222,-75.986,-101.297,-96.0205,-63.1881,-90.1372,
145    -22.7347,8.31409,-19.6912,-7.49008,23.6979,-1.66677,1.81556,34.4668,
146    6.23693,-100,-59.5861,-90.9159,-141.639,-89.2521,-112.881} ;
147    
148    //-------------------------------------------------------------------
149    
150    
151       for (int i=0; i < nevents; i++){
152    
153       TofBr->GetEntry(i);       TofBr->GetEntry(i);
154    
155       k = 0;       k = 0;
156       while (k < 24){       while (k < 24){
157         j = 0;         j = 0;
158         while (j < 2){         while (j < 2){
159           ch = tof[2*j][k]     - 1;           ch = tof[2*j][k]     - 1;
160           hb = tof[2*j + 1][k] - 1;           hb = tof[2*j + 1][k] - 1;
161           tdcHisto->Fill(tofEvent->tdc[ch][hb], 2*k + j);           ind = 2*k + j;
162           adcHisto->Fill(tofEvent->adc[ch][hb], 2*k + j);  
163             if(i==0){
164               sprintf(tdcname,"TDChist%4.4d",ind);
165               sprintf(adcname,"ADChist%4.4d",ind);
166          
167               htdc[ind] = new TH1F(tdcname,tdcname,409,0,4096);
168               hadc[ind] = new TH1F(adcname,adcname,409,0,4096);
169          
170               hhtdc->Add(htdc[ind]);
171               hhadc->Add(hadc[ind]);
172             }
173    
174             htdc[ind]->Fill(tofEvent->tdc[ch][hb]);
175             hadc[ind]->Fill(tofEvent->adc[ch][hb]);
176             tdca[ind]=tofEvent->tdc[ch][hb];
177             adca[ind]=tofEvent->adc[ch][hb];
178           j++;           j++;
179         }         }
180         k++;         k++;
181       }       }
182       i++;  
183     }  //============   calculate beta and select helium ====================
184          
185     TH1D       *tpADC = 0;  // find hitted paddle by looking for ADC values on both sides
186     TH1D       *tpTDC = 0;  // since we looking for helium this gives decent results
187     TH1D       *tpADCall = 0;  
188     TH1D       *tpTDCall = 0;  Int_t tof11_i,tof12_i,tof21_i,tof22_i,tof31_i,tof32_i;
189      Float_t  a1,a2;
190    Int_t jj;
191    
192    //  reset values
193    tof11_i = -1;
194    tof12_i = -1;
195    tof21_i = -1;
196    tof22_i = -1;
197    tof31_i = -1;
198    tof32_i = -1;
199    
200        for(jj=0; jj<8; jj++){
201        a1 = adca[2*jj];
202        a2 = adca[2*jj+1];
203        if ((a1 < 3000) && (a2 < 3000)) tof11_i = jj;
204                               }
205        for(jj=0; jj<6; jj++){
206        a1 = adca[16+2*jj];
207        a2 = adca[16+2*jj+1];
208        if ((a1 < 3000) && (a2 < 3000)) tof12_i = jj;
209                               }
210        for(jj=0; jj<2; jj++){
211        a1 = adca[28+2*jj];
212        a2 = adca[28+2*jj+1];
213        if ((a1 < 3000) && (a2 < 3000)) tof21_i = jj;
214                               }
215        for(jj=0; jj<2; jj++){
216        a1 = adca[32+2*jj];
217        a2 = adca[32+2*jj+1];
218        if ((a1 < 3000) && (a2 < 3000)) tof22_i = jj;
219                             }
220        for(jj=0; jj<3; jj++){
221        a1 = adca[36+2*jj];
222        a2 = adca[36+2*jj+1];
223        if ((a1 < 3000) && (a2 < 3000)) tof31_i = jj;
224                               }
225        for(jj=0; jj<3; jj++){
226        a1 = adca[42+2*jj];
227        a2 = adca[42+2*jj+1];
228        if ((a1 < 3000) && (a2 < 3000)) tof32_i = jj;
229                               }
230    
231    
232    //----------------------------------------------------------------
233    
234    Float_t zin[6] = {53.74, 53.04, 23.94, 23.44, -23.49, -24.34};
235    Float_t  c1,c2,xhelp,xhelp1,xhelp2,ds,dist,F;
236    Float_t sw,sxw,beta_mean_tof,w_i;
237    Float_t  theta,x1,x2,y1,y2,dx,dy,dr;
238    Int_t  ihelp;
239    Int_t ipmt[4];
240    Float_t time[4];
241    Float_t beta1[4];
242    
243    // Only use events with:  S11 and S12 and S31 and S32
244    
245    if ( (tof11_i>-1) && (tof12_i>-1) && (tof31_i>-1) && (tof32_i>-1) ) {
246    
247    //  calculate zenith angle theta using the locations of the hitted paddles
248    
249    
250            Float_t tof11_x[8] = {-17.85,-12.75,-7.65,-2.55,2.55,7.65,12.75,17.85};
251            Float_t tof12_y[6] = { -13.75,-8.25,-2.75,2.75,8.25,13.75};
252    //        Float_t tof21_y[2] = { 3.75,-3.75};
253    //        Float_t tof22_x[2] = { -4.5,4.5};
254            Float_t tof31_x[3] = { -6.0,0.,6.0};
255            Float_t tof32_y[3] = { -5.0,0.0,5.0};
256    
257            //  S11 8 paddles  33.0 x 5.1 cm
258            //  S12 6 paddles  40.8 x 5.5 cm
259            //  S21 2 paddles  18.0 x 7.5 cm
260            //  S22 2 paddles  15.0 x 9.0 cm
261            //  S31 3 paddles  15.0 x 6.0 cm
262            //  S32 3 paddles  18.0 x 5.0 cm
263    
264          x1 = 0.;
265          x2 = 0.;
266          y1 = 0.;
267          y2 = 0.;
268    
269          x1 = tof11_x[tof11_i] ;
270          y1 = tof12_y[tof12_i] ;
271          x2 = tof31_x[tof31_i] ;
272          y2 = tof32_y[tof32_i] ;
273    
274          theta=0.;
275          dx=0.;
276          dy=0.;
277          dr=0.;
278    
279          dx = x1-x2;
280          dy = y1-y2;
281          dr = sqrt(dx*dx+dy*dy);
282          theta = atan(dr/77.5);
283    
284    
285          beta_mean_tof=100.;
286    
287          for (Int_t jj=0; jj< 4; jj++) beta1[jj] = 100. ;
288    
289    
290    //----------------------------------------------------------------
291    //---------  S1 - S3 ---------------------------------------------
292    //----------------------------------------------------------------
293    
294    //---------  S11 - S31 -------------------------------------------
295    
296    if ((tof11_i>-1)&&(tof31_i>-1)) {
297    
298    dist = zin[0] - zin[4];
299    c2 = (2.*0.01*dist)/(3.E08*50.E-12);
300    F = 1./cos(theta);
301    
302               ipmt[0]   = (tof11_i)*2;
303               ipmt[1]   = (tof11_i)*2+1;
304               ipmt[2]   = 36+(tof31_i)*2;
305               ipmt[3]   = 36+(tof31_i)*2+1;
306    
307       for (Int_t jj=0; jj< 4; jj++) time[jj] = tdca[(ipmt[jj])] ;
308    
309       if ((time[0]<4095)&&(time[1]<4095)&&(time[2]<4095)&&(time[3]<4095)) {
310             xhelp1 = time[0] + time[1] ;
311             xhelp2 = time[2] + time[3] ;
312             ds = xhelp1-xhelp2;
313             ihelp=0+(tof11_i)*3+tof31_i ;
314             c1 = k1[ihelp] ;
315             beta1[0] = c2*F/(ds-c1);
316    }
317    }
318    
319    //---------  S11 - S32 -------------------------------------------
320    
321    if ((tof11_i>-1)&&(tof32_i>-1)) {
322    
323    dist = zin[0] - zin[5];
324    F = 1./cos(theta);
325    c2 = (2.*0.01*dist)/(3.E08*50.E-12);
326    
327               ipmt[0]   = (tof11_i)*2;
328               ipmt[1]   = (tof11_i)*2+1;
329               ipmt[2]   = 42+(tof32_i)*2;
330               ipmt[3]   = 42+(tof32_i)*2+1;
331    
332       for (Int_t jj=0; jj< 4; jj++) time[jj] = tdca[(ipmt[jj])] ;
333    
334       if ((time[0]<4095)&&(time[1]<4095)&&(time[2]<4095)&&(time[3]<4095)) {
335             xhelp1 = time[0] + time[1] ;
336             xhelp2 = time[2] + time[3] ;
337             ds = xhelp1-xhelp2;
338             ihelp=24+(tof11_i)*3+tof32_i ;
339             c1 = k1[ihelp] ;
340             beta1[1] = c2*F/(ds-c1);
341    }
342    }
343    
344    //---------  S12 - S31 -------------------------------------------
345    
346    if ((tof12_i>-1)&&(tof31_i>-1)) {
347    
348    dist = zin[1] - zin[4];
349    F = 1./cos(theta);
350    c2 = (2.*0.01*dist)/(3.E08*50.E-12);
351    
352               ipmt[0]   = 16+(tof12_i)*2;
353               ipmt[1]   = 16+(tof12_i)*2+1;
354               ipmt[2]   = 36+(tof31_i)*2;
355               ipmt[3]   = 36+(tof31_i)*2+1;
356    
357       for (Int_t jj=0; jj< 4; jj++) time[jj] = tdca[(ipmt[jj])] ;
358    
359       if ((time[0]<4095)&&(time[1]<4095)&&(time[2]<4095)&&(time[3]<4095)) {
360             xhelp1 = time[0] + time[1] ;
361             xhelp2 = time[2] + time[3] ;
362             ds = xhelp1-xhelp2;
363             ihelp=48+(tof12_i)*3+tof31_i ;
364             c1 = k1[ihelp] ;
365             beta1[2] = c2*F/(ds-c1);
366    }
367    }
368    
369    //---------  S12 - S32 -------------------------------------------
370    
371    if ((tof12_i>-1)&&(tof32_i>-1)) {
372    
373    dist = zin[1] - zin[5];
374    F = 1./cos(theta);
375    c2 = (2.*0.01*dist)/(3.E08*50.E-12);
376    
377               ipmt[0]   = 16+(tof12_i)*2;
378               ipmt[1]   = 16+(tof12_i)*2+1;
379               ipmt[2]   = 42+(tof32_i)*2;
380               ipmt[3]   = 42+(tof32_i)*2+1;
381    
382        for (Int_t jj=0; jj< 4; jj++) time[jj] = tdca[(ipmt[jj])] ;
383    
384       if ((time[0]<4095)&&(time[1]<4095)&&(time[2]<4095)&&(time[3]<4095)) {
385             xhelp1 = time[0] + time[1] ;
386             xhelp2 = time[2] + time[3] ;
387             ds = xhelp1-xhelp2;
388             ihelp=66+(tof12_i)*3+tof32_i ;
389             c1 = k1[ihelp] ;
390             beta1[3] = c2*F/(ds-c1);
391    }
392    }
393    
394    //----------------------   calculate  beta mean -----------------
395    
396          sw=0.;
397          sxw=0.;
398          beta_mean_tof=100.;
399    
400            for (Int_t jj=0; jj<4;jj++){
401            if ((beta1[jj]>0.1) && (beta1[jj]<1.5)) {
402                w_i=1./(0.13*0.13);
403                sxw=sxw + beta1[jj]*w_i ;
404                sw =sw + w_i ;
405             }
406             }
407    
408          if (sw>0) beta_mean_tof=sxw/sw;
409    
410    } //  if tof11_i > -1 && ...... beta calculation
411    
412    
413       Float_t   beta_help = beta_mean_tof ;  // pow(beta_mean_tof,1.0) gave best results
414    
415    //-----------------------  Select helium   --------------------------
416    
417       Int_t  icount=0;
418    
419       for (jj=0; jj<24; jj++){
420       a1 = adca[2*jj]*cos(theta);
421       a2 = adca[2*jj+1]*cos(theta);
422    
423       xhelp = 100000.;
424       if ((a1 < 3000) && (a2 < 3000)) xhelp = sqrt(a1*a2);  // geometric mean
425    // if geometric mean multiplied by beta_help  is inside helium limits, increase counter
426       if ((beta_mean_tof>0.6) && (beta_mean_tof<1.1) &&
427            ((beta_help*xhelp)>A_l[jj]) && ((beta_help*xhelp)<A_h[jj])) icount++ ;
428                         }
429    
430      Int_t   iz=0;
431    //  if (icount > 3) iz=2;   // if more than three paddles see helium, then set Z=2
432      if (icount > 4) iz=2;  
433    
434    //----------------------  Z=2 fill histograms  -----------------------------
435    
436        if (iz==2) {
437    
438        heevent++;
439        for (jj=0; jj<48; jj++)  adche[jj]->Fill(adca[jj]);
440                              
441                               }  // iz0==2
442    
443    
444    //=====================  end beta and helium part ===========================
445    
446       }  //  i < nevents
447    
448    
449     float *X       = new float[48];     float *X       = new float[48];
450     float *means   = new float[48];     float *means   = new float[48];
451     float *entries = new float[48];     float *entries = new float[48];
452     int *entriestdc = new int[48];     int *entriestdc = new int[48];
453     int *entriesadc = new int[48];     int *entriesadc = new int[48];
454      
455     const char *saveas = format;     const char *saveas = format;
   
    // all range ADC/TDC  
456        
457     j = 0;     int i=0;
    while (j < 12){  
      k = 0;  
      z = 0;  
       
      while(k < 4){  
        if (k > 1) z = 2;  
        i = j*4 + k;  
        X[i] = i;  
         
        tpTDCall = tdcHisto->ProjectionX(" ", i+1, i+1);  
        tpTDCall->SetAxisRange(0,4095);  
        entriestdc[i] = (Int_t)tpTDCall->Integral();  
         
        tpADCall = adcHisto->ProjectionX(" ", i+1, i+1);  
        tpADCall->SetAxisRange(0,4095);  
        entriesadc[i] = (Int_t)tpADCall->Integral();  
   
        k++;  
      }  
       
      j++;  
       
    }  
458        
459     gStyle->SetStatW(0.4);     gStyle->SetStatW(0.4);
460     gStyle->SetStatH(0.4);     gStyle->SetStatH(0.4);
# Line 166  void TofScan(TString base, TString outDi Line 464  void TofScan(TString base, TString outDi
464        
465     TCanvas *SCanvas = new TCanvas("SCanvas","SCanvas", 1280, 1024);     TCanvas *SCanvas = new TCanvas("SCanvas","SCanvas", 1280, 1024);
466     SCanvas->Divide(4,2);     SCanvas->Divide(4,2);
467    
468     j = 0;     j = 0;
469     while (j < 12){     while (j < 12){
470       k = 0;       k = 0;
# Line 184  void TofScan(TString base, TString outDi Line 483  void TofScan(TString base, TString outDi
483         X[i] = i;         X[i] = i;
484                
485         SCanvas->cd(k+3+z);         SCanvas->cd(k+3+z);
486         tpTDC = tdcHisto->ProjectionX(" ", i+1, i+1);         htdc[i] = (TH1F*)hhtdc->At(i);  
487           entriestdc[i] = (Int_t)htdc[i]->Integral();
488         sst.str("");         sst.str("");
489         sst << "TDC - " << photoS[i].Data() << " (Nev < 4096 = " << entriestdc[i] << ")";         sst << "TDC - " << photoS[i].Data() << " (Nev < 4096 = " << entriestdc[i] << ")";
490         tpTDC->SetTitle(sst.str().c_str());         htdc[i]->SetTitle(sst.str().c_str());
491         tpTDC->SetTitleSize(10);         htdc[i]->SetTitleSize(10);
492         tpTDC->SetAxisRange(690,1510);         htdc[i]->SetAxisRange(690,1510);
493         tpTDC->DrawCopy();         htdc[i]->DrawCopy();
494         tpTDC->ComputeIntegral();         htdc[i]->ComputeIntegral();
495         entries[i] = tpTDC->Integral();         entries[i] = htdc[i]->Integral();
496                
497         SCanvas->cd(k+1+z);               SCanvas->cd(k+1+z);      
498         tpADC = adcHisto->ProjectionX(" ", i+1, i+1);         hadc[i] = (TH1F*)hhadc->At(i);
499           entriesadc[i] = (Int_t)hadc[i]->Integral();
500         sst.str("");         sst.str("");
501         sst << "ADC - " << photoS[i].Data() << " (Nev < 4096 = " << entriesadc[i] << ")";         sst << "ADC - " << photoS[i].Data() << " (Nev < 4096 = " << entriesadc[i] << ")";
502         tpADC->SetTitle(sst.str().c_str());         hadc[i]->SetTitle(sst.str().c_str());
503         tpADC->SetAxisRange(-10,710);         hadc[i]->SetAxisRange(-10,710);
504         tpADC->DrawCopy();         hadc[i]->DrawCopy();
505         means[i]   = tpADC->GetMean();         means[i]   = hadc[i]->GetMean();
506                
507         k++;         k++;
508       }       }
509        
510    
511       if ( !strcmp(saveas,"ps") ) {       if ( !strcmp(saveas,"ps") ) {
512         sst.str("");         sst.str("");
513         sst << outDirectory.Data() << filename.Data() << "TOFScan.ps(";         sst << outDirectory.Data() << filename.Data() << "TOFScan.ps(";
# Line 217  void TofScan(TString base, TString outDi Line 520  void TofScan(TString base, TString outDi
520       }       }
521       j++;       j++;
522     }     }
523    
524     if (gROOT->IsBatch()) SCanvas->Close();     if (gROOT->IsBatch()) SCanvas->Close();
525        
526     /*     /*
527      * This Canvas will represent a summary of the performances for TOF TDC/ADC channels      * This Canvas will represent a summary of the performances for TOF TDC/ADC channels
528      */      */
529     TCanvas *performanceCanvas = new TCanvas("performanceCanvas","performanceCanvas", 1280, 1024);  //   TCanvas *performanceCanvas = new TCanvas("performanceCanvas","performanceCanvas", 1280, 1024);
530     performanceCanvas->Divide(1,2);     TCanvas *performanceCanvas = new TCanvas("performanceCanvas","performanceCanvas", 1024, 1280);
531       performanceCanvas->Divide(1,3);
532        
533     gStyle->SetTitleW(.9);     gStyle->SetTitleW(.9);
534    
# Line 252  void TofScan(TString base, TString outDi Line 557  void TofScan(TString base, TString outDi
557     tdcEntries->GetYaxis()->SetTitle("TDCIntegral");     tdcEntries->GetYaxis()->SetTitle("TDCIntegral");
558     tdcEntries->GetYaxis()->CenterTitle();           tdcEntries->GetYaxis()->CenterTitle();      
559     tdcEntries->Draw("AB");     tdcEntries->Draw("AB");
560      
561    //--------- new part PMT gain check  -----------------------------
562    
563       performanceCanvas->cd(3);
564    
565    Float_t  xc[48],xmean1[48],xmeana[48];
566    Float_t xmean_arr[12][48];
567    
568    //  xmean values from 2-3 april 2007
569    
570    char date_info[]="Reference Data: apr-2007";
571    
572    Float_t  xmean[48] = {
573    491.609,509.241,400.786,530.122,699.674,555.747,521.04,486.363,
574    470.173,227.752,611.038,455.889,553.601,520.54,403.527,382.099,
575    349.697,365.113,447.653,377.667,517.815,572.932,338.501,436.681,
576    485.696,450.491,395.375,329.631,751.258,626.681,385.561,578.476,
577    374.454,356.733,641.888,562.767,582.849,521.748,527.043,505.89,
578    489.828,628.408,532.924,506.511,482.872,532.236,554.554,498.849 };
579    
580    // new 01-oct-2007
581    int channelmap[] = {0,7,3,6,2,8,1,5,3,7,3,6,1,7,2,10,
582                        10,10,10,5,0,7,0,5,0,6,1,5,
583                        2,8,3,8,2,6,1,8,
584                        11,9,11,11,9,11,4,4,4,9,9,4};
585    
586    
587    int colormap[] = {46,2,29,4,5,6,7,8,9,11,28,34};
588    //int colormap[] = {417,400,632,617,603,600,434,419,591,625,403,424};
589    
590    
591    for (Int_t j=0; j<48; j++) xmeana[j]=0.;
592    for (Int_t j=0; j<24; j++) xmeana[2*j]=xmean[2*j];
593    
594    for (Int_t i=0; i<12; i++) {
595    for (Int_t j=0; j<48; j++) {
596    xmean_arr[i][j]=0.;
597    }
598    }
599    
600    for (Int_t j=0; j<48; j++) {
601    Int_t ichan = channelmap[j];
602    xmean_arr[ichan][j]=xmean[j];
603    }
604    
605    // get results from ADC histogram
606    for (Int_t j=0; j<48; j++) {
607    xc[j]=j;
608    xmean1[j]=adche[j]->GetMean();
609    }
610    
611    
612       gStyle->SetTitleW(.5);
613       gStyle->SetTitleH(.05);
614    
615    TH2F *hr = new TH2F("frame","2-Dim",2,-0.5,47.5,2,-300.,100.);
616    hr->SetStats(kFALSE);
617    hr->GetXaxis()->CenterTitle();
618    hr->GetXaxis()->SetTitle("Photomultipliers");
619    hr->GetYaxis()->CenterTitle();  
620    hr->GetYaxis()->SetTitle("Mean ADC Difference");
621    hr->SetTitle("Difference between Reference and Actual Values");
622    hr->Draw();
623    
624    Int_t npoint=48;
625    
626    for (Int_t j=0; j<12; j++) {
627    for (Int_t i=0; i<48; i++) xmeana[i] = 0.;
628    for (Int_t i=0; i<48; i++) {
629    if (xmean_arr[j][i] != 0)  xmeana[i] = xmean1[i] - xmean_arr[j][i];
630                               }
631    
632    
633    TGraph *graph1 = new TGraph(npoint,xc,xmeana);
634    graph1->SetFillColor(colormap[j]);
635    graph1->GetXaxis()->SetLimits(-0.5, 47.5);
636    graph1->Draw("BP");
637    }
638    
639    Float_t tp[10];
640    tp[0] = 15.5;
641    tp[1] = 27.5;
642    tp[2] = 31.5;
643    tp[3] = 35.5;
644    tp[4] = 41.5;
645    
646    for (Int_t ii=0; ii<5; ii++) {
647    TLine *l1=new TLine(tp[ii],-300,tp[ii],100);
648    l1->SetLineColor(38);
649    l1->Draw("same");
650                            }
651    
652    for (Int_t j=0; j<12; j++) {
653    sprintf(htitle, "HV_%d",j);
654    TText *text1 = new TText(0+j*4,80,htitle);
655    text1->SetTextColor(colormap[j]);
656    //text1->SetTextSize(0.03);
657    text1->SetTextSize(0.05);
658    text1->Draw();
659    }
660    
661    
662    TText *text1 = new TText(0,-185,date_info);
663    text1->SetTextColor(kBlack);
664    text1->SetTextSize(0.023);
665    text1->Draw();
666    
667    
668    sprintf(htitle, "Helium Events: %d",heevent);
669    TText *text2 = new TText(20,-185,htitle);
670    text2->SetTextColor(kBlack);
671    text2->SetTextSize(0.023);
672    text2->Draw();
673    
674    
675    for (Int_t i=0; i<6; i++) {
676    for (Int_t j=0; j<8; j++) {
677    Int_t ihelp = i*8+j;
678    sprintf(htitle, "%d: %.0f/%.0f",(ihelp+1),xmean[ihelp],xmean1[ihelp]);
679    TText *text1 = new TText(0+j*6,-200-i*15,htitle);
680    text1->SetTextColor(kBlack);
681    text1->SetTextSize(0.023);
682    text1->Draw();
683    }
684    }
685    
686    //-------- end new part -------------------------
687    
688      
689     //------print the ps     //------print the ps
690    
691     if ( !strcmp(saveas,"ps") ) {     if ( !strcmp(saveas,"ps") ) {
# Line 270  void TofScan(TString base, TString outDi Line 703  void TofScan(TString base, TString outDi
703       performanceCanvas->Close();       performanceCanvas->Close();
704     }     }
705    
706    
707    
708  }  }
709    
710  int main(int argc, char* argv[]){  int main(int argc, char* argv[]){
# Line 326  int main(int argc, char* argv[]){ Line 761  int main(int argc, char* argv[]){
761     TofScan(argv[1], outDir, format);     TofScan(argv[1], outDir, format);
762    
763  }  }
764    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.23