Skip to content
Snippets Groups Projects
Commit 73e99182 authored by LAVIRON Adrien's avatar LAVIRON Adrien
Browse files

Merge branch 'NPTool.2.dev' of https://gitlab.in2p3.fr/np/nptool into NPTool.2.dev

parents b4196d02 cd919c5a
No related branches found
No related tags found
No related merge requests found
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <cstdlib>
using namespace std; using namespace std;
//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--// //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//
int main() int main(int argc, char *argv[])
{ {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// configure option manager // configure option manager
// NPOptionManager::getInstance()->Destroy(); // NPOptionManager::getInstance()->Destroy();
...@@ -49,16 +49,34 @@ int main() ...@@ -49,16 +49,34 @@ int main()
auto ccamPhys = (TComptonTelescopePhysics*) m_NPDetectorManager->GetDetector("ComptonTelescope"); auto ccamPhys = (TComptonTelescopePhysics*) m_NPDetectorManager->GetDetector("ComptonTelescope");
ccamPhys->SetRawDataPointer(ccamData); ccamPhys->SetRawDataPointer(ccamData);
// deal with file name and number of events to treat from command line
std::cout << "\n";
int nevents = -1;
string fileName = "bb7_3309-7_cs137_20210304_14h35_conv.root";
if (argc == 1) {
std::cout << "Name of file to analyse should be provided as a command line argument\n";
std::cout << "Default file " << fileName << " is considered\n";
}
else {
fileName = argv[1];
if (argc == 3) nevents = std::atoi(argv[2]);
}
// read data file/flux and fill ccamData object // read data file/flux and fill ccamData object
std::cout << "Reading data\n"; std::cout << "Reading data from " << fileName << "\n";
DecodeD* DD = new DecodeD(true); // Instantiates DecodeD object reading DSSSD(s) data flux DecodeD* DD = new DecodeD(true); // Instantiates DecodeD object reading DSSSD(s) data flux
newframe_t* event; newframe_t* event;
DD -> setTree("../data/20200128_10h44_bi207_conv.root"); fileName = "../data/" + fileName;
DD -> setTree(fileName.c_str());
// DD -> setTree("../data/20200128_10h44_bi207_conv.root");
// DD -> setTree("../data/bb7_3309-7_cs137_20210304_14h35_conv.root");
//DD -> setTree("../data/bb7_3309-7_bi207_20210209_12h50_run10_conv.root"); //DD -> setTree("../data/bb7_3309-7_bi207_20210209_12h50_run10_conv.root");
int dlen = DD -> getLength(); int dlen = DD -> getLength();
// read a limited number of events
if (nevents > 0) dlen = nevents;
std::cout << "Reading the first " << dlen << " entries\n";
while (DD -> getCursor() < 49970) while (DD -> getCursor() < dlen)
//while (DD -> getCursor() < dlen)
{ {
// cout number of entries treated // cout number of entries treated
if (DD -> getCursor() % 10000 == 0) { if (DD -> getCursor() % 10000 == 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment