23 #include "Identifier/Identifier.h"
36 static const std::string pathRoot{
"/LB/"};
37 static const int n_chipsPerSide{6};
38 static const int n_stripsPerChip{128};
39 static const std::string detectorNames[] {
"negativeEndcap",
"barrel",
"positiveEndcap"};
40 static const std::string detectorPaths[] {
"SCTEC/",
"SCTB/",
"SCTEA/"};
60 if (element->swapPhiReadoutDirection()) {
65 std::pair<std::string, bool> msgCode{retrievedTool(
m_evtInfo)};
66 if (not msgCode.second) {
68 return StatusCode::FAILURE;
79 return StatusCode::SUCCESS;
87 m_phistoVector.clear();
88 m_phistoVector2D.clear();
89 std::string histoName{pathRoot+
"GENERAL/"};
96 if (m_thistSvc->regHist( histoName.c_str(), m_numberOfEventsHisto ).isFailure()) {
102 std::string hitmapPaths[3];
103 for (
int i{0};
i<3; ++
i) {
104 hitmapPaths[
i] = pathRoot+detectorPaths[
i];
112 std::string histotitle{std::string{
"SCT "} + detectorNames[
bec2Index(
bec)] + std::string{
" Hitmap: plane "} + formattedPosition};
113 std::string formattedPosition2D{formattedPosition +
"_2D"};
116 if (m_thistSvc->regHist(name2D.c_str(), hitmapHistoLB_tmp2D).isFailure()) {
119 m_phistoVector2D.push_back(hitmapHistoLB_tmp2D);
122 for (
int iChip(0); iChip!=n_chipsPerSide; ++iChip) {
124 const std::string formattedChipPosition{formattedPosition +
std::to_string(chipId)};
125 const std::string
hname{pathRoot + detectorPaths[
bec2Index(
bec)] +
"/" + formattedChipPosition};
126 const std::string histTitle{std::string{
"SCT"} + detectorNames[
bec2Index(
bec)] + std::string{
" LB: chip "} + formattedChipPosition};
128 if (m_thistSvc->regHist(
hname.c_str(), hist_tmp).isFailure())
ATH_MSG_ERROR(
"Error in booking LB histogram");
129 m_phistoVector.push_back(hist_tmp);
141 m_phistoVector.clear();
142 m_phistoVector2D.clear();
143 TFile* fileLB{TFile::Open(
fileName.c_str())};
147 m_numberOfEventsHisto =
static_cast<TH1I*
>(fileLB->Get(
"GENERAL/events"));
153 if (m_numberOfEventsHisto==
nullptr) {
164 TH2F* hitmapHistoLB_tmp2D = (
TH2F*) fileLB->Get(name2D.c_str());
166 if (hitmapHistoLB_tmp2D==
nullptr) {
169 m_phistoVector2D.push_back(hitmapHistoLB_tmp2D);
172 for (
int iChip{0}; iChip!=n_chipsPerSide; ++iChip) {
175 TH1F* hist_tmp{
static_cast<TH1F*
>(fileLB->Get(
hname.c_str()))};
176 if (hist_tmp==
nullptr) {
179 m_phistoVector.push_back(hist_tmp);
191 m_numberOfEventsHisto->Fill(m_lumiBlock);
194 for (
int i{0};
i != maxEntry; ++
i) {
195 int theFirstStrip{(*m_sct_firstStrip)[
i]};
197 int endStrip{(*m_sct_rdoGroupSize)[
i] + theFirstStrip};
198 int index{(*m_sct_waferHash)[
i]};
199 TH2F* pThisHisto2D{m_phistoVector2D[
index]};
202 pThisHisto2D->Fill(
strip, m_lumiBlock);
205 int rdoGroupSize{(*m_sct_rdoGroupSize)[
i]};
206 IdentifierHash waferHash{
static_cast<unsigned int>((*m_sct_waferHash)[
i])};
219 m_numberOfEventsHisto->Fill(m_lumiBlock);
224 if (not p_rdoContainer.isValid()) {
230 for (; itr != itrE; ++itr) {
232 if (SCT_Collection==
nullptr)
continue;
233 Identifier waferId{SCT_Collection->identify()};
236 TH2F* pThisHisto2D{m_phistoVector2D[
static_cast<int>(waferHash)]};
240 for (; rdoItr != rdoItrE; ++rdoItr ) {
244 const int endStrip{(*rdoItr)->getGroupSize() +
strip};
246 pThisHisto2D->Fill(
strip, m_lumiBlock );
249 int rdoGroupSize{(*rdoItr)->getGroupSize()};
260 int index{
static_cast<int>(waferHash)*n_chipsPerSide + stripNumber/n_stripsPerChip};
262 for (
int j{0}; j != groupSize; ++j) {
263 m_phistoVector[
index]->Fill(m_lumiBlock);