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

#include <CaloFillRectangularCluster.h>

Inheritance diagram for CaloFillRectangularCluster:
Collaboration diagram for CaloFillRectangularCluster:

Public Types

typedef std::array< std::pair< double, double >, 4 > WindowArray_t
 Holds the per-layer window sizes. More...
 
typedef ToolWithConstants base_class
 Shorthand for derived classes. More...
 
using Context = CaloUtils::ToolConstantsContext
 Convenient alias for the Context type. More...
 
using Constant = ToolConstant< T >
 Alias for the Constant type. More...
 

Public Member Functions

 CaloFillRectangularCluster (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi constructor. More...
 
virtual StatusCode initialize () override
 Standard Gaudi initialize method. More...
 
virtual void makeCorrection (const Context &myctx, xAOD::CaloCluster *cluster) const override
 CaloClusterCorrection virtual method. More...
 
void makeCorrection (const EventContext &ctx, xAOD::CaloCluster *cluster) const
 
virtual void get_seed (CaloClusterCorr::SamplingHelper &helper, const xAOD::CaloCluster *cluster, double &eta, double &phi) const
 
virtual StatusCode setCaloCellContainerName (const std::string &name) override
 Change the name of the CaloCellContainer used by this tool. More...
 
virtual WindowArray_t initWindows (const int neta, const int nphi, const double detas2, const double dphis2) const
 Set up layer-by-layer cluster window sizes. More...
 
virtual void setsample (xAOD::CaloCluster *cluster, CaloSampling::CaloSample sampling, float em, float etam, float phim, float emax, float etamax, float phimax, float etas, float phis) const
 
virtual void setenergy (xAOD::CaloCluster *cluster, float energy) const
 
StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const override
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const=0
 Execute on a single cluster. More...
 
virtual StatusCode execute (xAOD::CaloCluster *cluster) final
 Execute on a single cluster. More...
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const
 Execute on an entire collection of clusters. More...
 
Context context (const EventContext &ctx) const
 Create a Context object. More...
 
virtual void writeConstants (std::ostream &stream, const std::string &name, const EventContext &ctx) const
 Dump method (for debugging) More...
 
virtual StatusCode mergeConstants (CaloRec::ToolConstants &out, const EventContext &ctx) const override
 Merge our constants into out with the proper prefix. More...
 
virtual int toolVersion () const
 Return the version number for this tool. More...
 
virtual const std::string & toolType () const
 Return the name of the type of this tool. More...
 

Protected Attributes

double m_deta0 = 0.0
 Cell window sizes in each sampling. More...
 
double m_deta1 = 0.0
 
double m_deta2 = 0.0
 
double m_deta3 = 0.0
 
double m_dphi0 = 0.0
 
double m_dphi1 = 0.0
 
double m_dphi2 = 0.0
 
double m_dphi3 = 0.0
 
int m_neta
 \(\eta\times\phi\) cluster size. These are properties. More...
 
int m_nphi
 
bool m_fill_cluster
 Fill-cluster flag. More...
 
bool m_setRawState
 Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state
More...
 
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}
 

Private Member Functions

 CaloFillRectangularCluster ()=delete
 This isn't allowed. More...
 
void makeCorrection1 (const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper, double eta, double phi, const CaloSampling::CaloSample samplings[4]) const
 
void makeCorrection2 (const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper) const
 

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_cellsName
 The StoreGate key for the container of our input cells. More...
 
SG::ReadCondHandleKey< CaloRec::ToolConstantsm_DBHandle
 Handle to a ToolConstants conditions object. More...
 
StringProperty m_prefix
 Prefix for finding our constants within the ToolConstants object. More...
 
ToolWithConstantsImpl m_impl
 Internal implementation object. More...
 
Constant< int > m_order
 Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag. More...
 
Constant< bool > m_isdummy
 If true, then this is a dummy tool that should not be executed. More...
 

Detailed Description

Definition at line 60 of file CaloFillRectangularCluster.h.

Member Typedef Documentation

◆ base_class

typedef ToolWithConstants CaloUtils::ToolWithConstants< CaloClusterProcessor >::base_class
inherited

Shorthand for derived classes.

Definition at line 443 of file ToolWithConstants.h.

◆ Constant

using CaloUtils::ToolWithConstants< CaloClusterProcessor >::Constant = ToolConstant<T>
inherited

Alias for the Constant type.

Definition at line 456 of file ToolWithConstants.h.

◆ Context

Convenient alias for the Context type.

Definition at line 451 of file ToolWithConstants.h.

◆ WindowArray_t

typedef std::array<std::pair<double, double>, 4> CaloFillRectangularCluster::WindowArray_t

