]>
Commit | Line | Data |
---|---|---|
ece56eb9 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // $Id: AliMUONTriggerQADataMakerRec.cxx 35760 2009-10-21 21:45:42Z ivana $ | |
17 | ||
18 | // --- MUON header files --- | |
19 | #include "AliMUONTriggerQADataMakerRec.h" | |
20 | ||
21 | //----------------------------------------------------------------------------- | |
22 | /// \class AliMUONTriggerQADataMakerRec | |
23 | /// | |
24 | /// MUON class for quality assurance data (histo) maker | |
25 | /// | |
a026ce9e | 26 | /// \author C. Finck, D. Stocco, L. Aphecetche, A. Blanc |
ece56eb9 | 27 | |
28 | /// \cond CLASSIMP | |
29 | ClassImp(AliMUONTriggerQADataMakerRec) | |
30 | /// \endcond | |
31 | ||
32 | #include "AliCodeTimer.h" | |
33 | #include "AliMUONConstants.h" | |
34 | #include "AliMpConstants.h" | |
35 | #include "AliMUONTriggerDisplay.h" | |
36 | #include "TH2.h" | |
c39cf12d | 37 | #include "TH1F.h" |
ece56eb9 | 38 | #include "TString.h" |
39 | #include "AliRecoParam.h" | |
40 | #include "AliMUONDigitStoreV2R.h" | |
41 | #include "AliMUONTriggerStoreV1.h" | |
42 | #include "AliMpCDB.h" | |
43 | #include "AliMUONRawStreamTriggerHP.h" | |
44 | #include "AliMpDDLStore.h" | |
45 | #include "AliMpTriggerCrate.h" | |
46 | #include "AliMpLocalBoard.h" | |
47 | #include "AliQAv1.h" | |
48 | #include "AliRawReader.h" | |
49 | #include "AliMUONDigitMaker.h" | |
50 | #include "AliMUONLocalTrigger.h" | |
51 | #include "AliMUONRecoParam.h" | |
52 | #include "AliMUONTriggerElectronics.h" | |
53 | #include "AliMUONCalibrationData.h" | |
54 | #include "AliDCSValue.h" | |
55 | #include "AliMpDCSNamer.h" | |
56 | #include "AliMpDEManager.h" | |
57 | #include "AliMpDEIterator.h" | |
58 | #include "AliCDBManager.h" | |
59 | #include "TTree.h" | |
60 | #include "AliMUONGlobalTriggerBoard.h" | |
a026ce9e | 61 | #include "AliMUONGlobalTrigger.h" |
ece56eb9 | 62 | #include "AliMUONGlobalCrateConfig.h" |
6482f70b | 63 | #include "AliMUONQAIndices.h" |
ece56eb9 | 64 | |
34a26958 | 65 | namespace |
66 | { | |
67 | Double_t ProtectedSqrt(Double_t x) | |
68 | { | |
69 | return ( x > 0.0 ? TMath::Sqrt(x) : 0.0 ); | |
70 | } | |
71 | } | |
ece56eb9 | 72 | //____________________________________________________________________________ |
73 | AliMUONTriggerQADataMakerRec::AliMUONTriggerQADataMakerRec(AliQADataMakerRec* master) : | |
74 | AliMUONVQADataMakerRec(master), | |
c39cf12d | 75 | fNumberOf34Dec(0x0), |
76 | fNumberOf44Dec(0x0), | |
ece56eb9 | 77 | fDigitMaker(new AliMUONDigitMaker(kFALSE)), |
78 | fCalibrationData(new AliMUONCalibrationData(AliCDBManager::Instance()->GetRun())), | |
79 | fTriggerProcessor(new AliMUONTriggerElectronics(fCalibrationData)), | |
80 | fDigitStore(0x0) | |
81 | { | |
82 | /// ctor | |
83 | } | |
84 | ||
85 | ||
86 | //__________________________________________________________________ | |
87 | AliMUONTriggerQADataMakerRec::~AliMUONTriggerQADataMakerRec() | |
88 | { | |
89 | /// dtor | |
90 | delete fDigitMaker; | |
91 | delete fDigitStore; | |
92 | delete fTriggerProcessor; | |
93 | delete fCalibrationData; | |
c39cf12d | 94 | delete fNumberOf34Dec; |
95 | delete fNumberOf44Dec; | |
ece56eb9 | 96 | } |
97 | ||
98 | //____________________________________________________________________________ | |
99 | void AliMUONTriggerQADataMakerRec::EndOfDetectorCycleESDs(Int_t /*specie*/, TObjArray** /*list*/) | |
100 | { | |
101 | /// Normalize ESD histograms | |
102 | } | |
103 | ||
104 | //____________________________________________________________________________ | |
105 | void AliMUONTriggerQADataMakerRec::EndOfDetectorCycleRecPoints(Int_t /*specie*/, TObjArray** /*list*/) | |
106 | { | |
107 | /// Normalize RecPoints histograms | |
108 | ||
109 | } | |
110 | ||
111 | ||
112 | //____________________________________________________________________________ | |
113 | void AliMUONTriggerQADataMakerRec::EndOfDetectorCycleRaws(Int_t /*specie*/, TObjArray** /*list*/) | |
114 | { | |
115 | /// create Raws histograms in Raws subdir | |
116 | ||
a026ce9e | 117 | DisplayTriggerInfo(); |
118 | ||
ece56eb9 | 119 | // Normalize RawData histos |
6482f70b | 120 | Float_t nbevent = GetRawsData(AliMUONQAIndices::kTriggerRawNAnalyzedEvents)->GetBinContent(1); |
ece56eb9 | 121 | Int_t histoRawsIndex[] = { |
6482f70b | 122 | AliMUONQAIndices::kTriggerErrorSummary, |
123 | AliMUONQAIndices::kTriggerCalibSummary, | |
124 | AliMUONQAIndices::kTriggerReadOutErrors, | |
125 | AliMUONQAIndices::kTriggerGlobalOutput | |
ece56eb9 | 126 | }; |
a026ce9e | 127 | Int_t histoRawsScaledIndex[] = { |
6482f70b | 128 | AliMUONQAIndices::kTriggerErrorSummaryNorm, |
129 | AliMUONQAIndices::kTriggerCalibSummaryNorm, | |
130 | AliMUONQAIndices::kTriggerReadOutErrorsNorm, | |
131 | AliMUONQAIndices::kTriggerGlobalOutputNorm | |
a026ce9e | 132 | }; |
ece56eb9 | 133 | const Int_t kNrawsHistos = sizeof(histoRawsIndex)/sizeof(histoRawsIndex[0]); |
134 | Float_t scaleFactor[kNrawsHistos] = {100., 100., 100., 1.}; | |
135 | for(Int_t ihisto=0; ihisto<kNrawsHistos; ihisto++){ | |
a026ce9e | 136 | TH1* inputHisto = GetRawsData(histoRawsIndex[ihisto]); |
137 | TH1* scaledHisto = GetRawsData(histoRawsScaledIndex[ihisto]); | |
138 | if ( scaledHisto && inputHisto && nbevent > 0 ) { | |
139 | scaledHisto->Reset(); | |
140 | scaledHisto->Add(inputHisto); | |
141 | scaledHisto->Scale(scaleFactor[ihisto]/nbevent); | |
ece56eb9 | 142 | } |
a026ce9e | 143 | } // loop on histos |
144 | ||
6482f70b | 145 | TH1* hYCopy = GetRawsData(AliMUONQAIndices::kTriggerErrorLocalYCopy); //number of YCopy error per board |
146 | TH1* hYCopyTests = GetRawsData(AliMUONQAIndices::kTriggerErrorLocalYCopyTest); //contains the number of YCopy test per board | |
147 | TH1* hYCopyNorm = GetRawsData(AliMUONQAIndices::kTriggerErrorLocalYCopyNorm); | |
a026ce9e | 148 | hYCopyNorm->Reset(); |
149 | hYCopyNorm->Divide(hYCopy, hYCopyTests, 100., 1.); | |
150 | ||
151 | Float_t mean = hYCopyNorm->Integral(); | |
152 | ||
6482f70b | 153 | TH1* hSummary = GetRawsData(AliMUONQAIndices::kTriggerErrorSummary); |
154 | hSummary->SetBinContent(AliMUONQAIndices::kAlgoLocalYCopy+1,mean/192.); //put the mean of the % of YCopy error in the kTriggerError's corresponding bin | |
c39cf12d | 155 | |
fa7e0953 | 156 | TH1F* hTriggerRatio = (TH1F*)GetRawsData(AliMUONQAIndices::kTriggerLocalRatio4434); |
157 | if ( hTriggerRatio ){ | |
158 | hTriggerRatio->Divide(fNumberOf44Dec,fNumberOf34Dec); | |
c39cf12d | 159 | |
fa7e0953 | 160 | FillRatio4434Histos(1); |
25bf7c78 | 161 | |
fa7e0953 | 162 | //reset bins temporary used to store informations |
163 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinContent(0,0); | |
164 | Int_t nbins = ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->GetNbinsX(); | |
165 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinContent(nbins+1,0); | |
c39cf12d | 166 | |
fa7e0953 | 167 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerLocalRatio4434))->SetMaximum(1.1); |
168 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetMaximum(1.1); | |
169 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate))->SetMaximum(1.1); | |
170 | } | |
ece56eb9 | 171 | } |
172 | ||
173 | //____________________________________________________________________________ | |
174 | void AliMUONTriggerQADataMakerRec::InitRaws() | |
175 | { | |
176 | /// create Raws histograms in Raws subdir | |
177 | ||
178 | AliCodeTimerAuto("",0); | |
179 | ||
180 | const Bool_t expert = kTRUE ; | |
181 | const Bool_t saveCorr = kTRUE ; | |
182 | const Bool_t image = kTRUE ; | |
183 | ||
184 | TString boardName = "Local board Id"; | |
185 | ||
186 | Int_t nbLocalBoard = AliMUONConstants::NTriggerCircuit(); | |
187 | ||
188 | TH1F* histo1D = 0x0; | |
189 | TH2F* histo2D = 0x0; | |
190 | ||
191 | AliMUONTriggerDisplay triggerDisplay; | |
192 | ||
193 | TString histoName, histoTitle; | |
194 | if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) { | |
a026ce9e | 195 | histo1D = new TH1F("hTriggerScalersTime", "Acquisition time from trigger scalers", 1, 0.5, 1.5); |
196 | histo1D->GetXaxis()->SetBinLabel(1, "One-bin histogram: bin is filled at each scaler event."); | |
197 | histo1D->GetYaxis()->SetTitle("Cumulated scaler time (s)"); | |
6482f70b | 198 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerScalersTime, expert, !image, !saveCorr); |
a026ce9e | 199 | |
ece56eb9 | 200 | for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){ |
201 | TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane"; | |
202 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
203 | histoName = Form("hTriggerScalers%sChamber%i", cathName.Data(), 11+iChamber); | |
204 | histoTitle = Form("Chamber %i - %s: trigger scaler counts", 11+iChamber, cathName.Data()); | |
205 | histo2D = new TH2F(histoName.Data(), histoTitle.Data(), | |
206 | nbLocalBoard, 0.5, (Float_t)nbLocalBoard + 0.5, | |
207 | 16, -0.5, 15.5); | |
208 | histo2D->GetXaxis()->SetTitle(boardName.Data()); | |
209 | histo2D->GetYaxis()->SetTitle("Strip"); | |
210 | histo2D->SetOption("COLZ"); | |
6482f70b | 211 | Add2RawsList(histo2D, AliMUONQAIndices::kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image, !saveCorr); |
ece56eb9 | 212 | } // loop on chambers |
213 | } // loop on cathodes | |
214 | ||
215 | for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){ | |
216 | TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane"; | |
217 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
218 | histoName = Form("hTriggerScalersDisplay%sChamber%i", cathName.Data(), 11+iChamber); | |
219 | histoTitle = Form("Chamber %i - %s: Hit rate from scalers (Hz/cm^{2})", 11+iChamber, cathName.Data()); | |
220 | histo2D = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, | |
221 | iCath, iChamber, histoTitle); | |
222 | histo2D->SetOption("COLZ"); | |
6482f70b | 223 | Add2RawsList(histo2D, AliMUONQAIndices::kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image, !saveCorr); |
ece56eb9 | 224 | } // loop on chambers |
a026ce9e | 225 | } // loop on cathodes |
ece56eb9 | 226 | |
6482f70b | 227 | TString axisLabel[AliMUONQAIndices::kNtrigCalibSummaryBins] = {"#splitline{Dead}{Channels}", "#splitline{Dead}{Local Boards}", "#splitline{Dead}{Regional Boards}", "#splitline{Dead}{Global Board}", "#splitline{Noisy}{Strips}"}; |
ece56eb9 | 228 | |
6482f70b | 229 | TH1F* histoCalib = new TH1F("hTriggerCalibSummaryAll", "MTR calibration summary counts", AliMUONQAIndices::kNtrigCalibSummaryBins, -0.5, (Float_t)AliMUONQAIndices::kNtrigCalibSummaryBins - 0.5); |
230 | for (Int_t ibin=1; ibin<=AliMUONQAIndices::kNtrigCalibSummaryBins; ibin++){ | |
a026ce9e | 231 | histoCalib->GetXaxis()->SetBinLabel(ibin, axisLabel[ibin-1].Data()); |
ece56eb9 | 232 | } |
a026ce9e | 233 | histoCalib->SetFillColor(kBlue); |
234 | histoCalib->GetYaxis()->SetTitle("Counts"); | |
235 | // Copy of previous histo for scaling purposes | |
236 | TH1F* histoCalibNorm = (TH1F*)histoCalib->Clone("hTriggerCalibSummary"); | |
237 | histoCalibNorm->SetTitle("MTR calibration summary"); | |
238 | histoCalibNorm->SetOption("bar2"); | |
239 | histoCalibNorm->GetYaxis()->SetTitle("Percentage per event (%)"); | |
240 | // Adding both histos after cloning to avoid problems with the expert bit | |
6482f70b | 241 | Add2RawsList(histoCalib, AliMUONQAIndices::kTriggerCalibSummary, expert, !image, !saveCorr); |
242 | Add2RawsList(histoCalibNorm, AliMUONQAIndices::kTriggerCalibSummaryNorm, !expert, image, !saveCorr); | |
ece56eb9 | 243 | } // Calibration reco param |
ece56eb9 | 244 | |
213812e8 | 245 | const char *globalXaxisName[6] = {"US HPt", "US LPt", "LS HPt", "LS LPt", "SGL HPt", "SGL LPt"}; |
6482f70b | 246 | const char *allLevelXaxisName[AliMUONQAIndices::kNtrigAlgoErrorBins] = {"Local algo X", "Local algo Y", "Local LUT","Local Y Copy" , "Local2Regional", "Regional", "Regional2Global", "GlobalFromInGlobal", "GlobalFromInLocal", "GlobalFromOutLocal"}; |
247 | const char *readoutErrNames[AliMUONQAIndices::kNtrigStructErrorBins]={"Local","Regional","Global","DARC"}; | |
ece56eb9 | 248 | |
249 | TString errorAxisTitle = "Number of errors"; | |
250 | ||
b71c3d2d | 251 | histo1D = new TH1F("hTriggerErrorLocalXPos", "ErrorLocalXPos",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 252 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
253 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 254 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalXPos, expert, !image, !saveCorr); |
a026ce9e | 255 | |
b71c3d2d | 256 | histo1D = new TH1F("hTriggerErrorLocalYPos", "ErrorLocalYPos",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 257 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
258 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 259 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalYPos, expert, !image, !saveCorr); |
a026ce9e | 260 | |
b71c3d2d | 261 | histo1D = new TH1F("hTriggerErrorLocalDev", "ErrorLocalDev",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 262 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
263 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 264 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalDev, expert, !image, !saveCorr); |
a026ce9e | 265 | |
b71c3d2d | 266 | histo1D = new TH1F("hTriggerErrorLocalTriggerDec", "ErrorLocalTriggerDec",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 267 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
268 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 269 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalTriggerDec, expert, !image, !saveCorr); |
a026ce9e | 270 | |
b71c3d2d | 271 | histo1D = new TH1F("hTriggerErrorLocalLPtLSB", "ErrorLocalLPtLSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 272 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
273 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 274 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalLPtLSB, expert, !image, !saveCorr); |
a026ce9e | 275 | |
b71c3d2d | 276 | histo1D = new TH1F("hTriggerErrorLocalLPtMSB", "ErrorLocalLPtMSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 277 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
278 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 279 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalLPtMSB, expert, !image, !saveCorr); |
a026ce9e | 280 | |
b71c3d2d | 281 | histo1D = new TH1F("hTriggerErrorLocalHPtLSB", "ErrorLocalHPtLSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 282 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
283 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 284 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalHPtLSB, expert, !image, !saveCorr); |
a026ce9e | 285 | |
b71c3d2d | 286 | histo1D = new TH1F("hTriggerErrorLocalHPtMSB", "ErrorLocalHPtMSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 287 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
288 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 289 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalHPtMSB, expert, !image, !saveCorr); |
a026ce9e | 290 | |
b71c3d2d | 291 | histo1D = new TH1F("hTriggerErrorLocalTrigY", "ErrorLocalTrigY",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 292 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
293 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 294 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalTrigY, expert, !image, !saveCorr); |
a026ce9e | 295 | |
fa7e0953 | 296 | if ( GetRecoParam()->GetEventSpecie() != AliRecoParam::kCalib ) { |
297 | histo1D = new TH1F("hTriggerRatio4434Local", "Ratio4434Local",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); | |
298 | histo1D->GetXaxis()->SetTitle(boardName.Data()); | |
299 | histo1D->GetYaxis()->SetTitle("ratio 44/34"); | |
300 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerLocalRatio4434, expert, !image, !saveCorr); | |
301 | histo1D = new TH1F("hTriggerRatio4434AllEvents", "Ratio4434AllEvents",1,0,1); | |
302 | histo1D->GetXaxis()->SetTitle("Event number"); | |
303 | histo1D->GetYaxis()->SetTitle("ratio 44/34"); | |
304 | histo1D->SetLineColor(4); | |
305 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerRatio4434AllEvents, expert, !image, !saveCorr); | |
306 | histo1D = new TH1F("hTriggerRatio4434SinceLastUpdate", "Ratio4434SinceLastUpdate",1,0,1); | |
307 | histo1D->GetXaxis()->SetTitle("Event number"); | |
308 | histo1D->GetYaxis()->SetTitle("ratio 44/34"); | |
309 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate, expert, !image, !saveCorr); | |
310 | } | |
c39cf12d | 311 | |
b71c3d2d | 312 | histo1D = new TH1F("hTriggerErrorLocal2RegionalLPtLSB", "ErrorLocal2RegionalLPtLSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 313 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
314 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 315 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocal2RegionalLPtLSB, expert, !image, !saveCorr); |
a026ce9e | 316 | |
b71c3d2d | 317 | histo1D = new TH1F("hTriggerErrorLocal2RegionalLPtMSB", "ErrorLocal2RegionalLPtMSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 318 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
319 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 320 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocal2RegionalLPtMSB, expert, !image, !saveCorr); |
a026ce9e | 321 | |
b71c3d2d | 322 | histo1D = new TH1F("hTriggerErrorLocal2RegionalHPtLSB", "ErrorLocal2RegionalHPtLSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 323 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
324 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 325 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocal2RegionalHPtLSB, expert, !image, !saveCorr); |
a026ce9e | 326 | |
b71c3d2d | 327 | histo1D = new TH1F("hTriggerErrorLocal2RegionalHPtMSB", "ErrorLocal2RegionalHPtMSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 328 | histo1D->GetXaxis()->SetTitle(boardName.Data()); |
329 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
6482f70b | 330 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocal2RegionalHPtMSB, expert, !image, !saveCorr); |
a026ce9e | 331 | |
b71c3d2d | 332 | histo1D = new TH1F("hTriggerErrorOutGlobalFromInGlobal", "ErrorOutGlobalFromInGlobal",6,-0.5,6-0.5); |
a026ce9e | 333 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); |
ece56eb9 | 334 | for (int ibin=0;ibin<6;ibin++){ |
a026ce9e | 335 | histo1D->GetXaxis()->SetBinLabel(ibin+1,globalXaxisName[ibin]); |
ece56eb9 | 336 | } |
6482f70b | 337 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorOutGlobalFromInGlobal, expert, !image, !saveCorr); |
ece56eb9 | 338 | |
b71c3d2d | 339 | histo1D = new TH1F("hTriggerErrorOutGlobalFromInLocal", "ErrorOutGlobalFromInLocal",6,-0.5,6-0.5); |
c39cf12d | 340 | histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data()); |
341 | for (int ibin=0;ibin<6;ibin++){ | |
342 | histo1D->GetXaxis()->SetBinLabel(ibin+1,globalXaxisName[ibin]); | |
343 | } | |
344 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorOutGlobalFromInLocal, expert, !image, !saveCorr); | |
345 | ||
6482f70b | 346 | TH1F* histoAlgoErr = new TH1F("hTriggerAlgoNumOfErrors", "Trigger Algorithm total errors",AliMUONQAIndices::kNtrigAlgoErrorBins,-0.5,(Float_t)AliMUONQAIndices::kNtrigAlgoErrorBins-0.5); |
a026ce9e | 347 | histoAlgoErr->GetYaxis()->SetTitle("Number of events with errors"); |
6482f70b | 348 | for (int ibin=0;ibin<AliMUONQAIndices::kNtrigAlgoErrorBins;ibin++){ |
a026ce9e | 349 | histoAlgoErr->GetXaxis()->SetBinLabel(ibin+1,allLevelXaxisName[ibin]); |
ece56eb9 | 350 | } |
a026ce9e | 351 | histoAlgoErr->SetFillColor(kBlue); |
352 | // Copy of previous histo for scaling purposes | |
353 | TH1F* histoAlgoErrNorm = (TH1F*)histoAlgoErr->Clone("hTriggerAlgoErrors"); | |
354 | histoAlgoErrNorm->SetOption("bar2"); | |
355 | histoAlgoErrNorm->SetTitle("Trigger algorithm errors"); | |
356 | histoAlgoErrNorm->GetYaxis()->SetTitle("% of events with errors"); | |
357 | // Adding both histos after cloning to avoid problems with the expert bit | |
6482f70b | 358 | Add2RawsList(histoAlgoErr, AliMUONQAIndices::kTriggerErrorSummary, expert, !image, !saveCorr); |
359 | Add2RawsList(histoAlgoErrNorm, AliMUONQAIndices::kTriggerErrorSummaryNorm, !expert, image, !saveCorr); | |
ece56eb9 | 360 | |
b71c3d2d | 361 | histo1D = new TH1F("hTriggerTriggeredBoards", "Triggered boards", nbLocalBoard, 0.5, (Float_t)nbLocalBoard + 0.5); |
6482f70b | 362 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggeredBoards, expert, !image, !saveCorr); |
a026ce9e | 363 | |
b71c3d2d | 364 | histo2D = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hTriggerFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards, |
a026ce9e | 365 | 0, 0, "Local board triggers / event"); |
366 | histo2D->SetOption("COLZ"); | |
6482f70b | 367 | Add2RawsList(histo2D, AliMUONQAIndices::kTriggerBoardsDisplay, expert, !image, !saveCorr); |
a026ce9e | 368 | |
b71c3d2d | 369 | TH1F* histoYCopyErr = new TH1F("hTriggerErrorLocalYCopy", "Number of YCopy errors",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
a026ce9e | 370 | histoYCopyErr->GetXaxis()->SetTitle(boardName.Data()); |
371 | histoYCopyErr->GetYaxis()->SetTitle(errorAxisTitle.Data()); | |
372 | // Copy of previous histo for scaling purposes | |
b71c3d2d | 373 | TH1F* histoYCopyErrTest = (TH1F*)histoYCopyErr->Clone("hTriggerErrorLocalYCopyTest"); |
a026ce9e | 374 | histoYCopyErrTest->SetTitle("Number of YCopy tested"); |
375 | // Copy of previous histo for scaling purposes | |
b71c3d2d | 376 | TH1F* histoYCopyErrNorm = (TH1F*)histoYCopyErr->Clone("hTriggerErrorLocalYCopyNorm"); |
a026ce9e | 377 | histoYCopyErrNorm->SetTitle("% of YCopy errors"); |
378 | // Adding both histos after cloning to avoid problems with the expert bit | |
6482f70b | 379 | Add2RawsList(histoYCopyErr, AliMUONQAIndices::kTriggerErrorLocalYCopy, expert, !image, !saveCorr); |
380 | Add2RawsList(histoYCopyErrTest, AliMUONQAIndices::kTriggerErrorLocalYCopyTest, expert, !image, !saveCorr); | |
381 | Add2RawsList(histoYCopyErrNorm, AliMUONQAIndices::kTriggerErrorLocalYCopyNorm, expert, !image, !saveCorr); | |
a026ce9e | 382 | |
6482f70b | 383 | TH1F* histoROerr = new TH1F("hTriggerReadoutNumOfErrors","Trigger Read-Out total errors", AliMUONQAIndices::kNtrigStructErrorBins, -0.5, (Float_t)AliMUONQAIndices::kNtrigStructErrorBins-0.5); |
a026ce9e | 384 | histoROerr->GetYaxis()->SetTitle("Fraction of errors"); |
385 | histoROerr->SetFillColor(kBlue); | |
6482f70b | 386 | for (int ibin=0;ibin<AliMUONQAIndices::kNtrigStructErrorBins;ibin++){ |
a026ce9e | 387 | histoROerr->GetXaxis()->SetBinLabel(ibin+1,readoutErrNames[ibin]); |
ece56eb9 | 388 | } |
a026ce9e | 389 | // Copy of previous histo for scaling purposes |
390 | TH1F* histoROerrNorm = (TH1F*)histoROerr->Clone("hTriggerReadoutErrors"); | |
391 | histoROerrNorm->SetTitle("Trigger Read-Out errors"); | |
392 | histoROerrNorm->SetOption("bar2"); | |
393 | histoROerrNorm->GetYaxis()->SetTitle("% of errors per event"); | |
394 | // Adding both histos after cloning to avoid problems with the expert bit | |
6482f70b | 395 | Add2RawsList(histoROerr, AliMUONQAIndices::kTriggerReadOutErrors, expert, !image, !saveCorr); |
396 | Add2RawsList(histoROerrNorm, AliMUONQAIndices::kTriggerReadOutErrorsNorm, !expert, image, !saveCorr); | |
a026ce9e | 397 | |
398 | TH1F* histoGlobalMult = new TH1F("hTriggerGlobalOutMultiplicity","Trigger global outputs multiplicity", 6, -0.5, 6.-0.5); | |
399 | histoGlobalMult->GetYaxis()->SetTitle("Number of triggers"); | |
400 | histoGlobalMult->GetXaxis()->SetTitle("Global output"); | |
ece56eb9 | 401 | for (int ibin=0;ibin<6;ibin++){ |
a026ce9e | 402 | histoGlobalMult->GetXaxis()->SetBinLabel(ibin+1,globalXaxisName[ibin]); |
ece56eb9 | 403 | } |
a026ce9e | 404 | histoGlobalMult->SetFillColor(kBlue); |
405 | // Copy of previous histo for scaling purposes | |
406 | TH1F* histoGlobalMultNorm = (TH1F*)histoGlobalMult->Clone("hTriggerGlobalOutMultiplicityPerEvt"); | |
407 | histoGlobalMultNorm->SetTitle("Trigger global outputs multiplicity per event"); | |
408 | histoGlobalMultNorm->SetOption("bar2"); | |
409 | histoGlobalMultNorm->SetBarWidth(0.5); | |
410 | histoGlobalMultNorm->SetBarOffset(0.25); | |
411 | histoGlobalMultNorm->GetYaxis()->SetTitle("Triggers per event"); | |
412 | // Adding both histos after cloning to avoid problems with the expert bit | |
6482f70b | 413 | Add2RawsList(histoGlobalMult, AliMUONQAIndices::kTriggerGlobalOutput, expert, !image, !saveCorr); |
414 | Add2RawsList(histoGlobalMultNorm, AliMUONQAIndices::kTriggerGlobalOutputNorm, expert, !image, !saveCorr); | |
a026ce9e | 415 | |
b71c3d2d | 416 | histo1D = new TH1F("hTriggerRawNAnalyzedEvents", "Number of analyzed events per specie", 1, 0.5, 1.5); |
a026ce9e | 417 | Int_t esindex = AliRecoParam::AConvert(CurrentEventSpecie()); |
418 | histo1D->GetXaxis()->SetBinLabel(1, AliRecoParam::GetEventSpecieName(esindex)); | |
419 | histo1D->GetYaxis()->SetTitle("Number of analyzed events"); | |
6482f70b | 420 | Add2RawsList(histo1D, AliMUONQAIndices::kTriggerRawNAnalyzedEvents, expert, !image, !saveCorr); |
c39cf12d | 421 | |
b71c3d2d | 422 | fNumberOf34Dec = new TH1F("hTriggerNumberOf34Dec", "hNumberOf34Dec",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
3e42c3a7 | 423 | fNumberOf34Dec->SetDirectory(0); // Detach histo from file to avoid double delete |
b71c3d2d | 424 | fNumberOf44Dec = new TH1F("hTriggerNumberOf44Dec", "hNumberOf44Dec",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5); |
3e42c3a7 | 425 | fNumberOf44Dec->SetDirectory(0); // Detach histo from file to avoid double delete |
ece56eb9 | 426 | } |
427 | ||
428 | //__________________________________________________________________ | |
429 | void AliMUONTriggerQADataMakerRec::InitDigits() | |
430 | { | |
431 | /// Initialized Digits spectra | |
432 | const Bool_t expert = kTRUE ; | |
433 | const Bool_t image = kTRUE ; | |
434 | ||
b71c3d2d | 435 | TH1I* h0 = new TH1I("hTriggerDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 400, 1100, 1500); |
ece56eb9 | 436 | Add2DigitsList(h0, 0, !expert, image); |
437 | } | |
438 | ||
439 | //____________________________________________________________________________ | |
440 | void AliMUONTriggerQADataMakerRec::InitRecPoints() | |
441 | { | |
442 | /// create Reconstructed Points histograms in RecPoints subdir for the | |
443 | /// MUON Trigger subsystem. | |
444 | ||
445 | const Bool_t expert = kTRUE ; | |
446 | const Bool_t image = kTRUE ; | |
447 | ||
448 | TH1F* histo1D = 0x0; | |
449 | ||
b71c3d2d | 450 | histo1D = new TH1F("hTriggerNAnalyzedEvents", "Number of analyzed events per specie", 1, 0.5, 1.5); |
ece56eb9 | 451 | Int_t esindex = AliRecoParam::AConvert(CurrentEventSpecie()); |
452 | histo1D->GetXaxis()->SetBinLabel(1, AliRecoParam::GetEventSpecieName(esindex)); | |
453 | histo1D->GetYaxis()->SetTitle("Number of analyzed events"); | |
6482f70b | 454 | Add2RecPointsList(histo1D, AliMUONQAIndices::kTriggerNAnalyzedEvents, expert, !image); |
ece56eb9 | 455 | |
456 | histo1D = new TH1F("hTriggerTrippedChambers", "Trigger RPCs in trip", 418, 1100-0.5, 1417+0.5); | |
457 | histo1D->GetXaxis()->SetTitle("DetElemId"); | |
458 | histo1D->GetYaxis()->SetTitle("# of trips"); | |
459 | histo1D->SetFillColor(kRed); | |
460 | histo1D->SetLineColor(kRed); | |
6482f70b | 461 | Add2RecPointsList(histo1D, AliMUONQAIndices::kTriggerRPCtrips, !expert, image); |
ece56eb9 | 462 | |
463 | FillTriggerDCSHistos(); | |
464 | } | |
465 | ||
466 | ||
467 | //____________________________________________________________________________ | |
468 | void AliMUONTriggerQADataMakerRec::InitESDs() | |
469 | { | |
3e1866ad | 470 | /// Empty implementation |
ece56eb9 | 471 | } |
472 | ||
473 | //____________________________________________________________________________ | |
474 | void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader) | |
475 | { | |
476 | /// make QA for rawdata trigger | |
a026ce9e | 477 | |
478 | AliCodeTimerAuto("",0); | |
ece56eb9 | 479 | |
ece56eb9 | 480 | // Init Local/Regional/Global decision with fake values |
ece56eb9 | 481 | |
a026ce9e | 482 | UInt_t globalInput[4]; |
483 | for (Int_t bit=0; bit<4; bit++){ | |
484 | globalInput[bit]=0; | |
ece56eb9 | 485 | } |
486 | ||
a026ce9e | 487 | //for (Int_t reg=0;reg<16;reg++){ |
488 | //fTriggerOutputRegionalData[reg]=0; | |
489 | //for (Int_t bit=0;bit<4;bit++){ | |
490 | //fTriggerInputGlobalDataLPt[reg][bit]=0; | |
491 | //fTriggerInputGlobalDataHPt[reg][bit]=0; | |
492 | //} | |
493 | //} | |
ece56eb9 | 494 | |
495 | AliMUONDigitStoreV2R digitStore; | |
ece56eb9 | 496 | |
497 | AliMUONDigitStoreV2R digitStoreAll; | |
ece56eb9 | 498 | TArrayS xyPatternAll[2]; |
499 | for(Int_t icath=0; icath<AliMpConstants::NofCathodes(); icath++){ | |
500 | xyPatternAll[icath].Set(AliMpConstants::NofTriggerChambers()); | |
501 | xyPatternAll[icath].Reset(1); | |
502 | } | |
503 | ||
a026ce9e | 504 | AliMUONTriggerStoreV1 recoTriggerStore; |
ece56eb9 | 505 | |
a026ce9e | 506 | AliMUONTriggerStoreV1 inputTriggerStore; |
a026ce9e | 507 | |
508 | AliMUONGlobalTrigger inputGlobalTrigger; | |
ece56eb9 | 509 | |
510 | UShort_t maxNcounts = 0xFFFF; | |
511 | ||
512 | // Get trigger Local, Regional, Global in/outputs and scalers | |
513 | ||
514 | Int_t loCircuit=0; | |
515 | AliMpCDB::LoadDDLStore(); | |
516 | ||
517 | const AliMUONRawStreamTriggerHP::AliHeader* darcHeader = 0x0; | |
518 | const AliMUONRawStreamTriggerHP::AliRegionalHeader* regHeader = 0x0; | |
519 | const AliMUONRawStreamTriggerHP::AliLocalStruct* localStruct = 0x0; | |
520 | ||
521 | Int_t nDeadLocal = 0, nDeadRegional = 0, nDeadGlobal = 0, nNoisyStrips = 0; | |
522 | ||
523 | // When a crate is not present, the loop on boards is not performed | |
524 | // This should allow to correctly count the local boards | |
525 | Int_t countNotifiedBoards = 0, countAllBoards = 0; | |
526 | ||
3e42c3a7 | 527 | Bool_t containTriggerData = kFALSE; |
ece56eb9 | 528 | AliMUONRawStreamTriggerHP rawStreamTrig(rawReader); |
529 | while (rawStreamTrig.NextDDL()) | |
530 | { | |
3e42c3a7 | 531 | containTriggerData = kTRUE; |
532 | ||
ece56eb9 | 533 | Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1; |
534 | ||
535 | Bool_t fillScalerHistos = ( scalerEvent && | |
536 | ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) ); | |
537 | ||
538 | if ( scalerEvent != fillScalerHistos ) { | |
539 | Int_t esindex = AliRecoParam::AConvert(CurrentEventSpecie()); | |
540 | AliWarning(Form("Scaler event found but event specie is %s. Scaler histos will not be filled", AliRecoParam::GetEventSpecieName(esindex))); | |
541 | } | |
542 | ||
543 | darcHeader = rawStreamTrig.GetHeaders(); | |
544 | ||
545 | if (darcHeader->GetGlobalFlag()){ | |
546 | if ( fillScalerHistos ) { | |
547 | UInt_t nOfClocks = darcHeader->GetGlobalClock(); | |
548 | Double_t nOfSeconds = ((Double_t) nOfClocks) / 40e6; // 1 clock each 25 ns | |
6482f70b | 549 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerScalersTime))->Fill(1., nOfSeconds); |
ece56eb9 | 550 | } |
551 | ||
552 | //Get Global datas | |
a026ce9e | 553 | inputGlobalTrigger.SetFromGlobalResponse(darcHeader->GetGlobalOutput()); |
554 | Bool_t resp[6] = {inputGlobalTrigger.PairUnlikeHpt(), inputGlobalTrigger.PairUnlikeLpt(), | |
555 | inputGlobalTrigger.PairLikeHpt(), inputGlobalTrigger.PairLikeLpt(), | |
3e42c3a7 | 556 | inputGlobalTrigger.SingleHpt(), inputGlobalTrigger.SingleLpt()}; |
a026ce9e | 557 | for (Int_t bit=0; bit<6; bit++){ |
558 | if ( ! resp[bit] ){ | |
559 | if ( fillScalerHistos ) | |
560 | nDeadGlobal++; | |
561 | } | |
562 | else | |
6482f70b | 563 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerGlobalOutput))->Fill(bit); |
ece56eb9 | 564 | } |
565 | ||
a026ce9e | 566 | //for (Int_t Bit=0; Bit<32; Bit++){ |
567 | //fTriggerInputGlobalDataLPt[Bit/4][Bit%4]=((darcHeader->GetGlobalInput(0)>>Bit)&1); | |
568 | //fTriggerInputGlobalDataLPt[Bit/4+8][Bit%4]=((darcHeader->GetGlobalInput(1)>>Bit)&1); | |
569 | //fTriggerInputGlobalDataHPt[Bit/4][Bit%4]=((darcHeader->GetGlobalInput(2)>>Bit)&1); | |
570 | //fTriggerInputGlobalDataHPt[Bit/4+8][Bit%4]=((darcHeader->GetGlobalInput(3)>>Bit)&1); | |
571 | //} | |
572 | ||
573 | for (Int_t i=0; i<4; i++){ | |
574 | globalInput[i]=darcHeader->GetGlobalInput(i); | |
575 | } | |
ece56eb9 | 576 | } |
577 | ||
578 | Int_t nReg = rawStreamTrig.GetRegionalHeaderCount(); | |
579 | ||
580 | for(Int_t iReg = 0; iReg < nReg ;iReg++) | |
581 | { //reg loop | |
582 | ||
a026ce9e | 583 | //Int_t regId=rawStreamTrig.GetDDL()*8+iReg; |
ece56eb9 | 584 | |
585 | // crate info | |
586 | AliMpTriggerCrate* crate = AliMpDDLStore::Instance()->GetTriggerCrate(rawStreamTrig.GetDDL(), iReg); | |
587 | ||
588 | regHeader = rawStreamTrig.GetRegionalHeader(iReg); | |
589 | ||
a026ce9e | 590 | //Get regional outputs -> not checked, hardware read-out doesn't work |
591 | //fTriggerOutputRegionalData[regId]=Int_t(regHeader->GetOutput()); | |
592 | // if ( ! fTriggerOutputRegionalData[regId] ) | |
593 | // nDeadRegional++; | |
ece56eb9 | 594 | Int_t nBoardsInReg = 0; // Not necessary when regional output will work |
595 | ||
596 | // loop over local structures | |
597 | Int_t nLocal = regHeader->GetLocalStructCount(); | |
598 | ||
599 | for(Int_t iLocal = 0; iLocal < nLocal; iLocal++) | |
600 | { | |
601 | ||
602 | localStruct = regHeader->GetLocalStruct(iLocal); | |
603 | ||
604 | // if card exist | |
605 | if (!localStruct) continue; | |
606 | ||
607 | loCircuit = crate->GetLocalBoardId(localStruct->GetId()); | |
608 | ||
609 | if ( !loCircuit ) continue; // empty slot | |
610 | ||
611 | AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false); | |
612 | ||
613 | nBoardsInReg++; // Not necessary when regional output will work | |
614 | countAllBoards++; | |
615 | ||
616 | // skip copy cards | |
617 | if( !localBoard->IsNotified()) | |
618 | continue; | |
619 | ||
a026ce9e | 620 | AliMUONLocalTrigger inputLocalTrigger; |
621 | inputLocalTrigger.SetLocalStruct(loCircuit, *localStruct); | |
622 | inputTriggerStore.Add(inputLocalTrigger); | |
623 | ||
ece56eb9 | 624 | countNotifiedBoards++; |
625 | ||
626 | TArrayS xyPattern[2]; | |
627 | localStruct->GetXPattern(xyPattern[0]); | |
628 | localStruct->GetYPattern(xyPattern[1]); | |
629 | fDigitMaker->TriggerDigits(loCircuit, xyPattern, digitStore); | |
630 | if ( fillScalerHistos ) // Compute total number of strips | |
631 | fDigitMaker->TriggerDigits(loCircuit, xyPatternAll, digitStoreAll); | |
632 | ||
ece56eb9 | 633 | //Get electronic Decisions from data |
634 | ||
635 | //Get regional inputs -> not checked, hardware read-out doesn't work | |
a026ce9e | 636 | //fTriggerInputRegionalDataLPt[0][loCircuit]=Int_t(((regHeader->GetInput(0))>>(2*iLocal))&1); |
637 | //fTriggerInputRegionalDataLPt[1][loCircuit]=Int_t(((regHeader->GetInput(1))>>((2*iLocal)+1))&1); | |
ece56eb9 | 638 | |
639 | //Get local in/outputs | |
640 | if (Int_t(localStruct->GetDec())!=0){ | |
6482f70b | 641 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggeredBoards))->Fill(loCircuit); |
ece56eb9 | 642 | } |
643 | else if ( fillScalerHistos ){ | |
644 | nDeadLocal++; | |
645 | } | |
ece56eb9 | 646 | |
647 | // loop over strips | |
a026ce9e | 648 | if ( fillScalerHistos ) { |
649 | Int_t cathode = localStruct->GetComptXY()%2; | |
650 | for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) { | |
651 | if (ibitxy==0){ | |
652 | AliDebug(AliQAv1::GetQADebugLevel(),"Filling trigger scalers"); | |
653 | } | |
654 | ||
655 | UShort_t scalerVal[4] = { | |
656 | localStruct->GetXY1(ibitxy), | |
657 | localStruct->GetXY2(ibitxy), | |
658 | localStruct->GetXY3(ibitxy), | |
659 | localStruct->GetXY4(ibitxy) | |
660 | }; | |
661 | ||
662 | for(Int_t ich=0; ich<AliMpConstants::NofTriggerChambers(); ich++){ | |
663 | if ( scalerVal[ich] > 0 ) | |
6482f70b | 664 | ((TH2F*)GetRawsData(AliMUONQAIndices::kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + ich)) |
a026ce9e | 665 | ->Fill(loCircuit, ibitxy, 2*(Float_t)scalerVal[ich]); |
666 | ||
667 | if ( scalerVal[ich] >= maxNcounts ) | |
668 | nNoisyStrips++; | |
669 | } // loop on chamber | |
670 | } // loop on strips | |
671 | } // scaler event | |
ece56eb9 | 672 | } // iLocal |
673 | if ( nBoardsInReg == 0 ) | |
674 | nDeadRegional++; // Not necessary when regional output will work | |
675 | } // iReg | |
676 | ||
6482f70b | 677 | Float_t readoutErrors[AliMUONQAIndices::kNtrigStructErrorBins] = { |
ece56eb9 | 678 | ((Float_t)rawStreamTrig.GetLocalEoWErrors())/((Float_t)countAllBoards), |
679 | ((Float_t)rawStreamTrig.GetRegEoWErrors())/16., | |
680 | ((Float_t)rawStreamTrig.GetGlobalEoWErrors())/6., | |
681 | ((Float_t)rawStreamTrig.GetDarcEoWErrors())/2. | |
682 | }; | |
683 | ||
6482f70b | 684 | for (Int_t ibin=0; ibin<AliMUONQAIndices::kNtrigStructErrorBins; ibin++){ |
ece56eb9 | 685 | if ( readoutErrors[ibin] > 0 ) |
6482f70b | 686 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerReadOutErrors))->Fill(ibin, readoutErrors[ibin]); |
ece56eb9 | 687 | } |
688 | } // NextDDL | |
689 | ||
3e42c3a7 | 690 | if ( ! containTriggerData ) return; |
691 | GetRawsData(AliMUONQAIndices::kTriggerRawNAnalyzedEvents)->Fill(1.); | |
692 | ||
ece56eb9 | 693 | nDeadLocal += AliMUONConstants::NTriggerCircuit() - countNotifiedBoards; |
694 | Int_t nStripsTot = digitStoreAll.GetSize(); | |
695 | if ( nStripsTot > 0 ) { // The value is != 0 only for scaler events | |
6482f70b | 696 | Float_t fraction[AliMUONQAIndices::kNtrigCalibSummaryBins] = { |
ece56eb9 | 697 | ((Float_t)(nStripsTot - digitStore.GetSize())) / ((Float_t)nStripsTot), |
698 | //(Float_t)nDeadLocal / ((Float_t)countNotifiedBoards), | |
699 | (Float_t)nDeadLocal / ((Float_t)AliMUONConstants::NTriggerCircuit()), | |
700 | (Float_t)nDeadRegional / 16., | |
701 | (Float_t)nDeadGlobal / 6., // Number of bits of global response | |
702 | (Float_t)nNoisyStrips / ((Float_t)nStripsTot), | |
703 | }; | |
704 | ||
6482f70b | 705 | for(Int_t ibin = 0; ibin < AliMUONQAIndices::kNtrigCalibSummaryBins; ibin++){ |
ece56eb9 | 706 | if ( fraction[ibin] > 0. ) |
6482f70b | 707 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerCalibSummary))->Fill(ibin, fraction[ibin]); |
ece56eb9 | 708 | } |
709 | } | |
710 | ||
a026ce9e | 711 | fTriggerProcessor->Digits2Trigger(digitStore,recoTriggerStore); |
ece56eb9 | 712 | |
c39cf12d | 713 | AliMUONGlobalTrigger* recoGlobalTriggerFromLocal; |
714 | recoGlobalTriggerFromLocal = recoTriggerStore.Global(); | |
715 | ||
a026ce9e | 716 | //Reconstruct Global decision from Global inputs |
717 | UChar_t recoResp = RawTriggerInGlobal2OutGlobal(globalInput); | |
c39cf12d | 718 | AliMUONGlobalTrigger recoGlobalTriggerFromGlobal; |
719 | recoGlobalTriggerFromGlobal.SetFromGlobalResponse(recoResp); | |
ece56eb9 | 720 | |
a026ce9e | 721 | // Compare data and reconstructed decisions and fill histos |
722 | RawTriggerMatchOutLocal(inputTriggerStore, recoTriggerStore); | |
c39cf12d | 723 | //Fill ratio 44/34 histos |
25bf7c78 | 724 | FillRatio4434Histos(fgkUpdateRatio4434); |
a026ce9e | 725 | //RawTriggerMatchOutLocalInRegional(); // Not tested, hardware read-out doesn't work |
c39cf12d | 726 | RawTriggerMatchOutGlobal(inputGlobalTrigger, recoGlobalTriggerFromGlobal, 'G'); |
727 | // Global, reconstruction from Local inputs: compare data and reconstructed decisions and fill histos | |
728 | RawTriggerMatchOutGlobal(inputGlobalTrigger, *recoGlobalTriggerFromLocal, 'L'); | |
729 | // Global, reconstruction from Global inputs: compare data and reconstructed decisions and fill histos | |
ece56eb9 | 730 | } |
731 | ||
732 | //__________________________________________________________________ | |
733 | void AliMUONTriggerQADataMakerRec::MakeDigits(TTree* digitsTree) | |
734 | { | |
735 | /// makes data from Digits | |
736 | ||
737 | // Do nothing in case of calibration event | |
738 | if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return; | |
739 | ||
740 | if (!fDigitStore) | |
741 | fDigitStore = AliMUONVDigitStore::Create(*digitsTree); | |
742 | ||
743 | fDigitStore->Clear(); | |
744 | fDigitStore->Connect(*digitsTree, false); | |
745 | digitsTree->GetEvent(0); | |
746 | ||
747 | TIter next(fDigitStore->CreateIterator()); | |
748 | ||
749 | AliMUONVDigit* dig = 0x0; | |
750 | ||
751 | while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) ) | |
752 | { | |
753 | GetDigitsData(0)->Fill(dig->DetElemId()); | |
ece56eb9 | 754 | } |
755 | } | |
756 | ||
757 | //____________________________________________________________________________ | |
758 | void AliMUONTriggerQADataMakerRec::MakeRecPoints(TTree* /*clustersTree*/) | |
759 | { | |
bd47a7f7 | 760 | /// Fill histogram with total number of analyzed events for normalization purposes |
761 | ||
ece56eb9 | 762 | // Do nothing in case of calibration event |
763 | if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return; | |
764 | ||
6482f70b | 765 | GetRecPointsData(AliMUONQAIndices::kTriggerNAnalyzedEvents)->Fill(1.); |
ece56eb9 | 766 | } |
767 | ||
768 | //____________________________________________________________________________ | |
769 | void AliMUONTriggerQADataMakerRec::MakeESDs(AliESDEvent* /*esd*/) | |
770 | { | |
3e1866ad | 771 | /// Empty implementation |
ece56eb9 | 772 | } |
773 | ||
774 | ||
775 | //____________________________________________________________________________ | |
776 | void AliMUONTriggerQADataMakerRec::DisplayTriggerInfo() | |
777 | { | |
778 | // | |
779 | /// Display trigger information in a user-friendly way: | |
780 | /// from local board and strip numbers to their position on chambers | |
781 | // | |
782 | ||
783 | AliMUONTriggerDisplay triggerDisplay; | |
784 | ||
785 | TH2F* histoStrips=0x0; | |
786 | TH2F* histoDisplayStrips=0x0; | |
6482f70b | 787 | if ( GetRawsData(AliMUONQAIndices::kTriggerScalers) ) { |
ece56eb9 | 788 | AliMUONTriggerDisplay::EDisplayOption displayOption = AliMUONTriggerDisplay::kNormalizeToArea; |
789 | for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++) | |
790 | { | |
791 | for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++) | |
792 | { | |
6482f70b | 793 | histoStrips = (TH2F*)GetRawsData(AliMUONQAIndices::kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber); |
ece56eb9 | 794 | |
795 | if(histoStrips->GetEntries()==0) continue; // No events found => No need to display | |
796 | ||
6482f70b | 797 | histoDisplayStrips = (TH2F*)GetRawsData(AliMUONQAIndices::kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber); |
ece56eb9 | 798 | |
799 | triggerDisplay.FillDisplayHistogram(histoStrips, histoDisplayStrips, | |
800 | AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber, displayOption); | |
801 | ||
6482f70b | 802 | Float_t scaleValue = ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerScalersTime))->GetBinContent(1); |
ece56eb9 | 803 | if(scaleValue>0.) histoDisplayStrips->Scale(1./scaleValue); |
804 | } // iChamber | |
805 | } // iCath | |
806 | } | |
807 | ||
6482f70b | 808 | if ( GetRawsData(AliMUONQAIndices::kTriggeredBoards) ){ |
809 | TH1F* histoBoards = (TH1F*)GetRawsData(AliMUONQAIndices::kTriggeredBoards); | |
810 | TH2F* histoDisplayBoards = (TH2F*)GetRawsData(AliMUONQAIndices::kTriggerBoardsDisplay); | |
ece56eb9 | 811 | triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0); |
6482f70b | 812 | Float_t scaleValue = GetRawsData(AliMUONQAIndices::kTriggerRawNAnalyzedEvents)->GetBinContent(1); |
ece56eb9 | 813 | if(scaleValue>0.) histoDisplayBoards->Scale(1./scaleValue); |
814 | } | |
815 | } | |
816 | ||
817 | ||
818 | //_____________________________________________________________________________ | |
819 | Bool_t | |
820 | AliMUONTriggerQADataMakerRec::FillTriggerDCSHistos() | |
821 | { | |
822 | /// Get HV and currents values for one trigger chamber | |
823 | ||
824 | AliCodeTimerAuto("",0); | |
825 | ||
826 | TMap* triggerDcsMap = fCalibrationData->TriggerDCS(); | |
827 | ||
828 | if ( !triggerDcsMap ) | |
829 | { | |
830 | AliError("Cannot fill DCS histos, as triggerDcsMap is NULL"); | |
831 | return kFALSE; | |
832 | } | |
833 | ||
834 | const Double_t kMaxDelay = 3.; | |
835 | const Double_t kMaxVariation = 25.; // Volts | |
836 | const Int_t kDefaultNpoints = 200; | |
837 | Double_t scaleFactor = 1./1000.; | |
838 | ||
839 | Bool_t error = kFALSE; | |
840 | Bool_t expert = kTRUE; | |
841 | Bool_t image = kTRUE; | |
842 | ||
843 | AliMpDEIterator deIt; | |
844 | ||
845 | AliMpDCSNamer triggerDcsNamer("TRIGGER"); | |
846 | ||
847 | TH2F* currHisto = 0x0; | |
848 | Int_t histoIndex = 0; | |
849 | TString histoName, histoTitle; | |
850 | ||
851 | TArrayD axisSlat(18+1); | |
852 | for(Int_t islat=0; islat<=18; islat++){ | |
853 | axisSlat[islat] = -0.5 + (Float_t)islat; | |
854 | } | |
855 | ||
856 | TArrayD axisTimeAux[4], axisTime[4], axisTimeDE(kDefaultNpoints); | |
857 | TArrayI index[4], npoints(4); | |
858 | ||
859 | // Build axis of times | |
860 | npoints.Reset(); | |
861 | for(Int_t ich=0; ich<4; ich++){ | |
862 | axisTimeAux[ich].Set(kDefaultNpoints); | |
863 | axisTimeAux[ich].Reset(-1.); | |
864 | } | |
865 | ||
866 | deIt.First(); | |
867 | while ( !deIt.IsDone() ) | |
868 | { | |
869 | Int_t detElemId = deIt.CurrentDEId(); | |
870 | TObjArray* values = GetDCSValues(AliMpDCSNamer::kDCSHV, detElemId, triggerDcsMap, triggerDcsNamer); | |
871 | ||
872 | if ( values ) { | |
873 | ||
874 | AliDebug(AliQAv1::GetQADebugLevel(), Form("DetElemId %i", detElemId)); | |
875 | ||
876 | axisTimeDE.Reset(-1.); | |
877 | ||
878 | TIter next(values); | |
879 | AliDCSValue* val = 0x0; | |
880 | Double_t previousVal = -999.; | |
881 | Int_t npointsde = 0; | |
882 | while ( ( val = static_cast<AliDCSValue*>(next()) ) ) | |
883 | { | |
884 | if ( npointsde + 1 > kDefaultNpoints ) { | |
885 | axisTimeDE.Set(npointsde + 1); | |
886 | } | |
887 | ||
888 | Double_t currVal = val->GetFloat(); | |
889 | Double_t currTime = (Double_t)val->GetTimeStamp(); | |
890 | if (npointsde > 0 ){ | |
891 | if ( TMath::Abs( currVal - previousVal ) < kMaxVariation && | |
892 | TMath::Abs( currTime - axisTimeDE[npointsde-1] ) < 40 ) continue; | |
893 | } | |
894 | ||
895 | axisTimeDE[npointsde] = currTime; | |
896 | previousVal = currVal; | |
897 | npointsde++; | |
898 | } // loop on values | |
899 | ||
900 | // AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding DE point %2i (%2i) %.2f (%i)\n", previousBin, npointsde, axisTimeDE[previousBin], nTimesPerBin)); | |
901 | ||
902 | Int_t iChamber = AliMpDEManager::GetChamberId(detElemId); | |
903 | Int_t ich = iChamber - AliMpConstants::NofTrackingChambers(); | |
904 | ||
905 | for(Int_t ipde=0; ipde<npointsde; ipde++){ | |
906 | ||
907 | if ( npoints[ich] + 1 > kDefaultNpoints ) { | |
908 | axisTimeAux[ich].Set(npoints[ich] + 1); | |
909 | } | |
910 | ||
911 | for(Int_t ipoint = 0; ipoint < axisTimeAux[ich].GetSize(); ipoint++){ | |
912 | if (axisTimeAux[ich][ipoint] < 0.) { | |
913 | axisTimeAux[ich][ipoint] = axisTimeDE[ipde]; | |
914 | npoints[ich]++; | |
915 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding point %2i %.0f\n", ipoint, axisTimeAux[ich][ipoint])); | |
916 | break; | |
917 | } | |
918 | if ( TMath::Abs( axisTimeDE[ipde] - axisTimeAux[ich][ipoint]) < kMaxDelay ) { | |
919 | axisTimeAux[ich][ipoint] = TMath::Min(axisTimeAux[ich][ipoint], axisTimeDE[ipde]); | |
920 | break; | |
921 | } | |
922 | } // loop on points | |
923 | } // loop on reorganized values | |
924 | ||
925 | } // if ( values ) | |
926 | deIt.Next(); | |
927 | } // loop on DetElemId | |
928 | ||
929 | for(Int_t ich=0; ich<4; ich++){ | |
930 | axisTimeAux[ich].Set(npoints[ich]); | |
931 | index[ich].Set(npoints[ich]); | |
932 | TMath::Sort(npoints[ich], axisTimeAux[ich].GetArray(), index[ich].GetArray(), kFALSE); | |
933 | ||
934 | axisTime[ich].Set(npoints[ich]+1); | |
935 | for(Int_t ipoint = 0; ipoint < axisTimeAux[ich].GetSize(); ipoint++){ | |
936 | axisTime[ich][ipoint] = axisTimeAux[ich][index[ich][ipoint]]; | |
937 | } | |
938 | Double_t minStartEndWidth = 0.1 * (axisTime[ich][npoints[ich]-1] - axisTime[ich][0]); | |
939 | axisTime[ich][npoints[ich]] = axisTime[ich][npoints[ich]-1] + minStartEndWidth; | |
940 | if ( npoints[ich] >= 1) | |
941 | if ( axisTime[ich][1] - axisTime[ich][0] < minStartEndWidth ) | |
942 | axisTime[ich][0] = axisTime[ich][1] - minStartEndWidth; | |
943 | } | |
944 | ||
945 | ||
946 | // Loop again on detection elements: create and fill histos | |
947 | deIt.First(); | |
948 | while ( !deIt.IsDone() ) | |
949 | { | |
950 | Int_t detElemId = deIt.CurrentDEId(); | |
951 | TObjArray* values = GetDCSValues(AliMpDCSNamer::kDCSHV, detElemId, triggerDcsMap, triggerDcsNamer); | |
952 | ||
953 | if ( values ) { | |
954 | Int_t iChamber = AliMpDEManager::GetChamberId(detElemId); | |
955 | Int_t ich = iChamber - AliMpConstants::NofTrackingChambers(); | |
956 | ||
6482f70b | 957 | histoIndex = AliMUONQAIndices::kTriggerRPChv + ich; |
b71c3d2d | 958 | histoName = Form("hTriggerRPCHVChamber%i", 11+ich); |
ece56eb9 | 959 | histoTitle = Form("Chamber %i: RPC HV (kV)", 11+ich); |
960 | ||
961 | currHisto = (TH2F*)GetRecPointsData(histoIndex); | |
962 | ||
963 | if(!currHisto){ | |
964 | currHisto = new TH2F(histoName.Data(), histoTitle.Data(), | |
965 | npoints[ich], axisTime[ich].GetArray(), | |
966 | 18, axisSlat.GetArray()); | |
967 | currHisto->GetXaxis()->SetTitle("Time"); | |
968 | currHisto->GetXaxis()->SetTimeDisplay(1); | |
969 | //currHisto->GetXaxis()->SetTimeFormat("%d%b%y %H:%M:%S"); | |
970 | currHisto->GetXaxis()->SetLabelSize(0.03); | |
971 | currHisto->GetYaxis()->SetTitle("RPC"); | |
972 | currHisto->SetOption("TEXT45COLZ"); | |
973 | Add2RecPointsList(currHisto, histoIndex, expert, !image); | |
974 | } | |
975 | ||
976 | Int_t slat = detElemId%100; | |
977 | Int_t slatBin = currHisto->GetYaxis()->FindBin(slat); | |
978 | ||
979 | TIter next(values); | |
980 | AliDCSValue* val = 0x0; | |
981 | Double_t sumValuesPerBin = 0.; | |
982 | Int_t nValuesPerBin = 0; | |
983 | Int_t previousBin = -1; | |
984 | Double_t previousTime = -1., previousVal = -999., sumVal = 0., sumTime = 0.; | |
985 | Bool_t isTrip = kFALSE; | |
986 | Int_t nPointsForSlope = 0; | |
987 | while ( ( val = static_cast<AliDCSValue*>(next()) ) ) | |
988 | { | |
989 | Double_t currTime = (Double_t)val->GetTimeStamp(); | |
990 | Int_t currentBin = currHisto->GetXaxis()->FindBin(currTime+0.5); | |
991 | Double_t currVal = val->GetFloat(); | |
992 | Double_t deltaVal = currVal - previousVal; | |
993 | Bool_t isRepeated = kFALSE; | |
994 | if ( previousTime > 0 ){ | |
995 | isRepeated = ( TMath::Abs( currVal - previousVal ) < kMaxVariation && | |
996 | TMath::Abs( currTime - previousTime ) < 40 ); | |
997 | ||
998 | // Check for trips | |
999 | sumTime += currTime - previousTime; | |
1000 | sumVal += deltaVal; | |
1001 | nPointsForSlope++; | |
1002 | ||
1003 | if ( sumTime > 0. && nPointsForSlope >= 3 ){ | |
1004 | Double_t slope = sumVal / sumTime; | |
1005 | if ( slope < -10. ) // going down of more than 10V/s | |
1006 | isTrip = kTRUE; | |
1007 | } | |
1008 | ||
1009 | if ( deltaVal * sumVal < 0. ) { | |
1010 | sumTime = 0.; | |
1011 | sumVal = 0.; | |
1012 | nPointsForSlope = 0; | |
1013 | } | |
1014 | } | |
1015 | ||
1016 | if ( ! isRepeated ) { | |
1017 | if ( currentBin != previousBin ) { | |
1018 | if ( previousBin >= 0 ) { | |
1019 | currHisto->SetBinContent(previousBin, slatBin, scaleFactor*sumValuesPerBin/((Double_t)nValuesPerBin)); | |
1020 | sumValuesPerBin = 0.; | |
1021 | nValuesPerBin = 0; | |
1022 | } | |
1023 | previousBin = currentBin; | |
1024 | } | |
1025 | } | |
1026 | ||
1027 | sumValuesPerBin += currVal; | |
1028 | nValuesPerBin++; | |
1029 | previousTime = currTime; | |
1030 | previousVal = currVal; | |
1031 | } // loop on values | |
1032 | currHisto->SetBinContent(previousBin, slatBin, scaleFactor*sumValuesPerBin/((Double_t)nValuesPerBin)); // Fill last value | |
6482f70b | 1033 | if ( isTrip ) ((TH1F*)GetRecPointsData(AliMUONQAIndices::kTriggerRPCtrips))->Fill(detElemId); |
ece56eb9 | 1034 | } // if ( values ) |
1035 | deIt.Next(); | |
1036 | } // loop on detElem | |
1037 | return error; | |
1038 | } | |
1039 | ||
1040 | ||
1041 | //____________________________________________________________________________ | |
1042 | TObjArray* | |
1043 | AliMUONTriggerQADataMakerRec::GetDCSValues(Int_t iMeas, Int_t detElemId, | |
1044 | TMap* triggerDcsMap, AliMpDCSNamer& triggerDcsNamer) | |
1045 | { | |
bd47a7f7 | 1046 | // |
1047 | /// Get values of DCS data points from the map | |
1048 | // | |
1049 | ||
ece56eb9 | 1050 | if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger) return 0x0; |
1051 | ||
1052 | TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas); | |
1053 | ||
1054 | TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data())); | |
1055 | ||
1056 | if (!triggerDcsPair) | |
1057 | { | |
213812e8 | 1058 | AliError(Form("Did not find expected alias (%s) for DE %d\n", |
1059 | currAlias.Data(),detElemId)); | |
ece56eb9 | 1060 | return 0x0; |
1061 | } | |
1062 | ||
1063 | TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value()); | |
1064 | if (!values) | |
1065 | { | |
213812e8 | 1066 | AliError(Form("Could not get values for alias %s\n",currAlias.Data())); |
ece56eb9 | 1067 | return 0x0; |
1068 | } | |
1069 | ||
1070 | return values; | |
1071 | } | |
1072 | ||
1073 | ||
1074 | //____________________________________________________________________________ | |
a026ce9e | 1075 | UChar_t AliMUONTriggerQADataMakerRec::RawTriggerInGlobal2OutGlobal(UInt_t globalInput[4]) |
ece56eb9 | 1076 | { |
1077 | // | |
1078 | /// Reconstruct Global Trigger decision using Global Inputs | |
1079 | // | |
1080 | ||
a026ce9e | 1081 | AliCodeTimerAuto("",0); |
1082 | ||
ece56eb9 | 1083 | AliMUONGlobalCrateConfig* globalConfig = fCalibrationData->GlobalTriggerCrateConfig(); |
1084 | ||
1085 | AliMUONGlobalTriggerBoard globalTriggerBoard; | |
1086 | globalTriggerBoard.Reset(); | |
1087 | for (Int_t i = 0; i < 4; i++) { | |
1088 | globalTriggerBoard.Mask(i,globalConfig->GetGlobalMask(i)); | |
1089 | } | |
1090 | ||
a026ce9e | 1091 | globalTriggerBoard.RecomputeRegional(globalInput); |
ece56eb9 | 1092 | globalTriggerBoard.Response(); |
a026ce9e | 1093 | return globalTriggerBoard.GetResponse(); |
ece56eb9 | 1094 | |
ece56eb9 | 1095 | } |
1096 | ||
1097 | //____________________________________________________________________________ | |
a026ce9e | 1098 | void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocal(AliMUONVTriggerStore& inputTriggerStore, |
1099 | AliMUONVTriggerStore& recoTriggerStore) | |
ece56eb9 | 1100 | { |
1101 | // | |
1102 | /// Match data and reconstructed Local Trigger decision | |
1103 | // | |
1104 | ||
a026ce9e | 1105 | AliCodeTimerAuto("",0); |
ece56eb9 | 1106 | |
a026ce9e | 1107 | Bool_t skipBoard[234]; |
1108 | memset(skipBoard,0,AliMUONConstants::NTriggerCircuit()*sizeof(Bool_t)); | |
ece56eb9 | 1109 | |
a026ce9e | 1110 | Bool_t errorInYCopy = kFALSE; |
1111 | ||
1112 | // First search for YCopy errors. | |
1113 | Int_t loCircuit = -1; | |
1114 | TIter next(recoTriggerStore.CreateLocalIterator()); | |
1115 | AliMUONLocalTrigger* recoLocalTrigger, *inputLocalTrigger; | |
1116 | while ( ( recoLocalTrigger = static_cast<AliMUONLocalTrigger*>(next()) ) ) | |
1117 | { | |
1118 | loCircuit = recoLocalTrigger->LoCircuit(); | |
1119 | Int_t iboard = loCircuit - 1; | |
1120 | ||
6482f70b | 1121 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorLocalYCopyTest))->Fill(loCircuit); |
a026ce9e | 1122 | |
1123 | inputLocalTrigger = inputTriggerStore.FindLocal(loCircuit); | |
1124 | ||
1125 | Int_t recoTrigPattern[4] = {recoLocalTrigger->GetY1Pattern(), recoLocalTrigger->GetY2Pattern(), recoLocalTrigger->GetY3Pattern(), recoLocalTrigger->GetY4Pattern()}; | |
1126 | Int_t inputTrigPattern[4] = {inputLocalTrigger->GetY1Pattern(), inputLocalTrigger->GetY2Pattern(), inputLocalTrigger->GetY3Pattern(), inputLocalTrigger->GetY4Pattern()}; | |
1127 | ||
1128 | AliMpLocalBoard* localBoardMp = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit); // get local board object for switch value | |
1129 | ||
1130 | Bool_t errorInCopyBoard = kFALSE; | |
1131 | for(Int_t ich=0; ich<4; ich++){ | |
1132 | if ( recoTrigPattern[ich] != inputTrigPattern[ich] ){ | |
1133 | skipBoard[iboard] = kTRUE; | |
1134 | if ( ich >=2 ){ | |
1135 | if ( localBoardMp->GetSwitch(AliMpLocalBoard::kOR0) ) | |
1136 | skipBoard[iboard+1] = kTRUE; | |
1137 | if ( localBoardMp->GetSwitch(AliMpLocalBoard::kOR1) ) | |
1138 | skipBoard[iboard-1] = kTRUE; | |
ece56eb9 | 1139 | } |
a026ce9e | 1140 | errorInCopyBoard = kTRUE; |
1141 | errorInYCopy = kTRUE; | |
1142 | } | |
1143 | } // loop on chambers | |
1144 | if ( errorInCopyBoard ) | |
6482f70b | 1145 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorLocalYCopy))->Fill(loCircuit); |
a026ce9e | 1146 | } // loop on local boards |
1147 | ||
1148 | if (errorInYCopy) | |
6482f70b | 1149 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorSummary))->Fill(AliMUONQAIndices::kAlgoLocalYCopy); |
a026ce9e | 1150 | |
1151 | Bool_t errorInXPosDev = kFALSE; | |
1152 | Bool_t errorInYPosTrigY = kFALSE; | |
1153 | Bool_t errorInLUT = kFALSE; | |
1154 | ||
1155 | next.Reset(); | |
c39cf12d | 1156 | Bool_t respBendPlane, respNonBendPlane; |
a026ce9e | 1157 | while ( ( recoLocalTrigger = static_cast<AliMUONLocalTrigger*>(next()) ) ) |
1158 | { | |
1159 | loCircuit = recoLocalTrigger->LoCircuit(); | |
1160 | Int_t iboard = loCircuit - 1; | |
1161 | ||
25bf7c78 | 1162 | // Fill ratio 44/34 histos (if not scaler event) |
1163 | if ( GetRecoParam()->GetEventSpecie() != AliRecoParam::kCalib ) { | |
1164 | Bool_t is34 = ( recoLocalTrigger->GetLoDecision() != 0 ); | |
1165 | Bool_t is44 = fTriggerProcessor->ModifiedLocalResponse(loCircuit, respBendPlane, respNonBendPlane, kTRUE); | |
1166 | if ( is34 ) fNumberOf34Dec->Fill(loCircuit); | |
1167 | if ( is44 ) fNumberOf44Dec->Fill(loCircuit); | |
1168 | ||
1169 | if ( is44 && ! is34 ) | |
1170 | AliWarning("Event satisfies the 4/4 conditions but not the 3/4"); | |
1171 | } | |
c39cf12d | 1172 | |
a026ce9e | 1173 | inputLocalTrigger = inputTriggerStore.FindLocal(loCircuit); |
1174 | ||
1175 | if ( recoLocalTrigger->LoStripX() != inputLocalTrigger->LoStripX() ) { | |
6482f70b | 1176 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorLocalXPos))->Fill(loCircuit); |
a026ce9e | 1177 | errorInXPosDev = kTRUE; |
1178 | } | |
1179 | ||
1180 | if ( recoLocalTrigger->GetDeviation() != inputLocalTrigger->GetDeviation() ) { | |
6482f70b | 1181 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorLocalDev))->Fill(loCircuit); |
a026ce9e | 1182 | errorInXPosDev = kTRUE; |
1183 | } | |
1184 | ||
2fffb5d2 | 1185 | // Skip following checks in case we previously found YCopy error and YPos or trigY errors |
1186 | if ( (!skipBoard[iboard]) || ( (recoLocalTrigger->LoStripY() == inputLocalTrigger->LoStripY()) && (recoLocalTrigger->LoTrigY() == inputLocalTrigger->LoTrigY())) ) { | |
1187 | ||
1188 | if ( recoLocalTrigger->GetLoDecision() != inputLocalTrigger->GetLoDecision() ) { | |
6482f70b | 1189 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorLocalTriggerDec))->Fill(loCircuit); |
2fffb5d2 | 1190 | } |
1191 | ||
1192 | // Test Hpt and LPT | |
1193 | Int_t recoLut[2] = { recoLocalTrigger->LoLpt(), recoLocalTrigger->LoHpt() }; | |
1194 | Int_t inputLut[2] = {inputLocalTrigger->LoLpt(), inputLocalTrigger->LoHpt() }; | |
6482f70b | 1195 | Int_t currIndex[2][2] = {{AliMUONQAIndices::kTriggerErrorLocalLPtLSB, AliMUONQAIndices::kTriggerErrorLocalLPtMSB}, |
1196 | {AliMUONQAIndices::kTriggerErrorLocalHPtMSB, AliMUONQAIndices::kTriggerErrorLocalHPtMSB}}; | |
2fffb5d2 | 1197 | for (Int_t ilut=0; ilut<2; ilut++){ |
1198 | Int_t bitDiff = recoLut[ilut]^inputLut[ilut]; | |
1199 | if ( bitDiff == 0 ) continue; | |
1200 | for (Int_t ibit=0; ibit<2; ibit++){ | |
1201 | Bool_t isBitDifferent = (bitDiff>>ibit)&1; | |
1202 | if ( isBitDifferent ){ | |
1203 | ((TH1F*)GetRawsData(currIndex[ilut][ibit]))->Fill(loCircuit); | |
1204 | errorInLUT = kTRUE; | |
1205 | } | |
1206 | } | |
ece56eb9 | 1207 | } |
a026ce9e | 1208 | } |
2fffb5d2 | 1209 | |
1210 | ||
1211 | // Skip following checks in case we previously found YCopy errors | |
1212 | if ( skipBoard[iboard] ) continue; | |
ece56eb9 | 1213 | |
a026ce9e | 1214 | if ( recoLocalTrigger->LoStripY() != inputLocalTrigger->LoStripY() ) { |
6482f70b | 1215 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorLocalYPos))->Fill(loCircuit); |
a026ce9e | 1216 | errorInYPosTrigY = kTRUE; |
1217 | } | |
1218 | ||
1219 | if ( recoLocalTrigger->LoTrigY() != inputLocalTrigger->LoTrigY() ) { | |
6482f70b | 1220 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorLocalTrigY))->Fill(loCircuit); |
a026ce9e | 1221 | errorInYPosTrigY = kTRUE; |
1222 | } | |
1223 | } // loop on local boards | |
1224 | ||
1225 | if (errorInXPosDev) | |
6482f70b | 1226 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorSummary))->Fill(AliMUONQAIndices::kAlgoLocalX); |
a026ce9e | 1227 | |
1228 | if (errorInLUT) | |
6482f70b | 1229 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorSummary))->Fill(AliMUONQAIndices::kAlgoLocalLUT); |
a026ce9e | 1230 | |
1231 | if (errorInYPosTrigY) | |
6482f70b | 1232 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorSummary))->Fill(AliMUONQAIndices::kAlgoLocalY); |
a026ce9e | 1233 | |
1234 | } | |
1235 | /* | |
ece56eb9 | 1236 | //____________________________________________________________________________ |
1237 | void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocalInRegional() | |
1238 | { | |
1239 | // | |
1240 | /// Match Local outputs and Regional inputs | |
1241 | /// Not tested, hardware read-out doesn't work | |
1242 | // | |
1243 | ||
1244 | for (int localId=1;localId<235;localId++){ | |
1245 | if(fTriggerOutputLocalDataLPtDec[0][localId]!=fTriggerInputRegionalDataLPt[0][localId]){ | |
1246 | ((TH1F*)GetRawsData(kTriggerErrorLocal2RegionalLPtLSB))->Fill(localId); | |
1247 | } | |
1248 | if(fTriggerOutputLocalDataLPtDec[1][localId]!=fTriggerInputRegionalDataLPt[1][localId]){ | |
1249 | ((TH1F*)GetRawsData(kTriggerErrorLocal2RegionalLPtMSB))->Fill(localId); | |
1250 | } | |
1251 | if(fTriggerOutputLocalDataHPtDec[0][localId]!=fTriggerInputRegionalDataHPt[0][localId]){ | |
1252 | ((TH1F*)GetRawsData(kTriggerErrorLocal2RegionalHPtLSB))->Fill(localId); | |
1253 | } | |
1254 | if(fTriggerOutputLocalDataHPtDec[1][localId]!=fTriggerInputRegionalDataHPt[1][localId]){ | |
1255 | ((TH1F*)GetRawsData(kTriggerErrorLocal2RegionalHPtMSB))->Fill(localId); | |
1256 | } | |
1257 | } | |
ece56eb9 | 1258 | } |
a026ce9e | 1259 | */ |
1260 | ||
ece56eb9 | 1261 | |
1262 | //____________________________________________________________________________ | |
c39cf12d | 1263 | void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutGlobal(AliMUONGlobalTrigger& inputGlobalTrigger, |
1264 | AliMUONGlobalTrigger& recoGlobalTrigger, | |
1265 | Char_t histo) | |
ece56eb9 | 1266 | { |
1267 | // | |
c39cf12d | 1268 | /// Match data and reconstructed Global Trigger decision for a reconstruction from Global inputs. |
1269 | /// histo='G': fill FromGlobalInput histo='F': fill from Local input; | |
ece56eb9 | 1270 | // |
1271 | ||
a026ce9e | 1272 | if ( recoGlobalTrigger.GetGlobalResponse() == inputGlobalTrigger.GetGlobalResponse() ) |
1273 | return; | |
c39cf12d | 1274 | Int_t histoToFill; |
1275 | Int_t binToFill; | |
1276 | ||
1277 | if (histo=='G'){ | |
1278 | histoToFill=AliMUONQAIndices::kTriggerErrorOutGlobalFromInGlobal; | |
1279 | binToFill=AliMUONQAIndices::kAlgoGlobalFromGlobal; | |
1280 | }else{ | |
1281 | if (histo=='L'){ | |
1282 | histoToFill=AliMUONQAIndices::kTriggerErrorOutGlobalFromInLocal; | |
1283 | binToFill=AliMUONQAIndices::kAlgoGlobalFromLocal; | |
1284 | }else{ | |
1285 | AliWarning(Form("Global histos not filled, 3rd argument must be 'G' or 'F'")); | |
1286 | return; | |
1287 | } | |
1288 | } | |
a026ce9e | 1289 | |
c39cf12d | 1290 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorSummary))->Fill(binToFill); |
a026ce9e | 1291 | |
1292 | Bool_t inputResp[6] = {inputGlobalTrigger.PairUnlikeHpt(), inputGlobalTrigger.PairUnlikeLpt(), | |
1293 | inputGlobalTrigger.PairLikeHpt(), inputGlobalTrigger.PairLikeLpt(), | |
3e42c3a7 | 1294 | inputGlobalTrigger.SingleHpt(), inputGlobalTrigger.SingleLpt()}; |
a026ce9e | 1295 | |
1296 | Bool_t recoResp[6] = {recoGlobalTrigger.PairUnlikeHpt(), recoGlobalTrigger.PairUnlikeLpt(), | |
1297 | recoGlobalTrigger.PairLikeHpt(), recoGlobalTrigger.PairLikeLpt(), | |
3e42c3a7 | 1298 | recoGlobalTrigger.SingleHpt(), recoGlobalTrigger.SingleLpt()}; |
ece56eb9 | 1299 | |
1300 | for (int bit=0;bit<6;bit++){ | |
a026ce9e | 1301 | if ( recoResp[bit] != inputResp[bit] ) |
c39cf12d | 1302 | ((TH1F*)GetRawsData(histoToFill))->Fill(bit); |
1303 | } | |
1304 | } | |
1305 | ||
1306 | //____________________________________________________________________________ | |
25bf7c78 | 1307 | void AliMUONTriggerQADataMakerRec::FillRatio4434Histos(Int_t evtInterval) |
c39cf12d | 1308 | { |
1309 | /// Fill ratio 44/34 histos | |
1310 | ||
1311 | Int_t numEvent = Int_t(((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRawNAnalyzedEvents))->GetBinContent(1)); | |
1312 | ||
25bf7c78 | 1313 | // Fill every fgkUpdateRatio4434 events |
1314 | if (numEvent % evtInterval != 0) | |
1315 | return; | |
c39cf12d | 1316 | |
25bf7c78 | 1317 | Float_t totalNumberOf44 = fNumberOf44Dec->GetSumOfWeights(); |
1318 | Float_t totalNumberOf34 = fNumberOf34Dec->GetSumOfWeights(); | |
c39cf12d | 1319 | |
25bf7c78 | 1320 | if ( totalNumberOf34 == 0 ) |
1321 | return; | |
c39cf12d | 1322 | |
25bf7c78 | 1323 | TH1F* histoAllEvents = (TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents); |
fa7e0953 | 1324 | if ( ! histoAllEvents ) return; |
25bf7c78 | 1325 | Int_t nbins = histoAllEvents->GetNbinsX(); |
1326 | Float_t maxBin = histoAllEvents->GetXaxis()->GetBinLowEdge(nbins+1); | |
1327 | ||
1328 | if ( numEvent - maxBin < 1) return; | |
1329 | ||
1330 | // Use the underflow and overflow to store the number of 34 and 44 | |
1331 | // in previous event | |
1332 | Float_t previousNumOf34 = histoAllEvents->GetBinContent(0); | |
1333 | Float_t previousNumOf44 = histoAllEvents->GetBinContent(nbins+1); | |
1334 | ||
1335 | Float_t numOf34Update = totalNumberOf34 - previousNumOf34; | |
1336 | Float_t numOf44Update = totalNumberOf44 - previousNumOf44; | |
1337 | ||
fa7e0953 | 1338 | // No new tracks since last update |
25bf7c78 | 1339 | if ( numOf34Update == 0 && numOf44Update == 0 ) |
1340 | return; | |
1341 | ||
1342 | Int_t newNbins = ( (Int_t)maxBin % fgkUpdateRatio4434 ) ? nbins : nbins+1; | |
1343 | TString cloneName; | |
1344 | ||
1345 | Int_t hIndex[2] = {AliMUONQAIndices::kTriggerRatio4434AllEvents, AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate}; | |
1346 | ||
1347 | for (Int_t ihisto=0; ihisto<2; ihisto++){ | |
1348 | TH1F* currHisto = (TH1F*)GetRawsData(hIndex[ihisto]); | |
1349 | cloneName = Form("%sClone", currHisto->GetName()); | |
1350 | TArrayD newAxis(newNbins+1); | |
1351 | for (Int_t ibin=0; ibin<newNbins; ibin++){ | |
1352 | newAxis[ibin] = currHisto->GetXaxis()->GetBinLowEdge(ibin+1); | |
986c0fd3 | 1353 | } |
25bf7c78 | 1354 | newAxis[newNbins] = numEvent; |
1355 | TH1F* copyHisto = (TH1F*)currHisto->Clone(cloneName.Data()); | |
1356 | //currHisto->SetBins(newNbins, 0., fgkUpdateRatio4434*newNbins); | |
1357 | currHisto->SetBins(newNbins, newAxis.GetArray()); | |
1358 | for (Int_t ibin=1; ibin<newNbins; ibin++){ | |
1359 | currHisto->SetBinContent(ibin, copyHisto->GetBinContent(ibin)); | |
1360 | currHisto->SetBinError(ibin, copyHisto->GetBinError(ibin)); | |
1361 | } | |
1362 | delete copyHisto; | |
1363 | } | |
1364 | ||
1365 | Float_t ratio4434 = totalNumberOf44/totalNumberOf34; | |
1366 | Float_t errorRatio4434 = ProtectedSqrt(totalNumberOf44*(1-ratio4434))/totalNumberOf34; | |
986c0fd3 | 1367 | |
25bf7c78 | 1368 | histoAllEvents->SetBinContent(newNbins,ratio4434); |
1369 | histoAllEvents->SetBinError(newNbins,errorRatio4434); | |
1370 | ||
1371 | Float_t ratio4434Update = 0.; | |
1372 | Float_t errorRatio4434Update = 0.; | |
c39cf12d | 1373 | |
25bf7c78 | 1374 | if(numOf34Update!=0){ |
1375 | ratio4434Update = numOf44Update/numOf34Update; | |
1376 | if ( numOf44Update > numOf34Update ) | |
1377 | AliWarning("Number of 4/4 is higher than number of 3/4"); | |
1378 | errorRatio4434Update = ProtectedSqrt(numOf44Update*(1-ratio4434Update))/numOf34Update; | |
ece56eb9 | 1379 | } |
c39cf12d | 1380 | |
25bf7c78 | 1381 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate))->SetBinContent(newNbins,ratio4434Update); |
1382 | ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate))->SetBinError(newNbins,errorRatio4434Update); | |
1383 | ||
1384 | histoAllEvents->SetBinContent(0,totalNumberOf34); | |
1385 | histoAllEvents->SetBinContent(newNbins+1,totalNumberOf44); | |
1386 | ||
ece56eb9 | 1387 | } |
c39cf12d | 1388 |