ATLAS Offline Software
Loading...
Searching...
No Matches
JetTileCorrectionTool.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: JetTileCorrectionTool.h 2015-03-10 tripiana $
8#ifndef JETTILECORRECTION_JETTILECORRECTIONTOOL_H
9#define JETTILECORRECTION_JETTILECORRECTIONTOOL_H
10
11// Framework include(s):
13
14// Tool dependencies
15
16// Local include(s):
20
21#include "TFile.h"
22#include "TSystem.h"
23#include "TProfile.h"
24#include <iostream>
25#include <stdlib.h>
26#include <set>
27#include <vector>
28#include <unordered_map>
29
30//--- config ---
31#define PIXWIDTH 0.1
32#define RINGWIDTH 0.1
33#define RJET 0.4
34#define NPIX 16
35#define OUT 99
36#define Pix_eta 17
37#define Pix_phi 6
38//--------------
39
40
41
42namespace CP {
43
46 {
49
50 public:
52 JetTileCorrectionTool( const std::string& name );
53
55 virtual ~JetTileCorrectionTool();
56
58 virtual StatusCode initialize();
59
61 virtual CorrectionCode applyCorrection( xAOD::Jet& object );
62
64 virtual CorrectionCode correctedCopy( const xAOD::Jet& input, xAOD::Jet*& output );
65
66
68 virtual bool
69 isAffectedBySystematic( const SystematicVariation& systematic ) const;
70
72 virtual SystematicSet
74
76 virtual SystematicSet
78
83
84 virtual StatusCode applySystematicVariation
85 ( const SystematicSet& systConfig );
86
87 StatusCode registerSystematics();
88
89
90 //status helpers
92 StatusCode addTileStatus(const xAOD::Jet& jet);
93
94 //DR helper
95 void setRJET(float r); //Set Jet Radius. NOTE: Only for checking overlap! The correction is only derived for EMTopo R=0.4 jets at the moment.
96
97 private:
98
99 // Load dead regions DB
100 void loadDeadUser(); //user-defined
101 void loadDeadDB(); //DB-defined
102
103 std::vector<float> getCorrections(const xAOD::Jet& j); //, bool constScale);
104
105 JTC::TS overlap(const xAOD::Jet& j, const JTC::Hole& region);
106
107 int getPtBin(float pt); //in MeV
108
109 bool inIOV(const JTC::Hole& region, int run);
110
111 bool inHole(const xAOD::Jet& j, const JTC::Hole& rdead);
112 bool inHole(float eta, float phi, const JTC::Hole& rdead);
113
114 IPair getModulePosition(const xAOD::Jet& jet, const JTC::Hole& module);
115
116 void loadModulesFromMap(const xAOD::Jet& jet, JTC::TS& status, const std::map<std::string,JTC::Hole>& hmap, JTC::PART part=JTC::PART::LB, JTC::TYPE type=JTC::TYPE::DB);
117 StatusCode loadAllModules(const xAOD::Jet& jet, JTC::TS& status);
118
119 JTC::Hole partModToHole(int part, int mod); //translate to eta-phi coordinates (+dummy IOV)
120
121 bool m_constScale = false; //Get correction using constituent pt (for testing purposes)
122 bool m_isMC = false; //check if it is simulation
123
124 int m_current_run = -1; //keep current run number
125 //int m_current_lb; //keep current lumiblock
126
127 int m_NbinsPt = -1; //number of pt-bins in parametrization histograms
128
129 std::vector<std::string> m_v_user_dead; //book dead regions (apart from those coming from detector db)
130
131 TFile* m_rootFile = 0; //correction file
132 std::string m_rootFileName; //correction filename
133
134 std::string m_bd_dead_mapFile; //masked region DB filename
135
136 std::vector<JTC::Region> m_position_masked;
137
138 //***
139 TH1F* m_core_sys_LB = 0;
140 TH1F* m_core_sys_EB = 0;
141 //***
142
143 std::map<int,TH1F*> m_pars_LB;
144 std::map<int,TH1F*> m_pars_EB;
145 std::map<std::string,JTC::Hole> m_db_dead_LB;
146 std::map<std::string,JTC::Hole> m_db_dead_EB;
147 std::map<std::string,JTC::Hole> m_user_dead_LB;
148 std::map<std::string,JTC::Hole> m_user_dead_EB;
149
150 float m_RJET;
151
153 std::unordered_map<CP::SystematicSet, CP::SystematicSet> m_systFilter;
154
157
158 }; // class JetTileCorrectionTool
159
160} // namespace CP
161
162#endif // JETTILECORRECTION_JETTILECORRECTIONTOOL_H
Scalar eta() const
pseudorapidity method
#define ASG_TOOL_CLASS3(CLASSNAME, INT1, INT2, INT3)
std::pair< int, int > IPair
This file defines helper classes to deal with jet constituents.
Return value from object correction CP tools.
Interface for the tool correcting for dead Tile modules.
interface for all CP tools supporting systematic variations within a reentrant algorithm
Interface for all CP tools supporting systematic variations.
TH1F * m_core_sys_LB
//needs to be transient!
virtual StatusCode initialize()
Function initialising the tool.
virtual SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool recommends to use
std::vector< float > getCorrections(const xAOD::Jet &j)
std::map< std::string, JTC::Hole > m_db_dead_LB
std::map< std::string, JTC::Hole > m_user_dead_LB
JetTileCorrectionTool(const std::string &name)
Create a proper constructor for Athena.
IPair getModulePosition(const xAOD::Jet &jet, const JTC::Hole &module)
bool inIOV(const JTC::Hole &region, int run)
bool inHole(const xAOD::Jet &j, const JTC::Hole &rdead)
std::map< int, TH1F * > m_pars_EB
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
const CP::SystematicSet & appliedSystematics() const
returns: the currently applied systematics
virtual CorrectionCode applyCorrection(xAOD::Jet &object)
Apply the correction on a modifyable object.
std::vector< JTC::Region > m_position_masked
std::vector< std::string > m_v_user_dead
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
Systematics filter map.
std::map< int, TH1F * > m_pars_LB
JTC::Hole partModToHole(int part, int mod)
std::map< std::string, JTC::Hole > m_user_dead_EB
StatusCode loadAllModules(const xAOD::Jet &jet, JTC::TS &status)
CP::SystematicSet * m_appliedSystematics
Currently applied systematics.
virtual ~JetTileCorrectionTool()
Destructor:
JTC::TS overlap(const xAOD::Jet &j, const JTC::Hole &region)
void loadModulesFromMap(const xAOD::Jet &jet, JTC::TS &status, const std::map< std::string, JTC::Hole > &hmap, JTC::PART part=JTC::PART::LB, JTC::TYPE type=JTC::TYPE::DB)
virtual CorrectionCode correctedCopy(const xAOD::Jet &input, xAOD::Jet *&output)
Create a corrected copy from a constant jet.
virtual SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
JTC::TS getTileStatus(const xAOD::Jet &jet)
StatusCode registerSystematics()
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematic
std::map< std::string, JTC::Hole > m_db_dead_EB
StatusCode addTileStatus(const xAOD::Jet &jet)
Class to wrap a set of SystematicVariations.
Base class for dual-use tools that provide file metadata access.
int r
Definition globals.cxx:22
Select isolated Photons, Electrons and Muons.
Definition run.py:1
Jet_v1 Jet
Definition of the current "jet version".
setRcore setEtHad setFside pt