Jpp test-rotations-old-57-g407471f53
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 470 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 488 of file JSupernova.hh.

488 :
489 TMaxCluster_ns(TMax_ns)
490 {};

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

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

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

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

◆ fill()

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

Fill histogram with multiplicity spectrum resulting from given filter.

Definition at line 573 of file JSupernova.hh.

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

◆ getMultiplicities()

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

Definition at line 581 of file JSupernova.hh.

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

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

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

◆ operator<()

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

< operator

Definition at line 606 of file JSupernova.hh.

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

Member Data Documentation

◆ TMaxCluster_ns

double JSUPERNOVA::JTriggerSN::TMaxCluster_ns = 1000.0
private

Definition at line 474 of file JSupernova.hh.

◆ frameIndex

int JSUPERNOVA::JTriggerSN::frameIndex

Definition at line 480 of file JSupernova.hh.

◆ timeUTC

JDAQUTCExtended JSUPERNOVA::JTriggerSN::timeUTC

Definition at line 481 of file JSupernova.hh.


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