CMS 3D CMS Logo

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