#ifndef __JCLUSTER__ #define __JCLUSTER__ #include #include #include #include #include "JTrigger/JBuildL1.hh" #include "JTrigger/JHitL0.hh" #include "JTrigger/JHitL1.hh" #include "JTrigger/JHitToolkit.hh" #include "JTrigger/JSuperFrame2D.hh" #include "JDetector/JModule.hh" #include "km3net-dataformat/online/JDAQSuperFrame.hh" /** * \author mjongen */ namespace JMONITOR {} namespace JPP { using namespace JMONITOR; } namespace JMONITOR { using namespace std ; using JTRIGGER::JHitL1 ; /** A JHitL1 with a multiplicity. The multiplicity is defined as the number of uniquely hit PMTs in the cluster and is evaluated at construction. **/ class JCluster : public JHitL1 { public : /** Constructor from a JHitL1 **/ JCluster( const JHitL1& hits ) : JHitL1(hits) { setMultiplicity() ; } /** Returns the multiplicity evaluated at the last call to setMultiplicity. Note that it is not evaluated on the fly for efficiency reasons. The user has to make sure to call setMultiplicity first if changes were made to the JHitL0s! **/ unsigned int getMultiplicity() const { return m ; } /** Set the multiplicity by looping over the JHitL0s. **/ void setMultiplicity() { set unique_pmts ; for( JHitL1::const_iterator it=begin(); it!=end(); ++it ) { unique_pmts.insert(it->getPMTAddress()) ; } m = unique_pmts.size() ; } protected : unsigned int m ; } ; } #endif