CMS 3D CMS Logo

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

#include <RPixChargeShare.h>

Public Member Functions

 RPixChargeShare (const edm::ParameterSet &params, uint32_t det_id)
 
std::map< unsigned short, double > Share (const std::vector< RPixSignalPoint > &charge_map)
 

Private Attributes

double chargeMap2E_ [4][60][40]
 
std::string ChargeMapFile2E_ [4]
 
uint32_t det_id_
 
int no_of_pixels_
 
const int pxlColSize_ = pxlInd.getDefaultColDetSize()
 
CTPPSPixelIndices pxlInd
 
const int pxlRowSize_ = pxlInd.getDefaultRowDetSize()
 
std::vector< double > signalCoupling_
 
CTPPSPixelSimTopology theRPixDetTopology_
 
int verbosity_
 
const int xBinMax_ [4] = {29, 59, 29, 59}
 
const int yBinMax_ [4] = {19, 19, 39, 39}
 

Detailed Description

Definition at line 9 of file RPixChargeShare.h.

Constructor & Destructor Documentation

◆ RPixChargeShare()

RPixChargeShare::RPixChargeShare ( const edm::ParameterSet params,
uint32_t  det_id 
)

Definition at line 5 of file RPixChargeShare.cc.

6  : det_id_(det_id), theRPixDetTopology_() {
7  verbosity_ = params.getParameter<int>("RPixVerbosity");
8  signalCoupling_.clear();
9  ChargeMapFile2E_[0] = params.getParameter<std::string>("ChargeMapFile2E");
10  ChargeMapFile2E_[1] = params.getParameter<std::string>("ChargeMapFile2E_2X");
11  ChargeMapFile2E_[2] = params.getParameter<std::string>("ChargeMapFile2E_2Y");
12  ChargeMapFile2E_[3] = params.getParameter<std::string>("ChargeMapFile2E_2X2Y");
13 
14  double coupling_constant_ = params.getParameter<double>("RPixCoupling");
15 
16  signalCoupling_.push_back(coupling_constant_);
17  signalCoupling_.push_back((1.0 - coupling_constant_) / 2);
18 
20 
21  double xMap, yMap;
22  double chargeprobcollect;
23  int xUpper[] = {75, 150, 75, 150};
24  int yUpper[] = {50, 50, 100, 100};
25  int ix, iy;
26  for (int i = 0; i < 4; i++) {
27  std::ifstream fChargeMap(ChargeMapFile2E_[i]);
28  if (fChargeMap.is_open()) {
29  while (fChargeMap >> xMap >> yMap >> chargeprobcollect) {
30  ix = int((xMap + xUpper[i]) / 5);
31  iy = int((yMap + yUpper[i]) / 5);
32  chargeMap2E_[i][ix][iy] = chargeprobcollect;
33  }
34  fChargeMap.close();
35  } else
36  throw cms::Exception("RPixChargeShare") << "Charge map file not found";
37  }
38 }

References chargeMap2E_, ChargeMapFile2E_, CTPPSPixelTopology::detPixelNo(), Exception, mps_fire::i, createfilelist::int, no_of_pixels_, CalibrationSummaryClient_cfi::params, signalCoupling_, AlCaHLTBitMon_QueryRunRegistry::string, theRPixDetTopology_, verbosity_, and edmStreamStallGrapher::xUpper.

Member Function Documentation

◆ Share()

std::map< unsigned short, double > RPixChargeShare::Share ( const std::vector< RPixSignalPoint > &  charge_map)

Definition at line 40 of file RPixChargeShare.cc.

