|
|
#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 52 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 225 of file DTDigitizer.cc.
232 int partType =
hit->particleType();
239 LogPrint(
"DTDigitizer") <<
"Hit local entry point: " << entryP << endl <<
"Hit local exit point: " << exitP << endl;
242 float xEntry = entryP.
x() - xwire;
243 float xExit = exitP.
x() - xwire;
246 LogPrint(
"DTDigitizer") <<
"wire position: " << xwire <<
" x entry in cell rf: " << xEntry
247 <<
" x exit in cell rf: " << xExit << endl;
256 pair<float, bool> driftTime(0.,
false);
264 LogPrint(
"DTDigitizer") <<
" e- hit in gas; discarding " << endl;
277 float cosAlpha = hHat.
dot(pHat);
278 float sinAlpha =
sqrt(1. - cosAlpha * cosAlpha);
279 float radius_P = (
d.mag()) / (2. * cosAlpha);
280 float sagitta_P = radius_P * (1. - sinAlpha);
284 float halfd =
d.mag() / 2.;
285 float BMag = BLoc.
mag();
287 float radius_B = (
pT.mag() / (0.3 * BMag)) * 100.;
289 if (radius_B > halfd) {
290 sagitta_B = radius_B -
sqrt(radius_B * radius_B - halfd * halfd);
292 sagitta_B = radius_B;
300 <<
" cosAlpha = " << cosAlpha << endl
301 <<
" sinAlpha = " << sinAlpha << endl
302 <<
" pMag = " <<
pT.mag() << endl
303 <<
" bMag = " << BMag << endl
304 <<
" pT = " <<
pT << endl
305 <<
" halfd = " << halfd << endl
306 <<
" radius_P (cm) = " << radius_P << endl
307 <<
" sagitta_P (um) = " << sagitta_P * 10000. << endl
308 <<
" radius_B (cm) = " << radius_B << endl
309 <<
" sagitta_B (um) = " << sagitta_B * 10000. << endl;
313 || (entrySide == exitSide)
321 && (noParametrisation ==
false)) {
323 LogPrint(
"DTDigitizer") <<
"*** WARNING: hit is not straight, type = " << partType << endl;
328 if (!noParametrisation) {
342 if (fabs(
pt.z()) < 0.002) {
346 x = xEntry - (entryP.
z() * (xExit - xEntry)) / (exitP.
z() - entryP.
z());
355 if ((driftTime.second) ==
false) {
363 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, phase1PixelTopology::layer, M_PI, PV3DBase< T, PVType, FrameType >::mag(), DTTopology::none, DTTopology::onWhichBorder(), DiDispStaMuonMonitor_cfi::pt, PVValHelper::pT, 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 371 of file DTDigitizer.cc.
380 LogPrint(
"DTDigitizer") <<
"*** WARNING: parametrisation: x out of range = " <<
x <<
", skipping" << endl;
381 return pair<float, bool>(0.
f,
false);
389 float theta_par =
theta;
393 if (fabs(theta_par) > 45.) {
395 LogPrint(
"DTDigitizer") <<
"*** WARNING: extrapolating theta > 45: " <<
theta << endl;
398 if (fabs(By_par) > 0.75) {
400 LogPrint(
"DTDigitizer") <<
"*** WARNING: extrapolating Bnorm > 0.75: " << By_par << endl;
403 if (fabs(Bz_par) > 0.4) {
405 LogPrint(
"DTDigitizer") <<
"*** WARNING: extrapolating Bwire >0.4: " << Bz_par << endl;
414 LogPrint(
"DTDigitizer") <<
" Parametrisation: x, theta, Bnorm, Bwire = " <<
x <<
" " << theta_par <<
" "
415 << By_par <<
" " << Bz_par << endl
416 <<
" time=" <<
DT.t_drift <<
" sigma_m=" <<
DT.t_width_m <<
" sigma_p=" <<
DT.t_width_p
419 LogPrint(
"DTDigitizer") <<
"*** WARNING: call to parametrisation failed" << endl;
420 return pair<float, bool>(0.
f,
false);
434 double u = CLHEP::RandGaussQ::shoot(engine, 0.,
smearing);
438 LogPrint(
"DTDigitizer") <<
" drift time = " <<
time << endl;
440 return pair<float, bool>(
time,
true);
References asymGausSmear(), debug, GeomDetEnumerators::DT, f, RemoveAddSevLevel::flag, interpolate, SiStripPI::max, DTDriftTimeParametrization::MB_DT_drift_time(), smearing, theta(), protons_cff::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 561 of file DTDigitizer.cc.
570 <<
"------- SimHit: " << endl
571 <<
" Particle type = " <<
hit->particleType() << endl
572 <<
" process type = " <<
hit->processType() << endl
573 <<
" process type = " <<
hit->processType()
576 <<
" trackId = " <<
hit->trackId()
579 <<
" |p| = " <<
hit->pabs() << endl
580 <<
" Energy loss = " <<
hit->energyLoss()
586 <<
" localDirection = " <<
hit->momentumAtEntry().unit()
588 <<
" Entry point = " << entryP <<
" cell x = " << xEntry << endl
589 <<
" Exit point = " << exitP <<
" cell x = " << xExit << endl
590 <<
" DR = = " << (exitP - entryP).
mag() << endl
591 <<
" Dx = = " << (exitP - entryP).
x() << endl
594 <<
" DY entry from edge = " << topo.
cellLenght() / 2. - fabs(entryP.
y())
595 <<
" DY exit from edge = " << topo.
cellLenght() / 2. - fabs(exitP.
y())
596 <<
" 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 130 of file DTDigitizer.cc.
135 LogPrint(
"DTDigitizer") <<
"--- Run: " <<
iEvent.id().run() <<
" Event: " <<
iEvent.id().event() << endl;
168 DTWireId wireId((*simHit).detUnitId());
170 wireMap[wireId].push_back(&(*
simHit));
173 pair<float, bool>
time(0.,
false);
179 const vector<const PSimHit *> &vhit = (*wire).second;
191 for (vector<const PSimHit *>::const_iterator
hit = vhit.begin();
hit != vhit.end();
hit++) {
201 tdCont.push_back(make_pair((*
hit),
time.first));
204 LogPrint(
"DTDigitizer") <<
"hit discarded" << endl;
References cf_token, computeTime(), debug, edm::RandomNumberGenerator::getEngine(), edm::EventSetup::getHandle(), iEvent, MagneticField::inTesla(), DTGeometry::layer(), phase1PixelTopology::layer, DTWireId::layerId(), magnField_token, eostools::move(), muonGeom_token, convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), rpcPointValidation_cfi::simHit, FastTrackerRecHitCombiner_cfi::simHits, storeDigis(), and protons_cff::time.
◆ storeDigis()
Definition at line 494 of file DTDigitizer.cc.
505 float wakeTime = -999999.0;
506 float resolTime = -999999.0;
517 float time = (*hit).second;
518 if (
time > wakeTime) {
520 int wireN = wireId.
wire();
525 unsigned int SimTrackId = (*hit).first->trackId();
530 LogPrint(
"DTDigitizer") << endl <<
"---- DTDigitizer ----" << endl;
531 LogPrint(
"DTDigitizer") <<
"wireId: " << wireId << endl;
532 LogPrint(
"DTDigitizer") <<
"sim. time = " <<
time << endl;
533 LogPrint(
"DTDigitizer") <<
"digi number = " << digi.
number() <<
", digi time = " << digi.
time()
534 <<
", linked to SimTrack Id = " << SimTrackId << endl;
539 output.insertDigi(layerID, digi);
544 int wireN = wireId.
wire();
545 unsigned int SimTrackId = (*hit).first->trackId();
552 LogPrint(
"DTDigitizer") <<
"\nAdded multiple link: \n"
553 <<
"digi number = " << digi.
number() <<
", digi time = " << digi.
time()
554 <<
" (sim. time = " <<
time <<
")"
555 <<
", 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, jetUpdater_cfi::sort, protons_cff::time, DTDigi::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 |
◆ magnField_token
◆ mix_
std::string DTDigitizer::mix_ |
|
private |
◆ MultipleLinks
bool DTDigitizer::MultipleLinks |
|
private |
◆ muonGeom_token
◆ 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.
Log< level::Warning, true > LogPrint
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.
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.
Geom::Theta< T > theta() const
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magnField_token
Side onWhichBorder(float x, float y, float z) const
constexpr std::array< uint8_t, layerIndexSize > layer
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
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
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 mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
MuonDigiCollection< DTLayerId, DTDigiSimLink > DTDigiSimLinkCollection
std::vector< hitAndT > TDContainer
std::string collection_for_XF
void insertDigi(const IndexType &index, const DigiType &digi)
insert a digi for a given DetUnit
T getParameter(std::string const &) const
std::pair< float, bool > driftTimeFromTimeMap() 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)
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeom_token
float externalDelays(const DTLayer *layer, const DTWireId &wireId, const PSimHit *hit) const