56 LogDebug(
"CaloGeometryTools") <<
" No preshower present" << std::endl;
76 if(result.
null())
return result;
79 float deltaeta2 = ip.
eta()-cc.eta();
80 deltaeta2 *= deltaeta2;
81 float deltaphi2 = acos(
cos(ip.
phi()-cc.phi()));
82 deltaphi2 *= deltaphi2;
108 if ( fabs(point.Z()) > 1132. ) {
152 float deltaeta2 = ip.
eta()-cc.eta();
153 deltaeta2 *= deltaeta2;
154 float deltaphi2 = acos(
cos(ip.
phi()-cc.phi()));
155 deltaphi2 *= deltaphi2;
202 unsigned size=vec.size();
203 for(
unsigned ic=0; ic<
size; ++ic)
208 unsigned nneighbours=neighbours.size();
211 if(hashedindex>=nbarrel)
213 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
226 for(
unsigned in=0;
in<nneighbours;++
in)
229 if(neighbours[
in]!=vec[ic])
241 for(
unsigned idir=0;idir<8;++idir)
244 bool status=
move(testid,orderedDir[idir],
false);
264 for(
unsigned ic=0; ic<
size; ++ic)
268 unsigned nneighbours=neighbours.size();
272 if(hashedindex>=nendcap)
274 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
281 for(
unsigned in=0;
in<nneighbours;++
in)
284 if(neighbours[
in]!=vece[ic])
295 for(
unsigned idir=0;idir<8;++idir)
298 bool status=
move(testid,orderedDir[idir],
false);
316 DetId originalcell = cell;
317 if(dir==
NONE || cell==
DetId(0))
return false;
322 static const int calodirections[9]={-1,1,2,0,4,3,7,5,6};
351 std::vector<DetId> neighbours;
357 if ((!neighbours.empty()) && (!neighbours[0].null()))
359 cell = neighbours[0];
443 return (cc1.
im()!=cc2.
im()||cc1.
ism()!=cc2.
ism() );
463 unsigned size=vec.size();
464 for(
unsigned ic=0; ic<
size; ++ic)
484 for(
unsigned ic=0; ic<
size; ++ic)
int hashedIndex() const
get a compact index for arrays
void setCorners(const CaloCellGeometry::CornersVec &vec, const GlobalPoint &pos)
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
void buildCrystal(const DetId &id, Crystal &) const
DetId getClosestCell(const GlobalPoint &r) const override
constexpr bool null() const
is this a null id ?
const EcalEndcapGeometry * EcalEndcapGeometry_
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
const EcalPreshowerGeometry * getEcalPreshowerGeometry() const
const CaloSubdetectorTopology * EcalEndcapTopology_
std::vector< NeiVect > endcapNeighbours_
bool borderCrossing(const DetId &, const DetId &) const
int ism() const
get the ECAL/SM id
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
const CaloSubdetectorGeometry * getEcalGeometry(int subdetn) const
bool neighbourmapcalculated_
static const CaloDirection orderedDir[8]
int im() const
get the number of module inside the SM (1-4)
int hashedIndex(int ieta, int iphi)
void fill(const std::string &name, float val1, float val2=1., float val3=1.)
Fill an histogram.
void buildNeighbourArray()
Cos< T >::type cos(const T &t)
int ieta() const
get the cell ieta
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< BaseCrystal > endcapCrystals_
static Histos * instance()
const EcalBarrelGeometry * EcalBarrelGeometry_
const CaloSubdetectorTopology * getEcalTopology(int subdetn) const
std::vector< NeiVect > barrelNeighbours_
int iphi() const
get the cell iphi
bool diagonalmove(DetId &cell, const CaloDirection &dir) const
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
std::array< DetId, 8 > NeiVect
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
void getWindow(const DetId &pivot, int s1, int s2, std::vector< DetId > &) const
const CaloSubdetectorGeometry * HcalGeometry_
T perp() const
Magnitude of transverse component.
const CaloSubdetectorTopology * EcalBarrelTopology_
std::vector< BaseCrystal > barrelCrystals_
CaloDirection
Codes the local directions in the cell lattice.
DetId getClosestCell(const GlobalPoint &r) const override
DetId getClosestCell(const XYZPoint &point, bool ecal, bool central) const
void initialize(double bField)
bool simplemove(DetId &cell, const CaloDirection &dir) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
const NeiVect & getNeighbours(const DetId &det) const
bool move(DetId &cell, const CaloDirection &dir, bool fast=true) const