ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
JiveXML::AODJetRetriever Class Reference

Retrieves all Jet objects (JetEvent/Jet) More...

#include <AODJetRetriever.h>

Inheritance diagram for JiveXML::AODJetRetriever:
Collaboration diagram for JiveXML::AODJetRetriever:

Public Member Functions

 AODJetRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor. More...
 
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 Retrieve all the data. More...
 
const DataMap getData (const JetCollection *)
 Rretrieve basic parameters, mainly four-vectors. More...
 
virtual std::string dataTypeName () const
 Return the name of the data type. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Return the interface identifier. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const std::string m_typeName
 The data type that is generated by this retriever. More...
 
std::string m_sgKeyFavourite
 
std::vector< std::string > m_otherKeys
 
bool m_doWriteHLT
 
bool m_writeJetQuality
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Retrieves all Jet objects (JetEvent/Jet)

Definition at line 33 of file AODJetRetriever.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ AODJetRetriever()

JiveXML::AODJetRetriever::AODJetRetriever ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard Constructor.

This is the standard AthAlgTool constructor.

Parameters
typeAlgTool type name
nameAlgTool instance name
parentAlgTools parent owning this tool

Definition at line 20 of file AODJetRetriever.cxx.

20  :
22  m_typeName("Jet"){
23 
24  //Only declare the interface
25  declareInterface<IDataRetriever>(this);
26 
27  declareProperty("FavouriteJetCollection" ,m_sgKeyFavourite = "AntiKt4TopoEMJets" ,
28  "Collection to be first in output, shown in Atlantis without switching");
29  declareProperty("OtherJetCollections" ,m_otherKeys,
30  "Other collections to be retrieved. If list left empty, all available retrieved");
31  declareProperty("DoWriteHLT", m_doWriteHLT = false,"Ignore HLTAutokey object by default."); // ignore HLTAutoKey objects
32  declareProperty("WriteJetQuality", m_writeJetQuality = false,"Don't write extended jet quality details by default.");
33  }

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::AODJetRetriever::dataTypeName ( ) const
inlinevirtual

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 46 of file AODJetRetriever.h.

46 { return m_typeName; };

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getData()

const DataMap JiveXML::AODJetRetriever::getData ( const JetCollection jets)

Rretrieve basic parameters, mainly four-vectors.

AOD Jets have no cells (trying to access them without back-navigation causes Athena crash).

Parameters
FormatToolthe tool that will create formated output from the DataMap

Definition at line 114 of file AODJetRetriever.cxx.

