Skip to content

Commit

Permalink
Small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cortesep committed Nov 17, 2024
1 parent 375c7b1 commit f291070
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <deque>
#include <gsl/span>
#include <TFile.h>
#include <TAxis.h>
#include <TH1.h>
#include <TH2.h>
#include "Framework/Logger.h"
Expand Down Expand Up @@ -74,6 +75,7 @@ class DigiParser

void setStat(TH1* h);
void setModuleLabel(TH1* h);
void setModuleLabel(TAxis* ax);

int32_t mVerbosity = DbgMinimal;
bool mRejectPileUp = true;
Expand All @@ -87,6 +89,7 @@ class DigiParser
std::unique_ptr<TH1> mCounts[NChannels] = {nullptr};
std::unique_ptr<TH2> mSignalTH[NChannels] = {nullptr};
std::unique_ptr<TH2> mBunchH[NChannels] = {nullptr}; // Bunch pattern Hit
std::unique_ptr<TH2> mAlignment;

int mNBC = 0;
};
Expand Down
14 changes: 14 additions & 0 deletions Detectors/ZDC/reconstruction/src/DigiParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ void DigiParser::init()
if (mFired == nullptr) {
mFired = std::make_unique<TH1F>("hfired", "Fired channels", NChannels, -0.5, NChannels - 0.5);
}
if (mAlignment == nullptr) {
mAlignment = std::make_unique<TH2F>("hmap", "Map of fired channels", o2::constants::lhc::LHCMaxBunches, -0.5, o2::constants::lhc::LHCMaxBunches-0.5, NChannels, -0.5, NChannels - 0.5);
}
for (uint32_t ich = 0; ich < NChannels; ich++) {
if (mBaseline[ich] == nullptr) {
TString hname = TString::Format("hp_%s", ChannelNames[ich].data());
Expand Down Expand Up @@ -133,6 +136,9 @@ void DigiParser::eor()
setModuleLabel(mFired.get());
mFired->SetMinimum(0);
mFired->Write();
setModuleLabel((mAlignment.get())->GetYaxis());
mAlignment->SetMinimum(0);
mAlignment->Write();
f->Close();
}

Expand Down Expand Up @@ -221,6 +227,7 @@ int DigiParser::process(const gsl::span<const o2::zdc::OrbitData>& orbitdata, co
double bc_m = uint32_t(ir.bc % 100);
mBunchH[isig]->Fill(bc_m, -bc_d);
mFired->Fill(isig);
mAlignment->Fill(ir.bc, isig);
}
}
if (bcd == ibn) {
Expand Down Expand Up @@ -280,5 +287,12 @@ void DigiParser::setModuleLabel(TH1* h)
}
}

void DigiParser::setModuleLabel(TAxis* ax)
{
for (uint32_t isig = 0; isig < NChannels; isig++) {
ax->SetBinLabel(isig + 1, ChannelNames[isig].data());
}
}

} // namespace zdc
} // namespace o2

0 comments on commit f291070

Please sign in to comment.