StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPhmdCollection.cxx
1 /********************************************************************
2  *
3  * $Id: StPhmdCollection.cxx,v 2.1 2002/12/20 22:33:00 ullrich Exp $
4  *
5  * Author: Subhasis Chattopadhyay, Dec 2002
6  ********************************************************************
7  *
8  * Description: Base class for PMD collection
9  *
10  ********************************************************************
11  *
12  * $Log: StPhmdCollection.cxx,v $
13  * Revision 2.1 2002/12/20 22:33:00 ullrich
14  * Initial Revision.
15  *
16  ********************************************************************/
17 #include "StPhmdCollection.h"
18 #include "StPhmdDetector.h"
19 
20 ClassImp(StPhmdCollection)
21 
23 {
24  mCpvDetector = new StPhmdDetector(kPhmdCpvId);
25  mDetector = new StPhmdDetector(kPhmdId);
26 }
27 
28 StPhmdCollection::~StPhmdCollection()
29 {
30  delete mCpvDetector;
31  delete mDetector;
32 }
33 
35 StPhmdCollection::detector(StDetectorId id)
36 {
37  if (id == kPhmdCpvId)
38  return mCpvDetector;
39  else if (id == kPhmdId)
40  return mDetector;
41  else
42  return 0;
43 }
44 
45 const StPhmdDetector*
46 StPhmdCollection::detector(StDetectorId id) const
47 {
48  if (id == kPhmdCpvId)
49  return mCpvDetector;
50  else if (id == kPhmdId)
51  return mDetector;
52  else
53  return 0;
54 }
55 
56 void
57 StPhmdCollection::setDetector(StPhmdDetector* val)
58 {
59  if (val) {
60  if (val->id() == kPhmdCpvId) {
61  delete mCpvDetector;
62  mCpvDetector = val;
63  }
64  else if (val->id() == kPhmdId) {
65  delete mDetector;
66  mDetector = val;
67  }
68  }
69 }
70 
71 
72