modified: TrackRecon.C mismatched braces
This commit is contained in:
parent
fce1fb6c1d
commit
4d9145d532
157
TrackRecon.C
157
TrackRecon.C
|
|
@ -1496,6 +1496,7 @@ Bool_t TrackRecon::Process(Long64_t entry)
|
|||
for (int j = i + 1; j < pc.multi; j++)
|
||||
{
|
||||
if (doRawHistos)
|
||||
{
|
||||
plotter->Fill2D("PC_Coincidence_Matrix", 48, 0, 48, 48, 0, 48, pc.index[i], pc.index[j], "hRawPC");
|
||||
// only tag with anodeT-cathodeT once both are real: with the sentinels still in
|
||||
// place the difference is -199998, which piled the early hits into the "_1" plot
|
||||
|
|
@ -1508,16 +1509,16 @@ Bool_t TrackRecon::Process(Long64_t entry)
|
|||
plotter->Fill2D("Anode_V_Anode", 24, 0, 24, 24, 0, 24, pc.index[i], pc.index[j], "hGMPC");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// anodeT - cathodeT is one number per event, so it gets filled once per event.
|
||||
// This block used to sit inside the pc.multi loop above *and* wrap an inner loop
|
||||
// over qqq.multi / sx3.multi, so the identical value was filled O(pc.multi x
|
||||
// qqq.multi) times -- inflating the statistics and weighting every event by its
|
||||
// own multiplicity. PC_Time_Vs_QQQ_ch genuinely needs the channel loop, so it
|
||||
// keeps one; the rest do not.
|
||||
if (diagnostic_tplots && anodeT != -99999 && cathodeT != 99999)
|
||||
{
|
||||
// anodeT - cathodeT is one number per event, so it gets filled once per event.
|
||||
// This block used to sit inside the pc.multi loop above *and* wrap an inner loop
|
||||
// over qqq.multi / sx3.multi, so the identical value was filled O(pc.multi x
|
||||
// qqq.multi) times -- inflating the statistics and weighting every event by its
|
||||
// own multiplicity. PC_Time_Vs_QQQ_ch genuinely needs the channel loop, so it
|
||||
// keeps one; the rest do not.
|
||||
if (diagnostic_tplots && anodeT != -99999 && cathodeT != 99999)
|
||||
{
|
||||
double pcDT = anodeT - cathodeT;
|
||||
plotter->Fill1D("PC_Time", 200, -2000, 2000, pcDT, "hTiming");
|
||||
if (qqq.multi > 0)
|
||||
|
|
@ -1534,14 +1535,14 @@ if (diagnostic_tplots && anodeT != -99999 && cathodeT != 99999)
|
|||
plotter->Fill2D("PC_Time_vs_AIndex_sx3", 200, -2000, 2000, 24, -0.5, 23.5, pcDT, anodeIndex, "hTiming");
|
||||
plotter->Fill2D("PC_Time_vs_CIndex_sx3", 200, -2000, 2000, 24, -0.5, 23.5, pcDT, cathodeIndex, "hTiming");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anodeHits.clear();
|
||||
cathodeHits.clear();
|
||||
corrcatMax.clear();
|
||||
anodeHits.clear();
|
||||
cathodeHits.clear();
|
||||
corrcatMax.clear();
|
||||
|
||||
for (int i = 0; i < pc.multi; i++)
|
||||
{
|
||||
for (int i = 0; i < pc.multi; i++)
|
||||
{
|
||||
// if (pc.e[i] > 100)
|
||||
{
|
||||
if (pc.index[i] < 24)
|
||||
|
|
@ -1553,20 +1554,20 @@ for (int i = 0; i < pc.multi; i++)
|
|||
cathodeHits.push_back(std::pair<int, double>(pc.index[i] - 24, pc.e[i] * cathode_gain));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(anodeHits.begin(), anodeHits.end(), [](std::pair<int, double> a, std::pair<int, double> b)
|
||||
std::sort(anodeHits.begin(), anodeHits.end(), [](std::pair<int, double> a, std::pair<int, double> b)
|
||||
{ return a.first < b.first; });
|
||||
|
||||
std::sort(cathodeHits.begin(), cathodeHits.end(), [](std::pair<int, double> a, std::pair<int, double> b)
|
||||
std::sort(cathodeHits.begin(), cathodeHits.end(), [](std::pair<int, double> a, std::pair<int, double> b)
|
||||
{ return a.first < b.first; });
|
||||
|
||||
// clusters = collection of (collection of wires) where each wire is (index, energy, timestamp)
|
||||
std::vector<std::vector<std::tuple<int, double, double>>> aClusters = pwinstance.Make_Clusters(aWireEvents);
|
||||
std::vector<std::vector<std::tuple<int, double, double>>> cClusters = pwinstance.Make_Clusters(cWireEvents);
|
||||
// clusters = collection of (collection of wires) where each wire is (index, energy, timestamp)
|
||||
std::vector<std::vector<std::tuple<int, double, double>>> aClusters = pwinstance.Make_Clusters(aWireEvents);
|
||||
std::vector<std::vector<std::tuple<int, double, double>>> cClusters = pwinstance.Make_Clusters(cWireEvents);
|
||||
|
||||
for (const auto &aCluster : aClusters)
|
||||
{
|
||||
for (const auto &aCluster : aClusters)
|
||||
{
|
||||
if (clusterHasExcludedAnode(aCluster))
|
||||
continue;
|
||||
if (aCluster.size() == 2)
|
||||
|
|
@ -1672,10 +1673,10 @@ for (const auto &aCluster : aClusters)
|
|||
; // std::cout << "AAAA " << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cClusters.empty())
|
||||
{
|
||||
if (cClusters.empty())
|
||||
{
|
||||
for (const auto &aCl : aClusters)
|
||||
{
|
||||
if (aCl.size() < 1 || aCl.size() > 2) // A1C0 (1 wire) or A2C0 (2 wires) --
|
||||
|
|
@ -1744,20 +1745,20 @@ if (cClusters.empty())
|
|||
PC_Events_calibrated.push_back(ev);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doPCEnergyCalibration)
|
||||
{
|
||||
if (doPCEnergyCalibration)
|
||||
{
|
||||
pcEnergyCalibrationAccumulate(PC_Events, QQQ_Events, SX3_Events);
|
||||
pcEnergyCalibrationAccumulateProton(PC_Events, QQQ_Events, SX3_Events);
|
||||
}
|
||||
}
|
||||
|
||||
//////Timing stuff for F data
|
||||
//////Timing stuff for F data
|
||||
|
||||
TRandom3 &rnd = anasenRandom;
|
||||
double dt_rf_mcp_event = -987654321;
|
||||
double ts_rf_event = -987654321, ts_mcp_event = -987654321;
|
||||
{
|
||||
TRandom3 &rnd = anasenRandom;
|
||||
double dt_rf_mcp_event = -987654321;
|
||||
double ts_rf_event = -987654321, ts_mcp_event = -987654321;
|
||||
{
|
||||
for (int j = 0; j < misc.multi; j++)
|
||||
{
|
||||
if (misc.ch[j] == 3)
|
||||
|
|
@ -1767,9 +1768,9 @@ double ts_rf_event = -987654321, ts_mcp_event = -987654321;
|
|||
}
|
||||
if (ts_rf_event > -987654321 && ts_mcp_event > -987654321)
|
||||
dt_rf_mcp_event = ts_rf_event - ts_mcp_event;
|
||||
}
|
||||
if (dataset == "17F" && reactiondata)
|
||||
{
|
||||
}
|
||||
if (dataset == "17F" && reactiondata)
|
||||
{
|
||||
// misc.ch is a property of the event, not of any Si hit -- filled inside the
|
||||
// per-QQQ and per-SX3 loops it was multiplied by the Si multiplicity.
|
||||
for (int j = 0; j < misc.multi; j++)
|
||||
|
|
@ -1875,28 +1876,28 @@ if (dataset == "17F" && reactiondata)
|
|||
}
|
||||
ctr += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (process_alpha_proton_scattering)
|
||||
{
|
||||
if (process_alpha_proton_scattering)
|
||||
{
|
||||
protonAlphaHistograms(plotter, QQQ_Events, SX3_Events, PC_Events);
|
||||
// return kTRUE;
|
||||
} // end if(process_alpha_proton_scattering)
|
||||
} // end if(process_alpha_proton_scattering)
|
||||
|
||||
if (pcEnergyCalibLoaded)
|
||||
if (pcEnergyCalibLoaded)
|
||||
pcCalibratedHistograms(plotter, QQQ_Events, SX3_Events, PC_Events_calibrated);
|
||||
|
||||
a1c1CalibDiagnostic(plotter, PC_Events); // <-- new, unconditional
|
||||
pcVertexByWireGeometry(plotter, QQQ_Events, SX3_Events, PC_Events); // <-- new, unconditional
|
||||
a1c1CalibDiagnostic(plotter, PC_Events); // <-- new, unconditional
|
||||
pcVertexByWireGeometry(plotter, QQQ_Events, SX3_Events, PC_Events); // <-- new, unconditional
|
||||
|
||||
// phi_win matches every other Si-PC match in this file: SX3 sits at a longer lever
|
||||
// arm (rho ~88mm vs the PC anode at 37mm) than QQQ, so its true phi spread is wider
|
||||
// -- pi/4 for both detectors under-counted real SX3-PC coincidences. Also gated on
|
||||
// siPcCoincident(): this used to be the one Si-PC match in the file with a phi
|
||||
// window but no time gate, so "withPC" included phi-aligned but time-accidental
|
||||
// pairs.
|
||||
auto hasPCCoincidence = [&](const Event &sievent, bool isQQQ)
|
||||
{
|
||||
// phi_win matches every other Si-PC match in this file: SX3 sits at a longer lever
|
||||
// arm (rho ~88mm vs the PC anode at 37mm) than QQQ, so its true phi spread is wider
|
||||
// -- pi/4 for both detectors under-counted real SX3-PC coincidences. Also gated on
|
||||
// siPcCoincident(): this used to be the one Si-PC match in the file with a phi
|
||||
// window but no time gate, so "withPC" included phi-aligned but time-accidental
|
||||
// pairs.
|
||||
auto hasPCCoincidence = [&](const Event &sievent, bool isQQQ)
|
||||
{
|
||||
double phi_win = isQQQ ? TMath::Pi() / 4.0 : TMath::Pi() / 3.0;
|
||||
for (const auto &pcevent : PC_Events)
|
||||
{
|
||||
|
|
@ -1908,41 +1909,41 @@ auto hasPCCoincidence = [&](const Event &sievent, bool isQQQ)
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
for (const auto &qqqevent : QQQ_Events)
|
||||
{
|
||||
};
|
||||
for (const auto &qqqevent : QQQ_Events)
|
||||
{
|
||||
plotter->Fill1D("siE_qqq_calibrated_all", 800, 0, 15, qqqevent.Energy1, "siE");
|
||||
bool coinc = hasPCCoincidence(qqqevent, true);
|
||||
plotter->Fill1D(coinc ? "siE_qqq_calibrated_withPC" : "siE_qqq_calibrated_noPC", 800, 0, 15, qqqevent.Energy1, "siE");
|
||||
}
|
||||
for (const auto &sx3event : SX3_Events)
|
||||
{
|
||||
}
|
||||
for (const auto &sx3event : SX3_Events)
|
||||
{
|
||||
plotter->Fill1D("siE_sx3_calibrated_all", 800, 0, 15, sx3event.Energy1, "siE");
|
||||
bool coinc = hasPCCoincidence(sx3event, false);
|
||||
plotter->Fill1D(coinc ? "siE_sx3_calibrated_withPC" : "siE_sx3_calibrated_noPC", 800, 0, 15, sx3event.Energy1, "siE");
|
||||
}
|
||||
}
|
||||
|
||||
if (doMiscHistograms && ta_foil_run)
|
||||
{
|
||||
if (doMiscHistograms && ta_foil_run)
|
||||
{
|
||||
// det, si_ecut, perp_cut, phi_win -- identical per-detector cuts to the
|
||||
// m17Fax/m27Alax reaction_ax_core calls below, by design. a1c0/a2c0 (the
|
||||
// former miscHistograms_oneWire) is folded in here now, gated on
|
||||
// onewire_analysis internally.
|
||||
protonAlphaElastic_core(plotter, QQQ_Events, PC_Events, aClusters, true, "QQQ", 0.4, 6.0, TMath::Pi() / 4.0, 6.88);
|
||||
protonAlphaElastic_core(plotter, SX3_Events, PC_Events, aClusters, false, "SX3", 0.5, 10.0, TMath::Pi() / 3.0, 6.88);
|
||||
}
|
||||
}
|
||||
|
||||
if (reactiondata)
|
||||
{
|
||||
if (reactiondata)
|
||||
{
|
||||
if (dataset == "17F")
|
||||
miscHistograms_17Fax(plotter, QQQ_Events, SX3_Events, PC_Events, aClusters, "", dt_rf_mcp_event, ts_rf_event, ts_mcp_event);
|
||||
if (dataset == "27Al")
|
||||
miscHistograms_27Alax(plotter, QQQ_Events, SX3_Events, PC_Events, aClusters);
|
||||
}
|
||||
// return kTRUE;
|
||||
}
|
||||
// return kTRUE;
|
||||
|
||||
if (doRawHistos)
|
||||
{
|
||||
if (doRawHistos)
|
||||
{
|
||||
if (QQQ_Events.size() && PC_Events.size())
|
||||
plotter->Fill2D("PCEv_vs_QQQEv", 20, 0, 20, 20, 0, 20, QQQ_Events.size(), PC_Events.size());
|
||||
|
||||
|
|
@ -1960,19 +1961,19 @@ if (doRawHistos)
|
|||
{
|
||||
plotter->Fill2D("ac_vs_cc_ign0", 20, 0, 20, 20, 0, 20, aClusters.size(), cClusters.size(), "wiremult");
|
||||
}
|
||||
}
|
||||
if (doPCSX3ClusterAnalysis)
|
||||
{
|
||||
}
|
||||
if (doPCSX3ClusterAnalysis)
|
||||
{
|
||||
PCSX3ClusterAnalysis(plotter, QQQ_Events, SX3_Events, PC_Events, aClusters, cClusters);
|
||||
}
|
||||
if (doPCQQQClusterAnalysis)
|
||||
{
|
||||
}
|
||||
if (doPCQQQClusterAnalysis)
|
||||
{
|
||||
PCQQQClusterAnalysis(plotter, QQQ_Events, SX3_Events, PC_Events, aClusters, cClusters);
|
||||
}
|
||||
}
|
||||
|
||||
if (doOldAnalysis)
|
||||
if (doOldAnalysis)
|
||||
OldAnalysis();
|
||||
return kTRUE;
|
||||
return kTRUE;
|
||||
}
|
||||
|
||||
void TrackRecon::Terminate()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user