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