CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMSignalModel Class Reference

#include <GEMSignalModel.h>

Inheritance diagram for GEMSignalModel:
GEMDigiModel

Public Member Functions

 GEMSignalModel (const edm::ParameterSet &)
 
int getSimHitBx (const PSimHit *, CLHEP::HepRandomEngine *)
 
void simulate (const GEMEtaPartition *, const edm::PSimHitContainer &, CLHEP::HepRandomEngine *, Strips &, DetectorHitMap &) override
 
std::vector< std::pair< int, int > > simulateClustering (const GEMStripTopology *, const PSimHit *, const int, CLHEP::HepRandomEngine *)
 
 ~GEMSignalModel () override
 
- Public Member Functions inherited from GEMDigiModel
void setGeometry (const GEMGeometry *geom)
 
virtual ~GEMDigiModel ()
 

Private Attributes

double averageEfficiency_
 
double averageShapingTime_
 
bool bx0filter_
 
const double cspeed
 
bool digitizeOnlyMuons_
 
const double energyMinCut
 
double resolutionX_
 
double signalPropagationSpeed_
 
double timeJitter_
 
double timeResolution_
 

Additional Inherited Members

- Protected Member Functions inherited from GEMDigiModel
 GEMDigiModel (const edm::ParameterSet &)
 
- Protected Attributes inherited from GEMDigiModel
const GEMGeometrygeometry_
 

Detailed Description

Class for the GEM strip intrinsic noise simulation based on a very simple model Originally comes from GEMSimpleModel

Author
Sven Dildick by Roumyana Hadjiiska by Yechan Kang

Class for the GEM strip response simulation based on a very simple model Originally comes from GEMSimpleModel

Author
Sven Dildick by Roumyana Hadjiiska by Yechan Kang

Definition at line 24 of file GEMSignalModel.h.

Constructor & Destructor Documentation

◆ GEMSignalModel()

GEMSignalModel::GEMSignalModel ( const edm::ParameterSet config)

Definition at line 16 of file GEMSignalModel.cc.

18  averageEfficiency_(config.getParameter<double>("averageEfficiency")),
19  averageShapingTime_(config.getParameter<double>("averageShapingTime")),
20  timeResolution_(config.getParameter<double>("timeResolution")),
21  timeJitter_(config.getParameter<double>("timeJitter")),
22  signalPropagationSpeed_(config.getParameter<double>("signalPropagationSpeed")),
23  bx0filter_(config.getParameter<bool>("bx0filter")),
24  resolutionX_(config.getParameter<double>("resolutionX")),
26  // average energy required to remove an electron due to ionization for an Ar/CO2 gas mixture (in the ratio of 70/30) is 28.1 eV
27  energyMinCut(28.1e-09) {}
double averageEfficiency_
const double cspeed
Definition: config.py:1
double signalPropagationSpeed_
const double energyMinCut
double timeResolution_
GEMDigiModel(const edm::ParameterSet &)
Definition: GEMDigiModel.h:48
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
double averageShapingTime_

◆ ~GEMSignalModel()

GEMSignalModel::~GEMSignalModel ( )
override

Definition at line 29 of file GEMSignalModel.cc.

29 {}

Member Function Documentation

◆ getSimHitBx()

