Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:57:57

0001 
0002 // Copyright 2020, 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 
0008 /// JObjects are plain-old data containers for inputs, intermediate results, and outputs.
0009 /// They have member functions for introspection and maintaining associations with other JObjects, but
0010 /// all of the numerical code which goes into their creation should live in a JFactory instead.
0011 /// You are allowed to include STL containers and pointers to non-POD datatypes inside your JObjects,
0012 /// however, it is highly encouraged to keep them flat and include only primitive datatypes if possible.
0013 /// Think of a JObject as being a row in a database table, with event number as an implicit foreign key.
0014 
0015 struct CalorimeterHit : public JObject {
0016 
0017     JOBJECT_PUBLIC(CalorimeterHit)
0018 
0019     int x;     // Pixel coordinates centered around 0,0
0020     int y;     // Pixel coordinates centered around 0,0
0021     double E;  // Energy loss in GeV
0022     double t;  // Time in ms
0023 
0024 
0025     /// Override Summarize to tell JANA how to produce a convenient string representation for our JObject.
0026     /// This can be used called from user code, but also lets JANA automatically inspect its own data. For instance,
0027     /// adding JCsvWriter<Hit> will automatically generate a CSV file containing each hit. Warning: This is obviously
0028     /// slow, so use this for debugging and monitoring but not inside the performance critical code paths.
0029 
0030     void Summarize(JObjectSummary& summary) const override {
0031         summary.add(x, NAME_OF(x), "%d", "Pixel coordinates centered around 0,0");
0032         summary.add(y, NAME_OF(y), "%d", "Pixel coordinates centered around 0,0");
0033         summary.add(E, NAME_OF(E), "%f", "Energy loss in GeV");
0034         summary.add(t, NAME_OF(t), "%f", "Time in ms");
0035     }
0036 };
0037 
0038