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 
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
Vector3DBase< float, LocalTag >
DTDigitizer::MultipleLinks
bool MultipleLinks
Definition: DTDigitizer.h:129
DTDigitizer::theConstVDrift
float theConstVDrift
Definition: DTDigitizer.h:126
DTDigitizer::hitLessT::operator()
bool operator()(const hitAndT &h1, const hitAndT &h2)
Definition: DTDigitizer.h:68
DTDigitizer::DTWireIdMap
std::map< DTWireId, std::vector< const PSimHit * > > DTWireIdMap
Definition: DTDigitizer.h:62
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
edm::EDGetTokenT
Definition: EDGetToken.h:33
DTDigitizer
Definition: DTDigitizer.h:52
edm
HLT enums.
Definition: AlignableModifier.h:19
MuonDigiCollection
A container for a generic type of digis indexed by some index, implemented with a map<IndexType,...
Definition: MuonDigiCollection.h:87
CrossingFrame.h
PSimHitContainer.h
DTDigitizer::dumpHit
void dumpHit(const PSimHit *hit, float xEntry, float xExit, const DTTopology &topo)
Definition: DTDigitizer.cc:561
DTDigitizer::driftTimeFromParametrization
std::pair< float, bool > driftTimeFromParametrization(float x, float alpha, float By, float Bz, CLHEP::HepRandomEngine *) const
Definition: DTDigitizer.cc:371
EDProducer.h
alpha
float alpha
Definition: AMPTWrapper.h:105
DDAxes::x
ESGetToken.h
DTDigitizer::LinksTimeWindow
float LinksTimeWindow
Definition: DTDigitizer.h:130
DTDigiSyncBase
Definition: DTDigiSyncBase.h:13
DTTopology
Definition: DTTopology.h:28
PSimHit.h
MixCollection.h
DTWireId
Definition: DTWireId.h:12
DTDigitizer::IdealModel
bool IdealModel
Definition: DTDigitizer.h:125
IdealMagneticFieldRecord.h
Event
DTDigitizer::base
int base
Definition: DTDigitizer.h:117
DTDigitizer::cf_token
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
Definition: DTDigitizer.h:136
DTDigitizer::magnField_token
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magnField_token
Definition: DTDigitizer.h:138
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CLHEP
Definition: CocoaGlobals.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DTGeometry.h
DTDigitizer::interpolate
bool interpolate
Definition: DTDigitizer.h:115
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
DTDigitizer::storeDigis
void storeDigis(DTWireId &wireId, TDContainer &hits, DTDigiCollection &output, DTDigiSimLinkCollection &outputLinks)
Definition: DTDigitizer.cc:494
DTDigitizer::DTDigitizer
DTDigitizer(const edm::ParameterSet &)
Definition: DTDigitizer.cc:51
DTDigiCollection
DTDigitizer::debug
bool debug
Definition: DTDigitizer.h:114
DTDigitizer::smearing
float smearing
Definition: DTDigitizer.h:113
DTDigitizer::asymGausSmear
float asymGausSmear(double mean, double sigmaLeft, double sigmaRight, CLHEP::HepRandomEngine *) const
Definition: DTDigitizer.cc:443
DTDigitizer::DTWireIdMapConstIter
DTWireIdMap::const_iterator DTWireIdMapConstIter
Definition: DTDigitizer.h:64
edm::stream::EDProducer
Definition: EDProducer.h:38
DTDigitizer::vPropWire
double vPropWire
Definition: DTDigitizer.h:111
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:58
DTDigitizer::theSync
std::unique_ptr< DTDigiSyncBase > theSync
Definition: DTDigitizer.h:120
edm::ESGetToken< DTGeometry, MuonGeometryRecord >
DTLayer
Definition: DTLayer.h:25
DTDigitizer::deadTime
float deadTime
Definition: DTDigitizer.h:112
DTDigitizer::hitLessT
Definition: DTDigitizer.h:67
DTDigitizer::mix_
std::string mix_
Definition: DTDigitizer.h:133
DTDigitizer::DTWireIdMapIter
DTWireIdMap::iterator DTWireIdMapIter
Definition: DTDigitizer.h:63
DTWireId.h
DTDigitizer::hitAndT
std::pair< const PSimHit *, float > hitAndT
Definition: DTDigitizer.h:59
DTDigitizer::TDContainer
std::vector< hitAndT > TDContainer
Definition: DTDigitizer.h:60
DTDigitizer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: DTDigitizer.cc:130
DTDigitizer::collection_for_XF
std::string collection_for_XF
Definition: DTDigitizer.h:134
DTDigiSimLinkCollection.h
DTDigitizer::driftTimeFromTimeMap
std::pair< float, bool > driftTimeFromTimeMap() const
Definition: DTDigitizer.cc:460
DTDigitizer::computeTime
std::pair< float, bool > computeTime(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit, const LocalVector &BLoc, CLHEP::HepRandomEngine *)
Definition: DTDigitizer.cc:225
DTDigitizer::geometryType
std::string geometryType
Definition: DTDigitizer.h:122
ConsumesCollector.h
DTDigiCollection.h
DTDigitizer::DTDigitizerAnalysis
friend class DTDigitizerAnalysis
Definition: DTDigitizer.h:108
EventSetup
DTDigitizer::onlyMuHits
bool onlyMuHits
Definition: DTDigitizer.h:116
PSimHit
Definition: PSimHit.h:15
MuonGeometryRecord.h
DTDigitizer::syncName
std::string syncName
Definition: DTDigitizer.h:119
edm::Event
Definition: Event.h:73
LocalVector.h
DTDigitizer::muonGeom_token
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeom_token
Definition: DTDigitizer.h:137
hit
Definition: SiStripHitEffFromCalibTree.cc:88
DTDigitizer::externalDelays
float externalDelays(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit) const
Definition: DTDigitizer.cc:469