Compare commits

..

No commits in common. "4ba9c73b98299b1ef271dc1b75cea0899cbe1efa" and "b0093563d56b201311de9e380717706fb418fd9a" have entirely different histories.

View File

@ -28,8 +28,6 @@ TH2F * hqqqVpcIndex;
TH2F * hqqqVpcE; TH2F * hqqqVpcE;
TH2F * hsx3VpcE; TH2F * hsx3VpcE;
TH2F * hanVScatsum; TH2F * hanVScatsum;
TH2F * hAnodeHits;
int padID = 0; int padID = 0;
SX3 sx3_contr; SX3 sx3_contr;
@ -69,7 +67,6 @@ void Analyzer::Begin(TTree * /*tree*/){
hsx3VpcE->SetNdivisions( -12, "y"); hsx3VpcE->SetNdivisions( -12, "y");
hZProj = new TH1F("hZProj", "Z Projection", 200, -600, 600); hZProj = new TH1F("hZProj", "Z Projection", 200, -600, 600);
hAnodeHits = new TH2F("hAnodeHits", "Anode vs Anode Energy, Anode ID; Anode E", 24,0 , 23, 400, 0 , 16000);
hanVScatsum = new TH2F("hanVScatsum", "Anode vs Cathode Sum; Anode E; Cathode E", 400,0 , 10000, 400, 0 , 16000); hanVScatsum = new TH2F("hanVScatsum", "Anode vs Cathode Sum; Anode E; Cathode E", 400,0 , 10000, 400, 0 , 16000);
@ -260,66 +257,66 @@ Bool_t Analyzer::Process(Long64_t entry){
} }
// //======================= PC // //======================= PC
std::vector<std::pair<int, double>> anodeHits; ID.clear();
std::vector<std::pair<int, double>> cathodeHits; int counter=0;
std::vector<std::pair<int, double>> E;
E.clear();
for( int i = 0; i < pc.multi; i ++){
if( pc.e[i] > 100 ) ID.push_back(std::pair<int, int>(pc.id[i], i));
if( pc.e[i] > 100 ) E.push_back(std::pair<int, double>(pc.index[i], pc.e[i]));
hpcIndexVE->Fill( pc.index[i], pc.e[i] );
for( int j = i+1; j < pc.multi; j++){
hpcCoin->Fill( pc.index[i], pc.index[j]);
}
}
// for( size_t i = 0; i < E.size(); i++) printf("%zu | %d %d \n", i, E[i].first, E[i].second );
if( E.size()>=3 ){
int aID = 0; int aID = 0;
int cID = 0; int cID = 0;
float aE = 0; float aE = 0;
float cE = 0; float cE = 0;
bool multi_an =false;
// if( ID[0].first < 1 ) {
// aID = pc.ch[ID[0].second];
// cID = pc.ch[ID[1].second];
// }else{
// cID = pc.ch[ID[0].second];
// aID = pc.ch[ID[1].second];
// }
// printf("anode= %d, cathode = %d\n", aID, cID);
// Define the excluded SX3 and QQQ channels // for( int k = 0; k < qqq.multi; k++){
std::unordered_set<int> excludeSX3 = {34, 35, 36, 37, 61, 62, 67, 73, 74, 75, 76, 77, 78, 79, 80, 93, 97, 100, 103, 108, 109, 110, 111, 112}; // if(qqq.index[k]==75 && pc.index[k]==2 && pc.e[k]>100){
std::unordered_set<int> excludeQQQ = {0, 17, 109, 110, 111, 112, 113, 119, 127, 128}; for(int l=0;l<E.size();l++){
if(E[l].first<24 && E[l].first!=20 && E[l].first!=12){
for (int i = 0; i < pc.multi; i++) { if(!multi_an){
if (pc.e[i] > 20) { // Reduced threshold for debugging aE = E[l].second;
}
for (int j = 0; j < sx3.multi; j++) { multi_an=true;
if (excludeSX3.find(sx3.index[j]) == excludeSX3.end()) { }
else {
hpcIndexVE->Fill(pc.index[i], pc.e[i]); cE = E[l].second + cE;
if (pc.e[i] > 20) {
if (pc.index[i] < 24) {
anodeHits.push_back(std::make_pair(pc.index[i], pc.e[i]));
} else if (pc.index[i] >= 24) {
cathodeHits.push_back(std::make_pair(pc.index[i], pc.e[i]));
} }
} }
// }
// }
hanVScatsum->Fill(aE,cE);
for (int k = i + 1; k < pc.multi; k++) { if( ID[0].first < 1 ) {
hpcCoin->Fill(pc.index[i], pc.index[k]); aID = pc.ch[ID[0].second];
cID = pc.ch[ID[1].second];
}else{
cID = pc.ch[ID[0].second];
aID = pc.ch[ID[1].second];
} }
}
}
if (!anodeHits.empty() && !cathodeHits.empty()) {
float aESum = 0;
float cESum = 0;
for (const auto& anode : anodeHits) {
aESum += anode.second;
hAnodeHits->Fill(anode.first, anode.second);
}
for (const auto& cathode : cathodeHits) {
cESum += cathode.second;
}
// Debugging output
printf("Filling histogram: aESum = %f, cESum = %f\n", aESum, cESum);
hanVScatsum->Fill(aESum, cESum);
}
anodeHits.clear();
cathodeHits.clear();
}
}
// hanVScatsum->Fill(aE,cE);
if( HitNonZero){ if( HitNonZero){
pw_contr.CalTrack( hitPos, aID, cID); pw_contr.CalTrack( hitPos, aID, cID);
@ -327,7 +324,7 @@ for (int i = 0; i < pc.multi; i++) {
} }
}
@ -400,7 +397,6 @@ void Analyzer::Terminate(){
canvas->cd(padID); canvas->cd(padID)->SetGrid(1); canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
// hZProj->Draw(); // hZProj->Draw();
// hanVScatsum->Draw("colz"); hanVScatsum->Draw("colz");
hAnodeHits->Draw("colz");
} }