40  {
41  std::map<unsigned short, double> thePixelChargeMap;
42  if (verbosity_ > 1)
43  edm::LogInfo("RPixChargeShare") << det_id_ << " : Clouds to be induced= " << charge_map.size();
44 
45  double CH = 0;
46 
47  for (std::vector<RPixSignalPoint>::const_iterator i = charge_map.begin(); i != charge_map.end(); ++i) {
48  double hit_pos_x, hit_pos_y;
49  // Used to avoid the abort due to hits out of detector
50  if (((*i).Position().x() + 16.6 / 2) < 0 || ((*i).Position().x() + 16.6 / 2) > 16.6) {
51  edm::LogInfo("RPixChargeShare")
52  << "**** Attention ((*i).Position().x()+simX_width_/2.)<0||((*i).Position().x()+simX_width_/2.)>simX_width ";
53  edm::LogInfo("RPixChargeShare") << "(*i).Position().x() = " << (*i).Position().x();
54  continue;
55  }
56  if (((*i).Position().y() + 24.4 / 2.) < 0 || ((*i).Position().y() + 24.4 / 2.) > 24.4) {
57  edm::LogInfo("RPixChargeShare")
58  << "**** Attention ((*i).Position().y()+simY_width_/2.)<0||((*i).Position().y()+simY_width_/2.)>simY_width ";
59  edm::LogInfo("RPixChargeShare") << "(*i).Position().y() = " << (*i).Position().y();
60  continue;
61  }
62 
64  (*i).Position().x(), (*i).Position().y(), (*i).Sigma(), hit_pos_x, hit_pos_y);
65  double effic = relevant_pixels.effFactor();
66 
67  unsigned short pixel_no = relevant_pixels.pixelIndex();
68 
69  double charge_in_pixel = (*i).Charge() * effic;
70 
71  CH += charge_in_pixel;
72 
73  if (verbosity_ > 1)
74  edm::LogInfo("RPixChargeShare") << "Efficiency in detector " << det_id_ << " and pixel no " << pixel_no << " : "
75  << effic << " ch: " << charge_in_pixel << " CHtot: " << CH;
76 
77  // QUI SI POTREBBE INTRODURRE IL CHARGE SHARING TRA I PIXELS ..................................
78 
79  if (signalCoupling_[0] == 0.) {
80  thePixelChargeMap[pixel_no] += charge_in_pixel;
81  } else {
82  int pixel_row = relevant_pixels.pixelRowNo();
83  int pixel_col = relevant_pixels.pixelColNo();
84  double pixel_lower_x = 0;
85  double pixel_lower_y = 0;
86  double pixel_upper_x = 0;
87  double pixel_upper_y = 0;
88  int psize = 0;
89  theRPixDetTopology_.pixelRange(pixel_row, pixel_col, pixel_lower_x, pixel_upper_x, pixel_lower_y, pixel_upper_y);
90  double pixel_width_x = pixel_upper_x - pixel_lower_x;
91  double pixel_width_y = pixel_upper_y - pixel_lower_y;
92  if (pixel_row == 0 || pixel_row == pxlRowSize_ - 1)
93  pixel_width_x = 0.1; // Correct edge pixel width
94  if (pixel_col == 0 || pixel_col == pxlColSize_ - 1)
95  pixel_width_y = 0.15; //
96  double pixel_center_x = pixel_lower_x + (pixel_width_x) / 2.;
97  double pixel_center_y = pixel_lower_y + (pixel_width_y) / 2.;
98  // xbin and ybin are coordinates (um) ??nside the pixel as in the test beam, swapped wrt plane coodinates.
99  int xbin = int((((*i).Position().y() - pixel_center_y) + pixel_width_y / 2.) * 1.e3 / 5.);
100  int ybin = int((((*i).Position().x() - pixel_center_x) + pixel_width_x / 2.) * 1.e3 / 5.);
101  if (pixel_width_x < 0.11 && pixel_width_y < 0.151) { // pixel 100x150 um^2
102  psize = 0;
103  if (xbin > xBinMax_[psize] || ybin > yBinMax_[psize])
104  continue;
105  }
106  if (pixel_width_x > 0.11 && pixel_width_y < 0.151) { // pixel 200x150 um^2
107  psize = 2;
108  if (xbin > xBinMax_[psize] || ybin > yBinMax_[psize])
109  continue;
110  }
111  if (pixel_width_x < 0.11 && pixel_width_y > 0.151) { // pixel 100x300 um^2
112  psize = 1;
113  if (xbin > xBinMax_[psize] || ybin > yBinMax_[psize])
114  continue;
115  }
116  if (pixel_width_x > 0.11 && pixel_width_y > 0.151) { // pixel 200x300 um^2
117  psize = 3;
118  if (xbin > xBinMax_[psize] || ybin > yBinMax_[psize])
119  continue;
120  }
121  double hit2neighbour[8];
122  double collect_prob = chargeMap2E_[psize][xbin][ybin];
123  thePixelChargeMap[pixel_no] += charge_in_pixel * collect_prob;
124  unsigned short neighbour_no[8];
125  unsigned short m = 0;
126  double closer_neighbour = 0;
127  unsigned short closer_no = 0;
128  // Considering the 8 neighbours to share charge
129  for (int k = pixel_row - 1; k <= pixel_row + 1; k++) {
130  for (int l = pixel_col - 1; l <= pixel_col + 1; l++) {
131  if ((k < 0) || k > pxlRowSize_ - 1 || l < 0 || l > pxlColSize_ - 1)
132  continue;
133  if ((k == pixel_row) && (l == pixel_col))
134  continue;
135  double neighbour_pixel_lower_x = 0;
136  double neighbour_pixel_lower_y = 0;
137  double neighbour_pixel_upper_x = 0;
138  double neighbour_pixel_upper_y = 0;
139  double neighbour_pixel_center_x = 0;
140  double neighbour_pixel_center_y = 0;
141  // Check the hit approach to the neighbours
143  k, l, neighbour_pixel_lower_x, neighbour_pixel_upper_x, neighbour_pixel_lower_y, neighbour_pixel_upper_y);
144  neighbour_pixel_center_x = neighbour_pixel_lower_x + (neighbour_pixel_upper_x - neighbour_pixel_lower_x) / 2.;
145  neighbour_pixel_center_y = neighbour_pixel_lower_y + (neighbour_pixel_upper_y - neighbour_pixel_lower_y) / 2.;
146  hit2neighbour[m] = sqrt(pow((*i).Position().x() - neighbour_pixel_center_x, 2.) +
147  pow((*i).Position().y() - neighbour_pixel_center_y, -2.));
148  neighbour_no[m] = l * pxlRowSize_ + k;
149  if (hit2neighbour[m] > closer_neighbour) {
150  closer_neighbour = hit2neighbour[m];
151  closer_no = neighbour_no[m];
152  }
153  m++;
154  }
155  }
156  double chargetransfereff = (1 - collect_prob) * signalCoupling_[0];
157  thePixelChargeMap[closer_no] += charge_in_pixel * chargetransfereff;
158  }
159  }
160 
161  return thePixelChargeMap;
162 }

References L1DTConfigBti_cff::CH, chargeMap2E_, det_id_, CTPPSPixelSimTopology::PixelInfo::effFactor(), CTPPSPixelSimTopology::getPixelsInvolved(), mps_fire::i, createfilelist::int, dqmdumpme::k, cmsLHEtoEOSManager::l, visualization-live-secondInstance_cfg::m, CTPPSPixelSimTopology::PixelInfo::pixelColNo(), CTPPSPixelSimTopology::PixelInfo::pixelIndex(), CTPPSPixelSimTopology::pixelRange(), CTPPSPixelSimTopology::PixelInfo::pixelRowNo(), funct::pow(), pxlColSize_, pxlRowSize_, signalCoupling_, mathSSE::sqrt(), theRPixDetTopology_, verbosity_, xBinMax_, and yBinMax_.

Member Data Documentation

◆ chargeMap2E_

double RPixChargeShare::chargeMap2E_[4][60][40]
private

Definition at line 26 of file RPixChargeShare.h.

Referenced by RPixChargeShare(), and Share().

◆ ChargeMapFile2E_

std::string RPixChargeShare::ChargeMapFile2E_[4]
private

Definition at line 25 of file RPixChargeShare.h.

Referenced by RPixChargeShare().

◆ det_id_

uint32_t RPixChargeShare::det_id_
private

Definition at line 15 of file RPixChargeShare.h.

Referenced by Share().

◆ no_of_pixels_

int RPixChargeShare::no_of_pixels_
private

Definition at line 21 of file RPixChargeShare.h.

Referenced by RPixChargeShare().

◆ pxlColSize_

const int RPixChargeShare::pxlColSize_ = pxlInd.getDefaultColDetSize()
private

Definition at line 20 of file RPixChargeShare.h.

Referenced by Share().

◆ pxlInd

CTPPSPixelIndices RPixChargeShare::pxlInd
private

Definition at line 18 of file RPixChargeShare.h.

◆ pxlRowSize_

const int RPixChargeShare::pxlRowSize_ = pxlInd.getDefaultRowDetSize()
private