Holds the per-layer window sizes.

Definition at line 122 of file CaloFillRectangularCluster.h.

Constructor & Destructor Documentation

◆ CaloFillRectangularCluster() [1/2]

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

Standard Gaudi constructor.

Parameters
typeThe type of the tool.
nameThe name of the tool.
parentThe parent algorithm of the tool.

Definition at line 781 of file CaloFillRectangularCluster.cxx.

786 {
787  // properties
788  declareProperty("eta_size", m_neta = 5);
789  declareProperty("phi_size", m_nphi = 5);
790  declareProperty("fill_cluster", m_fill_cluster = true);
791  declareProperty("cells_name", m_cellsName = "AllCalo");
792  declareProperty("set_raw_state",m_setRawState=true);
793 }

◆ CaloFillRectangularCluster() [2/2]

CaloFillRectangularCluster::CaloFillRectangularCluster ( )
privatedelete

This isn't allowed.

Member Function Documentation

◆ context()

Context CaloUtils::ToolWithConstants< CaloClusterProcessor >::context ( const EventContext &  ctx) const
inherited

Create a Context object.

This can then be passed to Constant::operator().

◆ execute() [1/4]

StatusCode CaloClusterCorrection::execute ( const EventContext &  ctx,
xAOD::CaloCluster cluster 
) const
overrideinherited

Definition at line 53 of file CaloClusterCorrection.cxx.

55 {
56  this->makeCorrection (context(ctx), cluster);
57 
58 #if 0
59  ATH_MSG_DEBUG( " ...... e, et " << cluster->e() << " " << cluster->et() << endmsg);
60  ATH_MSG_DEBUG( " ...... eta, etaBE, etaSmp " << cluster->eta() << " " << cluster->etaBE(2)
61  << " " << cluster->etaSample(CaloSampling::EMB1)
62  << " " << cluster->etaSample(CaloSampling::EMB2)
63  << " " << cluster->etaSample(CaloSampling::EMB3) << endmsg);
64  ATH_MSG_DEBUG( " ...... phi, phiBE, phiSmp " << cluster->phi() << " " << cluster->phiBE(2)
65  << " " << cluster->phiSample(CaloSampling::EMB1)
66  << " " << cluster->phiSample(CaloSampling::EMB2)
67  << " " << cluster->phiSample(CaloSampling::EMB3) << endmsg);
68 #endif
69 
70  return StatusCode::SUCCESS;
71 }

◆ execute() [2/4]

virtual StatusCode CaloClusterProcessor::execute
inherited

Execute on a single cluster.

Parameters
clusterThe cluster to process.
ctxThe event context.

◆ execute() [3/4]

StatusCode CaloClusterProcessor::execute
inherited

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters.

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

Parameters
collectionThe container of clusters.
ctxThe event context.

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

Definition at line 73 of file CaloClusterProcessor.cxx.

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

◆ execute() [4/4]

StatusCode CaloClusterProcessor::execute
finalinherited

Execute on a single cluster.

Parameters
clusterThe cluster to process. (deprecated)

Definition at line 63 of file CaloClusterProcessor.cxx.

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

◆ get_seed()

void CaloFillRectangularCluster::get_seed ( CaloClusterCorr::SamplingHelper helper,
const xAOD::CaloCluster cluster,
double &  eta,
double &  phi 
) const
virtual

!!! NEW way of the endcap-shift treatment (same for barrel and endcap)

Reimplemented in CaloTopoEMlayers.

Definition at line 1153 of file CaloFillRectangularCluster.cxx.

