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  resolutionX_(config.getParameter<double>("resolutionX")),
25  // 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
26  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 28 of file GEMSignalModel.cc.

28 {}

Member Function Documentation

◆ getSimHitBx()

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

Definition at line 48 of file GEMSignalModel.cc.

References averageShapingTime_, nano_mu_digi_cff::bx, cspeed, PSimHit::detUnitId(), GEMGeometry::etaPartition(), Exception, GEMDigiModel::geometry_, l1ctLayer2EG_cff::id, PSimHit::localPosition(), LogDebug, nano_mu_digi_cff::roll, 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().

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

References nano_mu_digi_cff::bx, energyMinCut, getSimHitBx(), nano_mu_digi_cff::roll, FastTrackerRecHitCombiner_cfi::simHits, and simulateClustering().

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

◆ simulateClustering()

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

Definition at line 100 of file GEMSignalModel.cc.

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

Referenced by simulate().

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

◆ 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().