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 if ( service(
"THistSvc", m_thistSvc ).isFailure() )
ATH_MSG_ERROR(
"Unable to retrieve pointer to THistSvc");
54 return StatusCode::SUCCESS;
61 return StatusCode::SUCCESS;
68 m_phistoVector.clear();
69 std::string histoName{pathRoot +
"GENERAL/"};
71 m_numberOfEventsHisto =
new TH1I{
"events",
"Events", 1, 0.5, 1.5};
72 if (m_thistSvc->regHist(histoName.c_str(), m_numberOfEventsHisto).isFailure()) {
77 std::string hitmapPaths[3];
78 for (
int i{0};
i<3; ++
i) {
79 hitmapPaths[
i]=pathRoot+detectorPaths[
i];
82 const Identifier& waferId{*waferItr};
85 std::string histotitle{std::string{
"SCT "} + detectorNames[
bec2Index(
bec)] + std::string{
" Hitmap: plane "} + formattedPosition};
89 if (m_thistSvc->regHist(
name.c_str(), hitmapHisto_tmp ).isFailure()) {
92 m_phistoVector.push_back(hitmapHisto_tmp);
103 m_phistoVector.clear();
104 TFile* fileHitmap{TFile::Open(
fileName.c_str())};
107 if (fileHitmap==
nullptr) {
112 m_numberOfEventsHisto =
static_cast<TH1I*
>(fileHitmap->Get(
"GENERAL/events"));
113 if (m_numberOfEventsHisto==
nullptr) {
119 const Identifier& waferId{*waferItr};
122 TH1F* hitmapHisto_tmp{
static_cast<TH1F*
>(fileHitmap->Get(
name.c_str()))};
123 if (hitmapHisto_tmp==
nullptr) {
126 m_phistoVector.push_back(hitmapHisto_tmp);
140 m_numberOfEventsHisto->Fill(1);
144 for (
int i{0};
i != MaxEntry; ++
i) {
150 pThisHisto->Fill(
strip);
159 m_numberOfEventsHisto->Fill(1);
161 if (not prdoContainer.isValid())
ATH_MSG_ERROR(
"Failed to retrieve the SCT RDO container");
164 for (; itr !=
end; ++itr) {
166 if (not SCT_Collection)
continue;
167 const Identifier waferId{SCT_Collection->
identify()};
169 TH1F* pThisHisto{m_phistoVector[
static_cast<int>(waferHash)]};
172 for (; rdoItr != rdoEnd; ++rdoItr) {
174 const int endStrip{(*rdoItr)->getGroupSize() +
strip};
176 pThisHisto->Fill(
strip);