CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTDigitizer.cc
Go to the documentation of this file.
1 
6 // system include files
7 #include <memory>
8 
9 //C++ headers
10 #include <cmath>
11 
12 //Random generator
14 #include <CLHEP/Random/RandGaussQ.h>
15 #include <CLHEP/Random/RandFlat.h>
16 
17 // Framework
25 
26 // Geometry
31 
33 
34 // Magnetic Field
37 
38 // SimHits
43 
44 // Digis
48 
49 // DTDigitizer
52 
55 
56 // namespaces
57 using namespace edm;
58 using namespace std;
59 
60 // Constructor
62 
63  // Set verbose output
64  debug=conf_.getUntrackedParameter<bool>("debug");
65 
66  if (debug) cout<<"Creating a DTDigitizer"<<endl;
67 
68  //register the Producer with a label
69  //produces<DTDigiCollection>("MuonDTDigis"); // FIXME: Do I pass it by ParameterSet?
70  produces<DTDigiCollection>(); // FIXME: Do I pass it by ParameterSet?
71  // produces<DTDigiSimLinkCollection>("MuonDTDigiSimLinks");
72  produces<DTDigiSimLinkCollection>();
73 
74  //Parameters:
75 
76  // build digis only for mu hits (for debug purposes)
77  onlyMuHits=conf_.getParameter<bool>("onlyMuHits");
78 
79  // interpolate parametrization function
80  interpolate=conf_.getParameter<bool>("interpolate");
81 
82  // Velocity of signal propagation along the wire (cm/ns)
83  // For the default value
84  // cfr. CMS-IN 2000-021: (2.56+-0.17)x1e8 m/s
85  // CMS NOTE 2003-17: (0.244) m/ns
86  vPropWire=conf_.getParameter<double>("vPropWire"); //24.4
87 
88  // Dead time for signals on the same wire (number from M. Pegoraro)
89  deadTime=conf_.getParameter<double>("deadTime"); //150
90 
91  // further configurable smearing
92  smearing=conf_.getParameter<double>("Smearing"); // 3.
93 
94  // Sync Algo
95  syncName = conf_.getParameter<string>("SyncName");
96  theSync = DTDigiSyncFactory::get()->create(syncName,conf_.getParameter<ParameterSet>("pset"));
97 
98  // Debug flag to switch to the Ideal model
99  // it uses a constant drift velocity and doesn't set any external delay
100  IdealModel = conf_.getParameter<bool>("IdealModel");
101 
102  // Constant drift velocity needed by the above flag
103  if(IdealModel)
104  theConstVDrift = conf_.getParameter<double>("IdealModelConstantDriftVelocity"); // 55 um/ns
105  else theConstVDrift = 55.;
106 
107  // get random engine
109  if ( ! rng.isAvailable()) {
110  throw cms::Exception("Configuration")
111  << "RandomNumberGeneratorService for DTDigitizer missing in cfg file";
112  }
113  theGaussianDistribution = new CLHEP::RandGaussQ(rng->getEngine());
114  theFlatDistribution = new CLHEP::RandFlat(rng->getEngine(), 0, 1);
115 
116  // MultipleLinks=false ==> one-to-one correspondence between digis and SimHits
117  MultipleLinks = conf_.getParameter<bool>("MultipleLinks");
118  // MultipleLinks=true ==> association of SimHits within a time window LinksTimeWindow
119  // (of the order of the resolution)
120  LinksTimeWindow = conf_.getParameter<double>("LinksTimeWindow"); // (10 ns)
121 
122  //Name of Collection used for create the XF
123  mix_ = conf_.getParameter<std::string>("mixLabel");
124  collection_for_XF = conf_.getParameter<std::string>("InputCollection");
125 
126  //String to choice between ideal (the deafult) and (mis)aligned geometry for the digitization step
127  geometryType = conf_.getParameter<std::string>("GeometryType");
128 }
129 
130 // Destructor
132  delete theGaussianDistribution;
133  delete theFlatDistribution;
134 }
135 
136 // method called to produce the data
138  if(debug)
139  cout << "--- Run: " << iEvent.id().run()
140  << " Event: " << iEvent.id().event() << endl;
141 
142  //************ 1 ***************
143  // create the container for the SimHits
144  // Handle<PSimHitContainer> simHits;
145  // iEvent.getByLabel("g4SimHits","MuonDTHits",simHits);
146 
147  // use MixCollection instead of the previous
149  iEvent.getByLabel(mix_,collection_for_XF,xFrame);
150 
151  auto_ptr<MixCollection<PSimHit> >
152  simHits( new MixCollection<PSimHit>(xFrame.product()) );
153 
154  // create the pointer to the Digi container
155  auto_ptr<DTDigiCollection> output(new DTDigiCollection());
156  // pointer to the DigiSimLink container
157  auto_ptr<DTDigiSimLinkCollection> outputLinks(new DTDigiSimLinkCollection());
158 
159  // Muon Geometry
160  ESHandle<DTGeometry> muonGeom;
161  iSetup.get<MuonGeometryRecord>().get(geometryType,muonGeom);
162 
163  // Magnetic Field
164  ESHandle<MagneticField> magnField;
165  iSetup.get<IdealMagneticFieldRecord>().get(magnField);
166 
167  //************ 2 ***************
168 
169  // These are sorted by DetId, i.e. by layer and then by wire #
170  // map<DTDetId, vector<const PSimHit*> > wireMap;
171  DTWireIdMap wireMap;
172 
173  for(MixCollection<PSimHit>::MixItr simHit = simHits->begin();
174  simHit != simHits->end(); simHit++){
175 
176  // Create the id of the wire, the simHits in the DT known also the wireId
177 
178  DTWireId wireId( (*simHit).detUnitId() );
179  // Fill the map
180  wireMap[wireId].push_back(&(*simHit));
181  }
182 
183  pair<float,bool> time(0.,false);
184 
185  //************ 3 ***************
186  // Loop over the wires
187  for(DTWireIdMapConstIter wire = wireMap.begin(); wire!=wireMap.end(); wire++){
188  // SimHit Container associated to the wire
189  const vector<const PSimHit*> & vhit = (*wire).second;
190  if(vhit.size()!=0) {
191  TDContainer tdCont; // It is a vector<pair<const PSimHit*,float> >;
192 
193  //************ 4 ***************
194  DTWireId wireId = (*wire).first;
195 
196  //const DTLayer* layer = dynamic_cast< const DTLayer* > (muonGeom->idToDet(wireId.layerId()));
197  const DTLayer* layer = muonGeom->layer(wireId.layerId());
198 
199  // Loop on the hits of this wire
200  for (vector<const PSimHit*>::const_iterator hit=vhit.begin();
201  hit != vhit.end(); hit++){
202  //************ 5 ***************
203  LocalPoint locPos = (*hit)->localPosition();
204 
205  const LocalVector BLoc=layer->surface().toLocal(magnField->inTesla(layer->surface().toGlobal(locPos)));
206 
207  time = computeTime(layer, wireId, *hit, BLoc);
208 
209  //************ 6 ***************
210  if (time.second) {
211  tdCont.push_back(make_pair((*hit),time.first));
212  } else {
213  if (debug) cout << "hit discarded" << endl;
214  }
215  }
216 
217  //************ 7 ***************
218 
219  // the loading must be done by layer but
220  // the digitization must be done by wire (in order to take into account the dead time)
221 
222  storeDigis(wireId,tdCont,*output,*outputLinks);
223  }
224 
225  }
226 
227  //************ 8 ***************
228  // Load the Digi Container in the Event
229  //iEvent.put(output,"MuonDTDigis");
230  iEvent.put(output);
231  iEvent.put(outputLinks);
232 
233 }
234 
235 pair<float,bool> DTDigitizer::computeTime(const DTLayer* layer, const DTWireId &wireId,
236  const PSimHit *hit, const LocalVector &BLoc){
237 
238  LocalPoint entryP = hit->entryPoint();
239  LocalPoint exitP = hit->exitPoint();
240  int partType = hit->particleType();
241 
242  const DTTopology &topo = layer->specificTopology();
243 
244  // Pay attention: in CMSSW the rf of the SimHit is in the layer's rf
245 
246  if(debug) cout<<"Hit local entry point: "<<entryP<<endl
247  <<"Hit local exit point: "<<exitP<<endl;
248 
249  float xwire = topo.wirePosition(wireId.wire());
250  float xEntry = entryP.x() - xwire;
251  float xExit = exitP.x() - xwire;
252 
253  if(debug) cout<<"wire position: "<<xwire
254  <<" x entry in cell rf: "<<xEntry
255  <<" x exit in cell rf: "<<xExit<<endl;
256 
257  DTTopology::Side entrySide = topo.onWhichBorder(xEntry,entryP.y(),entryP.z());
258  DTTopology::Side exitSide = topo.onWhichBorder(xExit,exitP.y(),exitP.z());
259 
260  if (debug) dumpHit(hit, xEntry, xExit,topo);
261 
262  // The bolean is used to flag the drift time computation
263  pair<float,bool> driftTime(0.,false);
264 
265  // if delta in gas->ignore, since it is included in the parametrisation.
266  // FIXME: should check that it is actually a delta ray produced by a nearby
267  // muon hit.
268 
269  if (partType == 11 && entrySide == DTTopology::none) {
270  if (debug) cout << " e- hit in gas; discarding " << endl;
271  return driftTime;
272  }
273 
274  float By = BLoc.y();
275  float Bz = BLoc.z();
276 
277  // Radius and sagitta according to direction of momentum
278  // (just for printing)
279  // NOTE: in cmsim, d is always taken // pHat!
280  LocalVector d = (exitP-entryP);
281  LocalVector pHat = hit->localDirection().unit();
282  LocalVector hHat = (d.cross(pHat.cross(d))).unit();
283  float cosAlpha = hHat.dot(pHat);
284  float sinAlpha = sqrt(1.-cosAlpha*cosAlpha);
285  float radius_P = (d.mag())/(2.*cosAlpha);
286  float sagitta_P = radius_P*(1.-sinAlpha);
287 
288  // Radius, sagitta according to field bending
289  // (just for printing)
290  float halfd = d.mag()/2.;
291  float BMag = BLoc.mag();
292  LocalVector pT = (pHat - (BLoc.unit()*pHat.dot(BLoc.unit())))*(hit->pabs());
293  float radius_B = (pT.mag()/(0.3*BMag))*100.;
294  float sagitta_B;
295  if (radius_B > halfd) {
296  sagitta_B = radius_B - sqrt(radius_B*radius_B - halfd*halfd);
297  } else {
298  sagitta_B = radius_B;
299  }
300 
301  // cos(delta), delta= angle between direction at entry and hit segment
302  // (just for printing)
303  float delta = pHat.dot(d.unit());
304  if (debug) cout << " delta = " << delta << endl
305  << " cosAlpha = " << cosAlpha << endl
306  << " sinAlpha = " << sinAlpha << endl
307  << " pMag = " << pT.mag() << endl
308  << " bMag = " << BMag << endl
309  << " pT = " << pT << endl
310  << " halfd = " << halfd << endl
311  << " radius_P (cm) = " << radius_P << endl
312  << " sagitta_P (um) = " << sagitta_P*10000. << endl
313  << " radius_B (cm) = " << radius_B << endl
314  << " sagitta_B (um) = " << sagitta_B*10000. << endl;
315 
316  // Select cases where parametrization can not be used.
317  bool noParametrisation =
318  ( ( entrySide == DTTopology::none || exitSide == DTTopology::none ) // case # 2,3,8,9 or 11
319  || (entrySide == exitSide) // case # 4 or 10
320  || ((entrySide == DTTopology::xMin && exitSide == DTTopology::xMax) ||
321  (entrySide == DTTopology::xMax && exitSide == DTTopology::xMin)) // Hit is case # 7
322  );
323 
324  // FIXME: now, debug warning only; consider treating those
325  // with TM algo.
326  if ( delta < 0.99996 // Track is not straight. FIXME: use sagitta?
327  && (noParametrisation == false)) {
328  if (debug) cout << "*** WARNING: hit is not straight, type = " << partType << endl;
329  }
330 
331  //************ 5A ***************
332 
333  if (!noParametrisation) {
334 
335  LocalVector dir = hit->momentumAtEntry(); // ex Measurement3DVector dir = hit->measurementDirection(); //FIXME?
336  float theta = atan(dir.x()/-dir.z())*180/M_PI;
337 
338  // FIXME: use dir if M.S. is included as GARFIELD option...
339  // otherwise use hit segment dirction.
340  // LocalVector dir0 = (exitP-entryP).unit();
341  // float theta = atan(dir0.x()/-dir0.z())*180/M_PI;
342  float x;
343 
344  Local3DPoint pt = hit->localPosition(); //ex Measurement3DPoint pt = hit->measurementPosition(); // FIXME?
345 
346  if(fabs(pt.z()) < 0.002) {
347  // hit center within 20 um from z=0, no need to extrapolate.
348  x = pt.x() - xwire;
349  } else {
350  x = xEntry - (entryP.z()*(xExit-xEntry))/(exitP.z()-entryP.z());
351  }
352 
353  if(IdealModel) return make_pair(fabs(x)/theConstVDrift,true);
354  else driftTime = driftTimeFromParametrization(x, theta, By, Bz);
355 
356  }
357 
358 
359  if ((driftTime.second)==false) {
360  // Parametrisation not applicable, or failed. Use time map.
361  driftTime = driftTimeFromTimeMap();
362  }
363 
364  //************ 5B ***************
365 
366  // Signal propagation, TOF etc.
367  if (driftTime.second) {
368  driftTime.first += externalDelays(layer,wireId,hit);
369  }
370  return driftTime;
371 }
372 
373 //************ 5A ***************
374 
375 pair<float,bool> DTDigitizer::driftTimeFromParametrization(float x, float theta, float By, float Bz) const {
376 
377  // Convert from CMSSW frame/units r.f. to parametrization ones.
378  x *= 10.; //cm -> mm
379 
380  // FIXME: Current parametrisation can extrapolate above 21 mm,
381  // however a detailed study is needed before using this.
382  if (fabs(x) > 21.) {
383  if (debug) cout << "*** WARNING: parametrisation: x out of range = "
384  << x << ", skipping" << endl;
385  return pair<float,bool>(0.f,false);
386  }
387 
388  // Different r.f. of the parametrization:
389  // X_par = X_ORCA; Y_par=Z_ORCA; Z_par = -Y_ORCA
390 
391  float By_par = Bz; // Bnorm
392  float Bz_par = -By; // Bwire
393  float theta_par = theta;
394 
395  // Parametrisation uses interpolation up to |theta|=45 deg,
396  // |Bwire|=0.4, |Bnorm|=0.75; extrapolation above.
397  if (fabs(theta_par)>45.) {
398  if (debug) cout << "*** WARNING: extrapolating theta > 45: "
399  << theta << endl;
400  // theta_par = min(fabs(theta_par),45.f)*((theta_par<0.)?-1.:1.);
401  }
402  if (fabs(By_par)>0.75) {
403  if (debug) cout << "*** WARNING: extrapolating Bnorm > 0.75: "
404  << By_par << endl;
405  // By_par = min(fabs(By_par),0.75f)*((By_par<0.)?-1.:1.);
406  }
407  if (fabs(Bz_par)>0.4) {
408  if (debug) cout << "*** WARNING: extrapolating Bwire >0.4: "
409  << Bz_par << endl;
410  // Bz_par = min(fabs(Bz_par),0.4)*((Bz_par<0.)?-1.:1.);
411  }
412 
414  static const DTDriftTimeParametrization par;
415  unsigned short flag = par.MB_DT_drift_time (x, theta_par, By_par, Bz_par, 0, &DT, interpolate);
416 
417  if (debug) {
418  cout << " Parametrisation: x, theta, Bnorm, Bwire = "
419  << x << " " << theta_par << " " << By_par << " " << Bz_par << endl
420  << " time=" << DT.t_drift
421  << " sigma_m=" << DT.t_width_m
422  << " sigma_p=" << DT.t_width_p << endl;
423  if (flag!=1) {
424  cout << "*** WARNING: call to parametrisation failed" << endl;
425  return pair<float,bool>(0.f,false);
426  }
427  }
428 
429  // Double half-gaussian smearing
430  float time = asymGausSmear(DT.t_drift, DT.t_width_m, DT.t_width_p);
431 
432  // Do not allow the smearing to lead to negative values
433  time = max(time,0.f);
434 
435  // Apply a Gaussian smearing to account for electronic effects (cf. 2004 TB analysis)
436  // The width of the Gaussian can be configured with the "Smearing" parameter
437 
438  double u = theGaussianDistribution->fire(0.,smearing);
439  time += u;
440 
441  if (debug) cout << " drift time = " << time << endl;
442 
443  return pair<float,bool>(time,true);
444 }
445 
446 float DTDigitizer::asymGausSmear(double mean, double sigmaLeft, double sigmaRight) const {
447 
448  double f = sigmaLeft/(sigmaLeft+sigmaRight);
449  double t;
450 
451  if (theFlatDistribution->fire() <= f) {
452  t = theGaussianDistribution->fire(mean,sigmaLeft);
453  t = mean - fabs(t - mean);
454  } else {
455  t = theGaussianDistribution->fire(mean,sigmaRight);
456  t = mean + fabs(t - mean);
457  }
458  return static_cast<float>(t);
459 }
460 
461 pair<float,bool> DTDigitizer::driftTimeFromTimeMap() const {
462  // FIXME: not yet implemented.
463  if (debug) cout << " TimeMap " << endl;
464  return pair<float,bool>(0.,false);
465 }
466 
467 //************ 5B ***************
468 
470  const DTWireId &wireId,
471  const PSimHit *hit) const {
472 
473  // Time of signal propagation along wire.
474 
475  float wireCoord = hit->localPosition().y();
476  float halfL = (layer->specificTopology().cellLenght())/2.;
477  float propgL = halfL - wireCoord; // the FE is always located at the pos coord.
478 
479  float propDelay = propgL/vPropWire;
480 
481  // Real TOF.
482  float tof = hit->tof();
483 
484  // Delays and t0 according to theSync
485 
486  double sync= theSync->digitizerOffset(&wireId,layer);
487 
488 
489  if (debug) {
490  cout << " propDelay =" << propDelay
491  << "; TOF=" << tof
492  << "; sync= " << sync
493  << endl;
494  }
495 
496  return propDelay + tof + sync;
497 }
498 
499 
500 // accumulate digis by layer
501 
503  TDContainer &hits,
505 
506  //************ 7A ***************
507 
508  // sort signal times
509  sort(hits.begin(),hits.end(),hitLessT());
510 
511  //************ 7B ***************
512 
513  float wakeTime = -999999.0;
514  float resolTime = -999999.0;
515  int digiN = -1; // Digi identifier within the cell (for multiple digis)
516  DTDigi digi;
517 
518  // loop over signal times and drop signals inside dead time
519  for ( TDContainer::const_iterator hit = hits.begin() ; hit != hits.end() ;
520  hit++ ) {
521 
522  if (onlyMuHits && abs((*hit).first->particleType())!=13) continue;
523 
524  //************ 7C ***************
525 
526  float time = (*hit).second;
527  if ( time > wakeTime ) {
528  // Note that digi is constructed with a float value (in ns)
529  int wireN = wireId.wire();
530  digiN++;
531  digi = DTDigi(wireN, time, digiN);
532 
533  // Add association between THIS digi and the corresponding SimTrack
534  unsigned int SimTrackId = (*hit).first->trackId();
535  EncodedEventId evId = (*hit).first->eventId();
536  DTDigiSimLink digisimLink(wireN, digiN, time, SimTrackId, evId);
537 
538  if(debug) {
539  cout<<endl<<"---- DTDigitizer ----"<<endl;
540  cout<<"wireId: "<<wireId<<endl;
541  cout<<"sim. time = "<<time<<endl;
542  cout<<"digi number = "<< digi.number()<<", digi time = "<<digi.time()
543  <<", linked to SimTrack Id = "<<SimTrackId<<endl;
544  }
545 
546  //************ 7D ***************
547  if(digi.countsTDC() < pow(2.,16)){
548  DTLayerId layerID = wireId.layerId(); //taking the layer in which reside the wire
549  output.insertDigi(layerID, digi); // ordering Digis by layer
550  outputLinks.insertDigi(layerID, digisimLink);
551  wakeTime = time + deadTime;
552  resolTime = time + LinksTimeWindow;
553  }
554  else {
555  digiN--;
556  }
557  }
558  else if (MultipleLinks && time < resolTime){
559  int wireN = wireId.wire();
560  unsigned int SimTrackId = (*hit).first->trackId();
561  EncodedEventId evId = (*hit).first->eventId();
562  DTDigiSimLink digisimLink(wireN, digiN, time, SimTrackId, evId);
563  DTLayerId layerID = wireId.layerId();
564  outputLinks.insertDigi(layerID, digisimLink);
565 
566  if(debug) {
567  cout<<"\nAdded multiple link: \n"
568  <<"digi number = "<<digi.number()<<", digi time = "<<digi.time()<<" (sim. time = "<<time<<")"
569  <<", linked to SimTrack Id = "<<SimTrackId<<endl;
570  }
571  }
572  }
573 
574 }
575 
577  float xEntry, float xExit,
578  const DTTopology &topo) {
579 
580  LocalPoint entryP = hit->entryPoint();
581  LocalPoint exitP = hit->exitPoint();
582 
583  DTTopology::Side entrySide = topo.onWhichBorder(xEntry,entryP.y(),entryP.z());
584  DTTopology::Side exitSide = topo.onWhichBorder(xExit,exitP.y(),exitP.z());
585  // ProcessTypeEnumerator pTypes;
586 
587  cout << endl
588  << "------- SimHit: " << endl
589  << " Particle type = " << hit->particleType() << endl
590  << " process type = " << hit->processType() << endl
591  << " process type = " << hit->processType() << endl
592  // << " packedTrackId = " << hit->packedTrackId() << endl
593  << " trackId = " << hit->trackId() << endl // new,is the same as the
594  // previous?? FIXME-Check
595  << " |p| = " << hit->pabs() << endl
596  << " Energy loss = " << hit->energyLoss() << endl
597  // << " timeOffset = " << hit->timeOffset() << endl
598  // << " measurementPosition = " << hit->measurementPosition() << endl
599  // << " measurementDirection = " << hit->measurementDirection() << endl //FIXME
600  << " localDirection = " << hit->momentumAtEntry().unit() << endl //FIXME is it a versor?
601  << " Entry point = " << entryP << " cell x = " << xEntry << endl
602  << " Exit point = " << exitP << " cell x = " << xExit << endl
603  << " DR = = " << (exitP-entryP).mag() << endl
604  << " Dx = = " << (exitP-entryP).x() << endl
605  << " Cell w,h,l = (" << topo.cellWidth()
606  << " , " << topo.cellHeight()
607  << " , " << topo.cellLenght() << ") cm" << endl
608  << " DY entry from edge = " << topo.cellLenght()/2.-fabs(entryP.y())
609  << " DY exit from edge = " << topo.cellLenght()/2.-fabs(exitP.y())
610  << " entrySide = " << (int)entrySide
611  << " ; exitSide = " << (int)exitSide << endl;
612 
613 }
614 
RunNumber_t run() const
Definition: EventID.h:42
dbl * delta
Definition: mlp_gen.cc:36
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
void dumpHit(const PSimHit *hit, float xEntry, float xExit, const DTTopology &topo)
Definition: DTDigitizer.cc:576
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
std::pair< float, bool > computeTime(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit, const LocalVector &BLoc)
Definition: DTDigitizer.cc:235
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:72
float asymGausSmear(double mean, double sigmaLeft, double sigmaRight) const
Definition: DTDigitizer.cc:446
Side onWhichBorder(float x, float y, float z) const
Definition: DTTopology.cc:109
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:63
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:68
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
void insertDigi(const IndexType &index, const DigiType &digi)
insert a digi for a given DetUnit
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
std::pair< float, bool > driftTimeFromParametrization(float x, float alpha, float By, float Bz) const
Definition: DTDigitizer.cc:375
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
int iEvent
Definition: GenABIO.cc:243
double time() const
Get time in ns.
Definition: DTDigi.cc:63
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
T mag() const
Definition: PV3DBase.h:67
void storeDigis(DTWireId &wireId, TDContainer &hits, DTDigiCollection &output, DTDigiSimLinkCollection &outputLinks)
Definition: DTDigitizer.cc:502
Local3DPoint localPosition() const
Definition: PSimHit.h:44
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
T sqrt(T t)
Definition: SSEVec.h:48
LocalPoint toLocal(const GlobalPoint &gp) const
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
T z() const
Definition: PV3DBase.h:64
bool isAvailable() const
Definition: Service.h:46
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTDigitizer(const edm::ParameterSet &)
Definition: DTDigitizer.cc:61
double f[11][100]
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:70
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
Definition: PSimHit.h:63
Side
Sides of the cell.
Definition: DTTopology.h:88
Definition: DTDigi.h:17
DTWireIdMap::const_iterator DTWireIdMapConstIter
Definition: DTDigitizer.h:51
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
uint32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:65
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:52
int wire() const
Return the wire number.
Definition: DTWireId.h:56
Vector3DBase unit() const
Definition: Vector3DBase.h:57
unsigned short MB_DT_drift_time(double x, double alpha, double by, double bz, short ifl, drift_time *DT, short interpolate) const
Calculate drift time and spread.
#define M_PI
Definition: BFit3D.cc:3
#define debug
Definition: HDRShower.cc:19
const T & get() const
Definition: EventSetup.h:55
tuple simHits
Definition: trackerHits.py:16
T const * product() const
Definition: Handle.h:81
unsigned short processType() const
Definition: PSimHit.h:118
std::vector< hitAndT > TDContainer
Definition: DTDigitizer.h:47
Structure used to return output values.
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:62
edm::EventID id() const
Definition: EventBase.h:56
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:75
int particleType() const
Definition: PSimHit.h:85
MuonDigiCollection< DTLayerId, DTDigi > DTDigiCollection
int number() const
Identifies different digis within the same.
Definition: DTDigi.cc:69
unsigned int trackId() const
Definition: PSimHit.h:102
float externalDelays(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit) const
Definition: DTDigitizer.cc:469
tuple cout
Definition: gather_cfg.py:121
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition: DTDigitizer.cc:137
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
MuonDigiCollection< DTLayerId, DTDigiSimLink > DTDigiSimLinkCollection
float cellLenght() const
Definition: DTTopology.h:73
T x() const
Definition: PV3DBase.h:62
std::pair< float, bool > driftTimeFromTimeMap() const
Definition: DTDigitizer.cc:461
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
std::map< DTWireId, std::vector< const PSimHit * > > DTWireIdMap
Definition: DTDigitizer.h:49
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
T get(const Candidate &c)
Definition: component.h:55
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:137