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

#include <SuperCellVsCaloCellTestAlg.h>

Inheritance diagram for SuperCellVsCaloCellTestAlg:
Collaboration diagram for SuperCellVsCaloCellTestAlg:

Public Member Functions

 SuperCellVsCaloCellTestAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~SuperCellVsCaloCellTestAlg ()
 
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

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

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"SCCablingKey","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object"}
 
ToolHandle< ICaloSuperCellIDToolm_sc2ccMappingTool
 
const CaloCell_IDm_ccIdHelper
 
std::string m_scKey
 
std::string m_ccKey
 
std::string m_tscKey
 
std::string m_digitKey
 
std::string m_stream
 
std::vector< TProfile * > m_etReso
 
std::vector< TProfile * > m_etResoTruth
 
std::vector< TH1F * > m_Reso_et
 
std::vector< TH2F * > m_Reso_et_vs_eta
 
std::vector< TH2F * > m_Reso_et_vs_et
 
std::vector< TH2F * > m_Linear_SCet_vs_et
 
std::map< TString, std::vector< float > > m_graphsX
 
std::map< TString, std::vector< float > > m_graphsY
 
int m_eventNumber =0
 
int m_treeChannel =0
 
int m_treeSampling =0
 
float m_treeEta =0
 
float m_treeSCET =0
 
float m_treeTruthET =0
 
std::vector< short int > * m_treeDigits
 
TTree * m_tree
 
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

Definition at line 28 of file SuperCellVsCaloCellTestAlg.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

◆ SuperCellVsCaloCellTestAlg()

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

Definition at line 25 of file SuperCellVsCaloCellTestAlg.cxx.

25  :
26  AthAlgorithm( name, pSvcLocator ),
27  m_sc2ccMappingTool("CaloSuperCellIDTool"),
28  m_ccIdHelper(nullptr),
29  m_treeDigits(nullptr),
30  m_tree(nullptr)
31 {
32 
33  declareProperty("SuperCellContainer",m_scKey="SCell");
34  declareProperty("CaloCellContainer",m_ccKey="AllCalo");
35  declareProperty("TruthSuperCellContainer",m_tscKey="SCellTruth");
36  declareProperty("DigitContainer",m_digitKey="LArDigitSCL1","Only used for supicious supercells");
37 
38  declareProperty("OutputStream",m_stream="SUPERCELLTEST");
39 
40 }

◆ ~SuperCellVsCaloCellTestAlg()

SuperCellVsCaloCellTestAlg::~SuperCellVsCaloCellTestAlg ( )
virtualdefault

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 SuperCellVsCaloCellTestAlg::execute ( )
virtual

Definition at line 119 of file SuperCellVsCaloCellTestAlg.cxx.

