/[PAMELA software]/tof/flight/ToFReprocessing/ToFreproc.cpp
ViewVC logotype

Diff of /tof/flight/ToFReprocessing/ToFreproc.cpp

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

revision 1.3 by mocchiut, Mon Nov 23 09:38:05 2009 UTC revision 1.6 by mocchiut, Thu Apr 12 12:04:20 2012 UTC
# Line 44  extern "C" int tofl2com(); Line 44  extern "C" int tofl2com();
44  extern "C" int toftrk();  extern "C" int toftrk();
45  ///extern "C" int toftrk(float);  ///extern "C" int toftrk(float);
46  #define rdtofcal rdtofcal_  #define rdtofcal rdtofcal_
47  extern "C" int rdtofcal(char [], int *);  //extern "C" int rdtofcal(char [], int *);
48    extern "C" int rdtofcal(const char *, int *);
49    
50  using namespace std;  using namespace std;
51    
# Line 100  Int_t Loop(TString ddir,TString list, TS Line 101  Int_t Loop(TString ddir,TString list, TS
101    //    //
102    Int_t ntrkentry = 0;    Int_t ntrkentry = 0;
103    Int_t npmtentry = 0;    Int_t npmtentry = 0;
104      Float_t xleft=0;
105      Float_t xright=0;
106      Float_t yleft=0;
107      Float_t yright=0;
108    //    //
109    ULong64_t nevents = pam_event->GetEntries();    ULong64_t nevents = pam_event->GetEntries();
110    printf("\n\n Running on %llu events \n\n",nevents);    printf("\n\n Running on %llu events \n\n",nevents);
# Line 179  Int_t Loop(TString ddir,TString list, TS Line 184  Int_t Loop(TString ddir,TString list, TS
184          };          };
185          //          //
186          tofdedx->ReadParAtt((glparam->PATH+glparam->NAME).Data());          tofdedx->ReadParAtt((glparam->PATH+glparam->NAME).Data());
187                    printf(" Reading Attenuation file: %s \n",(glparam->PATH+glparam->NAME).Data());        
188    
189          //          //
190          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,205,dbc); // parameters stored in DB in GL_PRAM table          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,205,dbc); // parameters stored in DB in GL_PRAM table
191          if ( error<0 ) {          if ( error<0 ) {
# Line 187  Int_t Loop(TString ddir,TString list, TS Line 193  Int_t Loop(TString ddir,TString list, TS
193          };          };
194          //          //
195          tofdedx->ReadParPos((glparam->PATH+glparam->NAME).Data());          tofdedx->ReadParPos((glparam->PATH+glparam->NAME).Data());
196                    printf(" Reading desaturation1 file: %s \n",(glparam->PATH+glparam->NAME).Data());
197    
198          //          //
199          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,206,dbc); // parameters stored in DB in GL_PRAM table          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,206,dbc); // parameters stored in DB in GL_PRAM table
200          if ( error<0 ) {          if ( error<0 ) {
# Line 195  Int_t Loop(TString ddir,TString list, TS Line 202  Int_t Loop(TString ddir,TString list, TS
202          };          };
203          //          //
204          tofdedx->ReadParBBneg((glparam->PATH+glparam->NAME).Data());          tofdedx->ReadParBBneg((glparam->PATH+glparam->NAME).Data());
205                    printf(" Reading BBneg file: %s \n",(glparam->PATH+glparam->NAME).Data());
206    
207          //          //
208          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,207,dbc); // parameters stored in DB in GL_PRAM table          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,207,dbc); // parameters stored in DB in GL_PRAM table
209          if ( error<0 ) {          if ( error<0 ) {
# Line 203  Int_t Loop(TString ddir,TString list, TS Line 211  Int_t Loop(TString ddir,TString list, TS
211          };          };
212          //          //
213          tofdedx->ReadParBBpos((glparam->PATH+glparam->NAME).Data());          tofdedx->ReadParBBpos((glparam->PATH+glparam->NAME).Data());
214                    printf(" Reading BBpos file: %s \n",(glparam->PATH+glparam->NAME).Data());
215    
216          //          //
217          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,208,dbc); // parameters stored in DB in GL_PRAM table          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,208,dbc); // parameters stored in DB in GL_PRAM table
218          if ( error<0 ) {          if ( error<0 ) {
# Line 211  Int_t Loop(TString ddir,TString list, TS Line 220  Int_t Loop(TString ddir,TString list, TS
220          };          };
221          //          //
222          tofdedx->ReadParDesatBB((glparam->PATH+glparam->NAME).Data());          tofdedx->ReadParDesatBB((glparam->PATH+glparam->NAME).Data());
223                    printf(" Reading desaturation2 file: %s \n",(glparam->PATH+glparam->NAME).Data());
224                    
225          tofdedx->CheckConnectors(pam_event->GetRunInfo()->RUNHEADER_TIME,glparam,dbc);          tofdedx->CheckConnectors(pam_event->GetRunInfo()->RUNHEADER_TIME,glparam,dbc);
226                    
227                    
           
