35 minTime(config.getParameter<double>(
"minTime")),
36 maxTime(config.getParameter<double>(
"maxTime")),
37 doVdriftCorr(config.getParameter<bool>(
"doVdriftCorr")),
39 stepTwoFromDigi(config.getParameter<bool>(
"stepTwoFromDigi")),
40 useUncertDB(config.getParameter<bool>(
"useUncertDB")),
41 readLegacyTTrigDB(config.getParameter<bool>(
"readLegacyTTrigDB")),
44 debug(config.getUntrackedParameter<bool>(
"debug")) {
59 edm::LogVerbatim(
"DTLocalReco") <<
"[DTLinearDriftFromDBAlgo] setES called" << endl;
72 throw cms::Exception(
"Configuration") <<
"only version 1 is presently supported for VDriftDB";
111 return compute(layer, wireId, digi.
time(), globWirePos, leftPoint, rightPoint,
error, 1);
132 return compute(layer, wireId, recHit1D.
digiTime(), globWirePos, newHit1D, 2);
147 const float digiTime,
154 float driftTime = digiTime -
theSync->offset(layer, wireId, globPos);
157 if (driftTime < minTime || driftTime >
maxTime) {
159 edm::LogWarning(
"DTLocalReco") <<
"[DTLinearDriftFromDBAlgo]*** Drift time out of window for in-time hits "
160 << driftTime << endl;
175 float hitResolution = 0;
190 double args[1] = {double(step - 1)};
200 const float k_param = 1.2e-04;
202 vDrift = vDrift * (1. - k_param * local_pos.
y());
207 float drift = driftTime * vDrift;
216 error =
LocalError(hitResolution * hitResolution, 0., 0.);
219 edm::LogWarning(
"DTLocalReco") <<
"[DTLinearDriftFromDBAlgo] Compute drift distance, for digi at wire: " << wireId
221 <<
" Step: " << step << endl
222 <<
" Digi time: " << digiTime << endl
223 <<
" Drift time: " << driftTime << endl
224 <<
" Drift distance: " << drift << endl
225 <<
" Hit Resolution: " << hitResolution << endl
226 <<
" Left point: " << leftPoint << endl
227 <<
" Right point: " << rightPoint << endl
228 <<
" Error: " << error << endl;
237 const float digiTime,
245 if (
compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
247 switch (newHit1D.
lrSide()) {
264 throw cms::Exception(
"InvalidDTCellSide") <<
"[DTLinearDriftFromDBAlgo] Compute at Step " << step
265 <<
", Hit side " << newHit1D.
lrSide() <<
" is invalid!" << endl;
Log< level::Info, true > LogVerbatim
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
DTLinearDriftFromDBAlgo(const edm::ParameterSet &config, edm::ConsumesCollector cc)
Constructor.
Point3DBase< Scalar, LocalTag > LocalPoint
edm::ESGetToken< DTRecoConditions, DTRecoConditionsUncertRcd > uncertMapToken_
int version() const
Version numer specifying the structure of the payload. See .cc file for details.
int nominalValue() const
The nominal field value for this map in kGauss.
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 &)
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
edm::ESGetToken< DTRecoConditions, DTRecoConditionsVdriftRcd > vDriftMapToken_
const DTRecoConditions * vDriftMap
int wire() const
Return wire number.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
constexpr std::array< uint8_t, layerIndexSize > layer
bool getData(T &iHolder) const
const DTTopology & specificTopology() const
double time() const
Get time in ns.
edm::ESGetToken< DTMtime, DTMtimeRcd > mTimeMapToken_
int superLayer() const
Return the superlayer number.
Abs< T >::type abs(const T &t)
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
const DTRecoConditions * uncertMap
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > fieldToken_
const MagneticField * field
float get(const DTWireId &wireid, double *x=nullptr) const
Get the value correspoding to the given WireId, / using x[] as parameters of the parametrization whe...
int wire() const
Return the wire number.
std::unique_ptr< DTTTrigBaseSync > theSync
~DTLinearDriftFromDBAlgo() override
Destructor.
const bool stepTwoFromDigi
const std::string & version() const
access version
void setES(const edm::EventSetup &setup) override
Pass the Event Setup to the algo at each event.
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
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.
Log< level::Warning, false > LogWarning
int station() const
Return the station number.
int wheel() const
Return the wheel number.
LocalPoint localPosition() const override
Return the 3-dimensional local position.
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override
DTEnums::DTCellSide lrSide() const
The side of the cell.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
DTWireId wireId() const
Return the wireId.