17 #include "FairLogger.h"
18 #include "FairRootManager.h"
20 #include "FairRunOnline.h"
21 #include "FairRuntimeDb.h"
25 #include "TClonesArray.h"
30 #include "THttpServer.h"
32 #include "TPaveStats.h"
34 #include "TProfile2D.h"
55 , fvMsComponentsList()
58 , fbIgnoreOverlapMs(kFALSE)
59 , fsHistoFileFullname(
"data/TofPulserHistos.root")
60 , fuMsAcceptsPercent(100)
65 , fdTsCoreSizeInNs(0.0)
72 , fuNrOfChannelsPerGet4(0)
73 , fuNrOfChannelsPerFee(0)
75 , fuNrOfGet4PerGdpb(0)
76 , fuNrOfChannelsPerGdpb(0)
77 , fuRawDataPrintMsgNb(100000)
78 , fuRawDataPrintMsgIdx(fuRawDataPrintMsgNb)
79 , fbPrintAllHitsEnable(kFALSE)
80 , fbPrintAllEpochsEnable(kFALSE)
81 , fulCurrentTsIndex(0)
90 , fviMsgCounter(11, 0)
96 , fvulGdpbTsFullLast()
97 , fvulStarTsFullLast()
100 , fvuStarTrigCmdLast()
102 , fvbFirstEpochSeen()
103 , fvulCurrentEpochCycle()
104 , fvulCurrentEpochFull()
105 , fulCurrentEpochTime(0)
108 , fvuFeeChanNbHitsLastMs()
109 , fvdFeeChanMsLastPulserHit()
115 , fuNbFeePlotsPerGdpb(0)
117 , fdStartTimeLong(-1.)
118 , fdStartTimeMsSz(-1.)
119 , fuHistoryHistoSize(1800)
120 , fdLastRmsUpdateTime(0.0)
121 , fdFitZoomWidthPs(0.0)
123 , fvhMsSzPerLink(12, NULL)
124 , fvhMsSzTimePerLink(12, NULL)
133 , fvhTimeDiffPulserFeeA()
134 , fhTimeMeanPulserFeeA(NULL)
135 , fhTimeRmsPulserFeeA(NULL)
136 , fhTimeRmsZoomFitPulsFeeA(NULL)
137 , fhTimeResFitPulsFeeA(NULL)
138 , fvhTimeDiffPulserFeeB()
139 , fhTimeMeanPulserFeeB(NULL)
140 , fhTimeRmsPulserFeeB(NULL)
141 , fhTimeRmsZoomFitPulsFeeB(NULL)
142 , fhTimeResFitPulsFeeB(NULL)
143 , fvhTimeDiffPulserFeeFee()
144 , fhTimeMeanPulserFeeFee(NULL)
145 , fhTimeRmsPulserFeeFee(NULL)
146 , fhTimeRmsZoomFitPulsFeeFee(NULL)
147 , fhTimeResFitPulsFeeFee(NULL)
148 , fhChanTotFeeA(NULL)
149 , fhChanTotFeeB(NULL)
150 , fhChanPulseIntervalFeeA(NULL)
151 , fhChanPulseIntervalFeeB(NULL)
152 , fvhPulserCountEvoPerFeeGdpb()
155 , fcPulserFeeFee(NULL)
161 , fTimeLastHistoSaving() {}
166 LOG(info) <<
"Initializing Get4 monitor";
168 FairRootManager* ioman = FairRootManager::Instance();
170 LOG(fatal) <<
"No FairRootManager instance";
177 LOG(info) <<
"Setting parameter containers for " << GetName();
180 "CbmMcbm2018TofPar"));
184 LOG(info) <<
"Init parameter containers for " << GetName();
205 LOG(info) <<
"ReInit parameter containers for " << GetName();
235 LOG(info) <<
"GDPB Id of TOF " <<
i <<
" : " << std::hex
249 for (UInt_t uGbtx = 0; uGbtx <
fuNrOfGbtx; ++uGbtx) {
256 TString sPrintoutLine =
"Nr. of RPCs per GBTx: ";
257 for (UInt_t uGbtx = 0; uGbtx <
fuNrOfGbtx; ++uGbtx)
258 sPrintoutLine += Form(
" %2d",
fviNrOfRpc[uGbtx]);
259 LOG(info) << sPrintoutLine;
261 sPrintoutLine =
"RPC type per GBTx: ";
262 for (UInt_t uGbtx = 0; uGbtx <
fuNrOfGbtx; ++uGbtx)
263 sPrintoutLine += Form(
" %2d",
fviRpcType[uGbtx]);
264 LOG(info) << sPrintoutLine;
266 sPrintoutLine =
"RPC side per GBTx: ";
267 for (UInt_t uGbtx = 0; uGbtx <
fuNrOfGbtx; ++uGbtx)
268 sPrintoutLine += Form(
" %2d",
fviRpcSide[uGbtx]);
269 LOG(info) << sPrintoutLine;
271 sPrintoutLine =
"Module ID per GBTx: ";
272 for (UInt_t uGbtx = 0; uGbtx <
fuNrOfGbtx; ++uGbtx)
274 LOG(info) << sPrintoutLine;
281 LOG(info) <<
"Timeslice parameters: " <<
fuTotalMsNb
295 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {
337 UInt_t uGet4topadi[32] = {4, 3, 2, 1,
338 8, 7, 6, 5, 12, 11, 10, 9, 16, 15,
339 14, 13, 20, 19, 18, 17, 24, 23, 22, 21,
340 28, 27, 26, 25, 32, 31, 30, 29};
342 UInt_t uPaditoget4[32] = {4, 3, 2, 1,
343 12, 11, 10, 9, 20, 19, 18, 17, 28, 27,
344 26, 25, 32, 31, 30, 29, 8, 7, 6, 5,
345 16, 15, 14, 13, 24, 23, 22, 21};
357 27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
358 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
359 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
361 24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11,
362 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0,
363 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36};
385 TString sMsSzName = Form(
"MsSz_link_%02lu", component);
387 Form(
"Size of MS from link %02lu; Ms Size [bytes]", component);
389 new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
391 sMsSzName = Form(
"MsSzTime_link_%02lu", component);
393 "Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]",
400 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
410 LOG(info) <<
"Added MS size histo for component (link): " << component;
421 LOG(info) <<
"create Histos for " <<
fuNrOfGdpbs <<
" gDPBs ";
423 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
435 Double_t dBinSzG4v2 = (6250. / 112.);
450 if (uChanA < uChanB) {
452 new TH1I(Form(
"hTimeDiffPulser_g%02u_gbt%1u_f%1u_ch%02u_ch%02u",
458 Form(
"Time difference for pulser on gDPB %02u GBTx %02u FEE "
459 "%1u channels %02u and %02u; DeltaT [ps]; Counts",
470 new TH1I(Form(
"hTimeDiffPulser_g%02u_gbt%1u_f%1u_ch%02u_ch%02u",
476 Form(
"Time difference for pulser on gDPB %02u GBTx %02u FEE "
477 "%1u channels %02u and %02u; DeltaT [ps]; Counts",
494 "hTimeDiffPulser_g%02u_gbt%1u_f%1u_ch%02u_g%02u_gbt%1u_f%1u_ch%02u",
503 Form(
"Time difference for pulser on gDPB %02u GBTx %02u FEE %1u "
504 "channel %02u and gDPB %02u GBTx %02u FEE %1u channel %02u; "
505 "DeltaT [ps]; Counts",
521 name =
"hTimeMeanPulserFeeA";
523 "Time difference Mean for each channel pairs "
524 "in FEE A; Chan A; Chan B ; Mean [ps]",
532 name =
"hTimeRmsPulserFeeA";
534 "Time difference RMS for each channel pairs "
535 "in FEE A; Chan A; Chan B; RMS [ps]",
543 name =
"hTimeRmsZoomFitPulsFeeA";
545 new TH2D(name.Data(),
546 "Time difference RMS after zoom for each channel pairs in FEE A; "
547 "Chan A; Chan B; RMS [ps]",
555 name =
"hTimeResFitPulsFeeA";
557 new TH2D(name.Data(),
558 "Time difference Res from fit for each channel pairs in FEE A; "
559 "Chan A; Chan B; Sigma [ps]",
568 name =
"hTimeMeanPulserFeeB";
570 "Time difference Mean for each channel pairs "
571 "in FEE B; Chan A; Chan B ; Mean [ps]",
579 name =
"hTimeRmsPulserFeeB";
581 "Time difference RMS for each channel pairs "
582 "in FEE B; Chan A; Chan B; RMS [ps]",
590 name =
"hTimeRmsZoomFitPulsFeeB";
592 new TH2D(name.Data(),
593 "Time difference RMS after zoom for each channel pairs in FEE B; "
594 "Chan A; Chan B; RMS [ps]",
602 name =
"hTimeResFitPulsFeeB";
604 new TH2D(name.Data(),
605 "Time difference Res from fit for each channel pairs in FEE B; "
606 "Chan A; Chan B; Sigma [ps]",
615 name =
"hTimeMeanPulserFeeFee";
617 new TH2D(name.Data(),
618 "Time difference Mean for each channel pairs in FEE A & B; Chan "
619 "FEE A; Chan FEE B ; Mean [ps]",
627 name =
"hTimeRmsPulserFeeFee";
629 new TH2D(name.Data(),
630 "Time difference RMS for each channel pairs in FEE A & B; Chan "
631 "FEE A; Chan FEE B; RMS [ps]",
639 name =
"hTimeRmsZoomFitPulsFeeFee";
641 new TH2D(name.Data(),
642 "Time difference RMS after zoom for each channel pairs in FEE A & "
643 "B; Chan FEE A; Chan FEE B; RMS [ps]",
651 name =
"hTimeResFitPulsFeeFee";
653 new TH2D(name.Data(),
654 "Time difference Res from fit for each channel pairs in FEE A & "
655 "B; Chan FEE A; Chan FEE B; Sigma [ps]",
664 name =
"hChanTotFeeA";
667 "TOT distribution per channel in FEE A; Chan FEE A; TOT [bin]; Counts []",
674 name =
"hChanTotFeeB";
677 "TOT distribution per channel in FEE B; Chan FEE B; TOT [bin]; Counts []",
687 uint32_t iNbBinsLog = 0;
689 std::vector<double> dBinsLogVector =
691 double* dBinsLog = dBinsLogVector.data();
694 name =
"hChanPulseIntervalFeeA";
696 new TH2D(name.Data(),
697 "Pulses time interval per channel in FEE A; Time interval [ns]; "
698 "Chan FEE A; Counts []",
704 name =
"hChanPulseIntervalFeeB";
706 new TH2D(name.Data(),
707 "Pulses time interval per channel in FEE B; Time interval [ns]; "
708 "Chan FEE B; Counts []",
715 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {
716 name = Form(
"hPulserCountEvoPerFeeGdpb%02u", uGdpb);
719 Form(
"Pulser count per FEE in gDPB %02u; time in run [s]; FEE []", uGdpb),
739 server->Register(
"/TofDtFeeFee",
763 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {
768 server->RegisterCommand(
"/Reset_All_eTOF",
769 "bMcbmTofTestFeeResetHistos=kTRUE");
770 server->RegisterCommand(
"/Save_All_eTof",
771 "bMcbmTofTestFeeSaveHistos=kTRUE");
772 server->RegisterCommand(
"/Update_PulsFit",
773 "bMcbmTofTestFeeUpdateZoomedFit=kTRUE");
774 server->RegisterCommand(
"/Print_Raw_Data",
775 "bMcbmTofTestFeeRawDataPrint=kTRUE");
776 server->RegisterCommand(
"/Print_AllHits",
777 "bMcbmTofTestFeePrintAllHitsEna=kTRUE");
778 server->RegisterCommand(
"/Print_AllEps",
779 "bMcbmTofTestFeePrintAllEpochsEna=kTRUE");
781 server->Restrict(
"/Reset_All_eTof",
"allow=admin");
782 server->Restrict(
"/Save_All_eTof",
"allow=admin");
783 server->Restrict(
"/Update_PulsFit",
"allow=admin");
784 server->Restrict(
"/Print_Raw_Data",
"allow=admin");
785 server->Restrict(
"/Print_AllHits",
"allow=admin");
786 server->Restrict(
"/Print_AllEps",
"allow=admin");
795 "cPulserFeeA",
"Time difference RMS for channels on FEE A", w,
h);
823 "cPulserFeeB",
"Time difference RMS for channels on FEE A", w,
h);
851 new TCanvas(
"cPulserFeeFee",
852 "Time difference RMS for channels on FEE A VS FEE B",
882 "cPulseProp",
"Pulse properties for each channel on FEE A and FEE B", w,
h);
917 fcMsSizeAll =
dynamic_cast<TCanvas*
>(gROOT->FindObject(
"cMsSizeAll"));
920 new TCanvas(
"cMsSizeAll",
"Evolution of MS size in last 300 s", w,
h);
922 LOG(info) <<
"Created MS size canvas in TOF monitor";
925 LOG(info) <<
"Recovered MS size canvas in TOF monitor";
927 LOG(info) <<
"Leaving CreateHistograms";
933 LOG(info) <<
"Reset eTOF STAR histos ";
938 LOG(info) <<
"Start saving eTOF STAR histos ";
966 std::chrono::time_point<std::chrono::system_clock> timeCurrent =
967 std::chrono::system_clock::now();
968 std::chrono::duration<double> elapsed_seconds =
975 else if (300 < elapsed_seconds.count()) {
976 std::time_t cTimeCurrent =
977 std::chrono::system_clock::to_time_t(timeCurrent);
979 std::strftime(tempBuff, 80,
"%F %T", localtime(&cTimeCurrent));
992 LOG(debug1) <<
"Timeslice contains " << ts.num_microslices(component)
999 Int_t messageType = -111;
1000 Double_t dTsStartTime = -1;
1003 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1012 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1029 constexpr uint32_t kuBytesPerMessage = 8;
1032 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1034 fdMsIndex =
static_cast<double>(msDescriptor.idx);
1036 const uint8_t* msContent =
1037 reinterpret_cast<const uint8_t*
>(ts.content(uMsComp, uMsIdx));
1039 uint32_t size = msDescriptor.size;
1042 LOG(debug) <<
"Microslice: " << msDescriptor.idx
1043 <<
" has size: " << size;
1051 if (0 == uMsIdx && 0 == uMsCompIdx) dTsStartTime = (1e-9) *
fdMsIndex;
1064 if (0 != (size % kuBytesPerMessage))
1065 LOG(error) <<
"The input microslice buffer does NOT "
1066 <<
"contain only complete nDPB messages!";
1069 uint32_t uNbMessages =
1070 (size - (size % kuBytesPerMessage)) / kuBytesPerMessage;
1079 <<
"---------------------------------------------------------------";
1090 LOG(warning) <<
"Could not find the gDPB index for AFCK id 0x"
1091 << std::hex <<
fuGdpbId << std::dec <<
" in timeslice "
1093 <<
" component " << uMsCompIdx <<
"\n"
1094 <<
"If valid this index has to be added in the TOF "
1095 "parameter file in the RocIdArray field";
1102 const uint64_t* pInBuff =
reinterpret_cast<const uint64_t*
>(msContent);
1103 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
1105 uint64_t ulData =
static_cast<uint64_t
>(pInBuff[uIdx]);
1116 || gLogger->IsLogNeeded(fair::Severity::debug2)) {
1134 LOG(warning) <<
"Message with Get4 ID too high: " <<
fuGet4Id
1137 switch (messageType) {
1160 LOG(info) <<
"Epoch: " << Form(
"0x%08x ",
fuGdpbId) <<
", Merg"
1162 <<
", epoch " << std::setw(8)
1165 <<
", Data loss " << std::setw(1)
1168 <<
", Epoch miss " << std::setw(1)
1176 LOG(info) <<
"Epoch: " << Form(
"0x%08x ",
fuGdpbId) <<
", "
1177 << std::setw(4) <<
fuGet4Nr <<
", Link "
1179 <<
", epoch " << std::setw(8)
1182 <<
", Data loss " << std::setw(1)
1185 <<
", Epoch miss " << std::setw(1)
1217 LOG(error) <<
"Message type " << std::hex << std::setw(2)
1218 <<
static_cast<uint16_t
>(messageType)
1219 <<
" not included in Get4 unpacker.";
1229 Bool_t bChanOkFeeA = kFALSE;
1230 Bool_t bChanOkFeeB = kFALSE;
1232 bChanOkFeeA = kTRUE;
1234 bChanOkFeeB = kTRUE;
1242 Double_t dTimeDiff =
1252 Double_t dTimeDiff =
1265 Double_t dTimeDiff =
1329 || gLogger->IsLogNeeded(fair::Severity::debug2)) {
1331 <<
"CbmMcbm2018TofTestFee::ProcessEpochCyle => "
1364 if (0 < ulCurEpochGdpbGet4)
1365 ulCurEpochGdpbGet4--;
1370 UInt_t uChannelNrInFee =
1375 UInt_t uRemappedChannelNrInFee =
fvuGet4ToPadi[uChannelNrInFee];
1379 uRemappedChannelNrInFee = uChannelNrInFee;
1412 uRemappedChannelNrInFee);
1419 uRemappedChannelNrInFee);
1429 LOG(info) <<
"Hit: " << Form(
"0x%08x ",
fuGdpbId) <<
", " << std::setw(2)
1430 <<
fuGet4Nr <<
", " << std::setw(3) << uChannel <<
", "
1431 << std::setw(3) << uTot <<
", epoch " << std::setw(3)
1432 << ulCurEpochGdpbGet4 <<
", FullTime Clk "
1433 << Form(
"%12lu ", ulHitTime) <<
", FullTime s "
1434 << Form(
"%12.9f ", dHitTime / 1e9) <<
", FineTime " << uFts;
1458 if (0 < iBufferSize) {
1459 LOG(debug) <<
"Now processing stored messages for for get4 " <<
fuGet4Nr
1467 for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
1497 uint64_t uData = mess.
getData();
1499 LOG(debug) <<
"Get4 MSG type " << mType <<
" from gdpbId " <<
fuGdpbId
1500 <<
", getId " <<
fuGet4Id <<
", (hit channel) " << channel
1501 <<
" data " << std::hex << uData;
1506 LOG(debug) <<
"GET4 System message, epoch "
1508 << std::setprecision(9) << std::fixed
1510 <<
" for board ID " << std::hex << std::setw(4) <<
fuGdpbId
1522 LOG(debug) <<
" +++++++ > gDPB: " << std::hex << std::setw(4)
1523 <<
fuGdpbId << std::dec <<
", Chip = " << std::setw(2)
1528 << std::setw(2) << uData << std::dec
1529 <<
" -- GET4 V1 Error Event";
1531 LOG(debug) <<
" +++++++ >gDPB: " << std::hex << std::setw(4) <<
fuGdpbId
1532 << std::dec <<
", Chip = " << std::setw(2)
1537 << std::setw(2) << uData << std::dec
1538 <<
" -- GET4 V1 Error Event ";
1542 LOG(debug) <<
"Unknown GET4 message, data: " << std::hex << std::setw(8)
1544 <<
" Full message: " << std::hex << std::setw(16)
1545 << mess.
getData() << std::dec;
1550 LOG(info) << Form(
"GET4 Resynchronization: Get4:0x%04x ",
1552 << std::hex << std::setw(4) <<
fuGdpbId << std::dec;
1554 LOG(info) <<
"GET4 synchronization pulse missing in gDPB " << std::hex
1555 << std::setw(4) <<
fuGdpbId << std::dec;
1559 LOG(debug) <<
"ASIC pattern for missmatch, disable or resync";
1563 LOG(debug) <<
"Crazy system message, subtype "
1634 switch (iMsgIndex) {
1643 ULong64_t ulNewGdpbTsFull =
1660 LOG(warning) <<
"Possible error: identical STAR tokens found twice in "
1661 "a row => ignore 2nd! "
1668 << Form(
"TRG Wrd = %5x ", uTrigWord);
1685 LOG(debug) <<
"Probable reset of the STAR TS: old = "
1687 <<
" new = " << Form(
"%16llu", ulNewStarTsFull)
1730 default: LOG(error) <<
"Unknown Star Trigger messageindex: " << iMsgIndex;
1738 TString message_type;
1741 case 0: message_type =
"NOP";
break;
1742 case 1: message_type =
"HIT";
break;
1743 case 2: message_type =
"EPOCH";
break;
1744 case 3: message_type =
"SYNC";
break;
1745 case 4: message_type =
"AUX";
break;
1746 case 5: message_type =
"EPOCH2";
break;
1747 case 6: message_type =
"GET4";
break;
1748 case 7: message_type =
"SYS";
break;
1749 case 8: message_type =
"GET4_SLC";
break;
1750 case 9: message_type =
"GET4_32B";
break;
1751 case 10: message_type =
"GET4_SYS";
break;
1752 default: message_type =
"UNKNOWN";
break;
1820 TDirectory* oldDir = NULL;
1821 TFile* histoFile = NULL;
1822 if (
"" != sFileName) {
1824 oldDir = gDirectory;
1826 histoFile =
new TFile(sFileName,
"RECREATE");
1830 gDirectory->mkdir(
"TofDt");
1831 gDirectory->cd(
"TofDt");
1847 gDirectory->cd(
"..");
1851 gDirectory->mkdir(
"TofDtFeeA");
1852 gDirectory->cd(
"TofDtFeeA");
1857 gDirectory->cd(
"..");
1859 gDirectory->mkdir(
"TofDtFeeB");
1860 gDirectory->cd(
"TofDtFeeB");
1865 gDirectory->cd(
"..");
1867 gDirectory->mkdir(
"TofDtFeeFee");
1868 gDirectory->cd(
"TofDtFeeFee");
1873 gDirectory->cd(
"..");
1875 gDirectory->mkdir(
"TofPulse");
1876 gDirectory->cd(
"TofPulse");
1881 gDirectory->cd(
"..");
1883 gDirectory->mkdir(
"TofCnt");
1884 gDirectory->cd(
"TofCnt");
1885 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb)
1887 gDirectory->cd(
"..");
1889 gDirectory->mkdir(
"Flib_Raw");
1890 gDirectory->cd(
"Flib_Raw");
1891 for (UInt_t uLinks = 0; uLinks <
fvhMsSzPerLink.size(); uLinks++) {
1898 TH1* pMissedTsH1 =
dynamic_cast<TH1*
>(gROOT->FindObjectAny(
"Missed_TS"));
1899 if (NULL != pMissedTsH1) pMissedTsH1->Write();
1901 TProfile* pMissedTsEvoP =
1902 dynamic_cast<TProfile*
>(gROOT->FindObjectAny(
"Missed_TS_Evo"));
1903 if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
1905 gDirectory->cd(
"..");
1913 if (
"" != sFileName) {
1918 if (
"" != sFileName) {
1926 LOG(info) <<
"Reseting all TOF histograms.";
1964 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb)
1967 for (UInt_t uLinks = 0; uLinks <
fvhMsSzPerLink.size(); uLinks++) {
1980 std::vector<std::vector<TH1*>> phTimeDiff,
1982 TH2* phTimeResFit) {
1986 phTimeRmsZoom->Reset();
1987 phTimeResFit->Reset();
1994 if (NULL != phTimeDiff[uChanA][uChanB]) {
1996 if (0 == phTimeDiff[uChanA][uChanB]->GetEntries()) {
1997 phTimeRmsZoom->Fill(uChanA, uChanB, 0.0);
1998 phTimeResFit->Fill(uChanA, uChanB, 0.0);
2000 <<
"CbmMcbm2018TofTestFee::UpdateZoomedFit => Empty input "
2001 <<
"for Chan pair " << uChanA <<
" and " << uChanB <<
" !!! ";
2006 Int_t iBinWithMax = phTimeDiff[uChanA][uChanB]->GetMaximumBin();
2007 Double_t dNbCounts = phTimeDiff[uChanA][uChanB]->Integral();
2011 phTimeDiff[uChanA][uChanB]->GetXaxis()->GetBinCenter(iBinWithMax);
2012 phTimeDiff[uChanA][uChanB]->GetXaxis()->SetRangeUser(
2016 Double_t dZoomCounts = phTimeDiff[uChanA][uChanB]->Integral();
2017 if ((dZoomCounts / dNbCounts) < 0.99) {
2018 phTimeRmsZoom->Fill(uChanA, uChanB, 0.0);
2019 phTimeResFit->Fill(uChanA, uChanB, 0.0);
2021 <<
"CbmMcbm2018TofTestFee::UpdateZoomedFit => Zoom too strong, "
2022 <<
"more than 1% loss for Chan pair " << uChanA <<
" and "
2023 << uChanB <<
" !!! ";
2028 phTimeRmsZoom->Fill(
2029 uChanA, uChanB, phTimeDiff[uChanA][uChanB]->
GetRMS());
2034 fitFuncPairs[uChanA][uChanB] =
2035 new TF1(Form(
"fPair_%02d_%02d", uChanA, uChanB),
2040 fitFuncPairs[uChanA][uChanB]->SetParameter(0, dZoomCounts);
2041 fitFuncPairs[uChanA][uChanB]->SetParameter(1, dPeakPos);
2042 fitFuncPairs[uChanA][uChanB]->SetParameter(
2045 phTimeDiff[uChanA][uChanB]->Fit(
2046 Form(
"fPair_%02d_%02d", uChanA, uChanB),
"QRM0");
2048 dRes = fitFuncPairs[uChanA][uChanB]->GetParameter(2);
2050 delete fitFuncPairs[uChanA][uChanB];
2052 phTimeResFit->Fill(uChanA, uChanB, dRes / TMath::Sqrt2());
2055 LOG(debug) <<
"CbmMcbm2018TofTestFee::UpdateZoomedFit => "
2056 <<
"For chan pair " << uChanA <<
" and " << uChanB
2057 <<
" we have zoomed RMS = "
2058 << phTimeDiff[uChanA][uChanB]->GetRMS()
2059 <<
" and a resolution of " << dRes / TMath::Sqrt2();
2062 phTimeDiff[uChanA][uChanB]->GetXaxis()->UnZoom();
2067 <<
"CbmMcbm2018TofTestFee::UpdateZoomedFit => Zoom width not defined, "
2068 <<
"please use SetFitZoomWidthPs, e.g. in macro, before trying this "