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.3 |
Int_t N; |
46 |
|
|
Int_t NC; |
47 |
mocchiut |
1.1 |
// |
48 |
|
|
// needed to avoid reprocessing the same event over and over to obtain the variables; |
49 |
|
|
// |
50 |
|
|
UInt_t OBT; |
51 |
|
|
UInt_t PKT; |
52 |
|
|
UInt_t atime; |
53 |
|
|
Int_t sntr; |
54 |
|
|
Float_t estrip[2][22][96]; |
55 |
mocchiut |
1.3 |
Float_t qplane[43]; |
56 |
|
|
Bool_t sel; |
57 |
|
|
Bool_t cont; |
58 |
mocchiut |
1.1 |
// |
59 |
mocchiut |
1.3 |
Int_t mask18b; |
60 |
mocchiut |
1.1 |
Bool_t dofull; |
61 |
|
|
Bool_t dolong; |
62 |
|
|
Int_t degfre; |
63 |
|
|
// |
64 |
|
|
Float_t longtzeta; ///< longitudinal covariance parameter used for event selection |
65 |
|
|
Float_t fulltzeta; ///< full calorimeter covariance parameter used for event selection |
66 |
|
|
// |
67 |
|
|
|
68 |
|
|
public: |
69 |
|
|
// |
70 |
|
|
CaloFranzini(); |
71 |
|
|
CaloFranzini(PamLevel2 *L2); |
72 |
|
|
~CaloFranzini(){ Delete(); }; |
73 |
|
|
// |
74 |
|
|
Float_t GetLongTZeta(){Process(); return longtzeta;}; ///< Returns longitudinal covariance parameter used for event selection |
75 |
|
|
Float_t GetFullTZeta(){Process(); return fulltzeta;}; ///< Returns full calorimeter covariance parameter used for event selection |
76 |
|
|
// |
77 |
|
|
Float_t GetNormLongTZeta(); ///< Returns longitudinal covariance parameter used for event selection |
78 |
|
|
Float_t GetNormFullTZeta(); ///< Returns full calorimeter covariance parameter used for event selection |
79 |
|
|
// |
80 |
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); |
81 |
|
|
void Contamination(){sel = false; cont = true;}; ///< Set contamination mode: planes from N to 22 are used. |
82 |
mocchiut |
1.2 |
Int_t GetDegreeOfFreedom(){return degfre;}; |
83 |
|
|
// |
84 |
mocchiut |
1.1 |
TArrayF *LoadLongAverage(Float_t rig); |
85 |
|
|
TMatrixD *LoadCovarianceMatrix(Float_t rig); |
86 |
|
|
// |
87 |
|
|
Bool_t Open(TString matrixfile); |
88 |
mocchiut |
1.3 |
TFile *GetFile(){return file;}; |
89 |
mocchiut |
1.1 |
// |
90 |
|
|
Bool_t CreateMatrixFile(TString matrixfile); |
91 |
|
|
void WriteNumBin(Int_t numbin); |
92 |
|
|
void WriteRigBin(TArrayF *rigbin); |
93 |
|
|
void WriteLongMean(TArrayF *qpl, Int_t bin); |
94 |
|
|
void WriteLongMatrix(TMatrixD *matrix, Int_t bin); |
95 |
mocchiut |
1.3 |
void WriteInvertedLongMatrix(TMatrixD matrix, Int_t bin); |
96 |
mocchiut |
1.1 |
void CloseMatrixFile(); |
97 |
|
|
// |
98 |
|
|
void CalculateLongTZeta(){ dofull = false; dolong=true; }; |
99 |
|
|
void CalculateFullTZeta(){ dolong = false; dofull=true; }; |
100 |
|
|
void SetDebug(Bool_t d){ debug=d; }; |
101 |
mocchiut |
1.3 |
void SetNoWpreSampler(Int_t n); |
102 |
|
|
void SetNoWcalo(Int_t n); |
103 |
|
|
Int_t GetNoWpreSampler(){return N;}; ///< Get the number of W planes used as presampler. |
104 |
|
|
Int_t GetNoWcalo(){return NC;}; ///< Get the number of W planes used as calorimeter. |
105 |
|
|
void DrawLongAverage(Float_t rig); |
106 |
mocchiut |
1.1 |
// |
107 |
|
|
void Clear(); |
108 |
|
|
void Clear(Option_t *option){Clear();}; |
109 |
|
|
void Delete(); |
110 |
|
|
void Delete(Option_t *option){Delete();}; |
111 |
|
|
// |
112 |
|
|
void Process(Int_t ntrack); ///< Process data track number ntrack |
113 |
|
|
void Process(); ///< Process data |
114 |
|
|
void Print(); |
115 |
|
|
void Print(Option_t *option){Print();}; |
116 |
|
|
// |
117 |
|
|
ClassDef(CaloFranzini,1); |
118 |
|
|
}; |
119 |
|
|
|
120 |
|
|
#endif |
121 |
|
|
|