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

Top algorithm to generate Weight histograms for Local Hadron Calibration. More...

#include <GetLCWeights.h>

Inheritance diagram for GetLCWeights:
Collaboration diagram for GetLCWeights:

Public Member Functions

 GetLCWeights (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~GetLCWeights ()
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. 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 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
 

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

void mapinsert (const std::vector< Gaudi::Histo1DDef > &dims)
 
void mapparse ()
 
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

std::vector< std::vector< Gaudi::Histo1DDef > > m_dimensions
 definition of all dimensions used for each sampling More...
 
std::map< std::string, Gaudi::Histo1DDef > m_dimensionsmap
 property to set all dimensions introduced above More...
 
std::vector< std::vector< int > > m_isampmap
 Vector of indices in m_dimensions for each sampling. More...
 
std::vector< std::vector< TProfile2D * > > m_weight
 Vector of vector of actual histograms. More...
 
std::string m_outputFileName
 Name of the output file to save histograms in. More...
 
std::unique_ptr< TFile > m_outputFile
 Output file to save histograms in. More...
 
SG::ReadHandleKey< xAOD::CaloClusterContainerm_clusterCollName
 Name of the CaloClusterContainer to use. More...
 
SG::ReadHandleKeyArray< CaloCalibrationHitContainerm_CalibrationHitContainerNames
 vector of calibration hit container names to use. More...
 
bool m_useInversionMethod
 flag to switch on/off the use of the inversion method More...
 
std::string m_NormalizationType
 string to choose different normalization types More...
 
int m_NormalizationTypeNumber
 
std::string m_ClassificationType
 string to choose different classification types More...
 
int m_ClassificationTypeNumber
 
DataObjIDColl m_extendedExtraObjects
 
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

Top algorithm to generate Weight histograms for Local Hadron Calibration.

Version
$Id: GetLCWeights.h,v 1.2 2008-12-08 16:57:41 menke Exp $
Author
Sven Menke menke.nosp@m.@mpp.nosp@m.mu.mp.nosp@m.g.de
Date
3-October-2008 This class is an Algorithm to generate the 2D histograms from single pion simulations to cell-weight the hadronic classified clusters.

Definition at line 41 of file GetLCWeights.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GetLCWeights()

GetLCWeights::GetLCWeights ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 45 of file GetLCWeights.cxx.

47  : AthAlgorithm(name, pSvcLocator),
48  m_outputFile(nullptr),
49  m_clusterCollName("CaloTopoClusters"),
51  m_NormalizationType("Lin"),
53  m_ClassificationType("None"),
55 {
56 
57  std::vector<Gaudi::Histo1DDef> dims(7);
58  dims[1] = Gaudi::Histo1DDef("side",-1.5,1.5,1);
59  dims[2] = Gaudi::Histo1DDef("|eta|",0.,1.6,16);
60  dims[3] = Gaudi::Histo1DDef("phi",-M_PI,M_PI,1);
61  dims[4] = Gaudi::Histo1DDef("log10(E_clus (MeV))",log10(200),log10(1e6),14);
62  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.6,1.1,14);
63  dims[6] = Gaudi::Histo1DDef("weight",-2,3,1);
64 
65  dims[0] = Gaudi::Histo1DDef("EMB1",0.5,1.5,1);
66  mapinsert(dims);
67  dims[0] = Gaudi::Histo1DDef("EMB2",1.5,2.5,1);
68  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.8,0.5,14);
69  mapinsert(dims);
70  dims[0] = Gaudi::Histo1DDef("EMB3",2.5,3.5,1);
71  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.9,0.6,14);
72  mapinsert(dims);
73  dims[0] = Gaudi::Histo1DDef("EME1",4.5,5.5,1);
74  dims[2] = Gaudi::Histo1DDef("|eta|",1.2,3.2,20);
75  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.5,1.7,14);
76  mapinsert(dims);
77  dims[0] = Gaudi::Histo1DDef("EME2",5.5,6.5,1);
78  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.8,1.2,14);
79  mapinsert(dims);
80  dims[0] = Gaudi::Histo1DDef("EME3",6.5,7.5,1);
81  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.5,1.0,14);
82  mapinsert(dims);
83  dims[0] = Gaudi::Histo1DDef("HEC0",7.5,8.5,1);
84  dims[2] = Gaudi::Histo1DDef("|eta|",1.4,3.4,20);
85  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.8,0.6,14);
86  mapinsert(dims);
87  dims[0] = Gaudi::Histo1DDef("HEC1",8.5,9.5,1);
88  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.9,-0.2,14);
89  mapinsert(dims);
90  dims[0] = Gaudi::Histo1DDef("HEC2",9.5,10.5,1);
91  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.8,-0.2,14);
92  mapinsert(dims);
93  dims[0] = Gaudi::Histo1DDef("HEC3",10.5,11.5,1);
94  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-4.7,-0.2,14);
95  mapinsert(dims);
96  dims[0] = Gaudi::Histo1DDef("TileBar0",11.5,12.5,1);
97  dims[2] = Gaudi::Histo1DDef("|eta|",0.,1.2,12);
98  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-6,-1,14);
99  mapinsert(dims);
100  dims[0] = Gaudi::Histo1DDef("TileBar1",12.5,13.5,1);
101  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-6.7,-1.2,14);
102  mapinsert(dims);
103  dims[0] = Gaudi::Histo1DDef("TileBar2",13.5,14.5,1);
104  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-7,-1.9,14);
105  mapinsert(dims);
106  dims[0] = Gaudi::Histo1DDef("TileGap1",14.5,15.5,1);
107  dims[2] = Gaudi::Histo1DDef("|eta|",0.8,1.8,10);
108  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-6,-1,14);
109  mapinsert(dims);
110  dims[0] = Gaudi::Histo1DDef("TileGap2",15.5,16.5,1);
111  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-6.5,-1.5,14);
112  mapinsert(dims);
113  dims[0] = Gaudi::Histo1DDef("TileExt0",17.5,18.5,1);
114  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-6.5,-1,14);
115  mapinsert(dims);
116  dims[0] = Gaudi::Histo1DDef("TileExt1",18.5,19.5,1);
117  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-6.6,-1.5,14);
118  mapinsert(dims);
119  dims[0] = Gaudi::Histo1DDef("TileExt2",19.5,20.5,1);
120  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-7.2,-2.4,14);
121  mapinsert(dims);
122  dims[0] = Gaudi::Histo1DDef("FCal1",20.5,21.5,1);
123  dims[2] = Gaudi::Histo1DDef("|eta|",2.8,5.0,22);
124  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-3.5,2,14);
125  mapinsert(dims);
126  dims[0] = Gaudi::Histo1DDef("FCal2",21.5,22.5,1);
127  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-3.5,1.5,14);
128  mapinsert(dims);
129  dims[0] = Gaudi::Histo1DDef("FCal3",22.5,23.5,1);
130  dims[5] = Gaudi::Histo1DDef("log10(rho_cell (MeV/mm^3))",-3.8,1,14);
131  mapinsert(dims);
132 
133  // Dimensions to use for all samplings
134  declareProperty("SamplingDimensions",m_dimensionsmap);
135 
136  // Name of output file to save histograms in
137  declareProperty("OutputFileName",m_outputFileName);
138 
139  // Name of ClusterContainer to use
140  declareProperty("ClusterCollectionName",m_clusterCollName);
141 
142  // Names of CalibrationHitContainers to use
143  declareProperty("CalibrationHitContainerNames",m_CalibrationHitContainerNames);
144  // Use Inversion Method
145  declareProperty("UseInversionMethod",m_useInversionMethod);
146  // Normalization type "Const", "Lin", "Log", "NClus"
147  declareProperty("NormalizationType",m_NormalizationType);
148  // Classification type "None" for single pion MC or
149  // "ParticleID_EM" for ParticleID based em-type clusters
150  // "ParticleID_HAD" for ParticleID based had-type clusters
151  declareProperty("ClassificationType", m_ClassificationType);
152 }

