StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPxlRawHitCollection.cxx
1 
6 /***************************************************************************
7  *
8  * $Id: StPxlRawHitCollection.cxx,v 1.4 2017/08/28 17:05:16 dongx Exp $
9  *
10  * Author: Qiu Hao, March 2013
11  ***************************************************************************
12  *
13  * Description:
14  * pxl raw hit collection
15  * More information at
16  * https://www.star.bnl.gov/protected/heavy/qiuh/HFT/software/PXL_software.pdf
17  *
18  ***************************************************************************
19  *
20  * $Log: StPxlRawHitCollection.cxx,v $
21  * Revision 1.4 2017/08/28 17:05:16 dongx
22  * Append rawHits to StPxlRawHitCollection only if exists - for simu/embedding
23  *
24  * Revision 1.3 2014/01/28 19:29:44 qiuh
25  * *** empty log message ***
26  *
27  *
28  **************************************************************************/
29 #include "StPxlRawHitCollection.h"
30 #include "StPxlUtil/StPxlConstants.h"
31 
32 ClassImp(StPxlRawHitCollection)
33 
35 {
36 }
37 
39 {
40  mPxlRawHitVec[rawHit.sector() - 1][rawHit.ladder() - 1][rawHit.sensor() - 1].push_back(rawHit);
41 }
42 
43 Int_t StPxlRawHitCollection::numberOfRawHits(Int_t sector, Int_t ladder, Int_t sensor)
44 {
45  return mPxlRawHitVec[sector - 1][ladder - 1][sensor - 1].size();
46 }
47 
48 const StPxlRawHit *StPxlRawHitCollection::rawHit(Int_t sector, Int_t ladder, Int_t sensor, Int_t rawHitIndex) const
49 {
50  return &mPxlRawHitVec[sector - 1][ladder - 1][sensor - 1][rawHitIndex];
51 }
52 
53 Int_t StPxlRawHitCollection::numberOfRawHits()
54 {
55  int n = 0;
56  for (int i = 0; i < kNumberOfPxlSectors; i++) {
57  for (int j = 0; j < kNumberOfPxlLaddersPerSector; j++) {
58  for (int k = 0; k < kNumberOfPxlSensorsPerLadder; k++) {
59  n += mPxlRawHitVec[i][j][k].size();
60  }
61  }
62  }
63  return n;
64 }
const StPxlRawHit * rawHit(Int_t sector, Int_t ladder, Int_t sensor, Int_t rawHitIndex) const
pionter to a rawHit in the collection
vector< StPxlRawHit > mPxlRawHitVec[kNumberOfPxlSectors][kNumberOfPxlLaddersPerSector][kNumberOfPxlSensorsPerLadder]
vectors to store raw hits
Int_t ladder() const
ladder 1-4
Definition: StPxlRawHit.cxx:52
void addRawHit(const StPxlRawHit &rawHit)
add a raw hit to the collection
Int_t sector() const
sector 1-10
Definition: StPxlRawHit.cxx:51
Int_t sensor() const
sensor 1-10
Definition: StPxlRawHit.cxx:53
Int_t numberOfRawHits(Int_t sector, Int_t ladder, Int_t sensor)
number of raw hits in a sensor