18 #include "FairLogger.h"
20 #include "FairTrackParam.h"
41 : FairTask(name, iVerbose)
45 , fMvdMCHitsStations()
46 , fWordsPerRegion(nullptr)
47 , fWordsPerRegion2(nullptr)
48 , fWordsPerWorstRegion(nullptr)
49 , fWordsPerSuperRegion(nullptr)
50 , fWorstSuperPerEvent(nullptr)
51 , fMvdBankDist(nullptr)
52 , fMvdMCWorst(nullptr)
53 , fMvdMCWorstDelta(nullptr)
54 , fMvdDataLoadPerSensor(nullptr)
55 , fMvdDataLoadHotSensor(nullptr)
57 , fMvdDataPerSuperRegion()
69 FairRootManager* ioman = FairRootManager::Instance();
70 if (!ioman) { LOG(fatal) <<
"RootManager not instantised!"; }
72 fMcPoints = (TClonesArray*) ioman->GetObject(
"MvdPoint");
75 if (!
fMcPoints) LOG(fatal) <<
"Mvd Pile Up Mc array missing";
85 for (Int_t
i = 0;
i < 63;
i++) {
87 new TH2F(Form(
"fMvdMCBank%d",
i),
88 "Mvd mc distribution worst spot only delta electrons",
98 "fMvdMCStation0",
"Mvd mc distribution", 2, -2.5, -0.5, 3, -0.5, 2.5);
100 "fMvdMCStation1",
"Mvd mc distribution", 4, -4.5, -0.5, 6, -0.5, 5.5);
102 "fMvdMCStation2",
"Mvd mc distribution", 6, -7.5, -1.5, 9, -1.5, 7.5);
104 "fMvdMCStation3",
"Mvd mc distribution", 8, -9.5, -1.5, 12, -1.5, 10.5);
107 new TH1F(
"fWordsPerRegion",
"Words send to a region", 65, 0, 64);
112 new TH2F(
"fWordsPerRegion2",
113 "Words send to a region, errors sigma of gauss fit",
124 "fWordsPerWorstRegion",
"Most worst send to a region per Event", 65, 0, 64);
129 "fWordsPerSuperRegion",
"Words send to a super region", 1000, 0, 400);
134 "Most words send to super region per Event",
142 "fMvdMCWorst",
"Mvd mc distribution worst spot", 300, -2, 0, 1500, 3.5, 0);
147 new TH2F(
"fMvdMCWorstDelta",
148 "Mvd mc distribution worst spot only delta electrons",
159 new TH1I(
"fMvdDataLoadPerSensor",
"Mvd Dataload per Sensor", 300, 0, 300);
164 "fMvdDataLoadHotSensor",
"Mvd Dataload in worst Sensor", 2000, 0, 2000);
169 new TH2I(
"fMvdBankDist",
"Avarage Hits per Region", 63, 0, 63, 50, 0, 50);
173 for (Int_t
i = 0;
i < 64;
i++) {
175 Form(
"Words send to region %d",
i),
184 for (Int_t
i = 0;
i < 16;
i++) {
186 new TH1F(Form(
"fMvdDataPerSuperRegion[%d]",
i),
187 Form(
"Words send to superregion %d",
i),
202 Float_t wordsPerRegion[64] = {0};
203 Float_t wordsPerSuper[16] = {0};
205 Float_t yPosMin = -0.73;
206 Float_t yPosMax = 2.5;
208 for (Int_t k = 0; k <
fMcPoints->GetEntriesFast(); k++) {
212 if (curPoint->GetZ() < 8) {
213 if (curPoint->GetX() > -1.93 && curPoint->GetX() <= -0.55
214 && curPoint->GetY() >= yPosMin && curPoint->GetY() <= yPosMax) {
215 fMvdMCWorst->Fill(curPoint->GetX(), curPoint->GetY());
216 if (curPoint->GetTrackID() == -3)
218 for (Int_t nRegion = 0; nRegion < 64; nRegion++) {
219 if (curPoint->GetY() >= (yPosMin + (nRegion * 0.05))
220 && curPoint->GetY() < (yPosMin + ((nRegion + 1) * 0.05))) {
221 fMvdMCBank[nRegion]->Fill(curPoint->GetX(), curPoint->GetY());
222 wordsPerRegion[nRegion] = wordsPerRegion[nRegion] + 1.5;
223 if (wordsPerRegion[nRegion] > 100)
224 LOG(info) <<
" Region " << nRegion <<
" has an overflow";
231 if (curPoint->GetZ() < 8) {
232 if (curPoint->GetX() < -0.5 && curPoint->GetY() > -0.5)
234 }
else if (curPoint->GetZ() < 13) {
235 if (curPoint->GetX() < -0.5 && curPoint->GetY() > -1.5)
237 }
else if (curPoint->GetZ() < 18) {
238 if (curPoint->GetX() < -1.5 && curPoint->GetY() > -1.5)
241 if (curPoint->GetX() < -1.5 && curPoint->GetY() > -1.5)
245 LOG(info) <<
"//--------------- New Event " <<
fEventNumber
246 <<
" -----------------------\\";
249 Int_t wordsInWorst = 0;
250 Int_t wordsInWorstReg = 0;
251 Int_t wordsTotal = 0;
253 for (Int_t supReg = 0; supReg < 16; supReg++) {
254 for (Int_t k = 0; k < 4; k++) {
255 wordsPerSuper[supReg] += wordsPerRegion[
i];
257 if (wordsPerRegion[
i] > wordsInWorstReg)
258 wordsInWorstReg = wordsPerRegion[
i];
259 LOG(debug) <<
"Words in Region " <<
i <<
": " << wordsPerRegion[
i];
263 LOG(debug) <<
" Words in super region " << supReg <<
": "
264 << wordsPerSuper[supReg];
265 if (wordsPerSuper[supReg] > 400)
266 LOG(info) <<
"SuperRegion " << supReg <<
" has an overflow";
270 if (wordsPerSuper[supReg] > wordsInWorst)
271 wordsInWorst = wordsPerSuper[supReg];
273 wordsTotal += wordsPerSuper[supReg];
280 LOG(info) <<
"//--------------- End Event -----------------------\\";
289 for (Int_t iPad = 0; iPad < 4; iPad++) {
304 for (Int_t iPad = 0; iPad < 4; iPad++) {
320 for (Int_t
i = 0;
i < 64;
i++) {
323 Double_t param0 = func->GetParameter(0);
324 Double_t param1 = func->GetParameter(1);
325 Double_t param2 = func->GetParameter(2);
326 Double_t chi2 = func->GetChisquare();
327 cout <<
" // - " <<
i <<
" -- param 0 = " << param0
328 <<
" -- param 1 = " << param1 <<
" -- param 2 = " << param2
329 <<
" -- chi2 = " << chi2 << endl;
336 for (Int_t
i = 0;
i < 16;
i++)
343 TCanvas* mcCanvas1 =
new TCanvas();
344 mcCanvas1->Divide(2, 2);
345 for (Int_t iPad = 0; iPad < 4; iPad++) {
346 mcCanvas1->cd(iPad + 1);
350 TCanvas* dataLoad =
new TCanvas();
351 dataLoad->Divide(2, 1);
357 TCanvas* mcCanvas2 =
new TCanvas();
358 mcCanvas2->Divide(1, 2);
386 TCanvas* regionCanvas =
new TCanvas();
387 regionCanvas->Divide(1, 2);
393 TCanvas* regionsCanvas[64];
394 TCanvas* supregionsCanvas[16];
396 for (Int_t
i = 0;
i < 64;
i++) {
397 regionsCanvas[
i] =
new TCanvas();
398 regionsCanvas[
i]->cd();
402 for (Int_t
i = 0;
i < 16;
i++) {
403 supregionsCanvas[
i] =
new TCanvas();
404 supregionsCanvas[
i]->cd();