◆ ~GetLCWeights()

GetLCWeights::~GetLCWeights ( )
virtual

Definition at line 156 of file GetLCWeights.cxx.

157 { }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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()

StatusCode GetLCWeights::execute ( )
virtual

Definition at line 355 of file GetLCWeights.cxx.

356 {
357  const EventContext& ctx = getContext();
359 
360  std::vector<const CaloCalibrationHitContainer *> v_cchc;
363  v_cchc.push_back(cchc.cptr());
364  }
365 
366  std::vector<ClusWeight *> cellVector[CaloCell_ID::NSUBCALO];
367 
368  const CaloCell_ID* calo_id = nullptr;
369  ATH_CHECK(detStore()->retrieve(calo_id,"CaloCell_ID"));
370 
371  for(int ic=0;ic<CaloCell_ID::NSUBCALO; ic++) {
372  unsigned int maxHashSize(0);
373  IdentifierHash myHashMin,myHashMax;
374  calo_id->calo_cell_hash_range (ic,myHashMin,myHashMax);
375  maxHashSize = myHashMax-myHashMin;
376  cellVector[ic].resize(maxHashSize,nullptr);
377  }
378 
379  // loop over all cell members of all clusters and fill cell vector
380  // for used cells
381 
382  // total calib hit energy of all clusters
383  double eCalibTot(0.);
384 
385  unsigned int iClus = 0;
386  double nClusECalibGt0 = 0.0;
387  for (const xAOD::CaloCluster* theCluster : *cc) {
388  double eC=999;
389  if (!theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_TOT,eC)) {
390  ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_TOT");
391  return StatusCode::FAILURE;
392  }
394  double emFrac=-999;
395  if (!theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_FRAC_EM,emFrac)){
396  ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_FAC_EM");
397  return StatusCode::FAILURE;
398  }
400  eC = 0;
402  eC = 0;
403  }
404  eCalibTot += eC;
405  if ( eC > 0 ) {
406  nClusECalibGt0++;
407  }
408  xAOD::CaloCluster::const_cell_iterator cellIter = theCluster->cell_begin();
409  xAOD::CaloCluster::const_cell_iterator cellIterEnd = theCluster->cell_end();
410  for(; cellIter != cellIterEnd; cellIter++ ){
411  const CaloCell* pCell = (*cellIter);
412  Identifier myId = pCell->ID();
413  IdentifierHash myHashId;
414  int otherSubDet(0);
415  myHashId = calo_id->subcalo_cell_hash(myId,otherSubDet);
416  ClusWeight * myClus = new ClusWeight();
417  myClus->iClus = iClus;
418  myClus->weight = cellIter.weight();
419  myClus->next = nullptr;
420  myClus->eCalibTot = 0;
421  ClusWeight * theList = cellVector[otherSubDet][(unsigned int)myHashId];
422  if ( theList ) {
423  while ( theList->next )
424  theList = theList->next;
425  theList->next = myClus;
426  }
427  else {
428  cellVector[otherSubDet][(unsigned int)myHashId] = myClus;
429  }
430  }
431  }
432 
433  // calculate total calib energy of each cell in each cluster
434 
435  for (const CaloCalibrationHitContainer* cchc : v_cchc) {
436  for (const CaloCalibrationHit* hit : *cchc) {
437  Identifier myId = hit->cellID();
438  int otherSubDet;
439  IdentifierHash myHashId = calo_id->subcalo_cell_hash(myId,otherSubDet);
440  if ( myHashId != CaloCell_ID::NOT_VALID ) {
441  ClusWeight * theList = cellVector[otherSubDet][(unsigned int)myHashId];
442  while ( theList ) {
443  theList->eCalibTot += hit->energyTotal();
444  theList = theList->next;
445  }
446  }
447  }
448  }
449 
450  // fill weight histos for all cells in all clusters
451  // since pions can be split in several clusters the weights are
452  // calculated by importance of the cluster for the current pion - i.e.
453  // the weights get a weight itself proportinal to the calib hit energy
454  // sum of the cluster over the total calib hit energy
455 
456  if ( eCalibTot > 0 ) {
457  const double inv_eCalibTot = 1. / eCalibTot;
458  const double inv_nClusECalibGt0 = 1. / nClusECalibGt0;
459  for (unsigned int j=0;j<cc->size();j++) {
460  const xAOD::CaloCluster * pClus = cc->at(j);
461  double eng = pClus->e();
462  double eCalib=-999;
463  if (!pClus->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_TOT,eCalib)) {
464  ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_TOT");
465  return StatusCode::FAILURE;
466  }
467  if ( eng > 0 && eCalib > 0 ) {
469  double emFrac=-999;
471  ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_FAC_EM");
472  return StatusCode::FAILURE;
473  }
475  continue;
477  continue;
478  }
480  xAOD::CaloCluster::const_cell_iterator cellIterEnd = pClus->cell_end();
481  for(; cellIter != cellIterEnd; cellIter++ ){
482  const CaloCell* pCell = (*cellIter);
483  const Identifier myId = pCell->ID();
484  const CaloDetDescrElement* myCDDE=pCell->caloDDE();
485  const int caloSample = myCDDE->getSampling();//m_calo_id->calo_sample(myId);
486  if ( !m_isampmap[caloSample].empty() &&
487  !m_weight[caloSample].empty() ) {
488  int isideCell = 0;
489  int ietaCell = 0;
490  int iphiCell = 0;
491  int nside = 1;
492  int neta = 1;
493  int nphi = 1;
494  if ( m_isampmap[caloSample][1] >= 0 ) {
495  const Gaudi::Histo1DDef & hd = m_dimensions[m_isampmap[caloSample][0]][m_isampmap[caloSample][1]];
496  nside = hd.bins();
497  isideCell = (int)(nside*(((pCell->eta()<0?-1.0:1.0) - hd.lowEdge())
498  /(hd.highEdge()-hd.lowEdge())));
499  if ( isideCell < 0 || isideCell > nside-1 ) {
500  ATH_MSG_WARNING( " Side index out of bounds " <<
501  isideCell << " not in [0," << nside-1 << "] for "
502  << "Sampl=" << caloSample );
503  isideCell = -1;
504  }
505  }
506  if ( m_isampmap[caloSample][2] >= 0 ) {
507  const Gaudi::Histo1DDef & hd = m_dimensions[m_isampmap[caloSample][0]][m_isampmap[caloSample][2]];
508  neta = hd.bins();
509  ietaCell = (int)(neta*((fabs(pCell->eta()) - hd.lowEdge())
510  /(hd.highEdge()-hd.lowEdge())));
511  if ( ietaCell < 0 || ietaCell > neta-1 ) {
512  ATH_MSG_WARNING( " Eta index out of bounds " <<
513  ietaCell << " not in [0," << neta-1 << "] for "
514  << "Sampl=" << caloSample );
515  ietaCell = -1;
516  }
517  }
518  if ( m_isampmap[caloSample][3] >= 0 ) {
519  const Gaudi::Histo1DDef & hd = m_dimensions[m_isampmap[caloSample][0]][m_isampmap[caloSample][3]];
520  nphi = hd.bins();
521  iphiCell = (int)(nphi*((pCell->phi() - hd.lowEdge())
522  /(hd.highEdge()-hd.lowEdge())));
523  if ( iphiCell < 0 || iphiCell > nphi-1 ) {
524  ATH_MSG_WARNING( " Phi index out of bounds " <<
525  iphiCell << " not in [0," << nphi-1 << "] for "
526  << "Sampl=" << caloSample );
527  iphiCell = -1;
528  }
529  }
530  if ( isideCell >=0 && ietaCell >=0 && iphiCell >= 0 ) {
531  if ( myCDDE->volume() > 0 ) {
532  IdentifierHash myHashId;
533  int otherSubDet(0);
534  myHashId = calo_id->subcalo_cell_hash(myId,otherSubDet);
535  unsigned int iW = iphiCell*neta*nside+ietaCell*nside+isideCell;
536  if ( iW >= m_weight[caloSample].size() ) {
537  ATH_MSG_WARNING( " Index out of bounds " <<
538  iW << " > " << m_weight[caloSample].size()-1 << " for "
539  << "Sampl=" << caloSample
540  << ", iphi=" << iphiCell
541  << ", ieta=" << ietaCell
542  << ", iside=" << isideCell );
543  }
544  else {
545  ClusWeight * theList = cellVector[otherSubDet][(unsigned int)myHashId];
546  while ( theList && theList->iClus != j )
547  theList = theList->next;
548 
549  if (m_weight[caloSample][iW] && theList && eCalibTot > 0) {
550  double norm = 0.0;
552  norm = eCalib * inv_eCalibTot;
553  }
555  if ( eCalib > 0 ) {
556  // cluster has to have at least 1% of the calib hit E
557  norm = log10(eCalib * inv_eCalibTot)+2.0;
558  }
559  }
561  if ( eCalib > 0 ) {
562  norm = inv_nClusECalibGt0;
563  }
564  }
565  else {
566  norm = 1.0;
567  }
568  if ( norm > 0 ) {
569  if ( !m_useInversionMethod && pCell->e()>0 ) {
570  m_weight[caloSample][iW]->Fill(log10(eng),
571  log10(pCell->e()/myCDDE->volume()),
572  theList->eCalibTot/pCell->e(),norm);
573 
574  }
575  else if (m_useInversionMethod && theList->eCalibTot>0 ) {
576  m_weight[caloSample][iW]->Fill(log10(eng),
577  log10(theList->eCalibTot/myCDDE->volume()),
578  pCell->e()/theList->eCalibTot,
579  norm);
580  }
581  }
582  }
583  }
584  }
585  }
586  }
587  }
588  }
589  }
590  }
591 
592  for(unsigned int ic=0;ic<CaloCell_ID::NSUBCALO; ic++) {
593  for (unsigned int ii = 0;ii<cellVector[ic].size();ii++ ) {
594  ClusWeight * theList = cellVector[ic][ii];
595  ClusWeight * prev = nullptr;
596  while ( theList) {
597  while ( theList->next ) {
598  prev = theList;
599  theList = theList->next;
600  }
601  delete theList;
602  if ( prev )
603  prev->next = nullptr;
604  else
605  cellVector[ic][ii] = nullptr;
606  theList = cellVector[ic][ii];
607  prev = nullptr;
608  }
609  }
610  }
611 
612  return StatusCode::SUCCESS;
613 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode GetLCWeights::finalize ( )
virtual

