Commit a749878a authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

Apply Clang-format, including new settings on mCBMSource class

parent 782e3df5
...@@ -118,74 +118,65 @@ Bool_t CbmMcbm2018Source::Init() { ...@@ -118,74 +118,65 @@ Bool_t CbmMcbm2018Source::Init() {
fbWriteOutput); fbWriteOutput);
/// Single spill unpacking /// Single spill unpacking
if (0 <= fiUnpSpillIdxStart) if (0 <= fiUnpSpillIdxStart) {
{ switch (fuFlagSpillStart) {
switch( fuFlagSpillStart ) case 0: {
{
case 0:
{
/// 0 = Break begin /// 0 = Break begin
if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop ) if (fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop) {
{
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: " LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakBegTs.size() - 1; << fiUnpSpillIdxStop << " VS " << fvuSpillBreakBegTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 ) if (fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1) {
{ fiUnpSpillIdxStop = fvuSpillBreakBegTs.size() - 2;
fiUnpSpillIdxStop = fvuSpillBreakBegTs.size() - 2; LOG(warning) << "Using last possible spill instead as final one";
LOG(warning) << "Using last possible spill instead as final one"; } // if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 )
} // if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 ) else
else LOG(fatal) << "Start index also too large, exiting"; LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop ) } // if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakBegTs[ fiUnpSpillIdxStart ]; //! fuSpillBegTs = fvuSpillBreakBegTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakBegTs[ fiUnpSpillIdxStop + 1 ]; //! fuSpillEndTs = fvuSpillBreakBegTs[fiUnpSpillIdxStop + 1]; //!
break; break;
} }
case 1: case 1: {
{
/// 1 = Break middle /// 1 = Break middle
if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop ) if (fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop) {
{
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: " LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakMidTs.size() - 1; << fiUnpSpillIdxStop << " VS " << fvuSpillBreakMidTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 ) if (fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1) {
{ fiUnpSpillIdxStop = fvuSpillBreakMidTs.size() - 2;
fiUnpSpillIdxStop = fvuSpillBreakMidTs.size() - 2; LOG(warning) << "Using last possible spill instead as final one";
LOG(warning) << "Using last possible spill instead as final one"; } // if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 )
} // if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 ) else
else LOG(fatal) << "Start index also too large, exiting"; LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop ) } // if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakMidTs[ fiUnpSpillIdxStart ]; //! fuSpillBegTs = fvuSpillBreakMidTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakMidTs[ fiUnpSpillIdxStop + 1 ]; //! fuSpillEndTs = fvuSpillBreakMidTs[fiUnpSpillIdxStop + 1]; //!
break; break;
} }
case 2: case 2: {
{
/// 2 = Break end /// 2 = Break end
if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop ) if (fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop) {
{
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: " LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakEndTs.size() - 1; << fiUnpSpillIdxStop << " VS " << fvuSpillBreakEndTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 ) if (fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1) {
{ fiUnpSpillIdxStop = fvuSpillBreakEndTs.size() - 2;
fiUnpSpillIdxStop = fvuSpillBreakEndTs.size() - 2; LOG(warning) << "Using last possible spill instead as final one";
LOG(warning) << "Using last possible spill instead as final one"; } // if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 )
} // if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 ) else
else LOG(fatal) << "Start index also too large, exiting"; LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop ) } // if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakEndTs[ fiUnpSpillIdxStart ]; //! fuSpillBegTs = fvuSpillBreakEndTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakEndTs[ fiUnpSpillIdxStop + 1 ]; //! fuSpillEndTs = fvuSpillBreakEndTs[fiUnpSpillIdxStop + 1]; //!
break; break;
} }
default: default: {
{
LOG(fatal) << "Unknown spill start point option: " << fuFlagSpillStart; LOG(fatal) << "Unknown spill start point option: " << fuFlagSpillStart;
break; break;
} }
} // switch( fuFlagSpillStart ) } // switch( fuFlagSpillStart )
} // if (0 <= fiUnpSpillIdxStart) } // if (0 <= fiUnpSpillIdxStart)
return kTRUE; return kTRUE;
} }
...@@ -328,40 +319,35 @@ Int_t CbmMcbm2018Source::FillBuffer() { ...@@ -328,40 +319,35 @@ Int_t CbmMcbm2018Source::FillBuffer() {
auto msLength = msDescB.idx - msDescA.idx; auto msLength = msDescB.idx - msDescA.idx;
fTSLength = msLength * nMsInTs; fTSLength = msLength * nMsInTs;
fTSOverlappLength = msLength * (ts.num_microslices(0) - nMsInTs); fTSOverlappLength = msLength * (ts.num_microslices(0) - nMsInTs);
LOG(info) LOG(info) << "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculated "
<< "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculated " << "TimesliceMetaData information from microslices Metadata -> "
<< "TimesliceMetaData information from microslices Metadata -> " << "MS length found to be " << msLength << " ns, TS length " << fTSLength
<< "MS length found to be " << msLength << " ns, TS length " << " ns, and TS overlap length " << fTSOverlappLength << " ns";
<< fTSLength << " ns, and TS overlap length " }
<< fTSOverlappLength << " ns"; else {
} else {
LOG(warning) LOG(warning)
<< "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculate " << "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculate "
"TimesliceMetaData information - single microslice timeslices -> " "TimesliceMetaData information - single microslice timeslices -> "
"TS duration can not be calculated with the given method. Hence, " "TS duration can not be calculated with the given method. Hence, "
"TimesliceMetaData duration values are filled with 0"; "TimesliceMetaData duration values are filled with 0";
} }
} // if( 1 == fTSCounter ) } // if( 1 == fTSCounter )
if (0 <= fiUnpSpillIdxStart ) if (0 <= fiUnpSpillIdxStart) {
{ if (tsIndex < fuSpillBegTs) {
if (tsIndex < fuSpillBegTs)
{
/// Jump all TS until reaching the first TS in the spill we want to unpack /// Jump all TS until reaching the first TS in the spill we want to unpack
continue; continue;
} // if (tsIndex < fuSpillBegTs) } // if (tsIndex < fuSpillBegTs)
else if(fuSpillEndTs <= tsIndex) else if (fuSpillEndTs <= tsIndex) {
{
/// Stop when reaching the first TS in the next spill /// Stop when reaching the first TS in the next spill
return 1; return 1;
} // else if } // else if
} // if (0 <= fiUnpSpillIdxStart) } // if (0 <= fiUnpSpillIdxStart)
/// Apply TS throttling as set by user (default = 1 => no throttling) /// Apply TS throttling as set by user (default = 1 => no throttling)
if (0 == tsIndex % fuTsReduction) { if (0 == tsIndex % fuTsReduction) {
for (auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); for (auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); ++itUnp) {
++itUnp) {
(*itUnp)->DoUnpack(ts, 0); (*itUnp)->DoUnpack(ts, 0);
} // for( auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); ++ itUnp ) } // for( auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); ++ itUnp )
} // if( 0 == tsIndex % fuTsReduction ) } // if( 0 == tsIndex % fuTsReduction )
......
...@@ -77,26 +77,31 @@ public: ...@@ -77,26 +77,31 @@ public:
fuTsReduction = uTsReduction; fuTsReduction = uTsReduction;
} }
void UnpackSingleSpill( Int_t uSpillIdx, UInt_t uSpillStart = 1 ) { void UnpackSingleSpill(Int_t uSpillIdx, UInt_t uSpillStart = 1)
fiUnpSpillIdxStart = uSpillIdx; {
fiUnpSpillIdxStop = uSpillIdx; fiUnpSpillIdxStart = uSpillIdx;
fuFlagSpillStart = uSpillStart; fiUnpSpillIdxStop = uSpillIdx;
fuFlagSpillStart = uSpillStart;
} }
void UnpackSelectSpills( Int_t uSpillIdxStart, Int_t uSpillIdxStop, UInt_t uSpillStart = 1 ) { void UnpackSelectSpills(Int_t uSpillIdxStart, Int_t uSpillIdxStop, UInt_t uSpillStart = 1)
fiUnpSpillIdxStart = uSpillIdxStart; {
fiUnpSpillIdxStop = uSpillIdxStop; fiUnpSpillIdxStart = uSpillIdxStart;
fuFlagSpillStart = uSpillStart; fiUnpSpillIdxStop = uSpillIdxStop;
fuFlagSpillStart = uSpillStart;
} }
void LoadTsListSpillBreakBegin( std::vector< ULong64_t > vTsBeg ) { void LoadTsListSpillBreakBegin(std::vector<ULong64_t> vTsBeg)
fvuSpillBreakBegTs.assign( vTsBeg.begin(), vTsBeg.end() ); {
fvuSpillBreakBegTs.assign(vTsBeg.begin(), vTsBeg.end());
} }
void LoadTsListSpillBreakEnd( std::vector< ULong64_t > vTsEnd ) { void LoadTsListSpillBreakEnd(std::vector<ULong64_t> vTsEnd)
fvuSpillBreakEndTs.assign( vTsEnd.begin(), vTsEnd.end() ); {
fvuSpillBreakEndTs.assign(vTsEnd.begin(), vTsEnd.end());
} }
void LoadTsListSpillBreakMiddle( std::vector< ULong64_t > vTsMid ) { void LoadTsListSpillBreakMiddle(std::vector<ULong64_t> vTsMid)
fvuSpillBreakMidTs.assign( vTsMid.begin(), vTsMid.end() ); {
fvuSpillBreakMidTs.assign(vTsMid.begin(), vTsMid.end());
} }
void SetSubscriberHwm(UInt_t val = 1) { fuSubscriberHwm = val; } void SetSubscriberHwm(UInt_t val = 1) { fuSubscriberHwm = val; }
...@@ -133,9 +138,9 @@ private: ...@@ -133,9 +138,9 @@ private:
UInt_t fuSpillBegTs = 0; //! UInt_t fuSpillBegTs = 0; //!
UInt_t fuSpillEndTs = 0; //! UInt_t fuSpillEndTs = 0; //!
std::vector< ULong64_t > fvuSpillBreakBegTs = {}; //! std::vector<ULong64_t> fvuSpillBreakBegTs = {}; //!
std::vector< ULong64_t > fvuSpillBreakEndTs = {}; //! std::vector<ULong64_t> fvuSpillBreakEndTs = {}; //!
std::vector< ULong64_t > fvuSpillBreakMidTs = {}; //! std::vector<ULong64_t> fvuSpillBreakMidTs = {}; //!
std::unique_ptr<fles::TimesliceSource> fSource; //! std::unique_ptr<fles::TimesliceSource> fSource; //!
......
...@@ -36,9 +36,7 @@ ...@@ -36,9 +36,7 @@
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
CbmMcbmSpillFindAlgo::CbmMcbmSpillFindAlgo() : CbmStar2019Algo() {} CbmMcbmSpillFindAlgo::CbmMcbmSpillFindAlgo() : CbmStar2019Algo() {}
CbmMcbmSpillFindAlgo::~CbmMcbmSpillFindAlgo() CbmMcbmSpillFindAlgo::~CbmMcbmSpillFindAlgo() {}
{
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
Bool_t CbmMcbmSpillFindAlgo::Init() Bool_t CbmMcbmSpillFindAlgo::Init()
...@@ -52,55 +50,54 @@ void CbmMcbmSpillFindAlgo::Finish() ...@@ -52,55 +50,54 @@ void CbmMcbmSpillFindAlgo::Finish()
{ {
/// If Spill is On, add a fake spill break to have the last spill /// If Spill is On, add a fake spill break to have the last spill
/// If Spill is Off, add a fake spill break end so that all modes include last spill /// If Spill is Off, add a fake spill break end so that all modes include last spill
if (fbSpillOn) if (fbSpillOn) {
{ fvuSpillBreakBegTs.push_back(fulCurrentTsIdx + 1);
fvuSpillBreakBegTs.push_back( fulCurrentTsIdx + 1 ); fvuSpillBreakEndTs.push_back(fulCurrentTsIdx + 1);
fvuSpillBreakEndTs.push_back( fulCurrentTsIdx + 1 ); } // if (fbSpillOn)
} // if (fbSpillOn) else
else fvuSpillBreakEndTs.push_back( fulCurrentTsIdx + 1 ); fvuSpillBreakEndTs.push_back(fulCurrentTsIdx + 1);
/// Fill the vector of spill break middle points /// Fill the vector of spill break middle points
std::vector< ULong64_t >::iterator itBreakBeg = fvuSpillBreakBegTs.begin(); std::vector<ULong64_t>::iterator itBreakBeg = fvuSpillBreakBegTs.begin();
std::vector< ULong64_t >::iterator itBreakEnd = fvuSpillBreakEndTs.begin(); std::vector<ULong64_t>::iterator itBreakEnd = fvuSpillBreakEndTs.begin();
if( itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() && *itBreakEnd < *itBreakBeg ) { if (itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() && *itBreakEnd < *itBreakBeg) {
fvuSpillBreakMidTs.push_back((*itBreakEnd + fulFirstTsIdx) / 2); fvuSpillBreakMidTs.push_back((*itBreakEnd + fulFirstTsIdx) / 2);
++itBreakEnd; ++itBreakEnd;
} // if( itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() && *itBreakEnd < *itBreakBeg ) } // if( itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() && *itBreakEnd < *itBreakBeg )
while( itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() ) { while (itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end()) {
fvuSpillBreakMidTs.push_back((*itBreakBeg + *itBreakEnd) / 2); fvuSpillBreakMidTs.push_back((*itBreakBeg + *itBreakEnd) / 2);
++itBreakBeg; ++itBreakBeg;
++itBreakEnd; ++itBreakEnd;
} // while( itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() ) } // while( itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() )
if( itBreakBeg != fvuSpillBreakBegTs.end() ) { if (itBreakBeg != fvuSpillBreakBegTs.end()) {
fvuSpillBreakMidTs.push_back((*itBreakBeg + fulCurrentTsIdx) / 2); fvuSpillBreakMidTs.push_back((*itBreakBeg + fulCurrentTsIdx) / 2);
++itBreakBeg; ++itBreakBeg;
} // if( itBreakBeg != fvuSpillBreakBegTs.end() ) } // if( itBreakBeg != fvuSpillBreakBegTs.end() )
if( itBreakBeg != fvuSpillBreakBegTs.end() || itBreakEnd != fvuSpillBreakEndTs.end() ) { if (itBreakBeg != fvuSpillBreakBegTs.end() || itBreakEnd != fvuSpillBreakEndTs.end()) {
LOG(warning) << "Size of spill breaks beginning or end did not match: " LOG(warning) << "Size of spill breaks beginning or end did not match: " << fvuSpillBreakBegTs.size() << " VS "
<< fvuSpillBreakBegTs.size() << " VS " << fvuSpillBreakEndTs.size(); << fvuSpillBreakEndTs.size();
} // if( itBreakBeg != fvuSpillBreakBegTs.end() || itBreakEnd != fvuSpillBreakEndTs.end() ) } // if( itBreakBeg != fvuSpillBreakBegTs.end() || itBreakEnd != fvuSpillBreakEndTs.end() )
LOG(info) << "**********************************************"; LOG(info) << "**********************************************";
LOG(info) << "TS index for beginning of spill breaks:"; LOG(info) << "TS index for beginning of spill breaks:";
for (ULong64_t uBeg : fvuSpillBreakBegTs) { for (ULong64_t uBeg : fvuSpillBreakBegTs) {
LOG(info)<< Form( "%9llu", uBeg ); LOG(info) << Form("%9llu", uBeg);
} // for (ULong64_t uBeg : fvuSpillBreakBegTs) } // for (ULong64_t uBeg : fvuSpillBreakBegTs)
LOG(info) << "**********************************************"; LOG(info) << "**********************************************";
LOG(info) << "TS index for ending of spill breaks:"; LOG(info) << "TS index for ending of spill breaks:";
for (ULong64_t uEnd : fvuSpillBreakEndTs) { for (ULong64_t uEnd : fvuSpillBreakEndTs) {
LOG(info)<< Form( "%9llu", uEnd ); LOG(info) << Form("%9llu", uEnd);
} // for (ULong64_t uBeg : fvuSpillBreakBegTs) } // for (ULong64_t uBeg : fvuSpillBreakBegTs)
LOG(info) << "**********************************************"; LOG(info) << "**********************************************";
LOG(info) << "TS index for middle of spill breaks:"; LOG(info) << "TS index for middle of spill breaks:";
for (ULong64_t uMid : fvuSpillBreakMidTs) { for (ULong64_t uMid : fvuSpillBreakMidTs) {
LOG(info)<< Form( "%9llu", uMid ); LOG(info) << Form("%9llu", uMid);
} // for (ULong64_t uBeg : fvuSpillBreakBegTs) } // for (ULong64_t uBeg : fvuSpillBreakBegTs)
LOG(info) << "**********************************************"; LOG(info) << "**********************************************";
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -186,8 +183,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessTs(const fles::Timeslice& ts) ...@@ -186,8 +183,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessTs(const fles::Timeslice& ts)
{ {
fulCurrentTsIdx = ts.index(); fulCurrentTsIdx = ts.index();
fdTsStartTime = static_cast<Double_t>(ts.descriptor(0, 0).idx); fdTsStartTime = static_cast<Double_t>(ts.descriptor(0, 0).idx);
if( fulCurrentTsIdx < fulFirstTsIdx ) if (fulCurrentTsIdx < fulFirstTsIdx) fulFirstTsIdx = fulCurrentTsIdx;
fulFirstTsIdx = fulCurrentTsIdx;
/// Ignore First TS as first MS is typically corrupt /// Ignore First TS as first MS is typically corrupt
if (0 == fulCurrentTsIdx) return kTRUE; if (0 == fulCurrentTsIdx) return kTRUE;
...@@ -223,7 +219,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessTs(const fles::Timeslice& ts) ...@@ -223,7 +219,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessTs(const fles::Timeslice& ts)
return kFALSE; return kFALSE;
} // if( kFALSE == ProcessMs( ts, uMsCompIdx, fuMsIndex ) ) } // if( kFALSE == ProcessMs( ts, uMsCompIdx, fuMsIndex ) )
} // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx ) } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
} // for( fuMsIndex = 0; fuMsIndex < uNbMsLoop; fuMsIndex ++ ) } // for( fuMsIndex = 0; fuMsIndex < uNbMsLoop; fuMsIndex ++ )
/// Fill plots if in monitor mode /// Fill plots if in monitor mode
if (fbMonitorMode) { if (fbMonitorMode) {
...@@ -309,30 +305,27 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp ...@@ -309,30 +305,27 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
if (fbSpillOn && fuCountsLastInterval < fuOffSpillCountLimit) { if (fbSpillOn && fuCountsLastInterval < fuOffSpillCountLimit) {
fbSpillOn = kFALSE; fbSpillOn = kFALSE;
fuCurrentSpillIdx++; fuCurrentSpillIdx++;
fdStartTimeSpill = fdMsTime; fdStartTimeSpill = fdMsTime;
if( 0 < fvuSpillBreakBegTs.size() ) if (0 < fvuSpillBreakBegTs.size()) {
{ fhSpillDuration->Fill(fulCurrentTsIdx - fvuSpillBreakBegTs.back());
fhSpillDuration->Fill( fulCurrentTsIdx - fvuSpillBreakBegTs.back() ); } // if( 0 < fvuSpillBreakBegTs.size() )
} // if( 0 < fvuSpillBreakBegTs.size() ) fvuSpillBreakBegTs.push_back(fulCurrentTsIdx);
fvuSpillBreakBegTs.push_back( fulCurrentTsIdx );
} // if( fbSpillOn && fuCountsLastInterval < fuOffSpillCountLimit ) } // if( fbSpillOn && fuCountsLastInterval < fuOffSpillCountLimit )
else if (!fbSpillOn && fuOffSpillCountLimit < fuCountsLastInterval) { else if (!fbSpillOn && fuOffSpillCountLimit < fuCountsLastInterval) {
fbSpillOn = kTRUE; fbSpillOn = kTRUE;
if( 0 < fvuSpillBreakBegTs.size() ) if (0 < fvuSpillBreakBegTs.size()) {
{ fhSpillBreakDuration->Fill(fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakBegTs.back());
fhSpillBreakDuration->Fill( fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakBegTs.back() ); } // if( 0 < fvuSpillBreakBegTs.size() )
} // if( 0 < fvuSpillBreakBegTs.size() ) if (0 < fvuSpillBreakEndTs.size()) {
if( 0 < fvuSpillBreakEndTs.size() ) fhHitsPerSpill->Fill(fuCurrentSpillIdx, fuCountsLastSpill);
{ fhSpillDuration->Fill(fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakEndTs.back());
fhHitsPerSpill->Fill( fuCurrentSpillIdx, fuCountsLastSpill ); } // if( 0 < fvuSpillBreakEndTs.size() )
fhSpillDuration->Fill( fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakEndTs.back() ); fvuSpillBreakEndTs.push_back(fulCurrentTsIdx);
} // if( 0 < fvuSpillBreakEndTs.size() )
fvuSpillBreakEndTs.push_back( fulCurrentTsIdx );
fuCountsLastSpill = 0; fuCountsLastSpill = 0;
} // else if (fuOffSpillCountLimit < fuCountsLastInterval) } // else if (fuOffSpillCountLimit < fuCountsLastInterval)
fuCountsLastInterval = 0; fuCountsLastInterval = 0;
fdLastSecondTime = fdMsTime; fdLastSecondTime = fdMsTime;
} // if( fdSpillCheckInterval < fdMsTime - fdLastSecondTime ) } // if( fdSpillCheckInterval < fdMsTime - fdLastSecondTime )
} // if( 0 == fuCurrDpbIdx ) } // if( 0 == fuCurrDpbIdx )
...@@ -361,9 +354,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp ...@@ -361,9 +354,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]); uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
/// Catch the Epoch cycle block which is always the first 64b of the MS /// Catch the Epoch cycle block which is always the first 64b of the MS
if (0 == uIdx) { if (0 == uIdx) { continue; } // if( 0 == uIdx )
continue;
} // if( 0 == uIdx )
gdpbv100::Message mess(ulData); gdpbv100::Message mess(ulData);
/// Get message type /// Get message type
...@@ -395,7 +386,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp ...@@ -395,7 +386,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
fuCountsLastSpill++; fuCountsLastSpill++;
ulNbHitsTs++; ulNbHitsTs++;
} // if (0 != fuGet4Nr || uTot < fuMinTotPulser || fuMaxTotPulser < uTot) { } // if (0 != fuGet4Nr || uTot < fuMinTotPulser || fuMaxTotPulser < uTot) {
} // else of if( getGdpbHitIs24b() ) } // else of if( getGdpbHitIs24b() )
break; break;
} // case gdpbv100::MSG_HIT: } // case gdpbv100::MSG_HIT:
case gdpbv100::MSG_EPOCH: { case gdpbv100::MSG_EPOCH: {
...@@ -418,7 +409,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp ...@@ -418,7 +409,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
<< " not included in Get4 unpacker."; << " not included in Get4 unpacker.";
} // switch( mess.getMessageType() ) } // switch( mess.getMessageType() )
} // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++) } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
fhHitsEvo->Fill( fdTsStartTime*1e-9, ulNbHitsTs ); fhHitsEvo->Fill(fdTsStartTime * 1e-9, ulNbHitsTs);
/// Fill histograms /// Fill histograms
FillHistograms(); FillHistograms();
...@@ -440,11 +431,11 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms() ...@@ -440,11 +431,11 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms()
// double * dBinsLog = GenerateLogBinArray( 4, 9, 1, iNbBinsLog ); // double * dBinsLog = GenerateLogBinArray( 4, 9, 1, iNbBinsLog );
/*******************************************************************/ /*******************************************************************/
fhHitsEvo = new TH1I("hHitsEvo", "Hit count evo; Time [s]; Hits Count []", fuHistoryHistoSize * 50, 0., fhHitsEvo =
fuHistoryHistoSize); new TH1I("hHitsEvo", "Hit count evo; Time [s]; Hits Count []", fuHistoryHistoSize * 50, 0., fuHistoryHistoSize);
fhHitsPerSpill = new TH1I("hHitsPerSpill", "Hit count per spill; Spill; Hits Count []", 2000, 0., 2000); fhHitsPerSpill = new TH1I("hHitsPerSpill", "Hit count per spill; Spill; Hits Count []", 2000, 0., 2000);
fhSpillBreakDuration = new TH1I("hSpillBreakDuration", "Spill break duration; Spill; Duration [TS]", 2000, 0., 2000); fhSpillBreakDuration = new TH1I("hSpillBreakDuration", "Spill break duration; Spill; Duration [TS]", 2000, 0., 2000);
fhSpillDuration = new TH1I("hSpillDuration", "Spill duration; Spill; Duration [TS]", 2000, 0., 2000); fhSpillDuration = new TH1I("hSpillDuration", "Spill duration; Spill; Duration [TS]", 2000, 0., 2000);
/// Add pointers to the vector with all histo for access by steering class /// Add pointers to the vector with all histo for access by steering class
AddHistoToVector(fhHitsEvo, sFolder); AddHistoToVector(fhHitsEvo, sFolder);
...@@ -463,7 +454,7 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms() ...@@ -463,7 +454,7 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms()
Double_t h = 10; Double_t h = 10;
/*******************************************************************/ /*******************************************************************/
/* /*
/// Map of hits over T0 detector and same vs time in run /// Map of hits over T0 detector and same vs time in run
fcHitMaps = new TCanvas("cHitMaps", "Hit maps", w, h); fcHitMaps = new TCanvas("cHitMaps", "Hit maps", w, h);
fcHitMaps->Divide(2); fcHitMaps->Divide(2);
...@@ -488,14 +479,10 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms() ...@@ -488,14 +479,10 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms()
return kTRUE; return kTRUE;
} }
Bool_t CbmMcbmSpillFindAlgo::FillHistograms() Bool_t CbmMcbmSpillFindAlgo::FillHistograms() { return kTRUE; }
{
return kTRUE;
}
Bool_t CbmMcbmSpillFindAlgo::ResetHistograms(Bool_t bResetTime) Bool_t CbmMcbmSpillFindAlgo::ResetHistograms(Bool_t bResetTime)
{ {
fuCurrentSpillIdx = 0; fuCurrentSpillIdx = 0;
fhHitsEvo->Reset(); fhHitsEvo->Reset();
fhHitsPerSpill->Reset(); fhHitsPerSpill->Reset();
fhSpillBreakDuration->Reset(); fhSpillBreakDuration->Reset();
......
...@@ -88,9 +88,9 @@ private: ...@@ -88,9 +88,9 @@ private:
UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB
/// User settings: Data correction parameters /// User settings: Data correction parameters
UInt_t fuMinTotPulser = 90; UInt_t fuMinTotPulser = 90;
UInt_t fuMaxTotPulser = 100; UInt_t fuMaxTotPulser = 100;
UInt_t fuOffSpillCountLimit = 100; UInt_t fuOffSpillCountLimit = 100;
Double_t fdSpillCheckInterval = 0.5; Double_t fdSpillCheckInterval = 0.5;
/// Constants /// Constants
...@@ -100,7 +100,7 @@ private: ...@@ -100,7 +100,7 @@ private:
/// Running indices /// Running indices
/// TS/MS info /// TS/MS info
ULong64_t fulFirstTsIdx = 9999999999999; //! First TS index, forward point set ~30 years... ULong64_t fulFirstTsIdx = 9999999999999; //! First TS index, forward point set ~30 years...