|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #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")
84 return StatusCode::SUCCESS;
112 return StatusCode::SUCCESS;
120 const EventContext& ctx = Gaudi::Hive::currentContext();
136 for (
const auto*
const truthParticle : *truthParticles) {
139 if (std::abs(truthParticle->pdgId()) == 11 &&
148 if (std::abs(truthParticle->pdgId()) == 22 &&
157 bool isTrueConv =
false;
160 if (
tmp &&
tmp->hasDecayVtx()) {
161 float x =
tmp->decayVtx()->x();
162 float y =
tmp->decayVtx()->y();
163 trueR = std::sqrt(
x *
x +
y *
y);
166 if (
tmp !=
nullptr) {
196 bool val_loose =
false;
203 *truthParticle, *eventInfo);
206 *truthParticle, *eventInfo);
209 bool val_tight =
false;
216 *truthParticle, *eventInfo);
219 *truthParticle, *eventInfo);
232 bool elecPrompt =
false;
233 bool photonPrompt =
false;
235 for (
const auto*
const truthallParticle :
236 *truthallParticles) {
240 if (std::abs(truthallParticle->pdgId()) == 11 &&
259 if (std::abs(truthallParticle->pdgId()) == 22 &&
273 if (truthallParticle->pt() /
GeV > 20. &&
274 fabs(truthallParticle->eta()) < 2.47) {
279 float convTruthR = 9999.;
280 if (truthallParticle->decayVtx())
281 convTruthR = truthallParticle->decayVtx()->perp();
286 if (photOutCome ==
Converted && convTruthR < 800.)
288 *truthallParticle, *eventInfo);
291 *truthallParticle, *eventInfo);
300 return StatusCode::FAILURE;
307 return StatusCode::FAILURE;
315 return StatusCode::FAILURE;
320 return StatusCode::FAILURE;
327 return StatusCode::FAILURE;
333 return StatusCode::FAILURE;
338 return StatusCode::FAILURE;
345 return StatusCode::SUCCESS;
352 const EventContext& ctx = Gaudi::Hive::currentContext();
360 for(
const auto *
const electron : *Electrons){
361 bool isElecPrompt=
false;
373 if(
type==MCTruthPartClassifier::IsoElectron) {
378 float EtLin = (
electron->pt()-thePart->
pt())/thePart->
pt();
381 if (thePart->
pt()/
GeV>20.) {
389 ATH_MSG_INFO (
"Truth particle associated not in egamma truth collection");
401 return StatusCode::SUCCESS;
408 const EventContext& ctx = Gaudi::Hive::currentContext();
416 for(
const auto *
const electron : *LRTElectrons){
417 bool isElecPrompt=
false;
422 bool pass_LHVeryLooseNoPix =
false;
426 bool pass_LHLooseNoPix =
false;
430 bool pass_LHMediumNoPix =
false;
434 bool pass_LHTightNoPix =
false;
441 if(
type==MCTruthPartClassifier::IsoElectron) {
446 float EtLin = (
electron->pt()-thePart->
pt())/thePart->
pt();
449 if (thePart->
pt()/
GeV>20.) {
457 ATH_MSG_INFO (
"Truth particle associated not in egamma truth collection");
472 return StatusCode::SUCCESS;
479 const EventContext& ctx = Gaudi::Hive::currentContext();
486 for(
const auto *
const frwdelectron : *ElectronsFrwd){
488 bool isElecPrompt=
false;
490 if((
Match(frwdelectron,11, truthParticles)!=
nullptr )) isElecPrompt=
true;
500 return StatusCode::SUCCESS;
507 const EventContext& ctx = Gaudi::Hive::currentContext();
518 for(
const auto *
photon : *Photons){
519 bool isPhotPrompt=
false;
527 else if(
photon->pt()*0.001<7.) numofTopo++;
540 if(thePart&&thePart->
pt()/
GeV>20.) {
541 float EtLin = (
photon->pt()-thePart->
pt())/thePart->
pt();
544 if (std::abs(EtLin)<0.2){
549 cout<<
"Truth particle associated not in egamma truth collection"<<endl;
553 }
else if(
m_isMC){
if(
Match(
photon,22, truthParticles)!=nullptr ) isPhotPrompt=
true;}
559 numPhotAll = numofPhot+numofTopo+numofAmb;
573 return StatusCode::SUCCESS;
581 return StatusCode::SUCCESS;
587 float currentdr = 0.05;
590 for (
const auto *truthParticle: *truthParticles){
591 if (std::abs(truthParticle->pdgId()) != pdg || !
MC::isStable(truthParticle))
continue;
592 float dr =
particle->p4().DeltaR(truthParticle->p4());
595 matchedTruthParticle = truthParticle;
599 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
bool passOQquality(const xAOD::Photon &ph)
Helper to ease the implemmantation of the pass Quality requirements.
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)
Identify if the particle is stable, i.e. has not decayed.
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)