Definition at line 338 of file GetLCWeights.cxx.

339 {
340  ATH_MSG_INFO( "Writing out histograms" );
341  m_outputFile->cd();
342  for(unsigned int i=0;i<m_weight.size();i++) {
343  for(unsigned int j=0;j<m_weight[i].size();j++) {
344  if ( m_weight[i][j] )
345  m_weight[i][j]->Write();
346  }
347  }
348  m_outputFile->Close();
349 
350  return StatusCode::SUCCESS;
351 }

◆ initialize()

StatusCode GetLCWeights::initialize ( )
virtual

Definition at line 161 of file GetLCWeights.cxx.

162 {
163 
164  m_outputFile = std::make_unique<TFile>(m_outputFileName.c_str(),"RECREATE");
165  m_outputFile->cd();
166 
169  mapparse();
170 
171 
172  if ( m_NormalizationType == "Lin" ) {
173  ATH_MSG_INFO( "Using weighting proportional to E_calib" );
175  }
176  else if ( m_NormalizationType == "Log" ) {
177  ATH_MSG_INFO( "Using weighting proportional to log(E_calib)" );
179  }
180  else if ( m_NormalizationType == "NClus" ) {
181  ATH_MSG_INFO( "Using weighting proportional to 1/N_Clus_E_calib>0" );
183  }
184  else {
185  ATH_MSG_INFO( "Using constant weighting" );
187  }
188 
189  if ( m_ClassificationType == "None" ) {
190  ATH_MSG_INFO( "Expecting single particle input" );
192  }
193  else if ( m_ClassificationType == "ParticleID_EM" ) {
194  ATH_MSG_INFO( "Expecting ParticleID simulation as input -- use EM type clusters only" );
196  }
197  else if ( m_ClassificationType == "ParticleID_HAD" ) {
198  ATH_MSG_INFO( "Expecting ParticleID simulation as input -- use HAD type clusters only" );
200  }
201  else {
202  ATH_MSG_WARNING( " unknown classification type " << m_ClassificationType << " given! Using None instead" );
204  }
205 
206  for(unsigned int isamp=0;isamp<m_dimensions.size();isamp++) {
207  int theSampling(CaloSampling::Unknown);
208  for (unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
210  theSampling = jsamp;
211  break;
212  }
213  }
214  if ( theSampling == CaloSampling::Unknown ) {
215  ATH_MSG_ERROR( "Calorimeter sampling "
216  << m_dimensions[isamp][0].title()
217  << " is not a valid Calorimeter sampling name and will be ignored! "
218  << "Valid names are: ";
219  for (unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
221  if ( jsamp < CaloSampling::Unknown-1)
222  msg() << ", ";
223  else
224  msg() << ".";
225  }
226  msg() );
227  }
228  else {
229  m_isampmap[theSampling].resize(4,-1);
230  m_isampmap[theSampling][0] = isamp;
231  int iside(-1);
232  int ieta(-1);
233  int iphi(-1);
234  int ilogE(-1);
235  int ilogrho(-1);
236  int iweight(-1);
237 
238  for(unsigned int idim=1;idim<m_dimensions[isamp].size();idim++) {
239  if ( m_dimensions[isamp][idim].title() == "side" ) {
240  iside = idim;
241  m_isampmap[theSampling][1] = iside;
242  }
243  else if ( m_dimensions[isamp][idim].title() == "|eta|" ) {
244  ieta = idim;
245  m_isampmap[theSampling][2] = ieta;
246  }
247  else if ( m_dimensions[isamp][idim].title() == "phi" ) {
248  iphi = idim;
249  m_isampmap[theSampling][3] = iphi;
250  }
251  else if ( m_dimensions[isamp][idim].title() == "log10(E_clus (MeV))" )
252  ilogE = idim;
253  else if ( m_dimensions[isamp][idim].title() == "log10(rho_cell (MeV/mm^3))" )
254  ilogrho = idim;
255  else if ( m_dimensions[isamp][idim].title() == "weight" )
256  iweight = idim;
257  }
258  if ( ilogE < 0 || ilogrho < 0 || iweight < 0 ) {
259  ATH_MSG_FATAL( " Mandatory dimension log10E, log10rho or weight missing ..." );
260  return StatusCode::FAILURE;
261  }
262  int nside = (iside>=0?m_dimensions[isamp][iside].bins():1);
263  int neta = (ieta>=0?m_dimensions[isamp][ieta].bins():1);
264  int nphi = (iphi>=0?m_dimensions[isamp][iphi].bins():1);
265  m_weight[theSampling].resize(nside*neta*nphi,nullptr);
266  for ( int jside=0;jside<nside;jside++) {
267  for ( int jeta=0;jeta<neta;jeta++) {
268  for ( int jphi=0;jphi<nphi;jphi++) {
269  TString wname("");
270  if ( m_useInversionMethod )
271  wname += "inv_weight";
272  else
273  wname += "weight";
274  wname += "_isamp_";
275  wname += theSampling;
276  wname += "_iside_";
277  wname += jside;
278  wname += "_[";
279  wname += (iside>=0?m_dimensions[isamp][iside].lowEdge():-1);
280  wname += ",";
281  wname += (iside>=0?m_dimensions[isamp][iside].highEdge():-1);
282  wname += ",";
283  wname += nside;
284  wname += "]";
285  wname += "_ieta_";
286  wname += jeta;
287  wname += "_[";
288  wname += (ieta>=0?m_dimensions[isamp][ieta].lowEdge():-1);
289  wname += ",";
290  wname += (ieta>=0?m_dimensions[isamp][ieta].highEdge():-1);
291  wname += ",";
292  wname += neta;
293  wname += "]";
294  wname += "_iphi_";
295  wname += jphi;
296  wname += "_[";
297  wname += (iphi>=0?m_dimensions[isamp][iphi].lowEdge():-1);
298  wname += ",";
299  wname += (iphi>=0?m_dimensions[isamp][iphi].highEdge():-1);
300  wname += ",";
301  wname += nphi;
302  wname += "]";
303  int iW = jphi*neta*nside+jeta*nside+jside;
304  m_weight[theSampling][iW]=
305  new TProfile2D(wname,wname,
306  m_dimensions[isamp][ilogE].bins(),
307  m_dimensions[isamp][ilogE].lowEdge(),
308  m_dimensions[isamp][ilogE].highEdge(),
309  m_dimensions[isamp][ilogrho].bins(),
310  m_dimensions[isamp][ilogrho].lowEdge(),
311  m_dimensions[isamp][ilogrho].highEdge(),
312  m_dimensions[isamp][iweight].lowEdge(),
313  m_dimensions[isamp][iweight].highEdge(),
314  "spread");
315  if ( m_useInversionMethod ) {
316  m_weight[theSampling][iW]->SetYTitle("log10(#rho_{cell}^{true} (MeV/mm^{3}))");
317  m_weight[theSampling][iW]->SetZTitle("E_{reco}/E_{tot}");
318  }
319  else {
320  m_weight[theSampling][iW]->SetYTitle("log10(#rho_{cell} (MeV/mm^{3}))");
321  m_weight[theSampling][iW]->SetZTitle("E_{tot}/E_{reco}");
322  }
323  m_weight[theSampling][iW]->SetXTitle("log10(E_{clus} (MeV))");
324  }
325  }
326  }
327  }
328  }
329 
332 
333  return StatusCode::SUCCESS;
334 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ mapinsert()

