StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
StPmdUtil
StPmdCollection.cxx
1
/**********************************************
2
*
3
* $Id: StPmdCollection.cxx,v 1.5 2010/08/27 16:54:07 perev Exp $
4
*
5
* Author: Subhasis Chattopadhyay, July 2002.
6
***********************************************
7
*
8
* Description: Base class for PMD collection
9
*
10
***********************************************
11
* $Log: StPmdCollection.cxx,v $
12
* Revision 1.5 2010/08/27 16:54:07 perev
13
* WarnOff
14
*
15
* Revision 1.4 2004/11/15 23:27:16 subhasis
16
* if() removed in ctor to stop valgrind error
17
*
18
* Revision 1.3 2003/10/14 10:16:31 subhasis
19
* zeroed before delete
20
*
21
* Revision 1.2 2003/05/12 12:07:13 subhasis
22
* Mapping added
23
*
24
***********************************************/
25
#include "StPmdCollection.h"
26
#include "StPmdDetector.h"
27
28
ClassImp(
StPmdCollection
)
29
30
StPmdCollection
::
StPmdCollection
(const Char_t * name):
TDataSet
(name) {
31
for
(
int
i=0; i<2; i++){
32
mDetector[i]=0;
33
StPmdDetector
* det =
new
StPmdDetector
(i,12);
34
this->setDetector(det,i);
35
}
36
}
37
38
StPmdCollection::~StPmdCollection
(){
39
for
(
int
i=0; i<2; i++){
40
if
(mDetector[i])
delete
mDetector[i];
41
}
42
}
43
44
StPmdDetector
*
45
StPmdCollection::detector
(Int_t
id
)
46
{
47
if
(
id
>= 0 &&
id
<= 1)
48
return
mDetector[id];
49
else
50
return
0;
51
}
52
53
void
54
StPmdCollection::setDetector
(
StPmdDetector
* val, Int_t
id
)
55
{
56
if
(val) {
57
if
(
id
>= 0 &&
id
<= 1) {
58
59
if
(mDetector[
id
]) mDetector[id]=0;
60
if
(mDetector[
id
])
delete
mDetector[id];
61
mDetector[id] = val;
62
}
63
}
64
}
65
66
67
StPmdCollection
Definition:
StPmdCollection.h:32
StPmdCollection::detector
StPmdDetector * detector(Int_t)
destructor
Definition:
StPmdCollection.cxx:45
StPmdCollection::setDetector
void setDetector(StPmdDetector *, Int_t)
detector id
Definition:
StPmdCollection.cxx:54
TDataSet
Definition:
TDataSet.h:34
StPmdDetector
Definition:
StPmdDetector.h:28
StPmdCollection::~StPmdCollection
~StPmdCollection()
constructor keeps the information for bothCPV/PMD
Definition:
StPmdCollection.cxx:38
Generated by
1.8.5