228          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,201,dbc); // parameters stored in DB in GL_PRAM table          error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,201,dbc); // parameters stored in DB in GL_PRAM table
229          if ( error<0 ) {          if ( error<0 ) {
230            return(1);            return(1);
# Line 226  Int_t Loop(TString ddir,TString list, TS Line 234  Int_t Loop(TString ddir,TString list, TS
234          //          //
235          if ( (UInt_t)glparam->TO_TIME != (UInt_t)4294967295UL ) defcal = false;          if ( (UInt_t)glparam->TO_TIME != (UInt_t)4294967295UL ) defcal = false;
236          //          //
237          Int_t nlen = (Int_t)(glparam->PATH+glparam->NAME).Length();          TString pippo=(glparam->PATH+glparam->NAME).Data();
238          rdtofcal((char *)(glparam->PATH+glparam->NAME).Data(),&nlen);          //Int_t nlen = (Int_t)(glparam->PATH+glparam->NAME).Length();
239            //rdtofcal((char *)(glparam->PATH+glparam->NAME).Data(),&nlen);
240            Int_t nlen = (Int_t)pippo.Length();
241            rdtofcal(pippo.Data(),&nlen);
242          //          //
243    
244            tofdedx->Clear();
245    
246        };              };      
247        //        //
248    
# Line 238  Int_t Loop(TString ddir,TString list, TS Line 252  Int_t Loop(TString ddir,TString list, TS
252        //---  Define absolute time        //---  Define absolute time
253        UInt_t tabs=pam_event->GetOrbitalInfo()->absTime;        UInt_t tabs=pam_event->GetOrbitalInfo()->absTime;
254                
255        printf(" ATIME %u re %u \n",(Int_t)tabs,(UInt_t)iev);        if ( !(iev%100000) ) printf(" ATIME %u re %u \n",(Int_t)tabs,(UInt_t)iev);
256    
257        //==================================================================        //==================================================================
258        Float_t dedx_corr_m[2000][48],dedx_corr[48];        Float_t dedx_corr_m[2000][48],dedx_corr[48];
# Line 257  Int_t Loop(TString ddir,TString list, TS Line 271  Int_t Loop(TString ddir,TString list, TS
271          //-----------------------------------------------------------          //-----------------------------------------------------------
272    
273          jj=0;          jj=0;
274            printf(" READING NEW CALIBRATION FILE: %s \n",CALIBF.Data());
275    
276          ifstream fin(CALIBF.Data());          ifstream fin(CALIBF.Data());
277            //cout << "topolino" << endl;
278          while (! fin.eof()) {          while (! fin.eof()) {
279            fin>>t1>>tm>>t2;            fin>>t1>>tm>>t2;
280            //      cout<<jj<<" "<<tm<<endl;            //cout<<jj<<" "<<tm<<endl;
281            cout << setiosflags(ios::fixed)  << setw(10) << setprecision(3) << tm << endl;            //cout << setiosflags(ios::fixed)  << setw(10) << setprecision(3) << tm << endl;
282            mtime[jj]=tm;            mtime[jj]=tm;
283            for (ii=0; ii<48;ii++) {            for (ii=0; ii<48;ii++) {
284              fin>>j>>xmean1>>xwidth1;              fin>>j>>xmean1>>xwidth1;
# Line 273  Int_t Loop(TString ddir,TString list, TS Line 288  Int_t Loop(TString ddir,TString list, TS
288            //      printf(" kk %i \n",jj);            //      printf(" kk %i \n",jj);
289          }          }
290          //      printf(" 1ical %i \n",ical);          //      printf(" 1ical %i \n",ical);
291            //cout << "pippo" << endl;
292          fin.close();          fin.close();
293    
294    
# Line 282  Int_t Loop(TString ddir,TString list, TS Line 297  Int_t Loop(TString ddir,TString list, TS
297            ical = ical+1;            ical = ical+1;
298          }          }
299          //      ical = ical-1;          //      ical = ical-1;
300          cout<<"abs time "<<tabs<<" limit low "<<mtime[ical]<<" limit up "<<mtime[ical+1]<<" ical "<<ical<<endl;          //cout<<"abs time "<<tabs<<" limit low "<<mtime[ical]<<" limit up "<<mtime[ical+1]<<" ical "<<ical<<endl;
301        } // if iev==0...        } // if iev==0...
302    
303        //==================================================================        //==================================================================
# Line 300  Int_t Loop(TString ddir,TString list, TS Line 315  Int_t Loop(TString ddir,TString list, TS
315            ical = ical+1;            ical = ical+1;
316          }          }
317          //      ical = ical-1;          //      ical = ical-1;
318          cout<<"abs time "<<tabs<<" limit low "<<mtime[ical]<<" limit up "<<mtime[ical+1]<<" ical "<<ical<<endl;          //cout<<"abs time "<<tabs<<" limit low "<<mtime[ical]<<" limit up "<<mtime[ical+1]<<" ical "<<ical<<endl;
319        };        };
320    
321        //      printf(" 2ical %i \n",ical);        //      printf(" 2ical %i \n",ical);
# Line 312  Int_t Loop(TString ddir,TString list, TS Line 327  Int_t Loop(TString ddir,TString list, TS
327        thelp2 = mtime[ical+1];        thelp2 = mtime[ical+1];
328    
329        for (ii=0; ii<48;ii++) {        for (ii=0; ii<48;ii++) {
330          yhelp1 = dedx_corr_m[ical][ii];          yhelp1 = fabs(dedx_corr_m[ical][ii]);
331          //      yhelp1 = 6.;          //      yhelp1 = 6.;
332          if ( yhelp1 < 0.1 ) yhelp1 = 6.;          if ( yhelp1 < 0.1 ) yhelp1 = 4.;
333          yhelp2 = dedx_corr_m[ical+1][ii];          yhelp2 = fabs(dedx_corr_m[ical+1][ii]);
334          //      yhelp2 = 6.;          //      yhelp2 = 6.;
335          if ( yhelp2 < 0.1 ) yhelp2 = 6.;          if ( yhelp2 < 0.1 ) yhelp2 = 4.;
336          slope  = (yhelp2-yhelp1)/(thelp2-thelp1);          slope  = (yhelp2-yhelp1)/(thelp2-thelp1);
337          inter  = yhelp1 - slope*thelp1;          inter  = yhelp1 - slope*thelp1;
338          dedx_corr[ii] = slope*tabs + inter;          dedx_corr[ii] = slope*tabs + inter;
# Line 436  Int_t Loop(TString ddir,TString list, TS Line 451  Int_t Loop(TString ddir,TString list, TS
451        memcpy(t_tof->ytofpos,tofoutput_.ytofpos,sizeof(t_tof->ytofpos));        memcpy(t_tof->ytofpos,tofoutput_.ytofpos,sizeof(t_tof->ytofpos));
452        memcpy(t_tof->xtr_tof,tofoutput_.xtr_tof,sizeof(t_tof->xtr_tof));        memcpy(t_tof->xtr_tof,tofoutput_.xtr_tof,sizeof(t_tof->xtr_tof));
453        memcpy(t_tof->ytr_tof,tofoutput_.ytr_tof,sizeof(t_tof->ytr_tof));        memcpy(t_tof->ytr_tof,tofoutput_.ytr_tof,sizeof(t_tof->ytr_tof));
454        {        //      {
455          Float_t xtof_temp[6]={0.,t_tof->xtofpos[0],t_tof->xtofpos[1],0.,0.,t_tof->xtofpos[2]};  //      Float_t xtof_temp[6]={0.,t_tof->xtofpos[0],t_tof->xtofpos[1],0.,0.,t_tof->xtofpos[2]};
456          Float_t ytof_temp[6]={t_tof->ytofpos[0],0.,0.,t_tof->ytofpos[1],t_tof->ytofpos[2],0.};  //      Float_t ytof_temp[6]={t_tof->ytofpos[0],0.,0.,t_tof->ytofpos[1],t_tof->ytofpos[2],0.};
457          tofdedx->Process(pam_event->GetOrbitalInfo()->absTime,t_tof->beta[12], (Float_t *)xtof_temp,(Float_t *)ytof_temp);  //      tofdedx->Process(pam_event->GetOrbitalInfo()->absTime,t_tof->beta[12], (Float_t *)xtof_temp,(Float_t *)ytof_temp);
458        }  //       }
459        t_tof->npmtadc = 0;  //       t_tof->npmtadc = 0;
460    
461    
       for (Int_t hh=0; hh<12;hh++){  
         for (Int_t kk=0; kk<4;kk++){  
           pmt_id = tof->GetPMTid(kk,hh);  
           if ( tofdedx->GetdEdx_pmt(pmt_id)>-1. ){  
             t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);  
             t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);  
             t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07  
             t_tof->npmtadc++;  
           };  
         };  
       };  
