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 |
|
|
#include <PamLevel2.h> |
9 |
|
|
|
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 |
|
|
|
23 |
|
|
#include <iostream> |
24 |
|
|
|
25 |
|
|
using namespace std; |
26 |
|
|
|
27 |
|
|
/** |
28 |
|
|
* |
29 |
|
|
* Class to store and calculate variables useful for analysis with the Franzini method |
30 |
|
|
*/ |
31 |
|
|
class CaloFranzini : public TObject { |
32 |
|
|
|
33 |
|
|
private: |
34 |
|
|
// |
35 |
|
|
PamLevel2 *L2; |
36 |
|
|
Bool_t debug; |
37 |
|
|
TFile *file; |
38 |
|
|
Int_t nbin; |
39 |
|
|
TArrayF *brig; |
40 |
|
|
// |
41 |
|
|
// needed to avoid reprocessing the same event over and over to obtain the variables; |
42 |
|
|
// |
43 |
|
|
UInt_t OBT; |
44 |
|
|
UInt_t PKT; |
45 |
|
|
UInt_t atime; |
46 |
|
|
Int_t sntr; |
47 |
|
|
Float_t estrip[2][22][96]; |
48 |
|
|
Float_t qplane[44]; |
49 |
|
|
// |
50 |
|
|
Bool_t dofull; |
51 |
|
|
Bool_t dolong; |
52 |
|
|
Int_t degfre; |
53 |
|
|
// |
54 |
|
|
Float_t longtzeta; ///< longitudinal covariance parameter used for event selection |
55 |
|
|
Float_t fulltzeta; ///< full calorimeter covariance parameter used for event selection |
56 |
|
|
// |
57 |
|
|
|
58 |
|
|
public: |
59 |
|
|
// |
60 |
|
|
CaloFranzini(); |
61 |
|
|
CaloFranzini(PamLevel2 *L2); |
62 |
|
|
~CaloFranzini(){ Delete(); }; |
63 |
|
|
// |
64 |
|
|
Float_t GetLongTZeta(){Process(); return longtzeta;}; ///< Returns longitudinal covariance parameter used for event selection |
65 |
|
|
Float_t GetFullTZeta(){Process(); return fulltzeta;}; ///< Returns full calorimeter covariance parameter used for event selection |
66 |
|
|
// |
67 |
|
|
Float_t GetNormLongTZeta(); ///< Returns longitudinal covariance parameter used for event selection |
68 |
|
|
Float_t GetNormFullTZeta(); ///< Returns full calorimeter covariance parameter used for event selection |
69 |
|
|
// |
70 |
|
|
TArrayF *LoadLongAverage(Float_t rig); |
71 |
|
|
TMatrixD *LoadCovarianceMatrix(Float_t rig); |
72 |
|
|
// |
73 |
|
|
Bool_t Open(TString matrixfile); |
74 |
|
|
// |
75 |
|
|
Bool_t CreateMatrixFile(TString matrixfile); |
76 |
|
|
void WriteNumBin(Int_t numbin); |
77 |
|
|
void WriteRigBin(TArrayF *rigbin); |
78 |
|
|
void WriteLongMean(TArrayF *qpl, Int_t bin); |
79 |
|
|
void WriteLongMatrix(TMatrixD *matrix, Int_t bin); |
80 |
|
|
void CloseMatrixFile(); |
81 |
|
|
// |
82 |
|
|
void CalculateLongTZeta(){ dofull = false; dolong=true; }; |
83 |
|
|
void CalculateFullTZeta(){ dolong = false; dofull=true; }; |
84 |
|
|
void SetDebug(Bool_t d){ debug=d; }; |
85 |
|
|
// |
86 |
|
|
void Clear(); |
87 |
|
|
void Clear(Option_t *option){Clear();}; |
88 |
|
|
void Delete(); |
89 |
|
|
void Delete(Option_t *option){Delete();}; |
90 |
|
|
// |
91 |
|
|
void Process(Int_t ntrack); ///< Process data track number ntrack |
92 |
|
|
void Process(); ///< Process data |
93 |
|
|
void Print(); |
94 |
|
|
void Print(Option_t *option){Print();}; |
95 |
|
|
// |
96 |
|
|
ClassDef(CaloFranzini,1); |
97 |
|
|
}; |
98 |
|
|
|
99 |
|
|
#endif |
100 |
|
|
|