Jpp  master_rocky
the software that should make you happy
Public Member Functions | Public Attributes | Private Attributes | List of all members
JSUPERNOVA::JTriggerSN Class Reference

Auxiliary class to apply the supernova trigger to SN data. More...

#include <JSupernova.hh>

Inheritance diagram for JSUPERNOVA::JTriggerSN:
std::vector< JClusterSN >

Public Member Functions

 JTriggerSN (double TMax_ns)
 Default constructor. More...
 
void operator() (const JDataSN &in)
 Builds trigger by clustering pretrigger data. More...
 
JModuleSet getModules (JRange< int > A=JRange< int >(6, 10))
 Get triggered modules after track veto. More...
 
JModuleSet getModules (const JSNFilter &F)
 Get triggered modules according to given filter. More...
 
void fill (TH1D *out, const JSNFilter &F)
 Fill histogram with multiplicity spectrum resulting from given filter. More...
 
vector< double > getMultiplicities (const JSNFilter &F)
 
bool operator> (const JTriggerSN &rhs) const
 

operator

used by (reverse) std:priority_queue, in absence of this operator the container will behave unpredictably More...

 
bool operator< (const JTriggerSN &rhs) const
 < operator More...
 

Public Attributes

int frameIndex
 
JDAQUTCExtended timeUTC
 

Private Attributes

double TMaxCluster_ns = 1000.0
 

Detailed Description

Auxiliary class to apply the supernova trigger to SN data.

Definition at line 468 of file JSupernova.hh.

Constructor & Destructor Documentation

◆ JTriggerSN()

JSUPERNOVA::JTriggerSN::JTriggerSN ( double  TMax_ns)
inline

Default constructor.

Parameters
TMax_nstime width for coincidence clustering (track / afterpulse)

Definition at line 486 of file JSupernova.hh.

486  :
487  TMaxCluster_ns(TMax_ns)
488  {};

Member Function Documentation

◆ operator()()

void JSUPERNOVA::JTriggerSN::operator() ( const JDataSN in)
inline

Builds trigger by clustering pretrigger data.

Parameters
inpretrigger SN data

Definition at line 500 of file JSupernova.hh.

500  {
501 
502  frameIndex = in.frameIndex;
503  timeUTC = in.timeUTC;
504 
505  for (vector<JCoincidenceSN>::const_iterator p = in.begin(); p != in.end(); ) {
506 
507  JClusterSN cluster;
508 
509  cluster.push_back(*p);
510 
512 
513  while(q != in.end() && (q->getTime() <= (p->getTime() + TMaxCluster_ns))) {
514  cluster.push_back(*q);
515  ++q;
516  }
517 
518  p = q;
519 
520  this->push_back(cluster);
521 
522  }
523  }
JDAQUTCExtended timeUTC
Definition: JSupernova.hh:479

◆ getModules() [1/2]

JModuleSet JSUPERNOVA::JTriggerSN::getModules ( JRange< int >  A = JRange<int>(6,10))
inline

Get triggered modules after track veto.

Returns
std::set containing triggered modules IDs

Definition at line 531 of file JSupernova.hh.

531  {
532 
533  JModuleSet triggeredModules;
534 
535  JSNFilterM F(A, 1);
536 
537  for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
538 
539  if ( F(*p) ) {
540 
541  // only clusters with one module pass the selection JSNFilterM(A, 1)
542  triggeredModules.insert((*p)[0].getModule());
543 
544  }
545 
546  }
547 
548  return triggeredModules;
549 
550  }
set< int > JModuleSet
Definition: JSupernova.hh:45

◆ getModules() [2/2]

JModuleSet JSUPERNOVA::JTriggerSN::getModules ( const JSNFilter F)
inline

Get triggered modules according to given filter.

Definition at line 556 of file JSupernova.hh.

556  {
557 
558  JModuleSet out;
559 
560  for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
561  if ( F(*p) ) {
562  out.insert(p->getPeak().getModule());
563  }
564  }
565  return out;
566  }

◆ fill()

void JSUPERNOVA::JTriggerSN::fill ( TH1D *  out,
const JSNFilter F 
)
inline

Fill histogram with multiplicity spectrum resulting from given filter.

Definition at line 571 of file JSupernova.hh.

571  {
572  for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
573  if (F(*p)) {
574  out->Fill( p->getPeak().getMultiplicity() );
575  }
576  }
577  }

◆ getMultiplicities()

vector<double> JSUPERNOVA::JTriggerSN::getMultiplicities ( const JSNFilter F)
inline

Definition at line 579 of file JSupernova.hh.

579  {
580  vector<double> out;
581 
582  for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
583  if (F(*p)) {
584  out.push_back( p->getPeak().getMultiplicity() );
585  }
586  }
587  return out;
588  }

◆ operator>()

bool JSUPERNOVA::JTriggerSN::operator> ( const JTriggerSN rhs) const
inline

operator

used by (reverse) std:priority_queue, in absence of this operator the container will behave unpredictably

Definition at line 597 of file JSupernova.hh.

597  {
598  return (frameIndex > rhs.frameIndex);
599  }

◆ operator<()

bool JSUPERNOVA::JTriggerSN::operator< ( const JTriggerSN rhs) const
inline

< operator

Definition at line 604 of file JSupernova.hh.

604  {
605  return (frameIndex < rhs.frameIndex);
606  }

Member Data Documentation

◆ TMaxCluster_ns

double JSUPERNOVA::JTriggerSN::TMaxCluster_ns = 1000.0
private

Definition at line 472 of file JSupernova.hh.

◆ frameIndex

int JSUPERNOVA::JTriggerSN::frameIndex

Definition at line 478 of file JSupernova.hh.

◆ timeUTC

JDAQUTCExtended JSUPERNOVA::JTriggerSN::timeUTC

Definition at line 479 of file JSupernova.hh.


The documentation for this class was generated from the following file: