Jpp
JCluster.hh
Go to the documentation of this file.
1 #ifndef __JCLUSTER__
2 #define __JCLUSTER__
3 
4 #include<vector>
5 #include<algorithm>
6 #include<set>
7 #include<iterator>
8 
9 #include "JTrigger/JBuildL1.hh"
10 #include "JTrigger/JHitL0.hh"
11 #include "JTrigger/JHitL1.hh"
12 #include "JTrigger/JHitToolkit.hh"
14 #include "JDetector/JModule.hh"
16 
17 /**
18  * \author mjongen
19  */
20 
21 namespace JMONITOR {}
22 namespace JPP { using namespace JMONITOR; }
23 
24 namespace JMONITOR {
25  using namespace std ;
26  using JTRIGGER::JHitL1 ;
27 
28  /**
29  A JHitL1 with a multiplicity.
30 
31  The multiplicity is defined as the number of uniquely hit PMTs in the
32  cluster and is evaluated at construction.
33  **/
34  class JCluster : public JHitL1 {
35  public :
36 
37  /**
38  Constructor from a JHitL1
39  **/
40  JCluster( const JHitL1& hits ) : JHitL1(hits) {
41  setMultiplicity() ;
42  }
43 
44  /**
45  Returns the multiplicity evaluated at the last call to
46  setMultiplicity. Note that it is not evaluated on the fly
47  for efficiency reasons. The user has to make sure to call
48  setMultiplicity first if changes were made to the JHitL0s!
49  **/
50  unsigned int getMultiplicity() const { return m ; }
51 
52  /**
53  Set the multiplicity by looping over the JHitL0s.
54  **/
55  void setMultiplicity() {
56  set<unsigned int> unique_pmts ;
57  for( JHitL1::const_iterator it=begin(); it!=end(); ++it ) {
58  unique_pmts.insert(it->getPMTAddress()) ;
59  }
60  m = unique_pmts.size() ;
61  }
62 
63  protected :
64 
65  unsigned int m ;
66  } ;
67 
68 }
69 
70 #endif
JModule.hh
JSuperFrame2D.hh
JMONITOR::JCluster::JCluster
JCluster(const JHitL1 &hits)
Constructor from a JHitL1.
Definition: JCluster.hh:40
JMONITOR::JCluster
A JHitL1 with a multiplicity.
Definition: JCluster.hh:34
std::set
Definition: JSTDTypes.hh:13
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JBuildL1.hh
JHitToolkit.hh
JMONITOR::JCluster::m
unsigned int m
Definition: JCluster.hh:65
JMONITOR
Definition: JCluster.hh:21
JHitL1.hh
std
Definition: jaanetDictionary.h:36
JDAQSuperFrame.hh
JMONITOR::JCluster::getMultiplicity
unsigned int getMultiplicity() const
Returns the multiplicity evaluated at the last call to setMultiplicity.
Definition: JCluster.hh:50
JMONITOR::JCluster::setMultiplicity
void setMultiplicity()
Set the multiplicity by looping over the JHitL0s.
Definition: JCluster.hh:55
JHitL0.hh
JTRIGGER::JHitL1
Data structure for L1 hit.
Definition: JHitL1.hh:34