void GetLCWeights::mapinsert ( const std::vector< Gaudi::Histo1DDef > &  dims)
private

Definition at line 615 of file GetLCWeights.cxx.

615  {
616  for (unsigned int i=0;i<dims.size();i++) {
617  m_dimensionsmap[dims[0].title()+":"+dims[i].title()] = dims[i];
618  }
619 }

◆ mapparse()

void GetLCWeights::mapparse ( )
private

Definition at line 621 of file GetLCWeights.cxx.

621  {
622 
623  std::vector<int> theUsedSamplings(CaloSampling::Unknown,-1);
624 
625  int nsamp(-1);
626 
627  for (const std::pair<const std::string, Gaudi::Histo1DDef>& p : m_dimensionsmap) {
628  std::string_view dimname = std::string_view(p.first).substr(0,p.first.find(':'));
629  int theSampling(CaloSampling::Unknown);
630  for (unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
632  theSampling = jsamp;
633  break;
634  }
635  }
636  if ( theSampling == CaloSampling::Unknown ) {
637  msg(MSG::ERROR) << "Calorimeter sampling " << dimname
638  << " is not a valid Calorimeter sampling name and will be ignored! "
639  << "Valid names are: ";
640  for (unsigned int jsamp = 0;jsamp< CaloSampling::Unknown; jsamp++) {
642  if ( jsamp < CaloSampling::Unknown-1)
643  msg() << ", ";
644  else
645  msg() << ".";
646  }
647  msg() << endmsg;
648  }
649  else {
650  if ( theUsedSamplings[theSampling] == -1 ) {
651  nsamp++;
652  theUsedSamplings[theSampling] = nsamp;
653  m_dimensions.resize(nsamp+1);
654  m_dimensions[nsamp].resize(0);
655  }
656  m_dimensions[theUsedSamplings[theSampling]].push_back(p.second);
657  ATH_MSG_DEBUG(" New Dimension for " << dimname << ": "
658  << p.second.title() << ", [" << p.second.lowEdge()
659  << ", " << p.second.highEdge()
660  << ", " << p.second.bins()
661  << "]");
662  }
663  }
664 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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_CalibrationHitContainerNames

