modified: Analyzer.C

HPZProjection implemented, testing seems to result in a plot with 0s. Need to debug
This commit is contained in:
Vignesh Sitaraman 2025-01-31 09:25:37 -05:00
parent 02213caaee
commit 699b0f8701

View File

@ -47,6 +47,7 @@ std::map<int, std::pair<double, double>> slopeInterceptMap;
bool HitNonZero;
TH1F *hZProj;
TH1F *hPCZProj;
void Analyzer::Begin(TTree * /*tree*/)
{
@ -83,6 +84,7 @@ void Analyzer::Begin(TTree * /*tree*/)
hsx3VpcE->SetNdivisions(-12, "y");
hZProj = new TH1F("hZProj", "Z Projection", 200, -600, 600);
hPCZProj = new TH1F("hPCZProj", "PC Z Projection", 200, -600, 600);
hanVScatsum = new TH2F("hanVScatsum", "Anode vs Cathode Sum; Anode E; Cathode E", 400, 0, 16000, 400, 0, 20000);
hAnodeMultiplicity = new TH1F("hAnodeMultiplicity", "Number of Anodes/Event", 40, 0, 40);
@ -434,6 +436,7 @@ Bool_t Analyzer::Process(Long64_t entry)
std::vector<std::pair<int, double>> cathodeHits = {};
std::vector<std::pair<int, double>> corrcatMax = {};
std::vector<std::pair<int, double>> corrcatnextMax = {};
std::vector<std::pair<int, double>> commcat = {};
int aID = 0;
int cID = 0;
float aE = 0;
@ -523,21 +526,44 @@ Bool_t Analyzer::Process(Long64_t entry)
}
cESum += cE;
// This section of code is used to find the cathodes are correlated with the max and next max anodes, as well as to figure out if there are any common cathodes
for (int j = 0; j < 5; j++)
{
if ((aIDMax + 24 + j) % 24 == cathode.first)
{
corrcatMax.push_back(std::pair<int, double>(cathode.first, cathode.second));
std::sort(corrcatMax.begin(), corrcatMax.end(), [](const std::pair<int, double> &a, const std::pair<int, double> &b)
{ return a.second > b.second; });
}
if ((aIDnextMax + 24 + j) % 24 == cathode.first)
{
corrcatnextMax.push_back(std::pair<int, double>(cathode.first, cathode.second));
std::sort(corrcatMax.begin(), corrcatMax.end(), [](const std::pair<int, double> &a, const std::pair<int, double> &b)
{ return a.second > b.second; });
}
for (int k = 0; k < 5; k++)
{
if ((aIDMax + 24 + j) % 24 == (aIDnextMax + 24 + k) % 24)
{
commcat.push_back(std::pair<int, double>(cathode.first, cathode.second));
}
}
// for(int j=0;j<24;j++){
// if(corrcatMax[j]==corrcatnextMax[j])
// std::cout << "Common Cathode" << j;
// }
}
}
TVector3 anodeIntersection;
// Implementing a method for PC reconstruction using a single Anode event
if (anodeHits.size() == 1)
{
for (const auto &corr : corrcatMax)
{
anodeIntersection += TVector3((corr.second) / cESum * Crossover[aIDMax][corr.first][0].x, (corr.second) / cESum * Crossover[aIDMax][corr.first][0].y,
(corr.second) / cESum * Crossover[aIDMax][corr.first][0].z);
}
}
//Filling the PC Z projection histogram
hPCZProj->Fill(anodeIntersection.Z());
// }
@ -587,7 +613,6 @@ Bool_t Analyzer::Process(Long64_t entry)
// }
}
}
}
if (HitNonZero)
{