Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Plot-Measured_Energy-EMC.C File Reference
#include <iostream>
#include <cstdlib>
#include <memory>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <cassert>
#include "TFile.h"
#include "TTree.h"
#include "TCanvas.h"
#include "TLegend.h"
#include "TROOT.h"
#include "TH1F.h"
#include "TColor.h"
#include "TImage.h"
#include "/sphenix/user/gregtom3/SBU/research/macros/macros/sPHENIXStyle/sPhenixStyle.C"
+ Include dependency graph for Plot-Measured_Energy-EMC.C:

Go to the source code of this file.

Macros

#define NELEMS(arr)   (sizeof(arr)/sizeof(arr[0]))
 

Enumerations

enum  particle_type {
  electron, pion, electron, pion,
  electron, pion
}
 
enum  detector {
  cemc, eemc, femc, cemc,
  eemc, femc, cemc, eemc,
  femc
}
 

Functions

TTree * load_tree (const char *const file_name, const char *const tree_name)
 
void draw_histogram (TH1F *const h, const particle_type p, const int energy_level_gev, const detector d)
 
void fill_histogram (TH1F *const h, TTree *const t, const Float_t min_value)
 
char * generate_histogram_name (const particle_type p, const int particle_energy_gev, const detector d)
 
char * generate_file_path (const particle_type p, const int particle_energy_gev, const detector d)
 
char * generate_save_file_path (const particle_type p)
 
char * generate_canvas_name (const particle_type p)
 
char * generate_canvas_title (const particle_type p)
 
char * generate_legend_header (const particle_type p, const detector d)
 
char * generate_legend_entry_label (const int particle_energy_gev)
 
void Plot_Measured_Energy_EMC ()
 
char * strdup (const char *s)
 

Variables

const char *const data_directory
 
static const int energy_levels [] = { 1, 2, 5, 10, 20 }
 
static const int color_offsets [] = { -10, -9, -7, -4, 0 }
 
static const enum detector detectors [] = { cemc, eemc, femc }
 
static const enum particle_type particles [] = { pion, electron }
 
static const Color_t plot_colors [] = { kBlue, kRed, kGreen, kOrange, kViolet }
 
const int nenergy_levels = NELEMS(energy_levels)
 
const int ndetectors = NELEMS(detectors)
 
const int nparticles = NELEMS(particles)
 

Macro Definition Documentation

#define NELEMS (   arr)    (sizeof(arr)/sizeof(arr[0]))

Definition at line 24 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 24 of file Plot-Measured_Energy-EMC.C

Referenced by Plot_Measured_Energy_EMC().

Enumeration Type Documentation

enum detector
Enumerator:
cemc 
eemc 
femc 
cemc 
eemc 
femc 
cemc 
eemc 
femc 

Definition at line 29 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 29 of file Plot-Measured_Energy-EMC.C

Enumerator:
electron 
pion 
electron 
pion 
electron 
pion 

Definition at line 27 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 27 of file Plot-Measured_Energy-EMC.C

Function Documentation

void draw_histogram ( TH1F *const  h,
const particle_type  p,
const int  energy_level_gev,
const detector  d 
)

Definition at line 150 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 150 of file Plot-Measured_Energy-EMC.C

References fill_histogram(), generate_file_path(), generate_histogram_name(), load_tree(), and t.

Referenced by Plot_Measured_Energy_EMC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fill_histogram ( TH1F *const  h,
TTree *const  t,
const Float_t  min_value 
)

Definition at line 181 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 181 of file Plot-Measured_Energy-EMC.C

References i.

char * generate_canvas_name ( const particle_type  p)

Definition at line 297 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 297 of file Plot-Measured_Energy-EMC.C

References electron, pion, and strdup().

Referenced by Plot_Measured_Energy_EMC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char * generate_canvas_title ( const particle_type  p)

Definition at line 313 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 313 of file Plot-Measured_Energy-EMC.C

References electron, pion, and strdup().

Referenced by Plot_Measured_Energy_EMC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char* generate_file_path ( const particle_type  p,
const int  particle_energy_gev,
const detector  d 
)
char * generate_histogram_name ( const particle_type  p,
const int  particle_energy_gev,
const detector  d 
)

Definition at line 205 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 205 of file Plot-Measured_Energy-EMC.C

References cemc, eemc, electron, perf_headwind::name, pion, and strdup().

Referenced by draw_histogram(), and Plot_Measured_Energy_EMC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char * generate_legend_entry_label ( const int  particle_energy_gev)

Definition at line 357 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 357 of file Plot-Measured_Energy-EMC.C

References strdup().

Referenced by Plot_Measured_Energy_EMC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char * generate_legend_header ( const particle_type  p,
const detector  d 
)

Definition at line 329 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 329 of file Plot-Measured_Energy-EMC.C

References cemc, eemc, electron, femc, pion, and strdup().

Referenced by Plot_Measured_Energy_EMC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char * generate_save_file_path ( const particle_type  p)

Definition at line 265 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 265 of file Plot-Measured_Energy-EMC.C

References cemc, detectors, eemc, electron, femc, perf_headwind::name, ndetectors, pion, and strdup().

Referenced by Plot_Measured_Energy_EMC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TTree* load_tree ( const char *const  file_name,
const char *const  tree_name 
)
void Plot_Measured_Energy_EMC ( )