119  {
120  //get the supercells, calocells
121  const CaloCellContainer* scells=nullptr;CHECK( evtStore()->retrieve(scells, m_scKey) );
122 
123  const CaloCellContainer* ccells=nullptr;if(!m_ccKey.empty()) CHECK( evtStore()->retrieve(ccells, m_ccKey) );
124 
125  const CaloCellContainer* tscells=nullptr;if(!m_tscKey.empty()) CHECK( evtStore()->retrieve(tscells,m_tscKey) );
126 
128  const LArOnOffIdMapping* cabling{*cablingHdl};
129  if(!cabling) {
130  ATH_MSG_ERROR("Do not have SC mapping object " << m_cablingKey.key() );
131  return StatusCode::FAILURE;
132  }
133 
134  //iterate over supercells, and build up a histogram of the resolution
135  for(const auto *scell : *scells) {
136  //bool passPeakFinder( (scell->provenance()&0x40) );
137  //if(!passPeakFinder) continue; //skip non maxima?
138 
139  int samplingEnum = m_ccIdHelper->calo_sample(scell->ID());
140 
141  double scellEt = scell->e()*scell->sinTh()*1e-3;
142 
143  if(ccells) {
144  std::vector<Identifier> ccellIds = m_sc2ccMappingTool->superCellToOfflineID( scell->ID() );
145  double cellEt(0.);
146  //use findCell function of CaloCellContainer, which takes an identifier hash
147  for(auto& ccellId : ccellIds) {
148  const CaloCell* ccell = ccells->findCell(m_ccIdHelper->calo_cell_hash(ccellId));
149  if(!ccell) { ATH_MSG_WARNING("Could not find cell"); continue; }
150  if(ccell->e()>0) cellEt += ccell->e()*ccell->sinTh();
151  }
152  if(cellEt>0) m_etReso[samplingEnum]->Fill(cellEt*1e-3,scellEt*1000./cellEt);
153  float resolution = 0.0;
154  if ( TMath::Abs(cellEt)>1 ) resolution = 100*(scellEt - cellEt*1e-3 ) / (cellEt*1e-3);
155  if ( TMath::Abs(cellEt)>150 ) {
156  m_Reso_et[samplingEnum]->Fill( resolution );
157  m_Reso_et_vs_et[samplingEnum]->Fill( cellEt*1e-3, resolution );
158  m_Reso_et_vs_eta[samplingEnum]->Fill( scell->eta(), resolution );
159  m_Linear_SCet_vs_et[samplingEnum]->Fill( cellEt*1e-3 , scellEt );
160  }
161  }
162 
163  if(tscells) {
164  const CaloCell* tscell = tscells->findCell(scell->caloDDE()->calo_hash());
165  double tscellEt = tscell->e()*tscell->sinTh()*1e-3;
166  if(tscellEt>0) m_etResoTruth[samplingEnum]->Fill(tscellEt,scellEt/tscellEt);
167 
168  //detect suspicious supercells .. where truth energy is greater than 1GeV and we measure less than 25% of it, or super cell ET is greater than 1GeV and truth ET < 25% of that
169  if( (tscellEt>1. && scellEt/tscellEt<0.25) || (scellEt>1. && tscellEt/scellEt<0.25) ) {
170  m_eventNumber = getContext().eventID().event_number();
171 
172  HWIdentifier hwid = cabling->createSignalChannelID(scell->ID());
174  m_treeSampling = samplingEnum;
175  m_treeEta = scell->caloDDE()->eta();
176  m_treeSCET = scellEt;
177  m_treeTruthET = tscellEt;
178  if(!m_digitKey.empty()) {
179  const LArDigitContainer* digits=nullptr;CHECK( evtStore()->retrieve(digits, m_digitKey) );
180  for(const auto *digit : *digits) { if(digit->hardwareID()==hwid) *m_treeDigits = digit->samples(); }
181  }
182  m_tree->Fill();
183  }
184 
185  }
186 
187 
188 
189 
190  }
191 
192 
193  return StatusCode::SUCCESS;
194 }

◆ 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 SuperCellVsCaloCellTestAlg::finalize ( )
virtual

Definition at line 90 of file SuperCellVsCaloCellTestAlg.cxx.

90  {
91 
93 
94  for(uint i=0;i<CaloSampling::getNumberOfSamplings();i++) { //don't bother writing empty hists
95  if(m_etReso[i]->GetEntries()) CHECK( histSvc->regHist(TString::Format("/%s/SuperCellValidation/%s",m_stream.c_str(),m_etReso[i]->GetName()).Data(),m_etReso[i]) );
96  if(m_Reso_et[i]->GetEntries()) CHECK( histSvc->regHist(TString::Format("/%s/SuperCellValidation/%s",m_stream.c_str(),m_Reso_et[i]->GetName()).Data(), m_Reso_et[i]) );
97  if(m_Reso_et_vs_eta[i]->GetEntries()) CHECK( histSvc->regHist(TString::Format("/%s/SuperCellValidation/%s",m_stream.c_str(),m_Reso_et_vs_eta[i]->GetName()).Data(), m_Reso_et_vs_eta[i]) );
98  if(m_Reso_et_vs_et[i]->GetEntries()) CHECK( histSvc->regHist(TString::Format("/%s/SuperCellValidation/%s",m_stream.c_str(),m_Reso_et_vs_et[i]->GetName()).Data(), m_Reso_et_vs_et[i]) );
99  if(m_Linear_SCet_vs_et[i]->GetEntries()) CHECK( histSvc->regHist(TString::Format("/%s/SuperCellValidation/%s",m_stream.c_str(),m_Linear_SCet_vs_et[i]->GetName()).Data(), m_Linear_SCet_vs_et[i]) );
100 
101 
102  if(!m_tscKey.empty()) {
103  if(m_etResoTruth[i]->GetEntries())CHECK( histSvc->regHist(TString::Format("/%s/%s",m_stream.c_str(),m_etResoTruth[i]->GetName()).Data(),m_etResoTruth[i]) );
104  }
105  }
106 
107  //also write any graphs
108  for(auto graphPointsX : m_graphsX) {
109  TGraph* g = new TGraph(graphPointsX.second.size(),&graphPointsX.second[0],&m_graphsY[graphPointsX.first][0]);
110  g->SetTitle(graphPointsX.first);
111  g->SetMarkerStyle(6);
112  CHECK( histSvc->regGraph(TString::Format("/%s/%s",m_stream.c_str(),graphPointsX.first.Data()).Data(),g) );
113  }
114 
115 
116  return StatusCode::SUCCESS;
117 }

