Ok I have created a .root file having Tree with leaves and branches. But this I have created using
TFile *f = new TFile("232Th_280MeV_2.001", "READ");
TTree *RoseNIAS = (TTree* )f->Get("RoseNIAS");
Double_t ADC01_ADC[32];
Double_t ADC02_ADC[32];
Double_t TDC01_TDC[32]; //RoseNIAS is the name of tree
RoseNIAS->SetBranchAddress("ADC01.ADC",ADC01_ADC);
RoseNIAS->SetBranchAddress("ADC02.ADC",ADC02_ADC);
RoseNIAS->SetBranchAddress("TDC01.TDC",TDC01_TDC);
TFile *ff = new TFile("232Th_280MeV_2.root","RECREATE");
TTree *FissionTree = new TTree("FissionTree", "having all the leaves");
UShort_t P8009,P8027,P8045,P8063,P8081,P8099,P8117,P8135,P8207,P8225;
UShort_t E8009,E8027,E8045,E8063,E8081,E8099,E8117,E8135,E8207,E8225;
UShort_t T8009,T8027,T8045,T8063,T8081,T8099,T8117,T8135,T8207,T8225;
Long64_t i,j,entries;
FissionTree->Branch("P8009",&P8009,"P8009/s");
FissionTree->Branch("P8027",&P8027,"P8027/s");
FissionTree->Branch("P8045",&P8045,"P8045/s");
FissionTree->Branch("P8063",&P8063,"P8063/s");
FissionTree->Branch("P8081",&P8081,"P8081/s");
so on… and then
for(i=0;i<entries;i++)
{
RoseNIAS->GetEntry(i);
if (!(i%50000)) printf("Percentage done=%.1f\n",100.0*i/entries);
P8009=ADC01_ADC[0]; E8009=ADC01_ADC[1]; T8009=TDC01_TDC[0];
.
.
.
In the last
FissionTree->Fill();
}
ff->Write();
ff->Close();
filling the tree and the writing.
I want to know is there any way in which I can use this tree to generate histograms further into a root file.
Also suppose I want to add some channels in timing “T8009”. How can I do that???