1157 {
1158  const CaloCell* max_et_cell = helper.max_et_cell();
1159 
1161  // a.b.c 2004 : for barrel, correct for the alignment before
1162  // comparing the Tower direction and the cell's
1163  // ( for Atlas the difference is null, but it's not true for TB )
1164  const CaloDetDescrElement* elt = max_et_cell->caloDDE();
1165  double phi_shift = elt->phi()-elt->phi_raw();
1166  double eta_shift = elt->eta()-elt->eta_raw();
1167  eta = cluster->eta0()+eta_shift;
1168  phi = CaloPhiRange::fix(cluster->phi0()+phi_shift);
1169 
1170  // Special case to handle a pathology seen at the edge of the calorimeter
1171  // with clusters with an eta size of 3. The cluster size used for the SW
1172  // clustering is 5x5. The SW clustering will find the window that contains
1173  // the maximum amount of energy. So, suppose that there's a cluster
1174  // near the edge of the calorimeter such that the most energetic cell
1175  // is right at the edge of the calorimeter. In this case, the SW clustering
1176  // is likely to position the seed cell two cells from the edge
1177  // (the next-to-next-to-last cell), as in that case, all 5 eta cells
1178  // are contained within the calorimeter. But in that case, if we then
1179  // build a cluster of size 3 around this seed, then we'll be missing
1180  // the cell with the highest energy! This will severely bias the
1181  // energy and eta measurements.
1182  //
1183  // So, what I'll do is this. If the maximum cell is at the outer
1184  // edge of the (outer) EC and it is not within our eta window, then I'll
1185  // use the maximum cell position as the seed instead of what
1186  // the SW clustering gives. I restrict this to the outer edge
1187  // of the EC to avoid any chance of changing the clustering results
1188  // in the bulk of the calorimeter.
1189  // Also do this if the maximum cell is on the edge of the inner endcap ---
1190  // we can get the same effect.
1191  if ((elt->is_lar_em_endcap_inner() &&
1192  std::abs(elt->eta_raw()) - elt->deta() <
1193  elt->descriptor()->calo_eta_min()) ||
1194  (elt->is_lar_em_endcap_outer() &&
1195  std::abs(elt->eta_raw()) + elt->deta() >
1196  elt->descriptor()->calo_eta_max()))
1197  {
1198  // Max cell is at the edge. Is it outside the window?
1199  if (std::abs (eta - elt->eta()) > helper.deta(2)/2) {
1200  // Yes --- change the seed.
1201  eta = elt->eta();
1202  }
1203  }
1204 
1205  // stay in the calo frame and do not cook for cluster on edge
1206  // (inputs are now 3x5 so there should not be problems anymore)
1207  eta = cluster->eta0();
1208  phi = CaloPhiRange::fix(cluster->phi0());
1209 
1210 }

◆ initialize()

StatusCode CaloFillRectangularCluster::initialize ( )
overridevirtual

Standard Gaudi initialize method.

Derived classes can extend this to change the sampling window sizes.

Reimplemented from CaloClusterCorrection.

Reimplemented in CaloTopoEMlayers.

Definition at line 801 of file CaloFillRectangularCluster.cxx.

802 {
803  // The method from the base class.
805  if (!m_cellsName.key().empty()){
807  }
808 
810  return StatusCode::SUCCESS;
811 }

◆ initWindows()

CaloFillRectangularCluster::WindowArray_t CaloFillRectangularCluster::initWindows ( const int  neta,
const int  nphi,
const double  detas2,
const double  dphis2 
) const
virtual

Set up layer-by-layer cluster window sizes.

Parameters
netaCluster eta size.
nphiCluster phi size.
detas2Middle layer cell eta size.
detas2Middle layer cell phi size.

Returns per-layer array of deta,dphi pairs.

Reimplemented in CaloTopoEMlayers.

Definition at line 1235 of file CaloFillRectangularCluster.cxx.

1239 {
1241 
1242  // set up the sampling windows:
1243  w[0].first = detas2*neta;
1244  w[0].second = dphis2*4;
1245 
1246  if (nphi >= 7)
1247  w[0].second *= 2;
1248  else
1249  w[0].second *= 1.5;
1250 
1251  w[1].first = w[0].first;
1252  w[1].second = w[0].second;
1253 
1254  w[2].first = detas2*neta;
1255  w[2].second = dphis2*nphi;
1256 
1257  w[3].first = (2*detas2)*(0.5 + (neta/2.));
1258  w[3].second = w[2].second;
1259 
1260  return w;
1261 }

◆ makeCorrection() [1/2]

virtual void CaloFillRectangularCluster::makeCorrection ( const Context myctx,
xAOD::CaloCluster cluster 
) const
overridevirtual

CaloClusterCorrection virtual method.

Parameters
myctxToolWithConstants context.
clusterThe cluster on which to operate.

Implements CaloClusterCorrection.

◆ makeCorrection() [2/2]

void CaloFillRectangularCluster::makeCorrection ( const EventContext &  ctx,
xAOD::CaloCluster cluster 
) const
inline

Definition at line 92 of file CaloFillRectangularCluster.h.

94  {
95  return makeCorrection (context(ctx), cluster);
96  }

◆ makeCorrection1()

void CaloFillRectangularCluster::makeCorrection1 ( const EventContext &  ctx,
const CaloDetDescrManager dd_man,
CaloClusterCorr::SamplingHelper helper,
double  eta,
double  phi,
const CaloSampling::CaloSample  samplings[4] 
) const
private

Definition at line 823 of file CaloFillRectangularCluster.cxx.

