Jpp
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
JMONITOR::JCluster Class Reference

A JHitL1 with a multiplicity. More...

#include <JCluster.hh>

Inheritance diagram for JMONITOR::JCluster:
JTRIGGER::JHitL1 KM3NETDAQ::JDAQModuleIdentifier std::vector< JHitL0 >

Public Member Functions

 JCluster (const JHitL1 &hits)
 Constructor from a JHitL1. More...
 
unsigned int getMultiplicity () const
 Returns the multiplicity evaluated at the last call to setMultiplicity. More...
 
void setMultiplicity ()
 Set the multiplicity by looping over the JHitL0s. More...
 
const JHitL1sort ()
 Sort L0 hits. More...
 
 operator const JPosition3D & () const
 Type conversion operator. More...
 
 operator const JAxis3D & () const
 Type conversion operator. More...
 
const JPosition3DgetPosition () const
 Get position. More...
 
double getX () const
 Get x position. More...
 
double getY () const
 Get y position. More...
 
double getZ () const
 Get z position. More...
 
double getT (const unsigned int i) const
 Get time of hit i. More...
 
double getT () const
 Get time. More...
 
double getToT () const
 Get overall time over threshold. More...
 
double getW () const
 Get weight. More...
 
JHitL1add (const JVector3D &pos)
 Add position. More...
 
JHitL1sub (const JVector3D &pos)
 Subtract position. More...
 
JHitL1rotate (const JRotation3D &R)
 Rotate hit. More...
 
JHitL1rotate_back (const JRotation3D &R)
 Rotate back hit. More...
 
void transform (const JRotation3D &R, const JVector3D &pos)
 Transform hit. More...
 
void transform_back (const JRotation3D &R, const JVector3D &pos)
 Transform back hit. More...
 
const JDAQModuleIdentifiergetModuleIdentifier () const
 Get Module identifier. More...
 
void setModuleIdentifier (const JDAQModuleIdentifier &module)
 Set Module identifier. More...
 
int getModuleID () const
 Get module identifier. More...
 
 ClassDefNV (JDAQModuleIdentifier, 1)
 

Static Public Member Functions

static int sizeOf ()
 Get size of object. More...
 

Protected Attributes

unsigned int m
 
int id
 

Detailed Description

A JHitL1 with a multiplicity.

The multiplicity is defined as the number of uniquely hit PMTs in the cluster and is evaluated at construction.

Definition at line 34 of file JCluster.hh.

Constructor & Destructor Documentation

◆ JCluster()

JMONITOR::JCluster::JCluster ( const JHitL1 hits)
inline

Constructor from a JHitL1.

Definition at line 40 of file JCluster.hh.

40  : JHitL1(hits) {
41  setMultiplicity() ;
42  }

Member Function Documentation

◆ getMultiplicity()

unsigned int JMONITOR::JCluster::getMultiplicity ( ) const
inline

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!

Definition at line 50 of file JCluster.hh.

50 { return m ; }

◆ setMultiplicity()

void JMONITOR::JCluster::setMultiplicity ( )
inline

Set the multiplicity by looping over the JHitL0s.

Definition at line 55 of file JCluster.hh.

55  {
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  }

◆ sort()

const JHitL1& JTRIGGER::JHitL1::sort ( )
inlineinherited

Sort L0 hits.

Following the default sort operation, the time slewing implemented in method getT() is applicaple.

Returns
this hit

Definition at line 97 of file JHitL1.hh.

98  {
99  std::sort(this->begin(), this->end(), std::less<JHit>());
100 
101  return *this;
102  }

◆ operator const JPosition3D &()

JTRIGGER::JHitL1::operator const JPosition3D & ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 110 of file JHitL1.hh.

111  {
112  return *(this->begin());
113  }

◆ operator const JAxis3D &()

JTRIGGER::JHitL1::operator const JAxis3D & ( ) const
inlineinherited

Type conversion operator.

Returns
axis

Definition at line 121 of file JHitL1.hh.

122  {
123  return *(this->begin());
124  }

◆ getPosition()

const JPosition3D& JTRIGGER::JHitL1::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 132 of file JHitL1.hh.

133  {
134  return this->begin()->getPosition();
135  }

