|
|
Go to the documentation of this file.
41 EcalEntrance_(ecalentrance),
254 unsigned size = localCellVector.size();
263 for (
unsigned ic = 0; ic < 8 && ic <
size; ++ic) {
264 unsigned iq = localCellVector[ic];
287 unsigned iquadinside = 999;
300 std::cout <<
" Not found in the cracks " << std::endl;
324 for (
unsigned ic = 0; ic <
ncrystals_; ++ic) {
325 for (
unsigned idir = 0; idir < 4; ++idir) {
335 std::vector<CaloSegment>::const_iterator segiterator;
351 double x0 = segiterator->x0FromCm(dist);
402 std::cout <<
" Problem with the grid " << std::endl;
408 sort(
cp.begin(),
cp.end(), myDistance);
434 if (cmthickness > 0) {
452 if (cmthickness > 0) {
473 if (onHcal <= 2 && onHcal > 0) {
476 double eta = point1.eta();
488 double eta = point1.eta();
506 DetId c_entrance, c_exit;
507 bool entrancefound(
false), exitfound(
false);
519 unsigned ncrystals = (unsigned)(backdistance * 0.45);
520 unsigned highlim = (ncrystals + 4);
527 while (ic <
ncrystals_ && (ic < highlim || !exitfound)) {
540 entrancefound =
true;
565 if (entrancefound && exitfound && c_entrance == c_exit)
568 for (
unsigned iside = 0; iside < 4; ++iside) {
589 unsigned size =
cp.size();
595 unsigned nsegments =
size / 2;
604 unsigned ncrossedxtals = 0;
606 while (is < nsegments) {
607 if (
cp[2 * is].getDetId() !=
cp[2 * is + 1].getDetId() &&
cp[2 * is].whichDetector() !=
DetId::Hcal &&
621 cp[2 * is].whichLayer() == 1) {
623 cp[2 * is + 1].whichLayer() == 1) {
633 std::cout <<
" Strange segment between Preshower1 and " <<
cp[2 * is + 1].whichDetector();
643 cp[2 * is].whichLayer() == 2) {
645 cp[2 * is + 1].whichLayer() == 2) {
656 if (is < (nsegments - 1) &&
cp[2 * is + 2].whichDetector() ==
DetId::Ecal &&
668 std::cout <<
" Strange segment between Preshower2 and " <<
cp[2 * is + 1].whichDetector();
687 if (
cp[2 * is].getDetId() ==
cell2) {
699 std::cout <<
" One more bug in the segment " << std::endl;
703 if (is > 0 && is < nsegments) {
704 DetId cell3 =
cp[2 * is].getDetId();
736 std::cout <<
" Strange segment between " <<
cp[2 * is].whichDetector();
737 std::cout <<
" and " <<
cp[2 * is + 1].whichDetector() << std::endl;
784 myHistos->fill(
"h400", zvertex,
X0ECAL_);
798 std::vector<unsigned>
empty;
801 for (
unsigned inx = 0; inx < (unsigned)
nx_; ++inx) {
809 for (
unsigned ic = 0; ic <
ncrystals_; ++ic) {
847 double locxmin, locxmax, locymin, locymax;
850 std::vector<CaloSegment>::const_iterator segiterator;
866 std::cout <<
" FamosGrid: Could not go at such depth " <<
depth << std::endl;
879 std::cout <<
" In " << segiterator->whichDetector() << std::endl;
909 (
Point)(origin + newaxis),
913 for (
unsigned ic = 0; ic <
ncrystals_; ++ic) {
922 bool hasbeenpulled =
false;
923 bool behindback =
false;
924 for (
unsigned il = 0; il < 4; ++il) {
932 hasbeenpulled =
true;
944 if (
xx.mag2() != 0) {
979 for (
unsigned ic = 0; ic <
ncrystals_; ++ic) {
986 padsatdepth_[ic].extrems(locxmin, locxmax, locymin, locymax);
1011 for (
unsigned ic = 0; ic <
ncrystals_; ++ic) {
1013 for (
unsigned idir = 0; idir < 8; ++idir) {
1024 DetId newcell(oldcell);
1032 std::map<DetId, unsigned>::const_iterator niter(
DetIdMap_.find(newcell));
1068 double dotproduct = normal.Dot(fPoint - origin);
1069 if (dotproduct <= 0.)
1073 fPoint -= (1 + dotproduct) * normal;
1100 for (
unsigned ic = 0; ic <
ncrystals_; ++ic) {
1110 hitMap_.insert(std::pair<CaloHitID, float>(current_id,
hits_[ic]));
1113 hitMap_.insert(std::pair<CaloHitID, float>(current_id,
hits_[ic]));
1128 std::vector<neighbour> gaps;
1129 std::vector<std::vector<neighbour> > cracks;
1133 for (
unsigned iq = 0; iq <
ncrystals_; ++iq) {
1140 for (
unsigned iside = 0; iside < 4; ++iside) {
1146 if (neighbourstatus < 0)
1149 unsigned neighbourNumber =
regionOfInterest_[iq].crystalNeighbour(iside).number();
1153 if (neighbourstatus == 1) {
1155 cracks[iq].push_back(
neighbour(thisside, neighbourNumber));
1158 gaps.push_back(
neighbour(thisside, neighbourNumber));
1166 unsigned ncracks = cracks.size();
1168 for (
unsigned icrack = 0; icrack < ncracks; ++icrack) {
1199 if (
dirs.size() == 1)
1201 if (
dirs.size() % 2 == 0)
1227 unsigned ngaps = gaps.size();
1228 constexpr
bool debug =
false;
1231 std::cout <<
" Avant " << ngaps <<
" " << gaps[0].first << std::endl;
1249 }
else if (ngaps == 2) {
1251 std::cout <<
" Avant " << ngaps <<
" " << gaps[0].first <<
" " << gaps[1].first << std::endl;
1253 std::cout <<
" Voisin 1 " << (gaps[0].second) << std::endl;
1254 std::cout <<
" Voisin 2 " << (gaps[1].second) << std::endl;
1258 CLHEP::Hep2Vector
point(0., 0.);
1267 }
else if (corner0 ==
NONE) {
1294 }
else if (ngaps == 3) {
1296 unsigned iubd, idir1, idir2;
1298 CLHEP::Hep2Vector
point(0., 0.);
1317 }
else if (ngaps == 4) {
1321 CLHEP::Hep2Vector
point(0., 0.);
1337 unsigned ncracks = cracks.size();
1339 for (
unsigned ic = 0; ic < ncracks; ++ic) {
1342 switch (cracks[ic].
first) {
1383 XYZVector crossproduct(0., 0., 0.), previouscrossproduct(0., 0., 0.);
1385 for (
unsigned ip = 0; ip < 4; ++ip) {
1388 previouscrossproduct = crossproduct;
1389 else if (crossproduct.Dot(previouscrossproduct) < 0.)
CaloDirection
Codes the local directions in the cell lattice.
double outsideWindowEnergy_
CLHEP::Hep2Vector & correspondingEdge(neighbour &myneighbour, CaloDirection dir2)
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
static Histos * instance()
void preshowerCellLine(std::vector< CaloPoint > &cp) const
bool getCrystalWindow(unsigned, std::vector< unsigned > &) const
get the ordered list of the crystals around the crystal given as a first argument
void gapsLifting(std::vector< neighbour > &gaps, unsigned iq)
void setTrackParameters(const XYZNormal &normal, double X0depthoffset, const FSimTrack &theTrack)
std::vector< XYZPoint > corners
const PreshowerLayer2Properties * layer2Properties(int onLayer2) const
Preshower Layer2 properties.
const XYZTLorentzVector & vertex() const
the vertex fourvector
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
ROOT::Math::Plane3D Plane3D
CrystalWindowMap * myCrystalWindowMap_
ROOT::Math::Transform3DPJ Transform3DR
bool diagonalEdge(unsigned myPad, CaloDirection dir, CLHEP::Hep2Vector &point)
void buildSegments(const std::vector< CaloPoint > &cp)
double thickness(double eta) const override
const RawParticle & layer2Entrance() const
The particle at Preshower Layer 2.
static CaloDirection add2d(const CaloDirection &dir1, const CaloDirection &dir2)
std::vector< bool > validPads_
const PreshowerLayer1Properties * layer1Properties(int onLayer1) const
Preshower Layer1 properties.
bool getPads(double depth, bool inCm=false)
unsigned ncrackpadsatdepth_
std::vector< CrystalPad > padsatdepth_
static unsigned oppositeDirection(unsigned iside)
const FSimTrack * myTrack_
bool addHit(double r, double phi, unsigned layer=0) override
ROOT::Math::Plane3D::Vector Vector
const DetId & getDetId() const
get the DetId
Sin< T >::type sin(const T &t)
bool unbalancedDirection(const std::vector< neighbour > &dirs, unsigned &unb, unsigned &dir1, unsigned &dir2)
const EcalEndcapGeometry * getEcalEndcapGeometry() const
DetId getClosestCell(const XYZPoint &point, bool ecal, bool central) const
Cos< T >::type cos(const T &t)
void hcalCellLine(std::vector< CaloPoint > &cp) const
static unsigned neighbourDirection(const CaloDirection &side)
unsigned int -> Direction for the neighbours
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
virtual double thickness(double eta) const =0
Thickness (in cm) of the homegeneous material as a function of rapidity.
CLHEP::Hep2Vector & edge(unsigned iside, int n)
access to the corners in direction iside; n=0,1
math::XYZVector XYZNormal
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
double L0length() const
length of the segment (in L9)
std::vector< CLHEP::Hep2Vector > mycorners
static CaloDirection Side(unsigned i)
unsigned int -> Side conversion
Geom::Theta< T > theta() const
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
XYZVector Vect() const
the momentum threevector
static XYZPoint intersect(const Plane3D &p, const XYZPoint &a, const XYZPoint &b, double &t, bool segment, bool debug=false)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< DetId > CellsWindow_
std::vector< Crystal > regionOfInterest_
bool pulled(const XYZPoint &origin, const XYZNormal &normal, XYZPoint &fPoint) const
Structure Point Contains parameters of Gaussian fits to DMRs.
double pulledPadProbability_
void cellLine(std::vector< CaloPoint > &cp)
const FSimVertex vertex() const
Origin vertex.
std::vector< CaloSegment > segments_
void buildCrystal(const DetId &id, Crystal &) const
const math::XYZTLorentzVector & position() const
Temporary (until CMSSW moves to Mathcore) - No ! Actually very useful.
void setSurvivalProbability(double val)
std::map< DetId, unsigned > DetIdMap_
Tan< T >::type tan(const T &t)
std::vector< float > hits_
bool inside3D(const std::vector< XYZPoint > &, const XYZPoint &p) const
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
void getWindow(const DetId &pivot, int s1, int s2, std::vector< DetId > &) const
void cracksPads(std::vector< neighbour > &cracks, unsigned iq)
void ecalCellLine(const XYZPoint &, const XYZPoint &, std::vector< CaloPoint > &cp)
bool borderCrossing(const DetId &, const DetId &) const
double crackPadProbability_
void convertIntegerCoordinates(double x, double y, unsigned &ix, unsigned &iy) const
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.
double ecalTotalX0() const
in the ECAL
const RandomEngineAndDistribution * random
std::vector< CaloPoint > intersections_
double flatShoot(double xmin=0.0, double xmax=1.0) const
bool hitmaphasbeencalculated_
const CaloGeometryHelper * myCalorimeter
std::vector< CrystalPad > crackpadsatdepth_
bool addHitDepth(double r, double phi, double depth=-1)
const XYZVector & getFirstEdge() const
Direction of the first edge.
std::pair< CaloDirection, unsigned > neighbour
void prepareCrystalNumberArray()
double length() const
length of the segment (in cm)
ROOT::Math::Plane3D Plane3D
std::map< CaloHitID, float > hitMap_
double magneticField() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
bool move(DetId &cell, const CaloDirection &dir, bool fast=true) const
double thickness(const double eta) const override
double radiusCorrectionFactor_
*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
EcalHitMaker(CaloGeometryHelper *calo, const XYZPoint &ecalentrance, const DetId &cell, int onEcal, unsigned size, unsigned showertype, const RandomEngineAndDistribution *engine)
ROOT::Math::Plane3D::Point Point
int hashedIndex(int ieta, int iphi)
double X0length() const
length of the segment (in X0)
math::XYZVector XYZVector
const CaloSubdetectorGeometry * getEcalGeometry(int subdetn) const
static constexpr float d1
std::vector< std::vector< unsigned > > myCrystalNumberArray_
unsigned fastInsideCell(const CLHEP::Hep2Vector &point, double &sp, bool debug=false)
static CaloDirection oppositeSide(const CaloDirection &side)
const std::map< CaloHitID, float > & getHits() override
This class is used to determine if a point lies in the segment.