Calibrating TRD only if TPC is in the data taking (see https://savannah.cern.ch/bugs...
[u/mrichter/AliRoot.git] / PWGPP / TRD / macros / makeTrendingDB.C
CommitLineData
668a0654 1#if ! defined (__CINT__) || defined (__MAKECINT__)
2#include "TSystem.h"
3#include "TROOT.h"
4#include "TFile.h"
5#include "TTree.h"
6#include "TH1.h"
7#include "TF1.h"
8#include "TCanvas.h"
9#include "TError.h"
10#include "PWGPP/TRD/info/AliTRDtrendingManager.h"
11
12#endif
13
847569f2 14void makeTrendingDB(const Char_t *fl)
15{
16// Make trending of variable list "tl" from trending file list "fl"
17// The trending value list should be formated "var1:var2:var3"
18// The trending file from the list should be found on a path formated "your path"/runId/TRD.PerformanceTrend.root
19 gSystem->Load("libANALYSIS.so");
20 gSystem->Load("libANALYSISalice.so");
21 gSystem->Load("libTENDER.so");
22 gSystem->Load("libCORRFW.so");
23 gSystem->Load("libPWGPP.so");
24 gSystem->Load("libPWGmuon.so");
25
668a0654 26 const Int_t nt(167);
847569f2 27 const Char_t *tvn[nt][2] = {
28 {"TRDcheckDET_NTracksEvent", "<N_{track}/Event>"},
29 {"TRDcheckDET_NTracksEventRMS", "RMS(N_{track}/Event)"},
30 {"TRDcheckDET_NTracksSector", "<N_{track}/Sector>"},
31 {"TRDcheckDET_NClustersTrack", "<N_{cls}/Track>"},
32 {"TRDcheckDET_NClustersTrackRMS", "RMS(N_{cls}/Track)"},
33 {"TRDcheckDET_NClustersTracklet", "<N_{cls}/Tracklet>"},
34 {"TRDcheckDET_NClustersTrackletRMS", "RMS(N_{cls}/Tracklet)"},
35 {"TRDcheckDET_NTrackletsTrack", "<N_{tracklet}/Track>"},
36 {"TRDcheckDET_NTrackletsTrackRMS", "RMS(N_{tracklet}/Track)"},
37 {"TRDcheckDET_ChargeTracklet", "<dQdl>"},
38 {"TRDcheckDET_ChargeTrackletRMS", "RMS(dQdl)"},
39 {"TRDcheckDET_PHplateau", "Plateau(<PH>)"},
40 {"TRDcheckDET_PHslope", "Slope(<PH>)"},
41 {"TRDcheckDET_PHamplificationPeak", "Peak(<PH>)"},
42//=======================================================
668a0654 43 {"TRDresolution_TrkInPhnL0", "TrkIn :: <#Delta#phi>^{e-}(p_{t}[GeV/c]<0.5) [deg]"},
44 {"TRDresolution_TrkInPhnl0", "TrkIn :: <#Delta#phi>^{e-}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
45 {"TRDresolution_TrkInPhni0", "TrkIn :: <#Delta#phi>^{e-}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
46 {"TRDresolution_TrkInPhnh0", "TrkIn :: <#Delta#phi>^{e-}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
47 {"TRDresolution_TrkInPhnH0", "TrkIn :: <#Delta#phi>^{e-}(5.0<=p_{t}[GeV/c]) [deg]"},
48 {"TRDresolution_TrkInPhn0", "TrkIn :: <#Delta#phi>^{e-} [deg]"},
49 {"TRDresolution_TrkInQnL0", "TrkIn :: MPV(dQdl)^{e-}(p_{t}[GeV/c]<0.5) [a.u.]"},
50 {"TRDresolution_TrkInQnl0", "TrkIn :: MPV(dQdl)^{e-}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
51 {"TRDresolution_TrkInQni0", "TrkIn :: MPV(dQdl)^{e-}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
52 {"TRDresolution_TrkInQnh0", "TrkIn :: MPV(dQdl)^{e-}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
53 {"TRDresolution_TrkInQnH0", "TrkIn :: MPV(dQdl)^{e-}(5.0<=p_{t}[GeV/c]) [a.u.]"},
54 {"TRDresolution_TrkInQn0", "TrkIn :: MPV(dQdl)^{e-} [a.u.]"},
55 {"TRDresolution_TrkInQSnL0", "TrkIn :: <dQdl>^{e-}(p_{t}[GeV/c]<0.5) [a.u.]"},
56 {"TRDresolution_TrkInQSnl0", "TrkIn :: <dQdl>^{e-}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
57 {"TRDresolution_TrkInQSni0", "TrkIn :: <dQdl>^{e-}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
58 {"TRDresolution_TrkInQSnh0", "TrkIn :: <dQdl>^{e-}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
59 {"TRDresolution_TrkInQSnH0", "TrkIn :: <dQdl>^{e-}(5.0<=p_{t}[GeV/c]) [a.u.]"},
60 {"TRDresolution_TrkInQSn0", "TrkIn :: <dQdl>^{e-} [a.u.]"},
61 {"TRDresolution_TrkInPhnL1", "TrkIn :: <#Delta#phi>^{#mu#pi-}(p_{t}[GeV/c]<0.5) [deg]"},
62 {"TRDresolution_TrkInPhnl1", "TrkIn :: <#Delta#phi>^{#mu#pi-}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
63 {"TRDresolution_TrkInPhni1", "TrkIn :: <#Delta#phi>^{#mu#pi-}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
64 {"TRDresolution_TrkInPhnh1", "TrkIn :: <#Delta#phi>^{#mu#pi-}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
65 {"TRDresolution_TrkInPhnH1", "TrkIn :: <#Delta#phi>^{#mu#pi-}(5.0<=p_{t}[GeV/c]) [deg]"},
66 {"TRDresolution_TrkInPhn1", "TrkIn :: <#Delta#phi>^{#mu#pi-} [deg]"},
67 {"TRDresolution_TrkInQnL1", "TrkIn :: MPV(dQdl)^{#mu#pi-}(p_{t}[GeV/c]<0.5) [a.u.]"},
68 {"TRDresolution_TrkInQnl1", "TrkIn :: MPV(dQdl)^{#mu#pi-}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
69 {"TRDresolution_TrkInQni1", "TrkIn :: MPV(dQdl)^{#mu#pi-}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
70 {"TRDresolution_TrkInQnh1", "TrkIn :: MPV(dQdl)^{#mu#pi-}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
71 {"TRDresolution_TrkInQnH1", "TrkIn :: MPV(dQdl)^{#mu#pi-}(5.0<=p_{t}[GeV/c]) [a.u.]"},
72 {"TRDresolution_TrkInQn1", "TrkIn :: MPV(dQdl)^{#mu#pi-} [a.u.]"},
73 {"TRDresolution_TrkInQSnL1", "TrkIn :: <dQdl>^{#mu#pi-}(p_{t}[GeV/c]<0.5) [a.u.]"},
74 {"TRDresolution_TrkInQSnl1", "TrkIn :: <dQdl>^{#mu#pi-}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
75 {"TRDresolution_TrkInQSni1", "TrkIn :: <dQdl>^{#mu#pi-}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
76 {"TRDresolution_TrkInQSnh1", "TrkIn :: <dQdl>^{#mu#pi-}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
77 {"TRDresolution_TrkInQSnH1", "TrkIn :: <dQdl>^{#mu#pi-}(5.0<=p_{t}[GeV/c]) [a.u.]"},
78 {"TRDresolution_TrkInQSn1", "TrkIn :: <dQdl>^{#mu#pi-} [a.u.]"},
79 {"TRDresolution_TrkInPhnL2", "TrkIn :: <#Delta#phi>^{Kp-}(p_{t}[GeV/c]<0.5) [deg]"},
80 {"TRDresolution_TrkInPhnl2", "TrkIn :: <#Delta#phi>^{Kp-}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
81 {"TRDresolution_TrkInPhni2", "TrkIn :: <#Delta#phi>^{Kp-}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
82 {"TRDresolution_TrkInPhnh2", "TrkIn :: <#Delta#phi>^{Kp-}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
83 {"TRDresolution_TrkInPhnH2", "TrkIn :: <#Delta#phi>^{Kp-}(5.0<=p_{t}[GeV/c]) [deg]"},
84 {"TRDresolution_TrkInPhn2", "TrkIn :: <#Delta#phi>^{Kp-} [deg]"},
85 {"TRDresolution_TrkInQnL2", "TrkIn :: MPV(dQdl)^{Kp-}(p_{t}[GeV/c]<0.5) [a.u.]"},
86 {"TRDresolution_TrkInQnl2", "TrkIn :: MPV(dQdl)^{Kp-}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
87 {"TRDresolution_TrkInQni2", "TrkIn :: MPV(dQdl)^{Kp-}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
88 {"TRDresolution_TrkInQnh2", "TrkIn :: MPV(dQdl)^{Kp-}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
89 {"TRDresolution_TrkInQnH2", "TrkIn :: MPV(dQdl)^{Kp-}(5.0<=p_{t}[GeV/c]) [a.u.]"},
90 {"TRDresolution_TrkInQn2", "TrkIn :: MPV(dQdl)^{Kp-} [a.u.]"},
91 {"TRDresolution_TrkInQSnL2", "TrkIn :: <dQdl>^{Kp-}(p_{t}[GeV/c]<0.5) [a.u.]"},
92 {"TRDresolution_TrkInQSnl2", "TrkIn :: <dQdl>^{Kp-}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
93 {"TRDresolution_TrkInQSni2", "TrkIn :: <dQdl>^{Kp-}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
94 {"TRDresolution_TrkInQSnh2", "TrkIn :: <dQdl>^{Kp-}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
95 {"TRDresolution_TrkInQSnH2", "TrkIn :: <dQdl>^{Kp-}(5.0<=p_{t}[GeV/c]) [a.u.]"},
96 {"TRDresolution_TrkInQSn2", "TrkIn :: <dQdl>^{Kp-} [a.u.]"},
97 {"TRDresolution_TrkInYnL", "TrkIn :: <#Deltay>^{-}(p_{t}[GeV/c]<0.5) [cm]"},
98 {"TRDresolution_TrkInYSnL", "TrkIn :: RMS(#Deltay)^{-}(p_{t}[GeV/c]<0.5) [cm]"},
99 {"TRDresolution_TrkInPhnL", "TrkIn :: <#Delta#phi>^{-}(p_{t}[GeV/c]<0.5) [deg]"},
100 {"TRDresolution_TrkInYnl", "TrkIn :: <#Deltay>^{-}(0.5<=p_{t}[GeV/c]<0.8) [cm]"},
101 {"TRDresolution_TrkInYSnl", "TrkIn :: RMS(#Deltay)^{-}(0.5<=p_{t}[GeV/c]<0.8) [cm]"},
102 {"TRDresolution_TrkInPhnl", "TrkIn :: <#Delta#phi>^{-}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
103 {"TRDresolution_TrkInYni", "TrkIn :: <#Deltay>^{-}(0.8<=p_{t}[GeV/c]<1.5) [cm]"},
104 {"TRDresolution_TrkInYSni", "TrkIn :: RMS(#Deltay)^{-}(0.8<=p_{t}[GeV/c]<1.5) [cm]"},
105 {"TRDresolution_TrkInPhni", "TrkIn :: <#Delta#phi>^{-}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
106 {"TRDresolution_TrkInYnh", "TrkIn :: <#Deltay>^{-}(1.5<=p_{t}[GeV/c]<5.0) [cm]"},
107 {"TRDresolution_TrkInYSnh", "TrkIn :: RMS(#Deltay)^{-}(1.5<=p_{t}[GeV/c]<5.0) [cm]"},
108 {"TRDresolution_TrkInPhnh", "TrkIn :: <#Delta#phi>^{-}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
109 {"TRDresolution_TrkInYnH", "TrkIn :: <#Deltay>^{-}(5.0<=p_{t}[GeV/c]) [cm]"},
110 {"TRDresolution_TrkInYSnH", "TrkIn :: RMS(#Deltay)^{-}(5.0<=p_{t}[GeV/c]) [cm]"},
111 {"TRDresolution_TrkInPhnH", "TrkIn :: <#Delta#phi>^{-}(5.0<=p_{t}[GeV/c]) [deg]"},
112 {"TRDresolution_TrkInYn", "TrkIn :: <#Deltay>^{-} [cm]"},
113 {"TRDresolution_TrkInYSn", "TrkIn :: RMS(#Deltay)^{-} [cm]"},
114 {"TRDresolution_TrkInPhn", "TrkIn :: <#Delta#phi>^{-} [deg]"},
115 {"TRDresolution_TrkInPhpL0", "TrkIn :: <#Delta#phi>^{e+}(p_{t}[GeV/c]<0.5) [deg]"},
116 {"TRDresolution_TrkInPhpl0", "TrkIn :: <#Delta#phi>^{e+}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
117 {"TRDresolution_TrkInPhpi0", "TrkIn :: <#Delta#phi>^{e+}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
118 {"TRDresolution_TrkInPhph0", "TrkIn :: <#Delta#phi>^{e+}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
119 {"TRDresolution_TrkInPhpH0", "TrkIn :: <#Delta#phi>^{e+}(5.0<=p_{t}[GeV/c]) [deg]"},
120 {"TRDresolution_TrkInPhp0", "TrkIn :: <#Delta#phi>^{e+} [deg]"},
121 {"TRDresolution_TrkInQpL0", "TrkIn :: MPV(dQdl)^{e+}(p_{t}[GeV/c]<0.5) [a.u.]"},
122 {"TRDresolution_TrkInQpl0", "TrkIn :: MPV(dQdl)^{e+}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
123 {"TRDresolution_TrkInQpi0", "TrkIn :: MPV(dQdl)^{e+}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
124 {"TRDresolution_TrkInQph0", "TrkIn :: MPV(dQdl)^{e+}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
125 {"TRDresolution_TrkInQpH0", "TrkIn :: MPV(dQdl)^{e+}(5.0<=p_{t}[GeV/c]) [a.u.]"},
126 {"TRDresolution_TrkInQp0", "TrkIn :: MPV(dQdl)^{e+} [a.u.]"},
127 {"TRDresolution_TrkInQSpL0", "TrkIn :: <dQdl>^{e+}(p_{t}[GeV/c]<0.5) [a.u.]"},
128 {"TRDresolution_TrkInQSpl0", "TrkIn :: <dQdl>^{e+}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
129 {"TRDresolution_TrkInQSpi0", "TrkIn :: <dQdl>^{e+}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
130 {"TRDresolution_TrkInQSph0", "TrkIn :: <dQdl>^{e+}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
131 {"TRDresolution_TrkInQSpH0", "TrkIn :: <dQdl>^{e+}(5.0<=p_{t}[GeV/c]) [a.u.]"},
132 {"TRDresolution_TrkInQSp0", "TrkIn :: <dQdl>^{e+} [a.u.]"},
133 {"TRDresolution_TrkInPhpL1", "TrkIn :: <#Delta#phi>^{#mu#pi+}(p_{t}[GeV/c]<0.5) [deg]"},
134 {"TRDresolution_TrkInPhpl1", "TrkIn :: <#Delta#phi>^{#mu#pi+}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
135 {"TRDresolution_TrkInPhpi1", "TrkIn :: <#Delta#phi>^{#mu#pi+}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
136 {"TRDresolution_TrkInPhph1", "TrkIn :: <#Delta#phi>^{#mu#pi+}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
137 {"TRDresolution_TrkInPhpH1", "TrkIn :: <#Delta#phi>^{#mu#pi+}(5.0<=p_{t}[GeV/c]) [deg]"},
138 {"TRDresolution_TrkInPhp1", "TrkIn :: <#Delta#phi>^{#mu#pi+} [deg]"},
139 {"TRDresolution_TrkInQpL1", "TrkIn :: MPV(dQdl)^{#mu#pi+}(p_{t}[GeV/c]<0.5) [a.u.]"},
140 {"TRDresolution_TrkInQpl1", "TrkIn :: MPV(dQdl)^{#mu#pi+}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
141 {"TRDresolution_TrkInQpi1", "TrkIn :: MPV(dQdl)^{#mu#pi+}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
142 {"TRDresolution_TrkInQph1", "TrkIn :: MPV(dQdl)^{#mu#pi+}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
143 {"TRDresolution_TrkInQpH1", "TrkIn :: MPV(dQdl)^{#mu#pi+}(5.0<=p_{t}[GeV/c]) [a.u.]"},
144 {"TRDresolution_TrkInQp1", "TrkIn :: MPV(dQdl)^{#mu#pi+} [a.u.]"},
145 {"TRDresolution_TrkInQSpL1", "TrkIn :: <dQdl>^{#mu#pi+}(p_{t}[GeV/c]<0.5) [a.u.]"},
146 {"TRDresolution_TrkInQSpl1", "TrkIn :: <dQdl>^{#mu#pi+}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
147 {"TRDresolution_TrkInQSpi1", "TrkIn :: <dQdl>^{#mu#pi+}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
148 {"TRDresolution_TrkInQSph1", "TrkIn :: <dQdl>^{#mu#pi+}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
149 {"TRDresolution_TrkInQSpH1", "TrkIn :: <dQdl>^{#mu#pi+}(5.0<=p_{t}[GeV/c]) [a.u.]"},
150 {"TRDresolution_TrkInQSp1", "TrkIn :: <dQdl>^{#mu#pi+} [a.u.]"},
151 {"TRDresolution_TrkInPhpL2", "TrkIn :: <#Delta#phi>^{Kp+}(p_{t}[GeV/c]<0.5) [deg]"},
152 {"TRDresolution_TrkInPhpl2", "TrkIn :: <#Delta#phi>^{Kp+}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
153 {"TRDresolution_TrkInPhpi2", "TrkIn :: <#Delta#phi>^{Kp+}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
154 {"TRDresolution_TrkInPhph2", "TrkIn :: <#Delta#phi>^{Kp+}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
155 {"TRDresolution_TrkInPhpH2", "TrkIn :: <#Delta#phi>^{Kp+}(5.0<=p_{t}[GeV/c]) [deg]"},
156 {"TRDresolution_TrkInPhp2", "TrkIn :: <#Delta#phi>^{Kp+} [deg]"},
157 {"TRDresolution_TrkInQpL2", "TrkIn :: MPV(dQdl)^{Kp+}(p_{t}[GeV/c]<0.5) [a.u.]"},
158 {"TRDresolution_TrkInQpl2", "TrkIn :: MPV(dQdl)^{Kp+}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
159 {"TRDresolution_TrkInQpi2", "TrkIn :: MPV(dQdl)^{Kp+}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
160 {"TRDresolution_TrkInQph2", "TrkIn :: MPV(dQdl)^{Kp+}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
161 {"TRDresolution_TrkInQpH2", "TrkIn :: MPV(dQdl)^{Kp+}(5.0<=p_{t}[GeV/c]) [a.u.]"},
162 {"TRDresolution_TrkInQp2", "TrkIn :: MPV(dQdl)^{Kp+} [a.u.]"},
163 {"TRDresolution_TrkInQSpL2", "TrkIn :: <dQdl>^{Kp+}(p_{t}[GeV/c]<0.5) [a.u.]"},
164 {"TRDresolution_TrkInQSpl2", "TrkIn :: <dQdl>^{Kp+}(0.5<=p_{t}[GeV/c]<0.8) [a.u.]"},
165 {"TRDresolution_TrkInQSpi2", "TrkIn :: <dQdl>^{Kp+}(0.8<=p_{t}[GeV/c]<1.5) [a.u.]"},
166 {"TRDresolution_TrkInQSph2", "TrkIn :: <dQdl>^{Kp+}(1.5<=p_{t}[GeV/c]<5.0) [a.u.]"},
167 {"TRDresolution_TrkInQSpH2", "TrkIn :: <dQdl>^{Kp+}(5.0<=p_{t}[GeV/c]) [a.u.]"},
168 {"TRDresolution_TrkInQSp2", "TrkIn :: <dQdl>^{Kp+} [a.u.]"},
169 {"TRDresolution_TrkInYpL", "TrkIn :: <#Deltay>^{+}(p_{t}[GeV/c]<0.5) [cm]"},
170 {"TRDresolution_TrkInYSpL", "TrkIn :: RMS(#Deltay)^{+}(p_{t}[GeV/c]<0.5) [cm]"},
171 {"TRDresolution_TrkInPhpL", "TrkIn :: <#Delta#phi>^{+}(p_{t}[GeV/c]<0.5) [deg]"},
172 {"TRDresolution_TrkInYpl", "TrkIn :: <#Deltay>^{+}(0.5<=p_{t}[GeV/c]<0.8) [cm]"},
173 {"TRDresolution_TrkInYSpl", "TrkIn :: RMS(#Deltay)^{+}(0.5<=p_{t}[GeV/c]<0.8) [cm]"},
174 {"TRDresolution_TrkInPhpl", "TrkIn :: <#Delta#phi>^{+}(0.5<=p_{t}[GeV/c]<0.8) [deg]"},
175 {"TRDresolution_TrkInYpi", "TrkIn :: <#Deltay>^{+}(0.8<=p_{t}[GeV/c]<1.5) [cm]"},
176 {"TRDresolution_TrkInYSpi", "TrkIn :: RMS(#Deltay)^{+}(0.8<=p_{t}[GeV/c]<1.5) [cm]"},
177 {"TRDresolution_TrkInPhpi", "TrkIn :: <#Delta#phi>^{+}(0.8<=p_{t}[GeV/c]<1.5) [deg]"},
178 {"TRDresolution_TrkInYph", "TrkIn :: <#Deltay>^{+}(1.5<=p_{t}[GeV/c]<5.0) [cm]"},
179 {"TRDresolution_TrkInYSph", "TrkIn :: RMS(#Deltay)^{+}(1.5<=p_{t}[GeV/c]<5.0) [cm]"},
180 {"TRDresolution_TrkInPhph", "TrkIn :: <#Delta#phi>^{+}(1.5<=p_{t}[GeV/c]<5.0) [deg]"},
181 {"TRDresolution_TrkInYpH", "TrkIn :: <#Deltay>^{+}(5.0<=p_{t}[GeV/c]) [cm]"},
182 {"TRDresolution_TrkInYSpH", "TrkIn :: RMS(#Deltay)^{+}(5.0<=p_{t}[GeV/c]) [cm]"},
183 {"TRDresolution_TrkInPhpH", "TrkIn :: <#Delta#phi>^{+}(5.0<=p_{t}[GeV/c]) [deg]"},
184 {"TRDresolution_TrkInYp", "TrkIn :: <#Deltay>^{+} [cm]"},
185 {"TRDresolution_TrkInYSp", "TrkIn :: RMS(#Deltay)^{+} [cm]"},
186 {"TRDresolution_TrkInPhp", "TrkIn :: <#Delta#phi>^{+} [deg]"},
187 {"TRDresolution_TrkInPh0", "TrkIn :: <#Delta#phi>^{e} [deg]"},
188 {"TRDresolution_TrkInQ0", "TrkIn :: MPV(dQdl)^{e} [a.u.]"},
189 {"TRDresolution_TrkInQS0", "TrkIn :: <dQdl>^{e} [a.u.]"},
190 {"TRDresolution_TrkInPh1", "TrkIn :: <#Delta#phi>^{#mu#pi} [deg]"},
191 {"TRDresolution_TrkInQ1", "TrkIn :: MPV(dQdl)^{#mu#pi} [a.u.]"},
192 {"TRDresolution_TrkInQS1", "TrkIn :: <dQdl>^{#mu#pi} [a.u.]"},
193 {"TRDresolution_TrkInPh2", "TrkIn :: <#Delta#phi>^{Kp} [deg]"},
194 {"TRDresolution_TrkInQ2", "TrkIn :: MPV(dQdl)^{Kp} [a.u.]"},
195 {"TRDresolution_TrkInQS2", "TrkIn :: <dQdl>^{Kp} [a.u.]"}
847569f2 196 };
197 const char *resName[] = {"Markus Fasel", "Alexandru Bercuci"},
198 *resMail[] = {"M.Fasel@gsi.de", "A.Bercuci@gsi.de"};
199 const char *notName[] = {"Julian Book", "Hans Beck", "Ionut Arsene", "Raphaelle Bailache", "Christoph Blume"},
200 *notMail[] = {"jbook@ikf.uni-frankfurt.de", "hbeck@ikf.uni-frankfurt.de", "I.C.Arsene@gsi.de", "R.Bailhache@gsi.de", "blume@ikf.uni-frankfurt.de"};
201
202 TFile *fDB = TFile::Open("TRD.TrendDB.root", "RECREATE");
203 TTree *tDB = new TTree("trend", "Reference Trend Values");
204 Double_t val[nt];
205 for(Int_t it(0); it<nt; it++) tDB->Branch(tvn[it][0], &val[it], Form("%s/D", tvn[it][0]));
206 gROOT->cd();
207
208 AliTRDtrendValue *tv(NULL);
209 FILE *fp = fopen(fl, "rt");
210 TString sfp;
211 while(sfp.Gets(fp)){
212 if(!TFile::Open(sfp.Data())) continue;
213 for(Int_t it(0); it<nt; it++){
214 val[it] = -999;
215 if(!(tv = (AliTRDtrendValue*)gFile->Get(tvn[it][0]))) {
668a0654 216 Warning("makeTrendingDB()", "Missing %s from %s", tvn[it][0], sfp.Data());
217 continue;
218 }
f036f7ec 219 if((strstr(tvn[it][0], "TRDcheckDET") || strstr(tvn[it][0], "QS") || strstr(tvn[it][0], "YS")) && TMath::Abs(tv->GetVal()) < 1.e-5){
668a0654 220 Info("makeTrendingDB()", "Found bad value for %s[%f] in %s", tvn[it][0], tv->GetVal(), sfp.Data());
847569f2 221 continue;
222 }
223 val[it] = tv->GetVal();
224 }
225 gFile->Close();
226 tDB->Fill();
227 }
228
229
230// TFile *fDB = TFile::Open("TRD.TrendDB.root");
231// TTree *tDB = (TTree*)gFile->Get("trend");
232// Double_t val[nt];
233// for(Int_t it(0); it<nt; it++) tDB->SetBranchAddress(tvn[it][0], &val[it]);
234// gROOT->cd();
235
236 TString res[] = {Form("%s/%s", resName[0], resMail[0]), Form("%s/%s", resName[1], resMail[1])};
237 TString notifiable;
238 for(Int_t inot(0); inot<5; inot++){
239 notifiable+=notName[inot];
240 notifiable+="/";
241 notifiable+=notMail[inot];
242 if(inot<4) notifiable+=",";
243 }
668a0654 244 TF1 f("f", "gaus", -100, 100); TH1 *h(NULL);
847569f2 245 AliTRDtrendingManager *tm = AliTRDtrendingManager::Instance();
246 TCanvas *c = new TCanvas("c", "Trend Distrib.", 10, 10, 500, 500);
60dd7ffe 247 Int_t ntr=tDB->GetEntries();
847569f2 248 for(Int_t it(0); it<nt; it++){
60dd7ffe 249 tDB->Draw(tvn[it][0], "", "goff");
250 Double_t *v = tDB->GetV1(), xmin(100.), xmax(-100);
668a0654 251 Int_t ntr0(0);
60dd7ffe 252 for(Int_t ir=0; ir<ntr; ir++){
253 if(v[ir]<-100) continue;
668a0654 254 ntr0++;
60dd7ffe 255 if(v[ir]<xmin) xmin = v[ir];
256 if(v[ir]>xmax) xmax = v[ir];
257 }
668a0654 258 if(ntr0<10){
259 Warning("makeTrendingDB", "Couldn't create entry %s. Too few values %d", tvn[it][0], ntr0);
260 continue;
261 }
262 if((h =(TH1F*)gROOT->FindObject("hp"))){delete h; h = NULL;}
263 h = new TH1F("hp", Form(";%s;entries", tvn[it][0]), 10, 0.5*(3*xmin-xmax), 0.5*(3*xmax - xmin));
264 tDB->Draw(Form("%s>>hp", tvn[it][0]), Form("%s>-100", tvn[it][0]));
60dd7ffe 265 if(h->Integral() < 1) continue;
266 f.SetParameter(0, h->Integral());
267 f.SetParameter(1, h->GetMean());
268 f.SetParameter(2, h->GetRMS());
269 h->Fit(&f, "WQ");
270 c->Modified(); c->Update(); c->SaveAs(Form("Fit_%s.gif", tvn[it][0]));
847569f2 271
272 // write trending value to manager
60dd7ffe 273 Info("makeTrendingDB", "%s [%f - %f] %f[%f]", tvn[it][0], xmin, xmax, f.GetParameter(1), f.GetParameter(2));
668a0654 274 Double_t m(0.), s(0.);
f036f7ec 275 if(strstr(tvn[it][0], "TrkInYS")) {
276 m=0.4; s=0.06;
277 } else if(strstr(tvn[it][0], "TrkInY")) {
668a0654 278 m=0.; s=0.1;
279 } else if(strstr(tvn[it][0], "TrkInPh")) {
280 m=0.; s=0.35;
281 } else if(strstr(tvn[it][0], "TrkInQ") || strstr(tvn[it][0], "TrkInQS")) {
282 m=-2.; s=0.2;
283 } else {
284 m=f.GetParameter(1); s=f.GetParameter(2);
285 }
286 tm->AddValue(tvn[it][0], m, s, tvn[it][1], res[it>13], notifiable);
847569f2 287 }
288 tm->Terminate();
289
290 fDB->cd();
291 tDB->Write();
292 fDB->Close();
293}