diff --git a/armory/DataBlock.h b/armory/DataBlock.h index 5c240f9..8e2ac81 100644 --- a/armory/DataBlock.h +++ b/armory/DataBlock.h @@ -14,6 +14,8 @@ #include "TTree.h" #include "TString.h" +#define MAX_TRACE_LENGHT 16000 + class DataBlock{ public: @@ -37,7 +39,7 @@ public: ULong64_t eventID; - UShort_t trace[1024]; + UShort_t trace[MAX_TRACE_LENGHT]; DataBlock(){ Clear(); @@ -71,7 +73,7 @@ public: } void ClearTrace(){ - for( int i = 0; i < 1024; i++) trace[i] = 0; + for( int i = 0 ; i < MAX_TRACE_LENGHT; i++) trace[i] = 0; } diff --git a/armory/MergeEVT.cpp b/armory/MergeEVT.cpp index 47f2592..44b2477 100644 --- a/armory/MergeEVT.cpp +++ b/armory/MergeEVT.cpp @@ -81,20 +81,18 @@ int main(int argn, char **argv) { TBenchmark clock2; clock2.Reset(); clock2.Start("timer"); + + evt->ScanNumberOfBlock(); //=============== Read File while( evt->IsEndOfFile() == false ){ evt->ReadBlock(); - evt->PrintStatus(10000); + //evt->PrintStatus(10000); - int id = data->crate*MAX_BOARDS_PER_CRATE*MAX_CHANNELS_PER_BOARD + (data->slot-BOARD_START)*MAX_CHANNELS_PER_BOARD + data->ch; detID = mapping[id]; - printf("--------- a\n"); - outFile-> - //cern fill tree outFile->cd(); tree->Fill(); diff --git a/armory/evtReader.h b/armory/evtReader.h index f507df4..ab8855c 100644 --- a/armory/evtReader.h +++ b/armory/evtReader.h @@ -37,7 +37,7 @@ class evtReader{ long int nBlock; unsigned int extraHeader[14]; - unsigned int traceBlock[4000]; + unsigned int traceBlock[MAX_TRACE_LENGHT/2]; TBenchmark gClock; @@ -167,6 +167,7 @@ int evtReader::ReadBlock(int opt){ data->trace_out_of_range = header[3] >> 31; data->ClearQDC(); + data->ClearTrace(); ///======== read QDCsum if( data->headerLength >= 4 ){ @@ -192,15 +193,16 @@ int evtReader::ReadBlock(int opt){ data->baseline = 0; } ///====== read trace - if( data->eventLength > data->headerLength ){ + if( data->eventLength > data->headerLength ){ fread(traceBlock, sizeof(unsigned int) * ( data->trace_length / 2 ), 1, inFile); - + for( int i = 0; i < data->trace_length/2 ; i++){ data->trace[2*i+0] = traceBlock[i] & 0xFFFF ; data->trace[2*i+1] = (traceBlock[i] >> 16 ) & 0xFFFF ; } ///make QDC by trace + /** if( data->headerLength == 4 || data->headerLength == 8 ) { for( int i = 0; i < 8; i++){ data->QDCsum[i] = 0;} for( int i = 0; i < data->trace_length; i++){ @@ -213,7 +215,7 @@ int evtReader::ReadBlock(int opt){ if( 160 <= i && i < 175 ) data->QDCsum[6] += data->trace[i]; if( 175 <= i && i < 200 ) data->QDCsum[7] += data->trace[i]; } - } + }*/ } }