17 #ifndef CLONESA_EVENT_SECOND_RUN 19 void clonesA_Event() {
21 gROOT->ProcessLine(
TString(
".L ")+dir+
"/clonesA_Event.cxx+");
22 #define CLONESA_EVENT_SECOND_RUN yes 23 gROOT->ProcessLine(
"#include \"" __FILE__
"\"");
24 gROOT->ProcessLine(
"clonesA_Event(true)");
29 void clonesA_Event_w()
32 if (
gROOT->GetVersionInt() < 30503 ) {
33 cout <<
"Works only with ROOT version >= 3.05/03" << endl;
36 if (
gROOT->GetVersionDate() < 20030406 ) {
37 cout <<
"Works only with ROOT CVS version after 5. 4. 2003" << endl;
42 TFile *hfile =
new TFile(
"clonesA_Event.root",
"RECREATE",
"Test TClonesArray");
43 TTree *
tree =
new TTree(
"clonesA_Event",
"An example of a ROOT tree");
46 tree->Branch(
"top1",
"TUsrSevtData1",&event1,8000,99);
47 tree->Branch(
"top2",
"TUsrSevtData2",&event2,8000,99);
48 for (
Int_t ev = 0; ev < 10; ev++) {
49 cout <<
"event " << ev << endl;
53 if (ev <3)
tree->Show(ev);
60 void clonesA_Event_r()
63 TFile * hfile =
new TFile(
"clonesA_Event.root");
68 tree->SetBranchAddress(
"top1",&event1);
69 tree->SetBranchAddress(
"top2",&event2);
70 for (
Int_t ev = 0; ev < 8; ev++) {
72 cout <<
"Pileup event1: " << event1->
GetPileup() << endl;
73 cout <<
"Pileup event2: " << event2->
GetPileup() << endl;
81 void clonesA_Event(
bool ) {
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
void Clear(Option_t *="")
R__EXTERN TSystem * gSystem
A TTree object has a header with a name and a title.