23 #include "Identifier/Identifier.h"
28 #include "GaudiKernel/ITHistSvc.h"
38 static const std::string pathRoot{
"/LB/"};
39 static const int n_chipsPerSide{6};
40 static const int n_stripsPerChip{128};
41 static const std::string detectorNames[] {
"negativeEndcap",
"barrel",
"positiveEndcap"};
42 static const std::string detectorPaths[] {
"SCTEC/",
"SCTB/",
"SCTEA/"};
53 ATH_CHECK(service(
"THistSvc", m_thistSvc));
62 if (element->swapPhiReadoutDirection()) {
67 std::pair<std::string, bool> msgCode{retrievedTool(
m_evtInfo)};
68 if (not msgCode.second) {
70 return StatusCode::FAILURE;
81 return StatusCode::SUCCESS;
89 m_phistoVector.clear();
90 m_phistoVector2D.clear();
91 std::string histoName{pathRoot+
"GENERAL/"};
98 if (m_thistSvc->regHist( histoName.c_str(), m_numberOfEventsHisto ).isFailure()) {
104 std::string hitmapPaths[3];
105 for (
int i{0};
i<3; ++
i) {
106 hitmapPaths[
i] = pathRoot+detectorPaths[
i];
110 const Identifier& waferId{*waferItr};
114 std::string histotitle{std::string{
"SCT "} + detectorNames[
bec2Index(
bec)] + std::string{
" Hitmap: plane "} + formattedPosition};
115 std::string formattedPosition2D{formattedPosition +
"_2D"};
118 if (m_thistSvc->regHist(name2D.c_str(), hitmapHistoLB_tmp2D).isFailure()) {
121 m_phistoVector2D.push_back(hitmapHistoLB_tmp2D);
124 for (
int iChip(0); iChip!=n_chipsPerSide; ++iChip) {
126 const std::string formattedChipPosition{formattedPosition +
std::to_string(chipId)};
127 const std::string
hname{pathRoot + detectorPaths[
bec2Index(
bec)] +
"/" + formattedChipPosition};
128 const std::string histTitle{std::string{
"SCT"} + detectorNames[
bec2Index(
bec)] + std::string{
" LB: chip "} + formattedChipPosition};
130 if (m_thistSvc->regHist(
hname.c_str(), hist_tmp).isFailure())
ATH_MSG_ERROR(
"Error in booking LB histogram");
131 m_phistoVector.push_back(hist_tmp);
143 m_phistoVector.clear();
144 m_phistoVector2D.clear();
145 TFile* fileLB{TFile::Open(
fileName.c_str())};
149 m_numberOfEventsHisto =
static_cast<TH1I*
>(fileLB->Get(
"GENERAL/events"));
155 if (m_numberOfEventsHisto==
nullptr) {
161 const Identifier& waferId{*waferItr};
166 TH2F* hitmapHistoLB_tmp2D = (
TH2F*) fileLB->Get(name2D.c_str());
168 if (hitmapHistoLB_tmp2D==
nullptr) {
171 m_phistoVector2D.push_back(hitmapHistoLB_tmp2D);
174 for (
int iChip{0}; iChip!=n_chipsPerSide; ++iChip) {
177 TH1F* hist_tmp{
static_cast<TH1F*
>(fileLB->Get(
hname.c_str()))};
178 if (hist_tmp==
nullptr) {
181 m_phistoVector.push_back(hist_tmp);
193 m_numberOfEventsHisto->Fill(m_lumiBlock);
196 for (
int i{0};
i != maxEntry; ++
i) {
197 int theFirstStrip{(*m_sct_firstStrip)[
i]};
199 int endStrip{(*m_sct_rdoGroupSize)[
i] + theFirstStrip};
200 int index{(*m_sct_waferHash)[
i]};
201 TH2F* pThisHisto2D{m_phistoVector2D[
index]};
204 pThisHisto2D->Fill(
strip, m_lumiBlock);
207 int rdoGroupSize{(*m_sct_rdoGroupSize)[
i]};
208 IdentifierHash waferHash{
static_cast<unsigned int>((*m_sct_waferHash)[
i])};
221 m_numberOfEventsHisto->Fill(m_lumiBlock);
226 if (not p_rdoContainer.isValid()) {
232 for (; itr != itrE; ++itr) {
234 if (SCT_Collection==
nullptr)
continue;
235 Identifier waferId{SCT_Collection->
identify()};
238 TH2F* pThisHisto2D{m_phistoVector2D[
static_cast<int>(waferHash)]};
242 for (; rdoItr != rdoItrE; ++rdoItr ) {
246 const int endStrip{(*rdoItr)->getGroupSize() +
strip};
248 pThisHisto2D->Fill(
strip, m_lumiBlock );
251 int rdoGroupSize{(*rdoItr)->getGroupSize()};
262 int index{
static_cast<int>(waferHash)*n_chipsPerSide + stripNumber/n_stripsPerChip};
264 for (
int j{0}; j != groupSize; ++j) {
265 m_phistoVector[
index]->Fill(m_lumiBlock);