34 const std::vector<CLHEP::Hep2Vector>& corners)
39 survivalProbability_(1.),
47 std::cout <<
" Try to construct a quadrilateral with " << corners.size() <<
" points ! " << std::endl;
54 for(
unsigned ic=0; ic<4;++ic)
56 dir_[ic] = (corners[(ic+1)%4]-corners[ic]).unit();
67 const std::vector<XYZPoint>& corners,
75 survivalProbability_(1.),
83 std::cout <<
" Try to construct a quadrilateral with " << corners.size() <<
" points ! " << std::endl;
89 double sign=(onEcal==1) ? -1.: 1.;
100 for(
unsigned ic=0;ic<4;++ic)
105 corners_[ic] = CLHEP::Hep2Vector(corner.X(),corner.Y());
108 for(
unsigned ic=0;ic<4;++ic)
122 const std::vector<XYZPoint>& corners,
123 const Transform3D & trans,
double scaf,
bool bothdirections)
128 survivalProbability_(1.),
135 if(corners.size()!=4)
137 std::cout <<
" Try to construct a quadrilateral with " << corners.size() <<
" points ! " << std::endl;
148 for(
unsigned ic=0;ic<4;++ic)
157 for(
unsigned ic=0;ic<4;++ic)
175 CLHEP::Hep2Vector pv0(ppoint-
corners_[0]);
176 CLHEP::Hep2Vector pv2(ppoint-
corners_[2]);
177 CLHEP::Hep2Vector n1(pv0-(pv0*
dir_[0])*dir_[0]);
178 CLHEP::Hep2Vector n2(pv2-(pv2*dir_[2])*dir_[2]);
183 bool inside1(r1<=0.);
185 if (!inside1)
return false;
199 CLHEP::Hep2Vector pv1(ppoint-
corners_[1]);
200 CLHEP::Hep2Vector pv3(ppoint-
corners_[3]);
201 CLHEP::Hep2Vector n3(pv1-(pv1*dir_[1])*dir_[1]);
202 CLHEP::Hep2Vector n4(pv3-(pv3*dir_[3])*dir_[3]);
207 bool inside2(r2<=0.);
286 std::cout <<
" Serious problem in CrystalPad ! " << dir << std::endl;
299 for(
unsigned ic=0;ic<4;++ic)
312 center_ = CLHEP::Hep2Vector(0.,0.);
318 for(
unsigned ic=0;ic<4;++ic)
325 ost <<
" Number " << quad.
getNumber() << std::endl ;
double survivalProbability_
ROOT::Math::Rotation3D rotation_
bool inside(const CLHEP::Hep2Vector &point, bool debug=false) const
Check that the point (in the local frame) is inside the crystal.
ROOT::Math::Transform3DPJ::Point Point
void resetCorners()
Rescale the Quad to allow for some inaccuracy ...
CLHEP::Hep2Vector & edge(unsigned iside, int n)
access to the corners in direction iside; n=0,1
std::ostream & operator<<(std::ostream &out, const ALILine &li)
CrystalPad & operator=(const CrystalPad &rhs)
void getDrawingCoordinates(std::vector< float > &x, std::vector< float > &y) const
for graphic debugging
static std::vector< CLHEP::Hep2Vector > aVector
ROOT::Math::Transform3DPJ Transform3D
unsigned getNumber() const
access to the number
std::vector< CLHEP::Hep2Vector > dir_
math::XYZVector XYZVector
std::vector< CLHEP::Hep2Vector > corners_
CLHEP::Hep2Vector center_
void extrems(double &xmin, double &xmax, double &ymin, double &ymax) const
xmin xmax, ymin ymax of the quad
CaloDirection
Codes the local directions in the cell lattice.