ATLAS Offline Software
Loading...
Searching...
No Matches
JetHistoLeadingJetsRelations.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
7
9
10
11JetHistoLeadingJetsRelations::JetHistoLeadingJetsRelations( const std::string& type, const std::string & name ,const IInterface* parent):
12 AthAlgTool( type, name, parent )
13{
14 declareInterface<IJetHistoFiller>(this);
15
16}
17
18
20
21 return StatusCode::SUCCESS;
22}
23
24StatusCode JetHistoLeadingJetsRelations::processJetContainer(const JetMonitoringAlg& parentAlg, const xAOD::JetContainer & jets, const EventContext& ) const {
25 if(jets.empty()) return StatusCode::SUCCESS;
26 //
27
28 if(jets.size()==1) return StatusCode::SUCCESS;
29
30
31 // consider the two jets with the highest pt
32 const xAOD::Jet* j1 = jets[0];
33 const xAOD::Jet* j2 = jets[1];
34
35 // define deta, dphi and dr so that they are known to be monitored
36 auto dEta= Monitored::Scalar<float>("dEta",0.0);
37 // alternative way
38 //Monitored::Scalar<float>dEta("dEta")
39 auto dPhi= Monitored::Scalar<float>("dPhi",0.0);
40 // alternative way
41 //Monitored::Scalar<float>dEta("dPhi")
42 auto dR = Monitored::Scalar<float>("dR",0.0);
43 // Monitored::Scalar<float>dR("dR")
44
45 dEta= j1->eta() - j2->eta();
46 dPhi = fabs(j1->phi() - j2->phi() );
47 if(dPhi > 2*3.14159) dPhi -= 2*3.14159;
48 dR = sqrt( dPhi*dPhi + dEta*dEta);
49
50 // ToolHandle<GenericMonitoringTool> grpT =
51 parentAlg.fill(m_group,dEta,dPhi,dR);
52
53 return StatusCode::SUCCESS;
54}
55
56
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
JetHistoLeadingJetsRelations(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode processJetContainer(const JetMonitoringAlg &parentAlg, const xAOD::JetContainer &jets, const EventContext &ctx) const
Gaudi::Property< std::string > m_group
A monitoring algorithm in charge of filling histogram for a JetContainer.
Declare a monitored scalar variable.
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.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".