@@ -60,8 +60,14 @@ DecodingErrorsPlotter::DecodingErrorsPlotter(std::string path) : mPath(path)
6060 // Number of decoding errors, grouped by FEE ID and normalized to the number of processed TF
6161 mHistogramGoodBoardsPerDE = std::make_unique<TH1F>(TString::Format (" %sGoodBoardsFractionPerDE" , path.c_str ()),
6262 " Fraction of boards not in error" , getNumDE (), 0 , getNumDE ());
63+ addDEBinLabels (mHistogramGoodBoardsPerDE .get ());
6364 addHisto (mHistogramGoodBoardsPerDE .get (), false , " " , " " );
6465
66+ mHistogramGoodBoardsPerSolar = std::make_unique<TH1F>(TString::Format (" %sGoodBoardsFractionPerSolar" , path.c_str ()),
67+ " Fraction of boards not in error per SOLAR board" , getNumSolar (), 0 , getNumSolar ());
68+ addSolarBinLabels (mHistogramGoodBoardsPerSolar .get ());
69+ addHisto (mHistogramGoodBoardsPerSolar .get (), false , " " , " " );
70+
6571 // --------------------------------------------
6672 // Decoding errors per chamber, DE and FEEID
6773 // --------------------------------------------
@@ -122,7 +128,8 @@ void DecodingErrorsPlotter::update(TH2F* h)
122128 mHistogramErrorsPerDE ->Reset (" ICES" );
123129 mHistogramErrorsPerChamber ->Reset (" ICES" );
124130
125- std::array<std::pair<float , float >, getNumDE ()> goodBoardsFraction;
131+ std::array<std::pair<float , float >, getNumDE ()> goodBoardsFractionPerDE;
132+ std::array<std::pair<float , float >, getNumSolar ()> goodBoardsFractionPerSolar;
126133
127134 // loop over bins in electronics coordinates, and map the channels to the corresponding cathode pads
128135 int nbinsx = h->GetXaxis ()->GetNbins ();
@@ -144,16 +151,21 @@ void DecodingErrorsPlotter::update(TH2F* h)
144151 // where one bin is one physical pad
145152 // get the unique solar ID and the DS address associated to this digit
146153 int feeId = -1 ;
154+ int solarId = -1 ;
147155 std::optional<DsElecId> dsElecId = mDet2ElecMapper (dsDetId);
148156 if (dsElecId) {
149- uint32_t solarId = dsElecId->solarId ();
157+ solarId = dsElecId->solarId ();
150158 uint32_t dsAddr = dsElecId->elinkId ();
151159
152160 std::optional<FeeLinkId> feeLinkId = mSolar2FeeLinkMapper (solarId);
153161 if (feeLinkId) {
154162 feeId = feeLinkId->feeId ();
155163 }
156164 }
165+ int solarIndex = (solarId >= 0 ) ? getSolarIndex (solarId) : -1 ;
166+ if (solarIndex < 0 ) {
167+ continue ;
168+ }
157169
158170 bool hasError = false ;
159171
@@ -171,21 +183,33 @@ void DecodingErrorsPlotter::update(TH2F* h)
171183 incrementBin (mHistogramErrorsPerChamber .get (), chamber, j, count);
172184 }
173185
174- goodBoardsFraction[deIndex].first += 1 ;
186+ goodBoardsFractionPerDE[deIndex].first += 1 ;
187+ goodBoardsFractionPerSolar[solarIndex].first += 1 ;
175188 if (!hasError) {
176- goodBoardsFraction[deIndex].second += 1 ;
189+ goodBoardsFractionPerDE[deIndex].second += 1 ;
190+ goodBoardsFractionPerSolar[solarIndex].second += 1 ;
177191 }
178192 }
179193
180194 // update fraction of good boards per DE
181195 for (int i = 0 ; i < getNumDE (); i++) {
182- if (goodBoardsFraction [i].first > 0 ) {
183- float frac = goodBoardsFraction [i].second / goodBoardsFraction [i].first ;
196+ if (goodBoardsFractionPerDE [i].first > 0 ) {
197+ float frac = goodBoardsFractionPerDE [i].second / goodBoardsFractionPerDE [i].first ;
184198 mHistogramGoodBoardsPerDE ->SetBinContent (i + 1 , frac);
185199 } else {
186200 mHistogramGoodBoardsPerDE ->SetBinContent (i + 1 , 0 );
187201 }
188202 }
203+
204+ // update fraction of good boards per Solar
205+ for (int i = 0 ; i < getNumSolar (); i++) {
206+ if (goodBoardsFractionPerSolar[i].first > 0 ) {
207+ float frac = goodBoardsFractionPerSolar[i].second / goodBoardsFractionPerSolar[i].first ;
208+ mHistogramGoodBoardsPerSolar ->SetBinContent (i + 1 , frac);
209+ } else {
210+ mHistogramGoodBoardsPerSolar ->SetBinContent (i + 1 , 0 );
211+ }
212+ }
189213}
190214
191215} // namespace muonchambers
0 commit comments