14 const std::vector<std::vector<int> > pat1delta {
15 {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5},
19 {-4, -3, -2, -1, 0, 1, 2, 3, 4},
20 {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}
24 const std::vector<std::vector<int> > pat2delta {
34 const std::vector<std::vector<int> > pat3delta {
44 const std::vector<std::vector<int> > pat4delta {
55 const std::vector<std::vector<int> > pat5delta {
66 const std::vector<std::vector<int> > pat6delta {
76 const std::vector<std::vector<int> > pat7delta {
86 const std::vector<std::vector<int> > pat8delta {
96 const std::vector<std::vector<int> > pat9delta {
106 const std::vector<std::vector<int> > patAdelta {
115 const std::vector< std::vector<std::vector<int> > > patIndexToPatternDelta {
116 pat0delta, pat1delta, pat2delta, pat3delta, pat4delta, pat5delta, pat6delta, pat7delta, pat8delta, pat9delta, patAdelta
127 const auto& compRange = hCSCComparators.get(layerId);
130 for (
auto compDigiItr = compRange.first; compDigiItr != compRange.second; compDigiItr++) {
131 const auto& compDigi = *compDigiItr;
134 const int stubHalfStrip(compDigi.getHalfStrip());
141 compDigis.push_back(compDigi);
157 const auto& detId =
p.first;
160 float radius_tmp = 0.0;
164 if (
p.second.empty())
continue;
167 for (
const auto&
hit:
p.second) {
168 const float fractional_strip =
hit.getFractionalStrip();
169 const auto& layer_geo = cscChamber->layer(detId.layer())->
geometry();
170 const float wire = layer_geo->middleWireOfGroup(stub.
getKeyWG() + 1);
173 const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
175 const float gpphi = csc_gp.
phi();
179 phi_tmp += (gpphi-2*
M_PI);
180 else if (!
phis_.empty() and gpphi<0 and phis_[0]>0 and (gpphi-
phis_[0])<-
M_PI)
181 phi_tmp += (gpphi+2*
M_PI);
183 phi_tmp += (csc_gp.
phi());
186 radius_tmp += csc_gp.
perp();
190 radius_tmp = radius_tmp/(
p.second).
size();
191 radius_ += radius_tmp;
193 zs_.push_back(z_tmp);
196 phi_tmp = phi_tmp/(
p.second).
size();
197 phis_.push_back(phi_tmp);
206 std::vector<float>& fit_phi_layers,
207 std::vector<float>& fit_z_layers,
float& keyRadius)
210 fit_phi_layers.clear();
211 fit_z_layers.clear();
229 const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
242 alpha = csc_gp.
phi();
248 float stripPhiPitch = layer_geo->stripPhiPitch();
257 const float fit_z = cscChamber->layer(
i+1)->centerOfStrip(20).z();
259 fit_z_layers.push_back(fit_z);
260 fit_phi_layers.push_back(fit_phi);
262 fit_phi_layers.push_back((std::floor(fit_phi/stripPhiPitch) + 0.5)*stripPhiPitch);
270 if (
phis_.size()>=3) {
272 float Sxx = 0, Sxy = 0, Sx = 0, Sy = 0,
S = 0;
273 for (
unsigned i = 0;
i<
phis_.size(); ++
i){
278 Sy +=
phis_[
i] * sigma2_inv;
281 float delta =
S * Sxx - Sx * Sx;
282 alpha = (Sxx * Sy - Sx * Sxy) / delta;
283 beta = (
S * Sxy - Sx * Sy) / delta;
286 alpha = -99; beta= 0.0;
294 int index =
id.iChamberType()-1;
304 const std::vector<int>& subpat = patIndexToPatternDelta[
pattern].at(layer-1);
308 const int halfStripDelta = halfStrip - keyStrip;
309 return (
std::find(subpat.begin(), subpat.end(), halfStripDelta+1) != subpat.end()
or 310 std::find(subpat.begin(), subpat.end(), halfStripDelta) != subpat.end()
or 311 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
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)
std::vector< float > ezs_
const CSCLayerGeometry * geometry() const