ATLAS Offline Software
Loading...
Searching...
No Matches
wmain.cxx File Reference
#include <iostream>
#include <TFile.h>
#include <TTree.h>
#include "TrigInDetAnalysis/TIDAEvent.h"
#include <map>
Include dependency graph for wmain.cxx:

Go to the source code of this file.

Functions

int main ()

Detailed Description

Author
mark sutton
Date
Fri 11 Jan 2019 07:41:26 CET

Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

Definition in file wmain.cxx.

Function Documentation

◆ main()

int main ( )

Definition at line 24 of file wmain.cxx.

25{
26
27
28 {
29 TIDA::Event* h = new TIDA::Event();
30
31 std::cout << "\n\nconstructing ..." << std::endl;
32
33 TFile f("tree.root", "recreate");
34 TTree *tree = new TTree("tree","tree");
35
36 // tree->Branch("Track","Int",&t,6400);
37 tree->Branch("TIDA::Event", "TIDA::Event",&h,6400, 1);
38
39 std::string ars[3] = { "ars0", "ars1", "ars2" };
40
41 std::cout << "\n\nfilling ..." << std::endl;
42
43 for ( int i=0; i<3 ; i++ ) {
44
45 h->clear();
46
47 h->run_number(10);
48 h->event_number(i);
49
50 std::cout << "\n\nEvent " << i << std::endl;
51
52 for ( int j=0 ; j<2 ; j++ ) {
53
54 std::cout << "\n\tRoi " << j << std::endl;
55
56 h->addChain( ars[j] );
57
58 TIDA::Chain& tc = h->back();
59 // tc.addCombination();
60
61 // TrackCombination& c = h->back().back();
62
63 TIDARoiDescriptor roi1( j+1., j+1-2., j+1+2.,
64 j+3., j+3-1.1, j+3+1.1,
65 j+2.1, j+2.1-100, j+2.1+100 );
66
67 for ( int ij=0 ; ij<j+1 ; ij++ ) roi1.push_back( TIDARoiDescriptor( ij, ij-0.2, ij+0.2,
68 ij, ij-0.2, ij+0.2,
69 ij, ij-0.2, ij+0.2 ) );
70
71 std::cout << "Roi " << roi1 << std::endl;
72
73 TIDARoiDescriptor roi2( j+1., j+1-2., j+1+2.,
74 j+3., j+3-1.1, j+3+1.1,
75 j+2.1, j+2.1-100, j+2.1+100 );
76
77 tc.addRoi( roi1 );
78
79 tc.addRoi( roi2 );
80
81 }
82
83 cout << "TIDA::Event " << *h << endl;
84
85 tree->Fill();
86
87 }
88
89 std::cout << "\n\nwriting ..." << std::endl;
90
91
92 f.Write();
93 f.Close();
94
95 }
96
97
98 {
99 std::cout << "\n\nreading ..." << std::endl;
100
101 TIDA::Event* hh = new TIDA::Event();
102
103 TFile f("tree.root");
104 TTree *tree = (TTree*)f.Get("tree");
105
106 // tree->Branch("Track","Int",&t,6400);
107 tree->SetBranchAddress("TIDA::Event", &hh );
108
109 for ( int i=0; i<tree->GetEntries() ; i++ ) {
110
111 tree->GetEntry(i);
112
113 cout << "TIDA::Event " << i << " " << *hh << endl;
114
115 }
116
117 f.Close();
118
119 }
120
121 return 0;
122}
static Double_t tc
Header file for AthHistogramAlgorithm.
Describes the Region of Ineterest geometry It has basically 8 parameters.
TChain * tree