diff --git a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py index 7272f31aa2d91f434f62192388f8a6f166838e35..7798484e354378b204a26063a4835b54faf81e2d 100755 --- a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py +++ b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py @@ -20,6 +20,29 @@ cluster_list = [ ] + +cluster_list_photon = [ + {'name': 'clusterUnconvPhoton', 'title': 'Clusters Unconverted Photons'}, + {'name': 'clusterConvPhoton', 'title': 'Clusters Converted Photons'}, + {'name': 'clusterConvPhotonSi', 'title': 'Clusters Converted Photons - Si'}, + {'name': 'clusterConvPhotonSiSi', 'title': 'Clusters Converted Photons - SiSi'}, + {'name': 'clusterConvPhotonTRT', 'title': 'Clusters Converted Photons - TRT'}, + {'name': 'clusterConvPhotonTRTTRT', 'title': 'Clusters Converted Photons - TRTTRT'}, + {'name': 'clusterConvPhotonSiTRT', 'title': 'Clusters Converted Photons - SiTRT'}, +] + +photon_cluster_list = [ + {'name': 'clusterUnconvPhoton', 'title': 'Clusters Unconverted Photons'}, + {'name': 'clusterConvPhoton', 'title': 'Clusters Converted Photons'}, + {'name': 'clusterConvPhotonSi', 'title': 'Clusters Converted Photons - Si'}, + {'name': 'clusterConvPhotonSiSi', 'title': 'Clusters Converted Photons - SiSi'}, + {'name': 'clusterConvPhotonTRT', 'title': 'Clusters Converted Photons - TRT'}, + {'name': 'clusterConvPhotonTRTTRT', 'title': 'Clusters Converted Photons - TRTTRT'}, + {'name': 'clusterConvPhotonSiTRT', 'title': 'Clusters Converted Photons - SiTRT'}, + +] + + electron_comparison_list = [ {'name': 'showerShapesAll', 'title': 'Shower Shape - Inclusive'}, {'name': 'showerShapes10GeV', 'title': 'Shower Shape - 10 GeV'}, @@ -122,11 +145,14 @@ def make_comparison_plots(type, f_base, f_nightly, result_file): make_ratio_plot(h_base, h_nightly, folder['title'], result_file) -def make_profile_plots(f_base, f_nightly, result_file): +def make_profile_plots(f_base, f_nightly, result_file, particle_type): + + cluster_list_to_loop = cluster_list - for i, folder in enumerate(cluster_list): + if particle_type == "gamma": cluster_list_to_loop = cluster_list + cluster_list_photon + + for i, folder in enumerate(cluster_list_to_loop): for histo in get_key_names(f_nightly, folder['name']): - print(histo) if '2D' not in histo: continue h_base = f_base.Get(folder['name'] + '/' + histo) @@ -136,7 +162,10 @@ def make_profile_plots(f_base, f_nightly, result_file): h_base_profile.SetDirectory(0) h_nightly_profile.SetDirectory(0) - make_ratio_plot(h_base_profile, h_nightly_profile, folder['title'], result_file, "Mean E_{raw}/E_{truth}") + y_axis_label = "Mean %s" % (h_base_profile.GetTitle() ) + h_base_profile.SetTitle("") + + make_ratio_plot(h_base_profile, h_nightly_profile, folder['title'], result_file, y_axis_label) @@ -317,7 +346,7 @@ if __name__ == '__main__': make_comparison_plots(particle_type, baseline_file, nightly_file, output_file) - make_profile_plots(baseline_file, nightly_file, output_file) + make_profile_plots(baseline_file, nightly_file, output_file, particle_type) if particle_type == 'gamma': diff --git a/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py b/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py index 624bf5650be1b963f2a5d746999bc91d2e4a0b5c..cb3fed355cf6d408d885172e2530c2b8bd08e487 100755 --- a/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py +++ b/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py @@ -15,6 +15,23 @@ ToolSvc += MCClassifier # Ouput Message Level svcMgr.MessageSvc.OutputLevel = INFO +Geometry="ATLAS-R2-2016-01-00-01" +from AthenaCommon.GlobalFlags import globalflags +globalflags.DetGeo.set_Value_and_Lock('atlas') +from AthenaCommon.DetFlags import DetFlags +DetFlags.detdescr.all_setOn() +DetFlags.Forward_setOff() +DetFlags.ID_setOff() + +from AthenaCommon.GlobalFlags import jobproperties +jobproperties.Global.DetDescrVersion=Geometry + +from AtlasGeoModel import SetGeometryVersion +from AtlasGeoModel import GeoModelInit +include( "CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py" ) +include( "LArDetDescr/LArDetDescr_joboptions.py" ) + + # ART File testFile = 'Nightly_AOD_'+particleType+'.pool.root' svcMgr.EventSelector.InputCollections = [testFile] diff --git a/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.cxx b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.cxx index c78d4f790cb190fac3cb1714059c41231a55476d..bb42bb965a85d927a4987860ba0ee3579aa71bfe 100644 --- a/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.cxx +++ b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.cxx @@ -12,19 +12,75 @@ StatusCode ClusterHistograms::initializePlots() { histo2DMap["Eraw_Etruth_vs_Etruth_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"Eraw_Etruth_vs_Etruth_2D"), ";E^{truth};E^{raw}/E^{truth}", 100,0.,200.,50, 0.5, 1.5)); histo2DMap["Eraw_Etruth_vs_eta_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"Eraw_Etruth_vs_eta_2D"), ";truth #eta;E^{raw}/E^{truth}", 40, -3, 3, 50, 0.5, 1.5)); + histo2DMap["number_cells_vs_et_in_layer_0_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"number_cells_vs_et_in_layer_0_2D"), "Number of cells;E_{T}", 60,0,300,50, 0,100.)); + histo2DMap["number_cells_vs_et_in_layer_1_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"number_cells_vs_et_in_layer_1_2D"), "Number of cells;E_{T}", 60,0,300,50, 0,100.)); + histo2DMap["number_cells_vs_et_in_layer_2_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"number_cells_vs_et_in_layer_2_2D"), "Number of cells;E_{T}", 60,0,300,50, 0,100.)); + histo2DMap["number_cells_vs_et_in_layer_3_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"number_cells_vs_et_in_layer_3_2D"), "Number of cells;E_{T}", 600,0,300,50, 0,100.)); + + histo2DMap["number_cell_in_layer"] = (new TH2D(Form("%s_%s",m_name.c_str(),"number_cell_in_layer"), ";Number of cells;Layer",100,0,200, 4,0,4)); + + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"Eraw_Etruth_vs_Etruth_2D", histo2DMap["Eraw_Etruth_vs_Etruth_2D"])); ATH_CHECK(m_rootHistSvc->regHist(m_folder+"Eraw_Etruth_vs_eta_2D", histo2DMap["Eraw_Etruth_vs_eta_2D"])); + + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"number_cells_vs_et_in_layer_0_2D", histo2DMap["number_cells_vs_et_in_layer_0_2D"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"number_cells_vs_et_in_layer_1_2D", histo2DMap["number_cells_vs_et_in_layer_1_2D"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"number_cells_vs_et_in_layer_2_2D", histo2DMap["number_cells_vs_et_in_layer_2_2D"])); + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"number_cells_vs_et_in_layer_3_2D", histo2DMap["number_cells_vs_et_in_layer_3_2D"])); + + + ATH_CHECK(m_rootHistSvc->regHist(m_folder+"number_cell_in_layer", histo2DMap["number_cell_in_layer"])); + + + + return StatusCode::SUCCESS; } // initializePlots void ClusterHistograms::fill(const xAOD::Egamma& egamma) { + fill(egamma,0.); +} + +void ClusterHistograms::fill(const xAOD::Egamma& egamma, float mu = 0) { + + (void)mu; const xAOD::CaloCluster *cluster = egamma.caloCluster(); + const xAOD::TruthParticle *truth_egamma = xAOD::TruthHelpers::getTruthParticle(egamma); - if (truth_egamma) { - histo2DMap["Eraw_Etruth_vs_Etruth_2D"]->Fill(truth_egamma->e()/1000,cluster->rawE()/truth_egamma->e()); - histo2DMap["Eraw_Etruth_vs_eta_2D"]->Fill(truth_egamma->eta(),cluster->rawE()/truth_egamma->e()); + + if ( !truth_egamma ) return; + + histo2DMap["Eraw_Etruth_vs_Etruth_2D"]->Fill(truth_egamma->e()/1000,cluster->rawE()/truth_egamma->e()); + histo2DMap["Eraw_Etruth_vs_eta_2D"]->Fill(truth_egamma->eta(),cluster->rawE()/truth_egamma->e()); + + + const CaloClusterCellLink* cellLinks = cluster->getCellLinks(); + + if ( !cellLinks ) return; + + std::map<int, int > cells_per_layer; + + CaloClusterCellLink::const_iterator it_cell=cellLinks->begin(); + CaloClusterCellLink::const_iterator it_cell_e=cellLinks->end(); + for(;it_cell!=it_cell_e;++it_cell) { + + + const CaloCell* cell = (*it_cell); + + if (cell) { + int layer = cell->caloDDE()->getLayer(); + cells_per_layer[layer]++; + + } + + } + + for (auto const& x : cells_per_layer) { + histo2DMap["number_cell_in_layer"]->Fill(x.second,x.first); + histo2DMap["number_cells_vs_et_in_layer_"+std::to_string(x.first)+"_2D"]->Fill(truth_egamma->e()/1000, x.second); } + } diff --git a/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.h b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.h index 9c9e4ee087e942a85ee5898fa7fe668c8d3877fb..c40368a57bd889aa5023aa7bbb78297c654bfcbd 100644 --- a/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.h +++ b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.h @@ -13,6 +13,7 @@ #include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h" #include "TH1.h" #include "TH2.h" +#include "TH3.h" namespace egammaMonitoring{ @@ -32,9 +33,11 @@ namespace egammaMonitoring{ std::map<std::string, TH1D* > histoMap; std::map<std::string, TH2D* > histo2DMap; + std::map<std::string, TH3D* > histo3DMap; StatusCode initializePlots(); void fill(const xAOD::Egamma& egamma); + void fill(const xAOD::Egamma& egamma, float mu); protected: std::string m_name; diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx index 3fd5b9004d2271df0c0cbd0cf30ae844390707e5..9d637b529a06bcf4fb8386da0968711f6dbef127 100644 --- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx +++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx @@ -121,6 +121,29 @@ StatusCode EgammaMonitoring::initialize() { recoPhotonAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::RecoPhotonHistograms( "recoPhotonAll","Reco Photon", "/MONITORING/recoPhotonAll/", rootHistSvc)); + clusterConvPhoton = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms( + "clusterConvPhoton","Clusters from Converted Photons", "/MONITORING/clusterConvPhoton/", rootHistSvc)); + + clusterConvPhotonSi = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms( + "clusterConvPhotonSi","Clusters from Converted Photons - Si", "/MONITORING/clusterConvPhotonSi/", rootHistSvc)); + + clusterConvPhotonSiSi = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms( + "clusterConvPhotonSiSi","Clusters from Converted Photons - SiSi", "/MONITORING/clusterConvPhotonSiSi/", rootHistSvc)); + + clusterConvPhotonTRT = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms( + "clusterConvPhotonTRT","Clusters from Converted Photons - TRT", "/MONITORING/clusterConvPhotonTRT/", rootHistSvc)); + + clusterConvPhotonTRTTRT = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms( + "clusterConvPhotonTRTTRT","Clusters from Converted Photons - TRTTRT", "/MONITORING/clusterConvPhotonTRTTRT/", rootHistSvc)); + + clusterConvPhotonSiTRT = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms( + "clusterConvPhotonSiTRT","Clusters from Converted Photons - SiTRT", "/MONITORING/clusterConvPhotonSiTRT/", rootHistSvc)); + + + clusterUnconvPhoton = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms( + "clusterUnconvPhoton","Clusters from Converted Photons", "/MONITORING/clusterUnconvPhoton/", rootHistSvc)); + + truthPhotonRecoPhoton = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms( "truthPhotonRecoPhoton","truthPhotonRecoPhoton", "/MONITORING/truthPhotonRecoPhoton/", rootHistSvc)); @@ -196,6 +219,14 @@ StatusCode EgammaMonitoring::initialize() { ATH_CHECK(recoPhotonConvIsoFixedCutTightCaloOnly->initializePlots()); ATH_CHECK(recoPhotonConvIsoFixedCutLoose->initializePlots()); + ATH_CHECK(clusterConvPhoton->initializePlots()); + ATH_CHECK(clusterConvPhotonSi->initializePlots()); + ATH_CHECK(clusterConvPhotonSiSi->initializePlots()); + ATH_CHECK(clusterConvPhotonTRT->initializePlots()); + ATH_CHECK(clusterConvPhotonTRTTRT->initializePlots()); + ATH_CHECK(clusterConvPhotonSiTRT->initializePlots()); + ATH_CHECK(clusterUnconvPhoton->initializePlots()); + } // gamma Hists @@ -585,17 +616,33 @@ StatusCode EgammaMonitoring::execute() { truthPhotonConvRecoConv->fill(*egtruth); - if (convType == xAOD::EgammaParameters::singleSi) truthPhotonConvRecoConv1Si->fill(*egtruth); - if (convType == xAOD::EgammaParameters::singleTRT) truthPhotonConvRecoConv1TRT->fill(*egtruth); - if (convType == xAOD::EgammaParameters::doubleSi) truthPhotonConvRecoConv2Si->fill(*egtruth); - if (convType == xAOD::EgammaParameters::doubleTRT) truthPhotonConvRecoConv2TRT->fill(*egtruth); - if (convType == xAOD::EgammaParameters::doubleSiTRT) truthPhotonConvRecoConv2SiTRT->fill(*egtruth); + clusterConvPhoton->fill(*photon); + + if (convType == xAOD::EgammaParameters::singleSi) { + truthPhotonConvRecoConv1Si->fill(*egtruth); + clusterConvPhotonSi->fill(*photon); + } else if (convType == xAOD::EgammaParameters::singleTRT) { + truthPhotonConvRecoConv1TRT->fill(*egtruth); + clusterConvPhotonTRT->fill(*photon); + } else if (convType == xAOD::EgammaParameters::doubleSi) { + truthPhotonConvRecoConv2Si->fill(*egtruth); + clusterConvPhotonSiSi->fill(*photon); + } else if (convType == xAOD::EgammaParameters::doubleTRT) { + truthPhotonConvRecoConv2TRT->fill(*egtruth); + clusterConvPhotonTRTTRT->fill(*photon); + } else if (convType == xAOD::EgammaParameters::doubleSiTRT) { + truthPhotonConvRecoConv2SiTRT->fill(*egtruth); + clusterConvPhotonSiTRT->fill(*photon); + } if (m_IsoFixedCutTight->accept(*photon)) recoPhotonConvIsoFixedCutTight->fill(*egtruth); if (m_IsoFixedCutTightCaloOnly->accept(*photon)) recoPhotonConvIsoFixedCutTightCaloOnly->fill(*egtruth); if (m_IsoFixedCutLoose->accept(*photon)) recoPhotonConvIsoFixedCutLoose->fill(*egtruth); } // isRecoConv - else truthPhotonConvRecoUnconv->fill(*egtruth); + else { + truthPhotonConvRecoUnconv->fill(*egtruth); + clusterUnconvPhoton->fill(*photon); + } } //isTrueConv else if (!isTrueLateConv) { diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h index 868af6ba57067bf785f4492809ff14bdc1e3250c..fce824cd43624f0f065e19a4f2c19f3c85a7084f 100644 --- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h +++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h @@ -69,6 +69,14 @@ class EgammaMonitoring : public AthAlgorithm std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterPromptAll; std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterPrompt10GeV; + std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterConvPhoton; + std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterConvPhotonSi; + std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterConvPhotonSiSi; + std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterConvPhotonTRT; + std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterConvPhotonTRTTRT; + std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterConvPhotonSiTRT; + std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterUnconvPhoton; + std::unique_ptr<egammaMonitoring::ShowerShapesHistograms> showerShapesAll; std::unique_ptr<egammaMonitoring::ShowerShapesHistograms> showerShapes10GeV;