14 auto hist = std::make_unique<TH2F>(histName.c_str(), histTitle.c_str(), numBinsX, xMin, xMax, numBinsY, yMin, yMax);
15 if(
m_thistSvc->regHist(
"/" +
m_histStream +
"/" + histName, std::unique_ptr<TH1>(std::move(hist))).isFailure())
20 TH1 * tmpHist =
nullptr;
26 return static_cast<TH1*
>(tmpHist);
43 return StatusCode::FAILURE;
46 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
63 return StatusCode::SUCCESS;
75 return StatusCode::SUCCESS;
77 if(vertices->size() <= 1)
80 return StatusCode::SUCCESS;
87 return StatusCode::SUCCESS;
94 return StatusCode::SUCCESS;
97 int currentLB = eventInfo->lumiBlock();
98 int currentRun = eventInfo->runNumber();
104 TH2F * newHistTileWeights =
static_cast<TH2F*
>(
regAndGetTHF(Form(
"h_clusterET_fcalET_%d_%d",currentRun,currentLB),
";bin ID;sum FCalET/clusterET/FCalET^2/clusterET^2/FCalET*clusterET/n_{events}",
m_totalBins, -0.5,
m_totalBins-0.5, 6,0.5,6.5));
105 if (newHistTileWeights ==
nullptr)
107 ATH_MSG_WARNING(
"Could not create histogram "<<Form(
"h_clusterET_fcalET_%d_%d",currentRun,currentLB)<<
" that was supposed to be used for Run "<<currentRun<<
" LB "<<currentLB);
108 return StatusCode::SUCCESS;
116 float fcalEt = hiEventShape->at(5)->et()*1e-6;
120 return StatusCode::SUCCESS;
123 for(
const auto* cluster : *caloClusters)
125 float eta = cluster->eta();
126 float phi = cluster->phi();
128 float ET = cluster->e() * 1e-3 / std::cosh(
eta);
130 currentHistTileWeights->Fill(binID, 1, fcalEt);
131 currentHistTileWeights->Fill(binID, 2, ET);
132 currentHistTileWeights->Fill(binID, 3, fcalEt*fcalEt);
133 currentHistTileWeights->Fill(binID, 4, ET*ET);
134 currentHistTileWeights->Fill(binID, 5, fcalEt*ET);
135 currentHistTileWeights->Fill(binID, 6, 1.);
138 return StatusCode::SUCCESS;
143 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
HIClusterGeo_HistoFiller(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_hiEventShapeKey
TH1 * regAndGetTHF(const std::string &histName, const std::string &histTitle, int numBinsX, double xMin, double xMax, int numBinsY, double yMin, double yMax)
ServiceHandle< ITHistSvc > m_thistSvc
Gaudi::Property< std::string > m_histStream
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Gaudi::Property< float > m_minFCalET
virtual StatusCode finalize() override
Gaudi::Property< float > m_maxFCalET
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterContainerKey
std::unordered_map< int, TH2F * > m_histTileWeights
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
@ Tile
The Tile calorimeter.
@ Core
Core flags describing the event.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles