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

Cluster correction tool which applies local hadronic calibration w eights to the cells. The weight are provided by ICellWeight tools. More...

#include <CaloClusterLocalCalib.h>

Inheritance diagram for CaloClusterLocalCalib:
Collaboration diagram for CaloClusterLocalCalib:

Public Member Functions

virtual StatusCode initialize () override
 Tool initialization: load calibration tools specified by jobOptions. More...
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *theCluster) const override
 Execute on a single cluster. More...
 
 CaloClusterLocalCalib (const std::string &type, const std::string &name, const IInterface *parent)
 Standard AlgTool constructor. More...
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const=0
 Apply corrections to cluster. More...
 
virtual StatusCode execute (xAOD::CaloCluster *cluster) final
 Apply corrections to cluster. More...
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const
 Apply corrections to cluster. More...
 
virtual StatusCode execute (xAOD::CaloCluster *cluster) final
 Execute on a single cluster. More...
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const
 Execute on an entire collection of clusters. More...
 
virtual StatusCode execute (xAOD::CaloClusterContainer *collection) final
 Execute on an entire collection of clusters. 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 ()
 Standard Gaudi interface ID method. 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

ToolHandleArray< IClusterClassificationToolm_classificationTool
 property: Classification tools More...
 
ToolHandleArray< IClusterCellWeightToolm_calibTools
 property: Array of IClusterCellWeightTool More...
 
std::vector< int > m_recoStatus
 property: vector of valid Reco Statuses for the clusters in order to be calibrated More...
 
bool m_absOpt
 if set to true, negative clusters are weighted as well More...
 
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

Cluster correction tool which applies local hadronic calibration w eights to the cells. The weight are provided by ICellWeight tools.

Definition at line 32 of file CaloClusterLocalCalib.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

◆ CaloClusterLocalCalib()

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

Standard AlgTool constructor.

Definition at line 18 of file CaloClusterLocalCalib.cxx.

23  m_calibTools(this),
24  m_absOpt(false)
25 {
26  m_recoStatus.resize(0);
27  declareProperty ("ClusterClassificationTool",m_classificationTool);
28  declareProperty ("LocalCalibTools",m_calibTools) ;
29  declareProperty ("ClusterRecoStatus",m_recoStatus) ;
30  //Use weighting of negative clusters?
31  declareProperty ("WeightingOfNegClusters",m_absOpt) ;
32 }

Member Function Documentation

◆ 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; }

◆ execute() [1/7]

virtual StatusCode CaloClusterProcessor::execute

Apply corrections to cluster.

◆ execute() [2/7]

StatusCode CaloClusterLocalCalib::execute ( const EventContext &  ctx,
xAOD::CaloCluster cluster 
) const
overridevirtual

Execute on a single cluster.

Parameters
clusterThe cluster to process.
ctxThe event context.

Implements CaloClusterProcessor.

Definition at line 59 of file CaloClusterLocalCalib.cxx.

