16 #include "art_root_io/TFileDirectory.h" 17 #include "art_root_io/TFileService.h" 68 int EID = evt.
event();
70 std::stringstream FolderName;
72 FolderName <<
"run" << Run <<
"_evt" << EID;
74 art::TFileDirectory evtfolder = tfs->mkdir(FolderName.str().c_str());
76 std::map<int, bool> ChanFolderMade;
77 std::map<uint32_t, int> ChanFolderIndex;
78 std::vector<art::TFileDirectory> ChanFolders;
80 for (
size_t i = 0; i != FIFOChannelHandle->size(); ++i) {
81 uint32_t Frame = FIFOChannelHandle->at(i).Frame();
82 uint32_t TimeSlice = FIFOChannelHandle->at(i).TimeSlice();
83 uint32_t Channel = FIFOChannelHandle->at(i).ChannelNumber();
85 if (!ChanFolderMade[Channel]) {
86 std::stringstream ChannelLabel;
88 ChannelLabel <<
"chan" << Channel;
89 ChanFolderIndex[Channel] = ChanFolders.size();
90 ChanFolders.push_back(evtfolder.mkdir(ChannelLabel.str().c_str()));
91 ChanFolderMade[Channel] =
true;
94 std::stringstream HistName;
96 HistName <<
"frm" << Frame <<
"_" 97 <<
"tsl" << TimeSlice;
99 TH1D* ThisHist = ChanFolders[ChanFolderIndex[Channel]].make<TH1D>(
100 HistName.str().c_str(),
101 HistName.str().c_str(),
102 FIFOChannelHandle->at(i).size(),
103 float(TimeSlice) - 0.0001,
104 float(FIFOChannelHandle->at(i).size()) - 0.0001 + TimeSlice);
106 for (
size_t j = 0; j != FIFOChannelHandle->at(i).size(); ++j) {
107 ThisHist->Fill(TimeSlice + j, FIFOChannelHandle->at(i).at(j));
void analyze(const art::Event &)
EDAnalyzer(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
EventNumber_t event() const
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
FIFOHistogramAna(const fhicl::ParameterSet &)