30 interpolate(config.getParameter<bool>(
"interpolate")),
31 minTime(config.getParameter<double>(
"minTime")),
32 maxTime(config.getParameter<double>(
"maxTime")),
34 debug(config.getUntrackedParameter<bool>(
"debug",
"false")),
41 theSync->setES(setup);
69 angle = atan(lDirLoc.
x() / -lDirLoc.
z());
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) {
265 leftPoint =
LocalPoint(locWirePos.x() -
drift, locWirePos.
y(), locWirePos.z());
266 rightPoint =
LocalPoint(locWirePos.x() +
drift, locWirePos.
y(), locWirePos.z());
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,
306 if (
compute(layer, wireId, digiTime, angle, globPos, leftPoint, rightPoint, error, step)) {
308 switch (newHit1D.
lrSide()) {
325 throw cms::Exception(
"InvalidDTCellSide") <<
"[DTParametrizedDriftAlgo] Compute at Step " << step
326 <<
", Hit side " << newHit1D.
lrSide() <<
" is invalid!" << endl;
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
void setES(const edm::EventSetup &setup) override
Pass the Event Setup to the algo at each event.
Point3DBase< Scalar, LocalTag > LocalPoint
bool computeDriftDistance_mean(double time, double alpha, double by, double bz, short interpolate, drift_distance *dx) const
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override
DTLayerId id() const
Return the DetId of this SL.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Global3DPoint GlobalPoint
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
~DTParametrizedDriftAlgo() override
Destructor.
int wire() const
Return wire number.
constexpr std::array< uint8_t, layerIndexSize > layer
bool getData(T &iHolder) const
const DTTopology & specificTopology() const
double time() const
Get time in ns.
Abs< T >::type abs(const T &t)
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
DTParametrizedDriftAlgo(const edm::ParameterSet &config, edm::ConsumesCollector)
Constructor.
int wire() const
Return the wire number.
int superlayer() const
Return the superlayer number (deprecated method name)
tuple config
parse the configuration file
bool isWireValid(const int wireNumber) const
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
int wheel() const
Return the wheel number.
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Structure used to return output values.
DTEnums::DTCellSide lrSide() const
The side of the cell.
Basic3DVector unit() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
DTWireId wireId() const
Return the wireId.