File indexing completed on 2025-01-18 10:01:38
0001
0002 #include <JANA/JEventSourceGenerator.h>
0003 #include "MyFileReader.h"
0004
0005
0006 class MyFileReaderGenerator : public JEventSourceGenerator {
0007
0008 JEventSource* MakeJEventSource(std::string resource_name) override {
0009
0010 auto source = new MyFileReader;
0011 source->SetResourceName(resource_name);
0012
0013
0014
0015
0016 if (resource_name.find("timeslices") != std::string::npos) {
0017 source->SetLevel(JEventLevel::Timeslice);
0018 }
0019 else {
0020 source->SetLevel(JEventLevel::PhysicsEvent);
0021 }
0022 return source;
0023 }
0024
0025 double CheckOpenable(std::string resource_name) override {
0026
0027
0028 if (resource_name.find(".root") != std::string::npos) {
0029 return 0.01;
0030 }
0031 else {
0032 return 0;
0033 }
0034 }
0035 };
0036
0037