File indexing completed on 2023-03-17 10:43:00
0001 {
0002
0003 TFile* f1_out = new TFile("./hcalCorrsFile.root","update");
0004
0005
0006 ifstream respcorrs1("../data/response_corrections.txt");
0007 ifstream respcorrs2("../data/calibConst_IsoTrk_testCone_26.3cm.txt");
0008
0009 TProfile* corrs1 = new TProfile("corrs1", "resresponse_corrections", 84,-42,42);
0010 TProfile* corrs2 = new TProfile("corrs2", "calibConst_IsoTrk_testCone_26.3cm", 84,-42,42);
0011
0012
0013 Int_t iEta;
0014 UInt_t iPhi;
0015 Int_t depth;
0016
0017 string sdName;
0018 UInt_t detId;
0019 Float_t value;
0020
0021 std::string line;
0022
0023 while (getline(respcorrs1, line))
0024 {
0025 if(!line.size() || line[0]=='#') continue;
0026 std::istringstream linestream(line);
0027 linestream >> iEta >> iPhi >> depth >> sdName >> value >> hex >> detId;
0028 if (sdName!="HO" && depth==1) corrs1 -> Fill(iEta, value);
0029 }
0030
0031 while (getline(respcorrs2, line))
0032 {
0033 if(!line.size() || line[0]=='#') continue;
0034 std::istringstream linestream(line);
0035 linestream >> iEta >> iPhi >> depth >> sdName >> value >> hex >> detId;
0036 if (sdName!="HO" && depth==1) corrs2-> Fill(iEta, value);
0037 }
0038
0039 corrs1 -> Write("", TObject::kOverwrite);
0040 corrs2 -> Write("", TObject::kOverwrite);
0041
0042 f1_out->Close();
0043
0044 }