1 #include "../interface/EcalClusterLocal.h"
25 assert(bclus.hitsAndFractions().at(0).first.subdetId()==
EcalBarrel);
33 double Theta = -position_.theta()+0.5*
TMath::Pi();
34 double Eta = position_.eta();
39 const float X0 = 0.89;
const float T0 = 7.4;
40 double depth = X0 * (T0 +
log(bclus.energy()));
43 std::vector< std::pair<DetId, float> > crystals_vector = bclus.hitsAndFractions();
47 for (
unsigned int icry=0; icry!=crystals_vector.size(); ++icry) {
53 double EtaCentr = center_pos.
eta();
59 crystalseed = crystal;
64 ieta = crystalseed.
ieta();
65 iphi = crystalseed.
iphi();
71 thetatilt = cpyr->getThetaAxis();
72 phitilt = cpyr->getPhiAxis();
80 if (ieta<0) phicry *= -1.;
83 double ThetaWidth = (
TMath::Pi()/180.)*TMath::Cos(ThetaCentr);
84 etacry = (Theta-ThetaCentr)/ThetaWidth;
86 if (ieta<0) etacry *= -1.;
95 assert(bclus.hitsAndFractions().at(0).first.subdetId()==
EcalEndcap);
104 double Eta = position_.eta();
106 double X = position_.x();
107 double Y = position_.y();
111 const float X0 = 0.89;
float T0 = 1.2;
113 if (TMath::Abs(bclus.eta())<1.653) T0 = 3.1;
115 double depth = X0 * (T0 +
log(bclus.energy()));
118 std::vector< std::pair<DetId, float> > crystals_vector = bclus.hitsAndFractions();
122 for (
unsigned int icry=0; icry!=crystals_vector.size(); ++icry) {
128 double EtaCentr = center_pos.
eta();
134 crystalseed = crystal;
139 ix = crystalseed.
ix();
140 iy = crystalseed.
iy();
146 thetatilt = cpyr->getThetaAxis();
147 phitilt = cpyr->getPhiAxis();
151 double XCentr = center_pos.
x();
152 double XWidth = 2.59;
153 xcry = (X-XCentr)/XWidth;
156 double YCentr = center_pos.
y();
157 double YWidth = 2.59;
158 ycry = (Y-YCentr)/YWidth;
Geom::Phi< T > phi() const
double Phi_mpi_pi(double x)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Geom::Theta< T > theta() const
int iphi() const
get the crystal iphi
void localCoordsEE(const reco::BasicCluster &bclus, const edm::EventSetup &es, float &xcry, float &ycry, int &ix, int &iy, float &thetatilt, float &phitilt) const
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
int ieta() const
get the crystal ieta
XYZPointD XYZPoint
point in space with cartesian internal representation
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
void localCoordsEB(const reco::BasicCluster &bclus, const edm::EventSetup &es, float &etacry, float &phicry, int &ieta, int &iphi, float &thetatilt, float &phitilt) const