21 #include <calobase/RawTower.h> 
   22 #include <calobase/RawTowerv1.h> 
   45   new TCanvas(
"CheckItOut", 
"CheckItOut");
 
   47       "Sum$(G4HIT_HCALOUT.edep) + Sum$(G4HIT_ABSORBER_HCALOUT.edep)>>hSum_CEMC(30,0,30)");
 
   48   TH1 *hSum_CEMC = 
static_cast<TH1 *
>(gDirectory->GetObjectChecked(
"hSum_CEMC", 
"TH1"));
 
   50       "Total energy deposition in Outer HCal;Energy deposition (GeV)");
 
   58   T->SetAlias(
"PHG4Particle_p",
 
   59               "1*sqrt(PHG4Particle[].fpx**2+PHG4Particle[].fpy**2+PHG4Particle[].fpz**2)");
 
   60   T->SetAlias(
"PHG4Particle_eta",
 
   61               "0.5*log((PHG4Particle_p+PHG4Particle[].fpz)/(PHG4Particle_p-PHG4Particle[].fpz))");
 
   62   T->SetAlias(
"PHG4Particle_pT",
 
   63               "1*sqrt(PHG4Particle[].fpx**2+PHG4Particle[].fpy**2)");
 
   65   new TCanvas(
"AcessGeant4Particles", 
"AcessGeant4Particles");
 
   66   T->Draw(
"PHG4Particle_pT>>hPHG4Particle_pT(30,0,50)",
 
   67           "PHG4Particle[].trkid>0"   
   69   TH1 *hPHG4Particle_pT = 
static_cast<TH1 *
>(gDirectory->GetObjectChecked(
"hPHG4Particle_pT", 
"TH1"));
 
   70   hPHG4Particle_pT->SetTitle(
"pT for the first Geant4 particle;pT (GeV/c)");
 
   78   new TCanvas(
"WhereIsTheHits", 
"WhereIsTheHits");
 
   79   gPad->DrawFrame(-250, -250, 250, 250,
 
   80                   "Geant4 Hit distribution;X (cm);Y (cm)");
 
   82   T->Draw(
"G4HIT_SVTX.get_avg_y():G4HIT_SVTX.get_avg_x()", 
"", 
"* same");
 
   84       "G4HIT_ABSORBER_CEMC.get_avg_y():G4HIT_ABSORBER_CEMC.get_avg_x()>>hG4HIT_ABSORBER_CEMC(500,-250,250,500,-250,250)",
 
   87       "G4HIT_ABSORBER_HCALIN.get_avg_y():G4HIT_ABSORBER_HCALIN.get_avg_x()>>hG4HIT_ABSORBER_HCALIN(500,-250,250,500,-250,250)",
 
   90       "G4HIT_ABSORBER_HCALOUT.get_avg_y():G4HIT_ABSORBER_HCALOUT.get_avg_x()>>hG4HIT_ABSORBER_HCALOUT(500,-250,250,500,-250,250)",
 
   97   T->SetAlias(
"CEMC_Sample",
 
   98               "Sum$(G4HIT_CEMC.edep)/(Sum$(G4HIT_CEMC.edep) + Sum$(G4HIT_ABSORBER_CEMC.edep))");
 
   99   T->SetAlias(
"HCALIN_Sample",
 
  100               "Sum$(G4HIT_HCALIN.edep)/(Sum$(G4HIT_HCALIN.edep) + Sum$(G4HIT_ABSORBER_HCALIN.edep))");
 
  101   T->SetAlias(
"HCALOUT_Sample",
 
  102               "Sum$(G4HIT_HCALOUT.edep)/(Sum$(G4HIT_HCALOUT.edep) + Sum$(G4HIT_ABSORBER_HCALOUT.edep))");
 
  104   new TCanvas(
"PlotCalorimeterSamplingFraction", 
"PlotCalorimeterSamplingFraction");
 
  106   T->Draw(
"CEMC_Sample>>CEMC_Sample(30,0,.15)");
 
  107   TH1 *CEMC_Sample = 
static_cast<TH1 *
>(gDirectory->GetObjectChecked(
"CEMC_Sample", 
"TH1"));
 
  108   CEMC_Sample->SetLineColor(kRed);
 
  109   T->Draw(
"HCALIN_Sample>>HCALIN_Sample(30,0,.15)", 
"", 
"same");
 
  110   TH1 *HCALIN_Sample = 
static_cast<TH1 *
>(gDirectory->GetObjectChecked(
"HCALIN_Sample", 
"TH1"));
 
  111   HCALIN_Sample->SetLineColor(kMagenta);
 
  112   T->Draw(
"HCALOUT_Sample>>HCALOUT_Sample(30,0,.15)", 
"", 
"same");
 
  113   TH1 *HCALOUT_Sample = 
static_cast<TH1 *
>(gDirectory->GetObjectChecked(
"HCALOUT_Sample", 
"TH1"));
 
  114   HCALOUT_Sample->SetLineColor(kBlue);
 
  115   CEMC_Sample->SetTitle(
"Sampling fraction for three calorimeters; E_{Scint}/(E_{Scint} + E_{Absorber})");
 
  120   new TCanvas(
"AccessCalorimeterTowers", 
"AccessCalorimeterTowers");
 
  122   T->Draw(
"TOWER_CALIB_HCALOUT.get_bineta()>>hTowerBin(22,-0.5,21.5)", 
"TOWER_CALIB_HCALOUT.get_energy()");
 
  123   TH1 *hTowerBin = 
static_cast<TH1 *
>(gDirectory->GetObjectChecked(
"hTowerBin", 
"TH1"));
 
  124   hTowerBin->SetTitle(
"HCal tower eta bin distribution; Eta Bin # ; Sum energy in scintillator (GeV)");
 
  149     const TString infile =
 
  150         "https://www.phenix.bnl.gov/phenix/WWW/sPHENIX/tutorial/G4sPHENIX.root_DSTReader.root"  
  153   gSystem->Load(
"libg4dst.so");
 
  156   _file0 = TFile::Open(infile);
 
  158   T = (TTree *) 
_file0->GetObjectChecked(
"T", 
"TTree");