|
||||
File indexing completed on 2025-01-18 10:17:19
0001 // Copyright 2020, Jefferson Science Associates, LLC. 0002 // Subject to the terms in the LICENSE file found in the top-level directory. 0003 0004 #pragma once 0005 #include <JANA/JObject.h> 0006 0007 /// JObjects are plain-old data containers for inputs, intermediate results, and outputs. 0008 /// They have member functions for introspection and maintaining associations with other JObjects, but 0009 /// all of the numerical code which goes into their creation should live in a JFactory instead. 0010 /// You are allowed to include STL containers and pointers to non-POD datatypes inside your JObjects, 0011 /// however, it is highly encouraged to keep them flat and include only primitive datatypes if possible. 0012 /// Think of a JObject as being a row in a database table, with event number as an implicit foreign key. 0013 0014 struct CalorimeterCluster : public JObject { 0015 0016 JOBJECT_PUBLIC(CalorimeterCluster) 0017 0018 double x_center; // Pixel coordinates centered around 0,0 0019 double y_center; // Pixel coordinates centered around 0,0 0020 double E_tot; // Energy loss in GeV 0021 double t_begin; // Time in us 0022 double t_end; // Time in us 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_center, NAME_OF(x_center), "%f", "Pixel coords <- [0,80)"); 0032 summary.add(y_center, NAME_OF(y_center), "%f", "Pixel coords <- [0,24)"); 0033 summary.add(E_tot, NAME_OF(E_tot), "%f", "Energy loss in GeV"); 0034 summary.add(t_begin, NAME_OF(t_begin), "%f", "Earliest observed time in us"); 0035 summary.add(t_end, NAME_OF(t_end), "%f", "Latest observed time in us"); 0036 } 0037 0038 }; 0039 0040
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |