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 TrapezoidalStripTopology *, 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_
 
const double cspeed
 
bool digitizeOnlyMuons_
 
const double elecEffLowCoeff
 
const double elecEffLowParam0
 
const double elecEffMidCoeff
 
const double elecEffMidParam0
 
const double elecEffMidParam1
 
const double elecMomCut1
 
const double elecMomCut2
 
const double momConvFact
 
const int muonPdgId
 
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 \modified by Roumyana Hadjiiska \splitted by Yechan Kang

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

Author
Sven Dildick \modified by Roumyana Hadjiiska \splitted 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  digitizeOnlyMuons_(config.getParameter<bool>("digitizeOnlyMuons")),
24  resolutionX_(config.getParameter<double>("resolutionX")),
25  muonPdgId(13),
27  momConvFact(1000.),
28  elecMomCut1(1.96e-03),
29  elecMomCut2(10.e-03),
30  elecEffLowCoeff(1.7e-05),
31  elecEffLowParam0(2.1),
32  elecEffMidCoeff(1.34),
33  elecEffMidParam0(-5.75e-01),
34  elecEffMidParam1(7.96e-01) {}

◆ ~GEMSignalModel()

GEMSignalModel::~GEMSignalModel ( )
override

Definition at line 36 of file GEMSignalModel.cc.

36 {}

Member Function Documentation

◆ getSimHitBx()

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

Definition at line 78 of file GEMSignalModel.cc.

78  {
79  int bx = -999;
80  const LocalPoint simHitPos(simhit->localPosition());
81  const float tof(simhit->timeOfFlight());
82  // random Gaussian time correction due to electronics jitter
83  float randomJitterTime = CLHEP::RandGaussQ::shoot(engine, 0., timeJitter_);
84  const GEMDetId id(simhit->detUnitId());
85  const GEMEtaPartition* roll(geometry_->etaPartition(id));
86  if (!roll) {
87  throw cms::Exception("Geometry") << "GEMSignalModel::getSimHitBx() - GEM simhit id does not match any GEM roll id: "
88  << id << "\n";
89  return 999;
90  }
91  if (roll->id().region() == 0) {
92  throw cms::Exception("Geometry")
93  << "GEMSignalModel::getSimHitBx() - this GEM id is from barrel, which cannot happen: " << roll->id() << "\n";
94  }
95  const int nstrips = roll->nstrips();
96  float middleStrip = nstrips / 2.;
97  const LocalPoint& middleOfRoll = roll->centreOfStrip(middleStrip);
98  const GlobalPoint& globMiddleRol = roll->toGlobal(middleOfRoll);
99  double muRadius = sqrt(globMiddleRol.x() * globMiddleRol.x() + globMiddleRol.y() * globMiddleRol.y() +
100  globMiddleRol.z() * globMiddleRol.z());
101  double timeCalibrationOffset_ = muRadius / cspeed; //[ns]
102 
103  const TrapezoidalStripTopology* top(dynamic_cast<const TrapezoidalStripTopology*>(&(roll->topology())));
104  const float halfStripLength(0.5 * top->stripLength());
105  const float distanceFromEdge(halfStripLength - simHitPos.y());
106 
107  // signal propagation speed in material in [cm/ns]
108  double signalPropagationSpeedTrue = signalPropagationSpeed_ * cspeed;
109 
110  // average time for the signal to propagate from the SimHit to the top of a strip
111  const float averagePropagationTime(distanceFromEdge / signalPropagationSpeedTrue);
112  // random Gaussian time correction due to the finite timing resolution of the detector
113  float randomResolutionTime = CLHEP::RandGaussQ::shoot(engine, 0., timeResolution_);
114  const float simhitTime(tof + averageShapingTime_ + randomResolutionTime + averagePropagationTime + randomJitterTime);
115  float referenceTime = 0.;
116  referenceTime = timeCalibrationOffset_ + halfStripLength / signalPropagationSpeedTrue + averageShapingTime_;
117  const float timeDifference(simhitTime - referenceTime);
118  // assign the bunch crossing
119  bx = static_cast<int>(std::round((timeDifference) / 25.));
120 
121  // check time
122  LogDebug("GEMDigiProducer") << "checktime "
123  << "bx = " << bx << "\tdeltaT = " << timeDifference << "\tsimT = " << simhitTime
124  << "\trefT = " << referenceTime << "\ttof = " << tof
125  << "\tavePropT = " << averagePropagationTime
126  << "\taveRefPropT = " << halfStripLength / signalPropagationSpeedTrue << "\n";
127  return bx;
128 }

References averageShapingTime_, l1GtPatternGenerator_cfi::bx, cspeed, PSimHit::detUnitId(), GEMGeometry::etaPartition(), Exception, GEMDigiModel::geometry_, triggerObjects_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().

◆ simulate()

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

Implements GEMDigiModel.

Definition at line 38 of file GEMSignalModel.cc.

42  {
43  bool digiMuon = false;
44  bool digiElec = false;
45  const TrapezoidalStripTopology* top(dynamic_cast<const TrapezoidalStripTopology*>(&(roll->topology())));
46  for (const auto& hit : simHits) {
47  if (std::abs(hit.particleType()) != muonPdgId && digitizeOnlyMuons_)
48  continue;
49  double elecEff = 0.;
50  double partMom = hit.pabs();
51  double checkMuonEff = CLHEP::RandFlat::shoot(engine, 0., 1.);
52  double checkElecEff = CLHEP::RandFlat::shoot(engine, 0., 1.);
53  if (std::abs(hit.particleType()) == muonPdgId && checkMuonEff < averageEfficiency_)
54  digiMuon = true;
55  if (std::abs(hit.particleType()) != muonPdgId) //consider all non muon particles with gem efficiency to electrons
56  {
57  if (partMom <= elecMomCut1)
58  elecEff = elecEffLowCoeff * std::exp(elecEffLowParam0 * partMom * momConvFact);
59  if (partMom > elecMomCut1 && partMom < elecMomCut2)
62  if (partMom > elecMomCut2)
63  elecEff = 1.;
64  if (checkElecEff < elecEff)
65  digiElec = true;
66  }
67  if (!(digiMuon || digiElec))
68  continue;
69  const int bx(getSimHitBx(&hit, engine));
70  const std::vector<std::pair<int, int> >& cluster(simulateClustering(top, &hit, bx, engine));
71  for (const auto& digi : cluster) {
72  detectorHitMap_.emplace(digi, &hit);
73  strips_.emplace(digi);
74  }
75  }
76 }

References funct::abs(), averageEfficiency_, l1GtPatternGenerator_cfi::bx, digitizeOnlyMuons_, elecEffLowCoeff, elecEffLowParam0, elecEffMidCoeff, elecEffMidParam0, elecEffMidParam1, elecMomCut1, elecMomCut2, JetChargeProducer_cfi::exp, getSimHitBx(), dqm-mbProfile::log, momConvFact, muonPdgId, FastTrackerRecHitCombiner_cfi::simHits, simulateClustering(), and GEMEtaPartition::topology().

◆ simulateClustering()

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

Definition at line 130 of file GEMSignalModel.cc.

133  {
134  const LocalPoint& hit_entry(simHit->entryPoint());
135  const LocalPoint& hit_exit(simHit->exitPoint());
136 
137  LocalPoint start_point, end_point;
138  if (hit_entry.x() < hit_exit.x()) {
139  start_point = hit_entry;
140  end_point = hit_exit;
141  } else {
142  start_point = hit_exit;
143  end_point = hit_entry;
144  }
145 
146  // Add Gaussian noise to the points towards outside.
147  float smeared_start_x = start_point.x() - std::abs(CLHEP::RandGaussQ::shoot(engine, 0, resolutionX_));
148  float smeared_end_x = end_point.x() + std::abs(CLHEP::RandGaussQ::shoot(engine, 0, resolutionX_));
149 
150  LocalPoint smeared_start_point(smeared_start_x, start_point.y(), start_point.z());
151  LocalPoint smeared_end_point(smeared_end_x, end_point.y(), end_point.z());
152 
153  int cluster_start = top->channel(smeared_start_point);
154  int cluster_end = top->channel(smeared_end_point);
155 
156  std::vector<std::pair<int, int> > cluster;
157  for (int strip = cluster_start; strip <= cluster_end; strip++) {
158  cluster.emplace_back(strip, bx);
159  }
160 
161  return cluster;
162 }

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

Referenced by simulate().

Member Data Documentation

◆ averageEfficiency_

double GEMSignalModel::averageEfficiency_
private

Definition at line 41 of file GEMSignalModel.h.

Referenced by simulate().

◆ averageShapingTime_

double GEMSignalModel::averageShapingTime_
private

Definition at line 42 of file GEMSignalModel.h.

Referenced by getSimHitBx().

◆ 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 46 of file GEMSignalModel.h.

Referenced by simulate().

◆ elecEffLowCoeff

const double GEMSignalModel::elecEffLowCoeff
private

Definition at line 54 of file GEMSignalModel.h.

Referenced by simulate().

◆ elecEffLowParam0

const double GEMSignalModel::elecEffLowParam0
private

Definition at line 55 of file GEMSignalModel.h.

Referenced by simulate().

◆ elecEffMidCoeff