◆ getX()

double JTRIGGER::JHitL1::getX ( ) const
inlineinherited

Get x position.

The x position is taken from the first L0 hit.

Returns
x position [m]

Definition at line 144 of file JHitL1.hh.

145  {
146  return this->begin()->getX();
147  }

◆ getY()

double JTRIGGER::JHitL1::getY ( ) const
inlineinherited

Get y position.

The y position is taken from the first L0 hit.

Returns
y position [m]

Definition at line 156 of file JHitL1.hh.

157  {
158  return this->begin()->getY();
159  }

◆ getZ()

double JTRIGGER::JHitL1::getZ ( ) const
inlineinherited

Get z position.

The z position is taken from the first L0 hit.

Returns
z position [m]

Definition at line 168 of file JHitL1.hh.

169  {
170  return this->begin()->getZ();
171  }

◆ getT() [1/2]

double JTRIGGER::JHitL1::getT ( const unsigned int  i) const
inlineinherited

Get time of hit i.

Note that the time is corrected for the average time slewing.

Parameters
iindex
Returns
time [ns]

Definition at line 181 of file JHitL1.hh.

182  {
183  static const double t0 = 1.29; // [ns]
184 
185  return at(i).getT() - t0;
186  }

◆ getT() [2/2]

double JTRIGGER::JHitL1::getT ( ) const
inlineinherited

Get time.

The time is taken from the first L0 hit corrected for time slewing.

Returns
time [ns]

Definition at line 195 of file JHitL1.hh.

196  {
197  static std::vector<double> t0;
198 
199  if (t0.empty()) {
200 
201  t0.push_back(+0.00);
202  t0.push_back(+0.39);
203  t0.push_back(+0.21);
204  t0.push_back(-0.59);
205  t0.push_back(-1.15);
206  t0.push_back(-1.59);
207  t0.push_back(-1.97);
208  t0.push_back(-2.30);
209  t0.push_back(-2.56);
210  t0.push_back(-2.89);
211  t0.push_back(-3.12);
212  t0.push_back(-3.24);
213  t0.push_back(-3.56);
214  t0.push_back(-3.69);
215  t0.push_back(-4.00);
216  t0.push_back(-4.10);
217  t0.push_back(-4.16);
218  t0.push_back(-4.49);
219  t0.push_back(-4.71);
220  t0.push_back(-4.77);
221  t0.push_back(-4.81);
222  t0.push_back(-4.87);
223  t0.push_back(-4.88);
224  t0.push_back(-4.83);
225  t0.push_back(-5.21);
226  t0.push_back(-5.06);
227  t0.push_back(-5.27);
228  t0.push_back(-5.18);
229  t0.push_back(-5.24);
230  t0.push_back(-5.79);
231  t0.push_back(-6.78);
232  t0.push_back(-6.24);
233  }
234 
235  if (this->size() >= t0.size())
236  return this->begin()->getT() - t0.back();
237  else
238  return this->begin()->getT() - t0[this->size()];
239  }

◆ getToT()

double JTRIGGER::JHitL1::getToT ( ) const
inlineinherited

Get overall time over threshold.

Returns
time over threshold [ns]

Definition at line 247 of file JHitL1.hh.

248  {
249  return JHit(this->begin(), this->end()).getToT();
250  }

◆ getW()

double JTRIGGER::JHitL1::getW ( ) const
inlineinherited

Get weight.

The weight is equal to the number of L0 hits.

Returns
weight

Definition at line 259 of file JHitL1.hh.

260  {
261  return this->size();
262  }

◆ add()

JHitL1& JTRIGGER::JHitL1::add ( const JVector3D pos)
inlineinherited

Add position.

Parameters
posposition
Returns
this hit

Definition at line 271 of file JHitL1.hh.

272  {
273  for (iterator i = this->begin(); i != this->end(); ++i) {
274  i->add(pos);
275  }
276 
277  return *this;
278  }

◆ sub()

JHitL1& JTRIGGER::JHitL1::sub ( const JVector3D pos)
inlineinherited

Subtract position.

Parameters
posposition
Returns
this hit

Definition at line 287 of file JHitL1.hh.

