small tune for MultiBuilder.cpp

This commit is contained in:
Ryan Tang 2024-08-06 17:28:25 -04:00
parent 6f0cdb22b6
commit 3f24baa0aa
2 changed files with 14 additions and 14 deletions

View File

@ -190,11 +190,11 @@ void SplitPolePlotter(TChain *tree){
hXavg_Theta->Fill( hit.xAvg, hit.theta); hXavg_Theta->Fill( hit.xAvg, hit.theta);
for( int i = 0; i < 400; i++){ 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) ); double ex = hit.Rho2Ex( (hit.xAvg/100 + 0.363) );

View File

@ -105,7 +105,7 @@ void MultiBuilder::FindEarlistTimeAndCh(bool verbose){
for(unsigned int ch = 0; ch < data[i]->GetNChannel(); ch ++){ for(unsigned int ch = 0; ch < data[i]->GetNChannel(); ch ++){
int index = data[i]->GetDataIndex(ch); int index = data[i]->GetDataIndex(ch);
if( ch >= data[i]->GetNChannel() || index < 0 ) { if( index < 0 ) {
nExhaushedCh ++; nExhaushedCh ++;
chExhaused[i][ch] = true; chExhaused[i][ch] = true;
continue; continue;
@ -145,9 +145,9 @@ void MultiBuilder::FindLatestTimeAndCh(bool verbose){
for( int j = 0; j < data[i]->GetNChannel(); j++ ) chExhaused[i][j] = false; 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 ++; nExhaushedCh ++;
chExhaused[i][ch] = true; chExhaused[i][ch] = true;
// printf(", exhanshed. %d \n", nExhaushedCh); // printf(", exhanshed. %d \n", nExhaushedCh);
@ -211,7 +211,7 @@ void MultiBuilder::FindLatestTimeOfData(bool verbose){
void MultiBuilder::BuildEvents(bool isFinal, bool skipTrace, bool verbose){ void MultiBuilder::BuildEvents(bool isFinal, bool skipTrace, bool verbose){
DebugPrint("%s", "MultiBuilder"); 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 FindEarlistTimeAndCh(verbose); //Give the earliest time, ch, digi
if( earlistCh == -1 || nExhaushedCh == nData * MaxNChannels) return; /// no data 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; if( eventIndex >= MaxNEvent ) eventIndex = 0;
events[eventIndex].clear(); events[eventIndex].clear();
eventBuilt ++;
totalEventBuilt ++;
em.Clear(); em.Clear();
for( int k = 0; k < nData; k++){ 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 there is a time jump, say, bigger than TimeJump. break
if( earlistTime - lastEventTime > timeJump ) { if( earlistTime - lastEventTime > timeJump ) {
if( verbose ){ if( verbose ){
printf("%6lu, %16llu\n", eventIndex, earlistTime); printf("!!!!!!!! Time Jump detected stop event building and get more data.\n");
printf("%5s - %16llu \n", "", lastEventTime); printf("event index : %6lu, earlist time : %16llu\n", eventIndex, earlistTime);
printf("%5s > %16llu \n", "", timeJump); printf(" %6s last event time : %16llu \n", "", lastEventTime);
printf("!!!!!!!! Time Jump detected stop event building. stop event buinding and get more data.\n"); printf(" %6s time jump > %16llu \n", "", timeJump);
} }
return; return;
} }
eventBuilt ++;
totalEventBuilt ++;
if( verbose ){ if( verbose ){
printf(">>>>>>>>>>>>>>>>> Event ID : %ld, total built: %ld, multiplicity : %ld\n", eventIndex, totalEventBuilt, events[eventIndex].size()); 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++){ for( int i = 0; i <(int) events[eventIndex].size(); i++){