ATLAS Offline Software
wmain.cxx
Go to the documentation of this file.
1 
11 #include <iostream>
12 
13 #include <TFile.h>
14 #include <TTree.h>
15 
16 using namespace std;
17 
19 
20 #include <map>
21 
22 
23 
24 int main()
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 }
123 
main
int main()
Definition: wmain.cxx:24
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
DiTauMassTools::TauTypes::hh
@ hh
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:49
TIDAEvent.h
Basic event class to contain a vector of chains for trigger analysis
tree
TChain * tree
Definition: tile_monitor.h:30
JiveXML::Event
struct Event_t Event
Definition: ONCRPCServer.h:65
TIDARoiDescriptor
Describes the Region of Ineterest geometry It has basically 8 parameters.
Definition: TIDARoiDescriptor.h:42
TIDA::Event
Definition: TIDAEvent.h:33
TIDA::Chain::addRoi
void addRoi(TIDA::Roi &roi)
add and roi by root dictionary class
Definition: TIDAChain.h:44
python.MuonSegmentFindingConfig.ars
ars
Definition: MuonSegmentFindingConfig.py:627
lumiFormat.i
int i
Definition: lumiFormat.py:92
h
TIDA::Chain
Definition: TIDAChain.h:28
TIDARoiDescriptor::push_back
void push_back(const TIDARoiDescriptor &roi)
Definition: TIDARoiDescriptor.h:212