/[PAMELA software]/DarthVader/ToFLevel2/src/ToFCore.cpp
ViewVC logotype

Diff of /DarthVader/ToFLevel2/src/ToFCore.cpp

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

revision 1.39 by mocchiut, Wed Dec 2 22:41:02 2009 UTC revision 1.40 by mocchiut, Mon Dec 28 10:22:31 2009 UTC
# Line 214  int ToFCore(UInt_t run, TFile *file, GL_ Line 214  int ToFCore(UInt_t run, TFile *file, GL_
214    Float_t yhelp1,yhelp2,slope,inter,thelp1,thelp2;    Float_t yhelp1,yhelp2,slope,inter,thelp1,thelp2;
215    Float_t xmean1,xwidth1;    Float_t xmean1,xwidth1;
216    Int_t ical,ii,wj,jj;    Int_t ical,ii,wj,jj;
217      Float_t xleft=0;
218      Float_t xright=0;
219      Float_t yleft=0;
220      Float_t yright=0;
221    //    //
222    // Let's start!    // Let's start!
223    //    //
# Line 850  int ToFCore(UInt_t run, TFile *file, GL_ Line 854  int ToFCore(UInt_t run, TFile *file, GL_
854        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));
855        //        //
856        {        {
       Float_t xtof_temp[6]={0.,t_tof->xtofpos[0],t_tof->xtofpos[1],0.,0.,t_tof->xtofpos[2]};  
       Float_t ytof_temp[6]={t_tof->ytofpos[0],0.,0.,t_tof->ytofpos[1],t_tof->ytofpos[2],0.};  
857    
858        tofdedx->Process(atime,t_tof->beta[12], (Float_t *)xtof_temp,(Float_t *)ytof_temp);          Float_t xtof_temp[6]={100.,100.,100.,100.,100.,100.};
859        }          Float_t ytof_temp[6]={100.,100.,100.,100.,100.,100.};
860        t_tof->npmtadc = 0;  
861        for (Int_t hh=0; hh<12;hh++){          if(t_tof->xtofpos[0]<100. && t_tof->ytofpos[0]<100.){
862          for (Int_t kk=0; kk<4;kk++){            xtof_temp[1]=t_tof->xtofpos[0];
863              ytof_temp[0]=t_tof->ytofpos[0];
864            }else if(t_tof->xtofpos[0]>=100. && t_tof->ytofpos[0]<100.){
865              ytof_temp[0]=t_tof->ytofpos[0];
866              tof->GetPaddleGeometry(0,(Int_t)log2(tof->tof_j_flag[0]),xleft, xright, yleft, yright);
867              xtof_temp[1]=xright+2.55;
868            }else if(t_tof->ytofpos[0]>=100. && t_tof->xtofpos[0]<100.){
869              xtof_temp[1]=t_tof->xtofpos[0];
870              tof->GetPaddleGeometry(1,(Int_t)log2(tof->tof_j_flag[1]),xleft, xright, yleft, yright);
871              ytof_temp[0]=yright+2.75;
872            }
873    
874            if(t_tof->xtofpos[1]<100. && t_tof->ytofpos[1]<100.){
875              xtof_temp[2]=t_tof->xtofpos[1];
876              ytof_temp[3]=t_tof->ytofpos[1];
877            }else if(t_tof->xtofpos[1]>=100. && t_tof->ytofpos[1]<100.){
878              ytof_temp[3]=t_tof->ytofpos[1];
879              tof->GetPaddleGeometry(3,(Int_t)log2(tof->tof_j_flag[3]),xleft, xright, yleft, yright);
880              xtof_temp[2]=xright+4.5;
881            }else if(t_tof->ytofpos[1]>=100. && t_tof->xtofpos[1]<100.){
882              xtof_temp[2]=t_tof->xtofpos[1];
883              tof->GetPaddleGeometry(2,(Int_t)log2(tof->tof_j_flag[2]),xleft, xright, yleft, yright);
884              ytof_temp[3]=yright+3.75;
885            }
886    
887            if(t_tof->xtofpos[2]<100. && t_tof->ytofpos[2]<100.){
888              xtof_temp[5]=t_tof->xtofpos[2];
889              ytof_temp[4]=t_tof->ytofpos[2];
890            }else if(t_tof->xtofpos[2]>=100. && t_tof->ytofpos[2]<100.){
891              ytof_temp[4]=t_tof->ytofpos[2];
892              tof->GetPaddleGeometry(4,(Int_t)log2(tof->tof_j_flag[4]),xleft, xright, yleft, yright);
893              xtof_temp[5]=xright+3;
894            }else if(t_tof->ytofpos[2]>=100. && t_tof->xtofpos[2]<100.){
895              xtof_temp[5]=t_tof->xtofpos[2];
896              tof->GetPaddleGeometry(5,(Int_t)log2(tof->tof_j_flag[5]),xleft, xright, yleft, yright);
897              ytof_temp[4]=yright+2.5;
898            }
899    //       Float_t xtof_temp[6]={0.,t_tof->xtofpos[0],t_tof->xtofpos[1],0.,0.,t_tof->xtofpos[2]};
900    //       Float_t ytof_temp[6]={t_tof->ytofpos[0],0.,0.,t_tof->ytofpos[1],t_tof->ytofpos[2],0.};
901            tofdedx->Process(atime,t_tof->beta[12], (Float_t *)xtof_temp,(Float_t *)ytof_temp);
902            t_tof->npmtadc = 0;
903            for (Int_t hh=0; hh<12;hh++){
904              for (Int_t kk=0; kk<4;kk++){
905              pmt_id = tof->GetPMTid(kk,hh);              pmt_id = tof->GetPMTid(kk,hh);
906            if ( tofdedx->GetdEdx_pmt(pmt_id)>-1. ){              Int_t Iplane=-1;
907              t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);              Int_t Ipaddle=-1;
908              t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);              //      Int_t IpaddleT=-1;
909              t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07              tof->GetPMTPaddle(pmt_id, Iplane, Ipaddle);
910              t_tof->npmtadc++;              tof->GetPaddleGeometry(Iplane,Ipaddle,xleft,xright,yleft,yright);
911                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 !!!!
912                  t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);
913                  t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);
914                  t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07
915                  t_tof->npmtadc++;
916                };
917            };            };
918          };          };
919        };        };
920          
921  /*  /*
922        cout<<"ToFCore  tofl2com"<<endl;        cout<<"ToFCore  tofl2com"<<endl;
923        cout<<tofoutput_.xtofpos[0]<<" "<<tofoutput_.xtofpos[1]<<" "<<tofoutput_.xtofpos[2]<<endl;        cout<<tofoutput_.xtofpos[0]<<" "<<tofoutput_.xtofpos[1]<<" "<<tofoutput_.xtofpos[2]<<endl;
# Line 952  int ToFCore(UInt_t run, TFile *file, GL_ Line 1002  int ToFCore(UInt_t run, TFile *file, GL_
1002            for (Int_t hh=0; hh<12;hh++){            for (Int_t hh=0; hh<12;hh++){
1003              for (Int_t kk=0; kk<4;kk++){              for (Int_t kk=0; kk<4;kk++){
1004                pmt_id = tof->GetPMTid(kk,hh);                pmt_id = tof->GetPMTid(kk,hh);
1005                if ( tofdedx->GetdEdx_pmt(pmt_id) > -1. ){                Int_t Iplane=-1;
1006                  Int_t Ipaddle=-1;
1007                  Int_t IpaddleT=-1;
1008                  tof->GetPMTPaddle(pmt_id, Iplane, Ipaddle);
1009                  IpaddleT=tof->GetPaddleIdOfTrack(t_tof->xtr_tof[Iplane],t_tof->ytr_tof[Iplane], Iplane);
1010                  if ( tofdedx->GetdEdx_pmt(pmt_id) > -1. && Ipaddle==IpaddleT ){
1011                  t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);                  t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*36./pow(dedx_corr[pmt_id],2)),t_tof->npmtadc);
1012                  if ( debug ) 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]);                  if ( debug ) 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]);
1013                  t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);                  t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc);

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.23