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() {
fbWriteOutput);
/// Single spill unpacking
if (0 <= fiUnpSpillIdxStart)
{
switch( fuFlagSpillStart )
{
case 0:
{
if (0 <= fiUnpSpillIdxStart) {
switch (fuFlagSpillStart) {
case 0: {
/// 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: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakBegTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 )
{
fiUnpSpillIdxStop = fvuSpillBreakBegTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 )
else LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakBegTs[ fiUnpSpillIdxStart ]; //!
fuSpillEndTs = fvuSpillBreakBegTs[ fiUnpSpillIdxStop + 1 ]; //!
if (fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1) {
fiUnpSpillIdxStop = fvuSpillBreakBegTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 )
else
LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakBegTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakBegTs[fiUnpSpillIdxStop + 1]; //!
break;
}
case 1:
{
case 1: {
/// 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: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakMidTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 )
{
fiUnpSpillIdxStop = fvuSpillBreakMidTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 )
else LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakMidTs[ fiUnpSpillIdxStart ]; //!
fuSpillEndTs = fvuSpillBreakMidTs[ fiUnpSpillIdxStop + 1 ]; //!
if (fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1) {
fiUnpSpillIdxStop = fvuSpillBreakMidTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 )
else
LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakMidTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakMidTs[fiUnpSpillIdxStop + 1]; //!
break;
}
case 2:
{
case 2: {
/// 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: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakEndTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 )
{
fiUnpSpillIdxStop = fvuSpillBreakEndTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 )
else LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakEndTs[ fiUnpSpillIdxStart ]; //!
fuSpillEndTs = fvuSpillBreakEndTs[ fiUnpSpillIdxStop + 1 ]; //!
if (fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1) {
fiUnpSpillIdxStop = fvuSpillBreakEndTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 )
else
LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakEndTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakEndTs[fiUnpSpillIdxStop + 1]; //!
break;
}
default:
{
default: {
LOG(fatal) << "Unknown spill start point option: " << fuFlagSpillStart;
break;
}
} // switch( fuFlagSpillStart )
} // if (0 <= fiUnpSpillIdxStart)
} // if (0 <= fiUnpSpillIdxStart)
return kTRUE;
}
......@@ -328,40 +319,35 @@ Int_t CbmMcbm2018Source::FillBuffer() {
auto msLength = msDescB.idx - msDescA.idx;
fTSLength = msLength * nMsInTs;
fTSOverlappLength = msLength * (ts.num_microslices(0) - nMsInTs);
LOG(info)
<< "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculated "
<< "TimesliceMetaData information from microslices Metadata -> "
<< "MS length found to be " << msLength << " ns, TS length "
<< fTSLength << " ns, and TS overlap length "
<< fTSOverlappLength << " ns";
} else {
LOG(info) << "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculated "
<< "TimesliceMetaData information from microslices Metadata -> "
<< "MS length found to be " << msLength << " ns, TS length " << fTSLength
<< " ns, and TS overlap length " << fTSOverlappLength << " ns";
}
else {
LOG(warning)
<< "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculate "
"TimesliceMetaData information - single microslice timeslices -> "
"TS duration can not be calculated with the given method. Hence, "
"TimesliceMetaData duration values are filled with 0";
}
} // if( 1 == fTSCounter )
} // if( 1 == fTSCounter )
if (0 <= fiUnpSpillIdxStart )
{
if (tsIndex < fuSpillBegTs)
{
if (0 <= fiUnpSpillIdxStart) {
if (tsIndex < fuSpillBegTs) {
/// Jump all TS until reaching the first TS in the spill we want to unpack
continue;
} // if (tsIndex < fuSpillBegTs)
else if(fuSpillEndTs <= tsIndex)
{
} // if (tsIndex < fuSpillBegTs)
else if (fuSpillEndTs <= tsIndex) {
/// Stop when reaching the first TS in the next spill
return 1;
} // else if
} // if (0 <= fiUnpSpillIdxStart)
} // else if
} // if (0 <= fiUnpSpillIdxStart)
/// Apply TS throttling as set by user (default = 1 => no throttling)
if (0 == tsIndex % fuTsReduction) {
for (auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end();
++itUnp) {
for (auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); ++itUnp) {
(*itUnp)->DoUnpack(ts, 0);
} // for( auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); ++ itUnp )
} // if( 0 == tsIndex % fuTsReduction )
......
......@@ -77,26 +77,31 @@ public:
fuTsReduction = uTsReduction;
}
void UnpackSingleSpill( Int_t uSpillIdx, UInt_t uSpillStart = 1 ) {
fiUnpSpillIdxStart = uSpillIdx;
fiUnpSpillIdxStop = uSpillIdx;
fuFlagSpillStart = uSpillStart;
void UnpackSingleSpill(Int_t uSpillIdx, UInt_t uSpillStart = 1)
{
fiUnpSpillIdxStart = uSpillIdx;
fiUnpSpillIdxStop = uSpillIdx;
fuFlagSpillStart = uSpillStart;
}
void UnpackSelectSpills( Int_t uSpillIdxStart, Int_t uSpillIdxStop, UInt_t uSpillStart = 1 ) {
fiUnpSpillIdxStart = uSpillIdxStart;
fiUnpSpillIdxStop = uSpillIdxStop;
fuFlagSpillStart = uSpillStart;
void UnpackSelectSpills(Int_t uSpillIdxStart, Int_t uSpillIdxStop, UInt_t uSpillStart = 1)
{
fiUnpSpillIdxStart = uSpillIdxStart;
fiUnpSpillIdxStop = uSpillIdxStop;
fuFlagSpillStart = uSpillStart;
}
void LoadTsListSpillBreakBegin( std::vector< ULong64_t > vTsBeg ) {
fvuSpillBreakBegTs.assign( vTsBeg.begin(), vTsBeg.end() );
void LoadTsListSpillBreakBegin(std::vector<ULong64_t> vTsBeg)
{
fvuSpillBreakBegTs.assign(vTsBeg.begin(), vTsBeg.end());
}
void LoadTsListSpillBreakEnd( std::vector< ULong64_t > vTsEnd ) {
fvuSpillBreakEndTs.assign( vTsEnd.begin(), vTsEnd.end() );
void LoadTsListSpillBreakEnd(std::vector<ULong64_t> vTsEnd)
{
fvuSpillBreakEndTs.assign(vTsEnd.begin(), vTsEnd.end());
}
void LoadTsListSpillBreakMiddle( std::vector< ULong64_t > vTsMid ) {
fvuSpillBreakMidTs.assign( vTsMid.begin(), vTsMid.end() );
void LoadTsListSpillBreakMiddle(std::vector<ULong64_t> vTsMid)
{
fvuSpillBreakMidTs.assign(vTsMid.begin(), vTsMid.end());
}
void SetSubscriberHwm(UInt_t val = 1) { fuSubscriberHwm = val; }
......@@ -133,9 +138,9 @@ private:
UInt_t fuSpillBegTs = 0; //!
UInt_t fuSpillEndTs = 0; //!
std::vector< ULong64_t > fvuSpillBreakBegTs = {}; //!
std::vector< ULong64_t > fvuSpillBreakEndTs = {}; //!
std::vector< ULong64_t > fvuSpillBreakMidTs = {}; //!
std::vector<ULong64_t> fvuSpillBreakBegTs = {}; //!
std::vector<ULong64_t> fvuSpillBreakEndTs = {}; //!
std::vector<ULong64_t> fvuSpillBreakMidTs = {}; //!
std::unique_ptr<fles::TimesliceSource> fSource; //!
......
......@@ -36,9 +36,7 @@
// -------------------------------------------------------------------------
CbmMcbmSpillFindAlgo::CbmMcbmSpillFindAlgo() : CbmStar2019Algo() {}
CbmMcbmSpillFindAlgo::~CbmMcbmSpillFindAlgo()
{
}
CbmMcbmSpillFindAlgo::~CbmMcbmSpillFindAlgo() {}
// -------------------------------------------------------------------------
Bool_t CbmMcbmSpillFindAlgo::Init()
......@@ -52,55 +50,54 @@ void CbmMcbmSpillFindAlgo::Finish()
{
/// 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 (fbSpillOn)
{
fvuSpillBreakBegTs.push_back( fulCurrentTsIdx + 1 );
fvuSpillBreakEndTs.push_back( fulCurrentTsIdx + 1 );
} // if (fbSpillOn)
else fvuSpillBreakEndTs.push_back( fulCurrentTsIdx + 1 );
if (fbSpillOn) {
fvuSpillBreakBegTs.push_back(fulCurrentTsIdx + 1);
fvuSpillBreakEndTs.push_back(fulCurrentTsIdx + 1);
} // if (fbSpillOn)
else
fvuSpillBreakEndTs.push_back(fulCurrentTsIdx + 1);
/// Fill the vector of spill break middle points
std::vector< ULong64_t >::iterator itBreakBeg = fvuSpillBreakBegTs.begin();
std::vector< ULong64_t >::iterator itBreakEnd = fvuSpillBreakEndTs.begin();
std::vector<ULong64_t>::iterator itBreakBeg = fvuSpillBreakBegTs.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);
++itBreakEnd;
} // 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);
++itBreakBeg;
++itBreakEnd;
} // while( itBreakBeg != fvuSpillBreakBegTs.end() && itBreakEnd != fvuSpillBreakEndTs.end() )
if( itBreakBeg != fvuSpillBreakBegTs.end() ) {
fvuSpillBreakMidTs.push_back((*itBreakBeg + fulCurrentTsIdx) / 2);
if (itBreakBeg != fvuSpillBreakBegTs.end()) {
fvuSpillBreakMidTs.push_back((*itBreakBeg + fulCurrentTsIdx) / 2);
++itBreakBeg;
} // if( itBreakBeg != fvuSpillBreakBegTs.end() )
} // if( itBreakBeg != fvuSpillBreakBegTs.end() )
if( itBreakBeg != fvuSpillBreakBegTs.end() || itBreakEnd != fvuSpillBreakEndTs.end() ) {
LOG(warning) << "Size of spill breaks beginning or end did not match: "
<< fvuSpillBreakBegTs.size() << " VS " << fvuSpillBreakEndTs.size();
if (itBreakBeg != fvuSpillBreakBegTs.end() || itBreakEnd != fvuSpillBreakEndTs.end()) {
LOG(warning) << "Size of spill breaks beginning or end did not match: " << fvuSpillBreakBegTs.size() << " VS "
<< fvuSpillBreakEndTs.size();
} // if( itBreakBeg != fvuSpillBreakBegTs.end() || itBreakEnd != fvuSpillBreakEndTs.end() )
LOG(info) << "**********************************************";
LOG(info) << "TS index for beginning of spill breaks:";
for (ULong64_t uBeg : fvuSpillBreakBegTs) {
LOG(info)<< Form( "%9llu", uBeg );
LOG(info) << Form("%9llu", uBeg);
} // for (ULong64_t uBeg : fvuSpillBreakBegTs)
LOG(info) << "**********************************************";
LOG(info) << "TS index for ending of spill breaks:";
for (ULong64_t uEnd : fvuSpillBreakEndTs) {
LOG(info)<< Form( "%9llu", uEnd );
LOG(info) << Form("%9llu", uEnd);
} // for (ULong64_t uBeg : fvuSpillBreakBegTs)
LOG(info) << "**********************************************";
LOG(info) << "TS index for middle of spill breaks:";
for (ULong64_t uMid : fvuSpillBreakMidTs) {
LOG(info)<< Form( "%9llu", uMid );
LOG(info) << Form("%9llu", uMid);
} // for (ULong64_t uBeg : fvuSpillBreakBegTs)
LOG(info) << "**********************************************";
}
// -------------------------------------------------------------------------
......@@ -186,8 +183,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessTs(const fles::Timeslice& ts)
{
fulCurrentTsIdx = ts.index();
fdTsStartTime = static_cast<Double_t>(ts.descriptor(0, 0).idx);
if( fulCurrentTsIdx < fulFirstTsIdx )
fulFirstTsIdx = fulCurrentTsIdx;
if (fulCurrentTsIdx < fulFirstTsIdx) fulFirstTsIdx = fulCurrentTsIdx;
/// Ignore First TS as first MS is typically corrupt
if (0 == fulCurrentTsIdx) return kTRUE;
......@@ -223,7 +219,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessTs(const fles::Timeslice& ts)
return kFALSE;
} // if( kFALSE == ProcessMs( ts, uMsCompIdx, fuMsIndex ) )
} // 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
if (fbMonitorMode) {
......@@ -309,30 +305,27 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
if (fbSpillOn && fuCountsLastInterval < fuOffSpillCountLimit) {
fbSpillOn = kFALSE;
fuCurrentSpillIdx++;
fdStartTimeSpill = fdMsTime;
if( 0 < fvuSpillBreakBegTs.size() )
{
fhSpillDuration->Fill( fulCurrentTsIdx - fvuSpillBreakBegTs.back() );
} // if( 0 < fvuSpillBreakBegTs.size() )
fvuSpillBreakBegTs.push_back( fulCurrentTsIdx );
fdStartTimeSpill = fdMsTime;
if (0 < fvuSpillBreakBegTs.size()) {
fhSpillDuration->Fill(fulCurrentTsIdx - fvuSpillBreakBegTs.back());
} // if( 0 < fvuSpillBreakBegTs.size() )
fvuSpillBreakBegTs.push_back(fulCurrentTsIdx);
} // if( fbSpillOn && fuCountsLastInterval < fuOffSpillCountLimit )
else if (!fbSpillOn && fuOffSpillCountLimit < fuCountsLastInterval) {
fbSpillOn = kTRUE;
if( 0 < fvuSpillBreakBegTs.size() )
{
fhSpillBreakDuration->Fill( fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakBegTs.back() );
} // if( 0 < fvuSpillBreakBegTs.size() )
if( 0 < fvuSpillBreakEndTs.size() )
{
fhHitsPerSpill->Fill( fuCurrentSpillIdx, fuCountsLastSpill );
fhSpillDuration->Fill( fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakEndTs.back() );
} // if( 0 < fvuSpillBreakEndTs.size() )
fvuSpillBreakEndTs.push_back( fulCurrentTsIdx );
if (0 < fvuSpillBreakBegTs.size()) {
fhSpillBreakDuration->Fill(fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakBegTs.back());
} // if( 0 < fvuSpillBreakBegTs.size() )
if (0 < fvuSpillBreakEndTs.size()) {
fhHitsPerSpill->Fill(fuCurrentSpillIdx, fuCountsLastSpill);
fhSpillDuration->Fill(fuCurrentSpillIdx, fulCurrentTsIdx - fvuSpillBreakEndTs.back());
} // if( 0 < fvuSpillBreakEndTs.size() )
fvuSpillBreakEndTs.push_back(fulCurrentTsIdx);
fuCountsLastSpill = 0;
} // else if (fuOffSpillCountLimit < fuCountsLastInterval)
fuCountsLastInterval = 0;
fdLastSecondTime = fdMsTime;
fdLastSecondTime = fdMsTime;
} // if( fdSpillCheckInterval < fdMsTime - fdLastSecondTime )
} // if( 0 == fuCurrDpbIdx )
......@@ -361,9 +354,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
/// Catch the Epoch cycle block which is always the first 64b of the MS
if (0 == uIdx) {
continue;
} // if( 0 == uIdx )
if (0 == uIdx) { continue; } // if( 0 == uIdx )
gdpbv100::Message mess(ulData);
/// Get message type
......@@ -395,7 +386,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
fuCountsLastSpill++;
ulNbHitsTs++;
} // if (0 != fuGet4Nr || uTot < fuMinTotPulser || fuMaxTotPulser < uTot) {
} // else of if( getGdpbHitIs24b() )
} // else of if( getGdpbHitIs24b() )
break;
} // case gdpbv100::MSG_HIT:
case gdpbv100::MSG_EPOCH: {
......@@ -418,7 +409,7 @@ Bool_t CbmMcbmSpillFindAlgo::ProcessMs(const fles::Timeslice& ts, size_t uMsComp
<< " not included in Get4 unpacker.";
} // switch( mess.getMessageType() )
} // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
fhHitsEvo->Fill( fdTsStartTime*1e-9, ulNbHitsTs );
fhHitsEvo->Fill(fdTsStartTime * 1e-9, ulNbHitsTs);
/// Fill histograms
FillHistograms();
......@@ -440,11 +431,11 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms()
// double * dBinsLog = GenerateLogBinArray( 4, 9, 1, iNbBinsLog );
/*******************************************************************/
fhHitsEvo = 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);
fhHitsEvo =
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);
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
AddHistoToVector(fhHitsEvo, sFolder);
......@@ -463,7 +454,7 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms()
Double_t h = 10;
/*******************************************************************/
/*
/*
/// Map of hits over T0 detector and same vs time in run
fcHitMaps = new TCanvas("cHitMaps", "Hit maps", w, h);
fcHitMaps->Divide(2);
......@@ -488,14 +479,10 @@ Bool_t CbmMcbmSpillFindAlgo::CreateHistograms()
return kTRUE;
}
Bool_t CbmMcbmSpillFindAlgo::FillHistograms()
{
return kTRUE;
}
Bool_t CbmMcbmSpillFindAlgo::FillHistograms() { return kTRUE; }
Bool_t CbmMcbmSpillFindAlgo::ResetHistograms(Bool_t bResetTime)
{
fuCurrentSpillIdx = 0;
fuCurrentSpillIdx = 0;
fhHitsEvo->Reset();
fhHitsPerSpill->Reset();
fhSpillBreakDuration->Reset();
......
......@@ -88,9 +88,9 @@ private:
UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB
/// User settings: Data correction parameters
UInt_t fuMinTotPulser = 90;
UInt_t fuMaxTotPulser = 100;
UInt_t fuOffSpillCountLimit = 100;
UInt_t fuMinTotPulser = 90;
UInt_t fuMaxTotPulser = 100;
UInt_t fuOffSpillCountLimit = 100;
Double_t fdSpillCheckInterval = 0.5;
/// Constants
......@@ -100,7 +100,7 @@ private:
/// Running indices
/// 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...
ULong64_t fulCurrentTsIdx = 0;
ULong64_t fulCurrentMsIdx = 0;
Double_t fdTsStartTime = -1.0; //! Time in ns of current TS from the index of the first MS first component
......@@ -115,25 +115,26 @@ private:
UInt_t fuCurrDpbIdx = 0; //! Index of the DPB from which the MS currently unpacked is coming
Int_t fiRunStartDateTimeSec = -1; //! Start of run time since "epoch" in s, for the plots with date as X axis
Int_t fiBinSizeDatePlots = -1; //! Bin size in s for the plots with date as X axis
UInt_t fuGet4Id = 0; //! running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
UInt_t fuGet4Id =
0; //! running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
UInt_t fuGet4Nr = 0; //! running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
/// Starting state book-keeping
Double_t fdStartTime = -1.0; //! Time of first valid hit (epoch available), used as reference for evolution plots
Double_t fdStartTimeMsSz = 0.0; //! Time of first microslice, used as reference for evolution plots
Double_t fdStartTime = -1.0; //! Time of first valid hit (epoch available), used as reference for evolution plots
Double_t fdStartTimeMsSz = 0.0; //! Time of first microslice, used as reference for evolution plots
std::chrono::steady_clock::time_point ftStartTimeUnix = std::chrono::steady_clock::
now(); //! Time of run Start from UNIX system, used as reference for long evolution plots against reception time
now(); //! Time of run Start from UNIX system, used as reference for long evolution plots against reception time
/// Spill detection
Bool_t fbSpillOn = kTRUE;
UInt_t fuCurrentSpillIdx = 0;
Double_t fdStartTimeSpill = -1.0;
Double_t fdLastSecondTime = -1.0;
UInt_t fuCountsLastInterval = 0;
UInt_t fuCountsLastSpill = 0;
std::vector< ULong64_t > fvuSpillBreakBegTs = {};
std::vector< ULong64_t > fvuSpillBreakEndTs = {};
std::vector< ULong64_t > fvuSpillBreakMidTs = {};
Bool_t fbSpillOn = kTRUE;
UInt_t fuCurrentSpillIdx = 0;
Double_t fdStartTimeSpill = -1.0;
Double_t fdLastSecondTime = -1.0;
UInt_t fuCountsLastInterval = 0;
UInt_t fuCountsLastSpill = 0;
std::vector<ULong64_t> fvuSpillBreakBegTs = {};
std::vector<ULong64_t> fvuSpillBreakEndTs = {};
std::vector<ULong64_t> fvuSpillBreakMidTs = {};
/// Histograms related variables
UInt_t fuHistoryHistoSize = 3600; /** Size in seconds of the evolution histograms **/
......
......@@ -7,12 +7,8 @@
// In order to call later Finish, we make this global
FairRunOnline* run = NULL;
Bool_t find_spills(TString inFile = "",
UInt_t uRunId = 0,
TString sOutDir = "data",
TString sHostname = "localhost",
Int_t iServerHttpPort = 8080,
Int_t iServerRefreshRate = 100)
Bool_t find_spills(TString inFile = "", UInt_t uRunId = 0, TString sOutDir = "data", TString sHostname = "localhost",
Int_t iServerHttpPort = 8080, Int_t iServerRefreshRate = 100)
{
TString srcDir = gSystem->Getenv("VMCWORKDIR");
......@@ -49,18 +45,15 @@ Bool_t find_spills(TString inFile = "",
CbmMcbmSpillFindTask* spill_finder_t0 = new CbmMcbmSpillFindTask();
spill_finder_t0->SetIgnoreOverlapMs();
if (0 < uRunId)
spill_finder_t0->SetHistoFilename( Form("data/HistosSpillFinder_%03u.root", uRunId));
spill_finder_t0->SetPulserTotLimits(180, 210); // for runs > 86
spill_finder_t0->SetSpillCheckIntervalSec( 0.05 ); // ~every 4 TS
spill_finder_t0->SetSpillThreshold( 40 ); // ~10 hits per TS
if (0 < uRunId) spill_finder_t0->SetHistoFilename(Form("data/HistosSpillFinder_%03u.root", uRunId));
spill_finder_t0->SetPulserTotLimits(180, 210); // for runs > 86
spill_finder_t0->SetSpillCheckIntervalSec(0.05); // ~every 4 TS
spill_finder_t0->SetSpillThreshold(40); // ~10 hits per TS
// --- Source task
CbmMcbm2018Source* source = new CbmMcbm2018Source();
if ("" != inFile) {
source->SetFileName(inFile);
} // if( "" != inFile )
if ("" != inFile) { source->SetFileName(inFile); } // if( "" != inFile )
else {
source->SetHostName(sHostname);
} // else of if( "" != inFile )
......@@ -98,16 +91,14 @@ Bool_t find_spills(TString inFile = "",
timer.Stop();
std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices"
<< std::endl;
std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" << std::endl;
// --- End-of-run info
Double_t rtime = timer.RealTime();
Double_t ctime = timer.CpuTime();
std::cout << std::endl << std::endl;
std::cout << ">>> SpillFinder: Macro finished successfully." << std::endl;
std::cout << ">>> SpillFinder: Real time " << rtime << " s, CPU time " << ctime
<< " s" << std::endl;
std::cout << ">>> SpillFinder: Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl;
std::cout << std::endl;
/// --- Screen output for automatic tests
......
......@@ -54,5 +54,6 @@ Bool_t mcbm_tof_tracking_kronos(UInt_t uRunIdx = 28,
if (uRunId < 692 && 0 != uRunId) return kFALSE;
return mcbm_tof_tracking(uRunId, bEventWin, iTrackMode, iCalOpt, nTimeslices, sInpDir, sOutDir, cCalId, iUnpFileIndex);
return mcbm_tof_tracking(uRunId, bEventWin, iTrackMode, iCalOpt, nTimeslices, sInpDir, sOutDir, cCalId,
iUnpFileIndex);
}
......@@ -29,11 +29,10 @@ Bool_t unpack_tsa_mcbm(TString inFile = "",
TString runId = TString::Format("%03u", uRunId);
TString outFile = sOutDir + "/unp_mcbm_" + runId;
TString parFile = sOutDir + "/unp_mcbm_params_" + runId;
if( 0 <= iSpillIndex )
{
outFile += TString::Format("_%02i", iSpillIndex);
parFile += TString::Format("_%02i", iSpillIndex);
} // if( 0 <= iSpillIndex )
if (0 <= iSpillIndex) {
outFile += TString::Format<