Skip to content

Commit

Permalink
Remove heap pointers from ZFinderPlotter::Print
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Gude committed May 3, 2014
1 parent 5a8e253 commit 35b0c8d
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions ZFinder/Event/src/ZFinderPlotter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,93 +212,93 @@ namespace zf {
void ZFinderPlotter::Print(const std::string& basename) {
// Write all PNGs
std::string z0_mass_all_Str = basename + "_z0_mass_all" ;
TCanvas* z0_mass_all_C = new TCanvas(z0_mass_all_Str.c_str(), z0_mass_all_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas z0_mass_all_C(z0_mass_all_Str.c_str(), z0_mass_all_Str.c_str(), X_SIZE, Y_SIZE);
z0_mass_all_->Draw();
z0_mass_all_C->Print((z0_mass_all_Str+".png").c_str());
z0_mass_all_C.Print((z0_mass_all_Str+".png").c_str());

std::string z0_mass_coarse_Str = basename + "_z0_mass_coarse" ;
TCanvas* z0_mass_coarse_C = new TCanvas(z0_mass_coarse_Str.c_str(), z0_mass_coarse_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas z0_mass_coarse_C(z0_mass_coarse_Str.c_str(), z0_mass_coarse_Str.c_str(), X_SIZE, Y_SIZE);
z0_mass_coarse_->Draw();
z0_mass_coarse_C->Print((z0_mass_coarse_Str+".png").c_str());
z0_mass_coarse_C.Print((z0_mass_coarse_Str+".png").c_str());

std::string z0_mass_fine_Str = basename + "_z0_mass_fine";
TCanvas* z0_mass_fine_C = new TCanvas(z0_mass_fine_Str.c_str(), z0_mass_fine_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas z0_mass_fine_C(z0_mass_fine_Str.c_str(), z0_mass_fine_Str.c_str(), X_SIZE, Y_SIZE);
z0_mass_fine_->Draw();
z0_mass_fine_C->Print((z0_mass_fine_Str+".png").c_str());
z0_mass_fine_C.Print((z0_mass_fine_Str+".png").c_str());

std::string z0_rapidity_Str = basename + "_z0_rapidity";
TCanvas* z0_rapidity_C = new TCanvas(z0_rapidity_Str.c_str(), z0_rapidity_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas z0_rapidity_C(z0_rapidity_Str.c_str(), z0_rapidity_Str.c_str(), X_SIZE, Y_SIZE);
z0_rapidity_->Draw();
z0_rapidity_C->Print((z0_rapidity_Str+".png").c_str());
z0_rapidity_C.Print((z0_rapidity_Str+".png").c_str());

std::string z0_ptStr = basename + "_z0_pt";
TCanvas* z0_ptC = new TCanvas(z0_ptStr.c_str(), z0_ptStr.c_str(), X_SIZE, Y_SIZE);
TCanvas z0_ptC(z0_ptStr.c_str(), z0_ptStr.c_str(), X_SIZE, Y_SIZE);
z0_pt_->Draw();
z0_ptC->Print((z0_ptStr+".png").c_str());
z0_ptC.Print((z0_ptStr+".png").c_str());

std::string e0_ptStr = basename + "_e0_pt";
TCanvas* e0_ptC = new TCanvas(e0_ptStr.c_str(), e0_ptStr.c_str(), X_SIZE, Y_SIZE);
TCanvas e0_ptC(e0_ptStr.c_str(), e0_ptStr.c_str(), X_SIZE, Y_SIZE);
e0_pt_->Draw();
e0_ptC->Print((e0_ptStr+".png").c_str());
e0_ptC.Print((e0_ptStr+".png").c_str());

std::string e1_ptStr = basename + "_e1_pt";
TCanvas* e1_ptC = new TCanvas(e1_ptStr.c_str(), e1_ptStr.c_str(), X_SIZE, Y_SIZE);
TCanvas e1_ptC(e1_ptStr.c_str(), e1_ptStr.c_str(), X_SIZE, Y_SIZE);
e1_pt_->Draw();
e1_ptC->Print((e1_ptStr+".png").c_str());
e1_ptC.Print((e1_ptStr+".png").c_str());

std::string e0_eta_Str = basename + "_e0_eta";
TCanvas* e0_eta_C = new TCanvas(e0_eta_Str.c_str(), e0_eta_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas e0_eta_C(e0_eta_Str.c_str(), e0_eta_Str.c_str(), X_SIZE, Y_SIZE);
e0_eta_->Draw();
e0_eta_C->Print((e0_eta_Str+".png").c_str());
e0_eta_C.Print((e0_eta_Str+".png").c_str());

std::string e1_eta_Str = basename + "_e1_eta";
TCanvas* e1_eta_C = new TCanvas(e1_eta_Str.c_str(), e1_eta_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas e1_eta_C(e1_eta_Str.c_str(), e1_eta_Str.c_str(), X_SIZE, Y_SIZE);
e1_eta_->Draw();
e1_eta_C->Print((e1_eta_Str+".png").c_str());
e1_eta_C.Print((e1_eta_Str+".png").c_str());

std::string e0_phi_Str = basename + "_e0_phi";
TCanvas* e0_phi_C = new TCanvas(e0_phi_Str.c_str(), e0_phi_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas e0_phi_C(e0_phi_Str.c_str(), e0_phi_Str.c_str(), X_SIZE, Y_SIZE);
e0_phi_->Draw();
e0_phi_C->Print((e0_phi_Str+".png").c_str());
e0_phi_C.Print((e0_phi_Str+".png").c_str());

std::string e1_phi_Str = basename + "_e1_phi";
TCanvas* e1_phi_C = new TCanvas(e1_phi_Str.c_str(), e1_phi_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas e1_phi_C(e1_phi_Str.c_str(), e1_phi_Str.c_str(), X_SIZE, Y_SIZE);
e1_phi_->Draw();
e1_phi_C->Print((e1_phi_Str+".png").c_str());
e1_phi_C.Print((e1_phi_Str+".png").c_str());

std::string e0_charge_Str = basename + "_e0_charge";
TCanvas* e0_charge_C = new TCanvas(e0_charge_Str.c_str(), e0_charge_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas e0_charge_C(e0_charge_Str.c_str(), e0_charge_Str.c_str(), X_SIZE, Y_SIZE);
e0_charge_->Draw();
e0_charge_C->Print((e0_charge_Str+".png").c_str());
e0_charge_C.Print((e0_charge_Str+".png").c_str());

std::string e1_charge_Str = basename + "_e1_charge";
TCanvas* e1_charge_C = new TCanvas(e1_charge_Str.c_str(), e1_charge_Str.c_str(), X_SIZE, Y_SIZE);
TCanvas e1_charge_C(e1_charge_Str.c_str(), e1_charge_Str.c_str(), X_SIZE, Y_SIZE);
e1_charge_->Draw();
e1_charge_C->Print((e1_charge_Str+".png").c_str());
e1_charge_C.Print((e1_charge_Str+".png").c_str());

std::string phistarStr = basename + "_phistar";
TCanvas* phistarC = new TCanvas(phistarStr.c_str(), phistarStr.c_str(), X_SIZE, Y_SIZE);
TCanvas phistarC(phistarStr.c_str(), phistarStr.c_str(), X_SIZE, Y_SIZE);
phistar_->Draw();
phistarC->Print((phistarStr+".png").c_str());
phistarC.Print((phistarStr+".png").c_str());

std::string pileupStr = basename + "_pileup";
TCanvas* pileupC = new TCanvas(pileupStr.c_str(), pileupStr.c_str(), X_SIZE, Y_SIZE);
TCanvas pileupC(pileupStr.c_str(), pileupStr.c_str(), X_SIZE, Y_SIZE);
pileup_->Draw();
pileupC->Print((pileupStr+".png").c_str());
pileupC.Print((pileupStr+".png").c_str());

std::string nelectronsStr = basename + "_nelectrons";
TCanvas* nelectronsC = new TCanvas(nelectronsStr.c_str(), nelectronsStr.c_str(), X_SIZE, Y_SIZE);
TCanvas nelectronsC(nelectronsStr.c_str(), nelectronsStr.c_str(), X_SIZE, Y_SIZE);
nelectrons_->Draw();
nelectronsC->Print((nelectronsStr+".png").c_str());
nelectronsC.Print((nelectronsStr+".png").c_str());

std::string baseweightsStr = basename + "_baseweights";
TCanvas* baseweightsC = new TCanvas(baseweightsStr.c_str(), baseweightsStr.c_str(), X_SIZE, Y_SIZE);
TCanvas baseweightsC(baseweightsStr.c_str(), baseweightsStr.c_str(), X_SIZE, Y_SIZE);
baseweights_->Draw();
baseweightsC->Print((baseweightsStr+".png").c_str());
baseweightsC.Print((baseweightsStr+".png").c_str());

std::string fullweightsStr = basename + "_fullweights";
TCanvas* fullweightsC = new TCanvas(fullweightsStr.c_str(), fullweightsStr.c_str(), X_SIZE, Y_SIZE);
TCanvas fullweightsC(fullweightsStr.c_str(), fullweightsStr.c_str(), X_SIZE, Y_SIZE);
fullweights_->Draw();
fullweightsC->Print((fullweightsStr+".png").c_str());
fullweightsC.Print((fullweightsStr+".png").c_str());
}
} // namespace zf

0 comments on commit 35b0c8d

Please sign in to comment.