CMS 3D CMS Logo

RPLinearInduceChargeOnStrips.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6  : det_id_(det_id), theRPDetTopology(params) {
7  verbosity_ = params.getParameter<int>("RPVerbosity");
8  signalCoupling_.clear();
9  double coupling_constant_ = params.getParameter<double>("RPInterStripCoupling");
10  signalCoupling_.push_back(coupling_constant_);
11  signalCoupling_.push_back((1.0 - coupling_constant_) / 2.);
12 
14 }
15 
17  const simromanpot::charge_induced_on_surface &charge_map) {
18  theStripChargeMap.clear();
19  const double sqrt_2 = sqrt(2.0);
20  if (verbosity_)
21  edm::LogInfo("RPLinearInduceChargeOnStrips ") << det_id_ << " : Clouds to be induced:" << charge_map.size() << "\n";
22  for (simromanpot::charge_induced_on_surface::const_iterator i = charge_map.begin(); i != charge_map.end(); ++i) {
23  double hit_pos;
24  std::vector<strip_info> relevant_strips =
25  theRPDetTopology.GetStripsInvolved((*i).Position().x(), (*i).Position().y(), (*i).Sigma(), hit_pos);
26  if (verbosity_) {
27  edm::LogInfo("RPLinearInduceChargeOnStrips ")
28  << det_id_ << " : relevant_strips" << relevant_strips.size() << "\n";
29  }
30  for (std::vector<strip_info>::const_iterator j = relevant_strips.begin(); j != relevant_strips.end(); ++j) {
31  double strip_begin = (*j).LowerBoarder();
32  double strip_end = (*j).HigherBoarder();
33  double effic = (*j).EffFactor();
34  double sigma = (*i).Sigma();
35  unsigned short str_no = (*j).StripNo();
36 
37  double charge_on_strip = (TMath::Erfc((strip_begin - hit_pos) / sqrt_2 / sigma) / 2.0 -
38  TMath::Erfc((strip_end - hit_pos) / sqrt_2 / sigma) / 2.0) *
39  (*i).Charge() * effic;
40  if (verbosity_)
41  edm::LogInfo("RPLinearInduceChargeOnStrips") << "Efficiency " << det_id_ << " :" << effic << "\n";
42 
43  for (int k = -signalCoupling_.size() + 1; k < (int)signalCoupling_.size(); ++k) {
44  if ((str_no + k) >= 0 && (str_no + k) < no_of_strips_)
45  theStripChargeMap[str_no + k] += charge_on_strip * signalCoupling_[abs(k)];
46  }
47  }
48  }
49 
50  return theStripChargeMap;
51 }
simromanpot::strip_charge_map Induce(const simromanpot::charge_induced_on_surface &charge_map)
RPLinearInduceChargeOnStrips(const edm::ParameterSet &params, RPDetId det_id)
std::vector< RPSignalPoint > charge_induced_on_surface
Definition: RPSimTypes.h:15
simromanpot::strip_charge_map theStripChargeMap
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint32_t RPDetId
Definition: RPSimTypes.h:11
Log< level::Info, false > LogInfo
std::map< unsigned short, double > strip_charge_map
Definition: RPSimTypes.h:14
std::vector< strip_info > GetStripsInvolved(double x, double y, double sigma, double &hit_pos)
unsigned short DetStripNo() const
Definition: RPTopology.h:42