20#include "Identifier/Identifier.h"
23#include "GaudiKernel/ITHistSvc.h"
28#include "TFileCollection.h"
33static const std::string
detectorNames[] {
"negativeEndcap",
"barrel",
"positiveEndcap"};
37 base_class(
type, name, parent)
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) {
86 std::string histotitle{std::string{
"SCT "} +
detectorNames[
bec2Index(bec)] + std::string{
" Hitmap: plane "} + formattedPosition};
88 TH1F* hitmapHisto_tmp{
new TH1F{TString{formattedPosition}, TString{histotitle},
nbins,
firstStrip-0.5,
lastStrip+0.5}};
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())};
106 ATH_MSG_INFO(
"opening Hitmap file : " << fileName.c_str());
108 if (fileHitmap==
nullptr) {
109 ATH_MSG_ERROR(
"can not open Hitmap file : " << fileName.c_str());
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) {
149 TH1F* pThisHisto{m_phistoVector[
index]};
151 pThisHisto->Fill(
strip);
160 m_numberOfEventsHisto->Fill(1);
165 for (; itr !=end; ++itr) {
167 if (not SCT_Collection)
continue;
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);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
header file for the SCTCalibUtilities
Handle class for reading from StoreGate.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This is a "hash" representation of an Identifier.
virtual Identifier identify() const override final
std::vector< Identifier >::const_iterator const_id_iterator
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string formatPosition(const Identifier &waferId, const SCT_ID *helper, const std::string &delimiter, const bool includeSide)
unsigned int bec2Index(const int bec)