Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 03:24:07

0001 #ifndef RecoLocalMuon_DTLinearDriftFromDBAlgo_H
0002 #define RecoLocalMuon_DTLinearDriftFromDBAlgo_H
0003 
0004 /** \class DTLinearDriftFromDBAlgo
0005  *  Concrete implementation of DTRecHitBaseAlgo.
0006  *  Compute drift distance using constant drift velocity
0007  *  read from database.
0008  *
0009  *  \author S.Bolognesi - INFN Torino
0010  */
0011 
0012 #include "RecoLocalMuon/DTRecHit/interface/DTRecHitBaseAlgo.h"
0013 #include "FWCore/Utilities/interface/ESGetToken.h"
0014 
0015 class DTMtime;
0016 class DTRecoConditions;
0017 class MagneticField;
0018 class DTMtimeRcd;
0019 class DTRecoConditionsVdriftRcd;
0020 class IdealMagneticFieldRecord;
0021 class DTRecoConditionsUncertRcd;
0022 
0023 class DTLinearDriftFromDBAlgo : public DTRecHitBaseAlgo {
0024 public:
0025   /// Constructor
0026   DTLinearDriftFromDBAlgo(const edm::ParameterSet& config, edm::ConsumesCollector cc);
0027 
0028   /// Destructor
0029   ~DTLinearDriftFromDBAlgo() override;
0030 
0031   // Operations
0032 
0033   /// Pass the Event Setup to the algo at each event
0034   void setES(const edm::EventSetup& setup) override;
0035 
0036   /// First step in computation of Left/Right hits from a Digi.
0037   /// The results are the local position (in DTLayer frame) of the
0038   /// Left and Right hit, and the error (which is common). Returns
0039   /// false on failure. The hit is assumed to be at the wire center.
0040   bool compute(const DTLayer* layer,
0041                const DTDigi& digi,
0042                LocalPoint& leftPoint,
0043                LocalPoint& rightPoint,
0044                LocalError& error) const override;
0045 
0046   /// Second step in hit position computation.
0047   /// It is the same as first step since the angular information is not used
0048   /// NOTE: Only position and error of the new hit are modified
0049   bool compute(const DTLayer* layer,
0050                const DTRecHit1D& recHit1D,
0051                const float& angle,
0052                DTRecHit1D& newHit1D) const override;
0053 
0054   /// Third (and final) step in hits position computation.
0055   /// Also the hit position along the wire is available
0056   /// and can be used to correct the drift time for particle
0057   /// TOF and propagation of signal along the wire.
0058   /// NOTE: Only position and error of the new hit are modified
0059   bool compute(const DTLayer* layer,
0060                const DTRecHit1D& recHit1D,
0061                const float& angle,
0062                const GlobalPoint& globPos,
0063                DTRecHit1D& newHit1D) const override;
0064 
0065 private:
0066   // Do the actual work.
0067   virtual bool compute(const DTLayer* layer,
0068                        const DTWireId& wireId,
0069                        const float digiTime,
0070                        const GlobalPoint& globPos,
0071                        LocalPoint& leftPoint,
0072                        LocalPoint& rightPoint,
0073                        LocalError& error,
0074                        int step) const;
0075 
0076   // Interface to the method which does the actual work suited for 2nd and 3rd steps
0077   virtual bool compute(const DTLayer* layer,
0078                        const DTWireId& wireId,
0079                        const float digiTime,
0080                        const GlobalPoint& globPos,
0081                        DTRecHit1D& newHit1D,
0082                        int step) const;
0083 
0084   // Map of meantimes (old DB format)
0085   const DTMtime* mTimeMap;
0086   edm::ESGetToken<DTMtime, DTMtimeRcd> mTimeMapToken_;
0087 
0088   // Drift velocity (new DB format)
0089   const DTRecoConditions* vDriftMap;
0090   edm::ESGetToken<DTRecoConditions, DTRecoConditionsVdriftRcd> vDriftMapToken_;
0091 
0092   // MF field
0093   const MagneticField* field;
0094   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> fieldToken_;
0095   int nominalB;
0096 
0097   // Map of hit uncertainties
0098   const DTRecoConditions* uncertMap;
0099   edm::ESGetToken<DTRecoConditions, DTRecoConditionsUncertRcd> uncertMapToken_;
0100 
0101   // Times below MinTime (ns) are considered as coming from previous BXs.
0102   const float minTime;
0103 
0104   // Times above MaxTime (ns) are considered as coming from following BXs
0105   const float maxTime;
0106 
0107   // Perform a correction to vDrift for the external wheels
0108   const bool doVdriftCorr;
0109 
0110   // Switch recalculating hit parameters from digi time in Step 2
0111   // (when off, Step 2 does nothing)
0112   const bool stepTwoFromDigi;
0113 
0114   // Assign hit uncertainties based on new uncertainties DB
0115   // If false, the value taken from vdrift DB is used instead.
0116   bool useUncertDB;
0117 
0118   // Read legacy format for vdrift and ttrig DBs
0119   bool readLegacyTTrigDB;
0120   bool readLegacyVDriftDB;
0121 
0122   // Switch on/off the verbosity
0123   const bool debug;
0124 };
0125 #endif  // RecoLocalMuon_DTLinearDriftFromDBAlgo_H