23#include "Identifier/Identifier.h"
39static const std::string
detectorNames[] {
"negativeEndcap",
"barrel",
"positiveEndcap"};
43 base_class(
type, name, parent)
57 ATH_CHECK(detStore()->retrieve(manager,
"SCT"));
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) {
112 std::string histotitle{std::string{
"SCT "} +
detectorNames[
bec2Index(bec)] + std::string{
" Hitmap: plane "} + formattedPosition};
113 std::string formattedPosition2D{formattedPosition +
"_2D"};
114 std::string name2D{hitmapPaths[
bec2Index(
m_pSCTHelper->barrel_ec(waferId))] + formattedPosition +
"_2D"};
116 if (m_thistSvc->regHist(name2D.c_str(), hitmapHistoLB_tmp2D).isFailure()) {
119 m_phistoVector2D.push_back(hitmapHistoLB_tmp2D);
124 const std::string formattedChipPosition{formattedPosition + std::to_string(chipId)};
126 const std::string histTitle{std::string{
"SCT"} +
detectorNames[
bec2Index(bec)] + std::string{
" LB: chip "} + formattedChipPosition};
127 TH1F* hist_tmp{
new TH1F{TString{formattedChipPosition}, TString{histTitle},
m_LbRange, 0.5,
m_LbRange+0.5}};
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"));
149 ATH_MSG_ERROR(
"can not open LB file : " << fileName.c_str());
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);
174 const std::string hname{
detectorPaths[
bec2Index(bec)] +
"/" + formattedPosition + std::to_string(chipId)};
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;
236 TH2F* pThisHisto2D{m_phistoVector2D[
static_cast<int>(waferHash)]};
240 for (; rdoItr != rdoItrE; ++rdoItr ) {
241 int theFirstStrip{
m_pSCTHelper->strip((*rdoItr)->identify())};
244 const int endStrip{(*rdoItr)->getGroupSize() +
strip};
246 pThisHisto2D->Fill(
strip, m_lumiBlock );
249 int rdoGroupSize{(*rdoItr)->getGroupSize()};
262 for (
int j{0}; j != groupSize; ++j) {
263 m_phistoVector[
index]->Fill(m_lumiBlock);
#define ATH_CHECK
Evaluate an expression and check for errors.
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Implementation file for the SCT_CalibEventInfo class.
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.
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
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)