diff --git a/reco/detectors/tof/CbmTofCalibrator.cxx b/reco/detectors/tof/CbmTofCalibrator.cxx index f371a525588166809f50828d0fce999fe08fa1a6..db0b9fc4d11ffd3da4bbd8ddc910cdb50cea05cb 100644 --- a/reco/detectors/tof/CbmTofCalibrator.cxx +++ b/reco/detectors/tof/CbmTofCalibrator.cxx @@ -183,7 +183,7 @@ Bool_t CbmTofCalibrator::CreateCalHist() { -TSumMax, TSumMax); - Double_t TotMax = 25.; + Double_t TotMax = 20.; //FIXME: has to be consistent with Clusterizer! fhCalTot[iDetIndx] = new TH2F( Form("cal_SmT%01d_sm%03d_rpc%03d_Tot", iSmType, iSmId, iRpcId), Form( @@ -230,7 +230,7 @@ Bool_t CbmTofCalibrator::CreateCalHist() { return kTRUE; } -void CbmTofCalibrator::FillCalHist(CbmTofTracklet* pTrk) { +void CbmTofCalibrator::FillCalHist(CbmTofTracklet* pTrk, Int_t iOpt) { // fill deviation histograms on walk level if (pTrk->GetTt() < 0) return; // take tracks with positive velocity only if (fbBeam @@ -350,38 +350,49 @@ void CbmTofCalibrator::FillCalHist(CbmTofTracklet* pTrk) { << hlocal_f[1] << ", " << hlocal_p[1] << ", " << hlocal_d[1] << ", TOT: " << tDigi0->GetTot() << " " << tDigi1->GetTot(); } - - fhCalWalk[iDetIndx][iCh0][iSide0]->Fill( - tDigi0->GetTot(), - tDigi0->GetTime() - + (1. - 2. * tDigi0->GetSide()) * hlocal_d[1] + Int_t iWalkMode=(iOpt - iOpt%10)/10; + switch(iWalkMode) { + case 0: + fhCalWalk[iDetIndx][iCh0][iSide0]->Fill( + tDigi0->GetTot(), + tDigi0->GetTime() + + (1. - 2. * tDigi0->GetSide()) * hlocal_d[1] / fDigiBdfPar->GetSigVel(iSmType, iSm, iRpc) - - pTrk->GetFitT( - pHit->GetZ()) //-fTrackletTools->GetTexpected(pTrk, iDetId, pHit) - + fTofFindTracks->GetTOff(iDetId) - + 2. * (1. - 2. * tDigi0->GetSide()) * (hlocal_d[1] - hlocal_f[1]) - / fDigiBdfPar->GetSigVel(iSmType, iSm, iRpc)); - /* - LOG(info)<<"TSRCS "<<iSmType<<iSm<<iRpc<<iCh<<iSide0<<Form(": digi0 %f, ex %f, prop %f, Off %f, res %f", + - pTrk->GetFitT( + pHit->GetZ()) //-fTrackletTools->GetTexpected(pTrk, iDetId, pHit) + + fTofFindTracks->GetTOff(iDetId) + + 2. * (1. - 2. * tDigi0->GetSide()) * (hlocal_d[1] - hlocal_f[1]) + / fDigiBdfPar->GetSigVel(iSmType, iSm, iRpc)); + /* + LOG(info)<<"TSRCS "<<iSmType<<iSm<<iRpc<<iCh<<iSide0<<Form(": digi0 %f, ex %f, prop %f, Off %f, res %f", tDigi0->GetTime(), fTrackletTools->GetTexpected(pTrk, iDetId, pHit) , fTofFindTracks->GetTOff(iDetId), (1.-2.*tDigi0->GetSide())*hlocal_f[1]/fDigiBdfPar->GetSigVel(iSmType,iSm,iRpc), tDigi0->GetTime()-fTrackletTools->GetTexpected(pTrk, iDetId, pHit) -(1.-2.*tDigi0->GetSide())*hlocal_f[1]/fDigiBdfPar->GetSigVel(iSmType,iSm,iRpc)); - */ + */ - - fhCalWalk[iDetIndx][iCh1][iSide1]->Fill( - tDigi1->GetTot(), - tDigi1->GetTime() - + (1. - 2. * tDigi1->GetSide()) * hlocal_d[1] + fhCalWalk[iDetIndx][iCh1][iSide1]->Fill( + tDigi1->GetTot(), + tDigi1->GetTime() + + (1. - 2. * tDigi1->GetSide()) * hlocal_d[1] / fDigiBdfPar->GetSigVel(iSmType, iSm, iRpc) - - pTrk->GetFitT( - pHit->GetZ()) //-fTrackletTools->GetTexpected(pTrk, iDetId, pHit) - + fTofFindTracks->GetTOff(iDetId) - + 2. * (1. - 2. * tDigi1->GetSide()) * (hlocal_d[1] - hlocal_f[1]) + - pTrk->GetFitT( + pHit->GetZ()) //-fTrackletTools->GetTexpected(pTrk, iDetId, pHit) + + fTofFindTracks->GetTOff(iDetId) + + 2. * (1. - 2. * tDigi1->GetSide()) * (hlocal_d[1] - hlocal_f[1]) / fDigiBdfPar->GetSigVel(iSmType, iSm, iRpc)); + break; + + case 1: { + Double_t dDeltaT = 0.5*(tDigi0->GetTime()+tDigi1->GetTime()) + - pTrk->GetFitT(pHit->GetZ()); + fhCalWalk[iDetIndx][iCh1][iSide0]->Fill(tDigi0->GetTot(),dDeltaT); + fhCalWalk[iDetIndx][iCh1][iSide1]->Fill(tDigi1->GetTot(),dDeltaT); + } + break; + } } } } @@ -416,7 +427,7 @@ Bool_t CbmTofCalibrator::UpdateCalHist(Int_t iOpt) { continue; } - switch (iOpt) { + switch (iOpt%10) { case 0: // none break; case 1: // update channel mean diff --git a/reco/detectors/tof/CbmTofCalibrator.h b/reco/detectors/tof/CbmTofCalibrator.h index 1da5184d80f2a2e9a4846590d6b888adcba0d2e4..08e913e57a49593aba097b74ddbe957d1c100295 100644 --- a/reco/detectors/tof/CbmTofCalibrator.h +++ b/reco/detectors/tof/CbmTofCalibrator.h @@ -53,7 +53,7 @@ public: InitStatus Init(); Bool_t InitParameters(); Bool_t CreateCalHist(); - void FillCalHist(CbmTofTracklet* pTrk); + void FillCalHist(CbmTofTracklet* pTrk, Int_t iOpt); Bool_t UpdateCalHist(Int_t iOpt); void ReadHist(TFile* fhFile); void WriteHist(TFile* fhFile);