StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPidAmpNetOut.cxx
1 /***************************************************************************
2  *
3  * $Id: StPidAmpNetOut.cxx,v 1.1 2000/07/22 22:27:14 aihong Exp $
4  *
5  * Author: Aihong Tang & Richard Witt (FORTRAN Version),Kent State U.
6  * Send questions to aihong@cnr.physics.kent.edu
7  ***************************************************************************
8  *
9  * Description:part of StPidAmpMaker package
10  * This is the object to be written out.
11  * It contains: (if all filled)
12  * 1.Parameters for describing the band
13  * 2.Parameters for describing the amplitude
14  * 3.Parameters for describing the resolution
15  * 4.Parameters for calibration
16  * 5.Geant ID for the net type
17  ***************************************************************************
18  *
19  * $Log: StPidAmpNetOut.cxx,v $
20  * Revision 1.1 2000/07/22 22:27:14 aihong
21  * move files from StPidAmpMaker to StEventUtilities
22  *
23  * Revision 1.4 2000/05/05 21:24:57 aihong
24  * change operator << to let it pass sun compiler
25  *
26  * Revision 1.3 2000/05/05 19:20:47 aihong
27  * let StPidAmpNetOut::Get*ParArray() returns pointer instead of obj.
28  *
29  * Revision 1.2 2000/03/24 15:10:44 aihong
30  * add PrintContent()
31  *
32  * Revision 1.1.1.1 2000/03/09 17:48:33 aihong
33  * Installation of package
34  *
35  **************************************************************************/
36 
37 
38 #include "StPidAmpNetOut.h"
39 
40 ClassImp(StPidAmpNetOut)
41 
43  mCalibConst=0.0;
44 }
45 
46 StPidAmpNetOut::StPidAmpNetOut(const StPidAmpNetOut& netOut){
47  mGeantID =netOut.mGeantID;
48  mBandParArray=netOut.mBandParArray;
49  mAmpParArray =netOut.mAmpParArray;
50  mResoParArray=netOut.mResoParArray;
51  mCalibConst =netOut.mCalibConst;
52  SetName(netOut.GetName());
53  SetTitle(netOut.GetTitle());
54  }
55 
56 
57 StPidAmpNetOut::StPidAmpNetOut(Text_t* name,Text_t* title,Int_t id,TArrayD bandParAry, TArrayD ampParAry, TArrayD linrParAry) : TNamed(name,title) {
58 
59  mGeantID=id;
60  mBandParArray=bandParAry;
61  mAmpParArray=ampParAry;
62  mResoParArray=linrParAry;
63  mCalibConst=0.0;
64  }
65 StPidAmpNetOut::StPidAmpNetOut(const char* name,const char* title,Int_t id,TArrayD bandParAry, TArrayD ampParAry, TArrayD linrParAry) : TNamed(name,title) {
66 
67  mGeantID=id;
68  mBandParArray=bandParAry;
69  mAmpParArray=ampParAry;
70  mResoParArray=linrParAry;
71  mCalibConst=0.0;
72  }
73  StPidAmpNetOut::~StPidAmpNetOut(){}
74 
75 void StPidAmpNetOut::SetBandParArray(TArrayD bandParAry){
76  mBandParArray=bandParAry;
77 }
78 
79 void StPidAmpNetOut::SetAmpParArray(TArrayD ampParAry){
80  mAmpParArray=ampParAry;
81 }
82 
83 void StPidAmpNetOut::SetResoParArray(TArrayD linrParAry){
84  mResoParArray=linrParAry;
85 }
86 
87 void StPidAmpNetOut::SetGeantID(Int_t id){
88  mGeantID=id;
89 }
90 void StPidAmpNetOut::SetCalibConst(Double_t cal){
91  mCalibConst=cal;
92 }
93 void StPidAmpNetOut::PrintContent(){
94  int i;
95  cout<<GetName()<<" Geant ID: "<<mGeantID<<endl;
96  cout<<"Calibration constant: "<<mCalibConst<<endl;
97  cout<<"band Parameters: { ";
98 
99 
100  for (i=0; i<mBandParArray.GetSize();i++){
101 
102  cout<<mBandParArray.At(i);
103 
104  if ( i!=(mBandParArray.GetSize()-1)) cout<<", ";
105  else cout<<" ";
106  }
107 
108  cout<<"}"<<endl;
109 
110  cout<<"amplitude Parameters: { ";
111 
112 
113 
114  for (i=0; i<mAmpParArray.GetSize();i++){
115 
116  cout<<mAmpParArray.At(i);
117 
118  if ( i!=(mAmpParArray.GetSize()-1)) cout<<", ";
119  else cout<<" ";
120  }
121 
122  cout<<"}"<<endl;
123 
124  cout<<"resolution Parameters: { ";
125 
126 
127  for (i=0; i<mResoParArray.GetSize();i++){
128 
129  cout<<mResoParArray.At(i);
130 
131  if ( i!=(mResoParArray.GetSize()-1)) cout<<", ";
132  else cout<<" ";
133  }
134 
135  cout<<"}"<<endl;
136 
137 
138  cout<<endl;
139 
140 
141 }
142 
143 
144 
145 
146 
147 TArrayD* StPidAmpNetOut::GetBandParArray() {return &mBandParArray;}
148 TArrayD* StPidAmpNetOut::GetAmpParArray() {return &mAmpParArray;}
149 TArrayD* StPidAmpNetOut::GetResoParArray() {return &mResoParArray;}
150 Int_t StPidAmpNetOut::GetNBandPars() const{return mBandParArray.GetSize();}
151 Int_t StPidAmpNetOut::GetNAmpPars() const{return mAmpParArray.GetSize();}
152 Int_t StPidAmpNetOut::GetNResoPars() const{return mResoParArray.GetSize();}
153 
154 Int_t StPidAmpNetOut::GetGeantID() const{return mGeantID;}
155 Double_t StPidAmpNetOut::GetCalibConst() const{return mCalibConst;}
156 
157 ostream& operator<<(ostream& s, StPidAmpNetOut& netOut){
158  int i;
159  s<<netOut.GetName()<<" Geant ID: "<<netOut.GetGeantID()<<endl;
160  s<<"Calibration constant: "<<netOut.GetCalibConst()<<endl;
161 
162  s<<"band Parameters: { ";
163 
164  TArrayD* theBandParArray=netOut.GetBandParArray();
165 
166  for (i=0; i<theBandParArray->GetSize();i++){
167 
168  s<<theBandParArray->At(i);
169 
170  if ( i!=(theBandParArray->GetSize()-1)) s<<", ";
171  else s<<" ";
172  }
173 
174  s<<"}"<<endl;
175 
176  s<<"amplitude Parameters: { ";
177 
178  TArrayD* theAmpParArray=netOut.GetAmpParArray();
179 
180 
181  for (i=0; i<theAmpParArray->GetSize();i++){
182 
183  s<<theAmpParArray->At(i);
184 
185  if ( i!=(theAmpParArray->GetSize()-1)) s<<", ";
186  else s<<" ";
187  }
188 
189  s<<"}"<<endl;
190 
191  s<<"resolution Parameters: { ";
192 
193  TArrayD* theResoParArray=netOut.GetResoParArray();
194 
195  for (i=0; i<theResoParArray->GetSize();i++){
196 
197  s<<theResoParArray->At(i);
198 
199  if ( i!=(theResoParArray->GetSize()-1)) s<<", ";
200  else s<<" ";
201  }
202 
203  s<<"}"<<endl;
204 
205 
206  s<<endl;
207 
208  return s;
209 }