1 #ifndef __JSUPERNOVA_JSUPERNOVA__
2 #define __JSUPERNOVA_JSUPERNOVA__
34 namespace JSUPERNOVA {
38 using namespace KM3NETDAQ;
56 : time(t), multiplicity(m), moduleID(dom)
72 return (time < rhs.
time);
101 hit != event.
end<hit_type>();
104 moduleSet.insert(hit->getModuleID());
116 return timeRange.getLength();
124 return timeRange(in.
getTime()) &&
125 (moduleSet.find(in.
getModule()) != moduleSet.end());
135 :
public vector<JCoincidenceSN> {
151 : TMax_ns(window), min_M(threshold)
167 while (++q != in.end() && q->getT() - p->getT() <= TMax_ns ) {}
203 for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
205 int moduleID = frame->getModuleID();
207 JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame,
213 JSuperFrame1D_t&
data = JSuperFrame1D_t::multiplex(buffer);
215 (*this)(
data, moduleID);
219 sort(this->begin(), this->end());
265 return any_of(this->begin(), this->end(),
JMatchVeto(in));
283 JClusterSN::const_iterator p = this->begin();
285 for (JClusterSN::const_iterator q = p + 1; q != this->end(); q++) {
286 if (q->getMultiplicity() > p->getMultiplicity()) {
303 for (JClusterSN::const_iterator p = this->begin(); p != this->end(); p++) {
304 out.insert(p->getModule());
320 virtual bool operator() (
const JClusterSN& in)
const = 0;
349 bool out = (*this)(in.
getPeak());
395 double TMaxCluster_ns = 1000.0;
410 TMaxCluster_ns(TMax_ns)
432 cluster.push_back(*p);
436 while(q != in.end() && (q->getTime() <= (p->getTime() + TMaxCluster_ns))) {
437 cluster.push_back(*q);
443 this->push_back(cluster);
460 for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
465 triggeredModules.insert((*p)[0].
getModule());
471 return triggeredModules;
483 for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
485 out.insert(p->getPeak().getModule());
495 for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
497 out->Fill( p->getPeak().getMultiplicity() );
505 for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
507 out.push_back( p->getPeak().getMultiplicity() );
565 os <<
"=== SUPERNOVA TRIGGER STATISTICS ==" << endl;
566 os <<
"=> livetime [s] = " <<
livetime << endl;
567 os <<
"Level" <<
'\t' <<
"Rate (error)" << endl;
570 for (
unsigned i = 0;
i < this->size();
i++) {
572 double count = (*this)[
i];
574 double error = 100 * (sqrt(count) / count);
578 os << scientific << setprecision(2) << rate <<
"Hz ";
579 os << fixed << setprecision(0) <<
"(" << setw(2) << error <<
"%)";
602 for (
unsigned i = 0;
i < this->size();
i++) {
604 double count = (*this)[
i];
606 double error = (sqrt(count) / count);
611 os << setprecision(2);
double getLength()
Get length of veto time range.
JTriggerSNStats(const int nModules)
default constructor
Interface for SN filter operator.
Auxiliary class to store reduced information of a coincidence on an optical module.
bool operator>(const JTriggerSN &rhs) const
operatorused by (reverse) std:priority_queue, in absence of this operator the container will behave u...
Auxiliaries for pre-processing of hits.
Direct access to PMT data in detector data structure for DAQ hits.
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
JModuleSet getModules() const
Basic data structure for L0 hit.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
JModuleSet getModules(JRange< int > A=JRange< int >(6, 10))
Get triggered modules after track veto.
JMatchVeto(const JCoincidenceSN &in)
Default constructor.
Auxiliary class to define a veto time window on a set of optical modules.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
SN filter based on veto window.
Router for direct addressing of module data in detector data structure.
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
bool operator<(const JCoincidenceSN &rhs) const
int getMultiplicity() const
JTriggerSN(double TMax_ns)
Default constructor.
double getTime(const Hit &hit)
Get true time of hit.
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
Data structure for UTC time.
Default class to select DAQ hits.
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
int getFrameIndex() const
Get frame index.
1-dimensional frame with time calibrated data from one optical module.
string toSummaryFile()
put statistics into printable form outputs trigger level - rate - error
JCoincidenceSN getPeak() const
Finds coincidence with maximum multiplicity.
const_iterator< T > end() const
Get end of data.
join consecutive hits according match criterion
Reduced data structure for L0 hit.
void fill(TH1D *out, const JSNFilter &F)
Fill histogram with multiplicity spectrum resulting from given filter.
const_iterator< T > begin() const
Get begin of data.
string toString()
put statistics into printable form outputs trigger level - rate - error
SN trigger statistics, the information is stored in the form of a count as a function of the trigger ...
JCoincidenceSN(double t, int m, int dom)
JVeto(const JDAQEvent &event, const JDAQHitRouter &hitRouter)
Default constructor.
vector< double > multiplicities_t
Auxiliary class to apply the supernova trigger to SN data.
SN filter based on multiplicity selection optional suppression of multi-module coincidences WARNING: ...
Match operator for consecutive hits.
bool operator<(const JTriggerSN &rhs) const
< operator
Direct access to module in detector data structure.
then JCookie sh JDataQuality D $DETECTOR_ID R
Auxiliary class to build the supernova trigger dataset.
JModuleSet getModules(const JSNFilter &F)
Get triggered modules according to given filter.
Normalisation of MUPAGE events.
Auxiliary class to define a range between two values.
JSNFilterMV(JRange< int > &R, JVetoSet &S)
Auxiliary class to manage a cluster of coincidences.
Auxiliary class-operator to match a JVeto with a JCoincidenceSN object Provides an operator to test i...
2-dimensional frame with time calibrated data from one optical module.
Auxiliary class to select DAQ hits.
void setLiveTime(const double lt)
JDataSN(double window, int threshold=4)
Default constructor Configures the trigger with a time window and the pretrigger threshold.
const JPMT & getPMT(const JDAQKeyHit &hit) const
Get PMT parameters.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
JSNFilterM(JRange< int > R, int m=0)
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
vector< double > getMultiplicities(const JSNFilter &F)
Auxiliary class to manage a set of vetoes.