CMS 3D CMS Logo

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