43 |
|
* |
44 |
|
* Created by J. Daniel Gezelter on 09/26/06. |
45 |
|
* @author J. Daniel Gezelter |
46 |
< |
* @version $Id: BOPofR.cpp,v 1.1 2007-04-11 23:27:20 chuckv Exp $ |
46 |
> |
* @version $Id: BOPofR.cpp,v 1.3 2007-12-06 19:52:11 chuckv Exp $ |
47 |
|
* |
48 |
|
*/ |
49 |
|
|
76 |
|
RCount_.resize(nBins_); |
77 |
|
WofR_.resize(nBins_); |
78 |
|
QofR_.resize(nBins_); |
79 |
+ |
|
80 |
+ |
for (int i = 0; i < nBins_; i++){ |
81 |
+ |
RCount_[i] = 0; |
82 |
+ |
WofR_[i] = 0; |
83 |
+ |
QofR_[i] = 0; |
84 |
+ |
} |
85 |
|
|
86 |
|
// Make arrays for Wigner3jm |
87 |
|
double* THRCOF = new double[2*lMax_+1]; |
117 |
|
} |
118 |
|
|
119 |
|
delete [] THRCOF; |
120 |
< |
THRCOF = NULL; |
115 |
< |
|
116 |
< |
|
117 |
< |
for (int bin = 0; bin < nBins_; bin++) { |
118 |
< |
QofR_[bin].resize(lMax_ + 1); |
119 |
< |
WofR_[bin].resize(lMax_ + 1 ); |
120 |
< |
RCount_[bin].resize(lMax_ + 1); |
121 |
< |
|
122 |
< |
for (int l = 0; l <= lMax_; l++) { |
123 |
< |
QofR_[bin][l] = 0.0; |
124 |
< |
WofR_[bin][l] = 0.0; |
125 |
< |
RCount_[bin][l] = 1; |
126 |
< |
} |
127 |
< |
|
128 |
< |
} |
120 |
> |
THRCOF = NULL; |
121 |
|
|
122 |
|
} |
123 |
|
|
147 |
|
|
148 |
|
|
149 |
|
void BOPofR::initalizeHistogram() { |
150 |
< |
for (int bin = 0; bin < nBins_; bin++) { |
151 |
< |
QofR_[bin].resize(lMax_); |
152 |
< |
WofR_[bin].resize(lMax_); |
153 |
< |
RCount_[bin].resize(lMax_); |
154 |
< |
for (int l = 0; l <= lMax_; l++) { |
163 |
< |
QofR_[bin][l] = 0; |
164 |
< |
WofR_[bin][l] = 0; |
165 |
< |
RCount_[bin][l] = 0; |
166 |
< |
} |
167 |
< |
} |
150 |
> |
for (int i = 0; i < nBins_; i++){ |
151 |
> |
RCount_[i] = 0; |
152 |
> |
WofR_[i] = 0; |
153 |
> |
QofR_[i] = 0; |
154 |
> |
} |
155 |
|
} |
156 |
|
|
157 |
|
|
308 |
|
} |
309 |
|
|
310 |
|
collectHistogram(q_l, w_hat, distCOM); |
311 |
< |
if(real(w_hat[6]) < -0.1){ |
312 |
< |
std::cout << real(w_hat[6]) << pos << std::endl; |
313 |
< |
} |
311 |
> |
|
312 |
> |
// printf( "%s %18.10g %18.10g %18.10g %18.10g \n", sd->getType().c_str(),pos[0],pos[1],pos[2],real(w_hat[6])); |
313 |
> |
|
314 |
|
} |
315 |
|
} |
316 |
|
|
323 |
|
if ( distCOM < len_){ |
324 |
|
// Figure out where this distance goes... |
325 |
|
int whichBin = distCOM / deltaR_; |
326 |
< |
|
327 |
< |
|
328 |
< |
for (int l = 0; l <= lMax_; l++) { |
329 |
< |
RCount_[whichBin][l]++; |
343 |
< |
QofR_[whichBin][l]=q[l]; |
344 |
< |
WofR_[whichBin][l]=real(what[l]); |
326 |
> |
RCount_[whichBin]++; |
327 |
> |
|
328 |
> |
if(real(what[6]) < -0.15){ |
329 |
> |
WofR_[whichBin]++; |
330 |
|
} |
331 |
< |
|
331 |
> |
if(q[6] > 0.5){ |
332 |
> |
QofR_[whichBin]++; |
333 |
> |
} |
334 |
|
} |
335 |
|
|
336 |
|
} |
346 |
|
for (int i = 0; i < nBins_; ++i) { |
347 |
|
RealType Rval = (i + 0.5) * deltaR_; |
348 |
|
osq << Rval; |
349 |
< |
for (int l = 0; l <= lMax_; l++) { |
350 |
< |
|
351 |
< |
osq << "\t" << (RealType)QofR_[i][l]/(RealType)RCount_[i][l]; |
352 |
< |
} |
353 |
< |
osq << "\n"; |
349 |
> |
if (RCount_[i] == 0){ |
350 |
> |
osq << "\t" << 0; |
351 |
> |
osq << "\n"; |
352 |
> |
}else{ |
353 |
> |
osq << "\t" << (RealType)QofR_[i]/(RealType)RCount_[i]; |
354 |
> |
osq << "\n"; |
355 |
> |
} |
356 |
|
} |
357 |
|
|
358 |
|
osq.close(); |
371 |
|
for (int i = 0; i < nBins_; ++i) { |
372 |
|
RealType Rval = deltaR_ * (i + 0.5); |
373 |
|
osw << Rval; |
374 |
< |
for (int l = 0; l <= lMax_; l++) { |
375 |
< |
|
376 |
< |
osw << "\t" << (RealType)WofR_[i][l]/(RealType)RCount_[i][l]; |
377 |
< |
} |
378 |
< |
osw << "\n"; |
374 |
> |
if (RCount_[i] == 0){ |
375 |
> |
osw << "\t" << 0; |
376 |
> |
osw << "\n"; |
377 |
> |
}else{ |
378 |
> |
osw << "\t" << (RealType)WofR_[i]/(RealType)RCount_[i]; |
379 |
> |
osw << "\n"; |
380 |
> |
} |
381 |
|
} |
382 |
|
|
383 |
|
osw.close(); |