Definition at line 68 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 68 of file Plot-Measured_Energy-EMC.C

References assert, Acts::PhysicalConstants::c, detectors, draw_histogram(), Acts::UnitConstants::e, energy_levels, generate_canvas_name(), generate_canvas_title(), generate_histogram_name(), generate_legend_entry_label(), generate_legend_header(), generate_save_file_path(), h, i, ndetectors, NELEMS, nenergy_levels, nparticles, merge_hashes::p, particles, path, plot_colors, and SetsPhenixStyle().

+ Here is the call graph for this function:

char* strdup ( const char *  s)

Definition at line 199 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 199 of file Plot-Measured_Energy-EMC.C

References t.

Variable Documentation

const int color_offsets[] = { -10, -9, -7, -4, 0 }
static

Definition at line 52 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 52 of file Plot-Measured_Energy-EMC.C

const char* const data_directory
Initial value:
=
"/sphenix/user/gregtom3/data/Summer2018/ECAL_energy_studies"

Definition at line 46 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 46 of file Plot-Measured_Energy-EMC.C

const int energy_levels[] = { 1, 2, 5, 10, 20 }
static

Definition at line 49 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 49 of file Plot-Measured_Energy-EMC.C

Referenced by Plot_Measured_Energy_EMC().

const int ndetectors = NELEMS(detectors)

Definition at line 65 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 65 of file Plot-Measured_Energy-EMC.C

Referenced by generate_save_file_path(), histogram_to_png(), and Plot_Measured_Energy_EMC().

const int nenergy_levels = NELEMS(energy_levels)

Definition at line 64 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 64 of file Plot-Measured_Energy-EMC.C

Referenced by Plot_Measured_Energy_EMC().

const enum particle_type particles[] = { pion, electron }
static

Definition at line 58 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 58 of file Plot-Measured_Energy-EMC.C

Referenced by Acts::Python::addGenerators(), SvtxTrackEval::all_tracks_from(), SvtxClusterEval::all_truth_clusters(), JetRecoEval::all_truth_jets(), SvtxVertexEval::all_truth_points(), KFParticle_eventReconstruction::buildChain(), SvtxTrackEval::calc_cluster_contribution(), ActsExamples::ParticlesPrinter::execute(), ActsExamples::TruthVertexFinder::execute(), ActsExamples::TruthTrackFinder::execute(), ActsExamples::ParticleSmearing::execute(), ActsExamples::TruthSeedingAlgorithm::execute(), FastJetAlgo::FastJetAlgo(), SvtxClusterEval::FillRecoClusterFromG4HitCache(), ActsExamples::HepMC3Event::finalState(), ResonanceJetTagging::findMCTaggedJets(), SColdQcdCorrelatorAnalysis::SCorrelatorJetTree::FindRecoJets(), ResonanceJetTagging::findTaggedJets(), SColdQcdCorrelatorAnalysis::SCorrelatorJetTree::FindTrueJets(), Fun4All_G4_EICDetector_LQ(), Fun4All_G4_EICDetector_LQ_reference(), Fun4All_G4_EICDetector_RICH(), Fun4All_G4_sPHENIX_photonjet(), Fun4All_G4_sPHENIX_photons(), Fun4All_G4_sPHENIX_truthphotonjet(), Fun4All_Generator_Display(), SvtxTrackEval::get_layer_range_contribution(), SvtxTrackEval::get_nclusters_contribution_by_layer(), KFParticle_eventReconstruction::getCandidateDecay(), ParticleReader::getParticles(), hijfst_(), KFParticleTopoReconstructor::Init(), main(), SvtxClusterEval::max_truth_particle_by_cluster_energy(), SvtxHitEval::max_truth_particle_by_energy(), SvtxClusterEval::max_truth_particle_by_energy(), SvtxTrackEval::max_truth_particle_by_nclusters(), ActsExamples::ParametricParticleGenerator::operator()(), Plot_Measured_Energy_EMC(), PHAJMaker::process_event(), EMJetVal::process_event(), ActsExamples::EDM4hepParticleReader::read(), ActsExamples::CsvParticleReader::read(), ActsExamples::EDM4hepSimHitReader::read(), ActsExamples::EventGenerator::read(), ActsFatras::NuclearInteraction::run(), Jetscape::JetScapeWriterFinalStateStream< T >::Write(), Jetscape::JetScapeWriterFinalStateStream< T >::WriteEvent(), ActsExamples::TrackFinderPerformanceWriter::writeT(), ActsExamples::EDM4hepSimHitWriter::writeT(), ActsExamples::SeedingPerformanceWriter::writeT(), ActsExamples::TrackFitterPerformanceWriter::writeT(), ActsExamples::RootTrackParameterWriter::writeT(), ActsExamples::CKFPerformanceWriter::writeT(), ActsExamples::RootTrajectorySummaryWriter::writeT(), and ActsExamples::RootTrajectoryStatesWriter::writeT().

const Color_t plot_colors[] = { kBlue, kRed, kGreen, kOrange, kViolet }
static

Definition at line 61 of file Plot-Measured_Energy-EMC.C.

View newest version in sPHENIX GitHub at line 61 of file Plot-Measured_Energy-EMC.C

Referenced by Plot_Measured_Energy_EMC().