Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
35 #include "TProfile2D.h"
42 ISvcLocator* pSvcLocator)
44 m_outputFile(nullptr),
45 m_clusterCollName(
"CaloTopoClusters"),
46 m_NormalizationType(
"Lin"),
47 m_NormalizationTypeNumber(0),
48 m_ClassificationType(
"None"),
49 m_ClassificationTypeNumber(0)
52 std::vector<Gaudi::Histo1DDef> dims(6);
53 dims[0] = Gaudi::Histo1DDef(
"side",-1.5,1.5,1);
54 dims[1] = Gaudi::Histo1DDef(
"|eta|",0.,5.,50);
55 dims[2] = Gaudi::Histo1DDef(
"phi",-
M_PI,
M_PI,1);
56 dims[3] = Gaudi::Histo1DDef(
"log10(E_clus (MeV))",log10(200),log10(1e6),14);
57 dims[4] = Gaudi::Histo1DDef(
"log10(lambda_clus (mm))",0.0,4.0,14);
58 dims[5] = Gaudi::Histo1DDef(
"weight",0.,3.0,1);
105 ATH_MSG_INFO(
"Using weighting proportional to E_calib" );
109 ATH_MSG_INFO(
"Using weighting proportional to log(E_calib)" );
113 ATH_MSG_INFO(
"Using weighting proportional to 1/N_Clus_E_calib>0" );
126 ATH_MSG_INFO(
"Expecting ParticleID simulation as input -- use EM type clusters only" );
130 ATH_MSG_INFO(
"Expecting ParticleID simulation as input -- use HAD type clusters only" );
146 for(
unsigned int idim=0;idim<
m_dimensions.size();idim++) {
166 if ( ilogE < 0 || ieta < 0 || iloglambda < 0 || iweight < 0 || iside < 0 ) {
167 ATH_MSG_FATAL(
" Mandatory dimension log10E, |eta|, log10lambda or weight missing ...");
168 return StatusCode::FAILURE;
174 m_ooc.resize(nside*nphi*nlogE,
nullptr);
175 for (
int jside=0;jside<nside;jside++) {
176 for (
int jphi=0;jphi<nphi;jphi++) {
177 for(
int jlogE=0;jlogE<nlogE;jlogE++) {
178 TString oname(
"ooc");
206 int iO = jlogE*nphi*nside+jphi*nside+jside;
207 m_ooc[iO] =
new TProfile2D(oname,oname,
216 m_ooc[iO]->SetXTitle(
"|#eta_{clus}|");
217 m_ooc[iO]->SetYTitle(
"log_{10}(#lambda_{clus} (mm))");
218 m_ooc[iO]->SetZTitle(
"E_{out of cluster} / E_{clus}^{EM-no-PS/Gap3} / Isolation");
232 msg(MSG::ERROR) <<
"Calorimeter sampling "
234 <<
" is not a valid Calorimeter sampling name and will be ignored! "
235 <<
"Valid names are: ";
250 msg(MSG::INFO) <<
"Samplings to exclude from the out-of-cluster weighting:";
257 return StatusCode::SUCCESS;
266 for(
unsigned int i=0;
i<
m_ooc.size();
i++) {
271 return StatusCode::SUCCESS;
281 double eCalibTot(0.);
282 double nClusECalibGt0 = 0.0;
287 ATH_MSG_ERROR(
"Failed to retrieve cluster moment ENG_CALIB_TOT" );
288 return StatusCode::FAILURE;
293 ATH_MSG_ERROR(
"Failed to retrieve cluster moment ENG_CALIB_FAC_EM" );
294 return StatusCode::FAILURE;
307 if ( eCalibTot > 0 ) {
308 const double inv_eCalibTot = 1. / eCalibTot;
309 const double inv_nClusECalibGt0 = 1. / nClusECalibGt0;
311 double eng = pClus->e();
316 ATH_MSG_ERROR(
"Failed to retrieve cluster moment ENG_CALIB_FAC_EM");
317 return StatusCode::FAILURE;
342 iside = (
int)(nside*(((pClus->eta()<0?-1.0:1.0) - hd.lowEdge())
343 /(hd.highEdge()-hd.lowEdge())));
344 if ( iside < 0 || iside > nside-1 ) {
346 iside <<
" not in [0," << nside-1 <<
"]" );
354 iphi = (
int)(nphi*((pClus->phi() - hd.lowEdge())
355 /(hd.highEdge()-hd.lowEdge())));
356 if ( iphi < 0 || iphi > nphi-1 ) {
358 iphi <<
" not in [0," << nphi-1 <<
"]" );
365 ilogE = (
int)(nlogE*((log10(eng) - hd.lowEdge())
366 /(hd.highEdge()-hd.lowEdge())));
367 if ( ilogE >= 0 && ilogE < nlogE ) {
368 double lamb,eout,etot,isol;
373 ATH_MSG_ERROR(
"Failed to retrieve a cluster moment (CENTER_LAMBDA,ENG_CALIB_OUT,ENG_CALIB_TOT,ISOLATION)" );
374 return StatusCode::FAILURE;
381 int iO = ilogE*nphi*nside+iphi*nside+iside;
385 norm = etot*inv_eCalibTot;
389 norm = log10(etot*inv_eCalibTot)+2.0;
392 norm = inv_nClusECalibGt0;
398 m_ooc[iO]->Fill(fabs(pClus->eta()),log10(lamb),eout/eng/isol,
norm);
407 return StatusCode::SUCCESS;
411 for (
unsigned int i=0;
i<dims.size();
i++) {
418 for (std::pair<const std::string, Gaudi::Histo1DDef>&
p :
m_dimensionsmap) {
421 <<
p.second.title() <<
", [" <<
p.second.lowEdge()
422 <<
", " <<
p.second.highEdge()
423 <<
", " <<
p.second.bins()
int m_NormalizationTypeNumber
std::string m_NormalizationType
string to choose different normalization types
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< TProfile2D * > m_ooc
Vector of actual histograms.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
std::string m_ClassificationType
string to choose different classification types
virtual StatusCode initialize()
std::map< std::string, Gaudi::Histo1DDef > m_dimensionsmap
property to set all dimensions introduced above
Description of a calorimeter cluster.
std::vector< std::string > m_invalidSamplingNames
vector of names of the calorimeter samplings not to use when applying the out-of-cluster weights.
virtual StatusCode finalize()
std::unique_ptr< TFile > m_outputFile
Output file to save histograms in.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< int > m_isampmap
Vector of indices in m_dimensions.
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterCollName
Name of the CaloClusterContainer to use.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual StatusCode execute()
GetLCOutOfCluster(const std::string &name, ISvcLocator *pSvcLocator)
Helpers for checking error return status codes and reporting errors.
std::string m_outputFileName
Name of the output file to save histograms in.
virtual ~GetLCOutOfCluster()
std::set< int > m_invalidSamplings
actual set of samplings to be ignored for out-of-cluster weights
static const std::string & getSamplingName(const CaloSampling::CaloSample theSample)
Returns a string (name) for each CaloSampling.
#define ATH_MSG_WARNING(x)
@ ENG_CALIB_OUT_L
Attached Calibration Hit energy outside clusters but inside the calorimeter with loose matching (Angl...
int m_ClassificationTypeNumber
std::vector< Gaudi::Histo1DDef > m_dimensions
definition of all dimensions used for out-of-cluster corrections
Handle class for reading from StoreGate.
void mapinsert(const std::vector< Gaudi::Histo1DDef > &dims)