61 {
62  CaloRecoStatus& recoStatus=theCluster->recoStatus();
63  // call classification tool
64  if (!m_classificationTool.empty()) {
65  recoStatus=m_classificationTool[0]->classify(theCluster);
66  }
67  // check desired reco status
68  bool isSelected (false);
69  for (unsigned int i=0;!isSelected && i<m_recoStatus.size();i++ )
70  isSelected = recoStatus.checkStatus(CaloRecoStatus::StatusIndicator(m_recoStatus[i]));
71  if ( isSelected ) {
72  if( m_absOpt ){
73 
74 
75  //double dm_weight(0.);
76  //double had_weight(0.);
77  double centLambd(0.);
78  double engdens(0.);
79  double emprobability(0.);
80  double isolation(0.);
81  // Store moments and energy of the old cluster
82  //theCluster->retrieveMoment(xAOD::CaloCluster::DM_WEIGHT, dm_weight);
83  //theCluster->retrieveMoment(xAOD::CaloCluster::HAD_WEIGHT,had_weight);
84  if (!theCluster->retrieveMoment(xAOD::CaloCluster::CENTER_LAMBDA,centLambd))
85  centLambd = 0;
86  if (!theCluster->retrieveMoment(xAOD::CaloCluster::FIRST_ENG_DENS,engdens))
87  engdens = 0;
88  if (!theCluster->retrieveMoment(xAOD::CaloCluster::EM_PROBABILITY,emprobability))
89  emprobability = 0;
90  if (!theCluster->retrieveMoment(xAOD::CaloCluster::ISOLATION,isolation))
91  isolation = 0;
92 
93  double oldEnergy = theCluster->e();
94 
95  const CaloCell_ID* calo_id = nullptr;
96  ATH_CHECK(detStore()->retrieve(calo_id,"CaloCell_ID"));
97 
98 // Make new Cluster and CellColl
99  //std::unique_ptr<CaloCellContainer> myCellColl=std::make_unique<CaloCellContainer>(SG::OWN_ELEMENTS);
101  std::unique_ptr<xAOD::CaloCluster> myCluster = CaloClusterStoreHelper::makeCluster(&myCellColl);
102  int cellIndex = 0;
103 // Iterate over cells of old cluster and replicate them with energy weighted by -1 if negative and add it to the new cluster
104  xAOD::CaloCluster::cell_iterator cellIter = theCluster->cell_begin();
105  for(;cellIter!=theCluster->cell_end();cellIter++) {
106  const CaloCell* pCell = *cellIter;
107  double CellEnergy = pCell->e();
108  //Identifier myId = pCell->ID();
109  //IdentifierHash myHashId = calo_id->calo_cell_hash(myId);
110  if( CellEnergy < 0. ) CellEnergy = -1 * pCell->e();
111  myCellColl.push_back(new CaloCell(pCell->caloDDE(), pCell->ID(), CellEnergy, pCell->time(), pCell->quality(), pCell->provenance(), pCell->gain() ));
112  double cellWeight = cellIter.weight();
113  myCluster->addCell(cellIndex,cellWeight);
114  cellIndex++;
115  }
116 
117  CaloClusterKineHelper::calculateKine(myCluster.get(),false,false);
118  myCluster->setRawE(myCluster->e());
119 
120 // Set sample energy of the new cluster to the one of the old cluster, other wise it is zero, important for dm correction
121  for(unsigned int i=0; i != CaloSampling::Unknown; ++ i) {
123  if (myCluster->hasSampling(s)) myCluster->setEnergy((CaloSampling::CaloSample)i, theCluster->eSample((CaloSampling::CaloSample)i));
124  }//end loop over samplings
125 
126  CaloClusterKineHelper::calculateKine(myCluster.get(),true,false);
127 // Give the new cluster the same moments as the old one
128  myCluster->insertMoment(xAOD::CaloCluster::CENTER_LAMBDA,centLambd);
130  myCluster->insertMoment(xAOD::CaloCluster::EM_PROBABILITY,emprobability);
131  myCluster->insertMoment(xAOD::CaloCluster::ISOLATION,isolation);
132 
133 // Weight the new cluster
134  for (const ToolHandle<IClusterCellWeightTool>& tool : m_calibTools) {
135  if (tool->weight(myCluster.get(),ctx).isFailure())
136  msg(MSG::ERROR) << " failed to weight cluster " << endmsg;
137  }
138 
139 // Iterate over new, calibrated cluster and write out the weights of every cell into a map
140  std::map<IdentifierHash,double> weightMap;
141  xAOD::CaloCluster::cell_iterator mycellIter = myCluster->cell_begin();
142  xAOD::CaloCluster::cell_iterator mycellIterEnd = myCluster->cell_end();
143  for(;mycellIter!=mycellIterEnd;mycellIter++) {
144  const CaloCell* pCell = *mycellIter;
145  double cellWeight = mycellIter.weight();
146  Identifier myId = pCell->ID();
147  IdentifierHash myHashId = calo_id->calo_cell_hash(myId);
148  weightMap[myHashId] = cellWeight;
149  }
150 
151 
152 // Apply cellweight on the corresponding cell of the original cluster
153 
154  cellIter = theCluster->cell_begin();
155  for(;cellIter!=theCluster->cell_end();cellIter++) {
156  const CaloCell* pCell = *cellIter;
157  IdentifierHash myHashId = calo_id->calo_cell_hash(pCell->ID());
158  double weight = weightMap[myHashId];
159  theCluster->reweightCell(cellIter,weight);
160  }
161 
162 // Update kinematics of new cluster
163  CaloClusterKineHelper::calculateKine(theCluster,true,false);
164 
165 
166  //Manually insert weight moments to the original cluster, in the OOC case this is a multiplicative weight from LCOut and LCOutPi0
167  double newWeightMoment = theCluster->e()/oldEnergy;
168  if(m_calibTools[0].typeAndName() == "CaloLCWeightTool/LCWeight") theCluster->insertMoment(xAOD::CaloCluster::HAD_WEIGHT,newWeightMoment);
169  if(m_calibTools[0].typeAndName() == "CaloLCDeadMaterialTool/LCDeadMaterial") theCluster->insertMoment(xAOD::CaloCluster::DM_WEIGHT, newWeightMoment);
170  if(m_calibTools[0].typeAndName() == "CaloLCOutOfClusterTool/LCOut") theCluster->insertMoment(xAOD::CaloCluster::OOC_WEIGHT,newWeightMoment);
171  if(m_calibTools[0].typeAndName() == "CaloLCOutOfClusterTool/LCOutPi0")
172  {
173  double ooc_weight;
174  theCluster->retrieveMoment(xAOD::CaloCluster::OOC_WEIGHT,ooc_weight);
175  newWeightMoment *= ooc_weight;
176  theCluster->insertMoment(xAOD::CaloCluster::OOC_WEIGHT,newWeightMoment);
177  }
178  }
179 // else, what as was always done
180  else{
181 
182  for (const ToolHandle<IClusterCellWeightTool>& tool : m_calibTools) {
183  if (tool->weight(theCluster,ctx).isFailure())
184  msg(MSG::ERROR) << " failed to weight cluster " << endmsg;
185  }
186 
187  }
188  //report <<MSG::DEBUG<<"new cluster energy="<<theCluster->e()<<endmsg;
189  }//end of "has correct reco status" if statement
190 
191  // PL add calibration method bits to reco status
193 
194  return StatusCode::SUCCESS;
195 }

