20 #include "Identifier/Identifier.h"
23 #include "GaudiKernel/ITHistSvc.h"
28 #include "TFileCollection.h"
29 #include "THashList.h"
32 static const std::string pathRoot{
"/HitMaps/"};
33 static const std::string detectorNames[] {
"negativeEndcap",
"barrel",
"positiveEndcap"};
34 static const std::string detectorPaths[] {
"SCTEC/",
"SCTB/",
"SCTEA/"};
43 m_thistSvc = service(
"THistSvc");
55 return StatusCode::SUCCESS;
62 return StatusCode::SUCCESS;
69 m_phistoVector.clear();
70 std::string histoName{pathRoot +
"GENERAL/"};
72 m_numberOfEventsHisto =
new TH1I{
"events",
"Events", 1, 0.5, 1.5};
73 if (m_thistSvc->regHist(histoName.c_str(), m_numberOfEventsHisto).isFailure()) {
78 std::string hitmapPaths[3];
79 for (
int i{0};
i<3; ++
i) {
80 hitmapPaths[
i]=pathRoot+detectorPaths[
i];
86 std::string histotitle{std::string{
"SCT "} + detectorNames[
bec2Index(
bec)] + std::string{
" Hitmap: plane "} + formattedPosition};
90 if (m_thistSvc->regHist(
name.c_str(), hitmapHisto_tmp ).isFailure()) {
93 m_phistoVector.push_back(hitmapHisto_tmp);
104 m_phistoVector.clear();
105 TFile* fileHitmap{TFile::Open(
fileName.c_str())};
108 if (fileHitmap==
nullptr) {
113 m_numberOfEventsHisto =
static_cast<TH1I*
>(fileHitmap->Get(
"GENERAL/events"));
114 if (m_numberOfEventsHisto==
nullptr) {
123 TH1F* hitmapHisto_tmp{
static_cast<TH1F*
>(fileHitmap->Get(
name.c_str()))};
124 if (hitmapHisto_tmp==
nullptr) {
127 m_phistoVector.push_back(hitmapHisto_tmp);
141 m_numberOfEventsHisto->Fill(1);
145 for (
int i{0};
i != MaxEntry; ++
i) {
151 pThisHisto->Fill(
strip);
160 m_numberOfEventsHisto->Fill(1);
162 if (not prdoContainer.isValid())
ATH_MSG_ERROR(
"Failed to retrieve the SCT RDO container");
165 for (; itr !=
end; ++itr) {
167 if (not SCT_Collection)
continue;
168 const Identifier waferId{SCT_Collection->identify()};
170 TH1F* pThisHisto{m_phistoVector[
static_cast<int>(waferHash)]};
173 for (; rdoItr != rdoEnd; ++rdoItr) {
175 const int endStrip{(*rdoItr)->getGroupSize() +
strip};
177 pThisHisto->Fill(
strip);