diff --git a/.gitignore b/.gitignore index 7ab63d841..6593f57f4 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,9 @@ tramp .project .settings/ +# Mac files +.DS_Store + # Ignore build and install dirs build/ install/ diff --git a/analysis/include/SimPartHistos.h b/analysis/include/SimPartHistos.h new file mode 100644 index 000000000..47a8dc5d4 --- /dev/null +++ b/analysis/include/SimPartHistos.h @@ -0,0 +1,49 @@ +#ifndef SIMPARTHISTOS_H +#define SIMPARTHISTOS_H + +// ROOT +#include "TLorentzVector.h" + +// HPSTR +#include "HistoManager.h" +#include "MCParticle.h" +#include "MCTrackerHit.h" +#include "MCEcalHit.h" +#include "Track.h" +#include "TrackerHit.h" +#include "CalCluster.h" +#include "FlatTupleMaker.h" +#include +#include +#include + +/** + * @brief description + * + * details + */ +class SimPartHistos : public HistoManager { + + public: + /** + * @brief Constructor + * + * @param inputName + */ + SimPartHistos(const std::string& inputName) : HistoManager(inputName) { m_name = inputName; }; + + /** + * @brief description + * + * @param MCParticles + * @param RecoTracks + * @param RecoTrackerClusters + * @param RecoEcalClusters + * @param weight + */ + void FillMCParticle(MCParticle* part, FlatTupleMaker* tuples = nullptr, float weight = 1.); + void FillRecoTrack(Track* track, FlatTupleMaker* tuples = nullptr, float weight = 1.); + void FillRecoEcalCuster(CalCluster* ecal_cluster, FlatTupleMaker* tuples = nullptr, float weight = 1.); +}; + +#endif //SIMPARTHISTOS_H diff --git a/analysis/plotconfigs/mc/simPart.json b/analysis/plotconfigs/mc/simPart.json new file mode 100644 index 000000000..6044399bd --- /dev/null +++ b/analysis/plotconfigs/mc/simPart.json @@ -0,0 +1,590 @@ +{ + "numMCparts_h" : { + "bins" : 50, + "minX" : -0.5, + "maxX" : 49.5, + "xtitle" : "Number of Sim Particles", + "ytitle" : "Events" + }, + "numRecoTracks_h" : { + "bins" : 10, + "minX" : -0.5, + "maxX" : 9.5, + "xtitle" : "Number of Reco Tracks", + "ytitle" : "Events" + }, + "numSimTrackerHits_h" : { + "bins" : 60, + "minX" : -0.5, + "maxX" : 59.5, + "xtitle" : "Number of Sim Tracker Hits", + "ytitle" : "Events" + }, + "numRecoTrackerClusters_h" : { + "bins" : 30, + "minX" : -0.5, + "maxX" : 29.5, + "xtitle" : "Number of Reco Tracker Clusters", + "ytitle" : "Events" + }, + "numSimEcalHits_h" : { + "bins" : 20, + "minX" : -0.5, + "maxX" : 19.5, + "xtitle" : "Number of Sim Ecal Hits", + "ytitle" : "Events" + }, + "numRecoEcalClusters_h" : { + "bins" : 10, + "minX" : -0.5, + "maxX" : 9.5, + "xtitle" : "Number of Reco Ecal Clusters", + "ytitle" : "Events" + }, + "sim_pdgid_h" : { + "bins" : 60, + "minX" : -30, + "maxX" : 30, + "xtitle" : "PDG ID of Sim Particles", + "ytitle" : "Events" + }, + "sim_px_h" : { + "bins" : 60, + "minX" : -6, + "maxX" : 6, + "xtitle" : "sim p_{x}", + "ytitle" : "Events" + }, + "sim_py_h" : { + "bins" : 60, + "minX" : -6, + "maxX" : 6, + "xtitle" : "sim p_{y}", + "ytitle" : "Events" + }, + "sim_pz_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 10, + "xtitle" : "sim p_{z}", + "ytitle" : "Events" + }, + "sim_p_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 10, + "xtitle" : "sim p", + "ytitle" : "Events" + }, + "sim_pxpz_h" : { + "bins" : 200, + "minX" : -0.8, + "maxX" : 0.8, + "xtitle" : "sim p_{x}/p_{z}", + "ytitle" : "Events" + }, + "sim_pypz_h" : { + "bins" : 50, + "minX" : -0.2, + "maxX" : 0.2, + "xtitle" : "sim p_{y}/p_{z}", + "ytitle" : "Events" + }, + "sim_energy_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 10, + "xtitle" : "sim energy", + "ytitle" : "Events" + }, + "track_n_hits_h" : { + "bins" : 20, + "minX" : -0.5, + "maxX" : 19.5, + "xtitle" : "Track nr. of hits", + "ytitle" : "Events" + }, + "track_px_h" : { + "bins" : 60, + "minX" : -6, + "maxX" : 6, + "xtitle" : "Track p_{x}", + "ytitle" : "Events" + }, + "track_py_h" : { + "bins" : 60, + "minX" : -6, + "maxX" : 6, + "xtitle" : "Track p_{y}", + "ytitle" : "Events" + }, + "track_pz_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 10, + "xtitle" : "Track p_{z}", + "ytitle" : "Events" + }, + "track_p_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 10, + "xtitle" : "Track p", + "ytitle" : "Events" + }, + "track_phi0_h" : { + "bins" : 200, + "minX" : -0.8, + "maxX" : 0.8, + "xtitle" : "Track #phi_{0}", + "ytitle" : "Events" + }, + "track_tanlambda_h" : { + "bins" : 50, + "minX" : -0.2, + "maxX" : 0.2, + "xtitle" : "Track tan#lambda", + "ytitle" : "Events" + }, + "track_d0_h" : { + "bins" : 40, + "minX" : -20, + "maxX" : 20, + "xtitle" : "Track d_{0}", + "ytitle" : "Events" + }, + "track_z0_h" : { + "bins" : 40, + "minX" : -20, + "maxX" : 20, + "xtitle" : "Track z_{0}", + "ytitle" : "Events" + }, + "track_omega_h" : { + "bins" : 30, + "minX" : -0.003, + "maxX" : 0.003, + "xtitle" : "Track #Omega", + "ytitle" : "Events" + }, + "track_ecal_x_h" : { + "bins" : 100, + "minX" : -600, + "maxX" : 600, + "xtitle" : "Track ECal Position x", + "ytitle" : "Events" + }, + "track_ecal_y_h" : { + "bins" : 50, + "minX" : -200, + "maxX" : 200, + "xtitle" : "Track ECal Position y", + "ytitle" : "Events" + }, + "track_hit_layer_h" : { + "bins" : 14, + "minX" : 0.5, + "maxX" : 14.5, + "xtitle" : "Track Hit Layer", + "ytitle" : "Events" + }, + "ecal_n_hits_h" : { + "bins" : 20, + "minX" : -0.5, + "maxX" : 19.5, + "xtitle" : "ECal nr. of hits", + "ytitle" : "Events" + }, + "ecal_energy_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 10, + "xtitle" : "ECal energy", + "ytitle" : "Events" + }, + "ecal_energy_zoom_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 2, + "xtitle" : "ECal energy", + "ytitle" : "Events" + }, + "ecal_x_h" : { + "bins" : 200, + "minX" : -340, + "maxX" : 420, + "xtitle" : "Ecal cluster x", + "ytitle" : "Events" + }, + "ecal_y_h" : { + "bins" : 50, + "minX" : -100, + "maxX" : 100, + "xtitle" : "Ecal cluster y", + "ytitle" : "Events" + }, + "track_ecal_x_diff_h" : { + "bins" : 1000, + "minX" : -100, + "maxX" : 100, + "xtitle" : "Track (at ECal) x - Ecal x", + "ytitle" : "Events" + }, + "sim_track_x_diff_h" : { + "bins" : 1000, + "minX" : -100, + "maxX" : 100, + "xtitle" : "Track x - Sim x (at ECal)", + "ytitle" : "Events" + }, + "sim_track_atlasthit_x_diff_h" : { + "bins" : 1000, + "minX" : -20, + "maxX" : 20, + "xtitle" : "Track x (at At Last Hit) - Sim x (at At Last Hit)", + "ytitle" : "Events" + }, + "sim_track_atlasthit_y_diff_h" : { + "bins" : 1000, + "minX" : -20, + "maxX" : 20, + "xtitle" : "Track y (at At Last Hit) - Sim y (at At Last Hit)", + "ytitle" : "Events" + }, + "sim_track_atlasthit_z_diff_h" : { + "bins" : 1000, + "minX" : -20, + "maxX" : 20, + "xtitle" : "Track z (at At Last Hit) - Sim z (at At Last Hit)", + "ytitle" : "Events" + }, + "sim_track_atlasthit_p_diff_h" : { + "bins" : 100, + "minX" : -1, + "maxX" : 1, + "xtitle" : "Track p (at At Last Hit) - Sim p (at At Last Hit)", + "ytitle" : "Events" + }, + "sim_track_atlasthit_px_diff_h" : { + "bins" : 100, + "minX" : -1, + "maxX" : 1, + "xtitle" : "Track px (at At Last Hit) - Sim px (at At Last Hit)", + "ytitle" : "Events" + }, + "sim_track_atlasthit_py_diff_h" : { + "bins" : 100, + "minX" : -1, + "maxX" : 1, + "xtitle" : "Track py (at At Last Hit) - Sim py (at At Last Hit)", + "ytitle" : "Events" + }, + "sim_track_atlasthit_pz_diff_h" : { + "bins" : 100, + "minX" : -1, + "maxX" : 1, + "xtitle" : "Track pz (at At Last Hit) - Sim pz (at At Last Hit)", + "ytitle" : "Events" + }, + "sim_ecal_x_diff_h" : { + "bins" : 1000, + "minX" : -100, + "maxX" : 100, + "xtitle" : "Ecal x - Sim x (at ECal) x", + "ytitle" : "Events" + }, + "track_phi0_simpxpz_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 2, + "xtitle" : "Track #phi_{0} / Sim p_{x}/p_{z}", + "ytitle" : "Events" + }, + "track_tanlambda_simpypz_h" : { + "bins" : 50, + "minX" : 0, + "maxX" : 2, + "xtitle" : "Track tan#lambda / Sim p_{y}/p_{z}", + "ytitle" : "Events" + }, + "sim_pxpz_pypz_hh" : { + "binsX" : 200, + "minX" : -0.8, + "maxX" : 0.8, + "binsY" : 50, + "minY" : -0.2, + "maxY" : 0.2, + "xtitle" : "sim p_{x}/p_{z}", + "ytitle" : "sim p_{y}/p_{z}" + }, + "sim_pxpz_p_hh" : { + "binsX" : 100, + "minX" : -0.8, + "maxX" : 0.8, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "sim p_{x}/p_{z}", + "ytitle" : "sim p" + }, + "sim_pxpz_energy_hh" : { + "binsX" : 100, + "minX" : -0.8, + "maxX" : 0.8, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "sim p_{x}/p_{z}", + "ytitle" : "sim energy" + }, + "track_sim_p_sim_p_hh" : { + "binsX" : 100, + "minX" : 0, + "maxX" : 2, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "track p / sim p", + "ytitle" : "sim p" + }, + "track_phi0_p_hh" : { + "binsX" : 200, + "minX" : -0.8, + "maxX" : 0.8, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track #phi_{0}", + "ytitle" : "Track p" + }, + "track_phi0_tanlambda_hh" : { + "binsX" : 200, + "minX" : -0.8, + "maxX" : 0.8, + "binsY" : 50, + "minY" : -0.2, + "maxY" : 0.2, + "xtitle" : "Track #phi_{0}", + "ytitle" : "Track tan#lambda" + }, + "track_z0_tanlambda_hh" : { + "binsX" : 10, + "minX" : -20, + "maxX" : 20, + "binsY" : 50, + "minY" : -0.2, + "maxY" : 0.2, + "xtitle" : "Track z_{0}", + "ytitle" : "Track tan#lambda" + }, + "track_ecal_x_y_hh" : { + "binsX" : 100, + "minX" : -600, + "maxX" : 600, + "binsY" : 50, + "minY" : -200, + "maxY" : 200, + "xtitle" : "Track (at ECal) x", + "ytitle" : "Track (at ECal) y" + }, + "ecal_x_y_hh" : { + "binsX" : 100, + "minX" : -340, + "maxX" : 420, + "binsY" : 50, + "minY" : -100, + "maxY" : 100, + "xtitle" : "Ecal cluster x", + "ytitle" : "Ecal cluster y" + }, + "track_ecal_x_track_p_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at ECal) x - Ecal x", + "ytitle" : "Track p" + }, + "track_ecal_x_sim_p_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at ECal) x - Ecal x", + "ytitle" : "sim p" + }, + "track_ecal_x_ecal_energy_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at ECal) x - Ecal x", + "ytitle" : "Ecal energy" + }, + "sim_track_x_track_p_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at ECal) x - Sim x (at ECal)", + "ytitle" : "Track p" + }, + "sim_track_x_sim_p_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at ECal) x - Sim x (at ECal)", + "ytitle" : "sim p" + }, + "sim_track_x_ecal_energy_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at ECal) x - Sim x (at ECal)", + "ytitle" : "Ecal energy" + }, + "sim_track_atlasthit_x_track_p_hh" : { + "binsX" : 1000, + "minX" : -20, + "maxX" : 20, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at Last Hit) x - Sim x (at Last Hit)", + "ytitle" : "Track p" + }, + "sim_track_atlasthit_x_sim_p_hh" : { + "binsX" : 1000, + "minX" : -20, + "maxX" : 20, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at Last Hit) x - Sim x (at Last Hit)", + "ytitle" : "sim p" + }, + "sim_track_atlasthit_x_ecal_energy_hh" : { + "binsX" : 1000, + "minX" : -20, + "maxX" : 20, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at Last Hit) x - Sim x (at Last Hit)", + "ytitle" : "Ecal energy" + }, + "sim_track_atlasthit_px_track_p_hh" : { + "binsX" : 100, + "minX" : -1, + "maxX" : 1, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at Last Hit) px - Sim px (at Last Hit)", + "ytitle" : "Track p" + }, + "sim_track_atlasthit_px_sim_p_hh" : { + "binsX" : 100, + "minX" : -1, + "maxX" : 1, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at Last Hit) px - Sim px (at Last Hit)", + "ytitle" : "sim p" + }, + "sim_track_atlasthit_px_ecal_energy_hh" : { + "binsX" : 100, + "minX" : -1, + "maxX" : 1, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track (at Last Hit) px - Sim px (at Last Hit)", + "ytitle" : "Ecal energy" + }, + "sim_ecal_x_track_p_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Ecal x - Sim x (at ECal)", + "ytitle" : "Track p" + }, + "sim_ecal_x_sim_p_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Ecal x - Sim x (at ECal)", + "ytitle" : "sim p" + }, + "sim_ecal_x_ecal_energy_hh" : { + "binsX" : 1000, + "minX" : -100, + "maxX" : 100, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Ecal x - Sim x (at ECal)", + "ytitle" : "Ecal energy" + }, + "track_phi0_simpxpz_tanlambda_simpypz_hh" : { + "binsX" : 50, + "minX" : 0, + "maxX" : 2, + "binsY" : 50, + "minY" : 0, + "maxY" : 2, + "xtitle" : "Track #phi_{0} / Sim p_{x}/p_{z}", + "ytitle" : "Track tan#lambda / Sim p_{y}/p_{z}" + }, + "track_phi0_simpxpz_sim_p_hh" : { + "binsX" : 50, + "minX" : 0, + "maxX" : 2, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track #phi_{0} / Sim p_{x}/p_{z}", + "ytitle" : "Sim p" + }, + "track_tanlambda_simpypz_sim_p_hh" : { + "binsX" : 50, + "minX" : 0, + "maxX" : 2, + "binsY" : 20, + "minY" : 0, + "maxY" : 10, + "xtitle" : "Track tan#lambda / Sim p_{y}/p_{z}", + "ytitle" : "Sim p" + }, + "track_ecal_x_ecal_x_hh" : { + "binsX" : 100, + "minX" : -600, + "maxX" : 600, + "binsY" : 1000, + "minY" : -100, + "maxY" : 100, + "xtitle" : "ECal x", + "ytitle" : "Track (at ECal) x - Ecal x" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track.json b/analysis/selections/simPart/1Sim_1Track.json new file mode 100644 index 000000000..b4c38ce9e --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track.json @@ -0,0 +1,12 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1, + "id" : 1, + "info" : "N Tracks == 1" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal.json b/analysis/selections/simPart/1Sim_1Track_1Ecal.json new file mode 100644 index 000000000..bada1eeca --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal.json @@ -0,0 +1,17 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_0_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_0_bottom.json new file mode 100644 index 000000000..62c74cf0e --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_0_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 0, + "id" : 3, + "info" : "Track Last Layer == 0" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_0_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_0_top.json new file mode 100644 index 000000000..7eee8e3a6 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_0_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 0, + "id" : 3, + "info" : "Track Last Layer == 0" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_10_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_10_bottom.json new file mode 100644 index 000000000..300833032 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_10_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 10, + "id" : 3, + "info" : "Track Last Layer == 10" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_10_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_10_top.json new file mode 100644 index 000000000..d4fe7d603 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_10_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 10, + "id" : 3, + "info" : "Track Last Layer == 10" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_11_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_11_bottom.json new file mode 100644 index 000000000..edd321b7b --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_11_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 11, + "id" : 3, + "info" : "Track Last Layer == 11" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_11_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_11_top.json new file mode 100644 index 000000000..bb57052e8 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_11_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 11, + "id" : 3, + "info" : "Track Last Layer == 11" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_12_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_12_bottom.json new file mode 100644 index 000000000..67e989139 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_12_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 12, + "id" : 3, + "info" : "Track Last Layer == 12" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_12_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_12_top.json new file mode 100644 index 000000000..59182daf4 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_12_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 12, + "id" : 3, + "info" : "Track Last Layer == 12" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_13_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_13_bottom.json new file mode 100644 index 000000000..395b16d1b --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_13_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 13, + "id" : 3, + "info" : "Track Last Layer == 13" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_13_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_13_top.json new file mode 100644 index 000000000..621c81eca --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_13_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 13, + "id" : 3, + "info" : "Track Last Layer == 13" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_1_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_1_bottom.json new file mode 100644 index 000000000..593c155df --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_1_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 1, + "id" : 3, + "info" : "Track Last Layer == 1" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_1_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_1_top.json new file mode 100644 index 000000000..f9577abba --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_1_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 1, + "id" : 3, + "info" : "Track Last Layer == 1" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_2_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_2_bottom.json new file mode 100644 index 000000000..4fbb3921b --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_2_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 2, + "id" : 3, + "info" : "Track Last Layer == 2" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_2_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_2_top.json new file mode 100644 index 000000000..c95b193d5 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_2_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 2, + "id" : 3, + "info" : "Track Last Layer == 2" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_3_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_3_bottom.json new file mode 100644 index 000000000..c2556e5dc --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_3_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 3, + "id" : 3, + "info" : "Track Last Layer == 3" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_3_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_3_top.json new file mode 100644 index 000000000..0d16abc44 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_3_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 3, + "id" : 3, + "info" : "Track Last Layer == 3" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_4_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_4_bottom.json new file mode 100644 index 000000000..32d612293 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_4_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 4, + "id" : 3, + "info" : "Track Last Layer == 4" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_4_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_4_top.json new file mode 100644 index 000000000..6415c8033 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_4_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 4, + "id" : 3, + "info" : "Track Last Layer == 4" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_5_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_5_bottom.json new file mode 100644 index 000000000..75e680d55 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_5_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 5, + "id" : 3, + "info" : "Track Last Layer == 5" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_5_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_5_top.json new file mode 100644 index 000000000..fe2e060b9 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_5_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 5, + "id" : 3, + "info" : "Track Last Layer == 5" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_6_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_6_bottom.json new file mode 100644 index 000000000..712774c87 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_6_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 6, + "id" : 3, + "info" : "Track Last Layer == 6" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_6_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_6_top.json new file mode 100644 index 000000000..efbf0d61b --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_6_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 6, + "id" : 3, + "info" : "Track Last Layer == 6" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_7_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_7_bottom.json new file mode 100644 index 000000000..fbf09ac65 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_7_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 7, + "id" : 3, + "info" : "Track Last Layer == 7" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_7_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_7_top.json new file mode 100644 index 000000000..5812c486c --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_7_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 7, + "id" : 3, + "info" : "Track Last Layer == 7" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_8_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_8_bottom.json new file mode 100644 index 000000000..def318ffc --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_8_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 8, + "id" : 3, + "info" : "Track Last Layer == 8" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_8_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_8_top.json new file mode 100644 index 000000000..81b1586b1 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_8_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 8, + "id" : 3, + "info" : "Track Last Layer == 8" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_9_bottom.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_9_bottom.json new file mode 100644 index 000000000..83083488f --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_9_bottom.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 9, + "id" : 3, + "info" : "Track Last Layer == 9" + }, + "track_pypz_lt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_9_top.json b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_9_top.json new file mode 100644 index 000000000..bfdd51e23 --- /dev/null +++ b/analysis/selections/simPart/1Sim_1Track_1Ecal_Track_last_layer_9_top.json @@ -0,0 +1,27 @@ +{ + "n_sim_eq" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles == 1" + }, + "n_track_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 2, + "info" : "N Ecal Clusters == 1" + }, + "track_last_layer_eq" : { + "cut" : 9, + "id" : 3, + "info" : "Track Last Layer == 9" + }, + "track_pypz_gt" : { + "cut" : 0.0, + "id" : 4, + "info" : "Track py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/1Track_1Ecal.json b/analysis/selections/simPart/1Track_1Ecal.json new file mode 100644 index 000000000..1b6f99e21 --- /dev/null +++ b/analysis/selections/simPart/1Track_1Ecal.json @@ -0,0 +1,12 @@ +{ + "n_track_eq" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks == 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters == 1" + } +} diff --git a/analysis/selections/simPart/1Track_neg_Omega.json b/analysis/selections/simPart/1Track_neg_Omega.json new file mode 100644 index 000000000..155a4c65d --- /dev/null +++ b/analysis/selections/simPart/1Track_neg_Omega.json @@ -0,0 +1,12 @@ +{ + "n_track_eq" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks == 1" + }, + "track_omega_lt" : { + "cut" : 0.0, + "id" : 1, + "info" : "N Ecal Clusters <= 0" + } +} diff --git a/analysis/selections/simPart/1Track_pos_Omega.json b/analysis/selections/simPart/1Track_pos_Omega.json new file mode 100644 index 000000000..0284b549c --- /dev/null +++ b/analysis/selections/simPart/1Track_pos_Omega.json @@ -0,0 +1,12 @@ +{ + "n_track_eq" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks == 1" + }, + "track_omega_gt" : { + "cut" : 0.0, + "id" : 1, + "info" : "N Ecal Clusters >= 0" + } +} diff --git a/analysis/selections/simPart/Ecal.json b/analysis/selections/simPart/Ecal.json new file mode 100644 index 000000000..15b922127 --- /dev/null +++ b/analysis/selections/simPart/Ecal.json @@ -0,0 +1,7 @@ +{ + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Ecal Clusters >= 1" + } +} diff --git a/analysis/selections/simPart/Track.json b/analysis/selections/simPart/Track.json new file mode 100644 index 000000000..1bc604384 --- /dev/null +++ b/analysis/selections/simPart/Track.json @@ -0,0 +1,7 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + } +} diff --git a/analysis/selections/simPart/Track_Ecal.json b/analysis/selections/simPart/Track_Ecal.json new file mode 100644 index 000000000..58e31a8aa --- /dev/null +++ b/analysis/selections/simPart/Track_Ecal.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters >= 1" + } +} diff --git a/analysis/selections/simPart/Track_Ecal_Sim_p_ge1.json b/analysis/selections/simPart/Track_Ecal_Sim_p_ge1.json new file mode 100644 index 000000000..09f10f877 --- /dev/null +++ b/analysis/selections/simPart/Track_Ecal_Sim_p_ge1.json @@ -0,0 +1,17 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters >= 1" + }, + "sim_p_gt" : { + "cut" : 1.0, + "id" : 2, + "info" : "Sim pT >= 1" + } +} diff --git a/analysis/selections/simPart/Track_Ecal_Sim_p_le1.json b/analysis/selections/simPart/Track_Ecal_Sim_p_le1.json new file mode 100644 index 000000000..18aeffb99 --- /dev/null +++ b/analysis/selections/simPart/Track_Ecal_Sim_p_le1.json @@ -0,0 +1,17 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters >= 1" + }, + "sim_p_lt" : { + "cut" : 1.0, + "id" : 2, + "info" : "Sim pT <= 1" + } +} diff --git a/analysis/selections/simPart/Track_Ecal_Track_p_ge4.json b/analysis/selections/simPart/Track_Ecal_Track_p_ge4.json new file mode 100644 index 000000000..a2dc695e7 --- /dev/null +++ b/analysis/selections/simPart/Track_Ecal_Track_p_ge4.json @@ -0,0 +1,17 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters >= 1" + }, + "track_p_gt" : { + "cut" : 4.0, + "id" : 2, + "info" : "Tracks pT >= 4" + } +} diff --git a/analysis/selections/simPart/Track_bottom.json b/analysis/selections/simPart/Track_bottom.json new file mode 100644 index 000000000..23dd2c9eb --- /dev/null +++ b/analysis/selections/simPart/Track_bottom.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "sim_pypz_lt" : { + "cut" : 0.0, + "id" : 1, + "info" : "Sim py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/Track_nhit10.json b/analysis/selections/simPart/Track_nhit10.json new file mode 100644 index 000000000..d31ad7197 --- /dev/null +++ b/analysis/selections/simPart/Track_nhit10.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 10.0, + "id" : 1, + "info" : "N Reco Track Hits >= 10" + } +} diff --git a/analysis/selections/simPart/Track_nhit11.json b/analysis/selections/simPart/Track_nhit11.json new file mode 100644 index 000000000..1142136a7 --- /dev/null +++ b/analysis/selections/simPart/Track_nhit11.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 11.0, + "id" : 1, + "info" : "N Reco Track Hits >= 11" + } +} diff --git a/analysis/selections/simPart/Track_nhit12.json b/analysis/selections/simPart/Track_nhit12.json new file mode 100644 index 000000000..fca2ecd97 --- /dev/null +++ b/analysis/selections/simPart/Track_nhit12.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 12.0, + "id" : 1, + "info" : "N Reco Track Hits >= 12" + } +} diff --git a/analysis/selections/simPart/Track_nhit13.json b/analysis/selections/simPart/Track_nhit13.json new file mode 100644 index 000000000..968a0cd38 --- /dev/null +++ b/analysis/selections/simPart/Track_nhit13.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 13.0, + "id" : 1, + "info" : "N Reco Track Hits >= 13" + } +} diff --git a/analysis/selections/simPart/Track_nhit14.json b/analysis/selections/simPart/Track_nhit14.json new file mode 100644 index 000000000..f621515b9 --- /dev/null +++ b/analysis/selections/simPart/Track_nhit14.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 14.0, + "id" : 1, + "info" : "N Reco Track Hits >= 14" + } +} diff --git a/analysis/selections/simPart/Track_nhit7.json b/analysis/selections/simPart/Track_nhit7.json new file mode 100644 index 000000000..d7b7ed41d --- /dev/null +++ b/analysis/selections/simPart/Track_nhit7.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 7.0, + "id" : 1, + "info" : "N Reco Track Hits >= 7" + } +} diff --git a/analysis/selections/simPart/Track_nhit8.json b/analysis/selections/simPart/Track_nhit8.json new file mode 100644 index 000000000..3714b7376 --- /dev/null +++ b/analysis/selections/simPart/Track_nhit8.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 8.0, + "id" : 1, + "info" : "N Reco Track Hits >= 8" + } +} diff --git a/analysis/selections/simPart/Track_nhit9.json b/analysis/selections/simPart/Track_nhit9.json new file mode 100644 index 000000000..c691a7038 --- /dev/null +++ b/analysis/selections/simPart/Track_nhit9.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_track_hits_gt" : { + "cut" : 9.0, + "id" : 1, + "info" : "N Reco Track Hits >= 9" + } +} diff --git a/analysis/selections/simPart/Track_noEcal.json b/analysis/selections/simPart/Track_noEcal.json new file mode 100644 index 000000000..3be6adfff --- /dev/null +++ b/analysis/selections/simPart/Track_noEcal.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 0.0, + "id" : 1, + "info" : "N Ecal Clusters == 0" + } +} diff --git a/analysis/selections/simPart/Track_noEcal_lowtanlambda.json b/analysis/selections/simPart/Track_noEcal_lowtanlambda.json new file mode 100644 index 000000000..b41f4c3f8 --- /dev/null +++ b/analysis/selections/simPart/Track_noEcal_lowtanlambda.json @@ -0,0 +1,22 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "n_ecal_cluster_eq" : { + "cut" : 0.0, + "id" : 1, + "info" : "N Ecal Clusters == 0" + }, + "sim_pypz_lt" : { + "cut" : 0.06, + "id" : 2, + "info" : "Sim py/pz <= 0.06" + }, + "sim_pypz_gt" : { + "cut" : -0.06, + "id" : 3, + "info" : "Sim py/pz >= -0.06" + } +} diff --git a/analysis/selections/simPart/Track_top.json b/analysis/selections/simPart/Track_top.json new file mode 100644 index 000000000..13bdd9295 --- /dev/null +++ b/analysis/selections/simPart/Track_top.json @@ -0,0 +1,12 @@ +{ + "n_track_gt" : { + "cut" : 1.0, + "id" : 0, + "info" : "N Tracks >= 1" + }, + "sim_pypz_gt" : { + "cut" : 0.0, + "id" : 1, + "info" : "Sim py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/noEcal.json b/analysis/selections/simPart/noEcal.json new file mode 100644 index 000000000..aa127c4f0 --- /dev/null +++ b/analysis/selections/simPart/noEcal.json @@ -0,0 +1,7 @@ +{ + "n_ecal_cluster_eq" : { + "cut" : 0.0, + "id" : 0, + "info" : "N Ecal Clusters == 0" + } +} diff --git a/analysis/selections/simPart/noTrack.json b/analysis/selections/simPart/noTrack.json new file mode 100644 index 000000000..a56537bec --- /dev/null +++ b/analysis/selections/simPart/noTrack.json @@ -0,0 +1,7 @@ +{ + "n_track_eq" : { + "cut" : 0.0, + "id" : 0, + "info" : "N Tracks == 0" + } +} diff --git a/analysis/selections/simPart/noTrack_Ecal.json b/analysis/selections/simPart/noTrack_Ecal.json new file mode 100644 index 000000000..cd9c58d32 --- /dev/null +++ b/analysis/selections/simPart/noTrack_Ecal.json @@ -0,0 +1,12 @@ +{ + "n_track_eq" : { + "cut" : 0.0, + "id" : 0, + "info" : "N Tracks == 0" + }, + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters >= 1" + } +} diff --git a/analysis/selections/simPart/noTrack_Ecal_bottom.json b/analysis/selections/simPart/noTrack_Ecal_bottom.json new file mode 100644 index 000000000..a16cacb06 --- /dev/null +++ b/analysis/selections/simPart/noTrack_Ecal_bottom.json @@ -0,0 +1,17 @@ +{ + "n_track_eq" : { + "cut" : 0.0, + "id" : 0, + "info" : "N Tracks == 0" + }, + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters >= 1" + }, + "sim_pypz_lt" : { + "cut" : 0.0, + "id" : 2, + "info" : "Sim py/pz <= 0.0" + } +} diff --git a/analysis/selections/simPart/noTrack_Ecal_top.json b/analysis/selections/simPart/noTrack_Ecal_top.json new file mode 100644 index 000000000..6b5d99047 --- /dev/null +++ b/analysis/selections/simPart/noTrack_Ecal_top.json @@ -0,0 +1,17 @@ +{ + "n_track_eq" : { + "cut" : 0.0, + "id" : 0, + "info" : "N Tracks == 0" + }, + "n_ecal_cluster_gt" : { + "cut" : 1.0, + "id" : 1, + "info" : "N Ecal Clusters >= 1" + }, + "sim_pypz_gt" : { + "cut" : 0.0, + "id" : 2, + "info" : "Sim py/pz >= 0.0" + } +} diff --git a/analysis/selections/simPart/noTrack_noEcal.json b/analysis/selections/simPart/noTrack_noEcal.json new file mode 100644 index 000000000..8fab98fde --- /dev/null +++ b/analysis/selections/simPart/noTrack_noEcal.json @@ -0,0 +1,12 @@ +{ + "n_track_eq" : { + "cut" : 0.0, + "id" : 0, + "info" : "N Tracks == 0" + }, + "n_ecal_cluster_eq" : { + "cut" : 0.0, + "id" : 1, + "info" : "N Ecal Clusters == 0" + } +} diff --git a/analysis/selections/simPart/simPartAna.json b/analysis/selections/simPart/simPartAna.json new file mode 100644 index 000000000..57ee02e6b --- /dev/null +++ b/analysis/selections/simPart/simPartAna.json @@ -0,0 +1,12 @@ +{ + "n_simpart_gt" : { + "cut" : 1, + "id" : 0, + "info" : "N Sim Particles >= 1" + }, + "n_simpart_lt" : { + "cut" : 0, + "id" : 1, + "info" : "N Sim Particles <= 0" + } +} diff --git a/analysis/src/SimPartHistos.cxx b/analysis/src/SimPartHistos.cxx new file mode 100644 index 000000000..28ddffa16 --- /dev/null +++ b/analysis/src/SimPartHistos.cxx @@ -0,0 +1,134 @@ +#include "SimPartHistos.h" +#include + +void SimPartHistos::FillMCParticle(MCParticle* part, FlatTupleMaker* tuples, float weight){ + int pdg = part->getPDG(); + std::vector momentum_V = part->getMomentum(); + double px = momentum_V.at(0); + double py = momentum_V.at(1); + double pz = momentum_V.at(2); + double p = sqrt(px*px + py*py + pz*pz); + double energy = part->getEnergy(); + + Fill1DHisto("sim_pdgid_h", pdg, weight); + Fill1DHisto("sim_px_h", px, weight); + Fill1DHisto("sim_py_h", py, weight); + Fill1DHisto("sim_pz_h", pz, weight); + Fill1DHisto("sim_p_h", p, weight); + Fill1DHisto("sim_pxpz_h", px/pz, weight); + Fill1DHisto("sim_pypz_h", py/pz, weight); + Fill1DHisto("sim_energy_h", energy, weight); + Fill2DHisto("sim_pxpz_pypz_hh", px/pz, py/pz, weight); + Fill2DHisto("sim_pxpz_p_hh", px/pz, p, weight); + Fill2DHisto("sim_pxpz_energy_hh", px/pz, energy, weight); + if (tuples != nullptr){ + tuples->addToVector("particle_pdgid", pdg); + tuples->addToVector("sim_px", px); + tuples->addToVector("sim_py", py); + tuples->addToVector("sim_pz", pz); + tuples->addToVector("sim_p", p); + tuples->addToVector("sim_energy", energy); + tuples->addToVector("sim_pxpz", px/pz); + tuples->addToVector("sim_pypz", py/pz); + } +} + +void SimPartHistos::FillRecoTrack(Track* track, FlatTupleMaker* tuples, float weight){ + bool isTop = (track->getTanLambda() > 0.0); + bool isPos = (track->getOmega() < 0.0); + bool isKF = track->isKalmanTrack(); + int trkType = (int)isTop*2 + (int)isPos; + //int n2dhits_onTrack = !isKF ? track->getTrackerHitCount() * 2 : track->getTrackerHitCount(); + int n_hits = track->getTrackerHitCount(); + double phi0 = track->getPhi(); + double tan_lambda = track->getTanLambda(); + double d0 = track->getD0(); + double z0 = track->getZ0(); + double omega = track->getOmega(); + + std::vector position_V = track->getPosition(); + double track_x = position_V.at(0); + double track_y = position_V.at(1); + std::vector position_ecal_V = track->getPositionAtEcal(); + double track_ecal_x = position_ecal_V.at(0); + double track_ecal_y = position_ecal_V.at(1); + + std::vector momentum_V = track->getMomentum(); + double px = momentum_V.at(0); + double py = momentum_V.at(1); + double pz = momentum_V.at(2); + double p = track->getP(); + + std::vector hit_layers; + for (int ihit = 0; ihitgetSvtHits().GetEntries(); ++ihit) { + TrackerHit* hit = (TrackerHit*) track->getSvtHits().At(ihit); + int layer = hit->getLayer(); + hit_layers.push_back(layer); + } + + Fill1DHisto("track_n_hits_h", n_hits, weight); + Fill1DHisto("track_px_h", px, weight); + Fill1DHisto("track_py_h", py, weight); + Fill1DHisto("track_pz_h", pz, weight); + Fill1DHisto("track_p_h", p, weight); + Fill1DHisto("track_phi0_h", phi0, weight); + Fill1DHisto("track_tanlambda_h", tan_lambda, weight); + Fill1DHisto("track_d0_h", d0, weight); + Fill1DHisto("track_z0_h", z0, weight); + Fill1DHisto("track_omega_h", omega, weight); + Fill1DHisto("track_ecal_x_h", track_ecal_x, weight); + Fill1DHisto("track_ecal_y_h", track_ecal_y, weight); + Fill2DHisto("track_phi0_p_hh", phi0, p, weight); + Fill2DHisto("track_phi0_tanlambda_hh", phi0, tan_lambda, weight); + Fill2DHisto("track_z0_tanlambda_hh", z0, tan_lambda, weight); + //Fill2DHisto("track_x_y_hh", track_x, track_y, weight); + Fill2DHisto("track_ecal_x_y_hh", track_ecal_x, track_ecal_y, weight); + + if (tuples != nullptr){ + tuples->addToVector("track_n_hits", n_hits); + tuples->addToVector("track_px", px); + tuples->addToVector("track_py", py); + tuples->addToVector("track_pz", pz); + tuples->addToVector("track_p", p); + tuples->addToVector("track_phi0", phi0); + tuples->addToVector("track_tanlambda", tan_lambda); + tuples->addToVector("track_d0", d0); + tuples->addToVector("track_z0", z0); + tuples->addToVector("track_omega", omega); + //tuples->addToVector("track_x", track_x); + //tuples->addToVector("track_y", track_y); + tuples->addToVector("track_ecal_x", track_ecal_x); + tuples->addToVector("track_ecal_y", track_ecal_y); + } + + for (int i=0; iaddToVector("track_hit_layer", hit_layers[i]); + } +} + +void SimPartHistos::FillRecoEcalCuster(CalCluster* ecal_cluster, FlatTupleMaker* tuples, float weight){ + std::vector position_V = ecal_cluster->getPosition(); + double cluster_x = position_V.at(0); + double cluster_y = position_V.at(1); + int n_hits = ecal_cluster->getNHits(); + double energy = ecal_cluster->getEnergy(); + + Fill1DHisto("ecal_n_hits_h", n_hits, weight); + Fill1DHisto("ecal_energy_h", energy, weight); + Fill1DHisto("ecal_energy_zoom_h", energy, weight); + Fill1DHisto("ecal_x_h", cluster_x, weight); + Fill1DHisto("ecal_y_h", cluster_y, weight); + Fill2DHisto("ecal_x_y_hh", cluster_x, cluster_y, weight); + if (tuples != nullptr){ + tuples->addToVector("ecal_n_hits", n_hits); + tuples->addToVector("ecal_energy", energy); + tuples->addToVector("ecal_x", cluster_x); + tuples->addToVector("ecal_y", cluster_y); + } +} + + + + diff --git a/event/include/MCTrackerHit.h b/event/include/MCTrackerHit.h index 03bd8e5d8..9c229a6ab 100644 --- a/event/include/MCTrackerHit.h +++ b/event/include/MCTrackerHit.h @@ -37,13 +37,10 @@ class MCTrackerHit : public TObject { * * @param position The hit position. */ - void setPosition(const double* position, bool rotate = false); - - /** @return The hit position. */ - std::vector getPosition() const { return {x_, y_, z_}; }; - - void setMomentum(const float* momentum, bool rotate = false); - std::vector getMomentum() const { return {px_, py_, pz_}; }; + void setPosition(const double* position, bool rotate = false); + + /** @return The hit position. */ + std::vector getPosition() const { return {x_, y_, z_}; }; /** @return the global X coordinate of the hit */ double getGlobalX() const {return x_;} @@ -53,6 +50,24 @@ class MCTrackerHit : public TObject { /** @return the global X coordinate of the hit */ double getGlobalZ() const {return z_;} + + /** + * Set the hit momentum. + * + * @param momentum The hit momentum. + */ + void setMomentum(const float* momentum, bool rotate = false); + + /** @return The hit momentum. */ + std::vector getMomentum() const { return {px_, py_, pz_}; }; + + /** + * @return momentum magnitude + */ + + double getP(){return sqrt(px_*px_ + py_*py_ + pz_*pz_);}; + + double getPt() {return sqrt(px_*px_ + pz_*pz_);} /** * Set the hit time. @@ -91,23 +106,32 @@ class MCTrackerHit : public TObject { //** @return the pdg id of particle that made the hit */ int getPDG() const {return pdg_;}; - - ClassDef(MCTrackerHit, 1); + //** set the lcio id of particle that made the hit */ + void setPartID(const int id) {partID_ = id;}; + + //** @return the lcio id of particle that made the hit */ + int getPartID() const {return partID_;}; + + ClassDef(MCTrackerHit, 1); private: /** The x position of the hit. */ double x_{-999}; - /** The x position of the hit. */ + /** The y position of the hit. */ double y_{-999}; - /** The x position of the hit. */ + /** The z position of the hit. */ double z_{-999}; - /** The truth momentum of the hit. Only MC */ - float px_{-999}; - float py_{-999}; + /** The px momentum of the hit. */ + float px_{-999}; + + /** The y momentum of the hit. */ + float py_{-999}; + + /** The z momentum of the hit. */ float pz_{-999}; /** The hit time. */ @@ -125,6 +149,9 @@ class MCTrackerHit : public TObject { /** pdg id of particle that made the hit */ int pdg_{-999}; + /** lcio id of particle that made the hit */ + int partID_{-999}; + }; // MCTrackerHit #endif // _MCTRACKER_HIT_H_ diff --git a/processors/config/simPartAna_cfg.py b/processors/config/simPartAna_cfg.py new file mode 100644 index 000000000..5091a8082 --- /dev/null +++ b/processors/config/simPartAna_cfg.py @@ -0,0 +1,126 @@ +import HpstrConf +import sys +import os +import baseConfig as base + + +base.parser.add_argument("-w", "--tracking", type=str, dest="tracking", + help="Which tracking to use to make plots", metavar="tracking", default="KF") +options = base.parser.parse_args() + + +print(options) + +# Use the input file to set the output file name +infile = options.inFilename +outfile = options.outFilename + +analysis = options.analysis + + +print('Input file: %s' % infile) +print('Output file: %s' % outfile) +print('Analysis : %s' % analysis) + +p = HpstrConf.Process() + +p.run_mode = 1 +p.skip_events = options.skip_events +p.max_events = options.nevents + +#p.max_events = 1000 + +# Library containing processors +p.add_library("libprocessors") + +############################### +# Processors # +############################### + +sim_part_ana = HpstrConf.Processor('sim_part', 'SimPartAnaProcessor') + +############################### +# Processor Configuration # +############################### +#RecoHitAna +sim_part_ana.parameters["debug"] = 0 +sim_part_ana.parameters["anaName"] = "sim_part" +sim_part_ana.parameters["MCParticleColl"] = "MCParticle" +sim_part_ana.parameters["MCTrackerHitColl"] = "TrackerSimHits" +sim_part_ana.parameters["MCTrackerHitECalColl"] = "TrackerSimHitsECal" +sim_part_ana.parameters["MCEcalHitColl"] = "EcalSimHits" +sim_part_ana.parameters["RecoTrackColl"] = "KalmanFullTracks" +sim_part_ana.parameters["RecoTrackColl_AtLastHit"] = "KalmanFullTracks_AtLastHit" +sim_part_ana.parameters["RecoTrackerClusterColl"] = "SiClustersOnTrack" +sim_part_ana.parameters["RecoEcalClusterColl"] = "RecoEcalClusters" +sim_part_ana.parameters["analysis"] = analysis +sim_part_ana.parameters["histCfg"] = os.environ['HPSTR_BASE']+'/analysis/plotconfigs/mc/simPart.json' + +sim_part_ana.parameters["selectionjson"] = os.environ['HPSTR_BASE']+'/analysis/selections/simPart/simPartAna.json' +RegionPath = os.environ['HPSTR_BASE']+"/analysis/selections/simPart/" +sim_part_ana.parameters["regionDefinitions"] = [RegionPath+'1Sim_1Track.json', + RegionPath+'Track.json', + RegionPath+'Ecal.json', + RegionPath+'1Track_1Ecal.json', + RegionPath+'1Sim_1Track_1Ecal.json', + RegionPath+'Track_Ecal.json', + RegionPath+'noTrack.json', + RegionPath+'noTrack_Ecal.json', + RegionPath+'noEcal.json', + RegionPath+'Track_noEcal.json', + RegionPath+'noTrack_noEcal.json', + RegionPath+'1Track_pos_Omega.json', + RegionPath+'1Track_neg_Omega.json', + RegionPath+'Track_nhit7.json', + RegionPath+'Track_nhit8.json', + RegionPath+'Track_nhit9.json', + RegionPath+'Track_nhit10.json', + RegionPath+'Track_nhit11.json', + RegionPath+'Track_nhit12.json', + RegionPath+'Track_nhit13.json', + RegionPath+'Track_nhit14.json', + RegionPath+'Track_Ecal_Track_p_ge4.json', + RegionPath+'Track_Ecal_Sim_p_ge1.json', + RegionPath+'Track_Ecal_Sim_p_le1.json', + RegionPath+'Track_noEcal_lowtanlambda.json', + RegionPath+'Track_top.json', + RegionPath+'Track_bottom.json', + RegionPath+'noTrack_Ecal_top.json', + RegionPath+'noTrack_Ecal_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_0_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_1_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_2_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_3_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_4_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_5_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_6_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_7_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_8_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_9_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_10_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_11_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_12_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_13_top.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_0_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_1_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_2_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_3_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_4_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_5_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_6_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_7_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_8_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_9_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_10_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_11_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_12_bottom.json', + RegionPath+'1Sim_1Track_1Ecal_Track_last_layer_13_bottom.json' + ] + +# Sequence which the processors will run. +p.sequence = [sim_part_ana] + +p.input_files = infile +p.output_files = [outfile] + +p.printProcess() diff --git a/processors/config/simPartTuple_cfg.py b/processors/config/simPartTuple_cfg.py index 05e87a646..f9e7f2593 100644 --- a/processors/config/simPartTuple_cfg.py +++ b/processors/config/simPartTuple_cfg.py @@ -28,9 +28,11 @@ ############################### header = HpstrConf.Processor('header', 'EventProcessor') track = HpstrConf.Processor('track', 'TrackingProcessor') +track_atlasthit = HpstrConf.Processor('track_atlasthit', 'TrackingProcessor') svthits = HpstrConf.Processor('svthits', 'Tracker2DHitProcessor') rawsvt = HpstrConf.Processor('rawsvt', 'SvtRawDataProcessor') mcthits = HpstrConf.Processor('mcthits', 'MCTrackerHitProcessor') +mcthits_ecal = HpstrConf.Processor('mcthits_ecal', 'MCTrackerHitProcessor') mcehits = HpstrConf.Processor('mcehits', 'MCEcalHitProcessor') ecal = HpstrConf.Processor('ecal', 'ECalDataProcessor') fsp = HpstrConf.Processor('fps', 'FinalStateParticleProcessor') @@ -70,6 +72,16 @@ track.parameters["trkhitCollRoot"] = 'SiClustersOnTrack' track.parameters["hitFitsCollLcio"] = 'SVTFittedRawTrackerHits' +# Tracking at Last Hit +track_atlasthit.parameters["debug"] = 0 +track_atlasthit.parameters["trkCollLcio"] = 'KalmanFullTracks' +track_atlasthit.parameters["trkCollRoot"] = 'KalmanFullTracks_AtLastHit' +track_atlasthit.parameters["kinkRelCollLcio"] = '' +track_atlasthit.parameters["trkRelCollLcio"] = 'KFTrackDataRelations' +track_atlasthit.parameters["trkhitCollRoot"] = 'SiClustersOnTrack_AtLastHit' +track_atlasthit.parameters["hitFitsCollLcio"] = 'SVTFittedRawTrackerHits' +track_atlasthit.parameters["trackStateLocation"] = 'AtLastHit' + # Only for detail studies # LT uncomment track.parameters["rawhitCollRoot"] = 'SVTRawHitsOnTrack_KF' @@ -96,6 +108,11 @@ mcthits.parameters["hitCollLcio"] = 'TrackerHits' mcthits.parameters["hitCollRoot"] = 'TrackerSimHits' +#MCTrackerHits at Ecal +mcthits_ecal.parameters["debug"] = 0 +mcthits_ecal.parameters["hitCollLcio"] = 'TrackerHitsECal' +mcthits_ecal.parameters["hitCollRoot"] = 'TrackerSimHitsECal' + #MCEcalHits mcehits.parameters["debug"] = 0 mcehits.parameters["hitCollLcio"] = 'EcalHits' @@ -116,7 +133,7 @@ mcpart.parameters["mcPartCollLcio"] = 'MCParticle' mcpart.parameters["mcPartCollRoot"] = 'MCParticle' -sequence = [header, ecal, track, svthits, rawsvt, mcthits, mcehits, mcpart] +sequence = [header, ecal, track, track_atlasthit, svthits, rawsvt, mcthits, mcthits_ecal, mcehits, mcpart] p.sequence = sequence diff --git a/processors/include/SimPartAnaProcessor.h b/processors/include/SimPartAnaProcessor.h new file mode 100644 index 000000000..41a340324 --- /dev/null +++ b/processors/include/SimPartAnaProcessor.h @@ -0,0 +1,127 @@ +#ifndef __SIM_PARTANAPROCESSOR_H__ +#define __SIM_PARTANAPROCESSOR_H__ + +//HPSTR +#include "HpsEvent.h" +#include "Collections.h" +#include "MCParticle.h" +#include "MCTrackerHit.h" +#include "MCEcalHit.h" +#include "SimPartHistos.h" +#include "Track.h" +#include "TrackerHit.h" +#include "CalCluster.h" +#include "AnaHelpers.h" +#include "BaseSelector.h" +#include "FlatTupleMaker.h" + +//ROOT +#include "Processor.h" +#include "TClonesArray.h" +#include "TBranch.h" +#include "TTree.h" +#include "TFile.h" + +class TTree; + +/** + * @brief Insert description here. + * more details + */ +class SimPartAnaProcessor : public Processor { + + public: + /** + * @brief Constructor + * + * @param name + * @param process + */ + SimPartAnaProcessor(const std::string& name, Process& process); + + ~SimPartAnaProcessor(); + + /** + * @brief description + * + * @param ievent + * @return true + * @return false + */ + virtual bool process(IEvent* ievent); + + /** + * @brief description + * + * @param tree + */ + virtual void initialize(TTree* tree); + + /** + * @brief description + * + */ + virtual void finalize(); + + /** + * @brief description + * + * @param parameters + */ + virtual void configure(const ParameterSet& parameters); + + private: + + /** Containers to hold histogrammer info */ + SimPartHistos* histos{nullptr}; + std::string histCfgFilename_; //!< description + FlatTupleMaker* tuples{nullptr}; + + /** \todo Change this to be held from HPSEvent */ + TTree* tree_; + TBranch* bMCParticles_{nullptr}; //!< description + TBranch* bMCTrackerHits_{nullptr}; //!< description + TBranch* bMCTrackerHitsECal_{nullptr}; //!< description + TBranch* bMCEcalHits_{nullptr}; //!< description + TBranch* bRecoTracks_{nullptr}; //!< description + TBranch* bRecoTracks_atlasthit_{nullptr}; //!< description + TBranch* bRecoTrackerClusters_{nullptr}; //!< description + TBranch* bRecoEcalClusters_{nullptr}; //!< description + + std::vector * MCParticles_{nullptr}; //!< description + std::vector * MCTrackerHits_{nullptr}; //!< description + std::vector * MCTrackerHitsECal_{nullptr}; //!< description + std::vector * MCEcalHits_{nullptr}; //!< description + std::vector * RecoTracks_{nullptr}; //!< description + std::vector * RecoTracks_atlasthit_{nullptr}; //!< description + std::vector * RecoTrackerClusters_{nullptr}; //!< description + std::vector * RecoEcalClusters_{nullptr}; //!< description + + std::string anaName_{"SimPartAna"}; //!< description + std::string MCParticleColl_{"MCParticle"}; //!< description + std::string MCTrackerHitColl_{"TrackerSimHits"}; //!< description + std::string MCTrackerHitECalColl_{"TrackerSimHitsECal"}; //!< description + std::string MCEcalHitColl_{"EcalSimHits"}; //!< description + std::string RecoTrackColl_{"KalmanFullTracks"}; //!< description + std::string RecoTrackColl_atlasthit_{"KalmanFullTracks_AtLastHit"}; //!< description + std::string RecoTrackerClusterColl_{"SiClustersOnTrack"}; //!< description + std::string RecoEcalClusterColl_{"RecoEcalClusters"}; //!< description + std::string analysis_{"sim_part"}; //!< description + + std::string selectionCfg_; + std::shared_ptr EventSelector_; //!< description + std::vector regions_; //!< description + std::vector regionSelections_; //!< description + std::map> reg_selectors_; //!< description + + std::map> reg_histos_; //!< description + typedef std::map>::iterator reg_it; //!< description + //std::map> reg_tuples_; //!< description + //std::map reg_tuples_; //!< description + + int debug_{0}; //!< Debug Level + +}; + + +#endif diff --git a/processors/src/MCTrackerHitProcessor.cxx b/processors/src/MCTrackerHitProcessor.cxx index 0a2cbd9bf..a52e9d937 100644 --- a/processors/src/MCTrackerHitProcessor.cxx +++ b/processors/src/MCTrackerHitProcessor.cxx @@ -78,9 +78,11 @@ bool MCTrackerHitProcessor::process(IEvent* ievent) { mc_tracker_hit->setEdep(lcio_mcTracker_hit->getEDep()); // Set the pdg of particle generating the hit - if(lcio_mcTracker_hit->getMCParticle()) + if(lcio_mcTracker_hit->getMCParticle()){ mc_tracker_hit->setPDG(lcio_mcTracker_hit->getMCParticle()->getPDG()); - + mc_tracker_hit->setPartID(lcio_mcTracker_hit->getMCParticle()->id()); + } + // Set the time of the hit mc_tracker_hit->setTime(lcio_mcTracker_hit->getTime()); diff --git a/processors/src/SimPartAnaProcessor.cxx b/processors/src/SimPartAnaProcessor.cxx new file mode 100644 index 000000000..03460a8a1 --- /dev/null +++ b/processors/src/SimPartAnaProcessor.cxx @@ -0,0 +1,631 @@ +/** + * @file SimPartAnaProcessor.cxx + * @brief SimPartAnaProcessor used fill histograms to check acceptance of simulated particle source + * @author Abhisek Datta, University of California, Los Angeles + */ +#include "SimPartAnaProcessor.h" +#include +#include + +SimPartAnaProcessor::SimPartAnaProcessor(const std::string& name, Process& process) : Processor(name,process){} +//TODO CHECK THIS DESTRUCTOR +SimPartAnaProcessor::~SimPartAnaProcessor(){} + + +void SimPartAnaProcessor::configure(const ParameterSet& parameters) { + std::cout << "Configuring SimPartAnaProcessor" << std::endl; + try + { + debug_ = parameters.getInteger("debug"); + anaName_ = parameters.getString("anaName"); + MCParticleColl_ = parameters.getString("MCParticleColl"); + MCTrackerHitColl_ = parameters.getString("MCTrackerHitColl"); + MCTrackerHitECalColl_ = parameters.getString("MCTrackerHitECalColl"); + MCEcalHitColl_ = parameters.getString("MCEcalHitColl"); + RecoTrackColl_ = parameters.getString("RecoTrackColl"); + RecoTrackColl_atlasthit_ = parameters.getString("RecoTrackColl_AtLastHit"); + RecoTrackerClusterColl_ = parameters.getString("RecoTrackerClusterColl"); + RecoEcalClusterColl_ = parameters.getString("RecoEcalClusterColl"); + histCfgFilename_ = parameters.getString("histCfg"); + analysis_ = parameters.getString("analysis"); + selectionCfg_ = parameters.getString("selectionjson",selectionCfg_); + regionSelections_ = parameters.getVString("regionDefinitions",regionSelections_); + } + catch (std::runtime_error& error) + { + std::cout << error.what() << std::endl; + } +} + +void SimPartAnaProcessor::initialize(TTree* tree) { + tree_= tree; + // init histos + histos = new SimPartHistos(anaName_); + histos->loadHistoConfig(histCfgFilename_); + histos->DefineHistos(); + tuples = new FlatTupleMaker(anaName_+"_tree"); + tuples->addVariable("numMCparts"); + tuples->addVariable("numRecoTracks"); + tuples->addVariable("numSimTrackerHits"); + tuples->addVariable("numRecoTrackerClusters"); + tuples->addVariable("numSimEcalHits"); + tuples->addVariable("numRecoEcalClusters"); + tuples->addVector("sim_pdgid"); + tuples->addVector("sim_px"); + tuples->addVector("sim_py"); + tuples->addVector("sim_pz"); + tuples->addVector("sim_p"); + tuples->addVector("sim_energy"); + tuples->addVector("sim_pxpz"); + tuples->addVector("sim_pypz"); + tuples->addVector("track_n_hits"); + tuples->addVector("track_px"); + tuples->addVector("track_py"); + tuples->addVector("track_pz"); + tuples->addVector("track_p"); + tuples->addVector("track_phi0"); + tuples->addVector("track_tanlambda"); + tuples->addVector("track_d0"); + tuples->addVector("track_z0"); + tuples->addVector("track_omega"); + //tuples->addVector("track_x"); + //tuples->addVector("track_y"); + tuples->addVector("track_ecal_x"); + tuples->addVector("track_ecal_y"); + tuples->addVector("track_hit_layer"); + tuples->addVector("ecal_n_hits"); + tuples->addVector("ecal_energy"); + tuples->addVector("ecal_x"); + tuples->addVector("ecal_y"); + + if (!selectionCfg_.empty()) { + EventSelector_ = std::make_shared(name_+"_EventSelector",selectionCfg_); + EventSelector_->setDebug(debug_); + EventSelector_->LoadSelection(); + std::cout << "Event Selection Loaded" << std::endl; + } + for (unsigned int i_reg = 0; i_reg < regionSelections_.size(); i_reg++) { + std::string regname = AnaHelpers::getFileName(regionSelections_[i_reg],false); + std::cout << "Setting up region:: " << regname << std::endl; + reg_selectors_[regname] = std::make_shared(regname, regionSelections_[i_reg]); + reg_selectors_[regname]->setDebug(debug_); + reg_selectors_[regname]->LoadSelection(); + + reg_histos_[regname] = std::make_shared(regname); + reg_histos_[regname]->loadHistoConfig(histCfgFilename_); + reg_histos_[regname]->DefineHistos(); + + //reg_tuples_[regname] = std::make_shared(anaName_+"_"+regname+"_tree"); + /* + reg_tuples_[regname] = new FlatTupleMaker(anaName_+"_"+regname+"_tree"); + reg_tuples_[regname]->addVariable("numMCparts"); + reg_tuples_[regname]->addVariable("numRecoTracks"); + reg_tuples_[regname]->addVariable("numSimTrackerHits"); + reg_tuples_[regname]->addVariable("numRecoTrackerClusters"); + reg_tuples_[regname]->addVariable("numSimEcalHits"); + reg_tuples_[regname]->addVariable("numRecoEcalClusters"); + reg_tuples_[regname]->addVector("sim_pdgid"); + reg_tuples_[regname]->addVector("sim_px"); + reg_tuples_[regname]->addVector("sim_py"); + reg_tuples_[regname]->addVector("sim_pz"); + reg_tuples_[regname]->addVector("sim_p"); + reg_tuples_[regname]->addVector("sim_energy"); + reg_tuples_[regname]->addVector("sim_pxpz"); + reg_tuples_[regname]->addVector("sim_pypz"); + reg_tuples_[regname]->addVector("track_n_hits"); + reg_tuples_[regname]->addVector("track_px"); + reg_tuples_[regname]->addVector("track_py"); + reg_tuples_[regname]->addVector("track_pz"); + reg_tuples_[regname]->addVector("track_p"); + reg_tuples_[regname]->addVector("track_phi0"); + reg_tuples_[regname]->addVector("track_tanlambda"); + reg_tuples_[regname]->addVector("track_d0"); + reg_tuples_[regname]->addVector("track_z0"); + reg_tuples_[regname]->addVector("track_omega"); + //reg_tuples_[regname]->addVector("track_x"); + //reg_tuples_[regname]->addVector("track_y"); + reg_tuples_[regname]->addVector("track_ecal_x"); + reg_tuples_[regname]->addVector("track_ecal_y"); + reg_tuples_[regname]->addVector("track_hit_layrer"); + reg_tuples_[regname]->addVector("ecal_n_hits"); + reg_tuples_[regname]->addVector("ecal_energy"); + reg_tuples_[regname]->addVector("ecal_x"); + reg_tuples_[regname]->addVector("ecal_y"); + */ + + regions_.push_back(regname); + } + + // init TTree + tree_->SetBranchAddress(MCParticleColl_.c_str(), &MCParticles_, &bMCParticles_); + + if (tree_->FindBranch(MCTrackerHitColl_.c_str())) + tree_->SetBranchAddress(MCTrackerHitColl_.c_str(), &MCTrackerHits_, &bMCTrackerHits_); + else + std::cout<<"WARNING: No MC tracker hit collection"<FindBranch(MCTrackerHitECalColl_.c_str())) + tree_->SetBranchAddress(MCTrackerHitECalColl_.c_str(), &MCTrackerHitsECal_, &bMCTrackerHitsECal_); + else + std::cout<<"WARNING: No MC tracker hit collection"<FindBranch(MCEcalHitColl_.c_str())) + tree_->SetBranchAddress(MCEcalHitColl_.c_str(), &MCEcalHits_, &bMCEcalHits_); + else + std::cout<<"WARNING: No MC Ecal hit collection"<FindBranch(RecoTrackColl_.c_str())) + tree_->SetBranchAddress(RecoTrackColl_.c_str(), &RecoTracks_, &bRecoTracks_); + else + std::cout<<"WARNING: No Reco track collection"<FindBranch(RecoTrackColl_atlasthit_.c_str())) + tree_->SetBranchAddress(RecoTrackColl_atlasthit_.c_str(), &RecoTracks_atlasthit_, &bRecoTracks_atlasthit_); + else + std::cout<<"WARNING: No Reco track at last hit collection"<FindBranch(RecoTrackerClusterColl_.c_str())) + tree_->SetBranchAddress(RecoTrackerClusterColl_.c_str(), &RecoTrackerClusters_, &bRecoTrackerClusters_); + else + std::cout<<"WARNING: No Reco tracker hit collection"<FindBranch(RecoEcalClusterColl_.c_str())) + tree_->SetBranchAddress(RecoEcalClusterColl_.c_str(), &RecoEcalClusters_, &bRecoEcalClusters_); + else + std::cout<<"WARNING: No Reco Ecal hit collection"<getCutFlowHisto()->Fill(0.,weight); + + int nParts = MCParticles_->size(); + int nSim_Tracker_hits = MCTrackerHits_->size(); + int nSim_Tracker_hits_Ecal = MCTrackerHitsECal_->size(); + int nSim_Ecal_hits = MCEcalHits_->size(); + int nReco_Tracks = RecoTracks_->size(); + int nReco_Tracks_atlasthit = RecoTracks_atlasthit_->size(); + int nReco_Tracker_clusters = RecoTrackerClusters_->size(); + int nReco_Ecal_clusters = RecoEcalClusters_->size(); + + // Event Selection + if (EventSelector_ && !EventSelector_->passCutGt("n_simpart_gt", nParts, weight)) + return true; + //if (EventSelector_ && !EventSelector_->passCutLt("n_simpart_lt", nParts, weight)) + // return true; + + histos->Fill1DHisto("numMCparts_h", (float)nParts, weight); + histos->Fill1DHisto("numRecoTracks_h", (float)nReco_Tracks, weight); + histos->Fill1DHisto("numSimTrackerHits_h", (float)nSim_Tracker_hits, weight); + histos->Fill1DHisto("numSimEcalHits_h", (float)nSim_Ecal_hits, weight); + histos->Fill1DHisto("numRecoTrackerClusters_h", (float)nReco_Tracker_clusters, weight); + histos->Fill1DHisto("numRecoEcalClusters_h", (float)nReco_Ecal_clusters, weight); + tuples->setVariableValue("numMCparts", (float)nParts); + tuples->setVariableValue("numRecoTracks", (float)nReco_Tracks); + tuples->setVariableValue("numSimTrackerHits", (float)nSim_Tracker_hits); + tuples->setVariableValue("numSimEcalHits", (float)nSim_Ecal_hits); + tuples->setVariableValue("numRecoTrackerClusters", (float)nReco_Tracker_clusters); + tuples->setVariableValue("numRecoEcalClusters", (float)nReco_Ecal_clusters); + + double sim_max_p = -99999; + double sim_pxpz = -99999; + double sim_pypz = -99999; + std::vector sim_p_list; + std::vector sim_pypz_list; + sim_p_list.clear(); + sim_pypz_list.clear(); + for (int i=0; iat(i); + int gen = part->getGenStatus(); + if (gen != 1) + continue; + histos->FillMCParticle(part, tuples); + std::vector momentum_V = part->getMomentum(); + double px = momentum_V.at(0); + double py = momentum_V.at(1); + double pz = momentum_V.at(2); + double p = sqrt(px*px + py*py + pz*pz); + sim_p_list.push_back(p); + sim_pypz_list.push_back(py/pz); + if (p > sim_max_p){ + sim_max_p = p; + sim_pxpz = px/pz; + sim_pypz = py/pz; + } + } + + int min_n_Track_hits = 99999; + double track_omega = -99999; + double track_phi0 = -99999; + double track_tanlamda = -99999; + double track_max_p_ecal_x = -99999; + double track_max_p = -99999; + std::vector track_p_list; + track_p_list.clear(); + for (int i=0; iat(i); + int n_hits = track->getTrackerHitCount(); + if (n_hits < min_n_Track_hits) + min_n_Track_hits = n_hits; + histos->FillRecoTrack(track, tuples); + double p = track->getP(); + track_p_list.push_back(p); + if (p > track_max_p){ + track_max_p = p; + track_max_p_ecal_x = track->getPositionAtEcal().at(0); + track_omega = track->getOmega(); + track_phi0 = track->getPhi(); + track_tanlamda = track->getTanLambda(); + } + } + + double ecal_max_energy = -99999; + double ecal_max_p_x = -99999; + for (int i=0; iat(i); + histos->FillRecoEcalCuster(ecal_cluster, tuples); + double energy = ecal_cluster->getEnergy(); + if (energy > ecal_max_energy){ + ecal_max_energy = energy; + ecal_max_p_x = ecal_cluster->getPosition().at(0); + } + } + + double mc_tracker_hit_ecal_max_p = -99999; + double mc_tracker_hit_ecal_max_p_x = -99999; + for (int i=0; iat(i); + int track_id = mc_tracker_hit_ecal->getPartID(); + double sim_p = -99999; + for (int j=0; jat(j); + int gen = part->getGenStatus(); + if (gen != 1) + continue; + int sim_id = part->getID(); + std::vector momentum_V = part->getMomentum(); + double px = momentum_V.at(0); + double py = momentum_V.at(1); + double pz = momentum_V.at(2); + if (sim_id == track_id){ + sim_p = sqrt(px*px + py*py + pz*pz); + break; + } + } + if (sim_p > mc_tracker_hit_ecal_max_p){ + mc_tracker_hit_ecal_max_p = sim_p; + mc_tracker_hit_ecal_max_p_x = mc_tracker_hit_ecal->getPosition().at(0); + } + } + + double track_atlasthit_max_p_x = -99999; + double track_atlasthit_max_p_y = -99999; + double track_atlasthit_max_p_z = -99999; + double track_atlasthit_max_p = -99999; + double track_atlasthit_max_p_px = -99999; + double track_atlasthit_max_p_py = -99999; + double track_atlasthit_max_p_pz = -99999; + int track_atlasthit_last_layer = -99999; + std::vector track_atlasthit_pypz_list; + track_atlasthit_pypz_list.clear(); + for (int i=0; iat(i); + double track_p = track_atlasthit->getP(); + track_atlasthit_pypz_list.push_back(track_atlasthit->getMomentum().at(1)/track_atlasthit->getMomentum().at(2)); + if (track_p > track_atlasthit_max_p){ + track_atlasthit_max_p = track_p; + track_atlasthit_max_p_x = track_atlasthit->getPosition().at(2); + track_atlasthit_max_p_y = track_atlasthit->getPosition().at(0); + track_atlasthit_max_p_z = track_atlasthit->getPosition().at(1); + track_atlasthit_max_p_px = track_atlasthit->getMomentum().at(0); + track_atlasthit_max_p_py = track_atlasthit->getMomentum().at(1); + track_atlasthit_max_p_pz = track_atlasthit->getMomentum().at(2); + std::vector layer_list = track_atlasthit->getHitLayers(); + track_atlasthit_last_layer = *(std::max_element(layer_list.begin(), layer_list.end())); + } + } + + double mc_tracker_hit_atlasthit_max_p_x = -99999; + double mc_tracker_hit_atlasthit_max_p_y = -99999; + double mc_tracker_hit_atlasthit_max_p_z = -99999; + double mc_tracker_hit_atlasthit_max_p = -99999; + double mc_tracker_hit_atlasthit_max_p_px = -99999; + double mc_tracker_hit_atlasthit_max_p_py = -99999; + double mc_tracker_hit_atlasthit_max_p_pz = -99999; + for (int i=0; iat(i); + int track_layer = mc_tracker_hit_atlasthit->getLayer(); + int track_id = mc_tracker_hit_atlasthit->getPartID(); + double mc_track_p = mc_tracker_hit_atlasthit->getP(); + if (track_layer != (track_atlasthit_last_layer+1)) + continue; + if (mc_track_p > mc_tracker_hit_atlasthit_max_p){ + mc_tracker_hit_atlasthit_max_p = mc_track_p; + mc_tracker_hit_atlasthit_max_p_x = mc_tracker_hit_atlasthit->getPosition().at(0); + mc_tracker_hit_atlasthit_max_p_y = mc_tracker_hit_atlasthit->getPosition().at(1); + mc_tracker_hit_atlasthit_max_p_z = mc_tracker_hit_atlasthit->getPosition().at(2); + mc_tracker_hit_atlasthit_max_p_px = mc_tracker_hit_atlasthit->getMomentum().at(0); + mc_tracker_hit_atlasthit_max_p_py = mc_tracker_hit_atlasthit->getMomentum().at(1); + mc_tracker_hit_atlasthit_max_p_pz = mc_tracker_hit_atlasthit->getMomentum().at(2); + } + } + + if (track_max_p != -99999 && sim_max_p != -99999) + histos->Fill2DHisto("track_sim_p_sim_p_hh", track_max_p/sim_max_p, sim_max_p, weight); + + if (sim_pxpz != -99999 && track_phi0 != -99999){ + histos->Fill1DHisto("track_phi0_simpxpz_h", (track_phi0/sim_pxpz), weight); + histos->Fill2DHisto("track_phi0_simpxpz_sim_p_hh", (track_phi0/sim_pxpz), sim_max_p, weight); + } + if (sim_pypz != -99999 && track_tanlamda != -99999){ + histos->Fill1DHisto("track_tanlambda_simpypz_h", (track_tanlamda/sim_pypz), weight); + histos->Fill2DHisto("track_tanlambda_simpypz_sim_p_hh", (track_tanlamda/sim_pypz), sim_max_p, weight); + } + if (sim_pxpz != -99999 && track_phi0 != -99999 && sim_pypz != -99999 && track_tanlamda != -99999) + histos->Fill2DHisto("track_phi0_simpxpz_tanlambda_simpypz_hh", (track_phi0/sim_pxpz), (track_tanlamda/sim_pypz), weight); + if (track_max_p_ecal_x != -99999 && ecal_max_p_x != 99999){ + histos->Fill1DHisto("track_ecal_x_diff_h", (track_max_p_ecal_x-ecal_max_p_x), weight); + histos->Fill2DHisto("track_ecal_x_track_p_hh", (track_max_p_ecal_x-ecal_max_p_x), track_max_p, weight); + histos->Fill2DHisto("track_ecal_x_sim_p_hh", (track_max_p_ecal_x-ecal_max_p_x), sim_max_p, weight); + histos->Fill2DHisto("track_ecal_x_ecal_energy_hh", (track_max_p_ecal_x-ecal_max_p_x), ecal_max_energy, weight); + histos->Fill2DHisto("track_ecal_x_ecal_x_hh", ecal_max_p_x, (track_max_p_ecal_x-ecal_max_p_x), weight); + } + if (mc_tracker_hit_ecal_max_p_x != -99999 && track_max_p_ecal_x != 99999){ + histos->Fill1DHisto("sim_track_x_diff_h", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), weight); + histos->Fill2DHisto("sim_track_x_track_p_hh", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), track_max_p, weight); + histos->Fill2DHisto("sim_track_x_sim_p_hh", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), sim_max_p, weight); + histos->Fill2DHisto("sim_track_x_ecal_energy_hh", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), ecal_max_energy, weight); + } + if (mc_tracker_hit_ecal_max_p_x != -99999 && ecal_max_p_x != 99999){ + histos->Fill1DHisto("sim_ecal_x_diff_h", (ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), weight); + histos->Fill2DHisto("sim_ecal_x_track_p_hh", (ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), track_max_p, weight); + histos->Fill2DHisto("sim_ecal_x_sim_p_hh", (ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), sim_max_p, weight); + histos->Fill2DHisto("sim_ecal_x_ecal_energy_hh", (-ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), ecal_max_energy, weight); + } + if (mc_tracker_hit_atlasthit_max_p_x != -99999 && track_atlasthit_max_p_x != -99999){ + histos->Fill1DHisto("sim_track_atlasthit_x_diff_h", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), weight); + histos->Fill1DHisto("sim_track_atlasthit_y_diff_h", (track_atlasthit_max_p_y-mc_tracker_hit_atlasthit_max_p_y), weight); + histos->Fill1DHisto("sim_track_atlasthit_z_diff_h", (track_atlasthit_max_p_z-mc_tracker_hit_atlasthit_max_p_z), weight); + + histos->Fill1DHisto("sim_track_atlasthit_p_diff_h", (track_atlasthit_max_p-mc_tracker_hit_atlasthit_max_p), weight); + histos->Fill1DHisto("sim_track_atlasthit_px_diff_h", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), weight); + histos->Fill1DHisto("sim_track_atlasthit_py_diff_h", (track_atlasthit_max_p_py-mc_tracker_hit_atlasthit_max_p_py), weight); + histos->Fill1DHisto("sim_track_atlasthit_pz_diff_h", (track_atlasthit_max_p_pz-mc_tracker_hit_atlasthit_max_p_pz), weight); + + histos->Fill2DHisto("sim_track_atlasthit_x_track_p_hh", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), track_atlasthit_max_p, weight); + histos->Fill2DHisto("sim_track_atlasthit_x_sim_p_hh", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), mc_tracker_hit_atlasthit_max_p, weight); + histos->Fill2DHisto("sim_track_atlasthit_x_ecal_energy_hh", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), ecal_max_energy, weight); + + histos->Fill2DHisto("sim_track_atlasthit_px_track_p_hh", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), track_atlasthit_max_p, weight); + histos->Fill2DHisto("sim_track_atlasthit_px_sim_p_hh", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), mc_tracker_hit_atlasthit_max_p, weight); + histos->Fill2DHisto("sim_track_atlasthit_px_ecal_energy_hh", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), ecal_max_energy, weight); + } + + tuples->fill(); + + // Regions + for (auto region : regions_ ) { + reg_selectors_[region]->getCutFlowHisto()->Fill(0.,weight); + if(debug_) std::cout<<"Check for region "<passCutEq("n_sim_eq", nParts, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of Sim Particles Eq cut"<passCutEq("n_track_eq", nReco_Tracks, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of Tracks Eq cut"<passCutGt("n_track_gt", nReco_Tracks, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of Tracks Gt cut"<passCutLt("n_track_lt", nReco_Tracks, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of Tracks Lt cut"<passCutEq("n_ecal_cluster_eq", nReco_Ecal_clusters, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of ECal Clusters Eq cut"<passCutGt("n_ecal_cluster_gt", nReco_Ecal_clusters, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of ECal Clusters Gt cut"<passCutLt("n_ecal_cluster_lt", nReco_Ecal_clusters, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of ECal Clusters Lt cut"<passCutGt("track_omega_gt", track_omega, weight) ) continue; + if(debug_) std::cout<<"Pass Track Omega Gt cut"<passCutLt("track_omega_lt", track_omega, weight) ) continue; + if(debug_) std::cout<<"Pass Track Omega Lt cut"<passCutGt("n_track_hits_gt", min_n_Track_hits, weight) ) continue; + if(debug_) std::cout<<"Pass Nr. of Track Hits Gt cut"<passCutEq("track_last_layer_eq", track_atlasthit_last_layer, weight) ) continue; + if(debug_) std::cout<<"Pass Track Last Layer of Hit Eq cut"<passCutGt("track_p_gt", track_p_list[i], weight) ){ + track_p_fail = 1; + break; + } + } + if (track_p_fail) continue; + if(debug_) std::cout<<"Pass Track pT Gt cut"<passCutGt("sim_p_gt", sim_p_list[i], weight) ){ + sim_p_fail = 1; + break; + } + } + if (sim_p_fail) continue; + if(debug_) std::cout<<"Pass Sim pT Gt cut"<passCutLt("sim_p_lt", sim_p_list[i], weight) ){ + sim_p_fail = 1; + break; + } + } + if (sim_p_fail) continue; + if(debug_) std::cout<<"Pass Sim pT Lt cut"<passCutGt("sim_pypz_gt", sim_pypz_list[i], weight) ){ + sim_pypz_fail = 1; + break; + } + } + if (sim_pypz_fail) continue; + if(debug_) std::cout<<"Pass Sim py/pz Gt cut"<passCutLt("sim_pypz_lt", sim_pypz_list[i], weight) ){ + sim_pypz_fail = 1; + break; + } + } + if (sim_pypz_fail) continue; + if(debug_) std::cout<<"Pass Sim py/pz Lt cut"<passCutGt("track_pypz_gt", track_atlasthit_pypz_list[i], weight) ){ + track_atlasthit_pypz_fail = 1; + break; + } + } + if (track_atlasthit_pypz_fail) continue; + if(debug_) std::cout<<"Pass Track at Last Hit py/pz Gt cut"<passCutLt("track_pypz_lt", track_atlasthit_pypz_list[i], weight) ){ + track_atlasthit_pypz_fail = 1; + break; + } + } + if (track_atlasthit_pypz_fail) continue; + if(debug_) std::cout<<"Pass Track at Last Hit py/pz Lt cut"<Fill1DHisto("numMCparts_h", (float)nParts, weight); + reg_histos_[region]->Fill1DHisto("numRecoTracks_h", (float)nReco_Tracks, weight); + reg_histos_[region]->Fill1DHisto("numSimTrackerHits_h", (float)nSim_Tracker_hits, weight); + reg_histos_[region]->Fill1DHisto("numSimEcalHits_h", (float)nSim_Ecal_hits, weight); + reg_histos_[region]->Fill1DHisto("numRecoTrackerClusters_h", (float)nReco_Tracker_clusters, weight); + reg_histos_[region]->Fill1DHisto("numRecoEcalClusters_h", (float)nReco_Ecal_clusters, weight); + //reg_tuples_[region]->setVariableValue("numMCparts", (float)nParts); + //reg_tuples_[region]->setVariableValue("numRecoTracks", (float)nReco_Tracks); + //reg_tuples_[region]->setVariableValue("numSimTrackerHits", (float)nSim_Tracker_hits); + //reg_tuples_[region]->setVariableValue("numSimEcalHits", (float)nSim_Ecal_hits); + //reg_tuples_[region]->setVariableValue("numRecoTrackerClusters", (float)nReco_Tracker_clusters); + //reg_tuples_[region]->setVariableValue("numRecoEcalClusters", (float)nReco_Ecal_clusters); + + for (int i=0; iat(i); + int gen = part->getGenStatus(); + if (gen != 1) + continue; + //reg_histos_[region]->FillMCParticle(part, reg_tuples_[region]); + reg_histos_[region]->FillMCParticle(part); + } + + for (int i=0; iat(i); + reg_histos_[region]->FillRecoTrack(track); + } + + for (int i=0; iat(i); + //reg_histos_[region]->FillRecoEcalCuster(ecal_cluster, reg_tuples_[region]); + reg_histos_[region]->FillRecoEcalCuster(ecal_cluster); + } + + if (track_max_p != -99999 && sim_max_p != -99999) + reg_histos_[region]->Fill2DHisto("track_sim_p_sim_p_hh", track_max_p/sim_max_p, sim_max_p, weight); + + if (sim_pxpz != -99999 && track_phi0 != -99999){ + reg_histos_[region]->Fill1DHisto("track_phi0_simpxpz_h", (track_phi0/sim_pxpz), weight); + reg_histos_[region]->Fill2DHisto("track_phi0_simpxpz_sim_p_hh", (track_phi0/sim_pxpz), sim_max_p, weight); + } + if (sim_pypz != -99999 && track_tanlamda != -99999){ + reg_histos_[region]->Fill1DHisto("track_tanlambda_simpypz_h", (track_tanlamda/sim_pypz), weight); + reg_histos_[region]->Fill2DHisto("track_tanlambda_simpypz_sim_p_hh", (track_tanlamda/sim_pypz), sim_max_p, weight); + } + if (sim_pxpz != -99999 && track_phi0 != -99999 && sim_pypz != -99999 && track_tanlamda != -99999) + reg_histos_[region]->Fill2DHisto("track_phi0_simpxpz_tanlambda_simpypz_hh", (track_phi0/sim_pxpz), (track_tanlamda/sim_pypz), weight); + if (track_max_p_ecal_x != -99999 && ecal_max_p_x != 99999){ + reg_histos_[region]->Fill1DHisto("track_ecal_x_diff_h", (track_max_p_ecal_x-ecal_max_p_x), weight); + reg_histos_[region]->Fill2DHisto("track_ecal_x_track_p_hh", (track_max_p_ecal_x-ecal_max_p_x), track_max_p, weight); + reg_histos_[region]->Fill2DHisto("track_ecal_x_sim_p_hh", (track_max_p_ecal_x-ecal_max_p_x), sim_max_p, weight); + reg_histos_[region]->Fill2DHisto("track_ecal_x_ecal_energy_hh", (track_max_p_ecal_x-ecal_max_p_x), ecal_max_energy, weight); + reg_histos_[region]->Fill2DHisto("track_ecal_x_ecal_x_hh", ecal_max_p_x, (track_max_p_ecal_x-ecal_max_p_x), weight); + } + if (mc_tracker_hit_ecal_max_p_x != -99999 && track_max_p_ecal_x != 99999){ + reg_histos_[region]->Fill1DHisto("sim_track_x_diff_h", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), weight); + reg_histos_[region]->Fill2DHisto("sim_track_x_track_p_hh", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), track_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_track_x_sim_p_hh", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), sim_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_track_x_ecal_energy_hh", (track_max_p_ecal_x-mc_tracker_hit_ecal_max_p_x), ecal_max_energy, weight); + } + if (mc_tracker_hit_ecal_max_p_x != -99999 && ecal_max_p_x != 99999){ + reg_histos_[region]->Fill1DHisto("sim_ecal_x_diff_h", (ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), weight); + reg_histos_[region]->Fill2DHisto("sim_ecal_x_track_p_hh", (ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), track_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_ecal_x_sim_p_hh", (ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), sim_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_ecal_x_ecal_energy_hh", (-ecal_max_p_x-mc_tracker_hit_ecal_max_p_x), ecal_max_energy, weight); + } + if (mc_tracker_hit_atlasthit_max_p_x != -99999 && track_atlasthit_max_p_x != -99999){ + reg_histos_[region]->Fill1DHisto("sim_track_atlasthit_x_diff_h", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), weight); + reg_histos_[region]->Fill1DHisto("sim_track_atlasthit_y_diff_h", (track_atlasthit_max_p_y-mc_tracker_hit_atlasthit_max_p_y), weight); + reg_histos_[region]->Fill1DHisto("sim_track_atlasthit_z_diff_h", (track_atlasthit_max_p_z-mc_tracker_hit_atlasthit_max_p_z), weight); + + reg_histos_[region]->Fill1DHisto("sim_track_atlasthit_p_diff_h", (track_atlasthit_max_p-mc_tracker_hit_atlasthit_max_p), weight); + reg_histos_[region]->Fill1DHisto("sim_track_atlasthit_px_diff_h", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), weight); + reg_histos_[region]->Fill1DHisto("sim_track_atlasthit_py_diff_h", (track_atlasthit_max_p_py-mc_tracker_hit_atlasthit_max_p_py), weight); + reg_histos_[region]->Fill1DHisto("sim_track_atlasthit_pz_diff_h", (track_atlasthit_max_p_pz-mc_tracker_hit_atlasthit_max_p_pz), weight); + + reg_histos_[region]->Fill2DHisto("sim_track_atlasthit_x_track_p_hh", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), track_atlasthit_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_track_atlasthit_x_sim_p_hh", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), mc_tracker_hit_atlasthit_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_track_atlasthit_x_ecal_energy_hh", (track_atlasthit_max_p_x-mc_tracker_hit_atlasthit_max_p_x), ecal_max_energy, weight); + + reg_histos_[region]->Fill2DHisto("sim_track_atlasthit_px_track_p_hh", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), track_atlasthit_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_track_atlasthit_px_sim_p_hh", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), mc_tracker_hit_atlasthit_max_p, weight); + reg_histos_[region]->Fill2DHisto("sim_track_atlasthit_px_ecal_energy_hh", (track_atlasthit_max_p_px-mc_tracker_hit_atlasthit_max_p_px), ecal_max_energy, weight); + } + + //reg_tuples_[region]->fill(); + } + + return true; +} + +void SimPartAnaProcessor::finalize() { + + outF_->cd(); + histos->saveHistos(outF_, "presel"); + outF_->cd("presel"); + if (EventSelector_) + EventSelector_->getCutFlowHisto()->Write(); + tuples->writeTree(); + outF_->cd(); + + for (reg_it it = reg_histos_.begin(); it!=reg_histos_.end(); ++it) { + std::string dirName = it->first; + (it->second)->saveHistos(outF_,dirName); + outF_->cd(dirName.c_str()); + reg_selectors_[it->first]->getCutFlowHisto()->Scale(0.5); + reg_selectors_[it->first]->getCutFlowHisto()->Write(); + //reg_tuples_[it->first]->writeTree(); + outF_->cd(); + } + outF_->Close(); +} + +DECLARE_PROCESSOR(SimPartAnaProcessor); diff --git a/processors/src/TrackingProcessor.cxx b/processors/src/TrackingProcessor.cxx index 146712391..ed82857b3 100644 --- a/processors/src/TrackingProcessor.cxx +++ b/processors/src/TrackingProcessor.cxx @@ -206,6 +206,8 @@ bool TrackingProcessor::process(IEvent* ievent) { // Add a reference to the hit track->addHit(tracker_hit); hits_.push_back(tracker_hit); + int hitLayer = tracker_hit->getLayer(); + track->addHitLayer(hitLayer); //Get shared Hits information for (int jtrack = itrack+1; jtrack < tracks->getNumberOfElements(); ++jtrack) { diff --git a/processors/src/utilities.cxx b/processors/src/utilities.cxx index 4ba738858..850d00aa5 100644 --- a/processors/src/utilities.cxx +++ b/processors/src/utilities.cxx @@ -166,7 +166,8 @@ Track* utils::buildTrack(EVENT::Track* lc_track, //TrackState Location map std::map trackstateLocationMap_ = { {"", EVENT::TrackState::AtIP}, - {"AtTarget", EVENT::TrackState::LastLocation} + {"AtTarget", EVENT::TrackState::LastLocation}, + {"AtLastHit", EVENT::TrackState::AtLastHit} }; int loc; @@ -296,7 +297,7 @@ Track* utils::buildTrack(EVENT::Track* lc_track, // Check that the TrackData data structure is correct. If it's // not, throw a runtime exception. - if (track_datum->getNDouble() > 14 || track_datum->getNFloat() > 7 || track_datum->getNInt() != 1) { + if (track_datum->getNDouble() > 14 || track_datum->getNFloat() > 9 || track_datum->getNInt() != 1) { throw std::runtime_error("[ TrackingProcessor ]: The collection " + std::string(Collections::TRACK_DATA) + " has the wrong structure."); @@ -327,6 +328,8 @@ Track* utils::buildTrack(EVENT::Track* lc_track, } if (loc == trackstateLocationMap_["AtCalorimeter"]) bfieldY = track_datum->getFloatVal(6); + if (loc == trackstateLocationMap_["AtLastHit"]) + bfieldY = track_datum->getFloatVal(7); //Bfield needs factor of -1, not sure why... <-TODO investigate track->setMomentum(-bfieldY); }