ATLAS Offline Software
JetClusterer.h
Go to the documentation of this file.
1 // this file is -*- C++ -*-
2 /*
3  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 #ifndef JETREC_JETCLUSTERER_H
7 #define JETREC_JETCLUSTERER_H
8 
19 
24 
26 #include "AsgTools/AsgTool.h"
28 
32 #include "JetEDM/PseudoJetVector.h"
33 #include "JetEDM/ClusterSequence.h"
34 
35 #include "fastjet/PseudoJet.hh"
36 #include "fastjet/AreaDefinition.hh"
37 #include "fastjet/JetDefinition.hh"
38 
41 
42 
44 : public asg::AsgTool,
45  virtual public JetProvider<xAOD::JetAuxContainer> {
47 
48 public:
49 
50  // Can't use "using ctor" because of incompatiblity with pyroot in AnalysisBase
51  JetClusterer(const std::string &name)
52  : AsgTool(name),
53  m_jetRankAccessor("jetRank")
54  {}
55 
56  StatusCode initialize() override;
57 
60  std::pair<std::unique_ptr<xAOD::JetContainer>, std::unique_ptr<SG::IAuxStore> > getJets() const override;
61 
62 
63 protected:
64 
66  fastjet::AreaDefinition buildAreaDefinition(bool &seedsok) const ;
67 
69  std::unique_ptr<fastjet::ClusterSequence> buildClusterSequence(const PseudoJetVector* pseudoJetvector) const ;
70 
72  void processPseudoJet(const fastjet::PseudoJet& pj, const PseudoJetContainer& pjCont, xAOD::JetContainer* jets, const xAOD::Vertex* vertex) const;
73 
76 
78  SG::ReadHandleKey<PseudoJetContainer> m_inputPseudoJets {this, "InputPseudoJets", "inputpseudojet", "input constituents"};
79 
81  SG::WriteHandleKey<PseudoJetVector> m_finalPseudoJets {this, "FinalPseudoJets_DONOTSET", "", "output pseudojets -- autoconfigured name"};
82  SG::WriteHandleKey<jet::ClusterSequence> m_clusterSequence {this, "ClusterSequence_DONOTSET", "", "output pseudojets -- autoconfigured name"};
83  Gaudi::Property<std::string> m_jetRank {this, "jetRankName", "jetRank", "name for accessor for jet rank"};
84 
85  // Job options.
86  Gaudi::Property<std::string> m_jetalg {this, "JetAlgorithm", "AntiKt", "alg type : AntiKt, Kt, CA..."};
87  Gaudi::Property<float> m_jetrad {this, "JetRadius", 0.4 , "jet size parameter"};
88  Gaudi::Property<float> m_ptmin {this, "PtMin", 0.0, "pT min in MeV"};
89  Gaudi::Property<float> m_ghostarea {this, "GhostArea", 0.0, "Area for ghosts. 0==>no ghosts."};
90  Gaudi::Property<int> m_ranopt {this, "RandomOption", 1, "Rand option: 0=fj default, 1=run/event"};
91 
92  Gaudi::Property<int> m_inputType {this, "JetInputType", 0, "input type as in xAOD::JetInput (see xAODJet/JetContainerInfo.h)"};
93 
94 
95  // internal data set from properties during initialize()
96  fastjet::JetAlgorithm m_fjalg;
97  bool m_useArea;
98 
99  Gaudi::Property<float> m_minrad {this, "VariableRMinRadius", -1.0, "Variable-R min radius" };
100  Gaudi::Property<float> m_massscale {this, "VariableRMassScale", -1.0, "Variable-R mass scale" };
102  bool isVariableR() const { return m_isVariableR;}
103 
105 
106 };
107 
108 
110 
112  void seedsFromEventInfo(const xAOD::EventInfo* ei, std::vector<int> &seeds);
113 
114 }
115 
116 #endif
IJetProvider.h
JetClusterer::m_eventinfokey
SG::ReadHandleKey< xAOD::EventInfo > m_eventinfokey
Handle to EventInfo. This is used to get the evt&run number to set the Ghost area random seeds.
Definition: JetClusterer.h:84
JetClusterer::m_jetalg
Gaudi::Property< std::string > m_jetalg
Definition: JetClusterer.h:95
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
JetClusterer::m_ghostarea
Gaudi::Property< float > m_ghostarea
Definition: JetClusterer.h:98
JetClustererHelper
Definition: JetClusterer.h:109
JetClusterer::JetClusterer
JetClusterer(const std::string &name)
Definition: JetClusterer.h:60
PseudoJetVector.h
JetClusterer::m_inputType
Gaudi::Property< int > m_inputType
Definition: JetClusterer.h:101
JetClusterer::m_ranopt
Gaudi::Property< int > m_ranopt
Definition: JetClusterer.h:99
JetClusterer::m_jetrad
Gaudi::Property< float > m_jetrad
Definition: JetClusterer.h:96
ClusterSequence.h
JetClusterer::m_clusterSequence
SG::WriteHandleKey< jet::ClusterSequence > m_clusterSequence
Definition: JetClusterer.h:91
PseudoJetContainer
Definition: PseudoJetContainer.h:48
JetClusterer::m_massscale
Gaudi::Property< float > m_massscale
Definition: JetClusterer.h:109
SG::ReadHandleKey< xAOD::EventInfo >
JetClusterer::m_isVariableR
bool m_isVariableR
Definition: JetClusterer.h:110
JetClusterer::buildAreaDefinition
fastjet::AreaDefinition buildAreaDefinition(bool &seedsok) const
Build the area definition when running with area calculation. The seedsok flag is set to false when e...
Definition: JetClusterer.cxx:271
JetClusterer::m_fjalg
fastjet::JetAlgorithm m_fjalg
Definition: JetClusterer.h:105
JetClusterer::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetClusterer.cxx:44
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition: AsgTool.cxx:58
SG::WriteHandleKey< PseudoJetVector >
JetClusterer::m_inputPseudoJets
SG::ReadHandleKey< PseudoJetContainer > m_inputPseudoJets
Handle Input PseudoJetContainer.
Definition: JetClusterer.h:87
PseudoJetTranslator.h
JetClusterer::m_minrad
Gaudi::Property< float > m_minrad
Definition: JetClusterer.h:108
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
JetClustererHelper::seedsFromEventInfo
void seedsFromEventInfo(const xAOD::EventInfo *ei, std::vector< int > &seeds)
Fill seeds vector from run & event number. This functio is separated from the class so it's easier to...
Definition: JetClusterer.cxx:27
JetClusterer::buildClusterSequence
std::unique_ptr< fastjet::ClusterSequence > buildClusterSequence(const PseudoJetVector *pseudoJetvector) const
Used to create the cluster sequence.
Definition: JetClusterer.cxx:91
JetClusterer
Definition: JetClusterer.h:45
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
JetClusterer::m_jetRankAccessor
SG::AuxElement::Accessor< int > m_jetRankAccessor
Definition: JetClusterer.h:113
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PseudoJetVector
std::vector< fastjet::PseudoJet > PseudoJetVector
Definition: JetConstituentFiller.cxx:17
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
VertexContainer.h
PseudoJetContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
JetClusterer::m_finalPseudoJets
SG::WriteHandleKey< PseudoJetVector > m_finalPseudoJets
used to build the key under which the final PJ will be stored in evtStore()
Definition: JetClusterer.h:90
JetClusterer::getJets
std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > getJets() const override
Return the final jets with their aux store.
Definition: JetClusterer.cxx:192
JetAuxContainer.h
JetClusterer::m_ptmin
Gaudi::Property< float > m_ptmin
Definition: JetClusterer.h:97
JetProvider
Concrete class that implements the recording of jets & aux container to StoreGate via an externally p...
Definition: IJetProvider.h:77
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
JetFromPseudojet.h
JetClusterer::m_jetRank
Gaudi::Property< std::string > m_jetRank
Definition: JetClusterer.h:92
AsgTool.h
IJetProvider
Definition: IJetProvider.h:27
JetClusterer::m_useArea
bool m_useArea
Definition: JetClusterer.h:106
JetClusterer::isVariableR
bool isVariableR() const
Definition: JetClusterer.h:111
AuxElement.h
Base class for elements of a container that can have aux data.
JetClusterer::processPseudoJet
void processPseudoJet(const fastjet::PseudoJet &pj, const PseudoJetContainer &pjCont, xAOD::JetContainer *jets, const xAOD::Vertex *vertex) const
translate to xAOD::Jet
Definition: JetClusterer.cxx:151