#include "prttools.C" void convertToSimple(TString infile="../build/hits.root", TString outfile="hits_c.root"){ TFile hfile(outfile,"RECREATE"); // Create a ROOT Tree TTree *t2 = new TTree("K","Compact Tree for GSI o.."); Double_t fLeadingEdge= new Double_t[1]; Double_t fTot= new Double_t[1]; UInt_t nTdcId = new UInt_t[1]; UInt_t nTdcChan= new UInt_t[1]; UInt_t nMcpId= new UInt_t[1]; UInt_t nPixel= new UInt_t[1]; UInt_t nRow= new UInt_t[1]; UInt_t nCol= new UInt_t[1]; Bool_t bValid= new UInt_t[1]; t2->Branch("fLeadingEdge",&fLeadingEdge,"fLeadingEdge/D"); t2->Branch("fTot",&fTot,"fTot/D"); t2->Branch("nTdcId",&nTdcId,"nTdcId/I"); t2->Branch("nTdcChan",&nTdcChan,"nTdcChan/I"); t2->Branch("nMcpId",&nMcpId,"nMcpId/I"); t2->Branch("nPixel",&nPixel,"nPixel/I"); t2->Branch("nRow",&nRow,"nRow/I"); t2->Branch("nCol",&nCol,"nCol/I"); t2->Branch("bValid",&bValid,"bValid/O"); PrtInit(infile,0); Int_t angle = 0; for (Int_t ievent=0; ieventGetEntries(); ievent++){ PrtNextEvent(ievent,1000); angle = fEvent->GetAngle() + 0.01; for(Int_t h=0; hGetHitSize(); h++){ fHit = fEvent->GetHit(h); int mcpid = fHit.GetMcpId(); int pixid = fHit.GetPixelId(); mcpid =mcpid%3*5 + mcpid/3; //other layout fLeadingEdge[0] = fHit.GetLeadTime(0)/1000.; fTot[0] = 0; nTdcId[0] = 0; nTdcChan[0] = 0; nMcpId[0] = mcpid; nPixel[0] = pixid; nRow[0] = pixid%8+1; nCol[0] = pixid/8+1; bValid[0] = kTRUE; } t2->Fill(); } hfile.Write(); hfile.Close(); }