49 std::vector<float>
x,
y, gz;
52 for (
int i = 0;
i < 6; ++
i) {
63 int l_id =
id.layer();
69 x[l_id - 1] += lp.
x();
70 y[l_id - 1] += lp.
y();
71 gz[l_id - 1] +=
gp.z();
75 float avgChamberX = 0.;
76 float avgChamberY = 0.;
79 for (
unsigned i = 0;
i < 6; ++
i) {
91 avgChamberX = avgChamberX / n_lay;
92 avgChamberY = avgChamberY / n_lay;
98 LocalPoint lpCOM(avgChamberX, avgChamberY, 0.);
102 float Gdxdz = gpCOM.
x() / gpCOM.
z();
103 float Gdydz = gpCOM.
y() / gpCOM.
z();
107 std::vector<LocalPoint> layerPoints;
109 for (
size_t i = 0;
i != 6; ++
i) {
114 float layer_Z =
gp.z();
117 float layer_X = Gdxdz * layer_Z;
118 float layer_Y = Gdydz * layer_Z;
122 float layerX = Lintersect.
x();
123 float layerY = Lintersect.
y();
124 float layerZ = Lintersect.
z();
125 LocalPoint layerPoint(layerX, layerY, layerZ);
126 layerPoints.push_back(layerPoint);
129 std::vector<float> r_closest;
131 for (
size_t i = 0;
i != 6; ++
i) {
133 r_closest.push_back(9999.);
141 int layId =
hit.cscDetId().layer();
147 float d_x = lp.
x() - layerPoints[layId - 1].x();
148 float d_y = lp.
y() - layerPoints[layId - 1].y();
152 if (fabs(
diff.mag()) < r_closest[layId - 1]) {
153 r_closest[layId - 1] = fabs(
diff.mag());
166 int layId =
hit.cscDetId().layer();
168 if (
idx ==
id[layId - 1])
179 }
else if (gz[0] < 0.) {
195 int layer =
h->cscDetId().layer();
208 double protoTheta = protoGlobalDir.
theta();
209 double protoPhi = protoGlobalDir.
phi();
210 double simTheta = gvCOM.theta();
211 double simPhi = gvCOM.phi();
213 float dTheta = fabs(protoTheta - simTheta);
214 float dPhi = fabs(protoPhi - simPhi);
221 double theFlag = -1.;
244 double Hphi = Hgp.
phi();
254 double Sphi = Sgp.
phi();
257 double R =
sqrt(Sgp.
x() * Sgp.
x() + Sgp.
y() * Sgp.
y());
304 ChamberHitContainer::iterator
it;
306 if ((*it)->cscDetId().layer() ==
layer) {
338 float maxResidual = 0.;
339 float sumResidual = 0.;
342 ChamberHitContainer::iterator ih;
343 ChamberHitContainer::iterator ibad =
protoSegment.end();
360 sumResidual += residual;
362 if (residual > maxResidual) {
363 maxResidual = residual;
368 float corrAvgResidual = (sumResidual - maxResidual) / (
nHits - 1);
T getParameter(std::string const &) const
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
void updateParameters(void)
void compareProtoSegment(const CSCRecHit2D *h, int layer)
virtual ~CSCSegAlgoShowering()
Destructor.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
CSCSegment showerSeg(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
Geom::Phi< T > phi() const
LocalPoint intercept() const
float yfit(float z) const
bool addHit(const CSCRecHit2D *hit, int layer)
CSCSegAlgoShowering(const edm::ParameterSet &ps)
Constructor.
std::vector< const CSCRecHit2D * > ChamberHitContainer
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
AlgebraicSymMatrix covarianceMatrix(void)
float xfit(float z) const
LocalVector localdir() const
CSCSetOfHits hits(void) const
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
bool isHitNearSegment(const CSCRecHit2D *h) const
Utility functions.
float Rdev(float x, float y, float z) const
const CSCChamber * theChamber
ChamberHitContainer protoSegment
void pruneFromResidual(void)
Geom::Theta< T > theta() const