BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
Emc/EmcCalib/EmcBhaCalib/EmcBhaCalib-00-00-34/EmcBhaCalib/EmcBhaCalibData.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// Environment:
3// This software was developed for the BESIII collaboration. If you
4// use all or part of it, please give an appropriate acknowledgement.
5//
6// Copyright Information:
7// Copyright (C) 2005 IHEP
8//
9//------------------------------------------------------------------------
10
11#ifndef EMCBHACALIBDATA_H
12#define EMCBHACALIBDATA_H
13
14//-------------
15// C Headers --
16//-------------
17extern "C" {
18}
19
20//---------------
21// C++ Headers --
22//---------------
23#include <iostream>
24#include <fstream>
25
26//----------------------
27// Base Class Headers --
28//----------------------
29
30//-------------------------------
31// Collaborating Class Headers --
32//-------------------------------
33#include "EmcBhaCalib/EmcLSSMatrix.h"
34
35using namespace std;
36
37//------------------------------------
38// Collaborating Class Declarations --
39//------------------------------------
40// ---------------------
41// -- Class Interface --
42// ---------------------
43
44/**
45 * This class holds the information that is needed to do the calibration
46 * of the EMC with Bhabha events. It stores the accumulated matrix,
47 * the accumulated vector, the number of hits percrystal and other stuff.
48 *
49 * The data are filled in the method EmcMCBhaEvent::CollectBhabha().
50 *
51 * This software was developed for the BesIII collaboration. If you
52 * use all or part of it, please give an appropriate acknowledgement.
53 *
54 * Copyright (C) 2005 IHEP
55 *
56 * @see
57 *
58 *
59 * @author (Chunxiu Liu) (originator/contributor etc.);
60 */
61
62
64
65public:
66
67 // Constructor
68 EmcBhaCalibData(int numxtals);
69
70 EmcBhaCalibData(int numxtals, int MsgFlag);
71
72 // Destructor
74
75 // access
76 // calibration matrix element
77 double& matrixMEle(int row, int column) { return ((*_matrixM)(row,column)); }
78
79 // access
80 // pointer to calibration matrix
81 EmcLSSMatrix* getMatrixM() { return _matrixM; }
82
83 // calibration vector
84 double& vectorR(int ind) { return (_vectorR[ind]); }
85
86 // pointer to calibration vector
87 double* getVectorR() { return _vectorR; }
88
89 // array of xtal indices
90 int xtalInd(int ind) { return (_xtalInd[ind]); }
91
92 // number of xtals
93 int& nXtals() { return _nXtals; }
94 // number of xtals hit
95 int& nXtalsHit() { return _nXtalsHit; }
96 // array with number of hits per xtal
97 int& xtalHits(int ind) { return (_xtalHits[ind]); }
98 // array with number of direct hits per xtal
99 int& xtalHitsDir(int ind) { return (_xtalHitsMax[ind]); }
100
101 //reduce matrix and vector to an array containing only non zero elements,
102 // needed for matrix inversion package slap
103 bool reduce();
104
105 //reset all data
106 void reset();
107
108 // write matrix and vector to files
109 void writeOut(ostream& OutM, ostream& outV);
110
111 // read in matrix and vector from files
112 void readIn(istream& InM, istream& InV);
113
114 // output vector element
115 void printVec(int number);
116
117
118private:
119
120 // Data members
121 // calibration matrix
122 EmcLSSMatrix* _matrixM;
123 // calibration vector
124 double* _vectorR;
125 // array of xtal indices
126 int* _xtalInd;
127
128 // number of xtals
129 int _nXtals;
130 // number of xtals hit
131 int _nXtalsHit;
132 // array with number of hits per xtal
133 int* _xtalHits;
134 // array with number of direct hits per xtal
135 int* _xtalHitsMax;
136 // message output flag,
137 int _MsgFlag;
138};
139
140#endif // EMCBHACALIBDATA_H
void printVec(int number)
void writeOut(ostream &OutM, ostream &outV)
void readIn(istream &InM, istream &InV)