analyse.C 706 Bytes
Newer Older
1 2 3 4 5 6 7
void analyse()
{
	gSystem->Load("../libData.so");

	TFile *f = new TFile("../data/rawDataDSR4/NeuRad_test_07_1.root");
	TTree *tr = (TTree*)f->Get("rtree");

8
	RawEvent *revent = new RawEvent();
9 10 11 12 13 14 15
	tr->SetBranchAddress("rawEvent", &revent);

//	tr->SetMakeClass(1);

	TFile *fw = new TFile("../data/dataDSR4/analysis_07_1.root", "RECREATE");
	TTree *tw = new TTree("drs4analysis", "title of drs4 analysis tree");

16 17 18
	AEvent *wevent = new AEvent();
	wevent->SetInputEvent(&revent);
	tw->Bronch("AEvent", "AEvent", &wevent);
19 20 21 22 23

	Long64_t nentries = tr->GetEntries();
	for(Long64_t i = 0; i < nentries; i++) {
		tr->GetEntry(i);

24
		wevent->ProcessEvent();
25 26 27 28 29 30 31 32 33 34

		tw->Fill();
	}


	tw->Write();
	fw->Close();

	return;
}