831 {
832  // Do sampling 2.
833  helper.calculate_and_set (eta, phi, 2, -1, samplings, true);
834  // the etam and phim of the helper are now filled with etamr and phimr from the CaloLayerCalculator
835  double eta2 = helper.etam();
836  double phi2 = helper.phim();
837  // Make sure that we have a seed. Assume the input cluster has a good (eta,phi)
838  if (eta2 == -999.) eta2 = eta;
839  if (phi2 == -999.) phi2 = phi;
840 
841  // Now do sampling 1; use the result from sampling 2 as the seed.
842  helper.calculate_and_set (eta2, phi2, 1, -1, samplings);
843  double eta1 = helper.etam();
844  double phi1 = helper.phim();
845  bool refine = true;
846  if (eta1 == -999. || phi1 == -999.) {
847  // Make sure that we have a seed. If eta,phi1 not OK, (e.g. deadOTX), take (eta2,phi2)
848  if (eta1 == -999.) eta1 = eta2;
849  if (phi1 == -999.) phi1 = phi2;
850  refine = false;
851  }
852 
853  // For some silly reason, we have TWO different sampling enums.
854  // The clusters use one, the detector description uses the other.
855  CaloCell_ID::CaloSample xsample;
856  if (samplings[1] == CaloSampling::EMB1)
857  xsample = CaloCell_ID::EMB1;
858  else
859  xsample = CaloCell_ID::EME1;
860 
861  // Now refine the eta position using +-1 strip around hot cell
862  // This only makes sense if the previous step was OK
863  if (refine) {
864  double detastr, dphistr;
865  CaloClusterCorr::etaphi_range (dd_man,helper.etamax(), helper.phimax(),
866  xsample,
867  detastr, dphistr);
868 
869  if (detastr > 0 && dphistr > 0) {
870  helper.calculate_cluster (helper.etamax(), helper.phimax(),
871  detastr, dphistr, samplings[1]);
872 
873  if (helper.etam()!=-999.) {
874  eta1 = helper.etam();
875  double eta1r = helper.etareal();
876  helper.cluster()->setEta(samplings[1], eta1r);
877  }
878  }
879  }
880 
881  // Now do sampling 0 using the eta1 point:
882  helper.calculate_and_set (eta1, phi2, 0, 1, samplings);
883 
884  // Do for sampling 3 (using the sampling 2 seed).
885  helper.calculate_and_set (eta2, phi2, 3, -1, samplings);
886 
887  // Crack;
888  // Check if the cluster has TileGap3 sampling and avoid to calculate the TileGap3 energy twice
889  if ( helper.cluster()->hasSampling(CaloSampling::TileGap3) && samplings[0]==CaloSampling::PreSamplerE )
890  {
891  //By default, use the original cell container
892  const CaloCellContainer* cc = helper.cluster()->getCellLinks()->getCellContainer();
893 
894  //Leave the option to use a different cell container
895  if (!m_cellsName.key().empty()) {
897  if (!cchand.isValid()) {
898  REPORT_ERROR(StatusCode::FAILURE)
899  << "Can't retrieve cell container " << m_cellsName.key();
900  return;
901  }
902  cc = cchand.cptr();
903  }
904 
905  if(!cc) //cover the case when the cluster does not give a cell container and the name is empty
906  {
907  REPORT_ERROR(StatusCode::FAILURE)
908  << "Can't find cell container; cluster does not give a cell container";
909  return;
910  }
911 
912  // Add up the tile scintillator energy in the region around the cluster.
913  double eh_scint = 0;
915  cc->beginConstCalo(CaloCell_ID::TILE);
917  cc->endConstCalo(CaloCell_ID::TILE);
918 
919  for ( ; f_cell!=l_cell; ++f_cell)
920  {
921  const CaloCell* cell = (*f_cell) ;
922 
923  if (CaloCell_ID::TileGap3 == cell->caloDDE()->getSampling()) {
924  // consider only E4 cell
925  if( fabs(cell->eta()) < 1.4 || fabs(cell->eta()) > 1.6 ) continue;
926  double phic = cell->phi();
927  double etac = cell->eta();
928 
929  float diffeta = etac-eta2;
930  float diffphi = phic-phi2;
931  if (diffphi < -pi) diffphi += twopi;
932  if (diffphi > pi) diffphi -= twopi;
933 
934  if(fabs(diffeta)<deta && fabs(diffphi)<dphi){
935  eh_scint += cell->e();
936  }
937  }
938  }
939  //Set the TileGap3 sampling energy to the cluster; Needed for MVA calibration
940  helper.cluster()->setEnergy(CaloSampling::TileGap3,eh_scint);
941 
942  helper.cluster()->setEta(CaloSampling::TileGap3, eta2);
943  helper.cluster()->setPhi(CaloSampling::TileGap3, phi2);
944  }
945 }

◆ makeCorrection2()

