Functions
append.C File Reference
#include "TROOT.h"
#include "TObject.h"
#include "TH2.h"
#include "TH1.h"
#include "TMatrix.h"
#include "TMatrixD.h"
#include "TFile.h"
#include <iostream>
#include <algorithm>
#include <string>

Go to the source code of this file.

Functions

void append ()
 

Function Documentation

void append ( )

Definition at line 24 of file append.C.

References MECModelEnuComparisons::i, inFile, calib::j, string, and febshutoff_auto::val.

Referenced by pclistAnalyser::add_to_children(), raw2rootAnalyser::analyse(), pclistAnalyser::analyse(), lemmon_tools::appendStatus(), boost::python::vector_indexing_suite< Container, NoProxy, final_vector_derived_policies< Container, NoProxy > >::base_append(), runNovaSAM::checkAndMoveFiles(), ProductionTestTools::crontabToGantt(), log_trawl.Project::decomposeModes(), ProductionTestTools::directoryToGantt(), ControllerView.ControllerView::draw_component_plots(), bp::FindChanges(), bp::FindFiles(), ProductionTestTools::findMissingFiles(), ViewHTML::foldersToButtonGroups(), generic.tools.HistogramTools::getPlotStats(), common_tools::getPlotStats(), lem_server::handle_get_work(), lem_server::handle_pid(), log_trawl.Project::inspectProcs(), PandAna.utils.sadd_pandana::main(), FirstAnaPageMakers::makeDatasetPage(), PageMakers::makeResultsPage(), runNovaSAM::MakeTransposeJson(), PageMakers::makeValidationPage(), SupernovaUtilities::ParseSNDFile(), PandAna.core.core.loader::readData(), SupernovaUtilities::ReadGarchingLegacyFluxes(), SamTimer.SamTimer::record_time(), ViewHTML::samProjectCollectionToTable(), and validateGRLvsSAM::validate().

25 {
26 
27  // file where xsec is scaled up
28  std::string inName =
29  "<MY_INPUTS>/C_PiMinus_fit.root";
30 
31  TFile *inFile = new TFile(inName.c_str(), "UPDATE");
32 
33 
34  TMatrixT<double> *FitCovariance = (TMatrixT<double>*)inFile->Get("FitCovariance");
35 
36  FitCovariance->ResizeTo(6,6);
37 
38  // Set diagonal entry to (sigma)**2, all the others stay as zero
39  double cov_value = 0.2*0.2;
40 
41  (*FitCovariance)(4,4) = cov_value;
42  (*FitCovariance)(5,5) = cov_value;
43 
44  FitCovariance->Write("FitCovariance", TObject::kOverwrite);
45 
46 
47  std::vector existing_ints{"fAbs", "fCex", "fInel", "fReac"};
48  TH1D* parsHist = (TH1D*)inFile->Get("parsHist");
49  TH1D new_parsHist("new_parsHist", "", 6, 0, 6);
50 
51  TH2D* FitCovHist = (TH2D*)inFile->Get("FitCovHist");
52  TH2D new_FitCovHist("new_FitCovHist", "", 6, 0, 6, 6, 0, 6);
53 
54 
55  for(uint i=0; i<existing_ints.size(); ++i){
56  double val = parsHist->GetBinContent(i+1);
57  double err = parsHist->GetBinError(i+1);
58  //std::cout << i+1 << " = " << val << " +/- " << err << std::endl;
59  new_parsHist.SetBinContent(i+1, val);
60  new_parsHist.GetXaxis()->SetBinLabel( i+1, existing_ints.at(i));
61  new_parsHist.SetBinError(i+1, err);
62 
63  new_FitCovHist.GetXaxis()->SetBinLabel( i+1, existing_ints.at(i));
64  new_FitCovHist.GetYaxis()->SetBinLabel( i+1, existing_ints.at(i));
65 
66  for(uint j=0; j<existing_ints.size(); ++j){
67  double cov_val = FitCovHist->GetBinContent(i+1, j+1);
68  new_FitCovHist.SetBinContent(i+1, j+1, cov_val);
69  }
70 
71  }
72 
73  new_parsHist.SetBinContent(5, 1.);
74  new_parsHist.GetXaxis()->SetBinLabel( 5, "fDcex");
75  new_parsHist.SetBinError(5, 0.2);
76 
77  new_parsHist.SetBinContent(6, 1.);
78  new_parsHist.GetXaxis()->SetBinLabel( 6, "fProd");
79  new_parsHist.SetBinError(6, 0.2);
80 
81  new_parsHist.Write("parsHist", TObject::kOverwrite);
82 
83 
84  new_FitCovHist.SetBinContent(5, 5, cov_value);
85  new_FitCovHist.GetXaxis()->SetBinLabel(5, "fDcex");
86  new_FitCovHist.GetYaxis()->SetBinLabel(5, "fDcex");
87 
88  new_FitCovHist.SetBinContent(6, 6, cov_value);
89  new_FitCovHist.GetXaxis()->SetBinLabel(6, "fProd");
90  new_FitCovHist.GetYaxis()->SetBinLabel(6, "fProd");
91 
92  new_FitCovHist.Write("FitCovHist", TObject::kOverwrite);
93 
94 
95  inFile->Close();
96 
97 }
ifstream inFile
Definition: AnaPlotMaker.h:34
const double j
Definition: BetheBloch.cxx:29
enum BeamMode string
unsigned int uint