114  {
115 
116  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "retrieve()" << endmsg;
117 
119 
120  DataVect phi; phi.reserve(jets->size());
121  DataVect eta; eta.reserve(jets->size());
122  DataVect et; et.reserve(jets->size());
123  DataVect pt; pt.reserve(jets->size());
124 /* need to be added to AtlantisJava/event.dtd !
125  DataVect flavourTagWeight; flavourTagWeight.reserve(jets->size());
126  DataVect charge; charge.reserve(jets->size());
127 */
128  DataVect energy; energy.reserve(jets->size());
129  DataVect mass; mass.reserve(jets->size());
130  DataVect px; px.reserve(jets->size());
131  DataVect py; py.reserve(jets->size());
132  DataVect pz; pz.reserve(jets->size());
133  DataVect idVec; idVec.reserve(jets->size());
134 
135  DataVect bTagName; bTagName.reserve(jets->size());
136  DataVect bTagValue; bTagValue.reserve(jets->size());
137 
138  // jet quality variables:
139  DataVect quality; quality.reserve(jets->size());
140  DataVect qualityLAr; qualityLAr.reserve(jets->size());
141  DataVect qualityTile; qualityTile.reserve(jets->size());
142  DataVect time; time.reserve(jets->size());
143  DataVect timeClusters; timeClusters.reserve(jets->size());
144  DataVect n90cells; n90cells.reserve(jets->size());
145  DataVect n90const; n90const.reserve(jets->size());
146  DataVect hecf; hecf.reserve(jets->size());
147  DataVect emfrac; emfrac.reserve(jets->size());
148  DataVect tileGap3f; tileGap3f.reserve(jets->size());
149  DataVect fcorCell; fcorCell.reserve(jets->size());
150  DataVect fcorDotx; fcorDotx.reserve(jets->size());
151  DataVect fcorJet; fcorJet.reserve(jets->size());
152  DataVect fcorJetForCell; fcorJetForCell.reserve(jets->size());
153  DataVect nbadcells; nbadcells.reserve(jets->size());
154  DataVect fracSamplingMax; fracSamplingMax.reserve(jets->size());
155  DataVect sMax; sMax.reserve(jets->size());
156  DataVect OutOfTimeEfrac; OutOfTimeEfrac.reserve(jets->size());
157  DataVect isGood; isGood.reserve(jets->size());
158  DataVect isBad; isBad.reserve(jets->size());
159  DataVect isUgly; isUgly.reserve(jets->size());
160  DataVect jvf; jvf.reserve(jets->size());
161 
162  int id = 0;
163 
164  JetCollection::const_iterator itr = jets->begin();
165  for (; itr != jets->end(); ++itr) {
166  phi.push_back(DataType((*itr)->phi()));
167  eta.push_back(DataType((*itr)->eta()));
168  et.push_back(DataType((*itr)->et()/CLHEP::GeV));
169  pt.push_back(DataType((*itr)->pt()/CLHEP::GeV));
170  idVec.push_back( DataType( ++id ));
171 
172 //from: http://alxr.usatlas.bnl.gov/lxr/source/atlas/PhysicsAnalysis/AnalysisCommon/AnalysisExamples/src/JetTagAna.cxx
173 //
174  // bjet tagger values
175  bTagName.push_back( DataType( "JetFitterCOMBNN" ));
176  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("JetFitterCOMBNN") ));
177  bTagName.push_back( DataType( "JetFitterTagNN" ));
178  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("JetFitterTagNN") ));
179  bTagName.push_back( DataType( "IP3D+SV1" ));
180  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight() ));
181  bTagName.push_back( DataType( "IP2D" ));
182  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("IP2D") ));
183  bTagName.push_back( DataType( "IP3D" ));
184  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("IP3D") ));
185  bTagName.push_back( DataType( "SV1" ));
186  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("SV1") ));
187  bTagName.push_back( DataType( "SV2" ));
188  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("SV2") ));
189  bTagName.push_back( DataType( "MV1" ));
190  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("MV1") ));
191  bTagName.push_back( DataType( "MV2" ));
192  bTagValue.push_back( DataType( (*itr)->getFlavourTagWeight("MV2") ));
193 
194  // basic jet quality
195  quality.push_back(DataType((*itr)->getMoment("LArQuality")));
196 
197  isGood.push_back(DataType( 1 ));
198  isBad.push_back(DataType( 0 ));
199  isUgly.push_back(DataType( 0 ));
200  emfrac.push_back(DataType( 0.5 ));
201 
202  // isGood.push_back(DataType(JetCaloQualityUtils::isGood(*itr)));
203  // isBad.push_back(DataType(JetCaloQualityUtils::isBad(*itr)));
204  // isUgly.push_back(DataType(JetCaloQualityUtils::isUgly(*itr)));
205  // emfrac.push_back(DataType(JetCaloHelper::jetEMFraction(*itr)));
206 
207  /* not working anymore with xAOD - temporarily removed
208  if (m_writeJetQuality){ // extended jet quality
209  qualityLAr.push_back(DataType(JetCaloQualityUtils::jetQualityLAr(*itr))); // this caused problems in AOD !
210  qualityTile.push_back(DataType(JetCaloQualityUtils::jetQualityTile(*itr))); // this caused problems in AOD !
211  time.push_back(DataType(JetCaloQualityUtils::jetTime(*itr))); //(*itr)->getJetTime() without sign
212  timeClusters.push_back(DataType(JetCaloQualityUtils::jetTimeClusters(*itr)));
213  n90cells.push_back(DataType(JetCaloQualityUtils::nLeadingCells(*itr,0.9))); //(*itr)->getMoment("n90")
214  n90const.push_back(DataType(JetCaloQualityUtils::nLeadingConstituents(*itr,0.9)));
215  hecf.push_back(DataType(JetCaloQualityUtils::hecF(*itr)));
216  tileGap3f.push_back(DataType(JetCaloQualityUtils::tileGap3F(*itr)));
217  fcorCell.push_back(DataType((*itr)->getMoment("BCH_CORR_CELL")));
218  fcorDotx.push_back(DataType((*itr)->getMoment("BCH_CORR_DOTX")));
219  fcorJet.push_back(DataType((*itr)->getMoment("BCH_CORR_JET")));
220  fcorJetForCell.push_back(DataType((*itr)->getMoment("BCH_CORR_JET_FORCELL")));
221  nbadcells.push_back(DataType((*itr)->getMoment("N_BAD_CELLS_CORR")));
222  int SamplingMax = CaloSampling::Unknown;
223  fracSamplingMax.push_back(DataType(JetCaloQualityUtils::fracSamplingMax(*itr, SamplingMax)));
224  sMax.push_back(DataType(SamplingMax));
225  OutOfTimeEfrac.push_back(DataType(JetCaloQualityUtils::jetOutOfTimeEnergyFraction(*itr,25)));
226  } // writeJetQuality
227  */
228 
229 /* need to be added to AtlantisJava/event.dtd !
230  charge.push_back( DataType((*itr)->charge()));
231  flavourTagWeight.push_back( DataType((*itr)->getFlavourTagWeight()));
232 */
233  jvf.push_back( DataType((*itr)->getMoment("JVF") ));
234 
235  energy.push_back( DataType((*itr)->e()/CLHEP::GeV ) );
236  mass.push_back(DataType((*itr)->m()/CLHEP::GeV));
237  px.push_back( DataType((*itr)->px()/CLHEP::GeV ) );
238  py.push_back( DataType((*itr)->py()/CLHEP::GeV ) );
239  pz.push_back( DataType((*itr)->pz()/CLHEP::GeV ) );
240  }
241 
242  // Start with mandatory entries
243  const auto n = phi.size();
244  DataMap["phi"] = std::move(phi);
245  DataMap["eta"] = std::move(eta);
246  DataMap["et"] = std::move(et);
247  DataMap["pt"] = std::move(pt);
248  DataMap["id"] = std::move(idVec);
249 
250  DataMap["bTagName multiple=\"9\""] = std::move(bTagName); // assigned by hand !
251  DataMap["bTagValue multiple=\"9\""] = std::move(bTagValue);
252 
253  // basic jet quality
254  DataMap["quality"] = std::move(quality);
255  DataMap["isGood"] = std::move(isGood);
256  DataMap["isBad"] = std::move(isBad);
257  DataMap["isUgly"] = std::move(isUgly);
258  DataMap["emfrac"] = std::move(emfrac);
259 
260  DataMap["jvf"] = std::move(jvf);
261 
262  if (m_writeJetQuality){ // extended jet quality
263  DataMap["qualityLAr"] = std::move(qualityLAr);
264  DataMap["qualityTile"] = std::move(qualityTile);
265  DataMap["time"] = std::move(time);
266  DataMap["timeClusters"] = std::move(timeClusters);
267  DataMap["n90cells"] = std::move(n90cells);
268  DataMap["n90const"] = std::move(n90const);
269  DataMap["hecf"] = std::move(hecf);
270  DataMap["tileGap3f"] = std::move(tileGap3f);
271  DataMap["fcorCell"] = std::move(fcorCell);
272  DataMap["fcorDotx"] = std::move(fcorDotx);
273  DataMap["fcorJet"] = std::move(fcorJet);
274  DataMap["fcorJetForCell"] = std::move(fcorJetForCell);
275  DataMap["nbadcells"] = std::move(nbadcells);
276  DataMap["fracSamplingMax"] = std::move(fracSamplingMax);
277  DataMap["sMax"] = std::move(sMax);
278  DataMap["OutOfTimeEfrac"] = std::move(OutOfTimeEfrac);
279  } // writeJetQuality
280 
281  // further details
282  // four-vectors
283 /* need to be added to AtlantisJava/event.dtd !
284  DataMap["charge"] = charge;
285  DataMap["flavourTagWeight"] = flavourTagWeight;
286 */
287  DataMap["mass"] = std::move(mass);
288  DataMap["px"] = std::move(px);
289  DataMap["py"] = std::move(py);
290  DataMap["pz"] = std::move(pz);
291  DataMap["energy"] = std::move(energy);
292 
293  if (msgLvl(MSG::DEBUG)) {
294  msg(MSG::DEBUG) << dataTypeName() << " (AOD, no cells), collection: " << dataTypeName();
295  msg(MSG::DEBUG) << " retrieved with " << n << " entries"<< endmsg;
296  }
297 
298  //All collections retrieved okay
299  return DataMap;
300 
301  } // retrieve

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40 { return IID_IDataRetriever; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ retrieve()

StatusCode JiveXML::AODJetRetriever::retrieve ( ToolHandle< IFormatTool > &  FormatTool)
virtual

Retrieve all the data.

For each jet collections retrieve basic parameters.

'Favourite' jet collection first, then 'Other' jet collections.

Implements JiveXML::IDataRetriever.

Definition at line 39 of file AODJetRetriever.cxx.

39  {
40 
41  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "in retrieveAll()" << endmsg;
42 
44  const JetCollection* jets;
45 
46  //obtain the default collection first
47  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Trying to retrieve " << dataTypeName() << " (" << m_sgKeyFavourite << ")" << endmsg;
48  StatusCode sc = evtStore()->retrieve(jets, m_sgKeyFavourite);
49  if (sc.isFailure() ) {
50  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Collection " << m_sgKeyFavourite << " not found in SG " << endmsg;
51  }else{
53  if ( FormatTool->AddToEvent(dataTypeName(), m_sgKeyFavourite+"_AOD", &data).isFailure()){
54  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Collection " << m_sgKeyFavourite << " not found in SG " << endmsg;
55  }else{
56  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << " (" << m_sgKeyFavourite << ") AODJet retrieved" << endmsg;
57  }
58  }
59 
60  if ( m_otherKeys.empty() ) {
61  //obtain all other collections from StoreGate
62  if (( evtStore()->retrieve(iterator, end)).isFailure()){
63  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to retrieve iterator for Jet collection" << endmsg;
64 // return false;
65  }
66 
67  for (; iterator!=end; ++iterator) {
68 
69  std::string::size_type position = iterator.key().find("HLTAutoKey",0);
70  if ( m_doWriteHLT ){ position = 99; } // override SG key find
71 
72 // if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " AODJet: HLTAutoKey in " << iterator.key() << " at position "
73 // << position << endmsg;
74  if ( position != 0 ){ // SG key doesn't contain HLTAutoKey
75  if (iterator.key()!=m_sgKeyFavourite) {
76  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Trying to retrieve all " << dataTypeName() << " (" << iterator.key() << ")" << endmsg;
78  if ( FormatTool->AddToEvent(dataTypeName(), iterator.key()+"_AOD", &data).isFailure()){
79  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Collection " << iterator.key() << " not found in SG " << endmsg;
80  }else{
81  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << " (" << iterator.key() << ") AODJet retrieved" << endmsg;
82  }
83  }
84  }
85  }
86  }else {
87  //obtain all collections with the given keys
88  std::vector<std::string>::const_iterator keyIter;
89  for ( keyIter=m_otherKeys.begin(); keyIter!=m_otherKeys.end(); ++keyIter ){
90  if ( !evtStore()->contains<JetCollection>( (*keyIter) ) ){ continue; } // skip if not in SG
91  StatusCode sc = evtStore()->retrieve( jets, (*keyIter) );
92  if (!sc.isFailure()) {
93  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Trying to retrieve selected " << dataTypeName() << " (" << (*keyIter) << ")" << endmsg;
95  if ( FormatTool->AddToEvent(dataTypeName(), (*keyIter)+"_AOD", &data).isFailure()){
96  if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Collection " << (*keyIter) << " not found in SG " << endmsg;
97  }else{
98  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << " (" << (*keyIter) << ") retrieved" << endmsg;
99  }
100  }
101  }
102  }
103  //All collections retrieved okay
104  return StatusCode::SUCCESS;
105  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doWriteHLT

bool JiveXML::AODJetRetriever::m_doWriteHLT
private

Definition at line 54 of file AODJetRetriever.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_otherKeys

std::vector<std::string> JiveXML::AODJetRetriever::m_otherKeys
private

Definition at line 53 of file AODJetRetriever.h.

◆ m_sgKeyFavourite

std::string JiveXML::AODJetRetriever::m_sgKeyFavourite
private

Definition at line 52 of file AODJetRetriever.h.

◆ m_typeName

const std::string JiveXML::AODJetRetriever::m_typeName
private

The data type that is generated by this retriever.

Definition at line 50 of file AODJetRetriever.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeJetQuality

bool JiveXML::AODJetRetriever::m_writeJetQuality
private

Definition at line 55 of file AODJetRetriever.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
et
Extra patterns decribing particle interation process.
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
test_pyathena.px
px
Definition: test_pyathena.py:18
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
JiveXML::AODJetRetriever::m_sgKeyFavourite
std::string m_sgKeyFavourite
Definition: AODJetRetriever.h:52
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
JiveXML::AODJetRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: AODJetRetriever.cxx:39
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
test_pyathena.pt
pt
Definition: test_pyathena.py:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
JiveXML::AODJetRetriever::getData
const DataMap getData(const JetCollection *)
Rretrieve basic parameters, mainly four-vectors.
Definition: AODJetRetriever.cxx:114
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
JiveXML::AODJetRetriever::m_doWriteHLT
bool m_doWriteHLT
Definition: AODJetRetriever.h:54
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JiveXML::AODJetRetriever::m_otherKeys
std::vector< std::string > m_otherKeys
Definition: AODJetRetriever.h:53
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Amg::py
@ py
Definition: GeoPrimitives.h:39
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JiveXML::AODJetRetriever::m_writeJetQuality
bool m_writeJetQuality
Definition: AODJetRetriever.h:55
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
JetCollection
Container for Jets
Definition: JetCollection.h:30
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
JiveXML::AODJetRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: AODJetRetriever.h:46
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
SG::ConstIterator
Definition: SGIterator.h:163
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
JiveXML::AODJetRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition: AODJetRetriever.h:46