StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPxlClusterCollection.cxx
1 
6 /***************************************************************************
7  *
8  * $Id: StPxlClusterCollection.cxx,v 1.5 2017/09/01 02:58:33 dongx Exp $
9  *
10  * Author: Qiu Hao, March 2013
11  ***************************************************************************
12  *
13  * Description:
14  * pxl cluster collection
15  * More information at
16  * https://www.star.bnl.gov/protected/heavy/qiuh/HFT/software/PXL_software.pdf
17  *
18  ***************************************************************************
19  *
20  * $Log: StPxlClusterCollection.cxx,v $
21  * Revision 1.5 2017/09/01 02:58:33 dongx
22  * Update to ensure idTruth is preserved for MC hits for overlapping scenarios between MC/data and two or more MC hits
23  *
24  * Revision 1.4 2014/02/27 00:44:08 smirnovd
25  * Use constructor initializer list
26  *
27  * Revision 1.3 2014/01/28 19:29:35 qiuh
28  * *** empty log message ***
29  *
30  *
31  **************************************************************************/
32 
33 #include "StPxlClusterCollection.h"
34 
35 ClassImp(StPxlClusterCollection)
36 
38 {
39 }
40 
41 void StPxlClusterCollection::addCluster(Int_t sector, Int_t ladder, Int_t sensor, const StPxlCluster &cluster)
42 {
43  mClusterVec[sector - 1][ladder - 1][sensor - 1].push_back(cluster);
44 }
45 
46 Int_t StPxlClusterCollection::numberOfClusters(Int_t sector, Int_t ladder, Int_t sensor) const
47 {
48  return mClusterVec[sector - 1][ladder - 1][sensor - 1].size();
49 }
50 
51 const StPxlCluster *StPxlClusterCollection::cluster(Int_t sector, Int_t ladder, Int_t sensor, Int_t clusterIndex) const
52 {
53  return &mClusterVec[sector - 1][ladder - 1][sensor - 1][clusterIndex];
54 }
55 
56 Int_t StPxlClusterCollection::numberOfClusters() const
57 {
58  int n = 0;
59  for (int i = 0; i < kNumberOfPxlSectors; i++) {
60  for (int j = 0; j < kNumberOfPxlLaddersPerSector; j++) {
61  for (int k = 0; k < kNumberOfPxlSensorsPerLadder; k++) {
62  n += mClusterVec[i][j][k].size();
63  }
64  }
65  }
66  return n;
67 }
Int_t numberOfClusters(Int_t sector, Int_t ladder, Int_t sensor) const
number of clusters in a sensor
const StPxlCluster * cluster(Int_t sector, Int_t ladder, Int_t sensor, Int_t clusterIndex) const
pointer to a cluster in the collection
void addCluster(Int_t sector, Int_t ladder, Int_t sensor, const StPxlCluster &cluster)
add a cluster to the collection
vector< StPxlCluster > mClusterVec[kNumberOfPxlSectors][kNumberOfPxlLaddersPerSector][kNumberOfPxlSensorsPerLadder]
vectors to store clusters