FairRoot/PandaRoot
Functions
macro/detectors/disc/eventDisplay.C File Reference

Go to the source code of this file.

Functions

int eventDisplay (TString inFile="sim.root", TString parFile="simparams.root", TString outid="n")
 

Function Documentation

int eventDisplay ( TString  inFile = "sim.root",
TString  parFile = "simparams.root",
TString  outid = "n" 
)

Definition at line 1 of file macro/detectors/disc/eventDisplay.C.

References b, Bool_t, Double_t, fi, file, fMan, fRun, gGeoManager, i, inFile, parFile, parInput1, rtdb, topvol, tr, Track, TString, v, x, y, and z.

1  {
2  // ----- Reconstruction run -------------------------------------------
3  FairRunAna *fRun= new FairRunAna();
4  fRun->SetInputFile(inFile);
5  //fRun->AddFriend(digiFile);
6  fRun->SetOutputFile("tst.root");
7 
8  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
9  FairParRootFileIo* parInput1 = new FairParRootFileIo();
10  parInput1->open(parFile);
11  rtdb->setFirstInput(parInput1);
12 
13  FairEventManager *fMan= new FairEventManager();
14  FairMCTracks *Track = new FairMCTracks ("Monte-Carlo Tracks");
15  FairMCPointDraw *DiscSensorPoint = new FairMCPointDraw ("DiscSensorMCPoint",kViolet, kFullSquare);
16 
17  fMan->AddTask(Track);
18  fMan->AddTask(DiscSensorPoint);
19 
20  fMan->Init(1,4);
21  //fMan->Init();
22 
23  TFile* fi = new TFile("vgeo.root","RECREATE");
24  TGeoVolume *topvol = gGeoManager->GetVolume("cave");
25  topvol->CheckOverlaps(0.0001, "");
26  gGeoManager->CheckOverlaps(0.00001,""); // [cm]
27  TObjArray *listOfOverlaps = gGeoManager->GetListOfOverlaps();
28  cout<<listOfOverlaps->GetEntries()<<endl;
29  listOfOverlaps->Print();
30 
31  gGeoManager->SetTopVolume(topvol);
32  gGeoManager->CloseGeometry();
33  topvol->Write();
34 
35  FairEventManager* fm = FairEventManager::Instance();
36  fm->NextEvent();
37  TEveTrackList *eltrack = (TEveTrackList*) fm->FindChild("Cherenkov");
38 
39  int b=0;
40  Double_t x,y,z;
41 
42  Bool_t storePYtracks = false;
43  if(storePYtracks){
44  TEveElement::List_t ll = eltrack->RefChildren();
45  ofstream file;
46  file.open ("trackst.py");
47  for ( TEveElement::List_i ii = ll.begin(); ii != ll.end();++ii){
48  TEveTrack * tr = (TEveTrack*)(*ii);
49  Int_t size = tr->Size();
50  if(size<10) continue;
51  TString blendtrack = "listOfVectors = [";
52  for(Int_t i=0; i<size; i++){
53  tr->GetPoint(i,x,y,z);
54  blendtrack += Form("Vector((%f,%f,%f)),",x,y,z);
55  }
56  blendtrack = blendtrack.Strip(TString::kTrailing,',') + "] \n";
57  blendtrack += Form("MakePolyLine(\"Track_%d\", \"TrackN_%d\", listOfVectors) \n",i,i);
58  file<< blendtrack;
59  }
60  file.close();
61  }
62 
63  // //fm->DisableListElements();
64  // TEveElement *el = fm->FindChild("DrcPDPoint");
65  // el->Destroy();
66  // el = fm->FindChild("DrcEVPoint");
67  // el->Destroy();
68 
69  TGLViewer *v = gEve->GetDefaultGLViewer();
70  // v->SetClearColor(0);
71  v->SetIgnoreSizesOnUpdate(kTRUE);
72  v->UpdateScene(kTRUE);
73  TGLSAViewer *sav = (TGLSAViewer *)v;
74  sav->SetDrawCameraCenter(false);
75 
76  // TGLCamera & cam=(TGLOrthoCamera &)v->CurrentCamera();
77  // Double_t c[] = {46.8, 8.9, -120.};
78  // Double_t c[] = {10, 125, -125};
79  // cam.Configure(16.5,1,c,-0.3,1.8);
80  // cam.SetExternalCenter(false);
81 
82  TGLCamera & cam=(TGLOrthoCamera &)v->CurrentCamera();
83 
84  // Double_t c[] = {180, 0, -200}; // for hits
85  // cam.Configure(13,1,c,-0.2,1.3); // for hits
86 
87  // Double_t c[] = {90, 8.9, -150.};
88  // cam.Configure(25,1,c,-0.4,0.9); // for geom
89  // cam.SetExternalCenter(false);
90 
91  v->DoDraw();
92  fm->EnableListElements();
93  gEve->DoRedraw3D();
94  v->DoDraw();
95  v->SavePicture("geometry.png");
96  // v->SavePicture("anim_"+outid+".png");
97 
98  return 0;
99 }
Int_t i
Definition: run_full.C:25
TTree * b
TFile * file
TGeoManager * gGeoManager
__m128 v
Definition: P4_F32vec4.h:4
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
FairMCTracks * Track
Definition: drawEveTracks.C:8
TFile * fi
Double_t
TString parFile
Definition: hit_dirc.C:14
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
Double_t z
TGeoVolume * topvol
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t x
FairEventManager * fMan
Definition: drawEveTracks.C:7
Double_t y