Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pindex should be short #302

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/iguana/algorithms/clas12/FiducialFilter/Algorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void FiducialFilter::Run(hipo::banklist& banks) const {
std::map<int, FiducialFilter::traj_row_data> traj_map;

for(auto const& row : bank.getRowList()){
auto pindex = bank.getInt("pindex",row);
auto pindex = bank.getShort("pindex",row);
auto x = bank.getFloat("x",row);
auto y = bank.getFloat("y",row);
auto z = bank.getFloat("z",row);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ namespace iguana::clas12 {
// Loop over REC::Calorimeter rows
// Here we use bank.getRows() to purposefully ignore upstream filters
for(int row = 0; row < bank.getRows(); row++){
auto pindex = bank.getInt("pindex",row);
auto pindex = bank.getShort("pindex",row);
auto x = bank.getFloat("x",row);
auto y = bank.getFloat("y",row);
auto z = bank.getFloat("z",row);
Expand Down
10 changes: 5 additions & 5 deletions src/iguana/algorithms/clas12/SectorFinder/Algorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace iguana::clas12 {

// create the output bank
// FIXME: generalize the groupid and itemid
auto result_schema = CreateBank(banks, b_result, "REC::Particle::Sector", {"sector/I","pindex/I"}, 0xF000, 4);
auto result_schema = CreateBank(banks, b_result, "REC::Particle::Sector", {"sector/I","pindex/S"}, 0xF000, 4);
i_sector = result_schema.getEntryOrder("sector");
i_pindex = result_schema.getEntryOrder("pindex");
}
Expand Down Expand Up @@ -95,7 +95,7 @@ namespace iguana::clas12 {
resultBank.getMutableRowList().setList(particleBank.getRowList());
for(int row = 0; row < resultBank.getRows(); row++){
resultBank.putInt(i_sector, row, 0);
resultBank.putInt(i_pindex, row, row);
resultBank.putShort(i_pindex, row, static_cast<int16_t>(row));
}


Expand All @@ -112,7 +112,7 @@ namespace iguana::clas12 {
int sect=GetSector(sct_us, pin_us,row);
if (sect!=-1){
resultBank.putInt(i_sector, row, sect);
resultBank.putInt(i_pindex, row, row);
resultBank.putShort(i_pindex, row, static_cast<int16_t>(row));
}
} else {
enum det_enum {kTrack, kScint, kCal, nDet}; // try to get sector from these detectors, in this order
Expand All @@ -136,7 +136,7 @@ namespace iguana::clas12 {
if(sect != -1) {
m_log->Trace("{} pindex {} sect {}", det_name, row, sect);
resultBank.putInt(i_sector, row, sect);
resultBank.putInt(i_pindex, row, row);
resultBank.putShort(i_pindex, row, static_cast<int16_t>(row));
break;
}
}
Expand All @@ -154,7 +154,7 @@ namespace iguana::clas12 {
int det=bank.getByte("detector",row);
if (listFDDets.find(det) != listFDDets.end()) {
sectors.push_back(bank.getInt("sector", row));
pindices.push_back(bank.getInt("pindex", row));
pindices.push_back(bank.getShort("pindex", row));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/iguana/algorithms/clas12/SectorFinder/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace iguana::clas12 {
/// // eg det 7 is the ECAL
/// if(det==7){
/// sectors.push_back(bank.getInt("sector", row));
/// pindices.push_back(bank.getInt("pindex", row));
/// pindices.push_back(bank.getShort("pindex", row));
/// }
/// }
///
Expand Down
2 changes: 1 addition & 1 deletion src/iguana/algorithms/clas12/SectorFinder/Validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace iguana::clas12 {

double x=0,y=0;
for(auto const& rowcal : cal_bank.getRowList()){
if(cal_bank.getInt("pindex", rowcal)==row){
if(cal_bank.getShort("pindex", rowcal)==row){
x=cal_bank.getFloat("x", rowcal);
y=cal_bank.getFloat("y", rowcal);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ namespace iguana::physics {
}
}

result_bank.putShort(i_pindex_a, dih_row, had_a.row);
result_bank.putShort(i_pindex_b, dih_row, had_b.row);
result_bank.putShort(i_pindex_a, dih_row, static_cast<int16_t>(had_a.row));
result_bank.putShort(i_pindex_b, dih_row, static_cast<int16_t>(had_b.row));
result_bank.putInt(i_pdg_a, dih_row, had_a.pdg);
result_bank.putInt(i_pdg_b, dih_row, had_b.pdg);
result_bank.putDouble(i_Mh, dih_row, Mh);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace iguana::physics {
result_bank_rowlist.push_back(row);

// fill the bank
result_bank.putShort(i_pindex, row, row);
result_bank.putShort(i_pindex, row, static_cast<int16_t>(row));
result_bank.putInt(i_pdg, row, pdg);
result_bank.putDouble(i_z, row, z);
result_bank.putDouble(i_MX, row, MX);
Expand All @@ -142,7 +142,7 @@ namespace iguana::physics {
}
else {
// zero the row
result_bank.putShort(i_pindex, row, row);
result_bank.putShort(i_pindex, row, static_cast<int16_t>(row));
result_bank.putInt(i_pdg, row, pdg);
result_bank.putDouble(i_z, row, 0);
result_bank.putDouble(i_MX, row, 0);
Expand Down
Loading