FairRoot/PandaRoot
Functions
ReadLines.C File Reference
#include <vector>

Go to the source code of this file.

Functions

int ReadLines ()
 

Function Documentation

int ReadLines ( )

Definition at line 11 of file ReadLines.C.

References directory, f, fGeoH, geomFile, PndGeoHandling::GetPath(), p, t, TString, and y.

11  {
12 
13 
14  // load libs
15 
16  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17 
18  //
19  TString LinFile = "fit.root";
20 
21  TString directory = gSystem->Getenv("VMCWORKDIR");
22  TString geomFile = directory + "/geometry/TrackingStation.root";
23 
24  TFile *geo = new TFile(geomFile);
25 
26  TGeoManager *myGeo = geo->Get("FAIRGeom");
27 
28  fGeoH = new PndGeoHandling();
29 
30 
31  // Loading the geometry and defining the geo handler
32 
33  TFile *f = new TFile(LinFile);
34 
35  TTree *t=(TTree *) f->Get("pndsim") ;
36 
37  TClonesArray* tr_array=new TClonesArray("PndLinTrack");
38  t->SetBranchAddress("MVDTrack",&tr_array);//Branch names
39 
40  cout << "Events: " << t->GetEntries() << endl;
41 
42  for (Int_t j = 0 ; j < t->GetEntries() ; j++) // loop on events
43 
44  {
45 
46  t->GetEvent(j);
47 
48  cout << "Event " << j << " Entries " << tr_array->GetEntries() << endl;
49 
50  for (Int_t y = 0 ; y < tr_array->GetEntries() ; y++) // loop on hits
51  {
52 
53  PndLinTrack* line = (PndLinTrack*)tr_array->At(y);
54 
55  std::vector<TString> names = line->GetSens();
56 
57  Int_t siz = names.size();
58 
59  cout << " Hit " << y << " size " << siz << endl;
60 
61  for (Int_t p = 0 ; p < siz ; p++)
62  {
63  cout << "Det: " << fGeoH->GetPath(names[p]) << endl;
64  }
65  }
66 
67  } // end loop on events
68 
69  return 0;
70 
71 }
Double_t p
Definition: anasim.C:58
PndGeoHandling * fGeoH
Definition: anasim.C:34
TString GetPath(Int_t shortID)
for a given shortID the path is returned
TString geomFile
Class to access the naming information of the MVD.
TFile * f
Definition: bump_analys.C:12
TTree * t
Definition: bump_analys.C:13
Double_t y
TString directory