10#include <arich/modules/arichDQM/hitMapMaker.h>
13#include <arich/dbobjects/ARICHChannelMapping.h>
14#include <arich/dbobjects/ARICHMergerMapping.h>
15#include <arich/dataobjects/ARICHHit.h>
17#include <mdst/dataobjects/Track.h>
20#include <framework/database/DBObjPtr.h>
41 int m_moduleID = moduleID;
45 TH2* m_moduleHitMap =
new TH2D(Form(
"HAPDHitMapMod%d", moduleID), Form(
"HAPD hit map module %d;nChX;nChY", moduleID), 12, 0.5, 12.5,
48 TH1* m_hitMap = hitMap;
50 for (
int i = 0; i < 144; i++) {
51 int hitsNum = m_hitMap->GetBinContent((m_moduleID - 1) * 144 + i);
53 arichChMap->getXYFromAsic(i, xChn, yChn);
55 m_moduleHitMap->Fill(xChn + 1, yChn + 1, hitsNum);
59 return m_moduleHitMap;
64 int m_moduleID = moduleID;
68 TH2* m_moduleDeadMap =
new TH2D(Form(
"HAPDDeadMapMod%d", moduleID), Form(
"HAPD alive/dead module %d;nChX;nChY", moduleID), 2, 0.5,
71 TH1* m_hitMap = hitMap;
73 int deadCh[2][2] = {};
75 for (
int i = 0; i < 144; i++) {
76 int hitsNum = m_hitMap->GetBinContent((m_moduleID - 1) * 144 + i);
78 arichChMap->getXYFromAsic(i, xChn, yChn);
79 if (hitsNum == 0) deadCh[(int)xChn / 6][(
int)yChn / 6]++;
82 for (
int j = 0; j < 2; j++) {
83 for (
int k = 0; k < 2; k++) {
84 if (deadCh[j][k] > 18) {
85 m_moduleDeadMap->Fill(j + 1, k + 1, 1);
87 m_moduleDeadMap->Fill(j + 1, k + 1, 10);
92 return m_moduleDeadMap;
98 int m_mergerID = mergerID;
103 TH1* m_hitMap = hitMap;
105 std::vector<int> moduleIDs;
106 for (
int i = 1; i < 7; i++) {
107 moduleIDs.push_back(arichMergerMap->getModuleID(m_mergerID, i));
110 TH1D* m_mergerHitMap1D =
new TH1D(
"MergerHitMap1D", Form(
"Hit map in Merger Board %d", m_mergerID), 144 * 6, -0.5, 144 * 6 - 0.5);
111 for (
int i = 1; i < 7; i++) {
112 for (
int j = 0; j < 144; j++) {
113 int hitsNum = m_hitMap->GetBinContent((moduleIDs[i] - 1) * 144 + i);
114 m_mergerHitMap1D->Fill(144 * (i - 1) + j, hitsNum);
117 return m_mergerHitMap1D;
122 int m_mergerID = mergerID;
127 TH1* m_hitMap = hitMap;
130 std::vector<int> moduleIDs;
131 for (
int i = 1; i < 7; i++) {
132 moduleIDs.push_back(arichMergerMap->getModuleID(m_mergerID, i));
135 TCanvas* m_mergerHitMap =
new TCanvas(
"MergerHitMap",
"Hit map in Merger Board", 600, 400);
136 m_mergerHitMap->Divide(3, 2);
137 for (
int i = 1; i < 7; i++) {
138 m_mergerHitMap->cd(i);
141 return m_mergerHitMap;
147 TH2* m_moduleHitMap = NULL;
150 TPad* p_hitMaps[421] = {};
151 TCanvas* m_sectorHitMap =
new TCanvas(Form(
"c_hitMap%d", sector - 1), Form(
"Hit map of sector%d", sector - 1), 600, 400);
152 for (
int i = 1; i < 421; i++) {
153 for (
int iRing = 0; iRing < 7; iRing++) {
154 if (((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector - 1) < i && i <= ((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector)) {
155 m_sectorHitMap->cd();
156 p_hitMaps[i] =
new TPad(Form(
"p_hitMap%d", i),
"",
157 (
double)((
double)(6 - iRing) / 2 + ((i - ((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector - 1) - 1) % (iRing + 7))) / 13,
158 (
double)iRing / 7, (
double)((
double)(8 - iRing) / 2 + ((i - ((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector - 1) - 1) %
159 (iRing + 7))) / 13, (
double)(iRing + 1) / 7);
160 p_hitMaps[i]->Draw();
161 p_hitMaps[i]->SetNumber(i);
162 m_sectorHitMap->cd(i);
164 m_moduleHitMap->SetTitleSize(0,
"xyz");
165 m_moduleHitMap->SetTitle(0);
166 m_moduleHitMap->SetLineWidth(1);
167 gStyle->SetLabelColor(0,
"xyz");
168 m_moduleHitMap->SetStats(0);
169 m_moduleHitMap->Draw(
"col");
173 return m_sectorHitMap;
179 TH2* m_moduleDeadMap = NULL;
183 TPad* p_hitMaps[421] = {};
184 TCanvas* m_sectorDeadMap =
new TCanvas(Form(
"c_deadMap%d", sector - 1), Form(
"Dead chip map of sector%d", sector - 1), 600, 400);
185 for (
int i = 1; i < 421; i++) {
186 for (
int iRing = 0; iRing < 7; iRing++) {
187 if (((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector - 1) < i && i <= ((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector)) {
188 m_sectorDeadMap->cd();
189 p_hitMaps[i] =
new TPad(Form(
"p_deadMap%d", i),
"",
190 (
double)((
double)(6 - iRing) / 2 + ((i - ((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector - 1) - 1) % (iRing + 7))) / 13,
191 (
double)iRing / 7, (
double)((
double)(8 - iRing) / 2 + ((i - ((iRing + 13)*iRing / 2) * 6 + (iRing + 7) * (sector - 1) - 1) %
192 (iRing + 7))) / 13, (
double)(iRing + 1) / 7);
193 p_hitMaps[i]->Draw();
194 p_hitMaps[i]->SetNumber(i);
195 m_sectorDeadMap->cd(i);
197 m_moduleDeadMap->SetTitleSize(0,
"xyz");
198 m_moduleDeadMap->SetTitle(0);
199 m_moduleDeadMap->SetLineWidth(1);
200 m_moduleDeadMap->SetStats(0);
201 gStyle->SetLabelColor(0,
"xyz");
202 ex1 =
new TExec(
"ex1",
"deadPalette();");
204 m_moduleDeadMap->Draw(
"colz");
208 return m_sectorDeadMap;
216 static Int_t colors[50];
217 static Bool_t initialized = kFALSE;
218 Double_t Red[3] = { 1.00, 0.00, 0.00};
219 Double_t Green[3] = { 0.00, 0.00, 0.00};
220 Double_t Blue[3] = { 0.00, 1.00, 1.00};
221 Double_t Length[3] = { 0.00, 0.20, 1.00 };
223 Int_t FI = TColor::CreateGradientColorTable(3, Length, Red, Green, Blue, 50);
224 for (
int i = 0; i < 50; i++) colors[i] = FI + i;
228 gStyle->SetPalette(50, colors);
Class for accessing objects in the database.
TH2 * moduleHitMap(TH1 *hitMap, int moduleID)
Make hit map in HAPD view (12*12 channels).
void deadPalette()
Set palette for sector dead-chip map.
TH2 * moduleDeadMap(TH1 *hitMap, int moduleID)
Make chip dead/alive map in HAPD view (2*2 chips).
TCanvas * mergerClusterHitMap2D(TH1 *hitMap, int mergerID)
Make display of 6 HAPDs' 2D hit map of the Merger Board.
TH1 * mergerClusterHitMap1D(TH1 *hitMap, int mergerID)
Make 1D hit map of specified Merger Board.
TCanvas * sectorDeadMap(TH1 *hitMap, int sector)
Make display of 70 HAPDs' 2D dead/alive map of the sector.
TCanvas * sectorHitMap(TH1 *hitMap, int sector)
Make display of 70 HAPDs' 2D hit map of the sector.
Abstract base class for different kinds of events.