|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "CaloDetDescr/CaloDetDescrElement.h"
26 #include "CLHEP/Units/SystemOfUnits.h"
27 #include "CLHEP/Units/PhysicalConstants.h"
35 const double deta = 0.2;
36 const double dphi =
twopi / 64. +
pi / 64.;
79 const double eps = 0.001;
84 eta - elt->
deta() - eps,
88 deta_l = std::abs (eta - elt_l->
eta_raw()) + eps;
93 eta + elt->
deta() + eps,
97 deta_r = std::abs (eta - elt_r->
eta_raw()) + eps;
100 deta = 2 *
std::max (deta_r, deta_l);
110 eta - elt->
deta() - eps,
119 eta + elt->
deta() + eps,
126 dphi = 2 *
std::max (dphi_l, dphi_r);
147 if(dd_man ==
nullptr){
227 bool dofill =
false) = 0;
291 bool allow_badpos =
false);
396 double fallback_eta = eta;
397 double fallback_phi = phi;
398 if ((seteta == -999 || setphi == -999) && fallback_layer >= 0 && fallback_layer < 4) {
407 if (seteta == -999) seteta = fallback_eta;
408 if (setphi == -999) setphi = fallback_phi;
575 bool dofill =
false);
582 virtual bool empty()
const;
701 bool dofill =
false);
707 virtual bool empty()
const;
756 return *std::max_element(std::as_const(*m_cluster).cell_begin(),
757 std::as_const(*m_cluster).cell_end(),
782 (
const std::string&
type,
783 const std::string&
name,
788 declareProperty(
"eta_size",
m_neta = 5);
789 declareProperty(
"phi_size",
m_nphi = 5);
791 declareProperty(
"cells_name",
m_cellsName =
"AllCalo");
810 return StatusCode::SUCCESS;
833 helper.calculate_and_set (
eta,
phi, 2, -1, samplings,
true);
836 double phi2 =
helper.phim();
839 if (phi2 == -999.) phi2 =
phi;
842 helper.calculate_and_set (
eta2, phi2, 1, -1, samplings);
844 double phi1 =
helper.phim();
846 if (
eta1 == -999. || phi1 == -999.) {
849 if (phi1 == -999.) phi1 = phi2;
864 double detastr, dphistr;
869 if (detastr > 0 && dphistr > 0) {
871 detastr, dphistr, samplings[1]);
873 if (
helper.etam()!=-999.) {
875 double eta1r =
helper.etareal();
876 helper.cluster()->setEta(samplings[1], eta1r);
882 helper.calculate_and_set (
eta1, phi2, 0, 1, samplings);
885 helper.calculate_and_set (
eta2, phi2, 3, -1, samplings);
908 <<
"Can't find cell container; cluster does not give a cell container";
919 for ( ; f_cell!=l_cell; ++f_cell)
925 if( fabs(
cell->eta()) < 1.4 || fabs(
cell->eta()) > 1.6 )
continue;
926 double phic =
cell->phi();
927 double etac =
cell->eta();
929 float diffeta = etac-
eta2;
930 float diffphi = phic-phi2;
931 if (diffphi < -
pi) diffphi +=
twopi;
932 if (diffphi >
pi) diffphi -=
twopi;
934 if(fabs(diffeta)<deta && fabs(diffphi)<dphi){
935 eh_scint +=
cell->e();
968 double aeta = fabs(
eta);
1033 samplingPattern |=samplingPattern_b;
1036 samplingPattern |=samplingPattern_e;
1038 if (aeta > 1.37 && aeta < 1.63)
1041 cluster->setSamplingPattern(samplingPattern);
1055 for(
int i=0;
i<4;
i++ ){
1056 cl_ene += cluster->
eSample(samplings_b[
i]);
1057 cl_ene += cluster->
eSample(samplings_e[
i]);
1059 cluster->
setE(cl_ene);
1082 if(!caloDetDescrMgrHandle.isValid()){
1083 ATH_MSG_ERROR (
"Failed to retrieve CaloDetDescrManager : CaloMgr");
1089 if (seg.m_detas2 == 0) {
1094 seg.m_detas2, seg.m_dphis2);
1102 cluster->getOwnCellLinks()->clear();
1107 if (!cchand.isValid()) {
1112 cell_container = cchand.cptr();
1124 CaloCellList cell_list(calodetdescrmgr,cell_container);
1165 double phi_shift = elt->
phi()-elt->
phi_raw();
1166 double eta_shift = elt->
eta()-elt->
eta_raw();
1167 eta = cluster->
eta0()+eta_shift;
1219 (
const std::string&
name)
1221 return this->setProperty (StringProperty (
"cells_name",
name));
1237 const double detas2,
1238 const double dphis2)
const
1243 w[0].first = detas2*neta;
1244 w[0].second = dphis2*4;
1251 w[1].first =
w[0].first;
1252 w[1].second =
w[0].second;
1254 w[2].first = detas2*neta;
1255 w[2].second = dphis2*nphi;
1257 w[3].first = (2*detas2)*(0.5 + (neta/2.));
1258 w[3].second =
w[2].second;
float deta() const
cell deta
double calo_eta_max() const
'ideal' geometry: eta maximal
double m_phim
position from last calculation.
double etam() const
Return the position from the last calculation.
double phimr() const
Similar as phim, etam, phimax, etamax, but with raw quantities.
bool is_lar_em_endcap_inner() const
cell belongs to the inner wheel of EM end cap
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.
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
double phi0() const
Returns raw of cluster seed.
double m_etam
position from last calculation.
Extra patterns decribing particle interation process.
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
SamplingHelper(const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster)
Constructor.
Version of helper class for cells taken from the cluster itself.
Const iterator class for DataVector/DataList.
#define REPORT_ERROR(SC)
Report an error.
list_iterator begin() const
virtual void calculate(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)
Calculate layer variables.
bool is_lar_em_endcap_outer() const
cell belongs to the outer wheel of EM end cap
double phiSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
Scalar phi() const
phi method
SamplingHelper_CaloCellList(const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster, const CaloCellList &list, const CaloCellContainer *cell_container)
Constructor.
void makeCorrection1(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper, double eta, double phi, const CaloSampling::CaloSample samplings[4]) const
void setRawEta(double eta)
Set raw eta.
const_pointer_type cptr()
Dereference the pointer.
Sampling calculator helper class.
CaloFillRectangularCluster()=delete
This isn't allowed.
int m_neta
cluster size. These are properties.
Scalar eta() const
pseudorapidity method
void makeCorrection2(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper) const
double phimax() const
Get maximum value.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
virtual void calculate(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)=0
Calculate layer variables — abstract method.
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
virtual bool empty() const
Test for empty candidate cell list.
virtual const CaloCell * max_et_cell() const =0
Return the cell with the maximum energy — abstract method.
unsigned int getClusterPhiSize() const
setEt setPhi setE277 setWeta2 eta1
Calculates the per-layer position, size, etc. of a cluster. Optionally, fills the cluster with cells ...
const CaloCellContainer * getCellContainer(const CaloCell *pCell) const
Retrieve the pointer to the original cell container for a given cell.
double phis() const
Get the RMS size.
virtual const CaloCell * max_et_cell() const
Return the cell with the maximum energy.
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
const std::string & key() const
Return the StoreGate ID for the referenced object.
double dphi(int layer) const
virtual bool empty() const
Test for empty candidate cell list.
CaloCluster * m_cluster
The cluster we're updating.
void calculate_cluster(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling)
Calculate layer variables for cells in the cluster.
const CaloClusterCorrection & m_parent
The correction object using us.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
virtual StatusCode initialize() override
Initialize method.
float eta_raw() const
cell eta_raw
Helper to compare two cells by Et.
const CaloCellList & m_list
The cell list.
list_iterator end() const
Definition of CaloDetDescriptor.
double etam() const
Data access.
SG::ReadHandleKey< CaloCellContainer > m_cellsName
The StoreGate key for the container of our input cells.
virtual StatusCode initialize() override
Standard Gaudi initialize method.
::StatusCode StatusCode
StatusCode definition for legacy code.
double phimax() const
Return the maximum position from the last calculation.
double etamax() const
Return the maximum position from the last calculation.
Segmentation(const CaloDetDescrManager *dd_man)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
double etaSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
Principal data class for CaloCell clusters.
CaloPhiRange class declaration.
SamplingHelper_Cluster(const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster)
Constructor.
#define CHECK(...)
Evaluate an expression and check for errors.
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.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void setRawE(double e)
Set raw energy.
double etas() const
Get the RMS size.
CaloCluster * cluster()
Return the cluster we're updating.
static double fix(double phi)
Version of helper class for cells taken from StoreGate.
virtual StatusCode setCaloCellContainerName(const std::string &name) override
Change the name of the CaloCellContainer used by this tool.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual bool empty() const =0
Test for empty candidate cell list — abstract method.
virtual void calculate(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)
Calculate layer variables.
double etamax() const
Get maximum value.
std::array< std::pair< double, double >, 4 > WindowArray_t
Holds the per-layer window sizes.
Helpers for checking error return status codes and reporting errors.
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
virtual ~SamplingHelper()=default
Destructor — just to get a vtable.
StatusCode initialize(bool used=true)
void setRawPhi(double phi)
Set raw phi.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Container class for CaloCell.
double deta(int layer) const
double m_detas2
middle layer cell segmentation size
bool m_setRawState
Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state
double emax() const
Get the maximum energy.
float dphi() const
cell dphi
CaloLayerCalculator m_calc
The calculator object.
ClusterSize
enums to identify different cluster size
virtual void setE(double e)
Set energy.
double calo_eta_min() const
'ideal' geometry: eta minimal
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
bool operator()(const CaloCell *a, const CaloCell *b)
bool m_fill_cluster
Fill-cluster flag.
virtual const CaloCell * max_et_cell() const
Return the cell with the maximum energy.
static double et(const CaloCell *cell)
void setClusterSize(unsigned int theClusterSize)
Set cluster size.
CaloFillRectangularCluster::WindowArray_t m_windows
Window size, per layer.
void calculate_and_set(double eta, double phi, int layer, int fallback_layer, const CaloSampling::CaloSample samplings[4], bool allow_badpos=false)
Calculate layer variables and update cluster.
const CaloDetDescriptor * descriptor() const
cell descriptor
double eta0() const
Returns raw of cluster seed.
double phim() const
Get the mean layer value.
float eta() const
cell eta
virtual void get_seed(CaloClusterCorr::SamplingHelper &helper, const xAOD::CaloCluster *cluster, double &eta, double &phi) const
float phi() const
cell phi
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
CaloClusterCorrection virtual method.
Handle class for reading from StoreGate.
const CaloDetDescrElement * get_element_raw(CaloCell_ID::CaloSample sample, double eta, double phi) const
Get element from raw quantities (to build real fixed size clusters)
double phim() const
Return the position from the last calculation.
unsigned int getClusterEtaSize() const
void fill(Iterator beg, Iterator end, double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, xAOD::CaloCluster *tofill=0)
Calculate layer variables from cells in a list.
double em() const
Get the total energy.
float phi_raw() const
cell phi_raw
Calculate total energy, position, etc. for a given layer of a cluster.
int windows(float distance, float eta_pivot, int thr, int sector)