|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include <TGraphErrors.h>
15 #include "CaloDetDescr/CaloDetDescrElement.h"
17 #include "CaloGeoHelpers/CaloSampling.h"
55 if(
m_cells.empty())
return false;
58 if(
ref->IsCompatible(
cell))
return true;
74 if(
m_cells.empty())
return true;
78 if(
cell->getSampling()!=sampling)
return false;
79 if(
cell->eta_raw()*refcell->
eta_raw()<0)
return false;
81 if(TMath::Abs(
cell->deta()-refcell->
deta())>0.001)
return false;
82 if(TMath::Abs(
cell->dphi()-refcell->
dphi())>0.001)
return false;
89 if(TMath::Abs(delta_eta-TMath::Nint(delta_eta)) > 0.01)
return false;
124 if(
cell->getSampling()<21) {
189 if(
size()==0)
return;
196 if(TMath::Abs(rneta)>0.05 || TMath::Abs(rnphi)>0.05) {
197 cout<<
"ERROR: can't map cells into a regular grid for sampling "<<sampling<<
", map index "<<
index()<<endl;
234 cout<<
"Grid: Sampling "<<sampling<<
"_"<<
index()<<
": Already cell found at pos ("<<ieta<<
","<<iphi<<
"): id="
243 cout<<
"Grid: Sampling "<<sampling<<
"_"<<
index()<<
": Cell at pos ("<<ieta<<
","<<iphi<<
"): id="
244 <<refcell->
identify()<<
" outside eta range"<<endl;
253 float abs_dist_eta0=TMath::Abs(dist_eta0);
254 float abs_dist_phi0=TMath::Abs(dist_phi0);
255 return TMath::Max(abs_dist_eta0,abs_dist_phi0)-0.5;
270 float raw_eta=
eta+best_eta_corr;
271 float raw_phi=
phi+best_phi_corr;
278 float bestdist=+10000000;
281 while(newDDE && nsearch<3) {
282 float dist_eta0,dist_phi0;
288 cout<<
"CaloGeometryLookup::getDDE, search iteration "<<nsearch<<endl;
290 cout<<
" input sampling="<<newDDE->
getSampling()<<
" eta="<<newDDE->
eta()<<
" eta_raw="<<newDDE->
eta_raw()<<
" deta="<<newDDE->
deta()<<
" ("<<(newDDE->
eta_raw()-newDDE->
eta())/newDDE->
deta()<<
") phi="<<newDDE->
phi()<<
" phi_raw="<<newDDE->
phi_raw()<<
" dphi="<<newDDE->
dphi()<<
" ("<<(newDDE->
phi_raw()-newDDE->
phi())/newDDE->
dphi()<<
")"<<endl;
291 cout<<
" ieta="<<ieta<<
" iphi="<<iphi<<endl;
292 cout<<
" dist_eta0="<<dist_eta0<<
" ,dist_phi0="<<dist_phi0<<endl;
297 ieta+=TMath::Nint(dist_eta0);
298 iphi+=TMath::Nint(dist_phi0);
304 if(oldDDE==newDDE)
break;
307 cout<<
"CaloGeometryLookup::getDDE, direct search ieta="<<ieta<<
" iphi="<<iphi<<
" is empty"<<endl;
313 if(minieta<0) minieta=0;
315 for(
int iieta=minieta;iieta<=maxieta;++iieta) {
316 for(
int iiphi=miniphi;iiphi<=maxiphi;++iiphi) {
323 float dist_eta0,dist_phi0;
329 cout<<
" input sampling="<<newDDE->
getSampling()<<
" eta="<<newDDE->
eta()<<
" eta_raw="<<newDDE->
eta_raw()<<
" deta="<<newDDE->
deta()<<
" ("<<(newDDE->
eta_raw()-newDDE->
eta())/newDDE->
deta()<<
") phi="<<newDDE->
phi()<<
" phi_raw="<<newDDE->
phi_raw()<<
" dphi="<<newDDE->
dphi()<<
" ("<<(newDDE->
phi_raw()-newDDE->
phi())/newDDE->
dphi()<<
")"<<endl;
330 cout<<
" ieta="<<ieta<<
" iphi="<<iphi<<endl;
331 cout<<
" dist_eta0="<<dist_eta0<<
" ,dist_phi0="<<dist_phi0<<endl;
340 cout<<
"CaloGeometryLookup::getDDE, windows search ieta="<<ieta<<
" iphi="<<iphi<<
" is empty"<<endl;
float deta() const
cell deta
JetConstituentVector::iterator iterator
bool IsCompatible(const CaloDetDescrElement *cell)
MeanAndRMS & add(double xadd, double weight=1)
CaloGeometryLookup(int ind=0)
float m_xy_grid_adjustment_factor
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
bool index_range_adjust(int &ieta, int &iphi) const
const MeanAndRMS & deta()
int raw_phi_position_to_index(float phi_raw) const
__HOSTDEV__ double Phi_mpi_pi(double)
float m_maxphi_correction
float m_maxeta_correction
float eta_raw() const
cell eta_raw
void add(const CaloDetDescrElement *cell)
MeanAndRMS m_eta_correction
Identifier identify() const override final
cell identifier
static const Identifier m_debug_identify
MeanAndRMS m_phi_correction
float m_minphi_correction
bool has_overlap(CaloGeometryLookup *ref)
const MeanAndRMS & dphi()
void merge_into_ref(CaloGeometryLookup *ref)
virtual ~CaloGeometryLookup()
float x_raw() const
cell x_raw
static std::atomic< bool > m_debug
float dphi() const
cell dphi
std::vector< std::vector< const CaloDetDescrElement * > > m_cell_grid
CaloCell_ID::CaloSample getSampling() const
cell sampling
const boost::regex ref(r_ef)
virtual const CaloDetDescrElement * getDDE(float eta, float phi, float *distance=0, int *steps=0)
def delta_phi(phi1, phi2)
t_cellmap::size_type size() const
int cell_grid_eta() const
float m_mineta_correction
int cell_grid_phi() const
float eta() const
cell eta
float phi() const
cell phi
float calculate_distance_eta_phi(const CaloDetDescrElement *DDE, float eta, float phi, float &dist_eta0, float &dist_phi0) const
float y_raw() const
cell y_raw
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
int raw_eta_position_to_index(float eta_raw) const
float phi_raw() const
cell phi_raw