13 const std::vector<std::vector<int> > pat1delta{{-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5},
17 {-4, -3, -2, -1, 0, 1, 2, 3, 4},
18 {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}};
21 const std::vector<std::vector<int> > pat2delta{{3, 4, 5}, {1, 2}, {0}, {-2, -1, 0}, {-4, -3, -2}, {-5, -4, -3}};
24 const std::vector<std::vector<int> > pat3delta{{-5, -4, -3}, {-2, -1}, {0}, {0, 1, 2}, {2, 3, 4}, {3, 4, 5}};
27 const std::vector<std::vector<int> > pat4delta{{2, 3, 4}, {1, 2}, {0}, {-2, -1}, {-4, -3, -2}, {-4, -3, -2}
32 const std::vector<std::vector<int> > pat5delta{{-4, -3, -2}, {-2, -1}, {0}, {1, 2}, {2, 3, 4}, {2, 3, 4}
37 const std::vector<std::vector<int> > pat6delta{{1, 2, 3}, {0, 1}, {0}, {-1, 0}, {-2, -1}, {-3, -2, -1}};
40 const std::vector<std::vector<int> > pat7delta{{-3, -2, -1}, {-1, 0}, {0}, {0, 1}, {1, 2}, {1, 2, 3}};
43 const std::vector<std::vector<int> > pat8delta{{0, 1, 2}, {0, 1}, {0}, {-1, 0}, {-2, -1, 0}, {-2, -1, 0}};
46 const std::vector<std::vector<int> > pat9delta{{-2, -1, 0}, {-1, 0}, {0}, {0, 1}, {0, 1, 2}, {0, 1, 2}};
49 const std::vector<std::vector<int> > patAdelta{{-1, 0, 1}, {0}, {0}, {0}, {-1, 0, 1}, {-1, 0, 1}};
51 const std::vector<std::vector<std::vector<int> > > patIndexToPatternDelta{pat0delta,
72 const auto& compRange = hCSCComparators.get(layerId);
75 for (
auto compDigiItr = compRange.first; compDigiItr != compRange.second; compDigiItr++) {
76 const auto& compDigi = *compDigiItr;
79 const int stubHalfStrip(compDigi.getHalfStrip());
87 compDigis.push_back(compDigi);
102 const auto& detId =
p.first;
105 float radius_tmp = 0.0;
109 if (
p.second.empty())
113 for (
const auto&
hit :
p.second) {
114 const float fractional_strip =
hit.getFractionalStrip();
115 const auto& layer_geo = cscChamber->layer(detId.layer())->
geometry();
116 const float wire = layer_geo->middleWireOfGroup(stub.
getKeyWG() + 1);
119 const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
121 const float gpphi = csc_gp.
phi();
125 phi_tmp += (gpphi - 2 *
M_PI);
126 else if (!
phis_.empty() and gpphi < 0 and phis_[0] > 0 and (gpphi -
phis_[0]) < -
M_PI)
127 phi_tmp += (gpphi + 2 *
M_PI);
129 phi_tmp += (csc_gp.
phi());
132 radius_tmp += csc_gp.
perp();
136 radius_tmp = radius_tmp / (
p.second).
size();
137 radius_ += radius_tmp;
139 zs_.push_back(z_tmp);
142 phi_tmp = phi_tmp / (
p.second).
size();
143 phis_.push_back(phi_tmp);
153 std::vector<float>& fit_phi_layers,
154 std::vector<float>& fit_z_layers,
157 fit_phi_layers.clear();
158 fit_z_layers.clear();
176 const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
189 alpha = csc_gp.
phi();
195 float stripPhiPitch = layer_geo->stripPhiPitch();
204 const float fit_z = cscChamber->layer(
i + 1)->centerOfStrip(20).z();
206 fit_z_layers.push_back(fit_z);
207 fit_phi_layers.push_back(fit_phi);
209 fit_phi_layers.push_back((std::floor(fit_phi / stripPhiPitch) + 0.5) * stripPhiPitch);
216 if (
phis_.size() >= 3) {
217 float Sxx = 0, Sxy = 0, Sx = 0, Sy = 0,
S = 0;
218 for (
unsigned i = 0;
i <
phis_.size(); ++
i) {
220 Sxx +=
zs_[
i] *
zs_[
i] * sigma2_inv;
223 Sy +=
phis_[
i] * sigma2_inv;
226 float delta =
S * Sxx - Sx * Sx;
227 alpha = (Sxx * Sy - Sx * Sxy) / delta;
228 beta = (
S * Sxy - Sx * Sy) / delta;
237 int index =
id.iChamberType() - 1;
245 const std::vector<int>& subpat = patIndexToPatternDelta[
pattern].at(layer - 1);
249 const int halfStripDelta = halfStrip - keyStrip;
250 return (
std::find(subpat.begin(), subpat.end(), halfStripDelta + 1) != subpat.end()
or 251 std::find(subpat.begin(), subpat.end(), halfStripDelta) != subpat.end()
or 252 std::find(subpat.begin(), subpat.end(), halfStripDelta - 1) != subpat.end());
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const std::vector< int > strips_
void getComparatorDigiCoordinates(const CSCDetId &ch_id, const CSCCorrelatedLCTDigi &stub)
const GeomDet * idToDet(DetId) const override
constexpr T normalizedPhi(T phi)
Geom::Phi< T > phi() const
std::vector< CSCComparatorDigi > CSCComparatorDigiContainer
float cscHalfStripWidth(const CSCDetId &id) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Plane & surface() const
The nominal surface of the GeomDet.
const std::vector< float > degrees_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void fit(const CSCDetId &ch_id, const CSCCorrelatedLCTDigi &, const CSCComparatorDigiCollection &, std::vector< float > &fit_phi_layers, std::vector< float > &fit_z_layers, float &keyRadius)
float middleWireOfGroup(int wireGroup) const
Abs< T >::type abs(const T &t)
CSCComparatorDigiContainerIds compDigisIds_
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
void matchingComparatorDigisLCT(const CSCDetId &ch_id, const CSCCorrelatedLCTDigi &, const CSCComparatorDigiCollection &)
std::vector< float > phis_
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
std::vector< float > ephis_
ESHandle< TrackerGeometry > geometry
const CSCGeometry * cscGeometry_
bool comparatorInLCTPattern(int keyStrip, int pattern, int layer, int halfStrip) const
void calculateSlopeIntercept(float &alpha, float &beta)
alpha
zGenParticlesMatch = cms.InputTag(""),
std::vector< float > ezs_
const CSCLayerGeometry * geometry() const