◆ execute() [3/7]

StatusCode CaloClusterProcessor::execute

Apply corrections to cluster.

Definition at line 73 of file CaloClusterProcessor.cxx.

59 {
60  xAOD::CaloClusterContainer::iterator beg = collection->begin();
61  xAOD::CaloClusterContainer::iterator end = collection->end();
62  for (; beg != end; ++beg) {
63  CHECK( execute (ctx, *beg) );
64  }
65  return StatusCode::SUCCESS;
66 }

◆ execute() [4/7]

StatusCode CaloClusterProcessor::execute ( const EventContext &  ctx,
xAOD::CaloClusterContainer collection 
) const
virtualinherited

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters.

This will iterate over all the clusters in collection and call execute on each one individually.

Parameters
collectionThe container of clusters.
ctxThe event context.

This will iterate over all the clusters in collection and call execute on each one individually.

Implements CaloClusterCollectionProcessor.

Reimplemented in CaloClusterRemoveBad.

Definition at line 57 of file CaloClusterProcessor.cxx.

59 {
62  for (; beg != end; ++beg) {
63  CHECK( execute (ctx, *beg) );
64  }
65  return StatusCode::SUCCESS;
66 }

◆ execute() [5/7]

StatusCode CaloClusterProcessor::execute
final

Apply corrections to cluster.

Definition at line 63 of file CaloClusterProcessor.cxx.

44 {
45  return execute (Gaudi::Hive::currentContext(), cluster);
46 }

◆ execute() [6/7]