SG::ReadHandleKeyArray<CaloCalibrationHitContainer> GetLCWeights::m_CalibrationHitContainerNames
private

vector of calibration hit container names to use.

The containers specified in this property should hold calibration hits inside the calorimeter systems.

Definition at line 138 of file GetLCWeights.h.

◆ m_ClassificationType

std::string GetLCWeights::m_ClassificationType
private

string to choose different classification types

Available options are "None": the input MC is expected to be just a single pion MC with one sort of particles; "ParticleID_EM" Gena's ParticleID classification (EM type objects) for the use of QCD MC; "ParticleID_HAD" Gena's ParticleID classification (HAD type objects) for the use of QCD MC;

Definition at line 175 of file GetLCWeights.h.

◆ m_ClassificationTypeNumber

int GetLCWeights::m_ClassificationTypeNumber
private

Definition at line 176 of file GetLCWeights.h.

◆ m_clusterCollName

SG::ReadHandleKey<xAOD::CaloClusterContainer> GetLCWeights::m_clusterCollName
private

Name of the CaloClusterContainer to use.

Definition at line 131 of file GetLCWeights.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dimensions

std::vector<std::vector<Gaudi::Histo1DDef> > GetLCWeights::m_dimensions
private

definition of all dimensions used for each sampling

Since samplings can be present or not, the samplings itself are defined via the special first dimension which has to be exactly 1 bin with the title of the sampling and the bounds of the CaloSample enum.

