StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPxlSectorHitCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StPxlSectorHitCollection.cxx,v 2.2 2013/11/13 19:19:40 ullrich Exp $
4  *
5  * Author: X. Dong, Jan 2013
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StPxlSectorHitCollection.cxx,v $
13  * Revision 2.2 2013/11/13 19:19:40 ullrich
14  * Removed cause of warnings.
15  *
16  * Revision 2.1 2013/03/05 14:40:41 ullrich
17  * Initial Revision.
18  *
19  **************************************************************************/
20 #include "StPxlSectorHitCollection.h"
21 #include "StPxlHit.h"
22 
24 
26 
27 StPxlSectorHitCollection::~StPxlSectorHitCollection() { /* noop */ }
28 
30 StPxlSectorHitCollection::ladder(unsigned int i)
31 {
32  return (i < mNumberOfLadders) ? &(mLadders[i]) : 0;
33 }
34 
36 StPxlSectorHitCollection::ladder(unsigned int i) const
37 {
38  return (i < mNumberOfLadders) ? &(mLadders[i]) : 0;
39 }
40 
41 unsigned int StPxlSectorHitCollection::numberOfHits() const
42 {
43  unsigned int sum = 0;
44  for ( unsigned int i=0; i < mNumberOfLadders; i++) {
45  for ( unsigned int j=0; j < mLadders[i].numberOfSensors(); j++) {
46  sum += mLadders[i].sensor(j)->hits().size();
47  }
48  }
49  return sum;
50 }