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.
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  int base;
112 
114  std::unique_ptr<DTDigiSyncBase> theSync;
115 
117 
118  // Ideal model. Used for debug
121 
122  // to configure the creation of Digi-Sim links
125 
126  // Name of Collection use for create the XF
129 
131 };
132 #endif
Vector3DBase< float, LocalTag >
DTDigitizer::MultipleLinks
bool MultipleLinks
Definition: DTDigitizer.h:123
DTDigitizer::theConstVDrift
float theConstVDrift
Definition: DTDigitizer.h:120
DTDigitizer::hitLessT::operator()
bool operator()(const hitAndT &h1, const hitAndT &h2)
Definition: DTDigitizer.h:62
DTDigitizer::DTWireIdMap
std::map< DTWireId, std::vector< const PSimHit * > > DTWireIdMap
Definition: DTDigitizer.h:56
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
zMuMuMuonUserData.alpha
alpha
zGenParticlesMatch = cms.InputTag(""),
Definition: zMuMuMuonUserData.py:9
edm::EDGetTokenT
Definition: EDGetToken.h:33
DTDigitizer
Definition: DTDigitizer.h:46
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:567
DTDigitizer::driftTimeFromParametrization
std::pair< float, bool > driftTimeFromParametrization(float x, float alpha, float By, float Bz, CLHEP::HepRandomEngine *) const
Definition: DTDigitizer.cc:377
EDProducer.h
DDAxes::x
DTDigitizer::LinksTimeWindow
float LinksTimeWindow
Definition: DTDigitizer.h:124
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:119
Event
DTDigitizer::base
int base
Definition: DTDigitizer.h:111
DTDigitizer::cf_token
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
Definition: DTDigitizer.h:130
CLHEP
Definition: CocoaGlobals.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DTDigitizer::interpolate
bool interpolate
Definition: DTDigitizer.h:109
edm::ParameterSet
Definition: ParameterSet.h:36
ParameterSet
Definition: Functions.h:16
DTDigitizer::storeDigis
void storeDigis(DTWireId &wireId, TDContainer &hits, DTDigiCollection &output, DTDigiSimLinkCollection &outputLinks)
Definition: DTDigitizer.cc:500
DTDigitizer::DTDigitizer
DTDigitizer(const edm::ParameterSet &)
Definition: DTDigitizer.cc:57
DTDigiCollection
DTDigitizer::debug
bool debug
Definition: DTDigitizer.h:108
DTDigitizer::smearing
float smearing
Definition: DTDigitizer.h:107
DTDigitizer::asymGausSmear
float asymGausSmear(double mean, double sigmaLeft, double sigmaRight, CLHEP::HepRandomEngine *) const
Definition: DTDigitizer.cc:449
DTDigitizer::DTWireIdMapConstIter
DTWireIdMap::const_iterator DTWireIdMapConstIter
Definition: DTDigitizer.h:58
edm::stream::EDProducer
Definition: EDProducer.h:38
DTDigitizer::vPropWire
double vPropWire
Definition: DTDigitizer.h:105
edm::EventSetup
Definition: EventSetup.h:57
DTDigitizer::theSync
std::unique_ptr< DTDigiSyncBase > theSync
Definition: DTDigitizer.h:114
DTLayer
Definition: DTLayer.h:25
DTDigitizer::deadTime
float deadTime
Definition: DTDigitizer.h:106
DTDigitizer::hitLessT
Definition: DTDigitizer.h:61
DTDigitizer::mix_
std::string mix_
Definition: DTDigitizer.h:127
DTDigitizer::DTWireIdMapIter
DTWireIdMap::iterator DTWireIdMapIter
Definition: DTDigitizer.h:57
DTWireId.h
DTDigitizer::hitAndT
std::pair< const PSimHit *, float > hitAndT
Definition: DTDigitizer.h:53
DTDigitizer::TDContainer
std::vector< hitAndT > TDContainer
Definition: DTDigitizer.h:54
DTDigitizer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: DTDigitizer.cc:134
DTDigitizer::collection_for_XF
std::string collection_for_XF
Definition: DTDigitizer.h:128
DTDigiSimLinkCollection.h
DTDigitizer::driftTimeFromTimeMap
std::pair< float, bool > driftTimeFromTimeMap() const
Definition: DTDigitizer.cc:466
DTDigitizer::computeTime
std::pair< float, bool > computeTime(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit, const LocalVector &BLoc, CLHEP::HepRandomEngine *)
Definition: DTDigitizer.cc:231
DTDigitizer::geometryType
std::string geometryType
Definition: DTDigitizer.h:116
ConsumesCollector.h
DTDigiCollection.h
DTDigitizer::DTDigitizerAnalysis
friend class DTDigitizerAnalysis
Definition: DTDigitizer.h:102
EventSetup
DTDigitizer::onlyMuHits
bool onlyMuHits
Definition: DTDigitizer.h:110
PSimHit
Definition: PSimHit.h:15
DTDigitizer::syncName
std::string syncName
Definition: DTDigitizer.h:113
edm::Event
Definition: Event.h:73
LocalVector.h
hit
Definition: SiStripHitEffFromCalibTree.cc:88
DTDigitizer::externalDelays
float externalDelays(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit) const
Definition: DTDigitizer.cc:475