StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtBarrelHitCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StSvtBarrelHitCollection.cxx,v 2.2 2001/04/05 04:00:55 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Feb 2000
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StSvtBarrelHitCollection.cxx,v $
13  * Revision 2.2 2001/04/05 04:00:55 ullrich
14  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
15  *
16  * Revision 2.1 2000/02/17 18:15:09 ullrich
17  * Initial Revision
18  *
19  **************************************************************************/
20 #include "StSvtBarrelHitCollection.h"
21 
22 static const char rcsid[] = "$Id: StSvtBarrelHitCollection.cxx,v 2.2 2001/04/05 04:00:55 ullrich Exp $";
23 
25 
27 {
28  mBarrelNumber = -1;
29 }
30 
31 StSvtBarrelHitCollection::~StSvtBarrelHitCollection() { /* noop */ }
32 
33 void
34 StSvtBarrelHitCollection::setBarrelNumber(int i)
35 {
36  if (mBarrelNumber == -1) mBarrelNumber = i;
37 }
38 
39 unsigned int
40 StSvtBarrelHitCollection::numberOfLadders() const
41 {
42  switch (mBarrelNumber) {
43  case 0:
44  return 8;
45  break;
46  case 1:
47  return 12;
48  break;
49  case 2:
50  return 16;
51  break;
52  default:
53  return 0;
54  }
55 }
56 
57 unsigned int
58 StSvtBarrelHitCollection::numberOfHits() const
59 {
60  unsigned int sum = 0;
61  for (unsigned int j=0; j<numberOfLadders(); j++) {
62  for (unsigned int k=0; k<mLadders[j].numberOfWafers(); k++) {
63  sum += mLadders[j].wafer(k)->hits().size();
64  }
65  }
66  return sum;
67 }
68 
70 StSvtBarrelHitCollection::ladder(unsigned int i)
71 {
72  if (i < numberOfLadders())
73  return &(mLadders[i]);
74  else
75  return 0;
76 }
77 
79 StSvtBarrelHitCollection::ladder(unsigned int i) const
80 {
81  if (i < numberOfLadders())
82  return &(mLadders[i]);
83  else
84  return 0;
85 }
86