ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMonitoring
Root
LeadingJetsRelations.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetMonitoring/LeadingJetsRelations.h
"
6
#include "
JetMonitoring/ToolHandleHistoHelper.h
"
7
8
#include "TH1.h"
9
#include "TH2.h"
10
#include "TProfile.h"
11
12
13
14
LeadingJetsRelations::LeadingJetsRelations
(
const
std::string &t) :
JetHistoBase
(t)
15
,
m_histoDef
(this)
16
{
17
declareProperty
(
"HistoDef"
,
m_histoDef
,
"The list of HistoDefinitionTool defining the histos to be used in this tool"
);
18
}
19
20
21
22
StatusCode
LeadingJetsRelations::initialize
() {
23
CHECK
(
m_histoDef
.retrieve() );
24
return
StatusCode::SUCCESS;
25
}
26
27
int
LeadingJetsRelations::buildHistos
(){
28
ATH_MSG_INFO
(
" buildHistos num of histos : "
<<
m_histoDef
.size() );
29
30
ToolHandleHistoHelper::HistoRetriever
hbuilder(
m_histoDef
);
31
32
// Histos are defined in jobOptions !
33
// For each histo, ask hbuilder if a corresponding definition exists in the jobOption list.
34
// -> if so a valid histo is returned (and booked)
35
// -> else NULL is returned
36
m_histDeltaR
=
bookHisto
( hbuilder.
build
<TH1F>(
"ljrDeltaR"
) );
37
m_histDeltaEta
=
bookHisto
( hbuilder.
build
<TH1F>(
"ljrDeltaEta"
) );
38
m_histDeltaPhi
=
bookHisto
( hbuilder.
build
<TH1F>(
"ljrDeltaPhi"
) );
39
m_histFrac
=
bookHisto
( hbuilder.
build
<TH1F>(
"ljrFrac"
) );
40
m_histEta1Eta2
=
bookHisto
( hbuilder.
build
<TH2F>(
"ljrEta1Eta2"
) );
41
42
43
return
0;
44
}
45
46
47
int
LeadingJetsRelations::fillHistosFromContainer
(
const
xAOD::JetContainer
&cont,
float
weight){
48
if
( cont.
size
()<2)
return
0;
49
50
const
xAOD::Jet
* j1 = cont[0];
51
const
xAOD::Jet
* j2 = cont[1];
52
53
double
dEta = j1->eta() - j2->eta();
54
double
dPhi = fabs(j1->phi() - j2->phi() );
55
if
(dPhi > 2*3.14159) dPhi -= 2*3.14159;
56
double
dR = sqrt( dPhi*dPhi + dEta*dEta);
57
double
histFrac = 0.;
58
if
(j1->pt() > 0.) histFrac = j2->pt()/j1->pt();
59
60
if
(
m_histDeltaEta
)
m_histDeltaEta
->Fill( dEta, weight);
61
if
(
m_histDeltaPhi
)
m_histDeltaPhi
->Fill( dPhi, weight);
62
if
(
m_histDeltaR
)
m_histDeltaR
->Fill( dR, weight);
63
64
if
(
m_histFrac
)
m_histFrac
->Fill( histFrac, weight);
65
66
if
(
m_histEta1Eta2
)
m_histEta1Eta2
->Fill( j1->eta(), j2->eta(), weight );
67
68
return
0;
69
}
70
71
72
73
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
LeadingJetsRelations.h
ToolHandleHistoHelper.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
HistoGroupBase::bookHisto
T * bookHisto(T *h, Interval_t ityp=useToolInterval)
register the histo h in this group (if h!=NULL). The histo name is changed if m_prefixedHistoName==tr...
Definition
HistoGroupBase.h:69
JetHistoBase::JetHistoBase
JetHistoBase(const std::string &t)
Definition
JetHistoBase.cxx:10
LeadingJetsRelations::m_histDeltaPhi
TH1F * m_histDeltaPhi
Definition
LeadingJetsRelations.h:32
LeadingJetsRelations::m_histDeltaEta
TH1F * m_histDeltaEta
Definition
LeadingJetsRelations.h:31
LeadingJetsRelations::m_histFrac
TH1F * m_histFrac
Definition
LeadingJetsRelations.h:33
LeadingJetsRelations::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition
LeadingJetsRelations.cxx:22
LeadingJetsRelations::buildHistos
virtual int buildHistos()
Definition
LeadingJetsRelations.cxx:27
LeadingJetsRelations::m_histoDef
ToolHandleArray< HistoDefinitionTool > m_histoDef
Definition
LeadingJetsRelations.h:29
LeadingJetsRelations::m_histEta1Eta2
TH2F * m_histEta1Eta2
Definition
LeadingJetsRelations.h:35
LeadingJetsRelations::fillHistosFromContainer
virtual int fillHistosFromContainer(const xAOD::JetContainer &cont, float weight)
Definition
LeadingJetsRelations.cxx:47
LeadingJetsRelations::m_histDeltaR
TH1F * m_histDeltaR
Definition
LeadingJetsRelations.h:30
LeadingJetsRelations::LeadingJetsRelations
LeadingJetsRelations(const std::string &t)
Definition
LeadingJetsRelations.cxx:14
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
ToolHandleHistoHelper::HistoRetriever
Definition
ToolHandleHistoHelper.h:26
ToolHandleHistoHelper::HistoRetriever::build
T * build(const std::string &n)
Definition
ToolHandleHistoHelper.h:44
Generated on
for ATLAS Offline Software by
1.17.0