1 #ifndef __JSUPERNOVA_JSUPERNOVA__ 
    2 #define __JSUPERNOVA_JSUPERNOVA__ 
   61     double mean_dir_ctheta = -2; 
 
   62     double mean_dir_norm = -1; 
 
   64     double total_ToT = -1; 
 
   68       this->multiplicity = 0;
 
   69       this->mean_dir_ctheta = -2;
 
   70       this->mean_dir_norm = -1;
 
   88     JCoincidenceSN(
double t, 
int m, 
int dom, 
int vetoIndex=-1, 
double ctheta=-2, 
double rnorm=-1, 
double deltaT=-1, 
double total_ToT=-1, 
double timeslice_time=-1)
 
   89       : time(t), timeslice_time(timeslice_time), moduleID(dom), vetoIndex(vetoIndex), multiplicity(m), mean_dir_ctheta(ctheta), mean_dir_norm(rnorm), deltaT(deltaT), total_ToT(total_ToT)
 
   99         if (hits.size() == 0) 
return 1;
 
  101         double first_hit_time = 0;
 
  103         this->multiplicity = 0;
 
  106         for(
auto &hit: hits){
 
  107             this->multiplicity++;
 
  108             this->total_ToT += hit.getToT();
 
  110               this->deltaT += hit.getT() - first_hit_time;
 
  112             else first_hit_time = hit.getT();
 
  113             int channel_id = hit.getPMT();
 
  116             mean_pmt_dir += pmt.getDirection();
 
  119         if (this->multiplicity >= 2) {
 
  120             this->mean_dir_norm = mean_pmt_dir.
getLength()/this->multiplicity;
 
  121             this->mean_dir_ctheta = mean_pmt_dir.
getZ()/this->multiplicity;
 
  122             this->deltaT /= (this->multiplicity-1);
 
  140       return (time < rhs.
time);
 
  172         moduleSet.insert(hit->getModuleID());
 
  192       return timeRange(in.
getTime()) && 
 
  193         (moduleSet.find(in.
getModule()) != moduleSet.end());
 
  203     : 
public vector<JCoincidenceSN> {
 
  219       : TMax_ns(window), min_M(threshold)     
 
  236           while (++q != in.end() && q->getT() - p->getT() <= TMax_ns ) {}
 
  242             if (det.size() > 0) {
 
  244               coincidence_hits.assign(p,q); 
 
  245               coincidence(coincidence_hits, det);
 
  247             this->push_back(coincidence);
 
  279       for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
 
  281         int moduleID = frame->getModuleID();
 
  283         JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame,
 
  289         JSuperFrame1D_t& 
data = JSuperFrame1D_t::multiplex(buffer);
 
  291         if (det.size() < 0)(*this)(
data, moduleID);
 
  292         else (*
this)(
data, moduleID, det);
 
  296       sort(this->begin(), this->end());
 
  342       return any_of(this->begin(), this->end(), 
JMatchVeto(in)); 
 
  360       JClusterSN::const_iterator p = this->begin();
 
  362       for (JClusterSN::const_iterator q = p + 1; q != this->end(); q++) {
 
  363         if (q->getMultiplicity() > p->getMultiplicity()) {
 
  380       for (JClusterSN::const_iterator p = this->begin(); p != this->end(); p++) {
 
  381         out.insert(p->getModule());
 
  426       bool out = (*this)(in.
getPeak());
 
  472     double TMaxCluster_ns = 1000.0; 
 
  487       TMaxCluster_ns(TMax_ns)
 
  509         cluster.push_back(*p);
 
  513         while(q != in.end() && (q->getTime() <= (p->getTime() + TMaxCluster_ns))) {
 
  514           cluster.push_back(*q);
 
  520         this->push_back(cluster);      
 
  537       for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
 
  542           triggeredModules.insert((*p)[0].getModule());
 
  548       return triggeredModules;
 
  560       for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
 
  562           out.insert(p->getPeak().getModule());
 
  572       for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {       
 
  574           out->Fill( p->getPeak().getMultiplicity() );
 
  582       for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {       
 
  584           out.push_back( p->getPeak().getMultiplicity() );
 
  642       os << 
"=== SUPERNOVA TRIGGER STATISTICS ==" << endl;
 
  643       os << 
"=> livetime [s] = " << 
livetime << endl;
 
  644       os << 
"Level" << 
'\t' << 
"Rate (error)" << endl;
 
  647         for (
unsigned i = 0; i < this->size(); i++) {
 
  649           double count = (*this)[i];
 
  651           double error = 100 * (sqrt(count) / count);
 
  655             os << scientific << setprecision(2) << rate << 
"Hz "; 
 
  656             os << fixed      << setprecision(0) << 
"(" << setw(2) << error << 
"%)";
 
  679         for (
unsigned i = 0; i < this->size(); i++) {
 
  681           double count = (*this)[i];
 
  683           double error = (sqrt(count) / count);
 
  688             os << setprecision(2);
 
Direct access to PMT data in detector data structure for DAQ hits.
 
Data structure for detector geometry and calibration.
 
Basic data structure for L0 hit.
 
Match operator for consecutive hits.
 
Direct access to module in detector data structure.
 
Auxiliaries for pre-processing of hits.
 
Auxiliary class to define a range between two values.
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
 
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
 
const JPMT & getPMT(const JDAQKeyHit &hit) const
Get PMT parameters.
 
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT parameters.
 
Router for direct addressing of module data in detector data structure.
 
const JModule & getModule(const JObjectID &id) const
Get module parameters.
 
Address of PMT in detector data structure.
 
const JDirection3D & getDirection() const
Get direction.
 
Data structure for vector in three dimensions.
 
double getLength() const
Get length.
 
double getZ() const
Get z position.
 
Auxiliary class to manage a cluster of coincidences.
 
JCoincidenceSN getPeak() const
Finds coincidence with maximum multiplicity.
 
JModuleSet getModules() const
 
Auxiliary class to store reduced information of a coincidence on an optical module This class allows ...
 
int getMultiplicity() const
 
JCoincidenceSN(double t, int m, int dom, int vetoIndex=-1, double ctheta=-2, double rnorm=-1, double deltaT=-1, double total_ToT=-1, double timeslice_time=-1)
Constructor:
 
bool operator()(const vector< JHitR0 > &hits, const JDetector &det)
Compute single-DOM observables |R|, cos(theta), total ToT, and Delta(t) and set the corresponding cla...
 
bool operator<(const JCoincidenceSN &rhs) const
 
Auxiliary class to build the supernova trigger dataset.
 
JDataSN(double window, int threshold=4)
Default constructor Configures the trigger with a time window and the pretrigger threshold.
 
Auxiliary class-operator to match a JVeto with a JCoincidenceSN object Provides an operator to test i...
 
JMatchVeto(const JCoincidenceSN &in)
Default constructor.
 
SN filter based on veto window.
 
JSNFilterMV(JRange< int > &R, JVetoSet &S)
 
SN filter based on multiplicity selection optional suppression of multi-module coincidences WARNING: ...
 
JSNFilterM(JRange< int > R, int m=0)
 
Interface for SN filter operator.
 
SN trigger statistics, the information is stored in the form of a count as a function of the trigger ...
 
string toString()
put statistics into printable form outputs trigger level - rate - error
 
void setLiveTime(const double lt)
 
JTriggerSNStats(const int nModules)
default constructor
 
string toSummaryFile()
put statistics into printable form outputs trigger level - rate - error
 
Auxiliary class to apply the supernova trigger to SN data.
 
void fill(TH1D *out, const JSNFilter &F)
Fill histogram with multiplicity spectrum resulting from given filter.
 
JTriggerSN(double TMax_ns)
Default constructor.
 
JModuleSet getModules(const JSNFilter &F)
Get triggered modules according to given filter.
 
JModuleSet getModules(JRange< int > A=JRange< int >(6, 10))
Get triggered modules after track veto.
 
vector< double > getMultiplicities(const JSNFilter &F)
 
bool operator<(const JTriggerSN &rhs) const
< operator
 
bool operator>(const JTriggerSN &rhs) const
operator used by (reverse) std:priority_queue, in absence of this operator the container will behave ...
 
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.
 
JVeto(const JDAQEvent &event, const JDAQHitRouter &hitRouter)
Default constructor.
 
Reduced data structure for L0 hit.
 
1-dimensional frame with time calibrated data from one optical module.
 
2-dimensional frame with time calibrated data from one optical module.
 
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
 
int getFrameIndex() const
Get frame index.
 
const_iterator< T > end() const
Get end of data.
 
const_iterator< T > begin() const
Get begin of data.
 
Data structure for UTC time.
 
double getTime(const Hit &hit)
Get true time of hit.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
vector< double > multiplicities_t
 
KM3NeT DAQ data structures and auxiliaries.
 
Normalisation of MUPAGE events.
 
Default class to select DAQ hits.
 
Auxiliary class to select DAQ hits.
 
@ join_t
join consecutive hits according match criterion