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);
96 load(detectorFile, detector);
110 pts->configure(inputFile);
122 TH1D* h_vtr =
new TH1D(
"VetoTimeRange",
"VetoTimeRange", 10000, 0, 10000);
128 for (; evIn.hasNext(); ) {
130 STATUS(
"event: " << setw(10) << evIn.getCounter() <<
'\r');
DEBUG(endl);
134 JVeto vp(*event, hitRouter);
136 triggeredEvents[
event->getFrameIndex()].push_back(vp);
138 h_vtr->Fill(vp.getLength());
142 STATUS(triggeredEvents.size() <<
" JDAQEvents loaded in veto buffer." << endl);
157 JManager_t SNT(
new TH1D(
"SNT_F%", NULL, 100, 0.0, 100));
159 JManager_t MUL(
new TH1D(
"MUL_F%", NULL, 1 + 31, -0.5, 31 + 1 - 0.5));
161 const int nStages = 5;
168 for ( ; pts->hasNext() && counter != inputFile.getLimit(); ++counter) {
170 STATUS(
"timeslice: " << setw(10) << counter <<
'\r');
DEBUG(endl);
176 JDataSN preTrigger(TMax_ns, preTriggerThreshold);
178 preTrigger(timeslice, moduleRouter, totSelector_ns);
188 if (triggeredEvents.count(fIndex)) {
189 veto = triggeredEvents.at(fIndex);
204 int rawCount = count_if(preTrigger.begin(), preTrigger.end(), trgF0);
206 int trgCountF0 = count_if(trigger.begin(), trigger.end(), trgF0);
207 int trgCountF1 = count_if(trigger.begin(), trigger.end(), trgF1);
208 int trgCountFV = count_if(trigger.begin(), trigger.end(), trgFV);
209 int domCountF1 = trigger.getModules(trgF1).size();
211 trgHistory[0].push_back(rawCount);
212 trgHistory[1].push_back(trgCountF0);
213 trgHistory[2].push_back(trgCountF1);
214 trgHistory[3].push_back(trgCountFV);
215 trgHistory[4].push_back(domCountF1);
217 trigger.fill(MUL[1], trgF0);
218 trigger.fill(MUL[2], trgF1);
219 trigger.fill(MUL[3], trgFV);
220 trigger.fill(MUL[4], trgAV);
228 for (
int i = 0;
i < nStages;
i++) {
229 for (
unsigned j = 0;
j < trgHistory[
i].size();
j++) {
230 SNT[
i]->Fill(trgHistory[
i][
j]);
234 SNT[0]->SetTitle(
"M[6,10] count before clustering");
235 SNT[1]->SetTitle(
"M[6,10] count after clustering");
236 SNT[2]->SetTitle(
"M[6,10] count after track self-veto");
237 SNT[3]->SetTitle(
"M[6,10] count after track trigger-veto");
238 SNT[4]->SetTitle(
"M[6,10] count after track self-veto, unique modules");
241 if (outputFile !=
"") {
243 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.
Type definition of range.
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: ...
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
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 &dev null eval JShellParser o a A
JTriggerCounter_t next()
Increment trigger counter.
#define DEBUG(A)
Message macros.
Auxiliary class to manage a set of vetoes.