41 theSync->setES(
setup);
43 magField = &
setup.getData(magFieldToken_);
54 if (!
layer->specificTopology().isWireValid(wireId.wire()))
56 LocalPoint locWirePos(
layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
69 angle = atan(lDirLoc.
x() / -lDirLoc.
z());
83 if (!
layer->specificTopology().isWireValid(wireId.
wire()))
103 const float digiTime,
112 float driftTime = digiTime - theSync->offset(
layer, wireId, globPos);
115 if (
step == 1 && (driftTime < minTime || driftTime >
maxTime)) {
117 cout <<
"*** Drift time out of window for in-time hits " << driftTime << endl;
147 cout <<
"[DTParametrizedDriftAlgo]*** WARNING: call to parametrization failed" << endl;
157 bool variableSigma =
false;
175 reso = (sigma_l + sigma_r) / 2.;
181 }
else if (
wheel == 1) {
183 }
else if (
wheel == 2) {
187 }
else if (
step == 2) {
188 reso = (sigma_l + sigma_r) / 2.;
194 }
else if (
wheel == 1) {
196 }
else if (
wheel == 2) {
200 }
else if (
step == 3) {
201 reso = (sigma_l + sigma_r) / 2.;
207 }
else if (
wheel == 1) {
209 }
else if (
wheel == 2) {
214 float sXDelays = sTDelays * DX.
v_drift / 10.;
215 reso =
sqrt(reso * reso + sXDelays * sXDelays);
221 }
else if (
wheel == 1) {
223 }
else if (
wheel == 2) {
229 }
else if (
step == 2) {
233 }
else if (
wheel == 1) {
235 }
else if (
wheel == 2) {
241 }
else if (
step == 3) {
245 }
else if (
wheel == 1) {
247 }
else if (
wheel == 2) {
260 if (!
layer->specificTopology().isWireValid(wireId.
wire()))
269 int prevW =
cout.width();
270 cout << setiosflags(ios::showpoint |
ios::fixed) << setw(3) <<
"[DTParametrizedDriftAlgo]: step " <<
step << endl
271 <<
" Global Position " << globPos << endl
272 <<
" Local Position " <<
layer->toLocal(globPos)
275 <<
" Digi time " << digiTime
279 <<
" >Drif time " << driftTime << endl
280 <<
" >Angle " <<
angle * 180. /
M_PI << endl
281 <<
" <Drift distance " <<
drift << endl
282 <<
" <sigma_l " << sigma_l << endl
283 <<
" <sigma_r " << sigma_r << endl
284 <<
" reso " << reso << endl
285 <<
" leftPoint " << leftPoint << endl
286 <<
" rightPoint " << rightPoint << endl
287 <<
" error " <<
error << resetiosflags(ios::showpoint |
ios::fixed) << setw(prevW) << endl
297 const float digiTime,
308 switch (newHit1D.
lrSide()) {
325 throw cms::Exception(
"InvalidDTCellSide") <<
"[DTParametrizedDriftAlgo] Compute at Step " <<
step 326 <<
", Hit side " << newHit1D.
lrSide() <<
" is invalid!" << endl;
void setES(const edm::EventSetup &setup) override
Pass the Event Setup to the algo at each event.
Point3DBase< Scalar, LocalTag > LocalPoint
int wire() const
Return the wire number.
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Global3DPoint GlobalPoint
~DTParametrizedDriftAlgo() override
Destructor.
int wire() const
Return wire number.
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
constexpr std::array< uint8_t, layerIndexSize > layer
double time() const
Get time in ns.
bool computeDriftDistance_mean(double time, double alpha, double by, double bz, short interpolate, drift_distance *dx) const
DTEnums::DTCellSide lrSide() const
The side of the cell.
Abs< T >::type abs(const T &t)
DTParametrizedDriftAlgo(const edm::ParameterSet &config, edm::ConsumesCollector)
Constructor.
Basic3DVector unit() const
int superlayer() const
Return the superlayer number (deprecated method name)
int wheel() const
Return the wheel number.
DTWireId wireId() const
Return the wireId.
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Structure used to return output values.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)