StatusCode CaloClusterProcessor::execute ( xAOD::CaloCluster cluster)
finalvirtualinherited

Execute on a single cluster.

Parameters
clusterThe cluster to process. (deprecated)

Definition at line 43 of file CaloClusterProcessor.cxx.

44 {
45  return execute (Gaudi::Hive::currentContext(), cluster);
46 }

◆ execute() [7/7]

virtual StatusCode CaloClusterCollectionProcessor::execute ( xAOD::CaloClusterContainer collection)
inlinefinalvirtualinherited

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters. (deprecated)

Definition at line 49 of file CaloClusterCollectionProcessor.h.

50  {
51  return execute (Gaudi::Hive::currentContext(), collection);
52  }

◆ 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

◆ initialize()

StatusCode CaloClusterLocalCalib::initialize ( )
overridevirtual

Tool initialization: load calibration tools specified by jobOptions.

Definition at line 35 of file CaloClusterLocalCalib.cxx.

35  {
36 
37  if (m_classificationTool.size()>1) {
38  msg(MSG::ERROR) << "More than one classification tool specified!" << endmsg;
39  return StatusCode::FAILURE;
40  }
41  //Retrieve classification tool (if necessary)
42  if (!m_classificationTool.empty()) {
43  ATH_CHECK(m_classificationTool.retrieve());
44  msg(MSG::INFO) << "Found classification tool " << m_classificationTool[0] << endmsg;
45  }
46 
47  //Retrieve calibration tools
48  ATH_CHECK(m_calibTools.retrieve());
49  msg(MSG::INFO) <<"Loaded "<< m_calibTools.size() <<" hadronic calibration tools"<<endmsg;
50 
51  // check that at least one reco status is defined
52  if ( m_recoStatus.empty() ) {
53  msg(MSG::ERROR) << "Please specify at least one valid reco status with ClusterRecoStatus = [...] for this calib tool " << endmsg;
54  return StatusCode::FAILURE;
55  }
56  return StatusCode::SUCCESS;
57 }

◆ 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()

static const InterfaceID& CaloClusterProcessor::interfaceID ( )
inlinestaticinherited

Standard Gaudi interface ID method.

Definition at line 80 of file CaloClusterProcessor.h.

80 {return IID_CaloClusterProcessor;}

◆ 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  }

◆ 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_absOpt

bool CaloClusterLocalCalib::m_absOpt
private

if set to true, negative clusters are weighted as well

Definition at line 72 of file CaloClusterLocalCalib.h.

◆ m_calibTools

ToolHandleArray<IClusterCellWeightTool> CaloClusterLocalCalib::m_calibTools
private

property: Array of IClusterCellWeightTool

Definition at line 64 of file CaloClusterLocalCalib.h.

◆ m_classificationTool

ToolHandleArray<IClusterClassificationTool> CaloClusterLocalCalib::m_classificationTool
private

property: Classification tools

Definition at line 56 of file CaloClusterLocalCalib.h.

◆ 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_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_recoStatus

std::vector<int> CaloClusterLocalCalib::m_recoStatus
private

property: vector of valid Reco Statuses for the clusters in order to be calibrated

Definition at line 69 of file CaloClusterLocalCalib.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.


