17#ifndef CLONESA_EVENT_SECOND_RUN
20 std::string
s1(__FILE__);
22 gROOT->ProcessLine(
TString(
".L ")+dir+
"/clonesA_Event.cxx+");
23#define CLONESA_EVENT_SECOND_RUN yes
24 gROOT->ProcessLine(
"#include \"" __FILE__
"\"");
25 gROOT->ProcessLine(
"clonesA_Event(true)");
33 if (
gROOT->GetVersionInt() < 30503 ) {
34 cout <<
"Works only with ROOT version >= 3.05/03" << endl;
37 if (
gROOT->GetVersionDate() < 20030406 ) {
38 cout <<
"Works only with ROOT CVS version after 5. 4. 2003" << endl;
43 TFile *hfile =
new TFile(
"clonesA_Event.root",
"RECREATE",
"Test TClonesArray");
44 TTree *
tree =
new TTree(
"clonesA_Event",
"An example of a ROOT tree");
47 tree->Branch(
"top1",
"TUsrSevtData1",&event1,8000,99);
48 tree->Branch(
"top2",
"TUsrSevtData2",&event2,8000,99);
49 for (
Int_t ev = 0; ev < 10; ev++) {
50 cout <<
"event " << ev << endl;
54 if (ev <3)
tree->Show(ev);
64 TFile * hfile =
new TFile(
"clonesA_Event.root");
69 tree->SetBranchAddress(
"top1",&event1);
70 tree->SetBranchAddress(
"top2",&event2);
71 for (
Int_t ev = 0; ev < 8; ev++) {
73 cout <<
"Pileup event1: " << event1->
GetPileup() << endl;
74 cout <<
"Pileup event2: " << event2->
GetPileup() << endl;
82void clonesA_Event(
bool ) {
R__EXTERN TSystem * gSystem
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
void Clear(Option_t *="")
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
A TTree represents a columnar dataset.