Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:29:38

0001 
0002 #include "CollectionTabulators.h"
0003 
0004 JTablePrinter TabulateClusters(const ExampleClusterCollection* c) {
0005     
0006     JTablePrinter t;
0007     t.AddColumn("clusterId");
0008     t.AddColumn("energy");
0009     t.AddColumn("hits");
0010     t.AddColumn("clusters");
0011 
0012     for (auto cluster : *c) {
0013         std::ostringstream oss;
0014         for (auto hit : cluster.Hits()) {
0015             oss << hit.id() << " ";
0016         }
0017         std::ostringstream oss2;
0018         for (auto cluster : cluster.Clusters()) {
0019             oss2 << cluster.id() << " ";
0020         }
0021         t | cluster.id() | cluster.energy() | oss.str() | oss2.str();
0022     }
0023     return t;
0024 }
0025 
0026 
0027 JTablePrinter TabulateHits(const ExampleHitCollection* c) {
0028 
0029     JTablePrinter t;
0030     t.AddColumn("hitId");
0031     t.AddColumn("cellId");
0032     t.AddColumn("x");
0033     t.AddColumn("y");
0034     t.AddColumn("energy");
0035     t.AddColumn("time");
0036 
0037     for (auto hit : *c) {
0038         t | hit.id() | hit.cellID() | hit.x() | hit.y() | hit.energy() | hit.time();
0039     }
0040     return t;
0041 }