The documentation for this class was generated from the following files:
CaloClusterStoreHelper::makeCluster
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
Definition: CaloClusterStoreHelper.cxx:13
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloClusterLocalCalib::m_classificationTool
ToolHandleArray< IClusterClassificationTool > m_classificationTool
property: Classification tools
Definition: CaloClusterLocalCalib.h:56
CaloClusterLocalCalib::m_absOpt
bool m_absOpt
if set to true, negative clusters are weighted as well
Definition: CaloClusterLocalCalib.h:72
xAOD::CaloCluster_v1::OOC_WEIGHT
@ OOC_WEIGHT
Out-of-cluster weight (E_ooc/E_w)
Definition: CaloCluster_v1.h:175
xAOD::CaloCluster_v1::cell_begin
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Definition: CaloCluster_v1.h:812
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CaloRecoStatus::CALIBRATEDLHC
@ CALIBRATEDLHC
Definition: CaloRecoStatus.h:43
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
CaloClusterLocalCalib::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *theCluster) const override
Execute on a single cluster.
Definition: CaloClusterLocalCalib.cxx:59
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
CaloRecoStatus::StatusIndicator
StatusIndicator
reconstruction status word
Definition: CaloRecoStatus.h:37
xAOD::CaloCluster_v1::CaloSample
CaloSampling::CaloSample CaloSample
Definition: CaloCluster_v1.h:66
xAOD::CaloCluster_v1::EM_PROBABILITY
@ EM_PROBABILITY
Classification probability to be em-like.
Definition: CaloCluster_v1.h:173
CaloRecoStatus::setStatus
virtual void setStatus(const StatusIndicator &statusIndicator)
Set status.
Definition: CaloRecoStatus.h:107
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloClusterCollectionProcessor::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *collection) const =0
Execute on an entire collection of clusters.
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
xAOD::CaloCluster_v1::insertMoment
void insertMoment(MomentType type, double value)
Definition: CaloCluster_v1.cxx:754
xAOD::CaloCluster_v1::CENTER_LAMBDA
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
Definition: CaloCluster_v1.h:136
CaloCell::e
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition: CaloCell.h:317
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::CaloCluster_v1::setEnergy
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
Definition: CaloCluster_v1.cxx:526
CaloCell::provenance
uint16_t provenance() const
get provenance (data member)
Definition: CaloCell.h:338
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:352
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CaloClusterLocalCalib::m_calibTools
ToolHandleArray< IClusterCellWeightTool > m_calibTools
property: Array of IClusterCellWeightTool
Definition: CaloClusterLocalCalib.h:64
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
xAOD::CaloCluster_v1::DM_WEIGHT
@ DM_WEIGHT
Dead-material weight (E_dm/E_ooc)
Definition: CaloCluster_v1.h:176
AthCommonDataStore
Definition: AthCommonDataStore.h:52
xAOD::CaloCluster_v1::setRawE
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
Definition: CaloCluster_v1.cxx:284
xAOD::CaloCluster_v1::HAD_WEIGHT
@ HAD_WEIGHT
Hadronic weight (E_w/E_em)
Definition: CaloCluster_v1.h:174
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloClusterLocalCalib::m_recoStatus
std::vector< int > m_recoStatus
property: vector of valid Reco Statuses for the clusters in order to be calibrated
Definition: CaloClusterLocalCalib.h:69
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
xAOD::CaloCluster_v1::ISOLATION
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
Definition: CaloCluster_v1.h:146
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::CaloCluster_v1::FIRST_ENG_DENS
@ FIRST_ENG_DENS
First Moment in E/V.
Definition: CaloCluster_v1.h:143
CaloCell::quality
uint16_t quality() const
get quality (data member)
Definition: CaloCell.h:332
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
CaloRecoStatus::checkStatus
virtual bool checkStatus(const StatusIndicator &statusIndicator) const
Check status.
Definition: CaloRecoStatus.h:117
CaloClusterProcessor::CaloClusterProcessor
CaloClusterProcessor(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: CaloClusterProcessor.cxx:28
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
CaloCell::gain
CaloGain::CaloGain gain() const
get gain (data member )
Definition: CaloCell.h:345
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::CaloCluster_v1::addCell
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
Definition: CaloCluster_v1.h:771
xAOD::CaloCluster_v1::cell_end
const_cell_iterator cell_end() const
Definition: CaloCluster_v1.h:813
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
CaloClusterKineHelper::calculateKine
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
Definition: CaloClusterKineHelper.cxx:223
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
IdentifierHash
Definition: IdentifierHash.h:38
xAOD::CaloCluster_v1::hasSampling
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
Definition: CaloCluster_v1.h:890
CaloClusterProcessor::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const =0
Execute on a single cluster.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
CaloRecoStatus
reconstruction status indicator
Definition: CaloRecoStatus.h:12
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528