The remaining dimensions are:

side: negative values for eta < 0 and positive for eta > 0; 1 bin from -1.5 to 1.5 for no side dependency

|eta|: the absolute value of eta; normally in ATLAS the bounds are within [0,5], most samplings need smaller ranges and even smaller ones for test beam setups.

phi: the phi range; 1 bin from -pi to pi for no phi dependency

log10(E_clus): the log10 of the cluster energy; typical range should be within the generated energy range of single pions with about 50% room to the maximum created energy - i.e. use log10(1 TeV) as max value if you generated up tp 2 TeV pions

log10(rho_cell): the cell energy density (either truth or reco); typical ranges are from -7 to 1

weight: the ratio E_true/E_rec (or E_rec/E_true for inversion method; the bounds define the level of truncation for the weights to suppress noise and bad sampling ratios. Typical bounds are 0.5 to 3,5, or 10 without inversion method, where 5 and 10 are used for HEC and Tile, respectively. With inversion mewthod the bounds are -2 to 3.

Definition at line 92 of file GetLCWeights.h.

◆ m_dimensionsmap

std::map<std::string,Gaudi::Histo1DDef> GetLCWeights::m_dimensionsmap
private

property to set all dimensions introduced above

Gaudi has only a map<string,Histo1DDef> to use as property. So the syntax for all dimensions introduced above is {'Sampling:Title': ('Title',Low,High,Bins), ... }.

Definition at line 100 of file GetLCWeights.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_isampmap

std::vector<std::vector<int> > GetLCWeights::m_isampmap
private

Vector of indices in m_dimensions for each sampling.

Internal list of indices in m_dimensions object.

Definition at line 106 of file GetLCWeights.h.

◆ m_NormalizationType

std::string GetLCWeights::m_NormalizationType
private

string to choose different normalization types

Available options are "Const": every cluster counts with weight 1; "Lin": Each cluster is weighted with E_calib_clus/E_calib_tot; "Log": Each cluster is weighted with log10(E_calib_clus/E_calib_tot)+2; "NClus": Each cluster is weighted with 1/TotalNumberOfClustersWithE_calib>0.

Definition at line 162 of file GetLCWeights.h.

◆ m_NormalizationTypeNumber

int GetLCWeights::m_NormalizationTypeNumber
private

Definition at line 164 of file GetLCWeights.h.

◆ m_outputFile

std::unique_ptr<TFile> GetLCWeights::m_outputFile
private

Output file to save histograms in.

Internal variable pointing to the output file.

Definition at line 126 of file GetLCWeights.h.

◆ m_outputFileName

std::string GetLCWeights::m_outputFileName
private

Name of the output file to save histograms in.

Use this property to set the name of the output file containing the Weights histograms.

Definition at line 120 of file GetLCWeights.h.

◆ m_useInversionMethod

bool GetLCWeights::m_useInversionMethod
private

flag to switch on/off the use of the inversion method

If true the inversion method is used - i.e. the weights are calculated as E_rec/E_true vs. E_true and not as E_true/E_rec vs. E_rec. If the inversion method is used the actual correction histogram has to be created in a final step after all histograms have been added by looping over the possible E_true values, calculating E_rec from the histogram and then filling E_true/E_rec vs. E_rec in the new weighting histogram.

Definition at line 150 of file GetLCWeights.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_weight

std::vector<std::vector<TProfile2D *> > GetLCWeights::m_weight
private

Vector of vector of actual histograms.

Internal lists of histograms for each possible sampling to fill and save.

Definition at line 113 of file GetLCWeights.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GetLCDefs::CONST
@ CONST
Definition: GetLCDefs.h:21
GetLCWeights::m_dimensions
std::vector< std::vector< Gaudi::Histo1DDef > > m_dimensions
definition of all dimensions used for each sampling
Definition: GetLCWeights.h:92
CaloCalibrationHitContainer
Definition: CaloCalibrationHitContainer.h:25
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
xAOD::CaloCluster_v1::cell_begin
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Definition: CaloCluster_v1.h:812
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CaloCell::phi
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Definition: CaloCell.h:359
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ClusWeight::weight
double weight
Definition: GetLCWeights.h:36
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
GetLCWeights::m_useInversionMethod
bool m_useInversionMethod
flag to switch on/off the use of the inversion method
Definition: GetLCWeights.h:150
ClusWeight::eCalibTot
double eCalibTot
Definition: GetLCWeights.h:37
GetLCWeights::mapinsert
void mapinsert(const std::vector< Gaudi::Histo1DDef > &dims)
Definition: GetLCWeights.cxx:615
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
CaloCell::e
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition: CaloCell.h:317
GetLCWeights::m_outputFileName
std::string m_outputFileName
Name of the output file to save histograms in.
Definition: GetLCWeights.h:120
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::ReadHandleKey< CaloCalibrationHitContainer >
ClusWeight::iClus
unsigned int iClus
Definition: GetLCWeights.h:35
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
GetLCWeights::m_NormalizationType
std::string m_NormalizationType
string to choose different normalization types
Definition: GetLCWeights.h:162
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::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
GetLCDefs::NONE
@ NONE
Definition: GetLCDefs.h:25
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
GetLCDefs::NCLUS
@ NCLUS
Definition: GetLCDefs.h:21
GetLCDefs::PARTICLEID_EM
@ PARTICLEID_EM
Definition: GetLCDefs.h:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
GetLCWeights::m_NormalizationTypeNumber
int m_NormalizationTypeNumber
Definition: GetLCWeights.h:164
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCell_Base_ID::calo_cell_hash_range
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
xAOD::CaloCluster_v1::ENG_CALIB_TOT
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
Definition: CaloCluster_v1.h:195
covarianceTool.title
title
Definition: covarianceTool.py:542
xAOD::CaloCluster_v1::ENG_CALIB_FRAC_EM
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
Definition: CaloCluster_v1.h:248
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_Base_ID::subcalo_cell_hash
IdentifierHash subcalo_cell_hash(const Identifier cellId, int &subCalo) const
create hash id from 'global' cell id
xAOD::CaloCluster_v1::retrieveMoment
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
Definition: CaloCluster_v1.cxx:738
plotting.yearwise_luminosity_vs_mu.bins
bins
Definition: yearwise_luminosity_vs_mu.py:30
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
GetLCWeights::m_outputFile
std::unique_ptr< TFile > m_outputFile
Output file to save histograms in.
Definition: GetLCWeights.h:126
GetLCWeights::m_CalibrationHitContainerNames
SG::ReadHandleKeyArray< CaloCalibrationHitContainer > m_CalibrationHitContainerNames
vector of calibration hit container names to use.
Definition: GetLCWeights.h:138
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
grepfile.ic
int ic
Definition: grepfile.py:33
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
CaloCalibrationHit
Class to store calorimeter calibration hit.
Definition: CaloCalibrationHit.h:23
GetLCWeights::m_ClassificationTypeNumber
int m_ClassificationTypeNumber
Definition: GetLCWeights.h:176
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
CaloDetDescrElement::volume
float volume() const
cell volume
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:381
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
GetLCWeights::mapparse
void mapparse()
Definition: GetLCWeights.cxx:621
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
GetLCDefs::PARTICLEID_HAD
@ PARTICLEID_HAD
Definition: GetLCDefs.h:25
GetLCWeights::m_weight
std::vector< std::vector< TProfile2D * > > m_weight
Vector of vector of actual histograms.
Definition: GetLCWeights.h:113
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
CaloSamplingHelper::getSamplingName
static const std::string & getSamplingName(const CaloSampling::CaloSample theSample)
Returns a string (name) for each CaloSampling.
Definition: CaloUtils/src/CaloSamplingHelper.cxx:44
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::CaloCluster_v1::cell_end
const_cell_iterator cell_end() const
Definition: CaloCluster_v1.h:813
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
GetLCDefs::LOG
@ LOG
Definition: GetLCDefs.h:21
ClusWeight
Definition: GetLCWeights.h:33
GetLCDefs::LIN
@ LIN
Definition: GetLCDefs.h:21
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
ClusWeight::next
ClusWeight * next
Definition: GetLCWeights.h:38
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
GetLCWeights::m_dimensionsmap
std::map< std::string, Gaudi::Histo1DDef > m_dimensionsmap
property to set all dimensions introduced above
Definition: GetLCWeights.h:100
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloCell_Base_ID::NOT_VALID
@ NOT_VALID
Definition: CaloCell_Base_ID.h:46
GetLCWeights::m_ClassificationType
std::string m_ClassificationType
string to choose different classification types
Definition: GetLCWeights.h:175
GetLCWeights::m_isampmap
std::vector< std::vector< int > > m_isampmap
Vector of indices in m_dimensions for each sampling.
Definition: GetLCWeights.h:106
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
GetLCWeights::m_clusterCollName
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterCollName
Name of the CaloClusterContainer to use.
Definition: GetLCWeights.h:131
CaloCell::eta
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition: CaloCell.h:366
fitman.k
k
Definition: fitman.py:528
python.handimod.cc
int cc
Definition: handimod.py:523
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14