CMS 3D CMS Logo

DTDigitizer.h
Go to the documentation of this file.
1 #ifndef SimMuon_DTDigitizer_h
2 #define SimMuon_DTDigitizer_h
3 
13 
18 
20 // SimHits
25 
26 #include <memory>
27 #include <vector>
28 
29 namespace CLHEP {
30  class HepRandomEngine;
31 }
32 
33 class DTLayer;
34 class PSimHit;
35 class DTWireType;
36 class DTBaseDigiSync;
37 class DTTopology;
38 class DTDigiSyncBase;
39 
40 namespace edm {
41  class ParameterSet;
42  class Event;
43  class EventSetup;
44 } // namespace edm
45 
47 public:
48  explicit DTDigitizer(const edm::ParameterSet &);
49 
50  void produce(edm::Event &, const edm::EventSetup &) override;
51 
52 private:
53  typedef std::pair<const PSimHit *, float> hitAndT; // hit & corresponding time
54  typedef std::vector<hitAndT> TDContainer; // hits & times for one wire
55 
56  typedef std::map<DTWireId, std::vector<const PSimHit *>> DTWireIdMap;
57  typedef DTWireIdMap::iterator DTWireIdMapIter;
58  typedef DTWireIdMap::const_iterator DTWireIdMapConstIter;
59 
60  // Sort hits container by time.
61  struct hitLessT {
62  bool operator()(const hitAndT &h1, const hitAndT &h2) {
63  if (h1.second < h2.second)
64  return true;
65  return false;
66  }
67  };
68 
69  // Calculate the drift time for one hit.
70  // if status flag == false, hit has to be discarded.
71  std::pair<float, bool> computeTime(const DTLayer *layer,
72  const DTWireId &wireId,
73  const PSimHit *hit,
74  const LocalVector &BLoc,
75  CLHEP::HepRandomEngine *); // FIXME??
76 
77  // Calculate the drift time using the GARFIELD cell parametrization,
78  // taking care of all conversions from CMSSW local coordinates
79  // to the conventions used for the parametrization.
80  std::pair<float, bool> driftTimeFromParametrization(
81  float x, float alpha, float By, float Bz, CLHEP::HepRandomEngine *) const;
82 
83  // Calculate the drift time for the cases where it is not possible
84  // to use the GARFIELD cell parametrization.
85  std::pair<float, bool> driftTimeFromTimeMap() const;
86 
87  // Add all delays other than drift times (signal propagation along the wire,
88  // TOF etc.; subtract calibration time.
89  float externalDelays(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit) const;
90 
91  // Store digis for one wire, taking into account the dead time.
92  // FiXME put alias for the map.
93  void storeDigis(DTWireId &wireId, TDContainer &hits, DTDigiCollection &output, DTDigiSimLinkCollection &outputLinks);
94 
95  // Debug output
96  void dumpHit(const PSimHit *hit, float xEntry, float xExit, const DTTopology &topo);
97 
98  // Double half-gaussian smearing.
99  float asymGausSmear(double mean, double sigmaLeft, double sigmaRight, CLHEP::HepRandomEngine *) const;
100 
101  // Allow debugging and testing.
102  friend class DTDigitizerAnalysis;
103 
104  // Its Atributes:
105  double vPropWire;
106  float deadTime;
107  float smearing;
108  bool debug;
111 
113  std::unique_ptr<DTDigiSyncBase> theSync;
114 
116 
117  // Ideal model. Used for debug
120 
121  // to configure the creation of Digi-Sim links
124 
125  // Name of Collection use for create the XF
128 
130 };
131 #endif
float alpha
Definition: AMPTWrapper.h:95
bool onlyMuHits
Definition: DTDigitizer.h:110
float theConstVDrift
Definition: DTDigitizer.h:119
float LinksTimeWindow
Definition: DTDigitizer.h:123
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
Definition: DTDigitizer.h:129
float smearing
Definition: DTDigitizer.h:107
bool interpolate
Definition: DTDigitizer.h:109
DTWireIdMap::const_iterator DTWireIdMapConstIter
Definition: DTDigitizer.h:58
bool IdealModel
Definition: DTDigitizer.h:118
std::unique_ptr< DTDigiSyncBase > theSync
Definition: DTDigitizer.h:113
bool operator()(const hitAndT &h1, const hitAndT &h2)
Definition: DTDigitizer.h:62
std::string mix_
Definition: DTDigitizer.h:126
std::string geometryType
Definition: DTDigitizer.h:115
std::vector< hitAndT > TDContainer
Definition: DTDigitizer.h:54
std::string syncName
Definition: DTDigitizer.h:112
HLT enums.
double vPropWire
Definition: DTDigitizer.h:105
float deadTime
Definition: DTDigitizer.h:106
DTWireIdMap::iterator DTWireIdMapIter
Definition: DTDigitizer.h:57
std::map< DTWireId, std::vector< const PSimHit * > > DTWireIdMap
Definition: DTDigitizer.h:56
std::pair< const PSimHit *, float > hitAndT
Definition: DTDigitizer.h:53
bool MultipleLinks
Definition: DTDigitizer.h:122
std::string collection_for_XF
Definition: DTDigitizer.h:127
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...