Cicada  v1.4.1
Project 8 Processed-Data File Format Library
BasicTest.cc
Go to the documentation of this file.
1 
12 #include "logger.hh"
13 
14 #include "TFile.h"
15 #include "TTree.h"
16 #include "CROOTData.hh"
17 
18 LOGGER(bt, "BasicTest");
19 
20 int main(int argc, char *argv[]){
21  // Testing the number of arguments
22  if (argc<2) {
23  LERROR(bt,"No argument provided; exiting...");
24  return 1;
25  }
26  LINFO(bt, "Reading file:\t" << argv[1]);
27 
28  TFile* myFile = new TFile(argv[1], "READ");
29  TTree* myTree;
30  myFile->GetObject("multiTrackEvents", myTree);
31 
32  // Change Katydid into Cicada if necessary
33  Cicada::TMultiTrackEventData *myEvent = 0;
34  myTree->SetBranchAddress("Event", &myEvent);
35  for( int i=0; i<myTree->GetEntries(); ++i) {
36  myTree->GetEntry(i);
37  LINFO(bt,"StartTimeInAcq: " << myEvent->GetStartTimeInAcq());
38  }
39  return 1;
40 }
41 
static scarab::logger bt("BasicTest")
Contains the definition of the branches saved in the Katydid output for a processed event...
Definition: CROOTData.hh:102
int main(int argc, char *argv[])
Definition: BasicTest.cc:20
Contains TProcessedTrackData and TMultiTrackEventData.