8 #ifndef FIFOHistogramAna_H 9 #define FIFOHistogramAna_H 1 32 #include "TLorentzVector.h" 69 #endif // FIFOHistogramAna_H 109 std::stringstream FolderName;
111 FolderName<<
"run"<<Run<<
"_evt"<<EID;
115 std::map<int, bool> ChanFolderMade;
116 std::map<uint32_t, int> ChanFolderIndex;
117 std::vector<art::TFileDirectory> ChanFolders;
120 for(
size_t i=0; i!=FIFOChannelHandle->size(); ++i)
122 uint32_t Frame = FIFOChannelHandle->at(i).Frame();
123 uint32_t TimeSlice = FIFOChannelHandle->at(i).TimeSlice();
124 uint32_t Channel = FIFOChannelHandle->at(i).ChannelNumber();
126 if(!ChanFolderMade[Channel])
128 std::stringstream ChannelLabel;
129 ChannelLabel.flush();
130 ChannelLabel<<
"chan"<<Channel;
131 ChanFolderIndex[Channel] = ChanFolders.size();
132 ChanFolders.push_back(evtfolder.
mkdir(ChannelLabel.str().c_str()));
133 ChanFolderMade[Channel] =
true;
136 std::stringstream HistName;
138 HistName<<
"frm"<<Frame<<
"_"<<
"tsl"<<TimeSlice;
141 TH1D * ThisHist = ChanFolders[ChanFolderIndex[Channel] ].make<TH1D>(HistName.str().c_str(),HistName.str().c_str(),FIFOChannelHandle->at(i).size(), float(TimeSlice)-0.0001, float(FIFOChannelHandle->at(i).size())-0.0001+TimeSlice);
143 for(
size_t j=0; j!=FIFOChannelHandle->at(i).size(); ++j)
145 ThisHist->Fill(TimeSlice + j, FIFOChannelHandle->at(i).at(j));
void analyze(const art::Event &)
TFileDirectory mkdir(std::string const &dir, std::string const &descr="")
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
EventNumber_t event() const
EDAnalyzer(Table< Config > const &config)
FIFOHistogramAna(const fhicl::ParameterSet &)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
virtual ~FIFOHistogramAna()
art framework interface to geometry description