Definition at line 19 of file RPixChargeShare.h.

Referenced by Share().

◆ signalCoupling_

std::vector<double> RPixChargeShare::signalCoupling_
private

Definition at line 16 of file RPixChargeShare.h.

Referenced by RPixChargeShare(), and Share().

◆ theRPixDetTopology_

CTPPSPixelSimTopology RPixChargeShare::theRPixDetTopology_
private

Definition at line 17 of file RPixChargeShare.h.

Referenced by RPixChargeShare(), and Share().

◆ verbosity_

int RPixChargeShare::verbosity_
private

Definition at line 23 of file RPixChargeShare.h.

Referenced by RPixChargeShare(), and Share().

◆ xBinMax_

const int RPixChargeShare::xBinMax_[4] = {29, 59, 29, 59}
private

Definition at line 27 of file RPixChargeShare.h.

Referenced by Share().

◆ yBinMax_

const int RPixChargeShare::yBinMax_[4] = {19, 19, 39, 39}
private

Definition at line 28 of file RPixChargeShare.h.

Referenced by Share().

mps_fire.i
i
Definition: mps_fire.py:355
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
RPixChargeShare::ChargeMapFile2E_
std::string ChargeMapFile2E_[4]
Definition: RPixChargeShare.h:25
edm::LogInfo
Definition: MessageLogger.h:254
CTPPSPixelSimTopology::PixelInfo::pixelIndex
unsigned short pixelIndex() const
Definition: CTPPSPixelSimTopology.h:42
RPixChargeShare::det_id_
uint32_t det_id_
Definition: RPixChargeShare.h:15
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
RPixChargeShare::pxlRowSize_
const int pxlRowSize_
Definition: RPixChargeShare.h:19
dqmdumpme.k
k
Definition: dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelSimTopology::PixelInfo::pixelColNo
unsigned short pixelColNo() const
Definition: CTPPSPixelSimTopology.h:41
RPixChargeShare::pxlColSize_
const int pxlColSize_
Definition: RPixChargeShare.h:20
createfilelist.int
int
Definition: createfilelist.py:10
RPixChargeShare::chargeMap2E_
double chargeMap2E_[4][60][40]
Definition: RPixChargeShare.h:26
CTPPSPixelSimTopology::pixelRange
void pixelRange(unsigned int arow, unsigned int acol, double &lower_x, double &higher_x, double &lower_y, double &higher_y) const
Definition: CTPPSPixelSimTopology.h:61
L1DTConfigBti_cff.CH
CH
LTS and SET for low trigger suppression.
Definition: L1DTConfigBti_cff.py:38
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
CTPPSPixelSimTopology::PixelInfo
Definition: CTPPSPixelSimTopology.h:17
RPixChargeShare::signalCoupling_
std::vector< double > signalCoupling_
Definition: RPixChargeShare.h:16
CTPPSPixelTopology::detPixelNo
unsigned short detPixelNo() const
Definition: CTPPSPixelTopology.h:32
CTPPSPixelSimTopology::PixelInfo::pixelRowNo
unsigned short pixelRowNo() const
Definition: CTPPSPixelSimTopology.h:40
RPixChargeShare::yBinMax_
const int yBinMax_[4]
Definition: RPixChargeShare.h:28
edmStreamStallGrapher.xUpper
xUpper
Definition: edmStreamStallGrapher.py:874
Exception
Definition: hltDiff.cc:246
RPixChargeShare::theRPixDetTopology_
CTPPSPixelSimTopology theRPixDetTopology_
Definition: RPixChargeShare.h:17
RPixChargeShare::xBinMax_
const int xBinMax_[4]
Definition: RPixChargeShare.h:27
CTPPSPixelSimTopology::PixelInfo::effFactor
double effFactor() const
Definition: CTPPSPixelSimTopology.h:39
RPixChargeShare::verbosity_
int verbosity_
Definition: RPixChargeShare.h:23
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
CTPPSPixelSimTopology::getPixelsInvolved
PixelInfo getPixelsInvolved(double x, double y, double sigma, double &hit_pos_x, double &hit_pos_y) const
Definition: CTPPSPixelSimTopology.cc:8
RPixChargeShare::no_of_pixels_
int no_of_pixels_
Definition: RPixChargeShare.h:21