39 using namespace KM3NETDAQ;
40 using namespace JSUPERNOVA;
47 int main(
int argc,
char **argv)
53 JLimit_t& numberOfEvents = inputFile.getLimit();
60 int preTriggerThreshold;
68 JParser<> zap(
"Example program test supernova triggers.");
71 zap[
'o'] =
make_field(outputFile) =
"jsn.root";
72 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
76 zap[
'C'] =
make_field(selector) = getROOTClassSelection<JDAQTimesliceTypes_t>();
79 zap[
't'] =
make_field(preTriggerThreshold) = 4;
83 catch(
const exception &error) {
84 FATAL(error.what() << endl);
92 load(detectorFile, detector);
106 pts->configure(inputFile);
118 TH1D* h_vtr =
new TH1D(
"VetoTimeRange",
"VetoTimeRange", 10000, 0, 10000);
124 for (; evIn.hasNext(); ) {
126 STATUS(
"event: " << setw(10) << evIn.getCounter() <<
'\r');
DEBUG(endl);
132 triggeredEvents[
event->getFrameIndex()].push_back(vp);
138 STATUS(triggeredEvents.size() <<
" JDAQEvents loaded in veto buffer." << endl);
153 JManager_t SNTH(
new TH1D(
"SNT_F%", NULL, 100, 0.0, 100));
155 JManager_t MUL(
new TH1D(
"MUL_F%", NULL, 1 + 31, -0.5, 31 + 1 - 0.5));
157 const int nStages = 5;
164 for ( ; pts->hasNext() && counter != inputFile.getLimit(); ++counter) {
166 STATUS(
"timeslice: " << setw(10) << counter <<
'\r');
DEBUG(endl);
172 JDataSN preTrigger(TMax_ns, preTriggerThreshold);
174 preTrigger(timeslice, moduleRouter);
184 if (triggeredEvents.count(fIndex)) {
185 veto = triggeredEvents.at(fIndex);
194 int rawCount = count_if(preTrigger.begin(), preTrigger.end(), trgOp);
198 trgHistory[0].push_back(rawCount);
200 for (
int i = 0; i < 3; i++) {
201 trgHistory[i + 1].push_back(trgCount[i]);
204 trgHistory[4].push_back(trigger.
getModules().size());
212 for (
int i = 0; i < nStages; i++) {
213 for (
unsigned j = 0; j < trgHistory[i].size(); j++) {
214 SNTH[i]->Fill(trgHistory[i][j]);
218 if (outputFile !=
"") {
220 TFile out(outputFile.c_str(),
"RECREATE");
double getLength()
Get length of veto time range.
Utility class to parse command line options.
JModuleSet getModules(JRange< int > A=JRange< int >(6, 10))
Get triggered modules after track veto.
Auxiliary class to define a veto time window on a set of optical modules.
Auxiliary class to select ROOT class based on class name.
Router for direct addressing of module data in detector data structure.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
Long64_t counter_type
Type definition for counter.
Dynamic ROOT object management.
Auxiliary class for a type holder.
Template definition for direct access of elements in ROOT TChain.
Data structure for detector geometry and calibration.
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 to manage set of compatible ROOT objects (e.g.
Auxiliary class for defining the range of iterations of objects.
I/O formatting auxiliaries.
void setVeto(JVetoSet &vt)
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class to apply the supernova trigger to SN data.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
SN filter based on multiplicity selection optional suppression of multi-module coincidences.
General purpose messaging.
vector< int > benchmark(JRange< int > A=JRange< int >(6, 10))
Benchmark different trigger steps.
Auxiliary class to select JTreeScanner based on ROOT class name.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Auxiliary class to build the supernova trigger dataset.
Utility class to parse command line options.
ROOT TTree parameter settings.
#define DEBUG(A)
Message macros.
Auxiliary class to manage a set of vetoes.
int main(int argc, char *argv[])