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