56 JLimit_t& numberOfEvents = inputFile.getLimit();
64 int preTriggerThreshold;
72 JParser<> zap(
"Example program test supernova triggers.");
75 zap[
'o'] =
make_field(outputFile) =
"kexing.root";
76 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
80 zap[
'C'] =
make_field(selector) = getROOTClassSelection<JDAQTimesliceTypes_t>();
83 zap[
't'] =
make_field(preTriggerThreshold) = 4;
88 catch(
const exception &error) {
89 FATAL(error.what() << endl);
97 load(detectorFile, detector);
111 pts->configure(inputFile);
123 TH1D* h_vtr =
new TH1D(
"VetoTimeRange",
"VetoTimeRange", 10000, 0, 10000);
129 for (; evIn.hasNext(); ) {
131 STATUS(
"event: " << setw(10) << evIn.getCounter() <<
'\r');
DEBUG(endl);
135 JVeto vp(*event, hitRouter);
137 triggeredEvents[
event->getFrameIndex()].push_back(vp);
139 h_vtr->Fill(vp.getLength());
143 STATUS(triggeredEvents.size() <<
" JDAQEvents loaded in veto buffer." << endl);
158 JManager_t SNT(
new TH1D(
"SNT_F%", NULL, 100, 0.0, 100));
160 JManager_t MUL(
new TH1D(
"MUL_F%", NULL, 1 + 31, -0.5, 31 + 1 - 0.5));
162 const int nStages = 5;
169 for ( ; pts->hasNext() && counter != inputFile.getLimit(); ++counter) {
171 STATUS(
"timeslice: " << setw(10) << counter <<
'\r');
DEBUG(endl);
177 JDataSN preTrigger(TMax_ns, preTriggerThreshold);
179 preTrigger(timeslice, moduleRouter, totSelector_ns);
189 if (triggeredEvents.count(fIndex)) {
190 veto = triggeredEvents.at(fIndex);
205 int rawCount = count_if(preTrigger.begin(), preTrigger.end(), trgF0);
207 int trgCountF0 = count_if(trigger.begin(), trigger.end(), trgF0);
208 int trgCountF1 = count_if(trigger.begin(), trigger.end(), trgF1);
209 int trgCountFV = count_if(trigger.begin(), trigger.end(), trgFV);
210 int domCountF1 = trigger.getModules(trgF1).size();
212 trgHistory[0].push_back(rawCount);
213 trgHistory[1].push_back(trgCountF0);
214 trgHistory[2].push_back(trgCountF1);
215 trgHistory[3].push_back(trgCountFV);
216 trgHistory[4].push_back(domCountF1);
218 trigger.fill(MUL[1], trgF0);
219 trigger.fill(MUL[2], trgF1);
220 trigger.fill(MUL[3], trgFV);
221 trigger.fill(MUL[4], trgAV);
229 for (
int i = 0; i < nStages; i++) {
230 for (
unsigned j = 0;
j < trgHistory[i].size();
j++) {
231 SNT[i]->Fill(trgHistory[i][
j]);
235 SNT[0]->SetTitle(
"M[6,10] count before clustering");
236 SNT[1]->SetTitle(
"M[6,10] count after clustering");
237 SNT[2]->SetTitle(
"M[6,10] count after track self-veto");
238 SNT[3]->SetTitle(
"M[6,10] count after track trigger-veto");
239 SNT[4]->SetTitle(
"M[6,10] count after track self-veto, unique modules");
242 if (outputFile !=
"") {
244 TFile out(outputFile.c_str(),
"RECREATE");
Utility class to parse command line options.
Auxiliary class to define a veto time window on a set of optical modules.
Auxiliary class to select ROOT class based on class name.
SN filter based on veto window.
Router for direct addressing of module data in detector data structure.
Long64_t counter_type
Type definition for counter.
Auxiliary class for a type holder.
Template definition for direct access of elements in ROOT TChain.
Auxiliary interface for direct access of elements in ROOT TChain.
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
int getFrameIndex() const
Get frame index.
Auxiliary class for defining the range of iterations of objects.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class to apply the supernova trigger to SN data.
SN filter based on multiplicity selection optional suppression of multi-module coincidences WARNING: ...
Auxiliary class to select JTreeScanner based on ROOT class name.
Auxiliary class to build the supernova trigger dataset.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Auxiliary class to select DAQ hits based on time-over-treshold value.
do set_variable DETECTOR_TXT $WORKDIR detector
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
JTriggerCounter_t next()
Increment trigger counter.
#define DEBUG(A)
Message macros.
Auxiliary class to manage a set of vetoes.
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.