35AsgElectronIsEMSelector::AsgElectronIsEMSelector(
const std::string& myname)
44 declareProperty(
"WorkingPoint", m_WorkingPoint =
"",
"The Working Point");
45 declareProperty(
"ConfigFile",
47 "The config file to use (if not setting cuts one by one)");
52 m_rootTool->m_isEMMask =
56 declareProperty(
"useF3core", m_useF3core =
false,
"Cut on f3 or f3core?");
59 declareProperty(
"caloOnly",
61 "Flag to tell the tool if its a calo only cutbase");
62 declareProperty(
"trigEtTh", m_trigEtTh = -999.,
"Trigger threshold");
77 StatusCode
sc = StatusCode::SUCCESS;
86 if (filename.empty()) {
88 sc = StatusCode::FAILURE;
92 env.ReadFile(filename.c_str(), kEnvLocal);
99 int mask(env.GetValue(
"isEMMask", default_mask));
100 m_rootTool->m_isEMMask =
static_cast<unsigned int>(mask);
104 bool useTRTOutliers(env.GetValue(
"useTRTOutliers",
true));
105 m_rootTool->m_useTRTOutliers = useTRTOutliers;
106 bool useTRTXenonHits(env.GetValue(
" useTRTXenonHits",
false));
107 m_rootTool->m_useTRTXenonHits = useTRTXenonHits;
162 ATH_MSG_ERROR(
"Could not initialize the TElectronIsEMSelector!");
163 sc = StatusCode::FAILURE;
186 return accept(Gaudi::Hive::currentContext(), part);
200 "AsgElectronIsEMSelector::could not convert argument to Electron/Photon");
210 unsigned int isEM = ~0;
212 if (
sc.isFailure()) {
219 ATH_MSG_ERROR(
"AsgElectronIsEMSelector::accept was given a bad argument");
275 return "0 No cuts applied";
278 ATH_MSG_INFO(
"Didn't recognize the given operating point with mask: "
287 unsigned int& isEM)
const
300 return StatusCode::SUCCESS;
304 if (cluster ==
nullptr) {
308 return StatusCode::SUCCESS;
311 const float eta2 = fabsf(cluster->
etaBE(2));
313 const double energy = cluster->
e();
316 double et = (cosh(eta2) != 0.) ? energy / cosh(eta2) : 0.;
324 if (el && el->trackParticle() && !
m_caloOnly) {
325 et = (cosh(el->trackParticle()->eta()) != 0.)
326 ? energy / cosh(el->trackParticle()->eta())
334 if (el && el->trackParticle() && !
m_caloOnly) {
338 return StatusCode::SUCCESS;
347 unsigned int iflag)
const
372 bool allFound =
true;
453 unsigned int iflag)
const
467 ATH_MSG_ERROR(
"Something is bad with the variables as passed");
474 uint8_t nSiHitsPlusDeadSensors =
476 uint8_t nPixHitsPlusDeadSensors =
478 bool passBLayerRequirement =
482 uint8_t nTRThigh = 0;
483 uint8_t nTRThighOutliers = 0;
485 uint8_t nTRTOutliers = 0;
486 uint8_t nTRTXenonHits = 0;
489 bool allFound =
true;
503 const float trackd0 = fabsf(t->d0());
509 allFound = allFound && eg->trackCaloMatchValue(
511 allFound = allFound && eg->trackCaloMatchValue(
515 const double ep = energy * fabs(t->qOverP());
526 passBLayerRequirement,
527 nPixHitsPlusDeadSensors,
528 nSiHitsPlusDeadSensors,
#define ATH_MSG_WARNING(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Root::TElectronIsEMSelector * m_rootTool
Pointer to the underlying ROOT based tool.
bool m_caloOnly
Flag for calo only cut-base.
std::string m_WorkingPoint
Working Point.
virtual StatusCode execute(const EventContext &ctx, const xAOD::Egamma *eg, unsigned int &isEM) const override final
Add a legacy execute method - return isEM value.
virtual asg::AcceptData accept(const xAOD::IParticle *part) const override final
Accept with generic interface.
unsigned int calocuts_electrons(const xAOD::Egamma *eg, float eta2, double et, double trigEtTh, unsigned int iflag) const
virtual StatusCode initialize() override
Gaudi Service Interface method implementations.
bool m_useF3core
use f3core or f3 (default: use f3)
virtual std::string getOperatingPointName() const override final
Method to get the operating point.
unsigned int TrackCut(const xAOD::Electron *eg, float eta2, double et, double energy, unsigned int iflag) const
virtual ASG_TOOL_CLASS3(AsgElectronIsEMSelector, IAsgElectronIsEMSelector, IAsgEGammaIsEMSelector, IAsgSelectionTool) public ~AsgElectronIsEMSelector()
Standard constructor.
std::string m_configFile
Config File.
virtual const asg::AcceptInfo & getAcceptInfo() const override final
Method to get the plain AcceptInfo.
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.
std::vector< int > HelperInt(const std::string &input, TEnv &env)
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 > ElectronCutPointToConfFile
std::size_t numberOfPixelHitsAndDeadSensors(const xAOD::TrackParticle &tp)
return the number of Pixel hits plus dead sensors in the track particle
bool passBLayerRequirement(const xAOD::TrackParticle &tp)
return true if effective number of BL hits + outliers is at least one
std::size_t numberOfSiliconHitsAndDeadSensors(const xAOD::TrackParticle &tp)
return the number of Silicon hits plus dead sensors in the track particle
const unsigned int ElectronMediumHLT
Medium 2014 tunes electron selecton.
const unsigned int ElectronLoose1
Electron trigger PID definitions.
const unsigned int ElectronTightHLT
Tight 2014 tunes electron selecton.
const unsigned int ElectronLooseHLT
Loose 2014 tunes electron selection.
const unsigned int ElectronTightPP
Tight++ electron selecton.
const unsigned int ElectronTight1
Tight1 tunes electron selecton.
const unsigned int ElectronMediumPP
Medium++ electron selecton.
const unsigned int ElectronLoosePP
Loose++ electron selection.
const unsigned int ElectronMedium1
Medium1 tunes electron selecton.
@ ClusterEtaRange_Electron
cluster eta range
const unsigned int EgPidUndefined
@ Photon
The object is a photon.
@ Electron
The object is an electron.
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
@ deltaEta1
difference between the cluster eta (first sampling) and the eta of the track extrapolated to the firs...
@ 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.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Egamma_v1 Egamma
Definition of the current "egamma version".
Photon_v1 Photon
Definition of the current "egamma version".
@ numberOfTRTHighThresholdOutliers
number of TRT high threshold outliers (only xenon counted) [unit8_t].
@ numberOfTRTXenonHits
number of TRT hits on track in straws with xenon [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
@ numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold (only xenon counted) [unit8_t].
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
Electron_v1 Electron
Definition of the current "egamma version".
Extra patterns decribing particle interation process.