Collection of intranuke histograms. More...
Public Member Functions | |
INukeHists () | |
~INukeHists () | |
Public Attributes | |
std::vector< TH2F * > | offset |
std::vector< TH2F * > | from |
std::vector< TH2F * > | toMinus |
std::vector< TH2F * > | toPlus |
Collection of intranuke histograms.
Definition at line 167 of file NCEventInfo.h.
NCEventInfo::INukeHists::INukeHists | ( | ) |
Definition at line 59 of file NCEventInfo.cxx.
References base, from, gSystem(), Msg::kDebug, kDIS, Msg::kFatal, kQE, MSG, offset, toMinus, and toPlus.
00060 { 00061 //save the current working directory 00062 TDirectory* tmp = gDirectory; 00063 00064 // fCuts = new NCAnalysisCutsNC(); 00065 // fZbeam = new Zbeam(); 00066 // fZfluk = new Zfluk(); 00067 00068 // fSKZPWeight = new SKZPWeightCalculator(beamWeightConfig,true); 00069 // fZbeam->SetReweightConfig(beamWeightConfig); 00070 00071 // ---RPL 05/09/06: instantiate the mcReweight object now, and give 00072 // it a (neugen) weight calculator 00073 // Back this off; Brian says it should be done in the script. 00074 //MCReweight &mcReweight = MCReweight::Instance(); 00075 //fNeugenWeightCal = new NeugenWeightCalculator(); 00076 //mcReweight.AddWeightCalculator(fNeugenWeightCal); 00077 // --- 00078 00079 //gotta load shower energy weighting histograms from Mike K. 00080 TString scaleFromName = "integrated_smearing_histos_default.root"; 00081 TString scaleToNameMinus = "integrated_smearing_histos_1501.root"; 00082 TString scaleToNamePlus = "integrated_smearing_histos_1500.root"; 00083 TString offsetName = "integrated_smearing_histos_offset.root"; 00084 00085 TString topDir="MCReweight/data"; 00086 TString base=getenv("SRT_PRIVATE_CONTEXT"); 00087 if(base!="" && base!="."){ 00088 // check if directory exists in SRT_PRIVATE_CONTEXT 00089 TString path = base + "/" + topDir; 00090 void *dir_ptr = gSystem->OpenDirectory(path); 00091 if(!dir_ptr) base=getenv("SRT_PUBLIC_CONTEXT"); 00092 } 00093 // if it doesn't exist then use SRT_PUBLIC_CONTEXT 00094 else base=getenv("SRT_PUBLIC_CONTEXT"); 00095 00096 if(base==""){ 00097 MSG("NCUtils",Msg::kFatal) << "No SRT_PUBLIC_CONTEXT set" << endl; 00098 assert(false); 00099 } 00100 topDir = base+ "/" + topDir + "/"; 00101 00102 MSG("NCUtils",Msg::kDebug) 00103 << "Zbeam reading files from: " << topDir << endl; 00104 TFile scaleFileFrom(topDir+scaleFromName); 00105 TFile scaleFileToMinus(topDir+scaleToNameMinus); 00106 TFile scaleFileToPlus(topDir+scaleToNamePlus); 00107 TFile offsetFile(topDir+offsetName); 00108 00109 TString names[] = {"h_qe", "h_res", "h_dis"}; 00110 00111 TH2F *histFrom = dynamic_cast<TH2F *>(scaleFileFrom.Get(names[kQE])); 00112 TH2F *histToMinus = dynamic_cast<TH2F *>(scaleFileToMinus.Get(names[kQE])); 00113 TH2F *histToPlus = dynamic_cast<TH2F *>(scaleFileToPlus.Get(names[kQE])); 00114 TH2F *hist = dynamic_cast<TH2F *>(offsetFile.Get(names[kQE])); 00115 00116 for(int i = kQE; i < kDIS+1; ++i){ 00117 00118 histFrom = dynamic_cast<TH2F *>(scaleFileFrom.Get(names[i])); 00119 histToMinus = dynamic_cast<TH2F *>(scaleFileToMinus.Get(names[i])); 00120 histToPlus = dynamic_cast<TH2F *>(scaleFileToPlus.Get(names[i])); 00121 hist = dynamic_cast<TH2F *>(offsetFile.Get(names[i])); 00122 00123 MSG("NCEventInfo", Msg::kDebug) 00124 << histFrom->GetName() << " " 00125 << histToMinus->GetName() << " " 00126 << histToPlus->GetName() << " " 00127 << hist->GetName() << endl; 00128 00129 from.push_back(histFrom); 00130 toMinus.push_back(histToMinus); 00131 toPlus.push_back(histToPlus); 00132 offset.push_back(hist); 00133 00134 from[i]->SetDirectory(0); 00135 toMinus[i]->SetDirectory(0); 00136 toPlus[i]->SetDirectory(0); 00137 offset[i]->SetDirectory(0); 00138 00139 MSG("NCEventInfo", Msg::kDebug) 00140 << from[i]->GetName() << " " 00141 << toMinus[i]->GetName() << " " 00142 << toPlus[i]->GetName() << " " 00143 << offset[i]->GetName() << endl; 00144 00145 }//end loop to fill histograms 00146 00147 gDirectory = tmp; 00148 }
NCEventInfo::INukeHists::~INukeHists | ( | ) |
Definition at line 151 of file NCEventInfo.cxx.
References from, n, offset, toMinus, and toPlus.
00152 { 00153 for(unsigned int n = 0; n < offset.size(); ++n) delete offset[n]; 00154 for(unsigned int n = 0; n < from.size(); ++n) delete from[n]; 00155 for(unsigned int n = 0; n < toMinus.size(); ++n) delete toMinus[n]; 00156 for(unsigned int n = 0; n < toPlus.size(); ++n) delete toPlus[n]; 00157 }
std::vector<TH2F*> NCEventInfo::INukeHists::from |
Definition at line 172 of file NCEventInfo.h.
Referenced by INukeHists(), and ~INukeHists().
std::vector<TH2F*> NCEventInfo::INukeHists::offset |
Definition at line 171 of file NCEventInfo.h.
Referenced by INukeHists(), and ~INukeHists().
std::vector<TH2F*> NCEventInfo::INukeHists::toMinus |
Definition at line 173 of file NCEventInfo.h.
Referenced by INukeHists(), and ~INukeHists().
std::vector<TH2F*> NCEventInfo::INukeHists::toPlus |
Definition at line 174 of file NCEventInfo.h.
Referenced by INukeHists(), and ~INukeHists().