17 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
18 R__LOAD_LIBRARY(libinterface_main)
27 gSystem->Load(
"libinterface_main.so");
31 tree->SetAlias(
"event",
"DST.SQEvent");
32 tree->SetAlias(
"hit" ,
"DST.SQHitVector._vector");
34 TCanvas*
c1 =
new TCanvas(
"c1",
"");
42 tree->Draw(
"hit.get_tdc_time()",
43 "event._trigger == 0x4 && hit.get_detector_id() == 13");
44 c1->SaveAs(
"tdc_time.png");
47 tree->Draw(
"hit.get_element_id()",
48 "event._trigger == 0x4 && hit.get_detector_id() == 13");
49 c1->SaveAs(
"ele_id.png");
58 oss <<
"/data2/e1039/dst/run_" << setfill(
'0') << setw(6) << run <<
"_spin.root";
59 string fn_in = oss.str();
60 cout <<
"DST = " << fn_in << endl;
61 TFile* file =
new TFile(fn_in.c_str());
62 if (! file->IsOpen()) {
63 cout <<
" Cannot open the DST file. Abort." << endl;
66 TTree* tree = (TTree*)file->Get(
"T");
68 cout <<
" Cannot get the tree object. Abort." << endl;
77 TObjArray* arr = tree->GetListOfLeaves();
78 int n_ent = arr->GetEntries();
79 for (
int i_ent = 0; i_ent < n_ent; i_ent++) {
80 TObject* obj = arr->At(i_ent);
81 cout << setw(2) << i_ent <<
" " << obj->ClassName() <<
" " << obj->GetName() <<
"\n";
void PrintTreeElements(TTree *tree)
Sub-function to just print out the list of tree variables.
int run(const int nEvents=1)
void draw_real_dst(const int run=318)
Main function.
TTree * GetTree(const int run)
ROOT macro to look into the E1039 DST file in a simple way.