int GEMSignalModel::getSimHitBx ( const PSimHit simhit,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 51 of file GEMSignalModel.cc.

References averageShapingTime_, simKBmtfDigis_cfi::bx, cspeed, PSimHit::detUnitId(), GEMGeometry::etaPartition(), Exception, GEMDigiModel::geometry_, l1ctLayer2EG_cff::id, PSimHit::localPosition(), LogDebug, signalPropagationSpeed_, mathSSE::sqrt(), timeJitter_, PSimHit::timeOfFlight(), timeResolution_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by simulate().

51  {
52  int bx = -999;
53  const LocalPoint simHitPos(simhit->localPosition());
54  const float tof(simhit->timeOfFlight());
55  // random Gaussian time correction due to electronics jitter
56  float randomJitterTime = CLHEP::RandGaussQ::shoot(engine, 0., timeJitter_);
57  const GEMDetId id(simhit->detUnitId());
58  const GEMEtaPartition* roll(geometry_->etaPartition(id));
59  if (!roll) {
60  throw cms::Exception("Geometry") << "GEMSignalModel::getSimHitBx() - GEM simhit id does not match any GEM roll id: "
61  << id << "\n";
62  return 999;
63  }
64  if (roll->id().region() == 0) {
65  throw cms::Exception("Geometry")
66  << "GEMSignalModel::getSimHitBx() - this GEM id is from barrel, which cannot happen: " << roll->id() << "\n";
67  }
68  const int nstrips = roll->nstrips();
69  float middleStrip = nstrips / 2.;
70  const LocalPoint& middleOfRoll = roll->centreOfStrip(middleStrip);
71  const GlobalPoint& globMiddleRol = roll->toGlobal(middleOfRoll);
72  double muRadius = sqrt(globMiddleRol.x() * globMiddleRol.x() + globMiddleRol.y() * globMiddleRol.y() +
73  globMiddleRol.z() * globMiddleRol.z());
74  double timeCalibrationOffset_ = muRadius / cspeed; //[ns]
75 
76  const GEMStripTopology* top(dynamic_cast<const GEMStripTopology*>(&(roll->topology())));
77  const float halfStripLength(0.5 * top->stripLength());
78  const float distanceFromEdge(halfStripLength - simHitPos.y());
79 
80  // signal propagation speed in material in [cm/ns]
81  double signalPropagationSpeedTrue = signalPropagationSpeed_ * cspeed;
82 
83  // average time for the signal to propagate from the SimHit to the top of a strip
84  const float averagePropagationTime(distanceFromEdge / signalPropagationSpeedTrue);
85  // random Gaussian time correction due to the finite timing resolution of the detector
86  float randomResolutionTime = CLHEP::RandGaussQ::shoot(engine, 0., timeResolution_);
87  const float simhitTime(tof + averageShapingTime_ + randomResolutionTime + averagePropagationTime + randomJitterTime);
88  float referenceTime = 0.;
89  referenceTime = timeCalibrationOffset_ + halfStripLength / signalPropagationSpeedTrue + averageShapingTime_;
90  const float timeDifference(simhitTime - referenceTime);
91  // assign the bunch crossing
92  bx = static_cast<int>(std::round((timeDifference) / 25.));
93 
94  // check time
95  LogDebug("GEMDigiProducer") << "checktime "
96  << "bx = " << bx << "\tdeltaT = " << timeDifference << "\tsimT = " << simhitTime
97  << "\trefT = " << referenceTime << "\ttof = " << tof
98  << "\tavePropT = " << averagePropagationTime
99  << "\taveRefPropT = " << halfStripLength / signalPropagationSpeedTrue << "\n";
100  return bx;
101 }
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77
unsigned int detUnitId() const
Definition: PSimHit.h:97
T z() const
Definition: PV3DBase.h:61
const double cspeed
double signalPropagationSpeed_
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
double timeResolution_
Local3DPoint localPosition() const
Definition: PSimHit.h:52
const GEMGeometry * geometry_
Definition: GEMDigiModel.h:47
float timeOfFlight() const
Definition: PSimHit.h:73
double averageShapingTime_
#define LogDebug(id)

◆ simulate()

void GEMSignalModel::simulate ( const GEMEtaPartition roll,
const edm::PSimHitContainer simHits,
CLHEP::HepRandomEngine *  engine,
Strips strips_,
DetectorHitMap detectorHitMap_ 
)
overridevirtual

Implements GEMDigiModel.

Definition at line 31 of file GEMSignalModel.cc.

References simKBmtfDigis_cfi::bx, bx0filter_, energyMinCut, getSimHitBx(), FastTrackerRecHitCombiner_cfi::simHits, simulateClustering(), and GEMEtaPartition::topology().

35  {
36  const GEMStripTopology* top(dynamic_cast<const GEMStripTopology*>(&(roll->topology())));
37  for (const auto& hit : simHits) {
38  if (hit.energyLoss() < energyMinCut)
39  continue;
40  const int bx(getSimHitBx(&hit, engine));
41  if (bx != 0 and bx0filter_)
42  continue;
43  const std::vector<std::pair<int, int> >& cluster(simulateClustering(top, &hit, bx, engine));
44  for (const auto& digi : cluster) {
45  detectorHitMap_.emplace(digi, &hit);
46  strips_.emplace(digi);
47  }
48  }
49 }
std::vector< std::pair< int, int > > simulateClustering(const GEMStripTopology *, const PSimHit *, const int, CLHEP::HepRandomEngine *)
const double energyMinCut
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
const Topology & topology() const override

◆ simulateClustering()

std::vector< std::pair< int, int > > GEMSignalModel::simulateClustering ( const GEMStripTopology top,
const PSimHit simHit,
const int  bx,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 103 of file GEMSignalModel.cc.

References funct::abs(), simKBmtfDigis_cfi::bx, GEMStripTopology::channel(), resolutionX_, rpcPointValidation_cfi::simHit, digitizers_cfi::strip, and PV3DBase< T, PVType, FrameType >::x().

Referenced by simulate().

106  {
107  const LocalPoint& hit_entry(simHit->entryPoint());
108  const LocalPoint& hit_exit(simHit->exitPoint());
109 
110  LocalPoint start_point, end_point;
111  if (hit_entry.x() < hit_exit.x()) {
112  start_point = hit_entry;
113  end_point = hit_exit;
114  } else {
115  start_point = hit_exit;
116  end_point = hit_entry;
117  }
118 
119  // Add Gaussian noise to the points towards outside.
120  float smeared_start_x = start_point.x() - std::abs(CLHEP::RandGaussQ::shoot(engine, 0, resolutionX_));
121  float smeared_end_x = end_point.x() + std::abs(CLHEP::RandGaussQ::shoot(engine, 0, resolutionX_));
122 
123  LocalPoint smeared_start_point(smeared_start_x, start_point.y(), start_point.z());
124  LocalPoint smeared_end_point(smeared_end_x, end_point.y(), end_point.z());
125 
126  int cluster_start = top->channel(smeared_start_point);
127  int cluster_end = top->channel(smeared_end_point);
128 
129  std::vector<std::pair<int, int> > cluster;
130  for (int strip = cluster_start; strip <= cluster_end; strip++) {
131  cluster.emplace_back(strip, bx);
132  }
133 
134  return cluster;
135 }
int channel(const LocalPoint &) const override
T x() const
Definition: PV3DBase.h:59
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

◆ averageEfficiency_

double GEMSignalModel::averageEfficiency_
private

Definition at line 41 of file GEMSignalModel.h.

◆ averageShapingTime_

double GEMSignalModel::averageShapingTime_
private

Definition at line 42 of file GEMSignalModel.h.

Referenced by getSimHitBx().

◆ bx0filter_

bool GEMSignalModel::bx0filter_
private

Definition at line 46 of file GEMSignalModel.h.

Referenced by simulate().

◆ cspeed

const double GEMSignalModel::cspeed
private

Definition at line 50 of file GEMSignalModel.h.

Referenced by getSimHitBx().

◆ digitizeOnlyMuons_

bool GEMSignalModel::digitizeOnlyMuons_
private

Definition at line 47 of file GEMSignalModel.h.

◆ energyMinCut

const double GEMSignalModel::energyMinCut
private

Definition at line 51 of file GEMSignalModel.h.

Referenced by simulate().

◆ resolutionX_

double GEMSignalModel::resolutionX_
private

Definition at line 48 of file GEMSignalModel.h.

Referenced by simulateClustering().

◆ signalPropagationSpeed_

double GEMSignalModel::signalPropagationSpeed_
private

Definition at line 45 of file GEMSignalModel.h.

Referenced by getSimHitBx().

◆ timeJitter_

double GEMSignalModel::timeJitter_
private

Definition at line 44 of file GEMSignalModel.h.

Referenced by getSimHitBx().

◆ timeResolution_

double GEMSignalModel::timeResolution_
private

Definition at line 43 of file GEMSignalModel.h.

Referenced by getSimHitBx().