-
Notifications
You must be signed in to change notification settings - Fork 1
/
BTL_Analysis.cc
41 lines (32 loc) · 977 Bytes
/
BTL_Analysis.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <string>
#include "TTree.h"
#include "TFile.h"
#include "pulse.hh"
std::string ParseCommandLine( int argc, char* argv[], std::string opt )
{
for (int i = 1; i < argc; i++ )
{
std::string tmp( argv[i] );
if ( tmp.find( opt ) != std::string::npos )
{
if ( tmp.find( "=" ) != std::string::npos ) return tmp.substr( tmp.find_last_of("=") + 1 );
if ( tmp.find( "--" ) != std::string::npos ) return "yes";
}
}
return "";
};
int main( int argc, char** argv)
{
std::string inputRootFile = ParseCommandLine( argc, argv, "--inputRootFile" );
if ( inputRootFile == "" )
{
std::cerr << "[ERROR]: Please provide a valid ROOT file to run on!! Please use --inputRootFile=<your_file_name>\n";
return -1;
}
TFile* fin = new TFile(inputRootFile.c_str(), "READ");
TTree* myTree = (TTree*)fin->Get("pulse");
pulse* myPulse = new pulse( myTree );
myPulse->CheckAllDRSChannels();
return 0;
}