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");
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 ) {
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
virtual Int_t Fill()
Fill all branches.
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 *="")
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
R__EXTERN TSystem * gSystem
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
A TTree object has a header with a name and a title.