/[PAMELA software]/calo/flight/CaloFranzini/inc/CaloFranzini.h
ViewVC logotype

Contents of /calo/flight/CaloFranzini/inc/CaloFranzini.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Jan 21 10:24:08 2008 UTC (16 years, 10 months ago) by mocchiut
Branch: MAIN
Changes since 1.6: +5 -2 lines
File MIME type: text/plain
che stress

1 /**
2 * \file CaloFranzini.h
3 * \author Emiliano Mocchiutti (2007/12/03)
4 */
5 #ifndef calofranzini_h
6 #define calofranzini_h
7
8 #include <iostream>
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 <TMatrixF.h>
21 #include <TArrayI.h>
22 #include <TArrayF.h>
23 #include <TStyle.h>
24 #include <TCanvas.h>
25 #include <TStyle.h>
26 #include <TH1F.h>
27 #include <TDecompSVD.h>
28 //
29
30 #include <PamLevel2.h>
31
32 using namespace std;
33
34 /**
35 *
36 * Class to store and calculate variables useful for analysis with the Franzini method
37 */
38 class CaloFranzini : public TObject {
39
40 private:
41 //
42 PamLevel2 *L2;
43 Bool_t debug;
44 TFile *file;
45 Int_t nbin;
46 TArrayF *brig;
47 TArrayF *brigm;
48 TArrayF *qplmean[17];
49 TMatrixD *hmat[17];
50 TMatrixF *hfmat[17];
51 TMatrixD *fqplmean[17];
52 Int_t N;
53 Int_t NC;
54 //
55 // needed to avoid reprocessing the same event over and over to obtain the variables;
56 //
57 UInt_t OBT;
58 UInt_t PKT;
59 UInt_t atime;
60 Int_t sntr;
61 Float_t estrip[2][22][96];
62 Float_t qplane[43];
63 Bool_t sel;
64 Bool_t cont;
65 Bool_t crig;
66 //
67 Int_t mask18b;
68 Bool_t dofull;
69 Bool_t dolong;
70 Int_t degfre;
71 //
72 Float_t longtzeta; ///< longitudinal covariance parameter used for event selection
73 Float_t fulltzeta; ///< full calorimeter covariance parameter used for event selection
74 //
75
76 public:
77 //
78 CaloFranzini();
79 CaloFranzini(PamLevel2 *L2);
80 ~CaloFranzini(){ Delete(); };
81 //
82 Float_t GetLongTZeta(){Process(); return longtzeta;}; ///< Returns longitudinal covariance parameter used for event selection
83 Float_t GetFullTZeta(){Process(); return fulltzeta;}; ///< Returns full calorimeter covariance parameter used for event selection
84 //
85 Float_t GetNormLongTZeta(); ///< Returns longitudinal covariance parameter used for event selection
86 Float_t GetNormFullTZeta(); ///< Returns full calorimeter covariance parameter used for event selection
87 //
88 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);
89 void Contamination(){sel = false; cont = true;}; ///< Set contamination mode: planes from N to 22 are used.
90 Int_t GetDegreeOfFreedom(){return degfre;};
91 //
92 TArrayF *LoadLongAverage(Float_t rig);
93 TMatrixD *LoadCovarianceMatrix(Float_t rig);
94 //
95 Float_t GetAverageAt(Int_t plane, Float_t rig);
96 Float_t GetHmatrixAt(Int_t i, Int_t j, Float_t rig);
97 //
98 Float_t GetFullAverageAt(Int_t plane, Int_t strip, Float_t rig);
99 Float_t GetFullHmatrixAt(Int_t i, Int_t j, Float_t rig);
100 Float_t GetFullAverageAt(Int_t plane, Int_t strip, Float_t rig, Int_t rigbin);
101 Float_t GetFullHmatrixAt(Int_t i, Int_t j, Float_t rig, Int_t rigbin);
102 //
103 Bool_t Open(TString matrixfile);
104 Bool_t LoadBin();
105 Bool_t LoadLong();
106 Bool_t LoadFull();
107 Bool_t LoadMatrices();
108 Bool_t LoadFullMatrices();
109 TFile *GetFile(){return file;};
110 //
111 TMatrixD *LoadFullAverage(Int_t rigbin);
112 TMatrixD *LoadFullNAverage(Int_t rigbin);
113 void UnLoadFullAverage(Int_t rigbin);
114 void UnLoadFullNAverage(Int_t rigbin);
115 TMatrixF *LoadFullMatrix(Int_t rigbin);
116 void LoadFullMatrix(Int_t rigbin, TMatrixF *&fmatri);
117 TMatrixF *LoadFullNMatrix(Int_t rigbin);
118 void UnLoadFullMatrix(Int_t rigbin);
119 void UnLoadFullNMatrix(Int_t rigbin);
120 //
121 Int_t ConvertStrip(Int_t mstrip);
122 //
123 Bool_t CreateMatrixFile(TString matrixfile);
124 Bool_t UpdateMatrixFile(TString matrixfile);
125 void WriteNumBin(Int_t numbin);
126 void WriteRigBin(TArrayF *rigbin);
127 void WriteLongMean(TArrayF *qpl, Int_t bin);
128 void WriteLongMatrix(TMatrixD *matrix, Int_t bin);
129 void WriteFullMatrix(TMatrixD *matrix, Int_t bin);
130 void WriteFullNMatrix(TMatrixF *matrix, Int_t bin);
131 void WriteFullMean(TMatrixD *matrix, Int_t bin);
132 void WriteFullNMean(TMatrixD *matrix, Int_t bin);
133 void WriteInvertedLongMatrix(TMatrixD matrix, Int_t bin);
134 void WriteInvertedFullMatrix(TMatrixD matrix, Int_t bin);
135 void CloseMatrixFile();
136 //
137 void CalculateLongTZeta(){ dofull = false; dolong=true; };
138 void CalculateFullTZeta(){ dolong = false; dofull=true; };
139 void SetDebug(Bool_t d){ debug=d; };
140 void SetNoWpreSampler(Int_t n);
141 void SetNoWcalo(Int_t n);
142 Int_t GetNoWpreSampler(){return N;}; ///< Get the number of W planes used as presampler.
143 Int_t GetNoWcalo(){return NC;}; ///< Get the number of W planes used as calorimeter.
144 void DrawLongAverage(Float_t rig);
145 void DrawLongAverage(Int_t bin);
146 void UseCaloRig(){crig=true;};
147 //
148 void Clear();
149 void Clear(Option_t *option){Clear();};
150 void Delete();
151 void Delete(Option_t *option){Delete();};
152 //
153 void Process(Int_t ntrack); ///< Process data track number ntrack
154 void Process(); ///< Process data
155 void Print();
156 void Print(Option_t *option){Print();};
157 //
158 ClassDef(CaloFranzini,1);
159 };
160
161 #endif
162

  ViewVC Help
Powered by ViewVC 1.1.23