void CaloFillRectangularCluster::makeCorrection2 ( const EventContext &  ctx,
const CaloDetDescrManager dd_man,
CaloClusterCorr::SamplingHelper helper 
) const
private

Definition at line 954 of file CaloFillRectangularCluster.cxx.

958 {
959 
960  // Don't do anything if we don't have any cells.
961  if (helper.empty())
962  return;
963 
964  // Get the seed position of the cluster.
965  CaloCluster* cluster = helper.cluster();
966  double eta, phi;
967  get_seed (helper, cluster, eta, phi);
968  double aeta = fabs(eta);
969 
970  // set the appropriate cluster size
971  int neta = cluster->getClusterEtaSize();
972  int nphi = cluster->getClusterPhiSize();
973 
974  if (m_neta != neta || m_nphi != nphi) {
975  CaloCluster::ClusterSize oldSize = cluster->clusterSize();
976  CaloCluster::ClusterSize newSize = oldSize;
977  switch(oldSize) {
979  break;
983  if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55ele;
984  if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35ele;
985  if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37ele;
986  if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
987  break;
991  if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55gam;
992  if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35gam;
993  if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37gam;
994  if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
995  break;
999  if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55Econv;
1000  if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35Econv;
1001  if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37Econv;
1002  if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
1003  break;
1004  default:
1005  if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55ele;
1006  if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35ele;
1007  if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37ele;
1008  if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
1009  break;
1010  }
1011  cluster->setClusterSize(newSize);
1012  }
1013 
1014  // Lists of samplings in the barrel and endcap.
1015  static const CaloSampling::CaloSample samplings_b[4] =
1018  static const CaloSampling::CaloSample samplings_e[4] =
1021 
1022  // We need to calculate sampling properties for barrel and endcap
1023  // separately.
1024  // FIXME: the overlap with barrel should be checked!!
1025 
1026  //Now set the sampling pattern for this cluster
1027  //Can't set sampling variables w/o setting the sampling pattern before
1028  uint32_t samplingPattern_b=0xf; //first four bits: The barrel sampling (PS to Back)
1029  uint32_t samplingPattern_e=0xf0; //bits 4-7: The EMEC samplings (PS to back)
1030  uint32_t samplingPattern=0;
1031 
1032  if (aeta < 1.6)
1033  samplingPattern |=samplingPattern_b;
1034 
1035  if (aeta > 1.3)
1036  samplingPattern |=samplingPattern_e;
1037 
1038  if (aeta > 1.37 && aeta < 1.63)
1039  samplingPattern |=(1<<(uint32_t)CaloSampling::TileGap3);
1040 
1041  cluster->setSamplingPattern(samplingPattern);
1042 
1043  // Barrel
1044  if (aeta < 1.6) {
1045  makeCorrection1 (ctx, dd_man,helper, eta, phi, samplings_b);
1046  }
1047 
1048  // Endcap
1049  if (aeta > 1.3) {
1050  makeCorrection1 (ctx, dd_man,helper, eta, phi, samplings_e);
1051  }
1052 
1053  // Set the total cluster energy to the sum over all samplings.
1054  double cl_ene = 0;
1055  for(int i=0; i<4; i++ ){
1056  cl_ene += cluster->eSample(samplings_b[i]);
1057  cl_ene += cluster->eSample(samplings_e[i]);
1058  }
1059  cluster->setE(cl_ene);
1060 
1061  if (m_setRawState) {
1062  cluster->setRawE(cl_ene);
1063  cluster->setRawEta(eta);
1064  cluster->setRawPhi(phi);
1065  }
1066 
1067 }

◆ mergeConstants()

virtual StatusCode CaloUtils::ToolWithConstants< CaloClusterProcessor >::mergeConstants ( CaloRec::ToolConstants out,
const EventContext &  ctx 
) const
overridevirtualinherited

Merge our constants into out with the proper prefix.

Parameters
[out]outObject to receive our constants.
ctxEvent context.

◆ setCaloCellContainerName()

StatusCode CaloFillRectangularCluster::setCaloCellContainerName ( const std::string &  name)
overridevirtual

Change the name of the CaloCellContainer used by this tool.

Parameters
nameThe new container name.

Implements ISetCaloCellContainerName.

Definition at line 1218 of file CaloFillRectangularCluster.cxx.

1220 {
1221  return this->setProperty (StringProperty ("cells_name", name));
1222 }

◆ setenergy()

void CaloClusterCorrection::setenergy ( xAOD::CaloCluster cluster,
float  energy 
) const
virtualinherited

Definition at line 94 of file CaloClusterCorrection.cxx.

