From 3f24baa0aa0bddc9f458601634eaf01ffe7b52d4 Mon Sep 17 00:00:00 2001 From: "Ryan@SOLARIS_testStation" Date: Tue, 6 Aug 2024 17:28:25 -0400 Subject: [PATCH] small tune for MultiBuilder.cpp --- Aux/SplitPolePlotter.C | 6 +++--- MultiBuilder.cpp | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Aux/SplitPolePlotter.C b/Aux/SplitPolePlotter.C index 8a20e7d..dfa7bab 100644 --- a/Aux/SplitPolePlotter.C +++ b/Aux/SplitPolePlotter.C @@ -190,11 +190,11 @@ void SplitPolePlotter(TChain *tree){ hXavg_Theta->Fill( hit.xAvg, hit.theta); for( int i = 0; i < 400; i++){ - double y = -50 + 100/400.*i; + double z = -50 + 100/400.*i; - double x = (y/42.8625 + 0.5)* ( hit.x2-hit.x1) + hit.x1; + double x = (z/42.8625 + 0.5)* ( hit.x2-hit.x1) + hit.x1; - haha->Fill(x,y); + haha->Fill(x,z); } double ex = hit.Rho2Ex( (hit.xAvg/100 + 0.363) ); diff --git a/MultiBuilder.cpp b/MultiBuilder.cpp index 1b76acc..9907a53 100644 --- a/MultiBuilder.cpp +++ b/MultiBuilder.cpp @@ -105,7 +105,7 @@ void MultiBuilder::FindEarlistTimeAndCh(bool verbose){ for(unsigned int ch = 0; ch < data[i]->GetNChannel(); ch ++){ int index = data[i]->GetDataIndex(ch); - if( ch >= data[i]->GetNChannel() || index < 0 ) { + if( index < 0 ) { nExhaushedCh ++; chExhaused[i][ch] = true; continue; @@ -145,9 +145,9 @@ void MultiBuilder::FindLatestTimeAndCh(bool verbose){ for( int j = 0; j < data[i]->GetNChannel(); j++ ) chExhaused[i][j] = false; - for(unsigned int ch = 0; ch < MaxNChannels; ch ++){ + for(unsigned int ch = 0; ch < data[i]->GetNChannel(); ch ++){ - if( nextIndex[i][ch] < 0 || ch >= data[i]->GetNChannel() || data[i]->GetDataIndex(ch) < 0 ) { + if( nextIndex[i][ch] < 0 || data[i]->GetDataIndex(ch) < 0 ) { nExhaushedCh ++; chExhaused[i][ch] = true; // printf(", exhanshed. %d \n", nExhaushedCh); @@ -211,7 +211,7 @@ void MultiBuilder::FindLatestTimeOfData(bool verbose){ void MultiBuilder::BuildEvents(bool isFinal, bool skipTrace, bool verbose){ DebugPrint("%s", "MultiBuilder"); - FindEarlistTimeAmongLastData(verbose); // give lastest Time, Ch, and Digi + FindEarlistTimeAmongLastData(verbose); // give lastest Time, Ch, and Digi for event building FindEarlistTimeAndCh(verbose); //Give the earliest time, ch, digi if( earlistCh == -1 || nExhaushedCh == nData * MaxNChannels) return; /// no data @@ -225,9 +225,6 @@ void MultiBuilder::BuildEvents(bool isFinal, bool skipTrace, bool verbose){ if( eventIndex >= MaxNEvent ) eventIndex = 0; events[eventIndex].clear(); - eventBuilt ++; - totalEventBuilt ++; - em.Clear(); for( int k = 0; k < nData; k++){ @@ -295,14 +292,17 @@ void MultiBuilder::BuildEvents(bool isFinal, bool skipTrace, bool verbose){ // //if there is a time jump, say, bigger than TimeJump. break if( earlistTime - lastEventTime > timeJump ) { if( verbose ){ - printf("%6lu, %16llu\n", eventIndex, earlistTime); - printf("%5s - %16llu \n", "", lastEventTime); - printf("%5s > %16llu \n", "", timeJump); - printf("!!!!!!!! Time Jump detected stop event building. stop event buinding and get more data.\n"); + printf("!!!!!!!! Time Jump detected stop event building and get more data.\n"); + printf("event index : %6lu, earlist time : %16llu\n", eventIndex, earlistTime); + printf(" %6s last event time : %16llu \n", "", lastEventTime); + printf(" %6s time jump > %16llu \n", "", timeJump); } return; } + eventBuilt ++; + totalEventBuilt ++; + if( verbose ){ printf(">>>>>>>>>>>>>>>>> Event ID : %ld, total built: %ld, multiplicity : %ld\n", eventIndex, totalEventBuilt, events[eventIndex].size()); for( int i = 0; i <(int) events[eventIndex].size(); i++){