Prod3Loaders.cxx
Go to the documentation of this file.
2 
3 #include <iostream>
4 
5 namespace ana
6 {
7  //..........................................................................
8  void Prod3LoadersBase::SetLoaderPaths(const std::string& fdmc_nonswap,
9  const std::string& fdmc_fluxswap,
10  const std::string& fdmc_tauswap,
11  const std::string& ndmc,
12  const std::string& nddata)
13  {
14  if(!fdmc_nonswap.empty()) SetLoaderPath(fdmc_nonswap, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
15  if(!fdmc_fluxswap.empty()) SetLoaderPath(fdmc_fluxswap, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kFluxSwap);
16  if(!fdmc_tauswap.empty()) SetLoaderPath(fdmc_tauswap, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kTauSwap);
19  }
20 
21  //..........................................................................
23  const std::string& suffix)
24  {
25  SetLoaderPaths(prefix+"_nonswap_"+suffix,
26  prefix+"_fluxswap_"+suffix,
27  prefix+"_tau_"+suffix);
28  }
29 
30  //..........................................................................
32  {
33  SetLoaderPaths("", "", "", ndmc);
34  }
35 
36  //..........................................................................
38  std::string WhichNDPeriod, FluxType flux)
39  {
40  std::string nddata = "";
41  const std::string caftype = ECAFTypeToString(type);
42  const std::string flxtype = (flux==kFHC ? "fhc":"rhc");
43  const std::string rel = (flux==kFHC ? "d":"l");
44 
45  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat)
46  nddata = "prod_sumdecaf_R17-03-01-prod3reco." + rel + "_nd_numi_" + flxtype + "_" +
47  WhichNDPeriod + "_v1_goodruns_" + caftype;
48  if(type == kDecaf)
49  nddata = "prod_decaf_R17-03-01-prod3reco." + rel + "_nd_numi_"+ flxtype + "_" +
50  WhichNDPeriod + "_" + caftype + "_v1_goodruns";
51  if(type == kFullCAF)
52  nddata = "prod_caf_R17-03-01-prod3reco." + rel + "_nd_numi_" + flxtype + "_" +
53  WhichNDPeriod + "_v1_goodruns";
54 
56  }
57 
58  //..........................................................................
60  std::string WhichNDPeriod, FluxType flux)
61  : Prod3DataLoaders(type, WhichPeriod, WhichNDPeriod, flux)
62  {
63  const std::string caftype = ECAFTypeToString(type);
64  const std::string flxtype = (flux==kFHC? "fhc":"rhc");
65  const std::string ndrel = (flux==kFHC ? "d":"l");
66 
67  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat){
68 
69  SetLoaderFDMCPaths("prod_sumdecaf_R17-03-01-prod3reco.l_fd_genie",
70  flxtype + "_nova_v08_" + WhichPeriod + "_v1_" + caftype);
71  SetLoaderNDMCPath ("prod_sumdecaf_R17-03-01-prod3reco." + ndrel + "_nd_genie_nonswap_" +
72  flxtype + "_nova_v08_" + WhichNDPeriod + "_v1_" + caftype);
73  }
74 
75  if(type == kDecaf){
76  std::cerr << "\nWARNING: Don't use decaf loaders if you need the nue FD peripheral bin"
77  << std::endl << std::endl;
78  SetLoaderFDMCPaths("prod_decaf_R17-03-01-prod3reco.l_fd_genie",
79  flxtype + "_nova_v08_" + WhichPeriod + "_" + caftype + "_v1");
80  SetLoaderNDMCPath ("prod_decaf_R17-03-01-prod3reco." + ndrel + "_nd_genie_nonswap_" +
81  flxtype + "_nova_v08_" + WhichNDPeriod + "_" + caftype + "_v1");
82  }
83 
84  if(type == kFullCAF){
85  SetLoaderFDMCPaths("prod_caf_R17-03-01-prod3reco.l_fd_genie",
86  flxtype + "_nova_v08_" + WhichPeriod + "_v1");
87 
88  SetLoaderNDMCPath ("prod_caf_R17-03-01-prod3reco." + ndrel + "_nd_genie_nonswap_" +
89  flxtype + "_nova_v08_" + WhichNDPeriod + "_v1");
90  }
91  }
92 
93  //..........................................................................
95  std::string WhichNDPeriod)
96  : Prod3DataLoaders(type, WhichPeriod, WhichNDPeriod)
97  {
98  assert(abs(sign) == 1);
99 
100  const std::string caftype = ECAFTypeToString(type);
101 
102  const std::string posneg = (sign > 0) ? "pos" : "neg";
103 
104  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat){
105  SetLoaderFDMCPaths("prod_sumdecaf_R17-03-01-prod3reco.l_fd_genie",
106  "fhc_nova_v08_" + WhichPeriod + "_calib-shift-fd-xyview-" +
107  posneg + "-offset_v1_" + caftype);
108  SetLoaderNDMCPath ("prod_sumdecaf_R17-03-01-prod3reco.h_nd_genie_nonswap_fhc_nova_v08_" +
109  WhichNDPeriod + "_calib-shift-nd-xyview-" +
110  posneg + "-offset_v1_" + caftype);
111  }
112 
113  if(type == kDecaf){
114  std::cerr << "\nWARNING: Don't use decaf loaders if you need the nue FD peripheral bin\n"
115  << std::endl;
116  SetLoaderFDMCPaths("prod_decaf_R17-03-01-prod3reco.l_fd_genie",
117  "fhc_nova_v08_" + WhichPeriod + "_calib-shift-fd-xyview-" +
118  posneg + "-offset_" + caftype + "_v1");
119  SetLoaderNDMCPath ("prod_decaf_R17-03-01-prod3reco.h_nd_genie_nonswap_fhc_nova_v08_" +
120  WhichNDPeriod + "_calib-shift-nd-xyview-" +
121  posneg + "-offset_" + caftype + "_v1");
122  }
123 
124  if(type == kFullCAF){
125  SetLoaderFDMCPaths("prod_caf_R17-03-01-prod3reco.l_fd_genie",
126  "fhc_nova_v08_" + WhichPeriod + "_calib-shift-fd-xyview-" +
127  posneg + "-offset_v1");
128  SetLoaderNDMCPath ("prod_caf_R17-03-01-prod3reco.h_nd_genie_nonswap_fhc_nova_v08_" +
129  WhichNDPeriod + "_calib-shift-nd-xyview-" + posneg + "-offset_v1");
130  }
131  }
132 
133  //..........................................................................
135  std::string WhichPeriod,
136  std::string WhichNDPeriod)
137  : Prod3DataLoaders(type, WhichPeriod, WhichNDPeriod)
138  {
139  assert(abs(sign) == 1 || sign == 0);
140 
141  const std::string caftype = ECAFTypeToString(type);
142 
143  std::string updown;
144  if(sign == 1) updown = "lightup-calibdown";
145  else if (sign == -1) updown = "lightdown-calibup";
146  else if (sign == 0) updown = "noshift";
147 
148  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat){
149  SetLoaderFDMCPaths("prod_sumdecaf_R17-03-01-prod3reco.l_fd_genie",
150  "fhc_nova_v08_" + WhichPeriod + "_lightmodel-" +
151  updown + "_v2_" + caftype);
152  SetLoaderNDMCPath ("prod_sumdecaf_R17-03-01-prod3reco.l_nd_genie_nonswap_fhc_nova_v08_" +
153  WhichNDPeriod + "_lightmodel-" + updown + "_v1_" + caftype);
154  }
155 
156  if(type == kDecaf){
157  std::cerr << "\nWARNING: Don't use decaf loaders if you need the nue FD peripheral bin\n"
158  << std::endl;
159  SetLoaderFDMCPaths("prod_decaf_R17-03-01-prod3reco.l_fd_genie",
160  "fhc_nova_v08_" + WhichPeriod + "_lightmodel-" +
161  updown + "_" + caftype + "_v2");
162  SetLoaderNDMCPath ("prod_decaf_R17-03-01-prod3reco.l_nd_genie_nonswap_fhc_nova_v08_" +
163  WhichNDPeriod + "_lightmodel-" + updown + "_" + caftype + "_v1");
164  }
165 
166  if(type == kFullCAF){
167  SetLoaderFDMCPaths("prod_caf_R17-03-01-prod3reco.l_fd_genie",
168  "fhc_nova_v08_" + WhichPeriod + "_lightmodel-" + updown + "_v2");
169  SetLoaderNDMCPath ("prod_caf_R17-03-01-prod3reco.l_nd_genie_nonswap_fhc_nova_v08_" +
170  WhichNDPeriod + "_lightmodel-" + updown + "_v1");
171  }
172  }
173 
174  //..........................................................................
176  std::string WhichNDPeriod)
177  : Prod3DataLoaders(type, WhichPeriod, WhichNDPeriod)
178  {
179  const std::string caftype = ECAFTypeToString(type);
180 
181  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat){
182  SetLoaderFDMCPaths("prod_sumdecaf_R17-03-01-prod3reco.l_fd_genie",
183  "fhc_nova_v08_" + WhichPeriod +
184  "_ckv-proton-shift-down_v2_" + caftype);
185  SetLoaderNDMCPath ("prod_sumdecaf_R17-03-01-prod3reco.l_nd_genie_nonswap_fhc_nova_v08_" +
186  WhichNDPeriod + "_ckv-proton-shift-down_v1_" + caftype);
187  }
188 
189  if(type == kDecaf){
190  std::cerr << "\nWARNING: Don't use decaf loaders if you need the nue FD peripheral bin\n"
191  << std::endl;
192  SetLoaderFDMCPaths("prod_decaf_R17-03-01-prod3reco.l_fd_genie",
193  "fhc_nova_v08_" + WhichPeriod +
194  "_ckv-proton-shift-down_" + caftype + "_v2");
195  SetLoaderNDMCPath ("prod_decaf_R17-03-01-prod3reco.l_nd_genie_nonswap_fhc_nova_v08_" +
196  WhichNDPeriod + "_ckv-proton-shift-down_" + caftype + "_v1");
197  }
198 
199  if(type == kFullCAF){
200  SetLoaderFDMCPaths("prod_caf_R17-03-01-prod3reco.l_fd_genie",
201  "fhc_nova_v08_" + WhichPeriod + "_ckv-proton-shift-down_v2");
202  SetLoaderNDMCPath ("prod_caf_R17-03-01-prod3reco.l_nd_genie_nonswap_fhc_nova_v08_" +
203  WhichNDPeriod + "_ckv-proton-shift-down_v1");
204  }
205  }
206 
207  //..........................................................................
209  std::string WhichNDPeriod)
210  : Prod3DataLoaders(type, WhichPeriod, WhichNDPeriod)
211  {
212  const std::string caftype = ECAFTypeToString(type);
213 
214  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat){
215  SetLoaderFDMCPaths("prod_sumdecaf_R17-03-01-prod3reco.l_fd_genie",
216  "fhc_nova_v08_" + WhichPeriod + "_calib-shift-fd-func_v1_" + caftype);
217  SetLoaderNDMCPath ("prod_sumdecaf_R17-03-01-prod3reco.j_nd_genie_nonswap_fhc_nova_v08_" +
218  WhichNDPeriod + "_calib-shift-nd-func_v1_" + caftype);
219  }
220 
221  if(type == kDecaf){
222  std::cerr << "\nWARNING: Don't use decaf loaders if you need the nue FD peripheral bin\n"
223  << std::endl;
224  SetLoaderFDMCPaths("prod_decaf_R17-03-01-prod3reco.l_fd_genie",
225  "fhc_nova_v08_" + WhichPeriod +
226  "_calib-shift-fd-func_" + caftype + "_v1");
227  SetLoaderNDMCPath ("prod_decaf_R17-03-01-prod3reco.j_nd_genie_nonswap_fhc_nova_v08_" +
228  WhichNDPeriod + "_calib-shift-nd-func_" + caftype + "_v1");
229  }
230 
231  if(type == kFullCAF){
232  SetLoaderFDMCPaths("prod_caf_R17-03-01-prod3reco.l_fd_genie",
233  "fhc_nova_v08_" + WhichPeriod + "_calib-shift-fd-func_v1");
234  SetLoaderNDMCPath ("prod_caf_R17-03-01-prod3reco.j_nd_genie_nonswap_fhc_nova_v08_" +
235  WhichNDPeriod + "_calib-shift-nd-func_v1");
236  }
237  }
238 
240  {
241  const std::map<ECAFType, std::string> mapStringECAFType {
242  {ECAFType::kFullCAF, "caf"},
243  {ECAFType::kDecaf, "nue_or_numu_or_nus_contain"},
244  {ECAFType::kNueConcat, "nue2017"},
245  {ECAFType::kNumuConcat,"numu2017"},
246  {ECAFType::kNusConcat, "nus2017"}
247  };
248 
249  auto it = mapStringECAFType.find(type);
250  if(it == mapStringECAFType.end()) {
251  std::cout << "Unknown ECAFType" << std::endl;
252  std::cout << "Aborting..." << std::endl;
253  abort();
254  }
255  return it->second;
256  }
257 } // namespace
Near Detector underground.
Definition: SREnums.h:10
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
set< int >::iterator it
void SetLoaderNDMCPath(const std::string &ndmc)
Prod3NomLoaders(ECAFType type, std::string WhichPeriod="full", std::string WhichNDPeriod="full", FluxType flux=kFHC)
OStream cerr
Definition: OStream.cxx:7
Prod3CalibShapeLoaders(ECAFType type, std::string WhichPeriod="full", std::string WhichNDPeriod="full")
void abs(TH1 *hist)
Loaders::FluxType flux
Prod3CherenkovLoaders(ECAFType type, std::string WhichPeriod="full", std::string WhichNDPeriod="full")
const std::string ECAFTypeToString(ECAFType type)
Prod3AbsCalibLoaders(ECAFType type, int sign, std::string WhichPeriod="full", std::string WhichNDPeriod="full")
sign should be +1 (scale energies up) or -1 (scale energies down)
string rel
Definition: shutoffs.py:11
const XML_Char * prefix
Definition: expat.h:380
OStream cout
Definition: OStream.cxx:6
void SetLoaderPaths(const std::string &fdmc_nonswap, const std::string &fdmc_fluxswap, const std::string &fdmc_tauswap="", const std::string &ndmc="", const std::string &nddata="")
Definition: Prod3Loaders.cxx:8
Provide the data loaders only, base class for other loaders.
Definition: Prod3Loaders.h:31
assert(nhit_max >=nhit_nbins)
void SetLoaderFDMCPaths(const std::string &prefix, const std::string &suffix)
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
Prod3DataLoaders(ECAFType type, std::string WhichPeriod="full", std::string WhichNDPeriod="full", FluxType flux=kFHC)
def sign(x)
Definition: canMan.py:197
Prod3LightLevelLoaders(ECAFType type, int sign, std::string WhichPeriod="full", std::string WhichNDPeriod="full")
+1sigma is light levels up, calibration down. 0 is No shift photon rewriter
ECAFType
Definition: Loaders.h:19
enum BeamMode string