/* * trainStokesFisherOvRResponse.C * * Created on: June 18, 2020 * Author: John Russell * * Using both coherent and deconvolved waveforms, let's see if normalized Stokes parameters provide * good discrimination? */ #include "AnitaTMVA.h" // Use this to take care of requisite TMVA includes. #include "AnitaEventSummary.h" void trainStokesFisherOvRResponse() { const char * summaryPath = "~/jwrussWork/eventSummaries/%s"; // Create TChains from which to access eventSummaries for various data types. TChain WAISHPolChain("sampleA4"), WAISVPolChain("sampleA4"), HiCal2AChain("sampleA4"), HiCal2BChain("sampleA4"), iceMCChain("sampleA4"); TChain RCPChain("sampleA4"), LCPChain("sampleA4"), payloadBlastChain("sampleA4"), sunChain("sampleA4"); TChain minBiasThermalChain("sampleA4"), aboveHorizontalThermalChain("sampleA4"); WAISHPolChain.Add(TString::Format(summaryPath, "WAISHPol/purified/summary-full-*")); WAISVPolChain.Add(TString::Format(summaryPath, "WAISVPol/purified/summary-full-*")); HiCal2AChain.Add(TString::Format(summaryPath, "HiCal2A/purified/summary-full-*")); HiCal2BChain.Add(TString::Format(summaryPath, "HiCal2B/purified/summary-full-*")); iceMCChain.Add(TString::Format(summaryPath, "iceMC/purified/summary-*")); // iceMCChain.Add("~/jwrussWork/eventSummaries2019/iceMC/purified/summary-*"); RCPChain.Add(TString::Format(summaryPath, "other/RCP/summary-full-*")); LCPChain.Add(TString::Format(summaryPath, "other/LCP/summary-full-*")); payloadBlastChain.Add(TString::Format(summaryPath, "other/payloadBlast/summary-full-*")); sunChain.Add(TString::Format(summaryPath, "other/sun/summary-full-*")); minBiasThermalChain.Add(TString::Format(summaryPath, "minBias/thermal/summary-full-*")); aboveHorizontalThermalChain.Add(TString::Format(summaryPath, "aboveHorizontal/thermal/summary-full-*")); // Create weights for each classification. So that each classification effectively balanced. Should better distinguish each classification this way. double sumWeight = 0, sumSqWeight = 0; for (int i = 0; i < iceMCChain.GetEntries(); ++i) { iceMCChain.GetEntry(i); sumWeight += iceMCChain.GetLeaf("mc.weight") -> GetValue(); sumSqWeight += iceMCChain.GetLeaf("mc.weight") -> GetValue() * iceMCChain.GetLeaf("mc.weight") -> GetValue(); } double numIceMC = sumWeight * sumWeight / sumSqWeight; double WAISHPolWeight = 1. / WAISHPolChain.GetEntries(); double WAISVPolWeight = 1. / WAISVPolChain.GetEntries(); double HiCal2AWeight = 1. / HiCal2AChain.GetEntries(); double HiCal2BWeight = 1. / HiCal2BChain.GetEntries(); double iceMCWeight = 1. / numIceMC; double RCPWeight = 1. / RCPChain.GetEntries(); double LCPWeight = 1. / LCPChain.GetEntries(); double payloadBlastWeight = 1. / payloadBlastChain.GetEntries(); double sunWeight = 1. / sunChain.GetEntries(); double minBiasThermalWeight = 1. / minBiasThermalChain.GetEntries(); double aboveHorizontalThermalWeight = 1. / aboveHorizontalThermalChain.GetEntries(); // Set up DataLoader objects. // WAIS Hpol DataLoader object. TMVA::DataLoader WAISHPolDL("StokesResults"); WAISHPolDL.AddSignalTree(& WAISHPolChain); WAISHPolDL.AddBackgroundTree(& WAISVPolChain, WAISHPolChain.GetEntries() * WAISVPolWeight); WAISHPolDL.AddBackgroundTree(& HiCal2AChain, WAISHPolChain.GetEntries() * HiCal2AWeight); WAISHPolDL.AddBackgroundTree(& HiCal2BChain, WAISHPolChain.GetEntries() * HiCal2BWeight); WAISHPolDL.AddBackgroundTree(& iceMCChain, WAISHPolChain.GetEntries() * iceMCWeight); WAISHPolDL.AddBackgroundTree(& RCPChain, WAISHPolChain.GetEntries() * RCPWeight); WAISHPolDL.AddBackgroundTree(& LCPChain, WAISHPolChain.GetEntries() * LCPWeight); WAISHPolDL.AddBackgroundTree(& payloadBlastChain, WAISHPolChain.GetEntries() * payloadBlastWeight); WAISHPolDL.AddBackgroundTree(& sunChain, WAISHPolChain.GetEntries() * sunWeight); // WAISHPolDL.AddBackgroundTree(& minBiasThermalChain, WAISHPolChain.GetEntries() * minBiasThermalWeight); WAISHPolDL.AddBackgroundTree(& aboveHorizontalThermalChain, WAISHPolChain.GetEntries() * aboveHorizontalThermalWeight); WAISHPolDL.AddSpectator("run"); WAISHPolDL.AddSpectator("eventNumber"); WAISHPolDL.AddSpectator("mc.weight"); WAISHPolDL.SetWeightExpression("mc.weight ? mc.weight : 1"); WAISHPolDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); // Peak-to-average-power-ratio (PAPR). Equal to the square of crest factor (what we call SNR.) WAISHPolDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); WAISHPolDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); WAISHPolDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); WAISHPolDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); WAISHPolDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); WAISHPolDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); WAISHPolDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); WAISHPolDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); WAISHPolDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); WAISHPolDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); WAISHPolDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // WAIS Vpol DataLoader object. TMVA::DataLoader WAISVPolDL("StokesResults"); WAISVPolDL.AddBackgroundTree(& WAISHPolChain, WAISVPolChain.GetEntries() * WAISHPolWeight); WAISVPolDL.AddSignalTree(& WAISVPolChain); WAISVPolDL.AddBackgroundTree(& HiCal2AChain, WAISVPolChain.GetEntries() * HiCal2AWeight); WAISVPolDL.AddBackgroundTree(& HiCal2BChain, WAISVPolChain.GetEntries() * HiCal2BWeight); WAISVPolDL.AddBackgroundTree(& iceMCChain, WAISVPolChain.GetEntries() * iceMCWeight); WAISVPolDL.AddBackgroundTree(& RCPChain, WAISVPolChain.GetEntries() * RCPWeight); WAISVPolDL.AddBackgroundTree(& LCPChain, WAISVPolChain.GetEntries() * LCPWeight); WAISVPolDL.AddBackgroundTree(& payloadBlastChain, WAISVPolChain.GetEntries() * payloadBlastWeight); WAISVPolDL.AddBackgroundTree(& sunChain, WAISVPolChain.GetEntries() * sunWeight); // WAISVPolDL.AddBackgroundTree(& minBiasThermalChain, WAISVPolChain.GetEntries() * minBiasThermalWeight); WAISVPolDL.AddBackgroundTree(& aboveHorizontalThermalChain, WAISVPolChain.GetEntries() * aboveHorizontalThermalWeight); WAISVPolDL.AddSpectator("run"); WAISVPolDL.AddSpectator("eventNumber"); WAISVPolDL.AddSpectator("mc.weight"); WAISVPolDL.SetWeightExpression("mc.weight ? mc.weight : 1"); WAISVPolDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); WAISVPolDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); WAISVPolDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); WAISVPolDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); WAISVPolDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); WAISVPolDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); WAISVPolDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); WAISVPolDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); WAISVPolDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); WAISVPolDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); WAISVPolDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); WAISVPolDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // HiCal2A DataLoader object. TMVA::DataLoader HiCal2ADL("StokesResults"); HiCal2ADL.AddBackgroundTree(& WAISHPolChain, HiCal2AChain.GetEntries() * WAISHPolWeight); HiCal2ADL.AddBackgroundTree(& WAISVPolChain, HiCal2AChain.GetEntries() * WAISVPolWeight); HiCal2ADL.AddSignalTree(& HiCal2AChain); HiCal2ADL.AddBackgroundTree(& HiCal2BChain, HiCal2AChain.GetEntries() * HiCal2BWeight); HiCal2ADL.AddBackgroundTree(& iceMCChain, HiCal2AChain.GetEntries() * iceMCWeight); HiCal2ADL.AddBackgroundTree(& RCPChain, HiCal2AChain.GetEntries() * RCPWeight); HiCal2ADL.AddBackgroundTree(& LCPChain, HiCal2AChain.GetEntries() * LCPWeight); HiCal2ADL.AddBackgroundTree(& payloadBlastChain, HiCal2AChain.GetEntries() * payloadBlastWeight); HiCal2ADL.AddBackgroundTree(& sunChain, HiCal2AChain.GetEntries() * sunWeight); // HiCal2ADL.AddBackgroundTree(& minBiasThermalChain, HiCal2AChain.GetEntries() * minBiasThermalWeight); HiCal2ADL.AddBackgroundTree(& aboveHorizontalThermalChain, HiCal2AChain.GetEntries() * aboveHorizontalThermalWeight); HiCal2ADL.AddSpectator("run"); HiCal2ADL.AddSpectator("eventNumber"); HiCal2ADL.AddSpectator("mc.weight"); HiCal2ADL.SetWeightExpression("mc.weight ? mc.weight : 1"); HiCal2ADL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); HiCal2ADL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); HiCal2ADL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); HiCal2ADL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); HiCal2ADL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); HiCal2ADL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2ADL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2ADL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2ADL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2ADL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); HiCal2ADL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); HiCal2ADL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // HiCal2B DataLoader object. TMVA::DataLoader HiCal2BDL("StokesResults"); HiCal2BDL.AddBackgroundTree(& WAISHPolChain, HiCal2BChain.GetEntries() * WAISHPolWeight); HiCal2BDL.AddBackgroundTree(& WAISVPolChain, HiCal2BChain.GetEntries() * WAISVPolWeight); HiCal2BDL.AddBackgroundTree(& HiCal2AChain, HiCal2BChain.GetEntries() * HiCal2AWeight); HiCal2BDL.AddSignalTree(& HiCal2BChain); HiCal2BDL.AddBackgroundTree(& iceMCChain, HiCal2BChain.GetEntries() * iceMCWeight); HiCal2BDL.AddBackgroundTree(& RCPChain, HiCal2BChain.GetEntries() * RCPWeight); HiCal2BDL.AddBackgroundTree(& LCPChain, HiCal2BChain.GetEntries() * LCPWeight); HiCal2BDL.AddBackgroundTree(& payloadBlastChain, HiCal2BChain.GetEntries() * payloadBlastWeight); HiCal2BDL.AddBackgroundTree(& sunChain, HiCal2BChain.GetEntries() * sunWeight); // HiCal2BDL.AddBackgroundTree(& minBiasThermalChain, HiCal2BChain.GetEntries() * minBiasThermalWeight); HiCal2BDL.AddBackgroundTree(& aboveHorizontalThermalChain, HiCal2BChain.GetEntries() * aboveHorizontalThermalWeight); HiCal2BDL.AddSpectator("run"); HiCal2BDL.AddSpectator("eventNumber"); HiCal2BDL.AddSpectator("mc.weight"); HiCal2BDL.SetWeightExpression("mc.weight ? mc.weight : 1"); HiCal2BDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); HiCal2BDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); HiCal2BDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); HiCal2BDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); HiCal2BDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); HiCal2BDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2BDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2BDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2BDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); HiCal2BDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); HiCal2BDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); HiCal2BDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // iceMC DataLoader object. TMVA::DataLoader iceMCDL("StokesResults"); iceMCDL.AddBackgroundTree(& WAISHPolChain, numIceMC * WAISHPolWeight); iceMCDL.AddBackgroundTree(& WAISVPolChain, numIceMC * WAISVPolWeight); iceMCDL.AddBackgroundTree(& HiCal2AChain, numIceMC * HiCal2AWeight); iceMCDL.AddBackgroundTree(& HiCal2BChain, numIceMC * HiCal2BWeight); iceMCDL.AddSignalTree(& iceMCChain); iceMCDL.AddBackgroundTree(& RCPChain, numIceMC * RCPWeight); iceMCDL.AddBackgroundTree(& LCPChain, numIceMC * LCPWeight); iceMCDL.AddBackgroundTree(& payloadBlastChain, numIceMC * payloadBlastWeight); iceMCDL.AddBackgroundTree(& sunChain, numIceMC * sunWeight); // iceMCDL.AddBackgroundTree(& minBiasThermalChain, numIceMC * minBiasThermalWeight); iceMCDL.AddBackgroundTree(& aboveHorizontalThermalChain, numIceMC * aboveHorizontalThermalWeight); iceMCDL.AddSpectator("run"); iceMCDL.AddSpectator("eventNumber"); iceMCDL.AddSpectator("mc.weight"); iceMCDL.SetWeightExpression("mc.weight ? mc.weight : 1"); iceMCDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); iceMCDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); iceMCDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); iceMCDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); iceMCDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); iceMCDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); iceMCDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); iceMCDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); iceMCDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); iceMCDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); iceMCDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); iceMCDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // RCP DataLoader object. TMVA::DataLoader RCPDL("StokesResults"); RCPDL.AddBackgroundTree(& WAISHPolChain, RCPChain.GetEntries() * WAISHPolWeight); RCPDL.AddBackgroundTree(& WAISVPolChain, RCPChain.GetEntries() * WAISVPolWeight); RCPDL.AddBackgroundTree(& HiCal2AChain, RCPChain.GetEntries() * HiCal2AWeight); RCPDL.AddBackgroundTree(& HiCal2BChain, RCPChain.GetEntries() * HiCal2BWeight); RCPDL.AddBackgroundTree(& iceMCChain, RCPChain.GetEntries() * iceMCWeight); RCPDL.AddSignalTree(& RCPChain); RCPDL.AddBackgroundTree(& LCPChain, RCPChain.GetEntries() * LCPWeight); RCPDL.AddBackgroundTree(& payloadBlastChain, RCPChain.GetEntries() * payloadBlastWeight); RCPDL.AddBackgroundTree(& sunChain, RCPChain.GetEntries() * sunWeight); // RCPDL.AddBackgroundTree(& minBiasThermalChain, RCPChain.GetEntries() * minBiasThermalWeight); RCPDL.AddBackgroundTree(& aboveHorizontalThermalChain, RCPChain.GetEntries() * aboveHorizontalThermalWeight); RCPDL.AddSpectator("run"); RCPDL.AddSpectator("eventNumber"); RCPDL.AddSpectator("mc.weight"); RCPDL.SetWeightExpression("mc.weight ? mc.weight : 1"); RCPDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); RCPDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); RCPDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); RCPDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); RCPDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); RCPDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); RCPDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); RCPDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); RCPDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); RCPDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); RCPDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); RCPDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // LCP DataLoader object. TMVA::DataLoader LCPDL("StokesResults"); LCPDL.AddBackgroundTree(& WAISHPolChain, LCPChain.GetEntries() * WAISHPolWeight); LCPDL.AddBackgroundTree(& WAISVPolChain, LCPChain.GetEntries() * WAISVPolWeight); LCPDL.AddBackgroundTree(& HiCal2AChain, LCPChain.GetEntries() * HiCal2AWeight); LCPDL.AddBackgroundTree(& HiCal2BChain, LCPChain.GetEntries() * HiCal2BWeight); LCPDL.AddBackgroundTree(& iceMCChain, LCPChain.GetEntries() * iceMCWeight); LCPDL.AddBackgroundTree(& RCPChain, LCPChain.GetEntries() * RCPWeight); LCPDL.AddSignalTree(& LCPChain); LCPDL.AddBackgroundTree(& payloadBlastChain, LCPChain.GetEntries() * payloadBlastWeight); LCPDL.AddBackgroundTree(& sunChain, LCPChain.GetEntries() * sunWeight); // LCPDL.AddBackgroundTree(& minBiasThermalChain, LCPChain.GetEntries() * minBiasThermalWeight); LCPDL.AddBackgroundTree(& aboveHorizontalThermalChain, LCPChain.GetEntries() * aboveHorizontalThermalWeight); LCPDL.AddSpectator("run"); LCPDL.AddSpectator("eventNumber"); LCPDL.AddSpectator("mc.weight"); LCPDL.SetWeightExpression("mc.weight ? mc.weight : 1"); LCPDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); LCPDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); LCPDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); LCPDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); LCPDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); LCPDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); LCPDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); LCPDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); LCPDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); LCPDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); LCPDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); LCPDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // Payload Blast DataLoader object. TMVA::DataLoader payloadBlastDL("StokesResults"); payloadBlastDL.AddBackgroundTree(& WAISHPolChain, payloadBlastChain.GetEntries() * WAISHPolWeight); payloadBlastDL.AddBackgroundTree(& WAISVPolChain, payloadBlastChain.GetEntries() * WAISVPolWeight); payloadBlastDL.AddBackgroundTree(& HiCal2AChain, payloadBlastChain.GetEntries() * HiCal2AWeight); payloadBlastDL.AddBackgroundTree(& HiCal2BChain, payloadBlastChain.GetEntries() * HiCal2BWeight); payloadBlastDL.AddBackgroundTree(& iceMCChain, payloadBlastChain.GetEntries() * iceMCWeight); payloadBlastDL.AddBackgroundTree(& RCPChain, payloadBlastChain.GetEntries() * RCPWeight); payloadBlastDL.AddBackgroundTree(& LCPChain, payloadBlastChain.GetEntries() * LCPWeight); payloadBlastDL.AddSignalTree(& payloadBlastChain); payloadBlastDL.AddBackgroundTree(& sunChain, payloadBlastChain.GetEntries() * sunWeight); // payloadBlastDL.AddBackgroundTree(& minBiasThermalChain, payloadBlastChain.GetEntries() * minBiasThermalWeight); payloadBlastDL.AddBackgroundTree(& aboveHorizontalThermalChain, payloadBlastChain.GetEntries() * aboveHorizontalThermalWeight); payloadBlastDL.AddSpectator("run"); payloadBlastDL.AddSpectator("eventNumber"); payloadBlastDL.AddSpectator("mc.weight"); payloadBlastDL.SetWeightExpression("mc.weight ? mc.weight : 1"); payloadBlastDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); payloadBlastDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); payloadBlastDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); payloadBlastDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); payloadBlastDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); payloadBlastDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); payloadBlastDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); payloadBlastDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); payloadBlastDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); payloadBlastDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); payloadBlastDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); payloadBlastDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // Sun DataLoader object. TMVA::DataLoader sunDL("StokesResults"); sunDL.AddBackgroundTree(& WAISHPolChain, sunChain.GetEntries() * WAISHPolWeight); sunDL.AddBackgroundTree(& WAISVPolChain, sunChain.GetEntries() * WAISVPolWeight); sunDL.AddBackgroundTree(& HiCal2AChain, sunChain.GetEntries() * HiCal2AWeight); sunDL.AddBackgroundTree(& HiCal2BChain, sunChain.GetEntries() * HiCal2BWeight); sunDL.AddBackgroundTree(& iceMCChain, sunChain.GetEntries() * iceMCWeight); sunDL.AddBackgroundTree(& RCPChain, sunChain.GetEntries() * RCPWeight); sunDL.AddBackgroundTree(& LCPChain, sunChain.GetEntries() * LCPWeight); sunDL.AddBackgroundTree(& payloadBlastChain, sunChain.GetEntries() * payloadBlastWeight); sunDL.AddSignalTree(& sunChain); // sunDL.AddBackgroundTree(& minBiasThermalChain, sunChain.GetEntries() * minBiasThermalWeight); sunDL.AddBackgroundTree(& aboveHorizontalThermalChain, sunChain.GetEntries() * aboveHorizontalThermalWeight); sunDL.AddSpectator("run"); sunDL.AddSpectator("eventNumber"); sunDL.AddSpectator("mc.weight"); sunDL.SetWeightExpression("mc.weight ? mc.weight : 1"); sunDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); sunDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); sunDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); sunDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); sunDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); sunDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); sunDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); sunDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); sunDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); sunDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); sunDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); sunDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // // Minimumly biased thermal DataLoader object. // TMVA::DataLoader minBiasThermalDL("StokesResults"); // // minBiasThermalDL.AddBackgroundTree(& WAISHPolChain, minBiasThermalChain.GetEntries() * WAISHPolWeight); // minBiasThermalDL.AddBackgroundTree(& WAISVPolChain, minBiasThermalChain.GetEntries() * WAISVPolWeight); // minBiasThermalDL.AddBackgroundTree(& HiCal2AChain, minBiasThermalChain.GetEntries() * HiCal2AWeight); // minBiasThermalDL.AddBackgroundTree(& HiCal2BChain, minBiasThermalChain.GetEntries() * HiCal2BWeight); // minBiasThermalDL.AddBackgroundTree(& iceMCChain, minBiasThermalChain.GetEntries() * iceMCWeight); // minBiasThermalDL.AddBackgroundTree(& RCPChain, minBiasThermalChain.GetEntries() * RCPWeight); // minBiasThermalDL.AddBackgroundTree(& LCPChain, minBiasThermalChain.GetEntries() * LCPWeight); // minBiasThermalDL.AddBackgroundTree(& payloadBlastChain, minBiasThermalChain.GetEntries() * payloadBlastWeight); // minBiasThermalDL.AddBackgroundTree(& sunChain, minBiasThermalChain.GetEntries() * sunWeight); // minBiasThermalDL.AddSignalTree(& minBiasThermalChain); // minBiasThermalDL.AddBackgroundTree(& aboveHorizontalThermalChain, minBiasThermalChain.GetEntries() * aboveHorizontalThermalWeight); // // minBiasThermalDL.AddSpectator("run"); // minBiasThermalDL.AddSpectator("eventNumber"); // minBiasThermalDL.AddSpectator("mc.weight"); // // minBiasThermalDL.SetWeightExpression("mc.weight ? mc.weight : 1"); // // minBiasThermalDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); // minBiasThermalDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); // minBiasThermalDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); // minBiasThermalDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); // minBiasThermalDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); // minBiasThermalDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); // minBiasThermalDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); // minBiasThermalDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); // minBiasThermalDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); // Nonphysical thermal DataLoader object. TMVA::DataLoader aboveHorizontalThermalDL("StokesResults"); aboveHorizontalThermalDL.AddBackgroundTree(& WAISHPolChain, aboveHorizontalThermalChain.GetEntries() * WAISHPolWeight); aboveHorizontalThermalDL.AddBackgroundTree(& WAISVPolChain, aboveHorizontalThermalChain.GetEntries() * WAISVPolWeight); aboveHorizontalThermalDL.AddBackgroundTree(& HiCal2AChain, aboveHorizontalThermalChain.GetEntries() * HiCal2AWeight); aboveHorizontalThermalDL.AddBackgroundTree(& HiCal2BChain, aboveHorizontalThermalChain.GetEntries() * HiCal2BWeight); aboveHorizontalThermalDL.AddBackgroundTree(& iceMCChain, aboveHorizontalThermalChain.GetEntries() * iceMCWeight); aboveHorizontalThermalDL.AddBackgroundTree(& RCPChain, aboveHorizontalThermalChain.GetEntries() * RCPWeight); aboveHorizontalThermalDL.AddBackgroundTree(& LCPChain, aboveHorizontalThermalChain.GetEntries() * LCPWeight); aboveHorizontalThermalDL.AddBackgroundTree(& payloadBlastChain, aboveHorizontalThermalChain.GetEntries() * payloadBlastWeight); aboveHorizontalThermalDL.AddBackgroundTree(& sunChain, aboveHorizontalThermalChain.GetEntries() * sunWeight); // aboveHorizontalThermalDL.AddBackgroundTree(& minBiasThermalChain, aboveHorizontalThermalChain.GetEntries() * minBiasThermalWeight); aboveHorizontalThermalDL.AddSignalTree(& aboveHorizontalThermalChain); aboveHorizontalThermalDL.AddSpectator("run"); aboveHorizontalThermalDL.AddSpectator("eventNumber"); aboveHorizontalThermalDL.AddSpectator("mc.weight"); aboveHorizontalThermalDL.SetWeightExpression("mc.weight ? mc.weight : 1"); aboveHorizontalThermalDL.AddVariable("cohPAPRI := mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("cohFracQ := mostImpulsiveCoherentFiltered(2).Q / mostImpulsiveCoherentFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("cohFracU := mostImpulsiveCoherentFiltered(2).U / mostImpulsiveCoherentFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("cohFracV := mostImpulsiveCoherentFiltered(2).V / mostImpulsiveCoherentFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("cohPolFracMetric := pow(mostImpulsiveCoherentFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveCoherentFiltered(2).circPolFrac(), 2)"); aboveHorizontalThermalDL.AddVariable("deconvPAPRI := mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("deconvFracQ := mostImpulsiveDeconvolvedFiltered(2).Q / mostImpulsiveDeconvolvedFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("deconvFracU := mostImpulsiveDeconvolvedFiltered(2).U / mostImpulsiveDeconvolvedFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("deconvFracV := mostImpulsiveDeconvolvedFiltered(2).V / mostImpulsiveDeconvolvedFiltered(2).I"); aboveHorizontalThermalDL.AddVariable("deconvPolFracMetric := pow(mostImpulsiveDeconvolvedFiltered(2).linearPolFrac(), 2) - pow(mostImpulsiveDeconvolvedFiltered(2).circPolFrac(), 2)"); aboveHorizontalThermalDL.AddVariable("diffSqPAPRI := pow(mostImpulsiveDeconvolvedFiltered(2).max_dI / mostImpulsiveDeconvolvedFiltered(2).I, 2) - pow(mostImpulsiveCoherentFiltered(2).max_dI / mostImpulsiveCoherentFiltered(2).I, 2)"); aboveHorizontalThermalDL.AddVariable("payloadBlastMetric := pow(flags.middleOrBottomPower[2] - flags.topPower[2], 2) / pow(flags.middleOrBottomPower[2] + flags.topPower[2], 2)"); // Change weighting for multiclass purposes. WAISHPolDL.PrepareTrainingAndTestTree("", "NormMode=None"); WAISVPolDL.PrepareTrainingAndTestTree("", "NormMode=None"); HiCal2ADL.PrepareTrainingAndTestTree("", "NormMode=None"); HiCal2BDL.PrepareTrainingAndTestTree("", "NormMode=None"); iceMCDL.PrepareTrainingAndTestTree("", "NormMode=None"); RCPDL.PrepareTrainingAndTestTree("", "NormMode=None"); LCPDL.PrepareTrainingAndTestTree("", "NormMode=None"); payloadBlastDL.PrepareTrainingAndTestTree("", "NormMode=None"); sunDL.PrepareTrainingAndTestTree("", "NormMode=None"); // minBiasThermalDL.PrepareTrainingAndTestTree("", "NormMode=None"); aboveHorizontalThermalDL.PrepareTrainingAndTestTree("", "NormMode=None"); // Create files in which to store TMVA results. // TFile fisherOvRFile("StokesResults/StokesFisherOvRResults.root", "recreate"); TFile WAISHPolFile("StokesResults/StokesWAISHPolResults.root", "recreate"); TFile WAISVPolFile("StokesResults/StokesWAISVPolResults.root", "recreate"); TFile HiCal2AFile("StokesResults/StokesHiCal2AResults.root", "recreate"); TFile HiCal2BFile("StokesResults/StokesHiCal2BResults.root", "recreate"); TFile iceMCFile("StokesResults/StokesIceMCResults.root", "recreate"); TFile RCPFile("StokesResults/StokesRCPResults.root", "recreate"); TFile LCPFile("StokesResults/StokesLCPResults.root", "recreate"); TFile payloadBlastFile("StokesResults/StokesPayloadBlastResults.root", "recreate"); TFile sunFile("StokesResults/StokesSunResults.root", "recreate"); // TFile minBiasThermalFile("StokesResults/StokesMinBiasThermalResults.root", "recreate"); TFile aboveHorizontalThermalFile("StokesResults/StokesAboveHorizontalThermalResults.root", "recreate"); // Run TMVA factory, placing output into output file. // TMVA::Factory fisherOvRFactory("StokesFisherOvRFactory", & fisherOvRFile); TMVA::Factory WAISHPolFactory("StokesFisherOvRFactory", & WAISHPolFile); TMVA::Factory WAISVPolFactory("StokesFisherOvRFactory", & WAISVPolFile); TMVA::Factory HiCal2AFactory("StokesFisherOvRFactory", & HiCal2AFile); TMVA::Factory HiCal2BFactory("StokesFisherOvRFactory", & HiCal2BFile); TMVA::Factory iceMCFactory("StokesFisherOvRFactory", & iceMCFile); TMVA::Factory RCPFactory("StokesFisherOvRFactory", & RCPFile); TMVA::Factory LCPFactory("StokesFisherOvRFactory", & LCPFile); TMVA::Factory payloadBlastFactory("StokesFisherOvRFactory", & payloadBlastFile); TMVA::Factory sunFactory("StokesFisherOvRFactory", & sunFile); // TMVA::Factory minBiasThermalFactory("StokesFisherOvRFactory", & minBiasThermalFile); TMVA::Factory aboveHorizontalThermalFactory("StokesFisherOvRFactory", & aboveHorizontalThermalFile); // Booking, training, and writing. TString theOption = "VarTransform=P,G,D:CreateMVAPdfs:PDFInterpolMVAPdf=KDE:NbinsMVAPdf=%d"; // TString theOption = "VarTransform=P,G,D:CreateMVAPdfs:PDFInterpolMVAPdf=KDE:KDEiterMVAPdf=Adaptive:KDEFineFactorMVAPdf=0.3:NbinsMVAPdf=%d"; // Depending on number of signal samples, number of bins determined by average number of 50 bins per training or testing signal sample (each half the total signal sample), or 250 bins to reduce processing time. // fisherOvRFactory.BookMethod(& WAISHPolDL, TMVA::Types::kFisher, "WAISHPol", TString::Format(theOption, int(ceil(WAISHPolChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& WAISVPolDL, TMVA::Types::kFisher, "WAISVPol", TString::Format(theOption, int(ceil(WAISVPolChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& HiCal2ADL, TMVA::Types::kFisher, "HiCal2A", TString::Format(theOption, int(ceil(HiCal2AChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& HiCal2BDL, TMVA::Types::kFisher, "HiCal2B", TString::Format(theOption, int(ceil(HiCal2BChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& iceMCDL, TMVA::Types::kFisher, "iceMC", TString::Format(theOption, int(ceil(numIceMC / 100.)))); // fisherOvRFactory.BookMethod(& RCPDL, TMVA::Types::kFisher, "RCP", TString::Format(theOption, int(ceil(RCPChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& LCPDL, TMVA::Types::kFisher, "LCP", TString::Format(theOption, int(ceil(LCPChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& payloadBlastDL, TMVA::Types::kFisher, "payloadBlast", TString::Format(theOption, int(ceil(payloadBlastChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& sunDL, TMVA::Types::kFisher, "sun", TString::Format(theOption, int(ceil(sunChain.GetEntries() / 100.)))); //// fisherOvRFactory.BookMethod(& minBiasThermalDL, TMVA::Types::kFisher, "minBiasThermal", TString::Format(theOption, int(ceil(minBiasThermalChain.GetEntries() / 100.)))); // fisherOvRFactory.BookMethod(& aboveHorizontalThermalDL, TMVA::Types::kFisher, "aboveHorizontalThermal", TString::Format(theOption, int(ceil(aboveHorizontalThermalChain.GetEntries() / 100.)))); // // fisherOvRFactory.TrainAllMethods(); // fisherOvRFactory.TestAllMethods(); // fisherOvRFactory.EvaluateAllMethods(); // // fisherOvRFile.cd(); // fisherOvRFile.Write(); // fisherOvRFile.Close(); WAISHPolFactory.BookMethod(& WAISHPolDL, TMVA::Types::kFisher, "WAISHPol", TString::Format(theOption, int(ceil(WAISHPolChain.GetEntries() / 100.)))); WAISVPolFactory.BookMethod(& WAISVPolDL, TMVA::Types::kFisher, "WAISVPol", TString::Format(theOption, int(ceil(WAISVPolChain.GetEntries() / 100.)))); HiCal2AFactory.BookMethod(& HiCal2ADL, TMVA::Types::kFisher, "HiCal2A", TString::Format(theOption, int(ceil(HiCal2AChain.GetEntries() / 100.)))); HiCal2BFactory.BookMethod(& HiCal2BDL, TMVA::Types::kFisher, "HiCal2B", TString::Format(theOption, int(ceil(HiCal2BChain.GetEntries() / 100.)))); iceMCFactory.BookMethod(& iceMCDL, TMVA::Types::kFisher, "iceMC", TString::Format(theOption, int(ceil(numIceMC / 100.)))); RCPFactory.BookMethod(& RCPDL, TMVA::Types::kFisher, "RCP", TString::Format(theOption, int(ceil(RCPChain.GetEntries() / 100.)))); LCPFactory.BookMethod(& LCPDL, TMVA::Types::kFisher, "LCP", TString::Format(theOption, int(ceil(LCPChain.GetEntries() / 100.)))); payloadBlastFactory.BookMethod(& payloadBlastDL, TMVA::Types::kFisher, "payloadBlast", TString::Format(theOption, int(ceil(payloadBlastChain.GetEntries() / 100.)))); sunFactory.BookMethod(& sunDL, TMVA::Types::kFisher, "sun", TString::Format(theOption, int(ceil(sunChain.GetEntries() / 100.)))); // minBiasThermalFactory.BookMethod(& minBiasThermalDL, TMVA::Types::kFisher, "minBiasThermal", TString::Format(theOption, int(ceil(minBiasThermalChain.GetEntries() / 100.)))); aboveHorizontalThermalFactory.BookMethod(& aboveHorizontalThermalDL, TMVA::Types::kFisher, "aboveHorizontalThermal", TString::Format(theOption, int(ceil(aboveHorizontalThermalChain.GetEntries() / 100.)))); WAISHPolFactory.TrainAllMethods(); WAISHPolFactory.TestAllMethods(); WAISHPolFactory.EvaluateAllMethods(); WAISHPolFile.cd(); WAISHPolFile.Write(); WAISHPolFile.Close(); WAISVPolFactory.TrainAllMethods(); WAISVPolFactory.TestAllMethods(); WAISVPolFactory.EvaluateAllMethods(); WAISVPolFile.cd(); WAISVPolFile.Write(); WAISVPolFile.Close(); HiCal2AFactory.TrainAllMethods(); HiCal2AFactory.TestAllMethods(); HiCal2AFactory.EvaluateAllMethods(); HiCal2AFile.cd(); HiCal2AFile.Write(); HiCal2AFile.Close(); HiCal2BFactory.TrainAllMethods(); HiCal2BFactory.TestAllMethods(); HiCal2BFactory.EvaluateAllMethods(); HiCal2BFile.cd(); HiCal2BFile.Write(); HiCal2BFile.Close(); iceMCFactory.TrainAllMethods(); iceMCFactory.TestAllMethods(); iceMCFactory.EvaluateAllMethods(); iceMCFile.cd(); iceMCFile.Write(); iceMCFile.Close(); RCPFactory.TrainAllMethods(); RCPFactory.TestAllMethods(); RCPFactory.EvaluateAllMethods(); RCPFile.cd(); RCPFile.Write(); RCPFile.Close(); LCPFactory.TrainAllMethods(); LCPFactory.TestAllMethods(); LCPFactory.EvaluateAllMethods(); LCPFile.cd(); LCPFile.Write(); LCPFile.Close(); payloadBlastFactory.TrainAllMethods(); payloadBlastFactory.TestAllMethods(); payloadBlastFactory.EvaluateAllMethods(); payloadBlastFile.cd(); payloadBlastFile.Write(); payloadBlastFile.Close(); sunFactory.TrainAllMethods(); sunFactory.TestAllMethods(); sunFactory.EvaluateAllMethods(); sunFile.cd(); sunFile.Write(); sunFile.Close(); // minBiasThermalFactory.TrainAllMethods(); // minBiasThermalFactory.TestAllMethods(); // minBiasThermalFactory.EvaluateAllMethods(); // // minBiasThermalFile.cd(); // minBiasThermalFile.Write(); // minBiasThermalFile.Close(); aboveHorizontalThermalFactory.TrainAllMethods(); aboveHorizontalThermalFactory.TestAllMethods(); aboveHorizontalThermalFactory.EvaluateAllMethods(); aboveHorizontalThermalFile.cd(); aboveHorizontalThermalFile.Write(); aboveHorizontalThermalFile.Close(); }