17#include "GaudiKernel/ITHistSvc.h"
54 double etBins[11] = {0.1,0.25,0.5,0.75,1.,1.5,2.,3.,4.,5.,10.};
58 m_etReso.back()->SetDirectory(
nullptr);
70 m_tree =
new TTree(
"debug",
"debug");
88 return StatusCode::SUCCESS;
110 TGraph* g =
new TGraph(graphPointsX.second.size(),&graphPointsX.second[0],&
m_graphsY[graphPointsX.first][0]);
111 g->SetTitle(graphPointsX.first);
112 g->SetMarkerStyle(6);
113 CHECK( histSvc->regGraph(TString::Format(
"/%s/%s",
m_stream.c_str(),graphPointsX.first.Data()).Data(),g) );
117 return StatusCode::SUCCESS;
132 return StatusCode::FAILURE;
136 for(
const auto *scell : *scells) {
140 int samplingEnum =
m_ccIdHelper->calo_sample(scell->ID());
142 double scellEt = scell->e()*scell->sinTh()*1e-3;
145 std::vector<Identifier> ccellIds =
m_sc2ccMappingTool->superCellToOfflineID( scell->ID() );
148 for(
auto& ccellId : ccellIds) {
151 if(ccell->
e()>0) cellEt += ccell->
e()*ccell->
sinTh();
153 if(cellEt>0)
m_etReso[samplingEnum]->Fill(cellEt*1e-3,scellEt*1000./cellEt);
154 float resolution = 0.0;
155 if ( std::abs(cellEt)>1 ) resolution = 100*(scellEt - cellEt*1e-3 ) / (cellEt*1e-3);
156 if ( std::abs(cellEt)>150 ) {
157 m_Reso_et[samplingEnum]->Fill( resolution );
166 double tscellEt = tscell->
e()*tscell->
sinTh()*1e-3;
167 if(tscellEt>0)
m_etResoTruth[samplingEnum]->Fill(tscellEt,scellEt/tscellEt);
170 if( (tscellEt>1. && scellEt/tscellEt<0.25) || (scellEt>1. && tscellEt/scellEt<0.25) ) {
173 HWIdentifier hwid = cabling->createSignalChannelID(scell->ID());
181 for(
const auto *digit : *digits) {
if(digit->hardwareID()==hwid) *
m_treeDigits = digit->samples(); }
194 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
TGraphErrors * GetEntries(TH2F *histo)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
Container class for CaloCell.
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Data object for each calorimeter readout cell.
virtual double e() const override final
get energy (data member) (synonym to method energy()
virtual double sinTh() const override final
get sin(theta) (through CaloDetDescrElement)
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Container class for LArDigit.
virtual StatusCode initialize()
virtual ~SuperCellVsCaloCellTestAlg()
ToolHandle< ICaloSuperCellIDTool > m_sc2ccMappingTool
std::vector< short int > * m_treeDigits
std::vector< TProfile * > m_etResoTruth
std::vector< TH2F * > m_Linear_SCet_vs_et
SuperCellVsCaloCellTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< TH2F * > m_Reso_et_vs_et
virtual StatusCode finalize()
std::vector< TH2F * > m_Reso_et_vs_eta
std::map< TString, std::vector< float > > m_graphsX
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
std::vector< TH1F * > m_Reso_et
const CaloCell_ID * m_ccIdHelper
std::vector< TProfile * > m_etReso
std::map< TString, std::vector< float > > m_graphsY
virtual StatusCode execute()