--- tof/flight/ToFReprocessing/ToFreproc.cpp 2010/03/10 09:43:19 1.4 +++ tof/flight/ToFReprocessing/ToFreproc.cpp 2012/04/12 12:04:20 1.6 @@ -44,7 +44,8 @@ extern "C" int toftrk(); ///extern "C" int toftrk(float); #define rdtofcal rdtofcal_ -extern "C" int rdtofcal(char [], int *); +//extern "C" int rdtofcal(char [], int *); +extern "C" int rdtofcal(const char *, int *); using namespace std; @@ -183,7 +184,8 @@ }; // tofdedx->ReadParAtt((glparam->PATH+glparam->NAME).Data()); - + printf(" Reading Attenuation file: %s \n",(glparam->PATH+glparam->NAME).Data()); + // error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,205,dbc); // parameters stored in DB in GL_PRAM table if ( error<0 ) { @@ -191,7 +193,8 @@ }; // tofdedx->ReadParPos((glparam->PATH+glparam->NAME).Data()); - + printf(" Reading desaturation1 file: %s \n",(glparam->PATH+glparam->NAME).Data()); + // error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,206,dbc); // parameters stored in DB in GL_PRAM table if ( error<0 ) { @@ -199,7 +202,8 @@ }; // tofdedx->ReadParBBneg((glparam->PATH+glparam->NAME).Data()); - + printf(" Reading BBneg file: %s \n",(glparam->PATH+glparam->NAME).Data()); + // error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,207,dbc); // parameters stored in DB in GL_PRAM table if ( error<0 ) { @@ -207,7 +211,8 @@ }; // tofdedx->ReadParBBpos((glparam->PATH+glparam->NAME).Data()); - + printf(" Reading BBpos file: %s \n",(glparam->PATH+glparam->NAME).Data()); + // error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,208,dbc); // parameters stored in DB in GL_PRAM table if ( error<0 ) { @@ -215,12 +220,11 @@ }; // tofdedx->ReadParDesatBB((glparam->PATH+glparam->NAME).Data()); - + printf(" Reading desaturation2 file: %s \n",(glparam->PATH+glparam->NAME).Data()); tofdedx->CheckConnectors(pam_event->GetRunInfo()->RUNHEADER_TIME,glparam,dbc); - error=glparam->Query_GL_PARAM(pam_event->GetRunInfo()->RUNHEADER_TIME,201,dbc); // parameters stored in DB in GL_PRAM table if ( error<0 ) { return(1); @@ -230,9 +234,15 @@ // if ( (UInt_t)glparam->TO_TIME != (UInt_t)4294967295UL ) defcal = false; // - Int_t nlen = (Int_t)(glparam->PATH+glparam->NAME).Length(); - rdtofcal((char *)(glparam->PATH+glparam->NAME).Data(),&nlen); + TString pippo=(glparam->PATH+glparam->NAME).Data(); + //Int_t nlen = (Int_t)(glparam->PATH+glparam->NAME).Length(); + //rdtofcal((char *)(glparam->PATH+glparam->NAME).Data(),&nlen); + Int_t nlen = (Int_t)pippo.Length(); + rdtofcal(pippo.Data(),&nlen); // + + tofdedx->Clear(); + }; // @@ -242,7 +252,7 @@ //--- Define absolute time UInt_t tabs=pam_event->GetOrbitalInfo()->absTime; - if ( !(iev%1000) ) 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); //================================================================== Float_t dedx_corr_m[2000][48],dedx_corr[48]; @@ -264,11 +274,11 @@ printf(" READING NEW CALIBRATION FILE: %s \n",CALIBF.Data()); ifstream fin(CALIBF.Data()); - + //cout << "topolino" << endl; while (! fin.eof()) { fin>>t1>>tm>>t2; - // cout<>j>>xmean1>>xwidth1; @@ -278,7 +288,7 @@ // printf(" kk %i \n",jj); } // printf(" 1ical %i \n",ical); - + //cout << "pippo" << endl; fin.close(); @@ -287,7 +297,7 @@ ical = ical+1; } // ical = ical-1; - cout<<"abs time "<GetPMTPaddle(pmt_id, Iplane, Ipaddle); tof->GetPaddleGeometry(Iplane,Ipaddle,xleft,xright,yleft,yright); 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 !!!! - t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*4./dedx_corr[pmt_id]),t_tof->npmtadc); + //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*4./dedx_corr[pmt_id]),t_tof->npmtadc); + //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*dedx_corr[pmt_id]/4.),t_tof->npmtadc);//annullo wolfrizzazione + t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)),t_tof->npmtadc);//annullo wolfrizzazione t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc); t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07 t_tof->npmtadc++; @@ -638,7 +650,9 @@ tof->GetPMTPaddle(pmt_id, Iplane, Ipaddle); IpaddleT=tof->GetPaddleIdOfTrack(t_tof->xtr_tof[Iplane],t_tof->ytr_tof[Iplane], Iplane,0.0); if ( tofdedx->GetdEdx_pmt(pmt_id) > -1. && Ipaddle==IpaddleT ){ - t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*4./dedx_corr[pmt_id]),t_tof->npmtadc); + //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*4./dedx_corr[pmt_id]),t_tof->npmtadc); + //t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)*dedx_corr[pmt_id]/4.),t_tof->npmtadc);//annullo wolfrizzazione + t_tof->dedx.AddAt((tofdedx->GetdEdx_pmt(pmt_id)),t_tof->npmtadc);//annullo wolfrizzazione t_tof->pmtadc.AddAt(pmt_id,t_tof->npmtadc); t_tof->adcflag.AddAt(0,t_tof->npmtadc); // gf: Jan 09/07 t_tof->npmtadc++; @@ -791,7 +805,7 @@ // -----------------------------------------------------// else if (!strcmp(argv[i], "-calibFile")){ if (++i >= argc) throw -1; - CALIBF = argv[i]; + CALIBF = gSystem->ExpandPathName(argv[i]); cout << "calibFile "<