6 : det_id_(det_id), theRPixDetTopology_() {
14 double coupling_constant_ =
params.getParameter<
double>(
"RPixCoupling");
22 double chargeprobcollect;
23 int xUpper[] = {75, 150, 75, 150};
24 int yUpper[] = {50, 50, 100, 100};
26 for (
int i = 0;
i < 4;
i++) {
28 if (fChargeMap.is_open()) {
29 while (fChargeMap >> xMap >> yMap >> chargeprobcollect) {
31 iy =
int((yMap + yUpper[
i]) / 5);
36 throw cms::Exception(
"RPixChargeShare") <<
"Charge map file not found";
41 std::map<unsigned short, double> thePixelChargeMap;
43 edm::LogInfo(
"RPixChargeShare") <<
det_id_ <<
" : Clouds to be induced= " << charge_map.size();
47 for (std::vector<RPixSignalPoint>::const_iterator
i = charge_map.begin();
i != charge_map.end(); ++
i) {
48 double hit_pos_x, hit_pos_y;
50 if (((*i).Position().x() + 16.6 / 2) < 0 || ((*i).Position().x() + 16.6 / 2) > 16.6) {
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();
56 if (((*i).Position().y() + 24.4 / 2.) < 0 || ((*i).Position().y() + 24.4 / 2.) > 24.4) {
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();
64 (*i).Position().x(), (*i).Position().y(), (*i).Sigma(), hit_pos_x, hit_pos_y);
65 double effic = relevant_pixels.
effFactor();
67 unsigned short pixel_no = relevant_pixels.
pixelIndex();
69 double charge_in_pixel = (*i).Charge() * effic;
71 CH += charge_in_pixel;
74 edm::LogInfo(
"RPixChargeShare") <<
"Efficiency in detector " <<
det_id_ <<
" and pixel no " << pixel_no <<
" : "
75 << effic <<
" ch: " << charge_in_pixel <<
" CHtot: " <<
CH;
80 thePixelChargeMap[pixel_no] += charge_in_pixel;
84 double pixel_lower_x = 0;
85 double pixel_lower_y = 0;
86 double pixel_upper_x = 0;
87 double pixel_upper_y = 0;
90 double pixel_width_x = pixel_upper_x - pixel_lower_x;
91 double pixel_width_y = pixel_upper_y - pixel_lower_y;
96 double pixel_center_x = pixel_lower_x + (pixel_width_x) / 2.;
97 double pixel_center_y = pixel_lower_y + (pixel_width_y) / 2.;
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) {
106 if (pixel_width_x > 0.11 && pixel_width_y < 0.151) {
111 if (pixel_width_x < 0.11 && pixel_width_y > 0.151) {
116 if (pixel_width_x > 0.11 && pixel_width_y > 0.151) {
121 double hit2neighbour[8];
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;
129 for (
int k = pixel_row - 1;
k <= pixel_row + 1;
k++) {
130 for (
int l = pixel_col - 1;
l <= pixel_col + 1;
l++) {
133 if ((
k == pixel_row) && (
l == pixel_col))
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;
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.));
149 if (hit2neighbour[
m] > closer_neighbour) {
150 closer_neighbour = hit2neighbour[
m];
151 closer_no = neighbour_no[
m];
157 thePixelChargeMap[closer_no] += charge_in_pixel * chargetransfereff;
161 return thePixelChargeMap;