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;
51 const EventContext& ctx = Gaudi::Hive::currentContext();
57 return StatusCode::SUCCESS;
64 return StatusCode::SUCCESS;
76 return StatusCode::SUCCESS;
78 if(vertices->size() <= 1)
81 return StatusCode::SUCCESS;
88 return StatusCode::SUCCESS;
95 return StatusCode::SUCCESS;
98 int currentLB = eventInfo->lumiBlock();
99 int currentRun = eventInfo->runNumber();
105 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));
106 if (newHistTileWeights ==
nullptr)
108 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);
109 return StatusCode::SUCCESS;
117 float fcalEt = hiEventShape->at(5)->et()*1e-6;
121 return StatusCode::SUCCESS;
124 for(
const auto* cluster : *caloClusters)
126 float eta = cluster->eta();
127 float phi = cluster->phi();
129 float ET = cluster->e() * 1e-3 / std::cosh(
eta);
131 currentHistTileWeights->Fill(binID, 1, fcalEt);
132 currentHistTileWeights->Fill(binID, 2, ET);
133 currentHistTileWeights->Fill(binID, 3, fcalEt*fcalEt);
134 currentHistTileWeights->Fill(binID, 4, ET*ET);
135 currentHistTileWeights->Fill(binID, 5, fcalEt*ET);
136 currentHistTileWeights->Fill(binID, 6, 1.);
139 return StatusCode::SUCCESS;
144 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 with parameters:
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
Gaudi::Property< float > m_minFCalET
virtual StatusCode execute() override
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