54 _vectorR =
new double[_nXtals];
55 _xtalInd =
new int[_nXtals];
56 _xtalHits =
new int[_nXtals];
57 _xtalHitsMax =
new int[_nXtals];
58 for (
int i=0;i<_nXtals;i++) {
76 _vectorR =
new double[_nXtals];
77 _xtalInd =
new int[_nXtals];
78 _xtalHits =
new int[_nXtals];
79 _xtalHitsMax =
new int[_nXtals];
80 for (
int i=0;i<_nXtals;i++) {
102 if ( 0 != _xtalInd) {
106 if ( 0 != _xtalHits) {
110 if ( 0 != _xtalHitsMax) {
111 delete[] _xtalHitsMax;
133 OutM.setf(ios::scientific,ios::floatfield);
134 OutV.setf(ios::scientific,ios::floatfield);
142 double* vect_ele = _vectorR;
143 double* vect_end = _vectorR + _nXtals;
144 int* xtal_ind = _xtalInd;
146 int* hits = _xtalHits;
148 while ( vect_ele < vect_end ) {
149 if ( *vect_ele != 0. ){
155 OutV << _nXtalsHit <<
" ";
159 while ( vect_ele < vect_end ) {
160 if ( *vect_ele != 0. ) {
161 OutV << *xtal_ind <<
" " << *hits <<
" " << *
hits_max <<
" "
193 for (
int i=0; i<nr_ele; i++) {
198 if (_vectorR[xtal_ind] == 0. ) {
202 _vectorR[xtal_ind] += vect_ele ;
203 _xtalInd[xtal_ind] = xtal_ind;
204 _xtalHits[xtal_ind] += hits;
214 bool successful =
true;
221 int* xRef =
new int[_nXtals];
222 memset(xRef, -1, (_nXtals*
sizeof(
int)));
225 for (
int _arrayIndx = 0;
226 _arrayIndx < _nXtals; _arrayIndx++) {
228 if ( _vectorR[_arrayIndx] > 0. ) {
230 _vectorR[_nXtalsHit] = _vectorR[_arrayIndx];
231 _xtalInd[_nXtalsHit] = _xtalInd[_arrayIndx];
232 _xtalHits[_nXtalsHit] = _xtalHits[_arrayIndx];
233 _xtalHitsMax[_nXtalsHit] = _xtalHitsMax[_arrayIndx];
234 xRef[_arrayIndx] = _nXtalsHit;
254 for (
int i=0;i<_nXtals;i++) {
268 std::cout <<
"EmcBhaCalibData:: INFO "<<
"R ( " << number <<
" ): " << _vectorR[number]
269 <<
" hits: " << _xtalHits[number]
270 <<
" direct hits: " << _xtalHitsMax[number]
void printVec(int number)
void writeOut(ostream &OutM, ostream &outV)
EmcBhaCalibData(int numxtals)
void readIn(istream &InM, istream &InV)
bool reduce_Matrix(int *xRef_list)
void writeOut(ostream &Out)