Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:17:19

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