1 #include "SetOKStyle.C"
17 bins[
i] = 0. +
i * 2. / (
float)(nbins-1);
20 gSystem->Load(
"libPrototype3.so");
21 gSystem->Load(
"libProto3ShowCalib.so");
24 TFile *
f =TFile::Open(
"allfmods.root");
25 tree = (TTree*)f->Get(
"T");
41 for(
int j=0;
j<nbins-1;
j++){
43 name<<
"response_3x3_fmodeta_"<<
i<<
"_fmodphi_"<<
j;
48 name<<
"response_5x5_fmodeta_"<<
i<<
"_fmodphi_"<<
j;
58 TFile *
outfile =
new TFile(
"fmodoutfile.root",
"recreate");
60 for(
int j=0;
j<nbins-1;
j++){
70 file3x3.open(
"3x3clus_posdep_recals_fromsim.txt");
74 for(
int j=0;
j<nbins-1;
j++){
84 file5x5.open(
"5x5clus_posdep_recals_fromsim.txt");
86 for(
int i=0;
i<nbins-1;
i++){
87 for(
int j=0;
j<nbins-1;
j++){
101 for(
int j=0;
j<nbins-1;
j++){
104 name<<
"fit3x3_eta_"<<
i<<
"_phi_"<<
j;
105 fits3x3[
i][
j] =
new TF1(name.str().c_str(),
"gaus",
112 name<<
"fit5x5_eta_"<<
i<<
"_phi_"<<
j;
113 fits5x5[
i][
j] =
new TF1(name.str().c_str(),
"gaus",
127 cout<<
"3x3: "<<
i<<
"_"<<j<<endl;
129 cout<<
"5x5: "<<
i<<
"_"<<j<<endl;
147 tree->SetBranchAddress(
"clus_3x3_prod",&prod3x3);
148 tree->SetBranchAddress(
"clus_5x5_prod",&prod5x5);
149 tree->SetBranchAddress(
"info",&run);
152 for(
int i=0;
i<
tree->GetEntries();
i++){
159 float sume3x3 = prod3x3->
getsumE();
163 float sume5x5 = prod5x5->
getsumE();
165 int fmodphi3x3bin = -99;
166 int fmodeta3x3bin = -99;
167 int fmodphi5x5bin = -99;
168 int fmodeta5x5bin = -99;
171 if(fmodphi3x3>
bins[
j] && fmodphi3x3<=
bins[
j+1])
173 for(
int j=0;
j<nbins-1;
j++)
174 if(fmodeta3x3>
bins[
j] && fmodeta3x3<=
bins[
j+1])
176 for(
int j=0;
j<nbins-1;
j++)
177 if(fmodphi5x5>
bins[
j] && fmodphi5x5<=
bins[
j+1])
179 for(
int j=0;
j<nbins-1;
j++)
180 if(fmodeta5x5>
bins[
j] && fmodeta5x5<=
bins[
j+1])
183 if(fmodphi3x3bin>=0 && fmodeta3x3bin>=0){
189 if(fmodphi5x5bin>=0 && fmodeta5x5bin>=0){
207 TH1F * hbeam_mom =
new TH1F(
"hbeam_mom",
";beam momentum (GeV)",
211 TCanvas *c1 =
new TCanvas(
"GetBeamMom",
"GetBeamMom", 1800, 900);
213 tree->Draw(
"abs(info.beam_mom)>>hbeam_mom");
215 for (
int bin = 1; bin < hbeam_mom->GetNbinsX(); bin++)
217 if (hbeam_mom->GetBinContent(bin) > 40)
219 const double momentum = hbeam_mom->GetBinCenter(bin);
221 if (momentum == 1 || momentum == 2 || momentum == 3 || momentum == 4
222 || momentum == 6 || momentum == 8 || momentum == 12
223 || momentum == 16 || momentum == 24 || momentum == 32)
225 mom.push_back(momentum);
227 cout <<
"GetBeamMom - " << momentum <<
" GeV for "
228 << hbeam_mom->GetBinContent(bin) <<
" event" << endl;