95 {
96  if (cluster->e() == 0) {
97  if (energy != 0)
98  REPORT_MESSAGE (MSG::WARNING)
99  << "Attempt to rescale zero-energy cluster to energy " << energy
100  << " ignored.";
101  return;
102  }
103 
104  float correction = energy/cluster->e();
105  cluster->setE(energy);
106 
107  // also correct individual sampling energies:
108 
109  for (int iSample=CaloSampling::PreSamplerB;
110  iSample < CaloSampling::Unknown;
111  ++iSample)
112  {
113  CaloSampling::CaloSample sampling=static_cast<CaloSampling::CaloSample>(iSample);
114  if (cluster->hasSampling (sampling)) {
115  double e = cluster->eSample(sampling);
116  cluster->setEnergy(sampling,e*correction) ;
117  }
118  }
119 }

◆ setsample()

void CaloClusterCorrection::setsample ( xAOD::CaloCluster cluster,
CaloSampling::CaloSample  sampling,
float  em,
float  etam,
float  phim,
float  emax,
float  etamax,
float  phimax,
float  etas,
float  phis 
) const
virtualinherited

Definition at line 74 of file CaloClusterCorrection.cxx.

79 {
80  cluster->setEnergy(sampling, em);
81  cluster->setEta(sampling, etam);
82  cluster->setPhi(sampling, phim);
83 
84  cluster->setEmax(sampling,emax);
85  cluster->setEtamax(sampling,etamax);
86  cluster->setPhimax(sampling,phimax);
87 
88  cluster->setEtasize(sampling, etas);
89  cluster->setPhisize(sampling, phis);
90 }

◆ toolType()

virtual const std::string& CaloUtils::ToolWithConstants< CaloClusterProcessor >::toolType ( ) const
virtualinherited

Return the name of the type of this tool.

A saved set of constants includes both the C++ class name and a version number. Normally, the class name is taken from the Gaudi type() method, but that may be changed by overriding this method. This can be used, for example, when there are tools with distinct C++ classes but which are yet similar enough to combine together.

◆ toolVersion()

virtual int CaloUtils::ToolWithConstants< CaloClusterProcessor >::toolVersion ( ) const
virtualinherited

Return the version number for this tool.

A saved set of constants includes both the C++ class name and a version number. The idea is that the version number can be bumped whenever there's a backwards-incompatible change; this gives some protection against trying to use an old version of a tool with an incompatible newer set of constants.

If you want a tool to have a version number, override this method. Otherwise, it will default to a version number of 0.

◆ writeConstants()

virtual void CaloUtils::ToolWithConstants< CaloClusterProcessor >::writeConstants ( std::ostream &  stream,
const std::string &  name,
const EventContext &  ctx 
) const
virtualinherited

Dump method (for debugging)

Parameters
streamOstream to which to write.
nameName to go in output
ctxEvent context.

Member Data Documentation

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> CaloClusterCorrection::m_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}
protectedinherited

Definition at line 119 of file CaloClusterCorrection.h.

◆ m_cellsName

SG::ReadHandleKey<CaloCellContainer> CaloFillRectangularCluster::m_cellsName
private

The StoreGate key for the container of our input cells.

This is a property.

Definition at line 195 of file CaloFillRectangularCluster.h.

◆ m_DBHandle

Handle to a ToolConstants conditions object.

Definition at line 527 of file ToolWithConstants.h.

◆ m_deta0

double CaloFillRectangularCluster::m_deta0 = 0.0
protected

Cell window sizes in each sampling.

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_deta1

double CaloFillRectangularCluster::m_deta1 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_deta2

double CaloFillRectangularCluster::m_deta2 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_deta3

double CaloFillRectangularCluster::m_deta3 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_dphi0

double CaloFillRectangularCluster::m_dphi0 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_dphi1

double CaloFillRectangularCluster::m_dphi1 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_dphi2

double CaloFillRectangularCluster::m_dphi2 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_dphi3

double CaloFillRectangularCluster::m_dphi3 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_fill_cluster

bool CaloFillRectangularCluster::m_fill_cluster
protected

Fill-cluster flag.

This is a property. If true, then we fill the cluster with cells from StoreGate. Otherwise, we use the cells already in the cluster.

Definition at line 185 of file CaloFillRectangularCluster.h.

◆ m_impl

ToolWithConstantsImpl CaloUtils::ToolWithConstants< CaloClusterProcessor >::m_impl
privateinherited

Internal implementation object.

Definition at line 535 of file ToolWithConstants.h.

◆ m_isdummy

Constant<bool> CaloUtils::ToolWithConstants< CaloClusterProcessor >::m_isdummy
privateinherited

If true, then this is a dummy tool that should not be executed.

