FSUDAQ_Qt6/Aux/script.C

115 lines
3.1 KiB
C++
Raw Normal View History

2024-08-13 12:45:24 -04:00
#include "fsuReader.h"
// #include "../MultiBuilder.cpp"
#include "SplitPolePlotter.C"
#include "SplitPolePlotter_MT.C"
2023-12-14 15:34:28 -05:00
void script(){
TChain * chain = new TChain("tree");
// chain->Add("raw_binary/run_13/run013_3000.root");
// chain->Add("data/run*_3000.root");
chain->Add("data/12C_dp_*_3000.root");
// TFile * pidCutFile = new TFile("cut_proton.root");
TFile * pidCutFile = new TFile("cut_proton_FSU.root");
TCutG * pidCut = (TCutG *) pidCutFile->Get("protons");
// SplitPolePlotter(chain, pidCut, 123.307, 2.75, false); // for CoMPASS data
// SplitPolePlotter(chain, pidCut, 123.307, 2.75, true); // faster then MT?
SplotPolePlotter_MT(chain, 5, pidCut, 123.307, 2.75, true);
//^=====================================================
2024-08-13 12:45:24 -04:00
// FSUReader * reader = new FSUReader("data/12C_dp_002_19555_PSD_4_000.fsu", 10000, 2);
2023-12-14 15:34:28 -05:00
2024-08-13 12:45:24 -04:00
// reader->ScanNumBlock(1, 0);
2023-12-14 15:34:28 -05:00
2024-08-13 12:45:24 -04:00
// reader->ReadNextBlock(0, 9);
// for( int i = 0; i < 10 ; i++ ) reader->ReadNextBlock(0, 9);
// std::vector<Hit> hitList = reader->ReadBatch(10, true);
// for ( int i = 0; i < 10 ; i ++) hitList[i].Print();
2023-12-14 15:34:28 -05:00
// // int ch = 5;
// // std::vector<unsigned long long > tList;
// // int nEvent = 0;
// // for( int i = 0; i < data->TotNumNonPileUpEvents[ch]; i++){
// // tList.push_back(data->Timestamp[ch][i]);
// // printf("%3d | %d %llu \n", i, data->Energy[ch][i], data->Timestamp[ch][i]);
// // nEvent ++;
// // }
2023-12-14 15:34:28 -05:00
// // std::sort(tList.begin(), tList.end());
2023-12-14 15:34:28 -05:00
// // unsigned long long dTime = tList.back() - tList.front();
// // double sec = dTime * data->tick2ns / 1e9;
2023-12-14 15:34:28 -05:00
// // printf("=========== %llu, %llu = %llu | %f sec | %f Hz\n", tList.back(), tList.front(), dTime, sec, nEvent/sec );
2023-12-14 15:34:28 -05:00
// //data->PrintStat(0);
2023-12-14 15:34:28 -05:00
// data->ClearData();
// data->ClearTriggerRate();
2023-12-14 15:34:28 -05:00
// MultiBuilder * mb = new MultiBuilder(data, reader->GetDPPType(), 334);
// mb->SetTimeWindow(10000);
// unsigned long totNumBlock = reader->GetTotNumBlock();
// int lastDataIndex = 0;
// int lastLoopIndex = 0;
2023-12-14 15:34:28 -05:00
// for( unsigned long i = 0; i < 2; i++){
2023-12-14 15:34:28 -05:00
// reader->ReadNextBlock();
// // int maxDataIndex = 0;
// // int maxLoopIndex = 0;
2023-12-14 15:34:28 -05:00
// // for( int ch = 0; ch < 16 ; ch++){
// // if( data->DataIndex[ch] > maxDataIndex ) maxDataIndex = data->DataIndex[ch];
// // if( data->LoopIndex[ch] > maxLoopIndex ) maxLoopIndex = data->LoopIndex[ch];
// // }
2023-12-14 15:34:28 -05:00
// // if( (maxLoopIndex * MaxNData + maxDataIndex) - (lastLoopIndex * MaxNData + lastDataIndex) > MaxNData * 0.05){
// // printf("Agg ID : %lu \n", i );
2023-12-14 15:34:28 -05:00
// // data->PrintStat();
// // data->PrintAllData();
2023-12-14 15:34:28 -05:00
// // mb->BuildEvents();
// // mb->PrintAllEvent();
// // mb->PrintStat();
2023-12-14 15:34:28 -05:00
// // lastDataIndex = maxDataIndex;
// // lastLoopIndex = maxLoopIndex;
// // }
2023-12-14 15:34:28 -05:00
// }
2023-12-14 15:34:28 -05:00
// data->PrintStat();
// data->PrintAllData();
// //mb->BuildEvents(true);
2023-12-14 15:34:28 -05:00
// mb->BuildEventsBackWard(300);
2023-12-14 15:34:28 -05:00
// mb->PrintAllEvent();
// mb->PrintStat();
2023-12-14 15:34:28 -05:00
// delete mb;
// delete reader;
2023-12-14 15:34:28 -05:00
2024-08-13 12:45:24 -04:00
}