◆ initialize()

StatusCode SuperCellVsCaloCellTestAlg::initialize ( )
virtual

Definition at line 46 of file SuperCellVsCaloCellTestAlg.cxx.

46  {
47 
48  //get the mapping tool
49  CHECK( m_sc2ccMappingTool.retrieve() );
50  //and the id helper (used for making id hashes)
51  CHECK( detStore()->retrieve (m_ccIdHelper, "CaloCell_ID") );
52 
53  double etBins[11] = {0.1,0.25,0.5,0.75,1.,1.5,2.,3.,4.,5.,10.}; //in GeV
55  if(!m_ccKey.empty()) {
56  m_etReso.push_back(new TProfile(TString::Format("%s_calocell",CaloSampling::getSamplingName(i).c_str()),TString::Format("%s;CaloCell E_{T} [GeV];SuperCell E_{T} / CaloCell E_{T}",CaloSampling::getSamplingName(i).c_str()),10,etBins,"s"/* standard deviation for error*/));
57  m_etReso.back()->SetDirectory(nullptr);
58  m_Reso_et.push_back(new TH1F(TString::Format("%s_SuperCellResolution",CaloSampling::getSamplingName(i).c_str()),TString::Format("%s;(SuperCell E_{T} - CaloCell E_{T}) / CaloCell E_{T} (%%)",CaloSampling::getSamplingName(i).c_str()),80,-40,40) );
59  m_Reso_et_vs_et.push_back(new TH2F(TString::Format("%s_SuperCellResolution_versus_et",CaloSampling::getSamplingName(i).c_str()),TString::Format("%s; E_{T}[GeV] ; (SuperCell E_{T} - CaloCell E_{T}) / CaloCell E_{T} (%%)",CaloSampling::getSamplingName(i).c_str()),60,-10,50,80,-40,40) );
60  m_Reso_et_vs_eta.push_back(new TH2F(TString::Format("%s_SuperCellResolution_versus_eta",CaloSampling::getSamplingName(i).c_str()),TString::Format("%s; #eta ; (SuperCell E_{T} - CaloCell E_{T}) / CaloCell E_{T} (%%)",CaloSampling::getSamplingName(i).c_str()),50,-2.5,2.5,80,-40,40) );
61  m_Linear_SCet_vs_et.push_back(new TH2F(TString::Format("%s_Linearity",CaloSampling::getSamplingName(i).c_str()),TString::Format("%s; CaloCell Sum E_{T}[GeV] ; SuperCell E_{T}",CaloSampling::getSamplingName(i).c_str()),60,-10,50,60,-10,50) );
62  }
63  if(!m_tscKey.empty()) {
64  m_etResoTruth.push_back(new TProfile(TString::Format("%s_truth",CaloSampling::getSamplingName(i).c_str()),TString::Format("%s;Truth SuperCell E_{T} [GeV];SuperCell E_{T} / Truth SuperCell E_{T}",CaloSampling::getSamplingName(i).c_str()),10,etBins,"s"/* standard deviation for error*/));
65  m_etResoTruth.back()->SetDirectory(nullptr);
66  }
67  }
68 
69  m_tree = new TTree("debug","debug");
70 
71  m_treeDigits= new std::vector<short int>;
72 
73  m_tree->Branch("EventNumber",&m_eventNumber);
74  m_tree->Branch("Channel",&m_treeChannel);
75  m_tree->Branch("Sampling",&m_treeSampling);
76  m_tree->Branch("eta",&m_treeEta);
77  m_tree->Branch("scET",&m_treeSCET);
78  m_tree->Branch("truthET",&m_treeTruthET);
79  m_tree->Branch("digits",&m_treeDigits);
80 
82  CHECK( histSvc->regTree(TString::Format("/%s/debug",m_stream.c_str()).Data(),m_tree) );
83 
85 
86 
87  return StatusCode::SUCCESS;
88 }

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

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

SG::ReadCondHandleKey<LArOnOffIdMapping> SuperCellVsCaloCellTestAlg::m_cablingKey {this,"SCCablingKey","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object"}
private

Definition at line 40 of file SuperCellVsCaloCellTestAlg.h.

◆ m_ccIdHelper

const CaloCell_ID* SuperCellVsCaloCellTestAlg::m_ccIdHelper
private

Definition at line 42 of file SuperCellVsCaloCellTestAlg.h.

◆ m_ccKey

std::string SuperCellVsCaloCellTestAlg::m_ccKey
private

Definition at line 44 of file SuperCellVsCaloCellTestAlg.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_digitKey

