diff --git a/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx b/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx index 3abd095862eb66683653580edef228e2de83af55..a3698caab17fd1e947c01ccb935ce2624e87ec82 100644 --- a/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx +++ b/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx @@ -24,7 +24,7 @@ namespace xAOD { // Implementation of the SV0 accessor functions // - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, SV0_significance3D, setSV0_significance3D ) @@ -94,11 +94,11 @@ namespace xAOD { // Implementation of the SV1 accessor functions // - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, SV1_pb, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, SV1_pb, setSV1_pb ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, SV1_pu, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, SV1_pu, setSV1_pu ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, SV1_pc, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, SV1_pc, setSV1_pc ) // The accessor object(s): @@ -167,11 +167,11 @@ namespace xAOD { // Implementation of the IP2D accessor functions // - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, IP2D_pb, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, IP2D_pb, setIP2D_pb ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, IP2D_pu, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, IP2D_pu, setIP2D_pu ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, IP2D_pc, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, IP2D_pc, setIP2D_pc ) // The accessor object(s): @@ -241,11 +241,11 @@ namespace xAOD { // Implementation of the IP3D accessor functions // - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, IP3D_pb, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, IP3D_pb, setIP3D_pb ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, IP3D_pu, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, IP3D_pu, setIP3D_pu ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, IP3D_pc, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, IP3D_pc, setIP3D_pc ) // The accessor object(s): @@ -315,33 +315,13 @@ namespace xAOD { // Implementation of the JetFitter accessor functions // - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, JetFitter_pb, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, JetFitter_pb, setJetFitter_pb ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, JetFitter_pu, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, JetFitter_pu, setJetFitter_pu ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, JetFitter_pc, + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, JetFitter_pc, setJetFitter_pc ) - // - ///////////////////////////////////////////////////////////////////////////// - - ///////////////////////////////////////////////////////////////////////////// - // - // Implementation of the JetFitterComb accessor functions - // - - //AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, JetFitterCombNN_pb, - // setJetFitterCombNN_pb ) - //AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, JetFitterCombNN_pu, - // setJetFitterCombNN_pu ) - //AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, JetFitterCombNN_pc, - // setJetFitterCombNN_pc ) - - // - ///////////////////////////////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////////////////////////////// // // Implementation of generic tagger weight accessor functions @@ -350,14 +330,14 @@ namespace xAOD { // and background hypotheses (default: b and light) bool BTagging_v1::loglikelihoodratio( const std::string& taggername, - double &value, // return value + double &value, // return value const std::string& signal, const std::string& bckgd ) const { value = -1.; // default value if tagger is undefined - double pu = 1.; - double pb = 1.; - bool puvalid = variable<double>(taggername, bckgd , pu); - bool pbvalid = variable<double>(taggername, signal, pb); + ftagfloat_t pu = 1.; + ftagfloat_t pb = 1.; + bool puvalid = variable<ftagfloat_t>(taggername, bckgd , pu); + bool pbvalid = variable<ftagfloat_t>(taggername, signal, pb); if( !pbvalid || !puvalid ) return false; if("IP3D"==taggername&&pb==1.&&pu==1.e9) { value = 0.; @@ -368,8 +348,8 @@ namespace xAOD { } - double BTagging_v1::calcLLR(double numerator, double denominator) const { - double val = 0.; + ftagfloat_t BTagging_v1::calcLLR(double numerator, double denominator) const { + ftagfloat_t val = 0.; if(numerator<=0.) { val = -30.; } else if(denominator<=0.) { @@ -381,27 +361,40 @@ namespace xAOD { } bool BTagging_v1::pu(const std::string& taggername, double &value) const { - return variable<double>(taggername, "pu", value); + ftagfloat_t tmp = 0.; + bool output = variable<ftagfloat_t>(taggername, "pu", tmp); + if ( output ) value = tmp; + return output; } bool BTagging_v1::pb(const std::string& taggername, double &value) const { - return variable<double>(taggername, "pb", value); + ftagfloat_t tmp = 0.; + bool output = variable<ftagfloat_t>(taggername, "pb", tmp); + if ( output ) value = tmp; + return output; } bool BTagging_v1::pc(const std::string& taggername, double &value) const { - return variable<double>(taggername, "pc", value); + ftagfloat_t tmp = 0.; + bool output = variable<ftagfloat_t>(taggername, "pc", tmp); + if ( output ) value = tmp; + return output; } bool BTagging_v1::MVx_discriminant(const std::string& taggername, double &value) const { - return variable<double>(taggername, "discriminant", value); + ftagfloat_t tmp = 0.; + bool output = variable<ftagfloat_t>(taggername, "discriminant", tmp); + if ( output ) value = tmp; + return output; } - - // - ///////////////////////////////////////////////////////////////////////////// + // + ///////////////////////////////////////////////////////////////////////////// + + + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, ftagfloat_t, MV1_discriminant, + setMV1_discriminant ) - AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagging_v1, double, MV1_discriminant, - setMV1_discriminant ) ///////////////////////////////////////////////////////////////////////////// // diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/ftagfloat_t.h b/Event/xAOD/xAODBTagging/xAODBTagging/ftagfloat_t.h similarity index 90% rename from PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/ftagfloat_t.h rename to Event/xAOD/xAODBTagging/xAODBTagging/ftagfloat_t.h index 2576ccf201145feefa5fb3bccafb31be23dda54c..56478d1cae628b0ff6ff038313272ef05f73abca 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/ftagfloat_t.h +++ b/Event/xAOD/xAODBTagging/xAODBTagging/ftagfloat_t.h @@ -9,6 +9,6 @@ /// https://its.cern.ch/jira/browse/ATLASRECTS-5201 /// -using ftagfloat_t = double; +using ftagfloat_t = float; #endif diff --git a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingAuxContainer_v1.h b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingAuxContainer_v1.h index f780c35022ce4994f03067bb084f94f6e7634e45..de0c5e9185abacb1229008c5f2fca0b7579e96ec 100644 --- a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingAuxContainer_v1.h +++ b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingAuxContainer_v1.h @@ -16,6 +16,8 @@ #include "xAODCore/AuxContainerBase.h" #include "xAODTracking/TrackParticleContainer.h" +#include "xAODBTagging/ftagfloat_t.h" + namespace xAOD { /// Temporary container used until we have I/O for AuxStoreInternal @@ -37,33 +39,33 @@ namespace xAOD { private: - std::vector<double> SV0_significance3D; + std::vector<ftagfloat_t> SV0_significance3D; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > SV0_TrackParticles; - std::vector<double> SV1_pb; - std::vector<double> SV1_pu; - std::vector<double> SV1_pc; + std::vector<ftagfloat_t> SV1_pb; + std::vector<ftagfloat_t> SV1_pu; + std::vector<ftagfloat_t> SV1_pc; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > SV1_TrackParticles; - std::vector<double> IP2D_pb; - std::vector<double> IP2D_pu; - std::vector<double> IP2D_pc; + std::vector<ftagfloat_t> IP2D_pb; + std::vector<ftagfloat_t> IP2D_pu; + std::vector<ftagfloat_t> IP2D_pc; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > IP2D_TrackParticles; - std::vector<double> IP3D_pb; - std::vector<double> IP3D_pu; - std::vector<double> IP3D_pc; + std::vector<ftagfloat_t> IP3D_pb; + std::vector<ftagfloat_t> IP3D_pu; + std::vector<ftagfloat_t> IP3D_pc; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > IP3D_TrackParticles; - std::vector<double> JetFitter_pb; - std::vector<double> JetFitter_pu; - std::vector<double> JetFitter_pc; + std::vector<ftagfloat_t> JetFitter_pb; + std::vector<ftagfloat_t> JetFitter_pu; + std::vector<ftagfloat_t> JetFitter_pc; - std::vector<double> JetFitterCombNN_pb; - std::vector<double> JetFitterCombNN_pu; - std::vector<double> JetFitterCombNN_pc; + std::vector<ftagfloat_t> JetFitterCombNN_pb; + std::vector<ftagfloat_t> JetFitterCombNN_pu; + std::vector<ftagfloat_t> JetFitterCombNN_pc; - std::vector<double> MV1_discriminant; + std::vector<ftagfloat_t> MV1_discriminant; }; // class BTaggingAuxContainer_v1 diff --git a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingTrigAuxContainer_v1.h b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingTrigAuxContainer_v1.h index 730372a0a7986dc91a62b0686111b4e6df3c4aff..be02dbda3913417f7a8d16f2e0409248c146f3cc 100644 --- a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingTrigAuxContainer_v1.h +++ b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTaggingTrigAuxContainer_v1.h @@ -19,6 +19,8 @@ //#include "xAODVertex/VertexContainer.h" #include "xAODBTagging/BTagVertexContainer.h" +#include "xAODBTagging/ftagfloat_t.h" + namespace xAOD { /// Temporary container used until we have I/O for AuxStoreInternal @@ -40,40 +42,40 @@ namespace xAOD { private: - std::vector< double > SV0_significance3D; + std::vector< ftagfloat_t > SV0_significance3D; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > SV0_TrackParticles; - std::vector< double > SV1_pb; - std::vector< double > SV1_pu; - std::vector< double > SV1_pc; + std::vector< ftagfloat_t > SV1_pb; + std::vector< ftagfloat_t > SV1_pu; + std::vector< ftagfloat_t > SV1_pc; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > SV1_TrackParticles; - std::vector< double > IP2D_pb; - std::vector< double > IP2D_pu; - std::vector< double > IP2D_pc; + std::vector< ftagfloat_t > IP2D_pb; + std::vector< ftagfloat_t > IP2D_pu; + std::vector< ftagfloat_t > IP2D_pc; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > IP2D_TrackParticles; - std::vector< double > IP3D_pb; - std::vector< double > IP3D_pu; - std::vector< double > IP3D_pc; + std::vector< ftagfloat_t > IP3D_pb; + std::vector< ftagfloat_t > IP3D_pu; + std::vector< ftagfloat_t > IP3D_pc; //std::vector< std::vector< ElementLink< xAOD::TrackParticleContainer > > > IP3D_TrackParticles; - std::vector< double > JetFitter_pb; - std::vector< double > JetFitter_pu; - std::vector< double > JetFitter_pc; + std::vector< ftagfloat_t > JetFitter_pb; + std::vector< ftagfloat_t > JetFitter_pu; + std::vector< ftagfloat_t > JetFitter_pc; - std::vector< double > JetFitterCombNN_pb; - std::vector< double > JetFitterCombNN_pu; - std::vector< double > JetFitterCombNN_pc; + std::vector< ftagfloat_t > JetFitterCombNN_pb; + std::vector< ftagfloat_t > JetFitterCombNN_pu; + std::vector< ftagfloat_t > JetFitterCombNN_pc; - std::vector< double > MV1_discriminant; + std::vector< ftagfloat_t > MV1_discriminant; // Add the dynamic variables from BTaggingAuxContainer here as static variables // (otherwise this information isn't available in the trigger) - std::vector<double> MV2c00_discriminant; - std::vector<double> MV2c10_discriminant; - std::vector<double> MV2c20_discriminant; + std::vector< ftagfloat_t > MV2c00_discriminant; + std::vector< ftagfloat_t > MV2c10_discriminant; + std::vector< ftagfloat_t > MV2c20_discriminant; std::vector< std::vector< float > > IP2D_valD0wrtPVofTracks; std::vector< std::vector< float > > IP2D_sigD0wrtPVofTracks; @@ -94,9 +96,9 @@ namespace xAOD { std::vector< std::vector< int > > IP3D_gradeOfTracks; std::vector< float > SV0_normdist; - std::vector< double > SV0_pb; - std::vector< double > SV0_pu; - std::vector< double > SV0_pc; + std::vector< ftagfloat_t > SV0_pb; + std::vector< ftagfloat_t > SV0_pu; + std::vector< ftagfloat_t > SV0_pc; std::vector< float > SV0_energyTrkInJet; std::vector< float > SV0_masssvx; std::vector< float > SV0_efracsvx; diff --git a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h index 342ffe4c378178f7b7eed4d9e8b80cb6cca57cff..13d346e217cf7af38e23ea893dcea1b1cd4e314e 100644 --- a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h +++ b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h @@ -18,6 +18,7 @@ #include "xAODTracking/VertexContainer.h" #include "xAODJet/JetContainer.h" #include "xAODBTagging/BTagVertexContainer.h" +#include "xAODBTagging/ftagfloat_t.h" // STL include(s): #include <map> @@ -58,9 +59,9 @@ namespace xAOD { /// @{ /// @brief SV0 3D significance - double SV0_significance3D() const; + ftagfloat_t SV0_significance3D() const; /// @brief set SV0 3D significance - void setSV0_significance3D(double value); + void setSV0_significance3D(ftagfloat_t value); /// @brief get vector of SV0 TrackParticle ElementLinks const TPELVec_t& SV0_TrackParticleLinks() const; /// @brief set vector of SV0 TrackParticle ElementLinks @@ -80,17 +81,17 @@ namespace xAOD { /// @{ /// @brief SV1 b probability - double SV1_pb() const; + ftagfloat_t SV1_pb() const; /// @brief set SV1 b probability - void setSV1_pb(double value); + void setSV1_pb(ftagfloat_t value); /// @brief SV1 c probability - double SV1_pc() const; + ftagfloat_t SV1_pc() const; /// @brief set SV1 c probability - void setSV1_pc(double value); + void setSV1_pc(ftagfloat_t value); /// @brief SV1 light probability - double SV1_pu() const; + ftagfloat_t SV1_pu() const; /// @brief set SV1 light probability - void setSV1_pu(double value); + void setSV1_pu(ftagfloat_t value); /// @brief get SV1 log likelihood ratio double SV1_loglikelihoodratio() const { return this->calcLLR(SV1_pb(),SV1_pu()); } /// @brief get vector of SV1 TrackParticle ElementLinks @@ -112,19 +113,19 @@ namespace xAOD { /// @{ /// @brief IP2D b probability - double IP2D_pb() const; + ftagfloat_t IP2D_pb() const; /// @brief set IP2D b probability - void setIP2D_pb(double value); + void setIP2D_pb(ftagfloat_t value); /// @brief IP2D c probability - double IP2D_pc() const; + ftagfloat_t IP2D_pc() const; /// @brief set IP2D c probability - void setIP2D_pc(double value); + void setIP2D_pc(ftagfloat_t value); /// @brief IP2D light probability - double IP2D_pu() const; + ftagfloat_t IP2D_pu() const; /// @brief set IP2D light probability - void setIP2D_pu(double value); + void setIP2D_pu(ftagfloat_t value); /// @brief get IP2D log likelihood ratio - double IP2D_loglikelihoodratio() const { return this->calcLLR(IP2D_pb(),IP2D_pu()); } + ftagfloat_t IP2D_loglikelihoodratio() const { return this->calcLLR(IP2D_pb(),IP2D_pu()); } /// @brief get vector of IP2D TrackParticle ElementLinks const TPELVec_t& IP2D_TrackParticleLinks() const; /// @brief set vector of IP2D TrackParticle ElementLinks @@ -144,19 +145,19 @@ namespace xAOD { /// @{ /// @brief IP3D b probability - double IP3D_pb() const; + ftagfloat_t IP3D_pb() const; /// @brief set IP3D b probability - void setIP3D_pb(double value); + void setIP3D_pb(ftagfloat_t value); /// @brief IP3D c probability - double IP3D_pc() const; + ftagfloat_t IP3D_pc() const; /// @brief set IP3D c probability - void setIP3D_pc(double value); + void setIP3D_pc(ftagfloat_t value); /// @brief IP3D light probability - double IP3D_pu() const; + ftagfloat_t IP3D_pu() const; /// @brief set IP3D light probability - void setIP3D_pu(double value); + void setIP3D_pu(ftagfloat_t value); /// @brief get IP3D log likelihood ratio - double IP3D_loglikelihoodratio() const { return ( (IP3D_pb()==1.&&IP3D_pu()==1.e9) ? 0. : + ftagfloat_t IP3D_loglikelihoodratio() const { return ( (IP3D_pb()==1.&&IP3D_pu()==1.e9) ? 0. : this->calcLLR(IP3D_pb(),IP3D_pu()) ); } /// @brief get vector of IP3D TrackParticle ElementLinks const TPELVec_t& IP3D_TrackParticleLinks() const; @@ -176,7 +177,7 @@ namespace xAOD { /// @name Dedicated SV1+IP3D accessor functions /// @{ - double SV1plusIP3D_discriminant() const { + ftagfloat_t SV1plusIP3D_discriminant() const { return SV1_loglikelihoodratio() + IP3D_loglikelihoodratio(); } @@ -186,41 +187,19 @@ namespace xAOD { /// @{ /// @brief JetFitter b probability - double JetFitter_pb() const; + ftagfloat_t JetFitter_pb() const; /// @brief set JetFitter b probability - void setJetFitter_pb(double value); + void setJetFitter_pb(ftagfloat_t value); /// @brief JetFitter c probability - double JetFitter_pc() const; + ftagfloat_t JetFitter_pc() const; /// @brief set JetFitter c probability - void setJetFitter_pc(double value); + void setJetFitter_pc(ftagfloat_t value); /// @brief JetFitter light probability - double JetFitter_pu() const; + ftagfloat_t JetFitter_pu() const; /// @brief set JetFitter light probability - void setJetFitter_pu(double value); + void setJetFitter_pu(ftagfloat_t value); /// @brief get JetFitter log likelihood ratio - double JetFitter_loglikelihoodratio() const { return this->calcLLR(JetFitter_pb(),JetFitter_pu()); } - - - /// @} - - /// @name Dedicated JetFittercomb accessor functions - /// @{ - - /// @brief JetFitter b probability - //double JetFitterCombNN_pb() const; - /// @brief set JetFitter b probability - //void setJetFitterCombNN_pb(double value); - /// @brief JetFitter c probability - //double JetFitterCombNN_pc() const; - /// @brief set JetFitter c probability - //void setJetFitterCombNN_pc(double value); - /// @brief JetFitter light probability - //double JetFitterCombNN_pu() const; - /// @brief set JetFitter light probability - //void setJetFitterCombNN_pu(double value); - /// @brief get JetFitter log likelihood ratio - //double JetFitterCombNN_loglikelihoodratio() const { return this->calcLLR(JetFitterCombNN_pb(),JetFitterCombNN_pu()); - //} + ftagfloat_t JetFitter_loglikelihoodratio() const { return this->calcLLR(JetFitter_pb(),JetFitter_pu()); } /// @} @@ -229,9 +208,9 @@ namespace xAOD { /// @{ /// @brief MV1 discriminant - double MV1_discriminant() const; + ftagfloat_t MV1_discriminant() const; /// @brief set MV1 discriminant - void setMV1_discriminant(double value); + void setMV1_discriminant(ftagfloat_t value); /// @} @@ -244,7 +223,7 @@ namespace xAOD { bool pu(const std::string& taggername, double &value) const; bool pb(const std::string& taggername, double &value) const; bool pc(const std::string& taggername, double &value) const; - double calcLLR(double num, double den) const; + ftagfloat_t calcLLR(double num, double den) const; /// @} diff --git a/Event/xAOD/xAODBTaggingAthenaPool/src/xAODBTaggingAuxVariableInit.cxx b/Event/xAOD/xAODBTaggingAthenaPool/src/xAODBTaggingAuxVariableInit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..48346dccaf353b11595799d73c91bc1164138b96 --- /dev/null +++ b/Event/xAOD/xAODBTaggingAthenaPool/src/xAODBTaggingAuxVariableInit.cxx @@ -0,0 +1,30 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +// EDM include(s). +#include "xAODBTagging/ftagfloat_t.h" +#include "AthContainers/AuxElement.h" + +// Helper macro for registering the types of auxiliary variables in memory. +#define AUX_VAR(NAME) \ + static const SG::AuxElement::Accessor<ftagfloat_t> NAME(#NAME) + +// Register the correct types for a select set of auxiliary variables. +AUX_VAR( rnnip_pb ); +AUX_VAR( rnnip_pc ); +AUX_VAR( rnnip_pu ); +AUX_VAR( rnnip_ptau ); + +AUX_VAR( DL1_pb ); +AUX_VAR( DL1_pc ); +AUX_VAR( DL1_pu ); + +AUX_VAR( DL1r_pb ); +AUX_VAR( DL1r_pc ); +AUX_VAR( DL1r_pu ); + +AUX_VAR( MV2c00_discriminant ); +AUX_VAR( MV2c10_discriminant ); +AUX_VAR( MV2c20_discriminant ); +AUX_VAR( SMT_discriminant ); diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagJetAugmenter.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagJetAugmenter.h index f38011af602b7492db5e478d45f8cc2e490262c6..ea9a6a15854dfb7db2710089ae9a45ef4caf690d 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagJetAugmenter.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/BTagJetAugmenter.h @@ -6,7 +6,7 @@ #define BTAG_JET_AUGMENTER_HH #include "FlavorTagDiscriminants/FlipTagEnums.h" -#include "FlavorTagDiscriminants/ftagfloat_t.h" +#include "xAODBTagging/ftagfloat_t.h" // ATLAS things #include "xAODBTagging/BTagging.h" diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2.h index d5c2e02e809405a2aea4bc89dc91d64f4dac9814..d82bb92a6358ee87a5d473c762f03433314c71a5 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2.h @@ -9,7 +9,7 @@ #include "FlavorTagDiscriminants/customGetter.h" #include "FlavorTagDiscriminants/FlipTagEnums.h" #include "FlavorTagDiscriminants/DL2DataDependencyNames.h" -#include "FlavorTagDiscriminants/ftagfloat_t.h" +#include "xAODBTagging/ftagfloat_t.h" // EDM includes #include "xAODJet/Jet.h" diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IJetFitterClassifierTool.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IJetFitterClassifierTool.h index fe00bcba92f95aa57a7be03a2fb20576d55f8b46..861dc5207204bf67e02f4b05769d43286c6b092d 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IJetFitterClassifierTool.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IJetFitterClassifierTool.h @@ -23,6 +23,8 @@ #include "xAODBTagging/BTagging.h" #include <string> +#include "xAODBTagging/ftagfloat_t.h" + namespace Analysis { class IJetFitterTagInfo; @@ -39,9 +41,9 @@ namespace Analysis { const std::string & jetauthor, const std::string& inputbasename, const std::string& outputbasename, - double jetpT, - double jeteta, - double IP3dlike=-5000) const = 0; + ftagfloat_t jetpT, + ftagfloat_t jeteta, + ftagfloat_t IP3dlike=-5000) const = 0; }; } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterDummyClassifier.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterDummyClassifier.h index ceac512386af16772958dccd9b61ac5050b65f48..2a6ee3ef65af7b7d0521757623dce50c178cd0ca 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterDummyClassifier.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterDummyClassifier.h @@ -19,6 +19,8 @@ #include "JetTagTools/IJetFitterClassifierTool.h" +#include "xAODBTagging/ftagfloat_t.h" + namespace Analysis { @@ -38,9 +40,9 @@ namespace Analysis { const std::string & jetauthor, const std::string& inputbasename, const std::string& outputbasename, - double jetpT, - double jeteta, - double IP3dlike=-5000) const override; + ftagfloat_t jetpT, + ftagfloat_t jeteta, + ftagfloat_t IP3dlike=-5000) const override; }; }//end Analysis namespace diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterInputWriter.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterInputWriter.h index 012e4bdc782dc70a4979d802c3da4d843bf2ce8f..2fe8144bc86114fc4c77c3a7cf92501f50649104 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterInputWriter.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterInputWriter.h @@ -18,6 +18,8 @@ #include "JetTagTools/IJetFitterClassifierTool.h" #include "xAODBTagging/BTagging.h" +#include "xAODBTagging/ftagfloat_t.h" + // #include <TString.h> class TTrainedNetwork; @@ -47,9 +49,9 @@ namespace Analysis { const std::string & jetauthor, const std::string& inputbasename, const std::string& outputbasename, - double jetpT, - double jeteta, - double IP3dlike=-5000) const override; + ftagfloat_t jetpT, + ftagfloat_t jeteta, + ftagfloat_t IP3dlike=-5000) const override; private: Gaudi::Property<bool> m_useCombinedIPNN diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h index f0afb77c8302824d9b650ac648a1cd341367d892..5315c2809ff4aa1c00dc45d8284fe3c6f8464cdf 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterNNTool.h @@ -28,6 +28,8 @@ #include <TString.h> +#include "xAODBTagging/ftagfloat_t.h" + class TTrainedNetwork; class TH1; @@ -59,9 +61,9 @@ class IJetFitterTagInfo; const std::string & jetauthor, const std::string& inputbasename, const std::string& outputbasename, - double jetpT, - double jeteta, - double IP3dlike=-5000) const override; + ftagfloat_t jetpT, + ftagfloat_t jeteta, + ftagfloat_t IP3dlike=-5000) const override; private: diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx index 0819e0e040970e1844318e93ef7f3dabee2f6588..b6c0e57a34d0be13a1e9aa1cafeae9576cc28514 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx @@ -33,7 +33,7 @@ #include <string> #include "TLorentzVector.h" - +#include "xAODBTagging/ftagfloat_t.h" //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -749,9 +749,9 @@ namespace Analysis { << "pb= " << lkl[0] << " pu= " << lkl[1] << " pc= " << lkl[2] ); /** fill likelihood information in xaod: */ - BTag.setVariable<double>(m_xAODBaseName, "pb", lkl[0]); - BTag.setVariable<double>(m_xAODBaseName, "pu", lkl[1]); - if (m_useCHypo) BTag.setVariable<double>(m_xAODBaseName, "pc", lkl[2]); + BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pb", lkl[0]); + BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pu", lkl[1]); + if (m_useCHypo) BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pc", lkl[2]); /** fill trackParticle links and other track informations in xaod: */ diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterDummyClassifier.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterDummyClassifier.cxx index 8d96972a1dabbf28dc40a020bbcf1aca38b4bcde..e8ff2b1553ac81f33827d0faedaa7c9d4714dad7 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterDummyClassifier.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterDummyClassifier.cxx @@ -38,9 +38,9 @@ namespace Analysis { const std::string & /*jetauthor*/, const std::string& /*inputbasename*/, const std::string& /*outputbasename*/, - double /* jetpT */, - double /* jeteta */, - double /* IP3dlike=-5000 */) const + ftagfloat_t /* jetpT */, + ftagfloat_t /* jeteta */, + ftagfloat_t /* IP3dlike=-5000 */) const { return StatusCode::SUCCESS; } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterInputWriter.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterInputWriter.cxx index 1da57fc035575c9e09b644f9bd3aa3712f8fdad4..7c07ee50bd4c5d4af46fa9b54c951fc51a199e43 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterInputWriter.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterInputWriter.cxx @@ -51,9 +51,9 @@ namespace Analysis { const std::string & jetauthor, const std::string& inputbasename, const std::string& /*outputbasename*/, - double /*jetpT*/, - double /*jeteta*/, - double /*IP3dlike*/) const + ftagfloat_t /*jetpT*/, + ftagfloat_t /*jeteta*/, + ftagfloat_t /*IP3dlike*/) const { if (jetauthor=="") { ATH_MSG_WARNING(" Hypothesis or jetauthor is empty. No likelihood value given back. "); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx index ac0affa3edbae5c84c4ea111408d30c2b7b2e077..d16d96457aed143ff30e57aa56dae239130d57b8 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterNNTool.cxx @@ -176,9 +176,9 @@ StatusCode JetFitterNNTool::finalize() { const std::string & jetauthor, const std::string& inputbasename, const std::string& outputbasename, - double jetpT, - double jeteta, - double IP3dlike) const + ftagfloat_t jetpT, + ftagfloat_t jeteta, + ftagfloat_t IP3dlike) const { if (jetauthor=="") { ATH_MSG_WARNING(" Hypothesis or jetauthor is empty. No likelihood value given back. "); @@ -246,9 +246,9 @@ StatusCode JetFitterNNTool::finalize() { if (!status) { ATH_MSG_DEBUG(" Missing input data: cannot compute desired results. Assigning default light values."); - double defaultB=1e-10; - double defaultC=1e-10; - double defaultL=1.-defaultB-defaultC; + ftagfloat_t defaultB=1e-10; + ftagfloat_t defaultC=1e-10; + ftagfloat_t defaultL=1.-defaultB-defaultC; if("JetFitter" == outputbasename) { @@ -258,9 +258,9 @@ StatusCode JetFitterNNTool::finalize() { } else { - BTag->setVariable<double>(outputbasename, "pb", defaultB); - BTag->setVariable<double>(outputbasename, "pc", defaultC); - BTag->setVariable<double>(outputbasename, "pu", defaultL); + BTag->setVariable<ftagfloat_t>(outputbasename, "pb", defaultB); + BTag->setVariable<ftagfloat_t>(outputbasename, "pc", defaultC); + BTag->setVariable<ftagfloat_t>(outputbasename, "pu", defaultL); } @@ -296,7 +296,9 @@ StatusCode JetFitterNNTool::finalize() { << " cat " << norm_cat_pT(getPtCategory(jetpT).first) << ". (Check scale...!) "); - std::vector<double> outputValues=NN->calculateOutputValues(inputData); + //std::vector<ftagfloat_t> outputValues=NN->calculateOutputValues(inputData); + std::vector<double> outputValuesD=NN->calculateOutputValues(inputData); + std::vector<ftagfloat_t> outputValues(begin(outputValuesD), end(outputValuesD)); ATH_MSG_DEBUG(" NN Discriminator b: " << outputValues[0] << " c: " << outputValues[1] << " u: " << outputValues[2]); @@ -308,9 +310,9 @@ StatusCode JetFitterNNTool::finalize() { BTag->setJetFitter_pu(outputValues[2]); } else{ - BTag->setVariable<double>(outputbasename, "pb", outputValues[0]); - BTag->setVariable<double>(outputbasename, "pc", outputValues[1]); - BTag->setVariable<double>(outputbasename, "pu", outputValues[2]); + BTag->setVariable<ftagfloat_t>(outputbasename, "pb", outputValues[0]); + BTag->setVariable<ftagfloat_t>(outputbasename, "pc", outputValues[1]); + BTag->setVariable<ftagfloat_t>(outputbasename, "pu", outputValues[2]); } return StatusCode::SUCCESS; } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterTag.cxx index 1309da245a4ba956e6195fd7100a5b1b3ce4b18c..4da8e1796a04c05fdfb958235c6106202afab677 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterTag.cxx @@ -35,6 +35,8 @@ #include "ParticleJetTools/JetFlavourInfo.h" +#include "xAODBTagging/ftagfloat_t.h" + namespace Analysis { JetFitterTag::JetFitterTag(const std::string& t, const std::string& n, const IInterface* p) @@ -161,8 +163,8 @@ namespace Analysis { jetauthor = m_ForcedCalibName; } - double jetpT = jetToTag.pt(); - double jeteta = jetToTag.eta(); + ftagfloat_t jetpT = jetToTag.pt(); + ftagfloat_t jeteta = jetToTag.eta(); /** for the reference mode we need the true label: */ std::string pref = ""; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV1Tag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV1Tag.cxx index a4ad92f46d396f26bee6eeb9d190a4bcf28f0e43..7cbd7ef150d06389fc1ca6887bf887b47b04fa3b 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV1Tag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV1Tag.cxx @@ -19,6 +19,8 @@ #include <map> #include <list> +#include "xAODBTagging/ftagfloat_t.h" + using Athena::Units::GeV; namespace Analysis { @@ -202,7 +204,7 @@ namespace Analysis { BTag.setMV1_discriminant(mv1); } else{ - BTag.setVariable<double>(m_xAODBaseName, "discriminant", mv1); + BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "discriminant", mv1); } } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx index a8817d146ccd8b145f4e8564b0e919d70d236e30..f0dd6f334e983da5118f1594d23b3b6c12c1bf6c 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx @@ -29,6 +29,8 @@ #include <list> #include <math.h> /* hypot */ +#include "xAODBTagging/ftagfloat_t.h" + using Athena::Units::GeV; namespace Analysis { @@ -172,12 +174,12 @@ namespace Analysis { if (m_taggerNameBase.find("MV2c")!=std::string::npos) { //MV2cXX - BTag->setVariable<double>(m_xAODBaseName, "discriminant", mv2); + BTag->setVariable<ftagfloat_t>(m_xAODBaseName, "discriminant", mv2); }else { //MV2m - BTag->setVariable<double>(m_xAODBaseName, "pb", mv2m_pb); - BTag->setVariable<double>(m_xAODBaseName, "pu", mv2m_pu); - BTag->setVariable<double>(m_xAODBaseName, "pc", mv2m_pc); + BTag->setVariable<ftagfloat_t>(m_xAODBaseName, "pb", mv2m_pb); + BTag->setVariable<ftagfloat_t>(m_xAODBaseName, "pu", mv2m_pu); + BTag->setVariable<ftagfloat_t>(m_xAODBaseName, "pc", mv2m_pc); } } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx index 618b3c4677a6f7b2f38b0bab681163161d85d386..61bef5d19cdeeb6a0481b4b7aa45af92451d841c 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultivariateTagManager.cxx @@ -281,9 +281,9 @@ namespace Analysis { void MultivariateTagManager::fill_ip2d(var_map& inputs, xAOD::BTagging& BTag) const { // default values - double ip2d_pb = NAN; - double ip2d_pc = NAN; - double ip2d_pu = NAN; + ftagfloat_t ip2d_pb = NAN; + ftagfloat_t ip2d_pc = NAN; + ftagfloat_t ip2d_pu = NAN; float ip2 = NAN; float ip2_c = NAN; @@ -305,9 +305,9 @@ namespace Analysis { ip2d_pu = BTag.IP2D_pu(); } else { - BTag.variable<double>(m_ip2d_infosource, "pb", ip2d_pb); - BTag.variable<double>(m_ip2d_infosource, "pc", ip2d_pc); - BTag.variable<double>(m_ip2d_infosource, "pu", ip2d_pu); + BTag.variable<ftagfloat_t>(m_ip2d_infosource, "pb", ip2d_pb); + BTag.variable<ftagfloat_t>(m_ip2d_infosource, "pc", ip2d_pc); + BTag.variable<ftagfloat_t>(m_ip2d_infosource, "pu", ip2d_pu); } ip2 = BTag.calcLLR(ip2d_pb,ip2d_pu); @@ -348,9 +348,9 @@ namespace Analysis { void MultivariateTagManager::fill_ip3d(var_map& inputs, xAOD::BTagging& BTag) const { // default values - double ip3d_pb = NAN; - double ip3d_pc = NAN; - double ip3d_pu = NAN; + ftagfloat_t ip3d_pb = NAN; + ftagfloat_t ip3d_pc = NAN; + ftagfloat_t ip3d_pu = NAN; float ip3 = NAN; float ip3_c = NAN; @@ -370,9 +370,9 @@ namespace Analysis { ip3d_pu = BTag.IP3D_pu(); } else { - BTag.variable<double>(m_ip3d_infosource, "pb", ip3d_pb); - BTag.variable<double>(m_ip3d_infosource, "pc", ip3d_pc); - BTag.variable<double>(m_ip3d_infosource, "pu", ip3d_pu); + BTag.variable<ftagfloat_t>(m_ip3d_infosource, "pb", ip3d_pb); + BTag.variable<ftagfloat_t>(m_ip3d_infosource, "pc", ip3d_pc); + BTag.variable<ftagfloat_t>(m_ip3d_infosource, "pu", ip3d_pu); } ip3 = BTag.calcLLR(ip3d_pb,ip3d_pu); @@ -421,8 +421,8 @@ namespace Analysis { float sv0_efrc = NAN; float sv0_mass = NAN; float sv0_radius = NAN; - double sv0_sig3d = NAN; - double sv0_pv_x = NAN, sv0_pv_y = NAN; + ftagfloat_t sv0_sig3d = NAN; + ftagfloat_t sv0_pv_x = NAN, sv0_pv_y = NAN; // get vertex information bool sv0_ok(false); @@ -447,9 +447,9 @@ namespace Analysis { BTag.variable<float>(m_sv0_infosource, "efracsvx", sv0_efrc); BTag.variable<int>(m_sv0_infosource, "N2Tpair", sv0_n2t); BTag.variable<int>(m_sv0_infosource, "NGTinSvx", sv0_ntrkv); - //BTag.variable<double>(m_sv0_infosource, "significance3D", sv0_sig3d); + //BTag.variable<ftagfloat_t>(m_sv0_infosource, "significance3D", sv0_sig3d); } - BTag.variable<double>(m_sv0_infosource, "significance3D", sv0_sig3d); + BTag.variable<ftagfloat_t>(m_sv0_infosource, "significance3D", sv0_sig3d); sv0_pv_x=priVtx.x(); sv0_pv_y=priVtx.y(); @@ -468,7 +468,7 @@ namespace Analysis { void MultivariateTagManager::fill_sv1(var_map& inputs, xAOD::BTagging& BTag) const { // default values - double sv1_pb = NAN, sv1_pc = NAN, sv1_pu = NAN; + ftagfloat_t sv1_pb = NAN, sv1_pc = NAN, sv1_pu = NAN; float sv1 = NAN, sv1_c = NAN, sv1_cu = NAN; float sv1_nan = NAN, sv1_c_nan = NAN, sv1_cu_nan = NAN; @@ -504,9 +504,9 @@ namespace Analysis { BTag.taggerInfo(sv1_sig3d, xAOD::BTagInfo::SV1_normdist); } else { - BTag.variable<double>(m_sv1_infosource, "pu", sv1_pu); - BTag.variable<double>(m_sv1_infosource, "pb", sv1_pb); - BTag.variable<double>(m_sv1_infosource, "pc", sv1_pc); + BTag.variable<ftagfloat_t>(m_sv1_infosource, "pu", sv1_pu); + BTag.variable<ftagfloat_t>(m_sv1_infosource, "pb", sv1_pb); + BTag.variable<ftagfloat_t>(m_sv1_infosource, "pc", sv1_pc); BTag.variable<float>(m_sv1_infosource, "masssvx", sv1_mass); BTag.variable<float>(m_sv1_infosource, "efracsvx", sv1_efrc); @@ -572,20 +572,20 @@ namespace Analysis { if (m_aux_data_name_map.count(raw_key)) { key = m_aux_data_name_map.at(raw_key); } - // note: we should extend this to data types beyond double at + // note: we should extend this to data types beyond ftagfloat_t at // some point std::string valid_key = key + "IsValid"; - if ( ! BTag.isAvailable<double>(key) ) { + if ( ! BTag.isAvailable<ftagfloat_t>(key) ) { ATH_MSG_WARNING("aux data '" + key + "' is missing," " tagger inputs may be incomplete"); } else if (!BTag.isAvailable<char>(valid_key)) { ATH_MSG_WARNING("no key '" + valid_key + "' found, invalid inputs" " may be interperated incorrectly"); - inputs[key] = BTag.auxdata<double>(key); + inputs[key] = BTag.auxdata<ftagfloat_t>(key); } else if (!BTag.auxdata<char>(valid_key)) { inputs[key] = NAN; } else { - inputs[key] = BTag.auxdata<double>(key); + inputs[key] = BTag.auxdata<ftagfloat_t>(key); } } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx index f4421ab5403725c94c3d13d3bed51f0712ef65a6..28fa3b21538603032a8f50add1c90b1ceff69f04 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/SVTag.cxx @@ -22,6 +22,7 @@ #include <string> #include "GeoPrimitives/GeoPrimitivesHelpers.h" +#include "xAODBTagging/ftagfloat_t.h" namespace Analysis { @@ -448,19 +449,19 @@ namespace Analysis } if (m_save_probabilities) { - BTag.setVariable<double>(m_xAODBaseName, "pb", probi[0]); - BTag.setVariable<double>(m_xAODBaseName, "pu", probi[1]); - if (m_useCHypo) BTag.setVariable<double>(m_xAODBaseName, "pc", probi[2]); + BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pb", probi[0]); + BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pu", probi[1]); + if (m_useCHypo) BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pc", probi[2]); } - + } /* For SV0, put the signed 3D Lxy significance: */ } else { ATH_MSG_VERBOSE("#BTAG# SV0 Lxy3D significance = " << distnrm); - BTag.setVariable<double>(m_xAODBaseName, "pb", exp(distnrm)); - BTag.setVariable<double>(m_xAODBaseName, "pu", 1); - if (m_useCHypo) BTag.setVariable<double>(m_xAODBaseName, "pc", 1); + BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pb", exp(distnrm)); + BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pu", 1); + if (m_useCHypo) BTag.setVariable<ftagfloat_t>(m_xAODBaseName, "pc", 1); } ATH_MSG_VERBOSE("#BTAG# SVTag Finalizing... "); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx index e5843e9e1f0982c203e0e962f24d6a9c05b4d49c..cb4cd3482abfed99344a291a81cd14144f2b517c 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx @@ -55,6 +55,7 @@ PURPOSE: b-tagging based on soft muon identification #include <list> #include <math.h> +#include "xAODBTagging/ftagfloat_t.h" namespace Analysis { @@ -561,7 +562,7 @@ namespace Analysis // Can be uncommented if SVMT evaluation wants to be checked (rather than SMT) //if(inputVars.size()<10) BTag.setVariable<double>(xAODBaseName, "discriminant", smt); //else BTag.setVariable<double>("SVMT", "discriminant", smt); - BTag.setVariable<double>(xAODBaseName, "discriminant", smt); + BTag.setVariable<ftagfloat_t>(xAODBaseName, "discriminant", smt); BTag.setVariable<char>(xAODBaseName, "discriminantIsValid", true); /** ANDREA **/ diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h index 00a53b411f542bec081c31410a9d00faa81f75ca..45c68167009e3bbdaa682be4e2aee7ee785a7ca7 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h @@ -196,10 +196,10 @@ class TrigBtagFex: public HLT::FexAlgo { float m_mon_tag_IP3D; float m_mon_tag_SV1; float m_mon_tag_IP3DSV1; - float m_mon_tag_MV2c00; - float m_mon_tag_MV2c10; - float m_mon_tag_MV2c10_hybrid; - float m_mon_tag_MV2c20; + double m_mon_tag_MV2c00; + double m_mon_tag_MV2c10; + double m_mon_tag_MV2c10_hybrid; + double m_mon_tag_MV2c20; //2017 variables float m_mon_tag_IP2_c; float m_mon_tag_IP2_cu; diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx index ad1cd899055d16160254e4c7ea87265e41424deb..957687f655578cb1ee3a8583512760e3b86d4b1f 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx @@ -340,13 +340,13 @@ StatusCode TrigBjetBtagHypoAlgMT::monitor_btagging( const ElementLinkVector< xAO MONITOR_BTAG_AUX_VAR(SV1_significance3d, float, bTaggingEL); MONITOR_BTAG_AUX_VAR(IP2D_isDefaults, char, bTaggingEL); - MONITOR_BTAG_AUX_VAR(IP2D_bu, double, bTaggingEL); - MONITOR_BTAG_AUX_VAR(IP2D_bc, double, bTaggingEL); - MONITOR_BTAG_AUX_VAR(IP2D_cu, double, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP2D_bu, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP2D_bc, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP2D_cu, float, bTaggingEL); MONITOR_BTAG_AUX_VAR(IP3D_isDefaults, char, bTaggingEL); - MONITOR_BTAG_AUX_VAR(IP3D_bu, double, bTaggingEL); - MONITOR_BTAG_AUX_VAR(IP3D_bc, double, bTaggingEL); - MONITOR_BTAG_AUX_VAR(IP3D_cu, double, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP3D_bu, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP3D_bc, float, bTaggingEL); + MONITOR_BTAG_AUX_VAR(IP3D_cu, float, bTaggingEL); MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_nTracks, int, bTaggingEL); MONITOR_BTAG_AUX_VAR(JetFitterSecondaryVertex_isDefaults, char, bTaggingEL); diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx index 1a8775a079a70316bdd4326d2d72389f9f5d47c3..680eef0ffedc2a9ef82518ad93b269c5cae07e55 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx @@ -185,7 +185,8 @@ HLT::ErrorCode TrigBjetHypo::hltExecute(const HLT::TriggerElement* outputTE, boo for ( ; trigBTagging != trigBTaggingEnd; trigBTagging++) { - double x = (*trigBTagging)->auxdata<double>("MV2c20_discriminant"); + double x = 0.; + (*trigBTagging)->MVx_discriminant("MV2c20",x); if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG <<"MV2c20 x = " << x; if(x>m_xcutMV2c20) { @@ -203,7 +204,8 @@ HLT::ErrorCode TrigBjetHypo::hltExecute(const HLT::TriggerElement* outputTE, boo for ( ; trigBTagging != trigBTaggingEnd; trigBTagging++) { - double x = (*trigBTagging)->auxdata<double>("MV2c10_discriminant"); + double x = 0.; + (*trigBTagging)->MVx_discriminant("MV2c10",x); if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "MV2c10 x = " << x; if(x>m_xcutMV2c10) { @@ -225,7 +227,8 @@ HLT::ErrorCode TrigBjetHypo::hltExecute(const HLT::TriggerElement* outputTE, boo // Temporary use mv2c00 for hybrid tuning // double x = (*trigBTagging)->auxdata<double>("MV2c10_hybrid_discriminant"); - double x = (*trigBTagging)->auxdata<double>("MV2c00_discriminant"); + double x = 0.; + (*trigBTagging)->MVx_discriminant( "MV2c00",x ); if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "MV2c10_hybrid x = " << x; if(x>m_xcutMV2c10_hybrid) { diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAllTE.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAllTE.cxx index ec45e62eb3cee2e4e64ca6c50fc49f8ef1cd4d95..2775c7576291c6a1d1ed42bcbef60a244b6c5578 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAllTE.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAllTE.cxx @@ -21,6 +21,8 @@ #include "xAODJet/Jet.h" #include "xAODJet/JetContainer.h" +#include "xAODBTagging/ftagfloat_t.h" + using std::vector; @@ -271,7 +273,7 @@ HLT::ErrorCode TrigBjetHypoAllTE::hltExecute(std::vector<std::vector<HLT::Trigge // // Get pt and btagging weight // - double btagWeight = btagInfo->auxdata<double>(m_tagger); + double btagWeight = btagInfo->auxdata<ftagfloat_t>(m_tagger); double btagEt = jet->p4().Et(); // diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx index 1ab92da1add8e4ee679895755c094a9134d9b8f1..c606edee9ef97df84b4b130fd677b57d83b249e7 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx @@ -301,7 +301,6 @@ HLT::ErrorCode TrigBtagFex::hltExecute(const HLT::TriggerElement* inputTE, HLT:: if(msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "#BTAG# Failed in taggers call" << endmsg; } } - // Fill monitoring variables float sv_check; float sv_mass_check; @@ -394,12 +393,17 @@ HLT::ErrorCode TrigBtagFex::hltExecute(const HLT::TriggerElement* inputTE, HLT:: m_mon_tag_IP2D = trigBTagging->IP2D_loglikelihoodratio(); m_mon_tag_IP3D = trigBTagging->IP3D_loglikelihoodratio(); m_mon_tag_IP3DSV1 = trigBTagging->SV1plusIP3D_discriminant(); - m_mon_tag_MV2c00 = trigBTagging->auxdata<double>("MV2c00_discriminant"); - m_mon_tag_MV2c10 = trigBTagging->auxdata<double>("MV2c10_discriminant"); + m_mon_tag_MV2c00 = 0; + m_mon_tag_MV2c10 = 0; + trigBTagging->MVx_discriminant( "Mv2c00",m_mon_tag_MV2c00 ); + trigBTagging->MVx_discriminant( "Mv2c10",m_mon_tag_MV2c10 ); // Temporary use mv2c00 for hybrid tuning // m_mon_tag_MV2c10_hybrid = trigBTagging->auxdata<double>("MV2c10_hybrid_discriminant"); - m_mon_tag_MV2c10_hybrid = trigBTagging->auxdata<double>("MV2c00_discriminant"); - m_mon_tag_MV2c20 = trigBTagging->auxdata<double>("MV2c20_discriminant"); + m_mon_tag_MV2c10_hybrid = 0; + m_mon_tag_MV2c20 = 0; + trigBTagging->MVx_discriminant( "MV2c00",m_mon_tag_MV2c10_hybrid ); + trigBTagging->MVx_discriminant( "MV2c20",m_mon_tag_MV2c20 ); + if( trigBTagging->IP2D_pc() != 0 && trigBTagging->IP2D_pb() != 0 ) m_mon_tag_IP2_c = log(( trigBTagging->IP2D_pb() )/( trigBTagging->IP2D_pc() )); else m_mon_tag_IP2_c = -999.; if( trigBTagging->IP2D_pu() != 0 && trigBTagging->IP2D_pc() != 0 ) m_mon_tag_IP2_cu = log(( trigBTagging->IP2D_pc() )/( trigBTagging->IP2D_pu() )); @@ -412,15 +416,14 @@ HLT::ErrorCode TrigBtagFex::hltExecute(const HLT::TriggerElement* inputTE, HLT:: m_mon_jet_pt = jet->pt() ; m_mon_jet_eta = jet->eta() ; - // Dump results ATH_MSG_DEBUG( "IP2D u/b: " << trigBTagging->IP2D_pu() << "/" << trigBTagging->IP2D_pb() << " IP3D u/b: " << trigBTagging->IP3D_pu() << "/" << trigBTagging->IP3D_pb() << " SV1 u/b: " << trigBTagging->SV1_pu() << "/" << trigBTagging->SV1_pb() - << " MV2c20 var: " << trigBTagging->auxdata<double>("MV2c20_discriminant") - << " MV2c10 var: " << trigBTagging->auxdata<double>("MV2c10_discriminant") + << " MV2c20 var: " << m_mon_tag_MV2c20 + << " MV2c10 var: " << m_mon_tag_MV2c10 // Temporary use mv2c00 for hybrid tuning - << " MV2c10_hybrid var: " << trigBTagging->auxdata<double>("MV2c00_discriminant") ); + << " MV2c10_hybrid var: " << m_mon_tag_MV2c00 ); // << " MV2c10_hybrid var: " << trigBTagging->auxdata<double>("MV2c10_hybrid_discriminant") << endmsg; // ATTACH FEATURES AND CLEAR TEMPORARY OBJECTS diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx index de75e5613cdc2429c579470b0d2e8bbe0076e672..bc1347b50f853b2501aa696c6ba4a93ab4a10cda 100755 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx @@ -980,16 +980,17 @@ StatusCode HLTBjetMonTool::book(){ const xAOD::BTaggingContainer* onlinebjet = onlinebjets[0].cptr(); ATH_MSG_DEBUG(" - nBjet: " << onlinebjet->size()); for(const auto* bjet : *onlinebjet) { - double wIP3D, wSV1, wCOMB, wMV2c00, wMV2c10, wMV2c20 = 0.; // discriminant variables + double wIP3D=0., wSV1=0., wCOMB=0., wMV2c00=0., wMV2c10=0., wMV2c20 = 0.; // discriminant variables // double wMV1 = 0.; - float svp_efrc, svp_mass = -1.; int svp_n2t = -1; // SV1 variables + float svp_efrc =-1, svp_mass = -1.; int svp_n2t = -1; // SV1 variables bjet->loglikelihoodratio("IP3D", wIP3D); bjet->loglikelihoodratio("SV1", wSV1); double SV1_loglikelihoodratioLZ = bjet->SV1_loglikelihoodratio(); wCOMB = wIP3D+wSV1; - wMV2c00 = bjet->auxdata<double>("MV2c00_discriminant"); - wMV2c10 = bjet->auxdata<double>("MV2c10_discriminant"); - wMV2c20 = bjet->auxdata<double>("MV2c20_discriminant"); + bjet->MVx_discriminant("MV2c00",wMV2c00); + bjet->MVx_discriminant("MV2c10",wMV2c10); + bjet->MVx_discriminant("MV2c20",wMV2c20); + // wMV1 = bjet->MV1_discriminant(); // Suggestion of LZ bjet->variable<float>("SV1", "masssvx", svp_mass); @@ -1108,7 +1109,7 @@ StatusCode HLTBjetMonTool::book(){ double SV1_loglikelihoodratioLZ = btag->SV1_loglikelihoodratio(); wCOMB = wIP3D+wSV1; - wMV2c10 = btag->auxdata<double>("MV2c10_discriminant"); + btag->MVx_discriminant("MV2c10",wMV2c10); // Suggestion of LZ btag->variable<float>("SV1", "masssvx", svp_mass); diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx index 44ff7dbcb3e39471d861301a1429fd6c3aec65e5..8760fc91bedc3ab4d16339274a0f4097a51708d5 100644 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx @@ -293,7 +293,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c NameH = "wMV2c10_tr_"+trigName; ATH_MSG_DEBUG( " NameH: " << NameH ); auto wMV2c10 = Monitored::Scalar<double>(NameH,0.0); - wMV2c10 = btag->auxdata<double>("MV2c10_discriminant"); + btag->MVx_discriminant("MV2c10",wMV2c10); ATH_MSG_DEBUG(" wMV2c10: " << wMV2c10); fill("TrigBjetMonitor",wMV2c10);