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