std::string SuperCellVsCaloCellTestAlg::m_digitKey
private

Definition at line 44 of file SuperCellVsCaloCellTestAlg.h.

◆ m_etReso

std::vector<TProfile*> SuperCellVsCaloCellTestAlg::m_etReso
private

Definition at line 53 of file SuperCellVsCaloCellTestAlg.h.

◆ m_etResoTruth

std::vector<TProfile*> SuperCellVsCaloCellTestAlg::m_etResoTruth
private

Definition at line 54 of file SuperCellVsCaloCellTestAlg.h.

◆ m_eventNumber

int SuperCellVsCaloCellTestAlg::m_eventNumber =0
private

Definition at line 64 of file SuperCellVsCaloCellTestAlg.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_graphsX

std::map<TString,std::vector<float> > SuperCellVsCaloCellTestAlg::m_graphsX
private

Definition at line 61 of file SuperCellVsCaloCellTestAlg.h.

◆ m_graphsY

std::map<TString,std::vector<float> > SuperCellVsCaloCellTestAlg::m_graphsY
private

Definition at line 61 of file SuperCellVsCaloCellTestAlg.h.

◆ m_Linear_SCet_vs_et

std::vector<TH2F*> SuperCellVsCaloCellTestAlg::m_Linear_SCet_vs_et
private

Definition at line 59 of file SuperCellVsCaloCellTestAlg.h.

◆ m_Reso_et

std::vector<TH1F*> SuperCellVsCaloCellTestAlg::m_Reso_et
private

Definition at line 56 of file SuperCellVsCaloCellTestAlg.h.

◆ m_Reso_et_vs_et

std::vector<TH2F*> SuperCellVsCaloCellTestAlg::m_Reso_et_vs_et
private

Definition at line 58 of file SuperCellVsCaloCellTestAlg.h.

◆ m_Reso_et_vs_eta

std::vector<TH2F*> SuperCellVsCaloCellTestAlg::m_Reso_et_vs_eta
private

Definition at line 57 of file SuperCellVsCaloCellTestAlg.h.

◆ m_sc2ccMappingTool

ToolHandle<ICaloSuperCellIDTool> SuperCellVsCaloCellTestAlg::m_sc2ccMappingTool
private

Definition at line 41 of file SuperCellVsCaloCellTestAlg.h.

◆ m_scKey

std::string SuperCellVsCaloCellTestAlg::m_scKey
private

Definition at line 44 of file SuperCellVsCaloCellTestAlg.h.

◆ m_stream

std::string SuperCellVsCaloCellTestAlg::m_stream
private

Definition at line 44 of file SuperCellVsCaloCellTestAlg.h.

◆ m_tree

TTree* SuperCellVsCaloCellTestAlg::m_tree
private

Definition at line 71 of file SuperCellVsCaloCellTestAlg.h.

◆ m_treeChannel

int SuperCellVsCaloCellTestAlg::m_treeChannel =0
private

Definition at line 65 of file SuperCellVsCaloCellTestAlg.h.

◆ m_treeDigits

std::vector<short int>* SuperCellVsCaloCellTestAlg::m_treeDigits
private

Definition at line 70 of file SuperCellVsCaloCellTestAlg.h.

◆ m_treeEta

float SuperCellVsCaloCellTestAlg::m_treeEta =0
private

Definition at line 67 of file SuperCellVsCaloCellTestAlg.h.

◆ m_treeSampling

int SuperCellVsCaloCellTestAlg::m_treeSampling =0
private

Definition at line 66 of file SuperCellVsCaloCellTestAlg.h.

◆ m_treeSCET

float SuperCellVsCaloCellTestAlg::m_treeSCET =0
private

Definition at line 68 of file SuperCellVsCaloCellTestAlg.h.

◆ m_treeTruthET

float SuperCellVsCaloCellTestAlg::m_treeTruthET =0
private

Definition at line 69 of file SuperCellVsCaloCellTestAlg.h.

◆ m_tscKey

std::string SuperCellVsCaloCellTestAlg::m_tscKey
private

Definition at line 44 of file SuperCellVsCaloCellTestAlg.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.