This is used for the case of reading from COOL using hierarchical tags: we need to have such tags associated with some object in each folder, regardless of whether or not the correction from that folder is actually used. [Every folder that IOVDbSvc knows about at configuration time needs to have a valid object for the configured tag, else IOVDbSvc will raise a fatal error. But we don't know at configuration time which folders we're actually going to need, so we gotta configure all of them.]

Definition at line 553 of file ToolWithConstants.h.

◆ m_neta

int CaloFillRectangularCluster::m_neta
protected

\(\eta\times\phi\) cluster size. These are properties.

Definition at line 180 of file CaloFillRectangularCluster.h.

◆ m_nphi

int CaloFillRectangularCluster::m_nphi
protected

Definition at line 180 of file CaloFillRectangularCluster.h.

◆ m_order

Constant<int> CaloUtils::ToolWithConstants< CaloClusterProcessor >::m_order
privateinherited

Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag.

Tools should be executed in order of increasing m_order.

Definition at line 540 of file ToolWithConstants.h.

◆ m_prefix

StringProperty CaloUtils::ToolWithConstants< CaloClusterProcessor >::m_prefix
privateinherited

Prefix for finding our constants within the ToolConstants object.

Definition at line 531 of file ToolWithConstants.h.

◆ m_setRawState

bool CaloFillRectangularCluster::m_setRawState
protected

Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state

Definition at line 190 of file CaloFillRectangularCluster.h.


