Definition at line 51 of file CSCSegAlgoShowering.cc.
References CSCSegFit::chi2(), compareProtoSegment(), CSCSegFit::covarianceMatrix(), CSCRecHit2D::cscDetId(), alignCSCRings::d_x, alignCSCRings::d_y, mps_update::diff, dPhi(), runTauDisplay::gp, CSCSegFit::hits(), i, hcalTTPDigis_cfi::id, training_settings::idx, CSCSegFit::intercept(), isHitNearSegment(), CSCChamber::layer(), CSCDetId::layer(), CSCSegFit::localdir(), CSCRecHit2D::localPosition(), PV3DBase< T, PVType, FrameType >::mag(), maxDPhi, maxDTheta, gen::n, CSCSegFit::nhits(), Geom::Phi< T >::phi(), PV3DBase< T, PVType, FrameType >::phi(), protoSegment, pruneFromResidual(), groupFilesInBlocks::reverse, sfit_, groupFilesInBlocks::temp, theChamber, PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), GeomDet::toLocal(), updateParameters(), x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by CSCSegAlgoST::buildSegments(), and CSCSegAlgoDF::buildSegments().
55 std::vector<float>
x,
y, gz;
59 for (
int i = 0;
i < 6; ++
i) {
67 for (ChamberHitContainer::const_iterator it =
rechits.begin(); it !=
rechits.end(); ++it ) {
70 int l_id =
id.
layer();
78 gz[l_id -1] += gp.
z();
83 float avgChamberX = 0.;
84 float avgChamberY = 0.;
87 for (
unsigned i = 0;
i < 6; ++
i) {
88 if (n[
i] < 1 )
continue;
99 avgChamberX = avgChamberX / n_lay;
100 avgChamberY = avgChamberY / n_lay;
106 LocalPoint lpCOM(avgChamberX, avgChamberY, 0.);
110 float Gdxdz = gpCOM.
x()/gpCOM.
z();
111 float Gdydz = gpCOM.
y()/gpCOM.
z();
115 std::vector<LocalPoint> layerPoints;
117 for (
size_t i = 0;
i!=6; ++
i) {
122 float layer_Z = gp.
z();
125 float layer_X = Gdxdz * layer_Z;
126 float layer_Y = Gdydz * layer_Z;
130 float layerX = Lintersect.
x();
131 float layerY = Lintersect.
y();
132 float layerZ = Lintersect.
z();
133 LocalPoint layerPoint(layerX, layerY, layerZ);
134 layerPoints.push_back(layerPoint);
138 std::vector<float> r_closest;
140 for (
size_t i = 0;
i!=6; ++
i ) {
142 r_closest.push_back(9999.);
148 for (ChamberHitContainer::const_iterator it =
rechits.begin(); it !=
rechits.end(); ++it ) {
156 float d_x = lp.
x() - layerPoints[layId-1].x();
157 float d_y = lp.
y() - layerPoints[layId-1].y();
161 if ( fabs(
diff.mag() ) < r_closest[layId-1] ) {
162 r_closest[layId-1] = fabs(
diff.mag());
173 for (ChamberHitContainer::const_iterator it =
rechits.begin(); it !=
rechits.end(); ++it ) {
184 if ( gz[0] > gz[5] ) {
188 else if ( gz[0] < 0. ) {
189 if ( gz[0] < gz[5] ) {
201 for (ChamberHitContainer::const_iterator it =
rechits.begin(); it !=
rechits.end(); it++ ) {
214 double protoTheta = protoGlobalDir.
theta();
215 double protoPhi = protoGlobalDir.
phi();
216 double simTheta = gvCOM.theta();
217 double simPhi = gvCOM.phi();
219 float dTheta = fabs(protoTheta - simTheta);
220 float dPhi = fabs(protoPhi - simPhi);
227 double theFlag = -1.;
CSCSetOfHits hits(void) const
CSCDetId cscDetId() const
void updateParameters(void)
LocalVector localdir() const
void compareProtoSegment(const CSCRecHit2D *h, int layer)
bool isHitNearSegment(const CSCRecHit2D *h) const
Utility functions.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Geom::Theta< T > theta() const
double dPhi(double phi1, double phi2)
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
AlgebraicSymMatrix covarianceMatrix(void)
LocalPoint intercept() const
LocalPoint localPosition() const
const CSCChamber * theChamber
ChamberHitContainer protoSegment
void pruneFromResidual(void)