|
|
#include <DTDigitizer.h>
|
float | asymGausSmear (double mean, double sigmaLeft, double sigmaRight, CLHEP::HepRandomEngine *) const |
|
std::pair< float, bool > | computeTime (const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit, const LocalVector &BLoc, CLHEP::HepRandomEngine *) |
|
std::pair< float, bool > | driftTimeFromParametrization (float x, float alpha, float By, float Bz, CLHEP::HepRandomEngine *) const |
|
std::pair< float, bool > | driftTimeFromTimeMap () const |
|
void | dumpHit (const PSimHit *hit, float xEntry, float xExit, const DTTopology &topo) |
|
float | externalDelays (const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit) const |
|
void | storeDigis (DTWireId &wireId, TDContainer &hits, DTDigiCollection &output, DTDigiSimLinkCollection &outputLinks) |
|
Digitize the muon drift tubes. The parametrisation function in DTDriftTimeParametrization from P.G.Abia, J.Puerta is used in all cases where it is applicable.
- Authors
- : G. Bevilacqua, N. Amapane, G. Cerminara, R. Bellan
Definition at line 46 of file DTDigitizer.h.
◆ DTWireIdMap
◆ DTWireIdMapConstIter
◆ DTWireIdMapIter
◆ hitAndT
◆ TDContainer
◆ DTDigitizer()
◆ asymGausSmear()
float DTDigitizer::asymGausSmear |
( |
double |
mean, |
|
|
double |
sigmaLeft, |
|
|
double |
sigmaRight, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| const |
|
private |
◆ computeTime()
pair< float, bool > DTDigitizer::computeTime |
( |
const DTLayer * |
layer, |
|
|
const DTWireId & |
wireId, |
|
|
const PSimHit * |
hit, |
|
|
const LocalVector & |
BLoc, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| |
|
private |
Definition at line 231 of file DTDigitizer.cc.
238 int partType =
hit->particleType();
245 LogPrint(
"DTDigitizer") <<
"Hit local entry point: " << entryP << endl <<
"Hit local exit point: " << exitP << endl;
248 float xEntry = entryP.
x() - xwire;
249 float xExit = exitP.
x() - xwire;
252 LogPrint(
"DTDigitizer") <<
"wire position: " << xwire <<
" x entry in cell rf: " << xEntry
253 <<
" x exit in cell rf: " << xExit << endl;
262 pair<float, bool> driftTime(0.,
false);
270 LogPrint(
"DTDigitizer") <<
" e- hit in gas; discarding " << endl;
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);
290 float halfd =
d.mag() / 2.;
291 float BMag = BLoc.
mag();
293 float radius_B = (
pT.mag() / (0.3 * BMag)) * 100.;
295 if (radius_B > halfd) {
296 sagitta_B = radius_B -
sqrt(radius_B * radius_B - halfd * halfd);
298 sagitta_B = radius_B;
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;
319 || (entrySide == exitSide)
327 && (noParametrisation ==
false)) {
329 LogPrint(
"DTDigitizer") <<
"*** WARNING: hit is not straight, type = " << partType << endl;
334 if (!noParametrisation) {
348 if (fabs(
pt.z()) < 0.002) {
352 x = xEntry - (entryP.
z() * (xExit - xEntry)) / (exitP.
z() - entryP.
z());
361 if ((driftTime.second) ==
false) {
369 if (driftTime.second) {
References Vector3DBase< T, FrameTag >::cross(), ztail::d, debug, dumpMFGeometry_cfg::delta, DeadROC_duringRun::dir, Vector3DBase< T, FrameTag >::dot(), driftTimeFromParametrization(), driftTimeFromTimeMap(), dumpHit(), externalDelays(), IdealModel, M_PI, PV3DBase< T, PVType, FrameType >::mag(), DTTopology::none, DTTopology::onWhichBorder(), DiDispStaMuonMonitor_cfi::pt, PVValHelper::pT, DTLayer::specificTopology(), mathSSE::sqrt(), theConstVDrift, theta(), Vector3DBase< T, FrameTag >::unit(), DTWireId::wire(), DTTopology::wirePosition(), x, PV3DBase< T, PVType, FrameType >::x(), DTTopology::xMax, DTTopology::xMin, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by produce().
◆ driftTimeFromParametrization()
pair< float, bool > DTDigitizer::driftTimeFromParametrization |
( |
float |
x, |
|
|
float |
alpha, |
|
|
float |
By, |
|
|
float |
Bz, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| const |
|
private |
Definition at line 377 of file DTDigitizer.cc.
386 LogPrint(
"DTDigitizer") <<
"*** WARNING: parametrisation: x out of range = " <<
x <<
", skipping" << endl;
387 return pair<float, bool>(0.
f,
false);
395 float theta_par =
theta;
399 if (fabs(theta_par) > 45.) {
401 LogPrint(
"DTDigitizer") <<
"*** WARNING: extrapolating theta > 45: " <<
theta << endl;
404 if (fabs(By_par) > 0.75) {
406 LogPrint(
"DTDigitizer") <<
"*** WARNING: extrapolating Bnorm > 0.75: " << By_par << endl;
409 if (fabs(Bz_par) > 0.4) {
411 LogPrint(
"DTDigitizer") <<
"*** WARNING: extrapolating Bwire >0.4: " << Bz_par << endl;
420 LogPrint(
"DTDigitizer") <<
" Parametrisation: x, theta, Bnorm, Bwire = " <<
x <<
" " << theta_par <<
" "
421 << By_par <<
" " << Bz_par << endl
422 <<
" time=" <<
DT.t_drift <<
" sigma_m=" <<
DT.t_width_m <<
" sigma_p=" <<
DT.t_width_p
425 LogPrint(
"DTDigitizer") <<
"*** WARNING: call to parametrisation failed" << endl;
426 return pair<float, bool>(0.
f,
false);
440 double u = CLHEP::RandGaussQ::shoot(engine, 0.,
smearing);
444 LogPrint(
"DTDigitizer") <<
" drift time = " <<
time << endl;
446 return pair<float, bool>(
time,
true);
References asymGausSmear(), debug, GeomDetEnumerators::DT, f, RemoveAddSevLevel::flag, interpolate, SiStripPI::max, DTDriftTimeParametrization::MB_DT_drift_time(), smearing, theta(), ntuplemaker::time, and x.
Referenced by computeTime().
◆ driftTimeFromTimeMap()
pair< float, bool > DTDigitizer::driftTimeFromTimeMap |
( |
| ) |
const |
|
private |
◆ dumpHit()
void DTDigitizer::dumpHit |
( |
const PSimHit * |
hit, |
|
|
float |
xEntry, |
|
|
float |
xExit, |
|
|
const DTTopology & |
topo |
|
) |
| |
|
private |
Definition at line 567 of file DTDigitizer.cc.
576 <<
"------- SimHit: " << endl
577 <<
" Particle type = " <<
hit->particleType() << endl
578 <<
" process type = " <<
hit->processType() << endl
579 <<
" process type = " <<
hit->processType()
582 <<
" trackId = " <<
hit->trackId()
585 <<
" |p| = " <<
hit->pabs() << endl
586 <<
" Energy loss = " <<
hit->energyLoss()
592 <<
" localDirection = " <<
hit->momentumAtEntry().unit()
594 <<
" Entry point = " << entryP <<
" cell x = " << xEntry << endl
595 <<
" Exit point = " << exitP <<
" cell x = " << xExit << endl
596 <<
" DR = = " << (exitP - entryP).
mag() << endl
597 <<
" Dx = = " << (exitP - entryP).
x() << endl
600 <<
" DY entry from edge = " << topo.
cellLenght() / 2. - fabs(entryP.
y())
601 <<
" DY exit from edge = " << topo.
cellLenght() / 2. - fabs(exitP.
y())
602 <<
" entrySide = " << (
int)entrySide <<
" ; exitSide = " << (
int)exitSide << endl;
References DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), createfilelist::int, mag(), DTTopology::onWhichBorder(), x, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by computeTime().
◆ externalDelays()
float DTDigitizer::externalDelays |
( |
const DTLayer * |
layer, |
|
|
const DTWireId & |
wireId, |
|
|
const PSimHit * |
hit |
|
) |
| const |
|
private |
◆ produce()
Definition at line 134 of file DTDigitizer.cc.
139 LogPrint(
"DTDigitizer") <<
"--- Run: " <<
iEvent.id().run() <<
" Event: " <<
iEvent.id().event() << endl;
174 DTWireId wireId((*simHit).detUnitId());
176 wireMap[wireId].push_back(&(*
simHit));
179 pair<float, bool>
time(0.,
false);
185 const vector<const PSimHit *> &vhit = (*wire).second;
197 for (vector<const PSimHit *>::const_iterator
hit = vhit.begin();
hit != vhit.end();
hit++) {
207 tdCont.push_back(make_pair((*
hit),
time.first));
210 LogPrint(
"DTDigitizer") <<
"hit discarded" << endl;
References cf_token, computeTime(), debug, geometryType, edm::EventSetup::get(), get, edm::RandomNumberGenerator::getEngine(), iEvent, MagneticField::inTesla(), DTGeometry::layer(), DTWireId::layerId(), eostools::move(), convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), rpcPointValidation_cfi::simHit, FastTrackerRecHitCombiner_cfi::simHits, storeDigis(), GeomDet::surface(), ntuplemaker::time, Surface::toGlobal(), and GloballyPositioned< T >::toLocal().
◆ storeDigis()
Definition at line 500 of file DTDigitizer.cc.
507 sort(
hits.begin(),
hits.end(), hitLessT());
511 float wakeTime = -999999.0;
512 float resolTime = -999999.0;
523 float time = (*hit).second;
524 if (
time > wakeTime) {
526 int wireN = wireId.
wire();
531 unsigned int SimTrackId = (*hit).first->trackId();
536 LogPrint(
"DTDigitizer") << endl <<
"---- DTDigitizer ----" << endl;
537 LogPrint(
"DTDigitizer") <<
"wireId: " << wireId << endl;
538 LogPrint(
"DTDigitizer") <<
"sim. time = " <<
time << endl;
539 LogPrint(
"DTDigitizer") <<
"digi number = " << digi.
number() <<
", digi time = " << digi.
time()
540 <<
", linked to SimTrack Id = " << SimTrackId << endl;
545 output.insertDigi(layerID, digi);
550 int wireN = wireId.
wire();
551 unsigned int SimTrackId = (*hit).first->trackId();
558 LogPrint(
"DTDigitizer") <<
"\nAdded multiple link: \n"
559 <<
"digi number = " << digi.
number() <<
", digi time = " << digi.
time()
560 <<
" (sim. time = " <<
time <<
")"
561 <<
", linked to SimTrack Id = " << SimTrackId << endl;
References funct::abs(), base, deadTime, debug, hfClusterShapes_cfi::hits, MuonDigiCollection< IndexType, DigiType >::insertDigi(), DTWireId::layerId(), LinksTimeWindow, MultipleLinks, DTDigi::number(), onlyMuHits, convertSQLitetoXML_cfg::output, DTDigi::time(), ntuplemaker::time, and DTWireId::wire().
Referenced by produce().
◆ DTDigitizerAnalysis
friend class DTDigitizerAnalysis |
|
friend |
◆ base
◆ cf_token
◆ collection_for_XF
std::string DTDigitizer::collection_for_XF |
|
private |
◆ deadTime
float DTDigitizer::deadTime |
|
private |
◆ debug
◆ geometryType
std::string DTDigitizer::geometryType |
|
private |
◆ IdealModel
bool DTDigitizer::IdealModel |
|
private |
◆ interpolate
bool DTDigitizer::interpolate |
|
private |
◆ LinksTimeWindow
float DTDigitizer::LinksTimeWindow |
|
private |
◆ mix_
std::string DTDigitizer::mix_ |
|
private |
◆ MultipleLinks
bool DTDigitizer::MultipleLinks |
|
private |
◆ onlyMuHits
bool DTDigitizer::onlyMuHits |
|
private |
◆ smearing
float DTDigitizer::smearing |
|
private |
◆ syncName
std::string DTDigitizer::syncName |
|
private |
◆ theConstVDrift
float DTDigitizer::theConstVDrift |
|
private |
◆ theSync
◆ vPropWire
double DTDigitizer::vPropWire |
|
private |
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.
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
int wire() const
Return the wire number.
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
std::map< DTWireId, std::vector< const PSimHit * > > DTWireIdMap
T const * product() const
int number() const
Identifies different digis within the same cell.
void dumpHit(const PSimHit *hit, float xEntry, float xExit, const DTTopology &topo)
std::pair< float, bool > driftTimeFromParametrization(float x, float alpha, float By, float Bz, CLHEP::HepRandomEngine *) const
MuonDigiCollection< DTLayerId, DTDigi > DTDigiCollection
T getUntrackedParameter(std::string const &, T const &) const
double time() const
Get time in ns.
float cellWidth() const
Returns the cell width.
const Plane & surface() const
The nominal surface of the GeomDet.
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Vector3DBase unit() const
Structure used to return output values.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Geom::Theta< T > theta() const
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
Side onWhichBorder(float x, float y, float z) const
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
void storeDigis(DTWireId &wireId, TDContainer &hits, DTDigiCollection &output, DTDigiSimLinkCollection &outputLinks)
float asymGausSmear(double mean, double sigmaLeft, double sigmaRight, CLHEP::HepRandomEngine *) const
DTWireIdMap::const_iterator DTWireIdMapConstIter
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
std::unique_ptr< DTDigiSyncBase > theSync
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
float cellHeight() const
Returns the cell height.
T getParameter(std::string const &) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
MuonDigiCollection< DTLayerId, DTDigiSimLink > DTDigiSimLinkCollection
LocalPoint toLocal(const GlobalPoint &gp) const
std::vector< hitAndT > TDContainer
std::string collection_for_XF
void insertDigi(const IndexType &index, const DigiType &digi)
insert a digi for a given DetUnit
std::pair< float, bool > driftTimeFromTimeMap() const
const DTTopology & specificTopology() const
std::pair< float, bool > computeTime(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit, const LocalVector &BLoc, CLHEP::HepRandomEngine *)
DTLayerId layerId() const
Return the corresponding LayerId.
Abs< T >::type abs(const T &t)
float externalDelays(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit) const