-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
Copy pathDTLinearDriftFromDBAlgo.h
125 lines (102 loc) · 4.26 KB
/
DTLinearDriftFromDBAlgo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#ifndef RecoLocalMuon_DTLinearDriftFromDBAlgo_H
#define RecoLocalMuon_DTLinearDriftFromDBAlgo_H
/** \class DTLinearDriftFromDBAlgo
* Concrete implementation of DTRecHitBaseAlgo.
* Compute drift distance using constant drift velocity
* read from database.
*
* \author S.Bolognesi - INFN Torino
*/
#include "RecoLocalMuon/DTRecHit/interface/DTRecHitBaseAlgo.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
class DTMtime;
class DTRecoConditions;
class MagneticField;
class DTMtimeRcd;
class DTRecoConditionsVdriftRcd;
class IdealMagneticFieldRecord;
class DTRecoConditionsUncertRcd;
class DTLinearDriftFromDBAlgo : public DTRecHitBaseAlgo {
public:
/// Constructor
DTLinearDriftFromDBAlgo(const edm::ParameterSet& config, edm::ConsumesCollector cc);
/// Destructor
~DTLinearDriftFromDBAlgo() override;
// Operations
/// Pass the Event Setup to the algo at each event
void setES(const edm::EventSetup& setup) override;
/// First step in computation of Left/Right hits from a Digi.
/// The results are the local position (in DTLayer frame) of the
/// Left and Right hit, and the error (which is common). Returns
/// false on failure. The hit is assumed to be at the wire center.
bool compute(const DTLayer* layer,
const DTDigi& digi,
LocalPoint& leftPoint,
LocalPoint& rightPoint,
LocalError& error) const override;
/// Second step in hit position computation.
/// It is the same as first step since the angular information is not used
/// NOTE: Only position and error of the new hit are modified
bool compute(const DTLayer* layer,
const DTRecHit1D& recHit1D,
const float& angle,
DTRecHit1D& newHit1D) const override;
/// Third (and final) step in hits position computation.
/// Also the hit position along the wire is available
/// and can be used to correct the drift time for particle
/// TOF and propagation of signal along the wire.
/// NOTE: Only position and error of the new hit are modified
bool compute(const DTLayer* layer,
const DTRecHit1D& recHit1D,
const float& angle,
const GlobalPoint& globPos,
DTRecHit1D& newHit1D) const override;
private:
// Do the actual work.
virtual bool compute(const DTLayer* layer,
const DTWireId& wireId,
const float digiTime,
const GlobalPoint& globPos,
LocalPoint& leftPoint,
LocalPoint& rightPoint,
LocalError& error,
int step) const;
// Interface to the method which does the actual work suited for 2nd and 3rd steps
virtual bool compute(const DTLayer* layer,
const DTWireId& wireId,
const float digiTime,
const GlobalPoint& globPos,
DTRecHit1D& newHit1D,
int step) const;
// Map of meantimes (old DB format)
const DTMtime* mTimeMap;
edm::ESGetToken<DTMtime, DTMtimeRcd> mTimeMapToken_;
// Drift velocity (new DB format)
const DTRecoConditions* vDriftMap;
edm::ESGetToken<DTRecoConditions, DTRecoConditionsVdriftRcd> vDriftMapToken_;
// MF field
const MagneticField* field;
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> fieldToken_;
int nominalB;
// Map of hit uncertainties
const DTRecoConditions* uncertMap;
edm::ESGetToken<DTRecoConditions, DTRecoConditionsUncertRcd> uncertMapToken_;
// Times below MinTime (ns) are considered as coming from previous BXs.
const float minTime;
// Times above MaxTime (ns) are considered as coming from following BXs
const float maxTime;
// Perform a correction to vDrift for the external wheels
const bool doVdriftCorr;
// Switch recalculating hit parameters from digi time in Step 2
// (when off, Step 2 does nothing)
const bool stepTwoFromDigi;
// Assign hit uncertainties based on new uncertainties DB
// If false, the value taken from vdrift DB is used instead.
bool useUncertDB;
// Read legacy format for vdrift and ttrig DBs
bool readLegacyTTrigDB;
bool readLegacyVDriftDB;
// Switch on/off the verbosity
const bool debug;
};
#endif // RecoLocalMuon_DTLinearDriftFromDBAlgo_H