StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcSvtLadderHitCollection.cc
1 /***************************************************************************
2  *
3  * $Id: StMcSvtLadderHitCollection.cc,v 2.5 2005/01/27 23:40:48 calderon Exp $
4  *
5  * Author: Manuel Calderon de la Barca Sanchez, Oct 1999
6  ***************************************************************************
7  *
8  * Description: Monte Carlo Svt Ladder Hit Collection class
9  *
10  ***************************************************************************
11  *
12  * $Log: StMcSvtLadderHitCollection.cc,v $
13  * Revision 2.5 2005/01/27 23:40:48 calderon
14  * Adding persistency to StMcEvent as a step for Virtual MonteCarlo.
15  *
16  * Revision 2.4 2000/04/19 14:34:48 calderon
17  * More corrections for the SSD, thanks Helen
18  *
19  * Revision 2.3 2000/03/06 18:05:22 calderon
20  * 1) Modified SVT Hits storage scheme from layer-ladder-wafer to
21  * barrel-ladder-wafer.
22  * 2) Added Rich Hit class and collection, and links to them in other
23  * classes.
24  *
25  * Revision 2.2 1999/12/14 07:04:49 calderon
26  * Numbering scheme as per SVT request.
27  *
28  * Revision 2.1 1999/11/19 19:06:33 calderon
29  * Recommit after redoing the files.
30  *
31  * Revision 2.0 1999/11/17 02:01:00 calderon
32  * Completely revised for new StEvent
33  *
34  *
35  **************************************************************************/
36 #include "StMcSvtLadderHitCollection.hh"
37 
38 static const char rcsid[] = "$Id: StMcSvtLadderHitCollection.cc,v 2.5 2005/01/27 23:40:48 calderon Exp $";
40 StMcSvtLadderHitCollection::StMcSvtLadderHitCollection()
41 {
42  mBarrelNumber = -1;
43 }
44 
45 StMcSvtLadderHitCollection::~StMcSvtLadderHitCollection() { /* noop */ }
46 
47 void
48 StMcSvtLadderHitCollection::setBarrelNumber(int i)
49 {
50  if (mBarrelNumber == -1) mBarrelNumber = i;
51 }
52 
53 unsigned int
54 StMcSvtLadderHitCollection::numberOfWafers() const
55 {
56  switch (mBarrelNumber) {
57  case 0:
58  return 4;
59  break;
60  case 1:
61  return 6;
62  break;
63  case 2:
64  return 7;
65  break;
66  case 3: // SSD
67  return 16;
68  break;
69  default:
70  return 0;
71  }
72 }
73 
74 unsigned long
75 StMcSvtLadderHitCollection::numberOfHits() const
76 {
77  unsigned long sum = 0;
78  for (unsigned int j=0; j<numberOfWafers(); j++) {
79  sum += mWafers[j].hits().size();
80  }
81  return sum;
82 }
83 
85 StMcSvtLadderHitCollection::wafer(unsigned int i)
86 {
87  if (i < numberOfWafers())
88  return &(mWafers[i]);
89  else
90  return 0;
91 }
92 
94 StMcSvtLadderHitCollection::wafer(unsigned int i) const
95 {
96  if (i < numberOfWafers())
97  return &(mWafers[i]);
98  else
99  return 0;
100 }
101