462  //       for (Int_t hh=0; hh<12;hh++){  //       for (Int_t hh=0; hh<12;hh++){
463  //      for (Int_t kk=0; kk<4;kk++){  //      for (Int_t kk=0; kk<4;kk++){
464  //           if ( tofoutput_.adctof_c[hh][kk] < 1000 ){  //        pmt_id = tof->GetPMTid(kk,hh);
465  //          //      t_tof->dedx.AddAt(tofoutput_.adctof_c[hh][kk],t_tof->npmtadc); // EMILIANO  //        if ( tofdedx->GetdEdx_pmt(pmt_id)>-1. ){
466  //          pmt_id = tof->GetPMTid(kk,hh);  //          t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);
 //          t_tof->dedx.AddAt((tofoutput_.adctof_c[hh][kk]*4./dedx_corr[pmt_id]),t_tof->npmtadc); // EMILIANO  
467  //          t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);  //          t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);
468  //          t_tof->adcflag.AddAt(tofoutput_.adcflagtof[hh][kk],t_tof->npmtadc); // gf: Jan 09/07  //          t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07
469  //          t_tof->npmtadc++;  //          t_tof->npmtadc++;
470  //        };  //        };
471  //      };  //      };
472  //       };  //       };
473        //       {
474    
475        //          Float_t xtof_temp[6]={100.,100.,100.,100.,100.,100.};
476        new(t[ntrkentry]) ToFTrkVar(*t_tof);          Float_t ytof_temp[6]={100.,100.,100.,100.,100.,100.};
477        ntrkentry++;        
478        t_tof->Clear();          if(t_tof->xtofpos[0]<100. && t_tof->ytofpos[0]<100.){
479        //            xtof_temp[1]=t_tof->xtofpos[0];
480        //            ytof_temp[0]=t_tof->ytofpos[0];
481        //          }else if(t_tof->xtofpos[0]>=100. && t_tof->ytofpos[0]<100.){
482        t_pmt->Clear();            ytof_temp[0]=t_tof->ytofpos[0];
483        //            tof->GetPaddleGeometry(0,(Int_t)log2(tof->tof_j_flag[0]),xleft, xright, yleft, yright);
484              xtof_temp[1]=xleft+2.55;
485            }else if(t_tof->ytofpos[0]>=100. && t_tof->xtofpos[0]<100.){
486              xtof_temp[1]=t_tof->xtofpos[0];
487              tof->GetPaddleGeometry(1,(Int_t)log2(tof->tof_j_flag[1]),xleft, xright, yleft, yright);
488              ytof_temp[0]=yleft+2.75;
489            }
490    
491            if(t_tof->xtofpos[1]<100. && t_tof->ytofpos[1]<100.){
492              xtof_temp[2]=t_tof->xtofpos[1];
493              ytof_temp[3]=t_tof->ytofpos[1];
494            }else if(t_tof->xtofpos[1]>=100. && t_tof->ytofpos[1]<100.){
495              ytof_temp[3]=t_tof->ytofpos[1];
496              tof->GetPaddleGeometry(3,(Int_t)log2(tof->tof_j_flag[3]),xleft, xright, yleft, yright);
497              xtof_temp[2]=xleft+4.5;
498            }else if(t_tof->ytofpos[1]>=100. && t_tof->xtofpos[1]<100.){
499              xtof_temp[2]=t_tof->xtofpos[1];
500              tof->GetPaddleGeometry(2,(Int_t)log2(tof->tof_j_flag[2]),xleft, xright, yleft, yright);
501              ytof_temp[3]=yleft+3.75;
502            }
503    
504            if(t_tof->xtofpos[2]<100. && t_tof->ytofpos[2]<100.){
505              xtof_temp[5]=t_tof->xtofpos[2];
506              ytof_temp[4]=t_tof->ytofpos[2];
507            }else if(t_tof->xtofpos[2]>=100. && t_tof->ytofpos[2]<100.){
508              ytof_temp[4]=t_tof->ytofpos[2];
509              tof->GetPaddleGeometry(4,(Int_t)log2(tof->tof_j_flag[4]),xleft, xright, yleft, yright);
510              xtof_temp[5]=xleft+3;
511            }else if(t_tof->ytofpos[2]>=100. && t_tof->xtofpos[2]<100.){
512              xtof_temp[5]=t_tof->xtofpos[2];
513              tof->GetPaddleGeometry(5,(Int_t)log2(tof->tof_j_flag[5]),xleft, xright, yleft, yright);
514              ytof_temp[4]=yleft+2.5;
515            }
516    //       Float_t xtof_temp[6]={0.,t_tof->xtofpos[0],t_tof->xtofpos[1],0.,0.,t_tof->xtofpos[2]};
517    //       Float_t ytof_temp[6]={t_tof->ytofpos[0],0.,0.,t_tof->ytofpos[1],t_tof->ytofpos[2],0.};
518    //      tofdedx->Process(atime,t_tof->beta[12], (Float_t *)xtof_temp,(Float_t *)ytof_temp);
519            tofdedx->Process(pam_event->GetOrbitalInfo()->absTime,t_tof->beta[12], (Float_t *)xtof_temp,(Float_t *)ytof_temp);
520            t_tof->npmtadc = 0;
521            for (Int_t hh=0; hh<12;hh++){
522              for (Int_t kk=0; kk<4;kk++){
523                pmt_id = tof->GetPMTid(kk,hh);
524                Int_t Iplane=-1;
525                Int_t Ipaddle=-1;
526                //      Int_t IpaddleT=-1;
527                tof->GetPMTPaddle(pmt_id, Iplane, Ipaddle);
528                tof->GetPaddleGeometry(Iplane,Ipaddle,xleft,xright,yleft,yright);
529                if ( tofdedx->GetdEdx_pmt(pmt_id)>-1. &&((xtof_temp[Iplane]>=xleft&&xtof_temp[Iplane]<=xright) || (ytof_temp[Iplane]>=yleft&&ytof_temp[Iplane]<=yright)) ){  //attenzione:qui va inserito un controllo sulla traccia tof o sulle variabili di posizione !!!!
530                  //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*4./dedx_corr[pmt_id]),t_tof->npmtadc);
531                  //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*dedx_corr[pmt_id]/4.),t_tof->npmtadc);//annullo wolfrizzazione
532                  t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)),t_tof->npmtadc);//annullo wolfrizzazione
533                  t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);
534                  t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07
535                  t_tof->npmtadc++;
536                };
537              };
538            };
539          };
540    
541    
542    
543    
544    
545    
546    
547    
548    
549        
550         //       for (Int_t hh=0; hh<12;hh++){
551         //         for (Int_t kk=0; kk<4;kk++){
552         //           if ( tofoutput_.adctof_c[hh][kk] < 1000 ){
553         //             //      t_tof->dedx.AddAt(tofoutput_.adctof_c[hh][kk],t_tof->npmtadc); // EMILIANO
554         //             pmt_id = tof->GetPMTid(kk,hh);
555         //             t_tof->dedx.AddAt((tofoutput_.adctof_c[hh][kk]*4./dedx_corr[pmt_id]),t_tof->npmtadc); // EMILIANO
556         //             t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);
557         //             t_tof->adcflag.AddAt(tofoutput_.adcflagtof[hh][kk],t_tof->npmtadc); // gf: Jan 09/07
558         //             t_tof->npmtadc++;
559         //           };
560         //         };
561         //       };
562         //
563        
564         //
565         new(t[ntrkentry]) ToFTrkVar(*t_tof);
566         ntrkentry++;      
567         t_tof->Clear();
568         //
569         //
570         //
571         t_pmt->Clear();
572         //
573        for (Int_t hh=0; hh<12;hh++){        for (Int_t hh=0; hh<12;hh++){
574          for (Int_t kk=0; kk<4;kk++){          for (Int_t kk=0; kk<4;kk++){
575            // new WM            // new WM
# Line 514  Int_t Loop(TString ddir,TString list, TS Line 606  Int_t Loop(TString ddir,TString list, TS
606            for (Int_t e = 0; e < 5 ; e++){            for (Int_t e = 0; e < 5 ; e++){
607              tofinput_.al_pp[e] = ptt->al[e];              tofinput_.al_pp[e] = ptt->al[e];
608            };                  };      
609    
610              // new input for 9th reduction: tracker dEdx
611              tofinput_.trkmip = ptt->GetDEDX();
612    
613            //            //
614            // Get tracker related variables for this track            // Get tracker related variables for this track
615            //            //
# Line 544  Int_t Loop(TString ddir,TString list, TS Line 640  Int_t Loop(TString ddir,TString list, TS
640            //            //
641            tofdedx->Process(pam_event->GetOrbitalInfo()->absTime,t_tof->beta[12], (Float_t *)t_tof->xtr_tof,(Float_t *)t_tof->ytr_tof);            tofdedx->Process(pam_event->GetOrbitalInfo()->absTime,t_tof->beta[12], (Float_t *)t_tof->xtr_tof,(Float_t *)t_tof->ytr_tof);
642            t_tof->npmtadc = 0;            t_tof->npmtadc = 0;
643    
644            for (Int_t hh=0; hh<12;hh++){            for (Int_t hh=0; hh<12;hh++){
645              for (Int_t kk=0; kk<4;kk++){              for (Int_t kk=0; kk<4;kk++){
646                pmt_id = tof->GetPMTid(kk,hh);                pmt_id = tof->GetPMTid(kk,hh);
647                if ( tofdedx->GetdEdx_pmt(pmt_id) > -1. ){                Int_t Iplane=-1;
648                  t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);                Int_t Ipaddle=-1;
649                  Int_t IpaddleT=-1;
650                  tof->GetPMTPaddle(pmt_id, Iplane, Ipaddle);
651                  IpaddleT=tof->GetPaddleIdOfTrack(t_tof->xtr_tof[Iplane],t_tof->ytr_tof[Iplane], Iplane,0.0);
652                  if ( tofdedx->GetdEdx_pmt(pmt_id) > -1. && Ipaddle==IpaddleT ){
653                    //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*4./dedx_corr[pmt_id]),t_tof->npmtadc);
654                    //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*dedx_corr[pmt_id]/4.),t_tof->npmtadc);//annullo wolfrizzazione
655                    t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)),t_tof->npmtadc);//annullo wolfrizzazione
656                  t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);                  t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);
657                  t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07                  t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07
                 printf(" nt %i npmtadc %i dedx %f dedx corr %f\n",nt,t_tof->npmtadc,(tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),dedx_corr[pmt_id]);  
658                  t_tof->npmtadc++;                  t_tof->npmtadc++;
659                };                };
660                                
661              };              };
662            };            };
663    
664    
665    //        for (Int_t hh=0; hh<12;hh++){
666    //          for (Int_t kk=0; kk<4;kk++){
667    //            pmt_id = tof->GetPMTid(kk,hh);
668    //            if ( tofdedx->GetdEdx_pmt(pmt_id) > -1. ){
669    //              t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);
670    //              t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);
671    //              t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07
672    //              printf(" nt %i npmtadc %i dedx %f dedx corr %f\n",nt,t_tof->npmtadc,(tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),dedx_corr[pmt_id]);
673    //              t_tof->npmtadc++;
674    //            };
675                  
676    //          };
677    //        };
678  //        t_tof->npmtadc = 0;  //        t_tof->npmtadc = 0;
679  //        for (Int_t hh=0; hh<12;hh++){  //        for (Int_t hh=0; hh<12;hh++){
680  //          for (Int_t kk=0; kk<4;kk++){  //          for (Int_t kk=0; kk<4;kk++){
# Line 687  int HandleInputPar(int argc, char **argv Line 805  int HandleInputPar(int argc, char **argv
805        // -----------------------------------------------------//        // -----------------------------------------------------//
806        else if (!strcmp(argv[i], "-calibFile")){        else if (!strcmp(argv[i], "-calibFile")){
807          if (++i >= argc) throw -1;          if (++i >= argc) throw -1;
808          CALIBF = argv[i];          CALIBF = gSystem->ExpandPathName(argv[i]);
809          cout << "calibFile "<<CALIBF<<endl;          cout << "calibFile "<<CALIBF<<endl;
810          continue;          continue;
811        }          }  

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23