85 std::ostringstream oss;
89 dqmStore->setCurrentFolder(
"ChannelStatusPlots");
92 std::vector<std::string> subDetName;
93 std::vector<unsigned int> nLayers;
95 subDetName.push_back(
"");
96 subDetName.push_back(
"TIB");
97 subDetName.push_back(
"TID");
98 subDetName.push_back(
"TOB");
99 subDetName.push_back(
"TEC");
100 nLayers.push_back(0);
101 nLayers.push_back(4);
102 nLayers.push_back(3);
103 nLayers.push_back(6);
104 nLayers.push_back(9);
105 layerName.push_back(
"");
106 layerName.push_back(
"Layer");
107 layerName.push_back(
"Disk");
108 layerName.push_back(
"Layer");
109 layerName.push_back(
"Disk");
117 TH2F* medianVsAbsoluteOccupancy[5][10];
118 TH1F* medianOccupancy[5][10];
119 TH1F* absoluteOccupancy[5][10];
120 for (
unsigned int i = 0;
i < subDetName.size();
i++) {
121 for (
unsigned int j = 0;
j <= nLayers[
i];
j++) {
122 histoName =
"medianVsAbsoluteOccupancy" + subDetName[
i];
126 histoName += layerName[
i] + oss.str();
128 histoTitle =
"Median APV occupancy vs. absolute APV occupancy";
130 histoTitle +=
" in " + subDetName[
i];
132 histoTitle +=
" " + layerName[
i] +
" " + oss.str();
134 MonitorElement*
tmp = dqmStore->book2D(histoName.c_str(), histoTitle.c_str(), 1000, 0., 6., 1000, -1., 3.);
135 medianVsAbsoluteOccupancy[
i][
j] = tmp->
getTH2F();
136 medianVsAbsoluteOccupancy[
i][
j]->Rebin2D(10, 10);
137 medianVsAbsoluteOccupancy[
i][
j]->GetXaxis()->SetTitle(
"log_{10}(Abs. Occupancy)");
138 medianVsAbsoluteOccupancy[
i][
j]->GetYaxis()->SetTitle(
"log_{10}(Median Occupancy)");
140 histoName =
"medianOccupancy" + subDetName[
i];
144 histoName += layerName[
i] + oss.str();
146 histoTitle =
"Median APV occupancy";
148 histoTitle +=
" in " + subDetName[
i];
150 histoTitle +=
" " + layerName[
i] +
" " + oss.str();
152 tmp = dqmStore->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -1., 3.);
154 medianOccupancy[
i][
j]->GetXaxis()->SetTitle(
"log_{10}(Occupancy)");
155 medianOccupancy[
i][
j]->GetYaxis()->SetTitle(
"APVs");
157 histoName =
"absoluteOccupancy" + subDetName[
i];
161 histoName += layerName[
i] + oss.str();
163 histoTitle =
"Absolute APV occupancy";
165 histoTitle +=
" in " + subDetName[
i];
167 histoTitle +=
" " + layerName[
i] +
" " + oss.str();
169 tmp = dqmStore->book1D(histoName.c_str(), histoTitle.c_str(), 1000, 0., 6.);
170 absoluteOccupancy[
i][
j] = tmp->
getTH1F();
171 absoluteOccupancy[
i][
j]->GetXaxis()->SetTitle(
"log_{10}(Occupancy)");
172 absoluteOccupancy[
i][
j]->GetYaxis()->SetTitle(
"APVs");
177 TTree* intree = (TTree*)infile->Get(
"moduleOccupancy");
185 Int_t IsExternalString;
187 Int_t RodStringPetal;
189 Int_t ModulePosition;
190 Int_t NumberOfStrips;
191 Float_t APVGlobalPositionX;
192 Float_t APVGlobalPositionY;
193 Float_t APVGlobalPositionZ;
195 Int_t APVAbsoluteOccupancy;
196 Double_t APVMedianOccupancy;
197 intree->SetBranchAddress(
"DetRawId", &DetRawId);
198 intree->SetBranchAddress(
"SubDetId", &SubDetId);
199 intree->SetBranchAddress(
"Layer_Ring", &Layer_Ring);
200 intree->SetBranchAddress(
"Disc", &Disc);
201 intree->SetBranchAddress(
"IsBack", &IsBack);
202 intree->SetBranchAddress(
"IsExternalString", &IsExternalString);
203 intree->SetBranchAddress(
"IsZMinusSide", &IsZMinusSide);
204 intree->SetBranchAddress(
"RodStringPetal", &RodStringPetal);
205 intree->SetBranchAddress(
"IsStereo", &IsStereo);
206 intree->SetBranchAddress(
"ModuleNumber", &ModulePosition);
207 intree->SetBranchAddress(
"NumberOfStrips", &NumberOfStrips);
208 intree->SetBranchAddress(
"APVGlobalPositionX", &APVGlobalPositionX);
209 intree->SetBranchAddress(
"APVGlobalPositionY", &APVGlobalPositionY);
210 intree->SetBranchAddress(
"APVGlobalPositionZ", &APVGlobalPositionZ);
211 intree->SetBranchAddress(
"APVNumber", &APVNumber);
212 intree->SetBranchAddress(
"APVAbsoluteOccupancy", &APVAbsoluteOccupancy);
213 intree->SetBranchAddress(
"APVMedianOccupancy", &APVMedianOccupancy);
215 for (
int i = 0;
i < intree->GetEntries();
i++) {
218 double logMedianOccupancy = -1;
219 double logAbsoluteOccupancy = -1;
221 if (APVMedianOccupancy > 0)
222 logMedianOccupancy = log10(APVMedianOccupancy);
223 if (APVAbsoluteOccupancy > 0)
224 logAbsoluteOccupancy = log10(APVAbsoluteOccupancy);
227 unsigned int layer = 0;
228 if (SubDetId == 3 || SubDetId == 5)
234 medianVsAbsoluteOccupancy[0][0]->Fill(logAbsoluteOccupancy, logMedianOccupancy);
235 medianOccupancy[0][0]->Fill(logMedianOccupancy);
236 absoluteOccupancy[0][0]->Fill(logAbsoluteOccupancy);
238 medianVsAbsoluteOccupancy[SubDetId - 2][0]->Fill(logAbsoluteOccupancy, logMedianOccupancy);
239 medianOccupancy[SubDetId - 2][0]->Fill(logMedianOccupancy);
240 absoluteOccupancy[SubDetId - 2][0]->Fill(logAbsoluteOccupancy);
242 medianVsAbsoluteOccupancy[SubDetId - 2][
layer]->Fill(logAbsoluteOccupancy, logMedianOccupancy);
243 medianOccupancy[SubDetId - 2][
layer]->Fill(logMedianOccupancy);
244 absoluteOccupancy[SubDetId - 2][
layer]->Fill(logAbsoluteOccupancy);
const std::string infilename
virtual TH2F * getTH2F() const
constexpr char const * layerName[numberOfLayers]
virtual TH1F * getTH1F() const
const std::string outfilename
constexpr std::array< uint8_t, layerIndexSize > layer