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