const double GEMSignalModel::elecEffMidCoeff
private

Definition at line 56 of file GEMSignalModel.h.

Referenced by simulate().

◆ elecEffMidParam0

const double GEMSignalModel::elecEffMidParam0
private

Definition at line 57 of file GEMSignalModel.h.

Referenced by simulate().

◆ elecEffMidParam1

const double GEMSignalModel::elecEffMidParam1
private

Definition at line 58 of file GEMSignalModel.h.

Referenced by simulate().

◆ elecMomCut1

const double GEMSignalModel::elecMomCut1
private

Definition at line 52 of file GEMSignalModel.h.

Referenced by simulate().

◆ elecMomCut2

const double GEMSignalModel::elecMomCut2
private

Definition at line 53 of file GEMSignalModel.h.

Referenced by simulate().

◆ momConvFact

const double GEMSignalModel::momConvFact
private

Definition at line 51 of file GEMSignalModel.h.

Referenced by simulate().

◆ muonPdgId

const int GEMSignalModel::muonPdgId
private

Definition at line 49 of file GEMSignalModel.h.

Referenced by simulate().

◆ resolutionX_

double GEMSignalModel::resolutionX_
private

Definition at line 47 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().

PSimHit::timeOfFlight
float timeOfFlight() const
Definition: PSimHit.h:73
GEMSignalModel::resolutionX_
double resolutionX_
Definition: GEMSignalModel.h:47
GEMSignalModel::elecEffMidParam0
const double elecEffMidParam0
Definition: GEMSignalModel.h:57
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
GEMSignalModel::digitizeOnlyMuons_
bool digitizeOnlyMuons_
Definition: GEMSignalModel.h:46
GEMEtaPartition
Definition: GEMEtaPartition.h:12
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
GEMSignalModel::muonPdgId
const int muonPdgId
Definition: GEMSignalModel.h:49
GEMSignalModel::cspeed
const double cspeed
Definition: GEMSignalModel.h:50
PSimHit::detUnitId
unsigned int detUnitId() const
Definition: PSimHit.h:97
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
config
Definition: config.py:1
TrapezoidalStripTopology::channel
int channel(const LocalPoint &) const override
Definition: TrapezoidalStripTopology.cc:102
GEMSignalModel::elecEffLowParam0
const double elecEffLowParam0
Definition: GEMSignalModel.h:55
GEMSignalModel::elecMomCut1
const double elecMomCut1
Definition: GEMSignalModel.h:52
TrapezoidalStripTopology
Definition: TrapezoidalStripTopology.h:21
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
PSimHit::localPosition
Local3DPoint localPosition() const
Definition: PSimHit.h:52
GEMSignalModel::averageShapingTime_
double averageShapingTime_
Definition: GEMSignalModel.h:42
Point3DBase< float, LocalTag >
GEMSignalModel::momConvFact
const double momConvFact
Definition: GEMSignalModel.h:51
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
GEMDetId
Definition: GEMDetId.h:17
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GEMEtaPartition::topology
const Topology & topology() const override
Definition: GEMEtaPartition.cc:14
GEMSignalModel::getSimHitBx
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
Definition: GEMSignalModel.cc:78
GEMSignalModel::elecEffLowCoeff
const double elecEffLowCoeff
Definition: GEMSignalModel.h:54
GEMSignalModel::elecEffMidParam1
const double elecEffMidParam1
Definition: GEMSignalModel.h:58
GEMSignalModel::elecEffMidCoeff
const double elecEffMidCoeff
Definition: GEMSignalModel.h:56
GEMSignalModel::signalPropagationSpeed_
double signalPropagationSpeed_
Definition: GEMSignalModel.h:45
GEMSignalModel::averageEfficiency_
double averageEfficiency_
Definition: GEMSignalModel.h:41
GEMDigiModel::GEMDigiModel
GEMDigiModel(const edm::ParameterSet &)
Definition: GEMDigiModel.h:48
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
GEMSignalModel::timeJitter_
double timeJitter_
Definition: GEMSignalModel.h:44
Exception
Definition: hltDiff.cc:246
GEMSignalModel::elecMomCut2
const double elecMomCut2
Definition: GEMSignalModel.h:53
GEMSignalModel::timeResolution_
double timeResolution_
Definition: GEMSignalModel.h:43
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
GEMDigiModel::geometry_
const GEMGeometry * geometry_
Definition: GEMDigiModel.h:47
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GEMSignalModel::simulateClustering
std::vector< std::pair< int, int > > simulateClustering(const TrapezoidalStripTopology *, const PSimHit *, const int, CLHEP::HepRandomEngine *)
Definition: GEMSignalModel.cc:130
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
GEMGeometry::etaPartition
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77