StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtLadderHitCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StSvtLadderHitCollection.cxx,v 2.4 2001/04/05 04:00:56 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Sep 1999
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StSvtLadderHitCollection.cxx,v $
13  * Revision 2.4 2001/04/05 04:00:56 ullrich
14  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
15  *
16  * Revision 2.3 2000/02/17 18:13:16 ullrich
17  * Changed the SVT hit storage model. Hits are now stored according
18  * to barrel/ladder/wafer not by layer/ladder/wafer.
19  *
20  * Revision 2.2 1999/10/28 22:26:50 ullrich
21  * Adapted new StArray version. First version to compile on Linux and Sun.
22  *
23  * Revision 2.1 1999/10/13 19:45:16 ullrich
24  * Initial Revision
25  *
26  **************************************************************************/
27 #include "StSvtLadderHitCollection.h"
28 
29 static const char rcsid[] = "$Id: StSvtLadderHitCollection.cxx,v 2.4 2001/04/05 04:00:56 ullrich Exp $";
30 
32 
34 {
35  mBarrelNumber = -1;
36 }
37 
38 StSvtLadderHitCollection::~StSvtLadderHitCollection() { /* noop */ }
39 
40 void
41 StSvtLadderHitCollection::setBarrelNumber(int i)
42 {
43  if (mBarrelNumber == -1) mBarrelNumber = i;
44 }
45 
46 unsigned int
47 StSvtLadderHitCollection::numberOfWafers() const
48 {
49  switch (mBarrelNumber) {
50  case 0:
51  return 4;
52  break;
53  case 1:
54  return 6;
55  break;
56  case 2:
57  return 7;
58  break;
59  default:
60  return 0;
61  }
62 }
63 
64 unsigned int
65 StSvtLadderHitCollection::numberOfHits() const
66 {
67  unsigned int sum = 0;
68  for (unsigned int j=0; j<numberOfWafers(); j++) {
69  sum += mWafers[j].hits().size();
70  }
71  return sum;
72 }
73 
75 StSvtLadderHitCollection::wafer(unsigned int i)
76 {
77  if (i < numberOfWafers())
78  return &(mWafers[i]);
79  else
80  return 0;
81 }
82 
84 StSvtLadderHitCollection::wafer(unsigned int i) const
85 {
86  if (i < numberOfWafers())
87  return &(mWafers[i]);
88  else
89  return 0;
90 }
91