![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
19 #include "GaudiKernel/IToolSvc.h"
50 EgammaPhysValMonitoringTool::EgammaPhysValMonitoringTool(
const std::string&
type,
51 const std::string&
name,
52 const IInterface*
parent ):
54 m_oElectronValidationPlots(nullptr,
"Electron/"),
55 m_oPhotonValidationPlots(nullptr,
"Photon/"),
56 m_oLRTElectronValidationPlots(nullptr,
"LRTElectron/"),
57 m_acc_electronLLH_VeryLooseNoPix(
"DFCommonElectronsLHVeryLooseNoPix"),
58 m_acc_electronLLH_LooseNoPix(
"DFCommonElectronsLHLooseNoPix"),
59 m_acc_electronLLH_MediumNoPix(
"DFCommonElectronsLHMediumNoPix"),
60 m_acc_electronLLH_TightNoPix(
"DFCommonElectronsLHTightNoPix")
83 return StatusCode::SUCCESS;
113 return StatusCode::SUCCESS;
123 const EventContext& ctx = Gaudi::Hive::currentContext();
139 for (
const auto*
const truthParticle : *truthParticles) {
142 if (std::abs(truthParticle->pdgId()) == 11 &&
151 if (std::abs(truthParticle->pdgId()) == 22 &&
160 bool isTrueConv =
false;
163 if (
tmp &&
tmp->hasDecayVtx()) {
164 float x =
tmp->decayVtx()->x();
165 float y =
tmp->decayVtx()->y();
166 trueR = std::sqrt(
x *
x +
y *
y);
169 if (
tmp !=
nullptr) {
199 bool val_loose =
false;
206 *truthParticle, *eventInfo);
209 *truthParticle, *eventInfo);
212 bool val_tight =
false;
219 *truthParticle, *eventInfo);
222 *truthParticle, *eventInfo);
235 bool elecPrompt =
false;
236 bool photonPrompt =
false;
238 for (
const auto*
const truthallParticle :
239 *truthallParticles) {
243 if (std::abs(truthallParticle->pdgId()) == 11 &&
263 if (std::abs(truthallParticle->pdgId()) == 22 &&
278 if (truthallParticle->pt() /
GeV > 20. &&
279 fabs(truthallParticle->eta()) < 2.47) {
285 float convTruthR = 9999.;
286 if (truthallParticle->decayVtx())
287 convTruthR = truthallParticle->decayVtx()->perp();
292 if (photOutCome ==
Converted && convTruthR < 800.)
294 *truthallParticle, *eventInfo);
297 *truthallParticle, *eventInfo);
306 return StatusCode::FAILURE;
313 return StatusCode::FAILURE;
321 return StatusCode::FAILURE;
326 return StatusCode::FAILURE;
333 return StatusCode::FAILURE;
339 return StatusCode::FAILURE;
344 return StatusCode::FAILURE;
351 return StatusCode::SUCCESS;
360 const EventContext& ctx = Gaudi::Hive::currentContext();
368 for(
const auto *
const electron : *Electrons){
369 bool isElecPrompt=
false;
381 if(
type==MCTruthPartClassifier::IsoElectron) {
386 float EtLin = (
electron->pt()-thePart->
pt())/thePart->
pt();
389 if (thePart->
pt()/
GeV>20.) {
397 ATH_MSG_INFO (
"Truth particle associated not in egamma truth collection");
409 return StatusCode::SUCCESS;
418 const EventContext& ctx = Gaudi::Hive::currentContext();
426 for(
const auto *
const electron : *LRTElectrons){
427 bool isElecPrompt=
false;
432 bool pass_LHVeryLooseNoPix =
false;
436 bool pass_LHLooseNoPix =
false;
440 bool pass_LHMediumNoPix =
false;
444 bool pass_LHTightNoPix =
false;
451 if(
type==MCTruthPartClassifier::IsoElectron) {
456 float EtLin = (
electron->pt()-thePart->
pt())/thePart->
pt();
459 if (thePart->
pt()/
GeV>20.) {
467 ATH_MSG_INFO (
"Truth particle associated not in egamma truth collection");
482 return StatusCode::SUCCESS;
489 const EventContext& ctx = Gaudi::Hive::currentContext();
496 for(
const auto *
const frwdelectron : *ElectronsFrwd){
498 bool isElecPrompt=
false;
500 if((
Match(frwdelectron,11, truthParticles)!=
nullptr )) isElecPrompt=
true;
510 return StatusCode::SUCCESS;
518 const EventContext& ctx = Gaudi::Hive::currentContext();
529 for(
const auto *
photon : *Photons){
530 bool isPhotPrompt=
false;
535 else if(
photon->pt()*0.001<7.) numofTopo++;
548 if(thePart&&thePart->
pt()/
GeV>20.) {
549 float EtLin = (
photon->pt()-thePart->
pt())/thePart->
pt();
552 if (std::abs(EtLin)<0.2){
557 cout<<
"Truth particle associated not in egamma truth collection"<<endl;
561 }
else if(
m_isMC){
if(
Match(
photon,22, truthParticles)!=nullptr ) isPhotPrompt=
true;}
567 numPhotAll = numofPhot+numofTopo+numofAmb;
581 return StatusCode::SUCCESS;
590 return StatusCode::SUCCESS;
598 float currentdr = 0.05;
600 for (
const auto *truthParticle: *truthParticles){
601 if (std::abs(truthParticle->pdgId()) != pdg || !
MC::isStable(truthParticle))
continue;
602 float dr =
particle->p4().DeltaR(truthParticle->p4());
605 matchedTruthParticle = truthParticle;
608 return matchedTruthParticle;
TH1 * nParticles_weighted
Egamma::KinematicsPlots m_oTruthAllPlots
TH2 * convTruthMatchedRvsEta
const xAOD::Photon * getRecoPhoton(const xAOD::TruthParticle *particle)
return the reco photon associated to the given TruthParticle (if any)
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Egamma::KinematicsPlots m_oTruthRecoPlots
Egamma::PhotonPlots m_oTopoPhotPlots
Egamma::KinematicsPlots m_oTruthRecoLooseConvPlots
TProfile * res_et_cut_pt_20
TH1 * nParticles_weighted
TH1 * nParticles_weighted
const uint32_t BADCLUSELECTRON
bool empty() const
Test if the key is blank.
TH1 * m_nParticles_weighted
Egamma::LRTElectronPlots m_oCentralElecPlots
Egamma::KinematicsPlots m_oTruthAllPlots
TProfile * res_et_cut_pt_20
Egamma::KinematicsPlots m_oTruthRecoLoosePlots
Egamma::PhotonPlots m_oAllPlots
std::vector< HistData > retrieveBookedHistograms()
Retrieve all booked histograms.
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
TProfile * res_eta_cut_pt_20
Egamma::KinematicsPlots m_oTruthRecoLooseUncPlots
Egamma::KinematicsPlots m_oTruthRecoTightConvPlots
Egamma::KinematicsPlots m_oTruthRecoUncPlots
const uint16_t AuthorCaloTopo35
Photon reconstructed by SW CaloTopo35 seeded clusters.
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
Egamma::KinematicsPlots m_oTruthAllIsoConvPlots
::StatusCode StatusCode
StatusCode definition for legacy code.
void fill(const xAOD::Electron &electron, const xAOD::EventInfo &eventInfo, bool isPrompt)
Egamma::KinematicsPlots m_oTruthRecoTightPlots
Class describing a truth particle in the MC record.
Egamma::PhotonAmbPlots m_oAmbPhotPlots
TH1 * m_nParticles_weighted
TH1 * m_nParticles_weighted
Egamma::KinematicsPlots m_oTruthAllIsoPlots
Egamma::KinematicsPlots m_oTruthRecoTightUncPlots
Egamma::KinematicsPlots m_oTruthRecoConvPlots
void fill(const xAOD::IParticle &part, const xAOD::EventInfo &eventInfo)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Egamma::KinematicsPlots m_oTruthAllIsoUncPlots
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool isTrueConvertedPhoton(const xAOD::Photon *ph, float maxRadius=800.)
is the object matched to a true converted photon with R < maxRadius
Egamma::KinematicsPlots m_oTruthIsoPlots
Egamma::KinematicsPlots m_oTruthIsoConvPlots
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
Egamma::KinematicsPlots m_oTruthAllPromptPlots
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Class describing the basic event information.
Egamma::KinematicsPlots m_oTruthIsoUncPlots
const_pointer_type ptr()
Dereference the pointer.
const uint32_t BADCLUSPHOTON
bool isStable(const T &p)
Egamma::KinematicsPlots m_oTruthPromptElecPlots
Egamma::ElectronFrwdPlots m_oFrwdElecPlots
TProfile * res_eta_cut_pt_20
Egamma::PhotonCnvPlots m_oConvPhotPlots
const uint16_t AuthorPhoton
Object Reconstructed by standard cluster-based algorithm.
Egamma::ElectronPlots m_oCentralElecPlots
virtual double pt() const override final
The transverse momentum ( ) of the particle.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Egamma::KinematicsPlots m_oTruthAllIsoPlots
Egamma::KinematicsPlots m_oTruthIsoPlots
Helper class to provide constant type-safe access to aux data.
Handle class for reading from StoreGate.
void fill(const xAOD::Electron &electron, const xAOD::EventInfo &eventInfo, bool isPrompt, bool pass_LHVeryLooseNoPix, bool pass_LHLooseNoPix, bool pass_LHMediumNoPix, bool pass_LHTightNoPix)
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
Egamma::PhotonPlots m_oPhotPlots
float beamSpotWeight() const
Weight for beam spot size reweighting.
bool passSelection(bool &value, const std::string &menu) const
Check if the egamma object pass a selection menu (using the name) If the menu decision is stored in t...
const uint16_t AuthorElectron
Object Reconstructed by standard cluster-based algorithm.
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)