// --------------------------------------------------------------------- // ----- make_tree macro ----- // ----- Created 10/11/13 by P. Pawlowski ----- // ----- ----- // ----- 03/12/13 SK:depricated ----- // ----- This code is no longer supported in frame of asyeosroot ----- // ----- platform. TODO: to remove in once a nice day. ----- // --------------------------------------------------------------------- #include "ASYEvent_reduced.hxx" #include "KrattaEvent.hxx" #include "Swiatowid.hxx" #include "TString.h" #include "TFile.h" #include "TTree.h" #include "Progress.h" void LoadEvent(ASYEvent * event_in, KrattaEvent * event_out){ static Swiatowid S; event_out->Clear(); for(int ipeak = 0; ipeak < event_in->npeak; ipeak++) S.Analyze(event_in->Peak(ipeak),event_out->AddParticle()); } void make_tree(TString filename_in, TString filename_out){ /// Input tree TFile file_in(filename_in); TTree * tree_in = (TTree *)file_in.Get("ntuple"); ASYEvent * event_in = new ASYEvent; tree_in->SetBranchAddress("eventdst", &event_in); int Nev = tree_in->GetEntries(); /// Output tree TFile file_out(filename_out,"recreate"); TTree * tree_out = new TTree("tree","Kratta physical data"); KrattaEvent * event_out = new KrattaEvent; tree_out->Branch("event", &event_out); Progress prog(Nev); for(int iev = 0; iev < Nev; iev++){ /// loop over events tree_in->GetEntry(iev); prog.Write(iev); LoadEvent(event_in, event_out); tree_out->Fill(); }/// end loop over events file_out.Write(); file_out.Close(); file_in.Close(); }