1 |
mocchiut |
1.1 |
/** |
2 |
|
|
* \file CaloFranzini.h |
3 |
|
|
* \author Emiliano Mocchiutti (2007/12/03) |
4 |
|
|
*/ |
5 |
|
|
#ifndef calofranzini_h |
6 |
|
|
#define calofranzini_h |
7 |
|
|
|
8 |
mocchiut |
1.3 |
#include <iostream> |
9 |
mocchiut |
1.1 |
|
10 |
|
|
#include <TTree.h> |
11 |
|
|
#include <TFriendElement.h> |
12 |
|
|
#include <TChain.h> |
13 |
|
|
#include <TFile.h> |
14 |
|
|
#include <TList.h> |
15 |
|
|
#include <TKey.h> |
16 |
|
|
#include <TSystemFile.h> |
17 |
|
|
#include <TSystemDirectory.h> |
18 |
|
|
#include <TSQLServer.h> |
19 |
|
|
#include <TMatrixD.h> |
20 |
|
|
#include <TArrayI.h> |
21 |
|
|
#include <TArrayF.h> |
22 |
mocchiut |
1.3 |
#include <TStyle.h> |
23 |
|
|
#include <TCanvas.h> |
24 |
|
|
#include <TStyle.h> |
25 |
|
|
#include <TH1F.h> |
26 |
|
|
// |
27 |
mocchiut |
1.1 |
|
28 |
mocchiut |
1.3 |
#include <PamLevel2.h> |
29 |
mocchiut |
1.1 |
|
30 |
|
|
using namespace std; |
31 |
|
|
|
32 |
|
|
/** |
33 |
|
|
* |
34 |
|
|
* Class to store and calculate variables useful for analysis with the Franzini method |
35 |
|
|
*/ |
36 |
|
|
class CaloFranzini : public TObject { |
37 |
|
|
|
38 |
|
|
private: |
39 |
|
|
// |
40 |
|
|
PamLevel2 *L2; |
41 |
|
|
Bool_t debug; |
42 |
|
|
TFile *file; |
43 |
|
|
Int_t nbin; |
44 |
|
|
TArrayF *brig; |
45 |
mocchiut |
1.4 |
TArrayF *brigm; |
46 |
|
|
TArrayF *qplmean[17]; |
47 |
|
|
TMatrixD *hmat[17]; |
48 |
mocchiut |
1.3 |
Int_t N; |
49 |
|
|
Int_t NC; |
50 |
mocchiut |
1.1 |
// |
51 |
|
|
// needed to avoid reprocessing the same event over and over to obtain the variables; |
52 |
|
|
// |
53 |
|
|
UInt_t OBT; |
54 |
|
|
UInt_t PKT; |
55 |
|
|
UInt_t atime; |
56 |
|
|
Int_t sntr; |
57 |
|
|
Float_t estrip[2][22][96]; |
58 |
mocchiut |
1.3 |
Float_t qplane[43]; |
59 |
|
|
Bool_t sel; |
60 |
|
|
Bool_t cont; |
61 |
mocchiut |
1.1 |
// |
62 |
mocchiut |
1.3 |
Int_t mask18b; |
63 |
mocchiut |
1.1 |
Bool_t dofull; |
64 |
|
|
Bool_t dolong; |
65 |
|
|
Int_t degfre; |
66 |
|
|
// |
67 |
|
|
Float_t longtzeta; ///< longitudinal covariance parameter used for event selection |
68 |
|
|
Float_t fulltzeta; ///< full calorimeter covariance parameter used for event selection |
69 |
|
|
// |
70 |
|
|
|
71 |
|
|
public: |
72 |
|
|
// |
73 |
|
|
CaloFranzini(); |
74 |
|
|
CaloFranzini(PamLevel2 *L2); |
75 |
|
|
~CaloFranzini(){ Delete(); }; |
76 |
|
|
// |
77 |
|
|
Float_t GetLongTZeta(){Process(); return longtzeta;}; ///< Returns longitudinal covariance parameter used for event selection |
78 |
|
|
Float_t GetFullTZeta(){Process(); return fulltzeta;}; ///< Returns full calorimeter covariance parameter used for event selection |
79 |
|
|
// |
80 |
|
|
Float_t GetNormLongTZeta(); ///< Returns longitudinal covariance parameter used for event selection |
81 |
|
|
Float_t GetNormFullTZeta(); ///< Returns full calorimeter covariance parameter used for event selection |
82 |
|
|
// |
83 |
mocchiut |
1.3 |
void Selection(){sel = true; cont = false;}; ///< Set selection mode: planes from 1 to 22-N are used, plane 18 - N is masked if "emulate18" variable is true (DEFAULT); |
84 |
|
|
void Contamination(){sel = false; cont = true;}; ///< Set contamination mode: planes from N to 22 are used. |
85 |
mocchiut |
1.2 |
Int_t GetDegreeOfFreedom(){return degfre;}; |
86 |
|
|
// |
87 |
mocchiut |
1.1 |
TArrayF *LoadLongAverage(Float_t rig); |
88 |
|
|
TMatrixD *LoadCovarianceMatrix(Float_t rig); |
89 |
|
|
// |
90 |
mocchiut |
1.4 |
Float_t GetAverageAt(Int_t plane, Float_t rig); |
91 |
|
|
Float_t GetHmatrixAt(Int_t i, Int_t j, Float_t rig); |
92 |
|
|
// |
93 |
mocchiut |
1.1 |
Bool_t Open(TString matrixfile); |
94 |
mocchiut |
1.4 |
Bool_t LoadBin(); |
95 |
|
|
Bool_t LoadMatrices(); |
96 |
mocchiut |
1.3 |
TFile *GetFile(){return file;}; |
97 |
mocchiut |
1.1 |
// |
98 |
|
|
Bool_t CreateMatrixFile(TString matrixfile); |
99 |
mocchiut |
1.4 |
Bool_t UpdateMatrixFile(TString matrixfile); |
100 |
mocchiut |
1.1 |
void WriteNumBin(Int_t numbin); |
101 |
|
|
void WriteRigBin(TArrayF *rigbin); |
102 |
|
|
void WriteLongMean(TArrayF *qpl, Int_t bin); |
103 |
|
|
void WriteLongMatrix(TMatrixD *matrix, Int_t bin); |
104 |
mocchiut |
1.3 |
void WriteInvertedLongMatrix(TMatrixD matrix, Int_t bin); |
105 |
mocchiut |
1.1 |
void CloseMatrixFile(); |
106 |
|
|
// |
107 |
|
|
void CalculateLongTZeta(){ dofull = false; dolong=true; }; |
108 |
|
|
void CalculateFullTZeta(){ dolong = false; dofull=true; }; |
109 |
|
|
void SetDebug(Bool_t d){ debug=d; }; |
110 |
mocchiut |
1.3 |
void SetNoWpreSampler(Int_t n); |
111 |
|
|
void SetNoWcalo(Int_t n); |
112 |
|
|
Int_t GetNoWpreSampler(){return N;}; ///< Get the number of W planes used as presampler. |
113 |
|
|
Int_t GetNoWcalo(){return NC;}; ///< Get the number of W planes used as calorimeter. |
114 |
|
|
void DrawLongAverage(Float_t rig); |
115 |
mocchiut |
1.1 |
// |
116 |
|
|
void Clear(); |
117 |
|
|
void Clear(Option_t *option){Clear();}; |
118 |
|
|
void Delete(); |
119 |
|
|
void Delete(Option_t *option){Delete();}; |
120 |
|
|
// |
121 |
|
|
void Process(Int_t ntrack); ///< Process data track number ntrack |
122 |
|
|
void Process(); ///< Process data |
123 |
|
|
void Print(); |
124 |
|
|
void Print(Option_t *option){Print();}; |
125 |
|
|
// |
126 |
|
|
ClassDef(CaloFranzini,1); |
127 |
|
|
}; |
128 |
|
|
|
129 |
|
|
#endif |
130 |
|
|
|