The documentation for this class was generated from the following files:
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
xAOD::CaloCluster_v1::phi0
flt_t phi0() const
Returns raw of cluster seed.
CaloDetDescriptor::calo_eta_max
double calo_eta_max() const
'ideal' geometry: eta maximal
Definition: CaloDetDescriptor.h:563
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CaloCluster::SW_55ele
@ SW_55ele
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:87
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloDetDescrElement::is_lar_em_endcap_inner
bool is_lar_em_endcap_inner() const
cell belongs to the inner wheel of EM end cap
Definition: CaloDetDescrElement.cxx:114
CaloCluster::eSample
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:975
xAOD::CaloCluster_v1::setPhisize
bool setPhisize(const CaloSample sampling, const float phiSize)
Set the cluster size in for a given sampling.
Definition: CaloCluster_v1.cxx:624
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
REPORT_ERROR
#define REPORT_ERROR(SC)
Report an error.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:355
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloDetDescrElement::is_lar_em_endcap_outer
bool is_lar_em_endcap_outer() const
cell belongs to the outer wheel of EM end cap
Definition: CaloDetDescrElement.cxx:122
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloFillRectangularCluster::makeCorrection1
void makeCorrection1(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper, double eta, double phi, const CaloSampling::CaloSample samplings[4]) const
Definition: CaloFillRectangularCluster.cxx:823
CaloCluster::setRawEta
void setRawEta(double eta)
Set raw eta.
Definition: CaloCluster.cxx:1321
CaloCluster::SW_35Econv
@ SW_35Econv
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:96
CaloFillRectangularCluster::m_neta
int m_neta
cluster size. These are properties.
Definition: CaloFillRectangularCluster.h:180
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCluster::SW_35gam
@ SW_35gam
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:92
CaloCluster::getClusterPhiSize
unsigned int getClusterPhiSize() const
Definition: CaloCluster.cxx:1461
xAOD::CaloCluster_v1::et
double et() const
Definition: CaloCluster_v1.h:856
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
CaloCluster::SW_37gam
@ SW_37gam
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:93
xAOD::CaloCluster_v1::phiBE
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:680
xAOD::CaloCluster_v1::setEnergy
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
Definition: CaloCluster_v1.cxx:526
CaloCluster::SW_7_11
@ SW_7_11
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:104
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
xAOD::CaloCluster_v1::setEmax
bool setEmax(const CaloSample sampling, const float eMax)
Set the Energy of the cell with the highest energy in a particular sampling.
Definition: CaloCluster_v1.cxx:571
pi
#define pi
Definition: TileMuonFitter.cxx:65
CaloClusterCorrection::initialize
virtual StatusCode initialize() override
Initialize method.
Definition: CaloClusterCorrection.cxx:47
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
xAOD::CaloCluster_v1::etaSample
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:532
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
xAOD::CaloCluster_v1::setE
void setE(flt_t)
Definition: CaloCluster_v1.cxx:375
xAOD::CaloCluster_v1::setPhimax
bool setPhimax(const CaloSample sampling, const float phiMax)
Set the phi of the cell with the highest energy in a particular sampling.
Definition: CaloCluster_v1.cxx:597
CaloFillRectangularCluster::m_cellsName
SG::ReadHandleKey< CaloCellContainer > m_cellsName
The StoreGate key for the container of our input cells.
Definition: CaloFillRectangularCluster.h:195
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloFillRectangularCluster::m_nphi
int m_nphi
Definition: CaloFillRectangularCluster.h:180
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
CaloClusterCorr::etaphi_range
void etaphi_range(const CaloDetDescrManager &dd_man, double eta, double phi, CaloCell_ID::CaloSample sampling, double &deta, double &dphi)
Return eta/phi ranges encompassing +- 1 cell.
Definition: CaloFillRectangularCluster.cxx:64
xAOD::CaloCluster_v1::phiSample
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:547
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
CaloCluster::setRawE
void setRawE(double e)
Set raw energy.
Definition: CaloCluster.cxx:1320
CaloCluster::SW_softe
@ SW_softe
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:99
CaloCluster::SW_55Econv
@ SW_55Econv
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:95
CaloPhiRange::fix
static double fix(double phi)
Definition: CaloPhiRange.cxx:14
CaloFillRectangularCluster::WindowArray_t
std::array< std::pair< double, double >, 4 > WindowArray_t
Holds the per-layer window sizes.
Definition: CaloFillRectangularCluster.h:122
twopi
constexpr double twopi
Definition: VertexPointEstimator.cxx:16
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloUtils::ToolWithConstants< CaloClusterProcessor >::context
Context context(const EventContext &ctx) const
Create a Context object.
CaloCluster::setRawPhi
void setRawPhi(double phi)
Set raw phi.
Definition: CaloCluster.cxx:1322
CaloClusterCorrection::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: CaloClusterCorrection.h:119
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
CaloClusterCorrection::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *) const =0
CaloFillRectangularCluster::m_setRawState
bool m_setRawState
Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state
Definition: CaloFillRectangularCluster.h:190
xAOD::CaloCluster_v1::eta0
flt_t eta0() const
Returns raw of cluster seed.
CaloCluster::SW_35ele
@ SW_35ele
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:88
CaloCluster::ClusterSize
ClusterSize
enums to identify different cluster size
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:85
CaloCluster::SW_37Econv
@ SW_37Econv
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:97
CaloCluster::setE
virtual void setE(double e)
Set energy.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:767
xAOD::CaloCluster_v1::eSample
float eSample(const CaloSample sampling) const
Definition: CaloCluster_v1.cxx:521
CaloDetDescriptor::calo_eta_min
double calo_eta_min() const
'ideal' geometry: eta minimal
Definition: CaloDetDescriptor.h:558
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCluster::SW_55gam
@ SW_55gam
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:91
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloFillRectangularCluster::m_fill_cluster
bool m_fill_cluster
Fill-cluster flag.
Definition: CaloFillRectangularCluster.h:185
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCluster::setClusterSize
void setClusterSize(unsigned int theClusterSize)
Set cluster size.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:892
xAOD::CaloCluster_v1::setPhi
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
Definition: CaloCluster_v1.cxx:556
CaloDetDescrElement::descriptor
const CaloDetDescriptor * descriptor() const
cell descriptor
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:428
xAOD::CaloCluster_v1::setEtamax
bool setEtamax(const CaloSample sampling, const float etaMax)
Set the eta of the cell with the highest energy in a particular sampling.
Definition: CaloCluster_v1.cxx:584
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloFillRectangularCluster::get_seed
virtual void get_seed(CaloClusterCorr::SamplingHelper &helper, const xAOD::CaloCluster *cluster, double &eta, double &phi) const
Definition: CaloFillRectangularCluster.cxx:1153
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
CaloFillRectangularCluster::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
CaloClusterCorrection virtual method.
xAOD::CaloCluster_v1::setEtasize
bool setEtasize(const CaloSample sampling, const float etaSize)
Set the cluster size in for a given sampling.
Definition: CaloCluster_v1.cxx:611
CaloClusterCorrection
Definition: CaloClusterCorrection.h:55
xAOD::CaloCluster_v1::setEta
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
Definition: CaloCluster_v1.cxx:541
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
xAOD::CaloCluster_v1::hasSampling
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
Definition: CaloCluster_v1.h:890
CaloClusterCorrection::execute
StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override
Definition: CaloClusterCorrection.cxx:53
CaloCluster::SW_37ele
@ SW_37ele
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:89
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
CaloCluster::getClusterEtaSize
unsigned int getClusterEtaSize() const
Definition: CaloCluster.cxx:1439
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
EgEfficiencyCorr_testFixedInput.etas
list etas
Definition: EgEfficiencyCorr_testFixedInput.py:9
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
python.handimod.cc
int cc
Definition: handimod.py:523
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352