55 LogDebug(
"CaloGeometryTools") <<
" No preshower present" << std::endl;
75 if(result.
null())
return result;
78 float deltaeta2 = ip.
eta()-cc.eta();
79 deltaeta2 *= deltaeta2;
80 float deltaphi2 = acos(
cos(ip.
phi()-cc.phi()));
81 deltaphi2 *= deltaphi2;
107 if ( fabs(point.Z()) > 1132. ) {
120 if(myDetId.
depth()==3)
return result;
127 else if(ieta>=18 && ieta<=26)
133 bool layer2=(fabs(point.Z())>azmin);
150 float deltaeta2 = ip.
eta()-cc.eta();
151 deltaeta2 *= deltaeta2;
152 float deltaphi2 = acos(
cos(ip.
phi()-cc.phi()));
153 deltaphi2 *= deltaphi2;
169 sort(vec.begin(),vec.end(),
distance);
200 unsigned size=vec.size();
201 for(
unsigned ic=0; ic<
size; ++ic)
206 unsigned nneighbours=neighbours.size();
209 if(hashedindex>=nbarrel)
211 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
224 for(
unsigned in=0;
in<nneighbours;++
in)
227 if(neighbours[
in]!=vec[ic])
237 DetId central(vec[ic]);
239 for(
unsigned idir=0;idir<8;++idir)
241 DetId testid=central;
242 bool status=
move(testid,orderedDir[idir],
false);
262 for(
unsigned ic=0; ic<
size; ++ic)
266 unsigned nneighbours=neighbours.size();
270 if(hashedindex>=nendcap)
272 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
279 for(
unsigned in=0;
in<nneighbours;++
in)
282 if(neighbours[
in]!=vece[ic])
291 DetId central(vece[ic]);
293 for(
unsigned idir=0;idir<8;++idir)
295 DetId testid=central;
296 bool status=
move(testid,orderedDir[idir],
false);
314 DetId originalcell = cell;
315 if(dir==
NONE || cell==
DetId(0))
return false;
320 static const int calodirections[9]={-1,1,2,0,4,3,7,5,6};
349 std::vector<DetId> neighbours;
355 if(neighbours.size()>0 && !neighbours[0].null())
357 cell = neighbours[0];
441 return (cc1.
im()!=cc2.
im()||cc1.
ism()!=cc2.
ism() );
461 unsigned size=vec.size();
463 for(
unsigned ic=0; ic<
size; ++ic)
483 for(
unsigned ic=0; ic<
size; ++ic)
virtual DetId getClosestCell(const GlobalPoint &r) const
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
virtual DetId getClosestCell(const GlobalPoint &r) const
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)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const CaloSubdetectorGeometry * getEcalGeometry(int subdetn) const
bool neighbourmapcalculated_
U second(std::pair< T, U > const &p)
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.
int depth() const
get the tower depth
void buildNeighbourArray()
Cos< T >::type cos(const T &t)
int ieta() const
get the cell ieta
std::vector< BaseCrystal > endcapCrystals_
static Histos * instance()
const EcalBarrelGeometry * EcalBarrelGeometry_
const CaloSubdetectorTopology * getEcalTopology(int subdetn) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< NeiVect > barrelNeighbours_
int ietaAbs() const
get the absolute value of the cell ieta
virtual DetId getClosestCell(const GlobalPoint &r) const
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
void getWindow(const DetId &pivot, int s1, int s2, std::vector< DetId > &) const
bool null() const
is this a null id ?
const CaloSubdetectorGeometry * HcalGeometry_
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
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 XYZPoint &point, bool ecal, bool central) const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
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