Logo ROOT  
Reference Guide
No Matches
#include "TRandom.h"
#include <ROOT/REveElement.hxx>
#include <ROOT/REveScene.hxx>
#include <ROOT/REveManager.hxx>
#include <ROOT/REveJetCone.hxx>
Include dependency graph for jets.C:


void jets ()
void makeJets (int N_Jets, REX::REveElement *jetHolder)


const Double_t kR_max = 250
const Double_t kR_min = 240
const Double_t kZ_d = 300

Detailed Description

This example display only points in web browser.

#include "TFile.h"
#include "TTree.h"
#include "TRandom.h"
#include "TROOT.h"
#include "TSystem.h"
#include "JetEvent.h"
#include "Riostream.h"
void write(Int_t nev=100) {
//write nev Jet events
TFile f("JetEvent.root","recreate");
TTree *T = new TTree("T","Event example with Jets");
JetEvent *event = new JetEvent;
for (Int_t ev=0;ev<nev;ev++) {
void read() {
//read the JetEvent file
TFile f("JetEvent.root");
TTree *T = (TTree*)f.Get("T");
JetEvent *event = 0;
T->SetBranchAddress("event", &event);
Long64_t nentries = T->GetEntries();
for (Long64_t ev=0;ev<nentries;ev++) {
if (ev) continue; //dump first event only
cout << " Event: "<< ev
<< " Jets: " << event->GetNjet()
<< " Tracks: " << event->GetNtrack()
<< " Hits A: " << event->GetNhitA()
<< " Hits B: " << event->GetNhitB() << endl;
void pileup(Int_t nev=200) {
//make nev pileup events, each build with LOOPMAX events selected
//randomly among the nentries
TFile f("JetEvent.root");
TTree *T = (TTree*)f.Get("T");
// Long64_t nentries = T->GetEntries();
const Int_t LOOPMAX=10;
JetEvent *events[LOOPMAX];
Int_t loop;
for (loop=0;loop<LOOPMAX;loop++) events[loop] = 0;
for (Long64_t ev=0;ev<nev;ev++) {
if (ev%10 == 0) printf("building pileup: %lld\n",ev);
for (loop=0;loop<LOOPMAX;loop++) {
Int_t rev = gRandom->Uniform(LOOPMAX);
T->SetBranchAddress("event", &events[loop]);
void jets(Int_t nev=100, Int_t npileup=200, Bool_t secondrun = true) {
// Embedding these loads inside the first run of the script is not yet
// supported in v6
// gROOT->ProcessLine(".L $ROOTSYS/tutorials/tree/JetEvent.cxx+");
//void jets(Int_t nev=100, Int_t npileup=200, Bool_t secondrun);
void jets(Int_t nev=100, Int_t npileup=200) {
TString tutdir = gROOT->GetTutorialDir();
gROOT->ProcessLine(".L " + tutdir + "/tree/JetEvent.cxx+");
gROOT->ProcessLine("#define JETS_SECOND_RUN yes");
gROOT->ProcessLine("#include \"" __FILE__ "\"");
#define f(i)
Definition RSha256.hxx:104
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long long Long64_t
Definition RtypesCore.h:80
int nentries
#define gROOT
Definition TROOT.h:407
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Definition TRandom.cxx:682
Basic string class.
Definition TString.h:139
A TTree represents a columnar dataset.
Definition TTree.h:79
void jets()
Definition jets.C:38
double T(double x)

Definition in file jets.C.

Function Documentation

◆ jets()

void jets ( )

Definition at line 38 of file jets.C.

◆ makeJets()

void makeJets ( int  N_Jets,
REX::REveElement jetHolder 

Definition at line 21 of file jets.C.

Variable Documentation

◆ kR_max

const Double_t kR_max = 250

Definition at line 18 of file jets.C.

◆ kR_min

const Double_t kR_min = 240

Definition at line 17 of file jets.C.

◆ kZ_d

const Double_t kZ_d = 300

Definition at line 19 of file jets.C.