StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFcsCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StFcsCollection.cxx,v 2.1 2021/01/11 20:25:37 ullrich Exp $
4  *
5  * Author: Akio Ogawa, 2018 Aug
6  ***************************************************************************
7  *
8  * Description: Collection of all hits (towers), clusters and
9  * points (photons) in the FCS
10  *
11  ***************************************************************************
12  *
13  * $Log: StFcsCollection.cxx,v $
14  * Revision 2.1 2021/01/11 20:25:37 ullrich
15  * Initial Revision
16  *
17  **************************************************************************/
18 #include "StEvent/StFcsCollection.h"
19 
20 #include "StEvent/StFcsHit.h"
21 #include "StEvent/StFcsCluster.h"
22 #include "StEvent/StFcsPoint.h"
23 
24 static const char rcsid[] = "$Id: StFcsCollection.cxx,v 2.1 2021/01/11 20:25:37 ullrich Exp $";
25 
26 ClassImp(StFcsCollection)
27 
28 StFcsCollection::StFcsCollection() {/* no operation*/}
29 
30 StFcsCollection::~StFcsCollection() {/* no operation */}
31 
32 void StFcsCollection::addHit(unsigned int det, StFcsHit* hit){mHits[det%(kFcsNDet+1)].push_back(hit);}
33 StSPtrVecFcsHit& StFcsCollection::hits(unsigned int det) {return mHits[det%(kFcsNDet+1)];}
34 const StSPtrVecFcsHit& StFcsCollection::hits(unsigned int det) const {return mHits[det%(kFcsNDet+1)];}
35 unsigned int StFcsCollection::numberOfHits(unsigned int det) const { return mHits[det%(kFcsNDet+1)].size(); }
36 
37 void StFcsCollection::addCluster(unsigned int det, StFcsCluster* cluster){mClusters[det%kFcsNDet].push_back(cluster);}
38 StSPtrVecFcsCluster& StFcsCollection::clusters(unsigned int det) {return mClusters[det%kFcsNDet];}
39 const StSPtrVecFcsCluster& StFcsCollection::clusters(unsigned int det) const {return mClusters[det%kFcsNDet];}
40 unsigned int StFcsCollection::numberOfClusters(unsigned int det) const { return mClusters[det%kFcsNDet].size(); }
41 
42 void StFcsCollection::addPoint(unsigned int det, StFcsPoint* point){mPoints[det%kFcsNDet].push_back(point);}
43 StSPtrVecFcsPoint& StFcsCollection::points(unsigned int det) {return mPoints[det%kFcsNDet];}
44 const StSPtrVecFcsPoint& StFcsCollection::points(unsigned int det) const {return mPoints[det%kFcsNDet];}
45 unsigned int StFcsCollection::numberOfPoints(unsigned int det) const { return mPoints[det%kFcsNDet].size(); }
46 
47 /*
48 void StFcsCollection::addCluster(int det, StFcsCluster* cluster){
49  if(det==0){mClustersEcal.push_back(cluster);}
50  else {mClustersHcal.push_back(cluster);}
51 }
52 StSPtrVecFcsCluster& StFcsCollection::clusters(int det) {return (det==0 ? mClustersEcal : mClustersHcal);}
53 const StSPtrVecFcsCluster& StFcsCollection::clusters(int det) const {return (det==0 ? mClustersEcal : mClustersHcal);}
54 unsigned int StFcsCollection::numberOfClusters(int det) const {return (det==0 ? mClustersEcal.size() : mClustersHcal.size());}
55 
56 void StFcsCollection::addPoint(int det, StFcsPoint* point){
57  if(det==0){mPointsEcal.push_back(point);}
58  else {mPointsHcal.push_back(point);}
59 }
60 StSPtrVecFcsPoint& StFcsCollection::points(int det) {return (det==0 ? mPointsEcal : mPointsHcal);}
61 const StSPtrVecFcsPoint& StFcsCollection::points(int det) const {return (det==0 ? mPointsEcal : mPointsHcal);}
62 unsigned int StFcsCollection::numberOfPoints(int det) const {return (det==0 ? mPointsEcal.size() : mPointsHcal.size());}
63 */
64 
65 void StFcsCollection::print(int option) {
66  cout << Form(" *** Print FCS collection *** RecFlag=%d",mFcsReconstructionFlag) << endl;
67  for(unsigned int det=0; det<kFcsNDet+1; det++){
68  cout << Form(" *** FCS Det=%1d *** NHit=%3d NCluster=%3d NPoint=%3d",
69  det,numberOfHits(det),numberOfClusters(det),numberOfPoints(det)) << endl;
70  if(option>=3) for(unsigned int i=0; i<numberOfHits(det); i++) {hits(det)[i]->print();}
71  if(det==kFcsNDet) continue;
72  if(option>=2) for(unsigned int i=0; i<numberOfClusters(det); i++) {clusters(det)[i]->print();}
73  if(option>=1) for(unsigned int i=0; i<numberOfPoints(det); i++) {points(det)[i]->print();}
74  }
75 }
76