DD4hep  1.31.0
Detector Description Toolkit for High Energy Physics
next_event_dummy.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 //==========================================================================
11 
12 #include "TEveManager.h"
13 #include <iostream>
14 #include "TEveStraightLineSet.h"
15 #include "TRandom.h"
16 
17 TEveStraightLineSet* lineset(Int_t nlines = 40, Int_t nmarkers = 4) ;
18 
19 void next_event(){
20 
21  // static int count = 1 ;
22 
23  std::cout << " next_event called - nothing to do ... " << std::endl ;
24 
25  TEveElementList* tevent = (TEveElementList* ) gEve->GetCurrentEvent() ;
26 
27  if( tevent )
28  tevent->DestroyElements() ;
29 
30 
31  // lineset( count, count ) ;
32 
33  gEve->Redraw3D();
34 
35  // count += 3 ;
36 }
37 
38 
39 //=====================================================================================
40 TEveStraightLineSet* lineset(Int_t nlines, Int_t nmarkers )
41 {
42  TEveManager::Create();
43 
44  TRandom r(0);
45  Float_t s = 100;
46 
47  TEveStraightLineSet* ls = new TEveStraightLineSet();
48 
49  for(Int_t i = 0; i<nlines; i++)
50  {
51  ls->AddLine( r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s),
52  r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s));
53  // add random number of markers
54  Int_t nm = Int_t(nmarkers* r.Rndm());
55  for(Int_t m = 0; m < nm; m++) {
56  ls->AddMarker(i, r.Rndm());
57  }
58  }
59 
60  ls->SetMarkerSize(1.5);
61  ls->SetMarkerStyle(4);
62 
63  gEve->AddElement(ls);
64  gEve->Redraw3D();
65 
66  return ls;
67 }
68 //=====================================================================================
next_event
void next_event()
Definition: next_event_dummy.cpp:19
TEveElementList
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:13
lineset
TEveStraightLineSet * lineset(Int_t nlines=40, Int_t nmarkers=4)
Definition: next_event_dummy.cpp:40