34AsgPhotonIsEMSelector::AsgPhotonIsEMSelector(
const std::string& myname)
42 declareProperty(
"WorkingPoint", m_WorkingPoint =
"",
"The Working Point");
43 declareProperty(
"ConfigFile",
45 "The config file to use (if not setting cuts one by one)");
50 m_rootTool->m_isEMMask =
55 declareProperty(
"ForceConvertedPhotonPID",
56 m_rootTool->m_forceConvertedPhotonPID =
false,
57 "boolean to force to test converted photon hypothesis");
60 declareProperty(
"ForceNonConvertedPhotonPID",
61 m_rootTool->m_forceNonConvertedPhotonPID =
false,
62 "boolean to force to test non converted photon hypothesis");
66 declareProperty(
"useF3core", m_useF3core =
false,
"Cut on f3 or f3core?");
69 declareProperty(
"caloOnly",
71 "Flag to tell the tool if its a calo only cutbase");
72 declareProperty(
"trigEtTh", m_trigEtTh = -999.,
"Trigger threshold");
74 declareProperty(
"skipAmbiguityCut",m_skipAmbiguityCut =
false,
75 "If true, it will skip the ambiguity cut. This is useful for HLT photon emulation");
77 declareProperty(
"removeTRTConversion", m_removeTRTConversion =
true,
78 "boolean to treat barrel standalone TRT conversion as unconverted for Run3 ");
99 if (filename.empty()) {
101 return StatusCode::FAILURE;
104 env.ReadFile(filename.c_str(), kEnvLocal);
115 m_rootTool->m_cutBinEnergy_photonsNonConverted =
121 m_rootTool->m_cutHadLeakage_photonsNonConverted =
129 m_rootTool->m_cutBinEtaStrips_photonsNonConverted =
131 m_rootTool->m_cutBinEnergyStrips_photonsNonConverted =
133 m_rootTool->m_cutBinMuStrips_photonsNonConverted =
157 m_rootTool->m_cutHadLeakage_photonsConverted =
165 m_rootTool->m_cutBinEtaStrips_photonsConverted =
167 m_rootTool->m_cutBinEnergyStrips_photonsConverted =
169 m_rootTool->m_cutBinMuStrips_photonsConverted =
196 ATH_MSG_ERROR(
"Could not initialize the TPhotonIsEMSelector!");
197 return StatusCode::FAILURE;
202 !
m_rootTool->m_cutBinMu_photonsNonConverted.empty() ||
203 !
m_rootTool->m_cutBinMu_photonsConverted.empty() ||
204 !
m_rootTool->m_cutBinMuStrips_photonsNonConverted.empty() ||
205 !
m_rootTool->m_cutBinMuStrips_photonsConverted.empty();
210 return StatusCode::SUCCESS;
243 "AsgElectronIsEMSelector::could not convert argument to Photon/Electron");
252 unsigned int isEM = ~0;
254 if (
sc.isFailure()) {
261 ATH_MSG_ERROR(
"AsgElectronIsEMSelector::accept was given a bad argument");
307 return "No cuts applied";
310 ATH_MSG_ERROR(
"Didn't recognize the given operating point with mask: "
320 unsigned int& isEM)
const
336 return StatusCode::SUCCESS;
341 if (cluster ==
nullptr) {
342 ATH_MSG_ERROR(
"exiting because cluster is NULL " << cluster);
345 return StatusCode::SUCCESS;
350 const float eta2 = fabsf(cluster->
etaBE(2));
352 const double energy = cluster->
e();
355 const double cosheta = cosh(eta2);
356 et = (cosheta != 0.) ? energy / cosheta : 0.;
425 bool excludeTRT =
false;
454 int AmbiguityType = acc(*eg);
461 return StatusCode::SUCCESS;
470 return evtI->actualInteractionsPerCrossing();
479 return evtI->runNumber();
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
float getMu(const EventContext &ctx) const
std::string m_configFile
Config File.
virtual const asg::AcceptInfo & getAcceptInfo() const
Method to get the plain AcceptInfo.
virtual asg::AcceptData accept(const xAOD::IParticle *part) const
Accept with generic interface.
std::string m_WorkingPoint
Working Point.
bool m_caloOnly
Flag for calo only cut-base.
int RunNumber(const EventContext &ctx) const
bool m_removeTRTConversion
Root::TPhotonIsEMSelector * m_rootTool
Pointer to the underlying ROOT based tool.
ASG_TOOL_CLASS3(AsgPhotonIsEMSelector, IAsgPhotonIsEMSelector, IAsgEGammaIsEMSelector, IAsgSelectionTool) public ~AsgPhotonIsEMSelector()
Default constructor.
SG::ReadHandleKey< xAOD::EventInfo > m_EvtInfoKey
virtual std::string getOperatingPointName() const
Method to get the operating point.
virtual StatusCode execute(const EventContext &ctx, const xAOD::Egamma *eg, unsigned int &isEM) const
The basic isem.
bool m_useF3core
use f3core or f3 (default: use f3)
virtual StatusCode initialize()
AlgTool initialize method.
SG::Accessor< T, ALLOC > Accessor
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual double e() const
The total energy of the particle.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Class providing the definition of the 4-vector interface.
static std::vector< uint32_t > runnumber
unsigned int findMask(const std::string &input, const std::map< std::string, unsigned int > &maskmap)
std::string findConfigFile(const std::string &input, const std::map< std::string, std::string > &configmap)
std::vector< float > HelperFloat(const std::string &input, TEnv &env)
const std::map< std::string, std::string > PhotonCutPointToConfFile
const std::map< std::string, unsigned int > PhotonCutPointToMask
const unsigned int PhotonLooseEF
TrigEgamma Pid Definitions.
const unsigned int PhotonMediumEF
Medium photon selection for online EF.
const unsigned int PhotonMedium
Medium photon selection.
@ AmbiguityResolution_Photon
ambiguity resolution for photon (vs electron)
@ ClusterEtaRange_Photon
cluster eta range
const unsigned int PhotonLoose
Loose photon selection.
const unsigned int PhotonTight
Tight photon selection.
const unsigned int EgPidUndefined
@ Photon
The object is a photon.
@ Electron
The object is an electron.
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Amg::Vector3D momentumAtVertex(const xAOD::Photon *, bool debug=false)
return the momentum at the vertex (which can be 0)
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
@ wtots1
shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips...
@ f3core
E3(3x3)/E fraction of the energy reconstructed in the third compartment of the electromagnetic calori...
@ e277
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 7x7
@ f3
fraction of energy reconstructed in 3rd sampling
@ f1
E1/E = fraction of energy reconstructed in the first sampling, where E1 is energy in all strips belon...
@ Eratio
(emaxs1-e2tsts1)/(emaxs1+e2tsts1)
@ fracs1
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strip...
@ weta2
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...
@ weta1
shower width using +/-3 strips around the one with the maximal energy deposit: w3 strips = sqrt{sum(E...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".
Extra patterns decribing particle interation process.