288  {
289  for (iterator i = this->begin(); i != this->end(); ++i) {
290  i->sub(pos);
291  }
292 
293  return *this;
294  }

◆ rotate()

JHitL1& JTRIGGER::JHitL1::rotate ( const JRotation3D R)
inlineinherited

Rotate hit.

Parameters
Rrotation matrix
Returns
this hit

Definition at line 303 of file JHitL1.hh.

304  {
305  for (iterator i = this->begin(); i != this->end(); ++i) {
306  i->rotate(R);
307  }
308 
309  return *this;
310  }

◆ rotate_back()

JHitL1& JTRIGGER::JHitL1::rotate_back ( const JRotation3D R)
inlineinherited

Rotate back hit.

Parameters
Rrotation matrix
Returns
this hit

Definition at line 319 of file JHitL1.hh.

320  {
321  for (iterator i = this->begin(); i != this->end(); ++i) {
322  i->rotate_back(R);
323  }
324 
325  return *this;
326  }

◆ transform()

void JTRIGGER::JHitL1::transform ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transform hit.

Parameters
Rrotation matrix
posposition of origin (after rotation)

Definition at line 335 of file JHitL1.hh.

337  {
338  for (iterator i = this->begin(); i != this->end(); ++i) {
339  i->transform(R, pos);
340  }
341  }

◆ transform_back()

void JTRIGGER::JHitL1::transform_back ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transform back hit.

Parameters
Rrotation matrix
posposition of origin (before rotation)

Definition at line 350 of file JHitL1.hh.

352  {
353  for (iterator i = this->begin(); i != this->end(); ++i) {
354  i->transform_back(R, pos);
355  }
356  }

◆ getModuleIdentifier()

const JDAQModuleIdentifier& KM3NETDAQ::JDAQModuleIdentifier::getModuleIdentifier ( ) const
inlineinherited

Get Module identifier.

Returns
Module identifier

Definition at line 50 of file JDAQModuleIdentifier.hh.

51  {
52  return *this;
53  }

◆ setModuleIdentifier()

void KM3NETDAQ::JDAQModuleIdentifier::setModuleIdentifier ( const JDAQModuleIdentifier module)
inlineinherited

Set Module identifier.

Parameters
moduleModule identifier

Definition at line 61 of file JDAQModuleIdentifier.hh.

62  {
63  *this = module;
64  }

◆ getModuleID()

int KM3NETDAQ::JDAQModuleIdentifier::getModuleID ( ) const
inlineinherited

Get module identifier.

Returns
module identifier

Definition at line 72 of file JDAQModuleIdentifier.hh.

73  {
74  return id;
75  }

◆ sizeOf()

static int KM3NETDAQ::JDAQModuleIdentifier::sizeOf ( )
inlinestaticinherited

Get size of object.

Returns
number of bytes

Definition at line 143 of file JDAQModuleIdentifier.hh.

144  {
145  return sizeof(int);
146  }

◆ ClassDefNV()

KM3NETDAQ::JDAQModuleIdentifier::ClassDefNV ( JDAQModuleIdentifier  ,
 
)
inherited

Member Data Documentation

◆ m

unsigned int JMONITOR::JCluster::m
protected

Definition at line 65 of file JCluster.hh.

◆ id

int KM3NETDAQ::JDAQModuleIdentifier::id
protectedinherited

Definition at line 153 of file JDAQModuleIdentifier.hh.


The documentation for this class was generated from the following file:
std::vector< double >
KM3NETDAQ::JDAQModuleIdentifier::id
int id
Definition: JDAQModuleIdentifier.hh:153
std::set
Definition: JSTDTypes.hh:13
JMONITOR::JCluster::m
unsigned int m
Definition: JCluster.hh:65
JTRIGGER::JHit
Hit data structure.
Definition: JHit.hh:22
JMONITOR::JCluster::setMultiplicity
void setMultiplicity()
Set the multiplicity by looping over the JHitL0s.
Definition: JCluster.hh:55
JTRIGGER::JHitL1::JHitL1
JHitL1()
Default constructor.
Definition: JHitL1.hh:42
JTRIGGER::JHit::getToT
double getToT() const
Get calibrated time over threshold of hit.
Definition: JHit.hh:157