FairRoot/PandaRoot
Functions
macro/detectors/hypGe/Marcell/evt_disp/eventDisplay.C File Reference

Go to the source code of this file.

Functions

 eventDisplay (TString InputFileExt="TripleBall40Offset20STT_4MeV_100Evts_ST1__0.root", TString InputSubDir="Gamma")
 

Function Documentation

eventDisplay ( TString  InputFileExt = "TripleBall40Offset20STT_4MeV_100Evts_ST1__0.root",
TString  InputSubDir = "Gamma" 
)

Definition at line 3 of file macro/detectors/hypGe/Marcell/evt_disp/eventDisplay.C.

References fMan, fRun, gGeoManager, parInput1, rtdb, top, Track, trk, and TString.

4 {
5  // Load basic libraries
6  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
7  //rootlogon();
8  gSystem->Load("libEve");
9  gSystem->Load("libEventDisplay");
10  gSystem->Load("libHypGe");
11  // gSystem->Load("librazhyp");
12  // gSystem->Load("libHyp");
13  //gSystem->Load("libTof");
14 
15  // ----- Reconstruction run -------------------------------------------
16  FairRunAna *fRun= new FairRunAna();
17  //fRun->SetInputFile("points.x3872.jpsipipi.phsp.root");
18  // fRun->SetInputFile("../qa/lhetrack/points_tpccombi.root");
19  TString Path= gSystem->Getenv("SIMDATADIR");
20  TString InputFile = Path;
21  InputFile+= "/";
22  InputFile+= InputSubDir;
23  InputFile+= "/";
24  InputFile += InputFileExt;
25  cout << InputFile << endl;
26  fRun->SetInputFile(InputFile.Data());//sim_pidC.root");
27  // /d/pndint02/asanchez/FOct09/sim_hypFSG41TCIPAxxbG.root");//sim_with_vis.root");
28  // fRun->SetInputFile("../drc/testrun1.root");
29  // fRun->SetInputFile("../dsk/sim_dsk.g4native.root");
30  fRun->SetOutputFile("test.root");
31  // fRun->LoadGeometry();
32 
33  TString ParFile = InputFile;
34  if (ParFile.EndsWith(".root"))
35  ParFile.ReplaceAll(".root", "__Simparams.root");
36 
37  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
38  FairParRootFileIo* parInput1 = new FairParRootFileIo();
39  // parInput1->open("../drc/testparams.root");
40  parInput1->open(ParFile.Data());
41  //../hyp/SimG41TCIPAxxbGparams.root");//params_with_vis.root");
42 
43  rtdb->setFirstInput(parInput1);
44 
45  parInput1->print();
46 
47  FairEventManager *fMan= new FairEventManager();
48  FairMCTracks *Track = new FairMCTracks ("Monte-Carlo Tracks");
49  // FairMCPointDraw *MvdPoints = new FairMCPointDraw ("MVDPoint",kBlue, kFullSquare);
50 // FairMCPointDraw *EMCPoints = new FairMCPointDraw ("EmcPoint",kOrange, kFullSquare);
51  //FairMCPointDraw *TofPoint = new FairMCPointDraw ("TofPoint",kYellow, kFullSquare);
52  //FairMCPointDraw *TofSciFPoint= new FairMCPointDraw ("TofSciFPoint",kTeal, kFullSquare);
53  FairMCPointDraw *MuoPoint = new FairMCPointDraw ("HypGePoint",kAzure, kFullSquare);
54  // FairMCPointDraw *PndDrcPoint = new FairMCPointDraw ("PndDrcPoint",kViolet, kFullSquare);
55 // FairMCPointDraw *PndDchPoint = new FairMCPointDraw ("PndDchPoint",kPink, kFullSquare);
56  //FairMCPointDraw *PndTpcPoint = new FairMCPointDraw ("PndTpcPoint",kCyan, kFullSquare);
57  // FairMCPointDraw *PndSTTPoint = new FairMCPointDraw ("STTPoint",kMagenta, kFullSquare);
58 
59 
60  fMan->AddTask(Track);
61 
62  // fMan->AddTask(MvdPoints);
63 // fMan->AddTask(EMCPoints);
64  //fMan->AddTask(TofPoint);
65  //fMan->AddTask( TofSciFPoint);
66  fMan->AddTask( MuoPoint);
67  // fMan->AddTask( PndDrcPoint);
68 // fMan->AddTask( PndDchPoint);
69  //fMan->AddTask( PndTpcPoint);
70  // fMan->AddTask( PndSTTPoint);
71 
72  fMan->Init();
73  char str[80];
74  char str1[80];
75  char str2[80];
76  char str3[80];
77 
78  TGeoNode* trk;
79  TGeoNode* trl;
80  TGeoNode* trab;
81  TGeoNode* trsi;
82 
83  std::cout<<" gGeoM "<<gGeoManager<<std::endl;
84  int k;
85 
86 
87  TGeoVolume* top = gGeoManager->GetTopVolume();
88  gGeoManager->SetVisLevel(12);
89 
90 
91  //TEveScene* s = gEve->SpawnNewScene("Projected Event");
92  //gEve->GetDefaultViewer()->AddScene(s);
93  //TGLViewer* v = gEve->GetDefaultGLViewer();
94  //v->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
95  //TGLOrthoCamera* cam = (TGLOrthoCamera*) v->CurrentCamera();
96  //cam->SetZoomMinMax(0.2, 20);
97 
99  //TEveProjectionManager* mng =
100  //new TEveProjectionManager(TEveProjection::kPT_RPhi);
101  //s->AddElement(mng);
102  //TEveProjectionAxes* axes = new TEveProjectionAxes(mng);
103  //axes->SetTitle("TEveProjections demo");
104  //s->AddElement(axes);
105  //gEve->AddToListTree(axes, kTRUE);
106  //gEve->AddToListTree(mng, kTRUE);
107 
108 
109  //TGeoNode *N= gGeoManager->GetTopNode();
110  //TEveGeoTopNode *TNod=new TEveGeoTopNode(gGeoManager, N);
111  //TEveGeoNode *TRealtop = new TEveGeoNode(gGeoManager->GetTopNode()->GetDaughter(0));
112  //TEveGeoNode *TCrystal = new TEveGeoNode(gGeoManager->GetTopNode()->GetDaughter(0)->GetDaughter(0)->GetDaughter(0)->GetDaughter(1));
113  //TNod->Print();
114  //TRealtop->Print();
115  //TCrystal->Print();
116  //TCrystal->SetMainColor(kRed);
117  //cout << "Children : " <<TNod->GetNItems()<<endl;
119  //gEve->GetGlobalScene()->SetRnrState(kFALSE);
120  //gEve->AddGlobalElement(TCrystal);
121  //cout << "Import : " <<mng->ImportElements(TCrystal)<< endl;
126  //gEve->Redraw3D(kTRUE);
127 
128 
129 
130 // the secondary target (detetctor volume) consist of 4 blocks
131 // denominated by "stg0%d ", each of this block acts as a mother volume
132 // contains 20 layers which also mother volume for a double layer "stglay%d_1".
133 // the double layer is composed by one silicon and one absorber layers
134 // These are the "real" detector volumes,
135 // the names of these volumes are given by "stglAb%d_1" and "stglSi%d_1".
136 /*
137  for(int i=0;i<4;i++)
138  {
139 
140 
141  sprintf(str,"stg0%d_1",i+1);
142  std::cout<<" name "<<str<<std::endl;
143 
144  TGeoNode* trk = top->FindNode(str);
145  cout<<" tr "<<trk<<endl;
146 
147  for(int j=0;j<20;j++){
148  if(i==0) k = j;
149  if(i==1) k = j+20;
150  if(i==2) k = j+40;
151  if(i==3) k = j+60;
152 
153  sprintf(str1,"stglay%d_1",k);
154  TGeoNode* trl = trk->GetVolume()->FindNode(str1);
155  //cout<<" trl "<<trl<<" name "<<str1<<endl;
156 
157 
158  sprintf(str2,"stglAb%d_1",k);
159  TGeoNode* tra = trl->GetVolume()->FindNode(str2);
160  //cout<<" tra "<<tra<< " same "<<str2<<endl;
161  tra->GetVolume()->SetLineColor(kYellow);
162  sprintf(str3,"stglSi%d_1",k);
163  TGeoNode* trs = trl->GetVolume()->FindNode(str3);
164  //cout<<" tra "<<tra<< " same "<<str2<<endl;
165  trs->GetVolume()->SetLineColor(kMagenta);
166  //fMan->AddGlobalElement(tra[k]);
167  }
168  }
169 */
170 
171 }
TGeoManager * gGeoManager
TGeoVolume * top
FairRunAna * fRun
Definition: hit_dirc.C:58
FairMCTracks * Track
Definition: drawEveTracks.C:8
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
GFTrack * trk
Definition: checkgenfit.C:13
FairEventManager * fMan
Definition: drawEveTracks.C:7