StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuFcsCluster.cxx
1 /*****************************************************************************
2  *
3  * $Id: StMuFcsCluster.cxx,v 1.0 2021/11/17 17:11:34 jdb Exp $
4  *
5  * Author: Daniel Brandneburg , 2021
6  *****************************************************************************
7  *
8  * Description: Implementation of StMuFcsCluster, the MuDST FCS cluster class
9  *
10  *****************************************************************************/
11 
12 #include "StFcsCluster.h"
13 #include "StMuFcsCluster.h"
14 
15 #include "StMessMgr.h"
16 #include "StFcsHit.h"
17 #include "StMuFcsPoint.h"
18 
19 static const char rcsid[] = "$Id: StMuFcsCluster.cxx,v 2.1 2021/01/11 20:25:37 ullrich Exp $";
20 
21 StMuFcsCluster::StMuFcsCluster(): mFourMomentum(0.,0.,0.,0.) { /* no op */ }
22 
23 StMuFcsCluster::~StMuFcsCluster() { /* no op */ }
24 
25 void StMuFcsCluster::addNeighbor(StMuFcsCluster* neighbor) {
26  int n=nNeighbor();
27  for(int i=0; i<n; i++) if(mNeighbor[i]==neighbor) return; //already there, do nothing
28  mNeighbor.Add(neighbor);
29 }
30 
31 void StMuFcsCluster::addPoint(StMuFcsPoint* p) {
32  mPoints.Add(p);
33 }
34 
35 void StMuFcsCluster::addPoint(StMuFcsPoint* p1, StMuFcsPoint* p2) {
36  mPoints.Add(p1);
37  mPoints.Add(p2);
38 }
39 
40 void StMuFcsCluster::print(Option_t *option) const {
41  cout << Form(
42  "StFcsCluster id=%4d ctg=%1d n=%2d nNeigh=%1d nPoints=%1d loc=%7.2f %7.2f PXYZE=%7.2lf %7.2lf %7.2lf %7.2lf E=%7.2lf sigMin/max=%7.2f %7.2f Chi2=%7.2f %7.2f",
43  id(), category(), nTowers(), nNeighbor(),nPoints(),
44  x(), y(),
45  fourMomentum().Px(),fourMomentum().Py(),fourMomentum().Pz(),fourMomentum().E(),
46  energy(), sigmaMin(), sigmaMax(), chi2Ndf1Photon(), chi2Ndf2Photon()) << endl;
47 }