The documentation for this class was generated from the following files:
SuperCellVsCaloCellTestAlg::m_scKey
std::string m_scKey
Definition: SuperCellVsCaloCellTestAlg.h:44
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SuperCellVsCaloCellTestAlg::m_etReso
std::vector< TProfile * > m_etReso
Definition: SuperCellVsCaloCellTestAlg.h:53
SuperCellVsCaloCellTestAlg::m_treeSCET
float m_treeSCET
Definition: SuperCellVsCaloCellTestAlg.h:68
SuperCellVsCaloCellTestAlg::m_ccKey
std::string m_ccKey
Definition: SuperCellVsCaloCellTestAlg.h:44
SuperCellVsCaloCellTestAlg::m_Linear_SCet_vs_et
std::vector< TH2F * > m_Linear_SCet_vs_et
Definition: SuperCellVsCaloCellTestAlg.h:59
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
StateLessPT_NewConfig.Format
Format
Definition: StateLessPT_NewConfig.py:146
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
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
SuperCellVsCaloCellTestAlg::m_graphsX
std::map< TString, std::vector< float > > m_graphsX
Definition: SuperCellVsCaloCellTestAlg.h:61
GetEntries
TGraphErrors * GetEntries(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4019
SuperCellVsCaloCellTestAlg::m_eventNumber
int m_eventNumber
Definition: SuperCellVsCaloCellTestAlg.h:64
CaloCell_Base_ID::calo_sample
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
Definition: CaloCell_Base_ID.cxx:141
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SuperCellVsCaloCellTestAlg::m_digitKey
std::string m_digitKey
Definition: SuperCellVsCaloCellTestAlg.h:44
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
HWIdentifier
Definition: HWIdentifier.h:13
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
SuperCellVsCaloCellTestAlg::m_tree
TTree * m_tree
Definition: SuperCellVsCaloCellTestAlg.h:71
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
SuperCellVsCaloCellTestAlg::m_stream
std::string m_stream
Definition: SuperCellVsCaloCellTestAlg.h:44
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SuperCellVsCaloCellTestAlg::m_Reso_et_vs_eta
std::vector< TH2F * > m_Reso_et_vs_eta
Definition: SuperCellVsCaloCellTestAlg.h:57
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
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
SuperCellVsCaloCellTestAlg::m_graphsY
std::map< TString, std::vector< float > > m_graphsY
Definition: SuperCellVsCaloCellTestAlg.h:61
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
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.
SuperCellVsCaloCellTestAlg::m_etResoTruth
std::vector< TProfile * > m_etResoTruth
Definition: SuperCellVsCaloCellTestAlg.h:54
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
SuperCellVsCaloCellTestAlg::m_treeDigits
std::vector< short int > * m_treeDigits
Definition: SuperCellVsCaloCellTestAlg.h:70
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SuperCellVsCaloCellTestAlg::m_treeSampling
int m_treeSampling
Definition: SuperCellVsCaloCellTestAlg.h:66
SuperCellVsCaloCellTestAlg::m_Reso_et
std::vector< TH1F * > m_Reso_et
Definition: SuperCellVsCaloCellTestAlg.h:56
MuonSegmentReaderConfig.histSvc
histSvc
Definition: MuonSegmentReaderConfig.py:96
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SuperCellVsCaloCellTestAlg::m_treeChannel
int m_treeChannel
Definition: SuperCellVsCaloCellTestAlg.h:65
SuperCellVsCaloCellTestAlg::m_sc2ccMappingTool
ToolHandle< ICaloSuperCellIDTool > m_sc2ccMappingTool
Definition: SuperCellVsCaloCellTestAlg.h:41
SuperCellVsCaloCellTestAlg::m_treeTruthET
float m_treeTruthET
Definition: SuperCellVsCaloCellTestAlg.h:69
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
CaloCellContainer::findCell
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Definition: CaloCellContainer.cxx:345
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
SuperCellVsCaloCellTestAlg::m_treeEta
float m_treeEta
Definition: SuperCellVsCaloCellTestAlg.h:67
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloSampling::getNumberOfSamplings
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:30
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SuperCellVsCaloCellTestAlg::m_tscKey
std::string m_tscKey
Definition: SuperCellVsCaloCellTestAlg.h:44
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LArDigitContainer
Container class for LArDigit.
Definition: LArDigitContainer.h:24
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
CaloSampling::getSamplingName
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
Definition: Calorimeter/CaloGeoHelpers/Root/CaloSampling.cxx:18
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
SuperCellVsCaloCellTestAlg::m_ccIdHelper
const CaloCell_ID * m_ccIdHelper
Definition: SuperCellVsCaloCellTestAlg.h:42
SuperCellVsCaloCellTestAlg::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: SuperCellVsCaloCellTestAlg.h:40
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
CaloCell::sinTh
virtual double sinTh() const override final
get sin(theta) (through CaloDetDescrElement)
Definition: CaloCell.h:373
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ITHistSvc >
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
SuperCellVsCaloCellTestAlg::m_Reso_et_vs_et
std::vector< TH2F * > m_Reso_et_vs_et
Definition: SuperCellVsCaloCellTestAlg.h:58