pimpCOLZ.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////
2 // //
3 // SECOND ANALYSIS //
4 // //
5 // Detector response //
6 // TH2 COLZ plots PECorr/cm vs W vs Cell //
7 // //
8 // Created by: Diana Patricia Mendez //
9 // 10 March 2016 //
10 // //
11 // Input files generated with COLZ.cxx //
12 ////////////////////////////////////////////////////////////////
13 
14 #include <iostream>
15 #include <TFile.h>
16 #include <TPad.h>
17 #include <TProfile.h>
18 #include <TProfile2D.h>
19 #include <TH1.h>
20 #include <TH2.h>
21 #include <TH3.h>
22 #include <TH1F.h>
23 #include <TH2F.h>
24 #include <TH3F.h>
25 #include <TH1D.h>
26 #include <TH2D.h>
27 #include <TH3D.h>
28 #include <TCanvas.h>
29 #include <TVector.h>
30 #include <TColor.h>
31 #include <TLegend.h>
32 #include <TLatex.h>
33 #include <TMath.h>
34 #include <TStyle.h>
35 #include <TROOT.h>
36 #include <TPad.h>
37 #include <TFile.h>
38 #include <TTree.h>
39 #include <TSystem.h>
40 #include <TColor.h>
41 
42 #include "Utilities/rootlogon.C"
43 
44 // canvas size
45 #define c1_x 700
46 #define c1_y 500
47 
48 #define c2_x 1000
49 #define c2_y 500
50 
51 
52 double GetHistMax(TH1* h0, TH1* h1, TH1* h2, TH1* h3){
53  double max[4];
54  max[0] = h0->GetMaximum();
55  max[1] = h1->GetMaximum();
56  max[2] = h2->GetMaximum();
57  max[3] = h3->GetMaximum();
58 
59  double hiy = 0;
60  for(int i=1;i<4;i++){
61  if(max[i]>hiy)
62  hiy = max[i];
63  }
64  return (hiy * 1.1);
65 }
66 
67 
68 int main(){
69 
70  gROOT->ForceStyle();
71 
72 
73  //Normalization constants = MEUs for each set
74  double const fdmcg100 = 1;
75  // double const fdmcg100 = 40.2581;
76 
77  TFile *fmc_gain100 = new TFile("FD_WCellResponse_mcg100.root");
78  TH2D *hfdmc_gain100_PECorrWX1 = (TH2D*)fmc_gain100->Get("hPECorrCellPlaneX");
79  TH2D *hfdmc_gain100_PECorrWY1 = (TH2D*)fmc_gain100->Get("hPECorrCellPlaneY");
80 
81 
82 
83  ////////////////////////////////////////////
84  // W vs Cell vs Response //
85  // PROF COLZ Plots //
86  ////////////////////////////////////////////
87 
88 
89  TCanvas *cFDMC_PlaneCellX_mcg100 = new TCanvas("cFDMC_PlaneCellX","cFDMC_PlaneCellX", 700, 500);
90  cFDMC_PlaneCellX_mcg100->SetRightMargin(0.15);
91  hfdmc_gain100_PECorrWX1->GetXaxis()->SetTitle("W, x-view (cm)");
92  hfdmc_gain100_PECorrWX1->GetYaxis()->SetTitle("Cell");
93  hfdmc_gain100_PECorrWX1->GetZaxis()->SetRangeUser(0,80);
94  hfdmc_gain100_PECorrWX1->GetZaxis()->SetTitle("PECorr/cm");
95  CenterTitles(hfdmc_gain100_PECorrWX1);
96  hfdmc_gain100_PECorrWX1->Draw("colz");
97  // NovaFD();
98  Simulation();
99 
100  cFDMC_PlaneCellX_mcg100 -> Print("cFDmcgain100_WCellPECorrX.pdf");
101  cFDMC_PlaneCellX_mcg100 -> Print("cFDmcgain100_WCellPECorrX.png");
102 
103 }
104 
106  return main();
107 }
108 
109 
110 
void Simulation()
Definition: tools.h:16
int respCOLZ_WCell()
Definition: pimpCOLZ.cxx:105
TH1F * h3
Definition: berger.C:36
int main()
Definition: pimpCOLZ.cxx:68
double GetHistMax(TH1 *h0, TH1 *h1, TH1 *h2, TH1 *h3)
Definition: pimpCOLZ.cxx:52
void CenterTitles(TH1 *h)
TH1F * h2
Definition: plot.C:45
void Print(std::string prefix, std::string name, std::string suffix="")
Definition: nue_pid_effs.C:68
TH1F * h1
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:66