Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 10:33:36

0001 
0002 // Copyright 2020-2025, Jefferson Science Associates, LLC.
0003 // Subject to the terms in the LICENSE file found in the top-level directory.
0004 
0005 #pragma once
0006 #include <JANA/JObject.h>
0007 #include <cstdint>
0008 
0009 
0010 struct CalorimeterHit : public JObject {
0011 
0012     JOBJECT_PUBLIC(CalorimeterHit)
0013 
0014     int cell_id; // Cell's id
0015 
0016     int row;  // Cell's row in detector plane (zero-indexed)
0017     int col;  // Cell's column in detector plane (zero-indexed)
0018 
0019     double x; // x location of cell's center [cm]
0020     double y; // y location of cell's center [cm]
0021     double z; // z location of cell's center [cm]
0022 
0023     double energy;  // Measured energy deposit [GeV]
0024     uint64_t time;  // Time [ns]
0025 
0026 
0027     // Define a constructor that forces all fields to be initialized
0028     CalorimeterHit(int cell_id, int row, int col, double x, double y, double z, double energy, uint64_t time)
0029     : cell_id(cell_id), row(row), col(col), x(x), y(y), z(z), energy(energy), time(time) {}
0030 
0031 
0032     void Summarize(JObjectSummary& summary) const override {
0033         summary.add(cell_id, NAME_OF(cell_id), "%d", "Cell ID");
0034         summary.add(row, NAME_OF(row), "%d", "Cell row (zero-indexed)");
0035         summary.add(col, NAME_OF(col), "%d", "Cell col (zero-indexed)");
0036         summary.add(x, NAME_OF(x), "%f", "x location of cell center [cm]");
0037         summary.add(y, NAME_OF(y), "%f", "y location of cell center [cm]");
0038         summary.add(z, NAME_OF(z), "%f", "z location of cell center [cm]");
0039         summary.add(energy, NAME_OF(energy), "%f", "Measured energy deposit [GeV]");
0040         summary.add(time, NAME_OF(time), "%d", "Time [ns]");
0041     }
0042 };
0043 
0044