#include <SysFileGen2D.h>
Public Member Functions | |
| SysFileGen2D () | |
| virtual | ~SysFileGen2D () |
| void | Initialize () |
| void | AddSystematic (std::string sys) |
| void | SetOutputFile (std::string name="DefaultOut.root") |
| void | SetNearPOT (double pot=1e19) |
| void | SetFarPOT (double pot=3.14e20) |
| void | AddPID (std::string pid) |
| void | SetCutLevel (Selection::Selection_t s=Selection::kPre) |
| double | GetNueRecoEnergy (NueRecord *nr) |
| double | GetCCRecoEnergy (NueRecord *nr) |
| std::string | GetCurrentSysName () |
| void | ResetHistograms () |
| void | WriteToFile () |
| virtual void | FillHistograms () |
| void | RunSystematics () |
Public Attributes | |
| std::map< Background::Background_t, SysHists2D * > | fSysHistsMap |
Private Member Functions | |
| void | InitializeHistograms () |
| void | FinalizeHistograms () |
| void | SetDefaultOsc () |
Private Attributes | |
| vector< std::string > | fSysNames |
| std::string | fCurrentSysName |
| Selection::Selection_t | CutLevel |
| std::string | outFileName |
| double | fNearPOT |
| double | fFarPOT |
| vector< std::string > | PIDlist |
| TFile * | fout |
| TTree * | paramtree |
| double | Theta12 |
| double | Theta13 |
| double | Theta23 |
| double | DeltaMSq23 |
| double | DeltaMSq12 |
| double | DeltaCP |
|
|
Definition at line 3 of file SysFileGen2D.cxx. References Initialize(). 00004 {
00005 Initialize();
00006 return;
00007 }
|
|
|
Definition at line 27 of file SysFileGen2D.h. 00027 {};
|
|
|
Definition at line 21 of file SysFileGen2D.cxx. References PIDlist. 00022 {
00023 PIDlist.push_back(pid);
00024 return;
00025 }
|
|
|
Definition at line 30 of file SysFileGen2D.h. 00030 { fSysNames.push_back(sys);};//one should be 'Nominal', another could be e.g. 'Xtalk'
|
|
|
Definition at line 45 of file SysFileGen2D.cxx. Referenced by RunSystematics(). 00046 {
00047 }
|
|
|
Definition at line 56 of file SysFileGen2D.cxx. References SysHists2D::FD_RecoVsPID, SysHists2D::fDirectory, fSysHistsMap, SysHists2D::GetPIDBins(), SysHists2D::GetRecoBins(), and SysHists2D::ND_RecoVsPID. Referenced by WriteToFile(). 00057 {
00058 std::map<Background::Background_t, SysHists2D*>::iterator bgiter = fSysHistsMap.begin();
00059 std::map<Background::Background_t, SysHists2D*>::iterator last = fSysHistsMap.end();
00060
00061 int ir;
00062 int npid,nreco;
00063 double r,p;
00064
00065 while(bgiter != last)
00066 {
00067 SysHists2D* sysh = bgiter->second;
00068
00069 sysh->fDirectory->cd();
00070
00071 npid = sysh->GetPIDBins();
00072 nreco = sysh->GetRecoBins();
00073
00074 std::map<std::string, TH2D*>::iterator piditer = sysh->ND_RecoVsPID.begin();
00075 std::map<std::string, TH2D*>::iterator lastpid = sysh->ND_RecoVsPID.end();
00076
00077 while(piditer != lastpid)
00078 {
00079 TH2D *h = piditer->second;
00080 p = h->GetXaxis()->GetBinCenter(npid);
00081 for(ir=0;ir<nreco;ir++)
00082 {
00083 r = h->GetYaxis()->GetBinCenter(ir+1);
00084 h->Fill(p,r,h->GetBinContent(npid+1,ir+1));//fill last pid bin with overflow content
00085 h->SetBinContent(npid+1,ir+1,0);//set overflow content to 0
00086 }
00087 piditer++;
00088 }
00089
00090 piditer = sysh->FD_RecoVsPID.begin();
00091 lastpid = sysh->FD_RecoVsPID.end();
00092
00093 while(piditer != lastpid)
00094 {
00095 TH2D *h = piditer->second;
00096 p = h->GetXaxis()->GetBinCenter(npid);
00097 for(ir=0;ir<nreco;ir++)
00098 {
00099 r = h->GetYaxis()->GetBinCenter(ir+1);
00100 h->Fill(p,r,h->GetBinContent(npid+1,ir+1));//fill last pid bin with overflow content
00101 h->SetBinContent(npid+1,ir+1,0);//set overflow content to 0
00102 }
00103 piditer++;
00104 }
00105
00106 bgiter++;
00107 }
00108
00109 return;
00110 }
|
|
|
Definition at line 236 of file SysFileGen2D.cxx. References ANtpShowerInfoNue::phCCGeV, ANtpTrackInfoNue::phCCGeV, NueRecord::srshower, and NueRecord::srtrack. 00237 {
00238 double CCEn = 0.0;
00239 if(nr->srtrack.phCCGeV > 0) CCEn += nr->srtrack.phCCGeV;
00240 if(nr->srshower.phCCGeV > 0) CCEn += nr->srshower.phCCGeV;
00241
00242 return CCEn;
00243 }
|
|
|
Definition at line 39 of file SysFileGen2D.h. 00039 { return fCurrentSysName; };
|
|
|
Definition at line 232 of file SysFileGen2D.cxx. References ANtpEventInfoNue::phNueGeV, and NueRecord::srevent.
|
|
|
Definition at line 8 of file SysFileGen2D.cxx. References fout, paramtree, SetCutLevel(), SetDefaultOsc(), SetFarPOT(), SetNearPOT(), and SetOutputFile(). Referenced by SysFileGen2D(). 00009 {
00010 SetOutputFile();
00011 SetNearPOT();
00012 SetFarPOT();
00013 SetDefaultOsc();
00014 SetCutLevel();
00015
00016 fout = 0;
00017 paramtree = 0;
00018
00019 return;
00020 }
|
|
|
Definition at line 173 of file SysFileGen2D.cxx. References SysHists2D::AddPID(), SysHists2D::fDirectory, SysHists2D::InitializeHists(), and PIDlist. Referenced by ResetHistograms(). 00174 {
00175
00176 vector<Background::Background_t> bgs;
00177 bgs.push_back(Background::kNC);
00178 bgs.push_back(Background::kNuMuCC);
00179 bgs.push_back(Background::kNuTauCC);
00180 bgs.push_back(Background::kNueCC);
00181 bgs.push_back(Background::kBNueCC);
00182
00183 for(unsigned int i = 0; i < bgs.size(); i++){
00184 gDirectory->cd("/");
00185 std::string sysh_name = std::string(Background::AsString(bgs[i]));
00186 SysHists2D *sysh = new SysHists2D(sysh_name.c_str());
00187 sysh->fDirectory->cd();
00188 for(unsigned int j=0;j<PIDlist.size();j++)
00189 {
00190 sysh->AddPID(PIDlist.at(j));
00191 }
00192 sysh->InitializeHists();
00193
00194 (fSysHistsMap)[bgs[i]] = sysh;
00195 }
00196 }
|
|
|
Definition at line 197 of file SysFileGen2D.cxx. References SysHists2D::FD_RecoVsPID, SysHists2D::FD_TrueVsReco, SysHists2D::fDirectory, fSysHistsMap, InitializeHistograms(), SysHists2D::ND_RecoVsPID, and SysHists2D::ND_TrueVsReco. Referenced by RunSystematics(). 00198 {
00199
00200 if(fSysHistsMap.size() == 0) InitializeHistograms();
00201
00202 std::map<Background::Background_t, SysHists2D*>::iterator bgiter = fSysHistsMap.begin();
00203 std::map<Background::Background_t, SysHists2D*>::iterator last = fSysHistsMap.end();
00204
00205 while(bgiter != last)
00206 {
00207 SysHists2D* sysh = bgiter->second;
00208
00209 sysh->fDirectory->cd();
00210 sysh->ND_TrueVsReco->Reset("ICE");
00211 sysh->FD_TrueVsReco->Reset("ICE");
00212 std::map<std::string, TH2D*>::iterator piditer = sysh->ND_RecoVsPID.begin();
00213 std::map<std::string, TH2D*>::iterator lastpid = sysh->ND_RecoVsPID.end();
00214 while(piditer != lastpid)
00215 {
00216 TH2D *h = piditer->second;
00217 h->Reset("ICE");
00218 piditer++;
00219 }
00220 piditer = sysh->FD_RecoVsPID.begin();
00221 lastpid = sysh->FD_RecoVsPID.end();
00222 while(piditer != lastpid)
00223 {
00224 TH2D *h = piditer->second;
00225 h->Reset("ICE");
00226 piditer++;
00227 }
00228
00229 bgiter++;
00230 }
00231 }
|
|
|
Definition at line 33 of file SysFileGen2D.cxx. References fCurrentSysName, FillHistograms(), fSysNames, ResetHistograms(), and WriteToFile(). 00034 {
00035 for(unsigned int j = 0; j < fSysNames.size(); j++)
00036 {
00037 std::cout<<fSysNames[j]<<endl;
00038 fCurrentSysName = fSysNames[j];
00039 ResetHistograms(); //Clear out whatever happened last time
00040 FillHistograms();
00041 WriteToFile();
00042 }
00043 }
|
|
|
Definition at line 35 of file SysFileGen2D.h. Referenced by Initialize(). 00035 { CutLevel = s; };
|
|
|
Definition at line 27 of file SysFileGen2D.cxx. References NueStandard::SetDefaultOscParam(). Referenced by Initialize(). 00028 {
00029 NueStandard::SetDefaultOscParam();
00030 return;
00031 }
|
|
|
Definition at line 33 of file SysFileGen2D.h. Referenced by Initialize(). 00033 { fFarPOT = pot;};
|
|
|
Definition at line 32 of file SysFileGen2D.h. Referenced by Initialize(). 00032 { fNearPOT = pot;};
|
|
|
Definition at line 49 of file SysFileGen2D.cxx. References outFileName. Referenced by Initialize(). 00050 {
00051 outFileName = name;
00052
00053 return;
00054 }
|
|
|
Definition at line 111 of file SysFileGen2D.cxx. References CutLevel, DeltaCP, DeltaMSq12, DeltaMSq23, fCurrentSysName, SysHists2D::fDirectory, fFarPOT, FinalizeHistograms(), fNearPOT, fout, fSysHistsMap, fSysNames, NueStandard::GetOscParam(), outFileName, paramtree, Theta12, Theta13, and Theta23. Referenced by RunSystematics(). 00112 {
00113 FinalizeHistograms();
00114
00115 char selection[256];
00116
00117 double par[100]={0};
00118 NueStandard::GetOscParam(par);
00119 Theta12 = par[OscPar::kTh12];
00120 Theta13 = par[OscPar::kTh13];
00121 Theta23 = par[OscPar::kTh23];
00122 DeltaMSq23 = par[OscPar::kDeltaM23];
00123 DeltaMSq12 = par[OscPar::kDeltaM12];
00124 DeltaCP = par[OscPar::kDelta];
00125
00126 if(fout == 0)
00127 {
00128 fout = new TFile(outFileName.c_str(),"RECREATE");
00129 paramtree = new TTree("paramtree","paramtree");
00130 paramtree->Branch("Selection",selection,"Selection/C");
00131 paramtree->Branch("nearPOT",&fNearPOT,"nearPOT/D");
00132 paramtree->Branch("farPOT",&fFarPOT,"farPOT/D");
00133 paramtree->Branch("Theta12",&Theta12,"Theta12/D");
00134 paramtree->Branch("Theta13",&Theta13,"Theta13/D");
00135 paramtree->Branch("Theta23",&Theta23,"Theta23/D");
00136 paramtree->Branch("DeltaMSq23",&DeltaMSq23,"DeltaMSq23/D");
00137 paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
00138 paramtree->Branch("DeltaCP",&DeltaCP,"DeltaCP/D");
00139 }
00140
00141 fout->cd();
00142
00143 sprintf(selection,"%s",Selection::AsString(CutLevel));
00144
00145 std::map<Background::Background_t,SysHists2D*>::iterator bgiter = fSysHistsMap.begin();
00146 std::map<Background::Background_t,SysHists2D*>::iterator last = fSysHistsMap.end();
00147
00148 while(bgiter!=last) {
00149 std::string sysh_name = bgiter->second->fDirectory->GetName();
00150 sysh_name += "_" + fCurrentSysName + "_" + std::string(Selection::AsString(CutLevel));
00151
00152 TDirectory *filedir = fout->mkdir(sysh_name.c_str());
00153 filedir->cd();
00154 TList *list = bgiter->second->fDirectory->GetList();
00155 TIter iter(list->MakeIterator());
00156 TObject *ob = 0;
00157 while((ob = iter())) ob->Write();
00158 fout->cd();
00159 bgiter++;
00160 }
00161
00162 fout->cd();
00163
00164 paramtree->Fill();
00165
00166 if(fCurrentSysName == fSysNames[fSysNames.size()-1])
00167 {
00168 paramtree->Write();
00169 fout->Close();
00170 }
00171 }
|
|
|
Definition at line 55 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 69 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 68 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 67 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 54 of file SysFileGen2D.h. Referenced by RunSystematics(), and WriteToFile(). |
|
|
Definition at line 58 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 57 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 61 of file SysFileGen2D.h. Referenced by Initialize(), and WriteToFile(). |
|
|
Definition at line 46 of file SysFileGen2D.h. Referenced by FinalizeHistograms(), ResetHistograms(), and WriteToFile(). |
|
|
Definition at line 53 of file SysFileGen2D.h. Referenced by RunSystematics(), and WriteToFile(). |
|
|
Definition at line 56 of file SysFileGen2D.h. Referenced by SetOutputFile(), and WriteToFile(). |
|
|
Definition at line 62 of file SysFileGen2D.h. Referenced by Initialize(), and WriteToFile(). |
|
|
Definition at line 59 of file SysFileGen2D.h. Referenced by AddPID(), and InitializeHistograms(). |
|
|
Definition at line 64 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 65 of file SysFileGen2D.h. Referenced by WriteToFile(). |
|
|
Definition at line 66 of file SysFileGen2D.h. Referenced by WriteToFile(). |
1.3.9.1