50 int main(
int argc,
char **argv)
56 JLimit_t& numberOfEvents = inputFile.getLimit();
64 int preTriggerThreshold;
72 JParser<> zap(
"Example program test supernova triggers.");
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);
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);
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);
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);
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");
Data structure for detector geometry and calibration.
int main(int argc, char **argv)
Dynamic ROOT object management.
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
ROOT TTree parameter settings of various packages.
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
Router for direct addressing of module data in detector data structure.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
Auxiliary class to build the supernova trigger dataset.
SN filter based on veto window.
SN filter based on multiplicity selection optional suppression of multi-module coincidences WARNING: ...
Auxiliary class to apply the supernova trigger to SN data.
Auxiliary class to manage a set of vetoes.
Auxiliary class to define a veto time window on a set of optical modules.
double getLength()
Get length of veto time range.
Auxiliary interface for direct access of elements in ROOT TChain.
Template definition for direct access of elements in ROOT TChain.
int getFrameIndex() const
Get frame index.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
Long64_t counter_type
Type definition for counter.
KM3NeT DAQ data structures and auxiliaries.
Type definition of range.
Auxiliary class for a type holder.
Auxiliary class to select ROOT class based on class name.
Auxiliary class to select JTreeScanner based on ROOT class name.
Auxiliary class for defining the range of iterations of objects.
Auxiliary class to select DAQ hits based on time-over-treshold value.