Jpp 19.3.0-rc.5
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
void operator() (const JDataSN &in)
 Builds trigger by clustering pretrigger data.
 
JModuleSet getModules (JRange< int > A=JRange< int >(6, 10))
 Get triggered modules after track veto.
 
JModuleSet getModules (const JSNFilter &F)
 Get triggered modules according to given filter.
 
void fill (TH1D *out, const JSNFilter &F)
 Fill histogram with multiplicity spectrum resulting from given filter.
 
vector< double > getMultiplicities (const JSNFilter &F)
 
bool operator> (const JTriggerSN &rhs) const
 
bool operator< (const JTriggerSN &rhs) const
 < operator
 

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 471 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 489 of file JSupernova.hh.

489 :
490 TMaxCluster_ns(TMax_ns)
491 {};

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 503 of file JSupernova.hh.

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

◆ 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 534 of file JSupernova.hh.

534 {
535
536 JModuleSet triggeredModules;
537
538 JSNFilterM F(A, 1);
539
540 for (JTriggerSN::const_iterator p = this->begin(); p != this->end(); p++) {
541
542 if ( F(*p) ) {
543
544 // only clusters with one module pass the selection JSNFilterM(A, 1)
545 triggeredModules.insert((*p)[0].getModule());
546
547 }
548
549 }
550
551 return triggeredModules;
552
553 }
const JModule & getModule(const JType< JDetector_t > type, const int id, const JLocation &location=JLocation())
Get module according given detector type.
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 559 of file JSupernova.hh.

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

◆ fill()

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

Fill histogram with multiplicity spectrum resulting from given filter.

Definition at line 574 of file JSupernova.hh.

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

◆ getMultiplicities()

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

Definition at line 582 of file JSupernova.hh.

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

◆ 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 600 of file JSupernova.hh.

600 {
601 return (frameIndex > rhs.frameIndex);
602 }

◆ operator<()

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

< operator

Definition at line 607 of file JSupernova.hh.

607 {
608 return (frameIndex < rhs.frameIndex);
609 }

Member Data Documentation

◆ TMaxCluster_ns

double JSUPERNOVA::JTriggerSN::TMaxCluster_ns = 1000.0
private

Definition at line 475 of file JSupernova.hh.

◆ frameIndex

int JSUPERNOVA::JTriggerSN::frameIndex

Definition at line 481 of file JSupernova.hh.

◆ timeUTC

JDAQUTCExtended JSUPERNOVA::JTriggerSN::timeUTC

Definition at line 482 of file JSupernova.hh.


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