Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:27

0001 #include "SimPPS/RPDigiProducer/plugins/RPLinearInduceChargeOnStrips.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include <iostream>
0004 
0005 RPLinearInduceChargeOnStrips::RPLinearInduceChargeOnStrips(const edm::ParameterSet &params, RPDetId det_id)
0006     : det_id_(det_id), theRPDetTopology(params) {
0007   verbosity_ = params.getParameter<int>("RPVerbosity");
0008   signalCoupling_.clear();
0009   double coupling_constant_ = params.getParameter<double>("RPInterStripCoupling");
0010   signalCoupling_.push_back(coupling_constant_);
0011   signalCoupling_.push_back((1.0 - coupling_constant_) / 2.);
0012 
0013   no_of_strips_ = theRPDetTopology.DetStripNo();
0014 }
0015 
0016 simromanpot::strip_charge_map RPLinearInduceChargeOnStrips::Induce(
0017     const simromanpot::charge_induced_on_surface &charge_map) {
0018   theStripChargeMap.clear();
0019   const double sqrt_2 = sqrt(2.0);
0020   if (verbosity_)
0021     edm::LogInfo("RPLinearInduceChargeOnStrips ") << det_id_ << " : Clouds to be induced:" << charge_map.size() << "\n";
0022   for (simromanpot::charge_induced_on_surface::const_iterator i = charge_map.begin(); i != charge_map.end(); ++i) {
0023     double hit_pos;
0024     std::vector<strip_info> relevant_strips =
0025         theRPDetTopology.GetStripsInvolved((*i).Position().x(), (*i).Position().y(), (*i).Sigma(), hit_pos);
0026     if (verbosity_) {
0027       edm::LogInfo("RPLinearInduceChargeOnStrips ")
0028           << det_id_ << " : relevant_strips" << relevant_strips.size() << "\n";
0029     }
0030     for (std::vector<strip_info>::const_iterator j = relevant_strips.begin(); j != relevant_strips.end(); ++j) {
0031       double strip_begin = (*j).LowerBoarder();
0032       double strip_end = (*j).HigherBoarder();
0033       double effic = (*j).EffFactor();
0034       double sigma = (*i).Sigma();
0035       unsigned short str_no = (*j).StripNo();
0036 
0037       double charge_on_strip = (TMath::Erfc((strip_begin - hit_pos) / sqrt_2 / sigma) / 2.0 -
0038                                 TMath::Erfc((strip_end - hit_pos) / sqrt_2 / sigma) / 2.0) *
0039                                (*i).Charge() * effic;
0040       if (verbosity_)
0041         edm::LogInfo("RPLinearInduceChargeOnStrips") << "Efficiency " << det_id_ << " :" << effic << "\n";
0042 
0043       for (int k = -signalCoupling_.size() + 1; k < (int)signalCoupling_.size(); ++k) {
0044         if ((str_no + k) >= 0 && (str_no + k) < no_of_strips_)
0045           theStripChargeMap[str_no + k] += charge_on_strip * signalCoupling_[abs(k)];
0046       }
0047     }
0048   }
0049 
0050   return theStripChargeMap;
0051 }