|
ATLAS Offline Software
|
Go to the documentation of this file.
27 ATH_MSG_INFO(
"TrigEgammaMonitorTopoAlgorithm::initialize()...");
34 return StatusCode::SUCCESS;
46 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
62 return StatusCode::SUCCESS;
68 std::string trigger_num =
d.at(
"trigger_num");
69 std::string trigger_den =
d.at(
"trigger_den");
71 auto monGroup_online =
getGroup( trigger_num +
"_Efficiency_HLT" );
72 auto monGroup_offline =
getGroup( trigger_num +
"_Efficiency_Offline" );
74 std::vector<float> mass_vec, mass_off_vec, match_mass_vec, match_mass_off_vec;
75 std::vector<float> dphi_vec, dphi_off_vec, match_dphi_vec, match_dphi_off_vec;
87 std::vector<Legs> legs_den_vec, legs_num_vec;
89 make_legs( trigger_num ,
d.at(
"leg0_key"),
d.at(
"leg1_key"), legs_num_vec);
90 make_legs( trigger_den ,
d.at(
"leg0_key"),
d.at(
"leg1_key"), legs_den_vec);
94 for (
auto &legs : legs_den_vec){
96 if( legs.leg0 && legs.leg1 ){
97 mass_vec.push_back( (legs.leg0->p4() + legs.leg1->p4()).M() );
98 dphi_vec.push_back( legs.leg0->p4().DeltaPhi(legs.leg1->p4()) );
101 if(
match( *offElectrons, legs.leg0, leg0_off) &&
102 match( *offElectrons, legs.leg1, leg1_off))
104 if (! (leg0_off == leg1_off)){
105 mass_off_vec.push_back( (leg0_off->
p4() + leg1_off->
p4()).M() );
106 dphi_off_vec.push_back( leg0_off->
p4().DeltaPhi(leg1_off->
p4()) );
114 for (
auto &legs : legs_num_vec){
117 if( legs.leg0 && legs.leg1 ){
118 match_mass_vec.push_back( (legs.leg0->p4() + legs.leg1->p4()).M() );
119 match_dphi_vec.push_back( legs.leg0->p4().DeltaPhi(legs.leg1->p4()) );
122 if(
match( *offElectrons, legs.leg0, leg0_off) &&
123 match( *offElectrons, legs.leg1, leg1_off))
125 if (! (leg0_off == leg1_off)){
126 match_mass_off_vec.push_back( (leg0_off->
p4() + leg1_off->
p4()).M() );
127 match_dphi_off_vec.push_back( leg0_off->
p4().DeltaPhi(leg1_off->
p4()) );
134 fill(monGroup_online, mass_col, match_mass_col, dphi_col, match_dphi_col);
135 fill(monGroup_offline, mass_off_col, match_mass_off_col, dphi_off_col, match_dphi_off_col);
139 return StatusCode::SUCCESS;
149 float min_deltaR = 999;
150 for (
auto part : container){
151 float dR = part_on->
p4().DeltaR(
part->p4());
152 if (
dR < min_deltaR ){
157 return ( (min_deltaR <
m_dR) && part_off);
163 std::string key_leg0,
164 std::string key_leg1,
165 std::vector<Legs> &legs_vec )
const
187 ATH_MSG_DEBUG(
"We have " << vec_leg0.size() <<
" combinations for leg0 from " << trigger);
188 ATH_MSG_DEBUG(
"We have " << vec_leg1.
size() <<
" combinations for leg1 from " << trigger);
190 for (
auto & leg0_feat : vec_leg0){
192 for (
auto & leg1_feat : vec_leg1){
194 if ( !leg0_feat.isValid() || !leg1_feat.isValid() )
198 auto leg0 = (*leg0_feat.link);
199 auto leg1 = (*leg1_feat.link);
201 if (leg0 == leg1)
continue;
203 legs_vec.push_back(
Legs{leg0 , leg1} );
FeatureRequestDescriptor & setCondition(const unsigned int condition)
Set the Condition: TrigDefs::Physics - (default), only returns features from paths through the naviga...
float dR(const float, const float, const float, const float) const
Get delta R.
virtual StatusCode fillHistograms(const EventContext &ctx) const override
=========================================================================
SG::ReadHandleKey< xAOD::PhotonContainer > m_offPhotonKey
The common trigger namespace for trigger analysis tools.
void make_legs(const std::string &trigger, std::string key_leg0, std::string key_leg1, std::vector< Legs > &) const
Get all combinations.
FeatureRequestDescriptor & setChainGroup(const std::string &chainGroupName)
Set the desired Chain or Chain Group.
Gaudi::Property< float > m_dR
Min Delta R between online and offline.
const ToolHandle< Trig::TrigDecisionTool > & tdt() const
Get the TDT
Class providing the definition of the 4-vector interface.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
SG::ReadHandleKey< xAOD::ElectronContainer > m_offElectronKey
Event Wise offline ElectronContainer Access and end iterator.
bool isHLTTruncated() const
virtual StatusCode initialize() override
=========================================================================
::StatusCode StatusCode
StatusCode definition for legacy code.
TrigEgammaMonitorTopoAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void reset()
Reset the FeatureRequestDescriptor to its default configuration.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
FeatureRequestDescriptor & setRestrictRequestToLeg(const int restrictToLegIndex)
Set to -1 by default, indicating that all legs of multi-leg chains are searched.
FeatureRequestDescriptor & setRequireSGKey(const std::string &containerSGKey)
Set the StoreGate key filter.
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
const ToolHandle< TrigEgammaMatchingToolMT > & match() const
Get the e/g match tool.
virtual StatusCode initialize() override
initialize
virtual ~TrigEgammaMonitorTopoAlgorithm() override
=========================================================================
size_type size() const noexcept
Returns the number of elements in the collection.
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
Gaudi::Property< std::vector< std::map< std::string, std::string > > > m_trigListConfig
List of configurations.