diff --git a/macros/runCond/fluenceExtract.C b/macros/runCond/fluenceExtract.C index bf75c41..d60975f 100755 --- a/macros/runCond/fluenceExtract.C +++ b/macros/runCond/fluenceExtract.C @@ -17,18 +17,18 @@ // ROOT include -#include "incBasicROOT.h" -#include "incDrawROOT.h" -#include "incHistROOT.h" -#include "incIOROOT.h" +#include "../../include/incBasicROOT.h" +#include "../../include/incDrawROOT.h" +#include "../../include/incHistROOT.h" +#include "../../include/incIOROOT.h" -#include "basicROOTTools.h" -#include "basicRooFitTools.h" +#include "../../include/basicROOTTools.h" +#include "../../include/basicRooFitTools.h" -#include "lhcbstyle.C" +#include "../../include/lhcbstyle.C" @@ -96,9 +96,9 @@ } - const char* homeVar = std::getenv ("HOME"); + const char* homeVar = std::getenv ("CCEHOME"); const char* diskVar = std::getenv ("DISK"); - TString dn_fluka(Form("%s/cmtuser/Vetra_v13r2/ST/STAging/data/fluka",homeVar)); + TString dn_fluka(Form("%s/data/fluka",homeVar)); TString fn_fluka(Form("%s/fluka.root", dn_fluka.Data())); @@ -115,11 +115,11 @@ TString tn_hit(Form("STHitIntegrator/%s",lay.Data())); - TString dn_lumi(Form("%s/cmtuser/Vetra_v13r2/ST/STAging/data/lumi",homeVar)); + TString dn_lumi(Form("%s/data/lumi",homeVar)); TString fn_lumi(Form("%s/lumi.root", dn_lumi.Data())); - TString dn_out(Form("%s/cmtuser/Vetra_v13r2/ST/STAging/data/db",homeVar)); + TString dn_out(Form("%s/data/db",homeVar)); TString fn_out(Form("%s/fluence.root", dn_out.Data())); @@ -134,8 +134,10 @@ std::vector v_sector; std::vector v_flux7; std::vector v_flux8; + std::vector v_flux13; std::vector v_flux7_e; std::vector v_flux8_e; + std::vector v_flux13_e; while (f_db) { std::string line; @@ -162,13 +164,16 @@ TH2F* h_map7; TH2F* h_map8; + TH2F* h_map13; if (strcmp(det.Data(),"TT")==0) { h_map7 = (TH2F*)f_lumi->Get("h_tt_7"); h_map8 = (TH2F*)f_lumi->Get("h_tt_8"); + h_map13 = (TH2F*)f_lumi->Get("h_tt_13"); }else{ h_map7 = (TH2F*)f_lumi->Get("h_t3_7"); h_map8 = (TH2F*)f_lumi->Get("h_t3_8"); + h_map13 = (TH2F*)f_lumi->Get("h_t3_13"); } TFile* f_hit = TFile::Open(fn_hit.Data()); @@ -193,17 +198,19 @@ TH2F* h_hit8 = (TH2F*)h_hit7->Clone("h_hit8"); + TH2F* h_hit13 = (TH2F*)h_hit7->Clone("h_hit13"); h_hit7->Multiply(h_map7); h_hit8->Multiply(h_map8); + h_hit13->Multiply(h_map13); - if (h_hit7->Integral()<1e-9 && h_hit8->Integral()<1e-9) { + if (h_hit7->Integral()<1e-9 && h_hit8->Integral()<1e-9 && h_hit13->Integral()<1e-9) { Info("fluenceExtract","Negligible flux for sector %d",sec); } - double flux7_v, flux8_v; - double flux7_e, flux8_e; + double flux7_v, flux8_v, flux13_v; + double flux7_e, flux8_e, flux13_e; flux7_v = h_hit7->IntegralAndError(1,h_hit7->GetNbinsX(), @@ -212,6 +219,9 @@ flux8_v = h_hit8->IntegralAndError(1,h_hit8->GetNbinsX(), 1,h_hit8->GetNbinsY(), flux8_e); + flux13_v = h_hit13->IntegralAndError(1,h_hit13->GetNbinsX(), + 1,h_hit13->GetNbinsY(), + flux13_e); if (TMath::IsNaN(flux7_v)) { flux7_v = 0.0; @@ -223,18 +233,28 @@ flux8_e = 0.0; } + if (TMath::IsNaN(flux13_v)) { + flux13_v = 0.0; + flux13_e = 0.0; + } + Info("fluenceExtract","Sector %d:",sec); Printf(" Average flux: %10.7f+/-%10.7f 1-MeV n / cm^{2} collision for 7 TeV", sec,flux7_v,flux7_e); Printf(" Average flux: %10.7f+/-%10.7f 1-MeV n / cm^{2} collision for 8 TeV", sec,flux8_v,flux8_e); + Printf(" Average flux: %10.7f+/-%10.7f 1-MeV n / cm^{2} collision for 13 TeV", + sec,flux13_v,flux13_e); v_flux7.push_back(flux7_v); v_flux7_e.push_back(flux7_e); v_flux8.push_back(flux8_v); v_flux8_e.push_back(flux8_e); + v_flux13.push_back(flux13_v); + v_flux13_e.push_back(flux13_e); delete h_hit7; delete h_hit8; + delete h_hit13; } TFile* f_out = new TFile(fn_out.Data(),"UPDATE"); @@ -244,6 +264,8 @@ TVectorD vr_flux7_e = getROOTVector(v_flux7_e); TVectorD vr_flux8_v = getROOTVector(v_flux8); TVectorD vr_flux8_e = getROOTVector(v_flux8_e); + TVectorD vr_flux13_v = getROOTVector(v_flux13); + TVectorD vr_flux13_e = getROOTVector(v_flux13_e); if (useRadius) { lay+=Form("_r%d",(int)radius); @@ -254,12 +276,16 @@ f_out->Delete(Form("v_flux7_e_%s;*",lay.Data())); f_out->Delete(Form("v_flux8_v_%s;*",lay.Data())); f_out->Delete(Form("v_flux8_e_%s;*",lay.Data())); + f_out->Delete(Form("v_flux13_v_%s;*",lay.Data())); + f_out->Delete(Form("v_flux13_e_%s;*",lay.Data())); vr_sector.Write(Form("v_sector_%s", lay.Data())); vr_flux7_v.Write(Form("v_flux7_v_%s",lay.Data())); vr_flux7_e.Write(Form("v_flux7_e_%s",lay.Data())); vr_flux8_v.Write(Form("v_flux8_v_%s",lay.Data())); vr_flux8_e.Write(Form("v_flux8_e_%s",lay.Data())); + vr_flux13_v.Write(Form("v_flux13_v_%s",lay.Data())); + vr_flux13_e.Write(Form("v_flux13_e_%s",lay.Data())); f_out->Close();