21#include "GaudiKernel/ITHistSvc.h"
22#include "GaudiKernel/SystemOfUnits.h"
31using Gaudi::Units::GeV;
85 return StatusCode::FAILURE;
90 return StatusCode::SUCCESS;
128 m_trees.insert(std::pair<std::string, TTree*>(name,
tree));
133 SmartIF<ITHistSvc> tHistSvc{service(
"THistSvc")};
139 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree!" );
140 return StatusCode::FAILURE;
146 m_h_events =
new TH1F(
"h_events",
"total events", 10, 0, 10);
150 return StatusCode::FAILURE;
153 ATH_MSG_INFO(
"Calibration Tree booked and registered successfully!");
155 return StatusCode::SUCCESS;
167 float ev_weight = evt->mcEventWeight();
170 if (not truths)
return StatusCode::FAILURE;
173 if (not vertices)
return StatusCode::FAILURE;
176 float mu= evt->averageInteractionsPerCrossing();
181 for (
const auto vertex : *vertices) {
182 if (vertex->nTrackParticles()>=2)
205 for (
const auto truth: *truths) {
209 std::vector<const xAOD::Jet*> matched = {};
214 if (Nmatches==0)
continue;
259 return StatusCode::SUCCESS;
269 for (
unsigned int ind = 0; ind < jets->size(); ind++) {
270 double dr = truth->
p4().DeltaR(jets->at(ind)->p4());
280 matched.push_back(jets->at(Min_index));
290 for (
const auto jet : *jets) {
291 if (PtMin>0. and
jet->pt()<PtMin)
continue;
292 double Dr = myjet->
p4().DeltaR(
jet->p4());
293 if (Dr>0.0001 and Dr<
DRmin)
303 const auto& partLinks =
jet->constituentLinks();
306 if (not link.isValid()) {
314 float det_eta = tcc->
eta();
317 det_eta = acc_detEta(*tcc);
319 ATH_MSG_WARNING(
"DetectorEta decoration not found for TCCs! Using eta...");
321 double pt = tcc->
p4().P()/cosh(det_eta);
324 p4CorrCl.SetPtEtaPhiE(pt, det_eta, tcc->
p4().Phi(), tcc->
p4().E());
325 if(tcc->
p4().E() < 0.) p4CorrCl*=-1.;
355 return StatusCode::SUCCESS;
#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:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
SG::Accessor< T, ALLOC > Accessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Jet_v1 Jet
Definition of the current "jet version".
IParticleLink_v1 IParticleLink
Define the latest version of the IParticleLink class.
TrackCaloCluster_v1 TrackCaloCluster
Reference the current persistent version:
JetContainer_v1 JetContainer
Definition of the current "jet container version".