char rootfile[32]; int eta[56] = {-30,-30,-30,-30,-32,-32,-32,-32,-34,-34,-34,-34,-36,-36,-36,-36,-38,-38,-38,-38,-40,-40,-40,-40,-41,-41,-41,-41,30,30,30,30,32,32,32,32,34,34,34,34,36,36,36,36,38,38,38, 38,40,40,40,40,41,41,41,41}; int phi[56] = {15,35,51,71,15,35,51,71,15,35,51,71,15,35,51,71,15,35,51,71,15,35,51,71,15,35,51,71,1,21,37,57,1,21,37,57,1,21,37,57,1,21,37,57,1,21,37,57,19,35,55,71,19,35,55,71}; int depth[56] = {2,1,2,1,1,2,1,2,2,1,2,1,1,2,1,2,2,1,2,1,1,2,1,2,2,1,2,1,2,1,2,1,1,2,1,2,2,1,2,1,1,2,1,2,2,1,2,1,2,1,2,1,1,2,1,2}; int i =0; void test1(int runNo){ sprintf(rootfile,"calibPulseShapes_%d.root",runNo); TFile *f = new TFile(rootfile); TString name = "Run-"; name+=runNo; name+=".root"; TFile *h = new TFile(name,"RECREATE"); for(i=0;i==55;i++){ TString label = "calibPulseShapes/HF_eta"; label+=eta[i]; label+="_phi"; label+=phi[i]; label+="_depth"; label+=depth[i]; label+="_chanNo=32767"; TH1F *hHFR = (TH1F*)f->Get(label); hHFR->Write("Chan_%d",i); } }