810 {
811 bool bShowRef=false;
812 if (debug_ref_electrons!=0)bShowRef=true;
813
814 #pragma region
815 m_xstripSheet.clear();
816 m_xstripID.clear();
817 m_vstripSheet.clear();
818 m_vstripID.clear();
819 m_xstripQ.clear();
820 m_vstripQ.clear();
821 m_xstripT_Branch.clear();
822 m_vstripT_Branch.clear();
823 m_xstripQ_Branch.clear();
824 m_vstripQ_Branch.clear();
825 m_xTfirst.clear();
826 m_vTfirst.clear();
827
828
829
830 std::vector<int> m000_xstripSheet;
831 std::vector<int> m000_xstripID;
832 std::vector<int> m000_vstripSheet;
833 std::vector<int> m000_vstripID;
834 std::vector<double> m000_xstripQ;
835 std::vector<double> m000_vstripQ;
836 std::vector<double> m000_xstripT_Branch;
837 std::vector<double> m000_vstripT_Branch;
838 std::vector<double> m000_xstripQ_Branch;
839 std::vector<double> m000_vstripQ_Branch;
840
841
842
843
844
845
846
847
848
849
850
851
856
857 Vint Save_Sheetx, Save_Sheetv;
858 Vint Save_FinalstripIDx, Save_FinalstripIDv;
859 Vint Save_Gridx, Save_Gridv;
860 Vint Save_IDx, Save_IDv;
861 Vint Save_Tx, Save_Tv;
862
863
864
865
866
867
868
869
870
871
872 for (int i = 0; i < 2; i++) {
873 for (int k = 0; k < 2; k++) {
874 m_mapQ[i][k].clear();
875
876 }
877 }
878 #pragma endregion
879
880
881
882
883 if (bShowRef) {
884 int Nelec = 0;
885 HitHistMap::const_iterator itm = hitmap.begin();
886 for (; itm != hitmap.end(); itm++) {
887 const Vint &hist = itm->second;
888 for (
int num = 0;
num < hist.size();
num++) {
890 }
891 }
892 if (Nelec != debug_ref_electrons->x->size()) {
893 cout << "oops! given different electrons! map gives " << Nelec << " while list gives" << debug_ref_electrons->x->size() << endl;
894 }
895 }
896
897
898 if (bShowRef) {
899 const vector<float> &
x = *debug_ref_electrons->x;
900 const vector<float> &y = *debug_ref_electrons->y;
901 const vector<float> &z = *debug_ref_electrons->z;
902 const vector<float> &
t = *debug_ref_electrons->t;
903 const int nElectrons =
x.size();
904
905 for (int i = 0; i < nElectrons; i++) {
906
907 double phi_electron = atan2(y[i], x[i]);
908 double z_electron = z[i];
909 G4ThreeVector pos(x[i], y[i], z[i]);
910 for (int j = 0; j < NSheet; j++) {
912 if (CgemReadoutPlane->
OnThePlane(phi_electron, z_electron)) {
913 int xID;
915 int vID;
917
918
919
920
921
922 int grid_x = 1;
923 int grid_v = 1;
924
925
926
927
928 double L_XPitch = CgemReadoutPlane->
getXPitch();
929 double L_VPitch = CgemReadoutPlane->
getVPitch();
930 grid_v = floor(distX / L_XPitch * 5. + 2.5);
931 grid_x = floor(distV / L_VPitch * 5. + 2.5);
932
933
934
935
936 if (xID >= 0 && vID >= 0) {
937 map<int, double>::iterator itx = m_mapQ[j][0].find(xID);
938 map<int, double>::iterator itv = m_mapQ[j][1].find(vID);
939 if (RatioX[layer][grid_x][grid_v][2] != 0) {
940 if (itx == m_mapQ[j][0].end()) {
941 m_mapQ[j][0][xID] = RatioX[layer][grid_x][grid_v][2];
942 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 2);
943 Save_IDx.push_back(j * 10000 + xID);
944 Save_Tx.push_back(
t[i]);
945
946 } else {
947 double Q = (itx->second) + RatioX[layer][grid_x][grid_v][2];
948 m_mapQ[j][0][xID] = Q;
949 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 2);
950 Save_IDx.push_back(j * 10000 + xID);
951 Save_Tx.push_back(
t[i]);
952
953 }
954 vector<int>::iterator result_Sheetx = find(Save_Sheetx.begin(), Save_Sheetx.end(), j * 10000 + xID);
955 if (result_Sheetx == Save_Sheetx.end()) {
956 Save_Sheetx.push_back(j * 10000 + xID);
957 }
958 }
959 if (RatioV[layer][grid_x][grid_v][1] != 0) {
960 if (itv == m_mapQ[j][1].end()) {
961 m_mapQ[j][1][vID] = RatioV[layer][grid_x][grid_v][1];
962 Save_Gridv.push_back(grid_x * 100 + grid_v * 10 + 1);
963 Save_IDv.push_back(j * 10000 + vID);
964 Save_Tv.push_back(
t[i]);
965 } else {
966 double Q = (itv->second) + RatioV[layer][grid_x][grid_v][1];
967 m_mapQ[j][1][vID] = Q;
968 Save_Gridv.push_back(grid_x * 100 + grid_v * 10 + 1);
969 Save_IDv.push_back(j * 10000 + vID);
970 Save_Tv.push_back(
t[i]);
971 }
972 vector<int>::iterator result_Sheetv = find(Save_Sheetv.begin(), Save_Sheetv.end(), j * 10000 + vID);
973 if (result_Sheetv == Save_Sheetv.end()) {
974 Save_Sheetv.push_back(j * 10000 + vID);
975 }
976 }
977 }
978
979 if ((xID >= 0 && vID >= 0) && (xID + 1) < CgemReadoutPlane->
getNXstrips()) {
980 map<int, double>::iterator itx = m_mapQ[j][0].find(xID + 1);
981 if (RatioX[layer][grid_x][grid_v][3] != 0) {
982 if (itx == m_mapQ[j][0].end()) {
983 m_mapQ[j][0][xID + 1] = RatioX[layer][grid_x][grid_v][3];
984 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 3);
985 Save_IDx.push_back(j * 10000 + xID + 1);
986 Save_Tx.push_back(
t[i]);
987
988 } else {
989 double Q = (itx->second) + RatioX[layer][grid_x][grid_v][3];
990 m_mapQ[j][0][xID + 1] = Q;
991 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 3);
992 Save_IDx.push_back(j * 10000 + xID + 1);
993 Save_Tx.push_back(
t[i]);
994 }
995
996 vector<int>::iterator result_Sheetx = find(Save_Sheetx.begin(), Save_Sheetx.end(), j * 10000 + xID + 1);
997 if (result_Sheetx == Save_Sheetx.end()) {
998 Save_Sheetx.push_back(j * 10000 + xID + 1);
999 }
1000 }
1001 }
1002
1003 if ((xID >= 0 && vID >= 0) && (vID + 1) < CgemReadoutPlane->
getNVstrips()) {
1004 map<int, double>::iterator itv = m_mapQ[j][1].find(vID + 1);
1005 if (RatioV[layer][grid_x][grid_v][2] != 0) {
1006 if (itv == m_mapQ[j][1].end()) {
1007 m_mapQ[j][1][vID + 1] = RatioV[layer][grid_x][grid_v][2];
1008 Save_Gridv.push_back(grid_x * 100 + grid_v * 10 + 2);
1009 Save_IDv.push_back(j * 10000 + vID + 1);
1010 Save_Tv.push_back(
t[i]);
1011 } else {
1012 double Q = (itv->second) + RatioV[layer][grid_x][grid_v][2];
1013 m_mapQ[j][1][vID + 1] = Q;
1014 Save_Gridv.push_back(grid_x * 100 + grid_v * 10 + 2);
1015 Save_IDv.push_back(j * 10000 + vID + 1);
1016 Save_Tv.push_back(
t[i]);
1017 }
1018
1019 vector<int>::iterator result_Sheetv = find(Save_Sheetv.begin(), Save_Sheetv.end(), j * 10000 + vID + 1);
1020 if (result_Sheetv == Save_Sheetv.end()) {
1021 Save_Sheetv.push_back(j * 10000 + vID + 1);
1022 }
1023 }
1024 }
1025
1026 if ((xID >= 0 && vID >= 0) && (xID - 2) >= 0) {
1027 map<int, double>::iterator itx = m_mapQ[j][0].find(xID - 2);
1028 if (RatioX[layer][grid_x][grid_v][0] != 0) {
1029 if (itx == m_mapQ[j][0].end()) {
1030 m_mapQ[j][0][xID - 2] = RatioX[layer][grid_x][grid_v][0];
1031 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 0);
1032 Save_IDx.push_back(j * 10000 + xID - 2);
1033 Save_Tx.push_back(
t[i]);
1034
1035 } else {
1036 double Q = (itx->second) + RatioX[layer][grid_x][grid_v][0];
1037 m_mapQ[j][0][xID - 2] = Q;
1038 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 0);
1039 Save_IDx.push_back(j * 10000 + xID - 2);
1040 Save_Tx.push_back(
t[i]);
1041 }
1042
1043 vector<int>::iterator result_Sheetx = find(Save_Sheetx.begin(), Save_Sheetx.end(), j * 10000 + xID - 2);
1044 if (result_Sheetx == Save_Sheetx.end()) {
1045 Save_Sheetx.push_back(j * 10000 + xID - 2);
1046 }
1047 }
1048 }
1049
1050 if ((xID >= 0 && vID >= 0) && (xID - 1) >= 0) {
1051 map<int, double>::iterator itx = m_mapQ[j][0].find(xID - 1);
1052 if (RatioX[layer][grid_x][grid_v][1] != 0) {
1053 if (itx == m_mapQ[j][0].end()) {
1054 m_mapQ[j][0][xID - 1] = RatioX[layer][grid_x][grid_v][1];
1055 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 1);
1056 Save_IDx.push_back(j * 10000 + xID - 1);
1057 Save_Tx.push_back(
t[i]);
1058 } else {
1059 double Q = (itx->second) + RatioX[layer][grid_x][grid_v][1];
1060 m_mapQ[j][0][xID - 1] = Q;
1061 Save_Gridx.push_back(grid_x * 100 + grid_v * 10 + 1);
1062 Save_IDx.push_back(j * 10000 + xID - 1);
1063 Save_Tx.push_back(
t[i]);
1064 }
1065
1066 vector<int>::iterator result_Sheetx = find(Save_Sheetx.begin(), Save_Sheetx.end(), j * 10000 + xID - 1);
1067 if (result_Sheetx == Save_Sheetx.end()) {
1068 Save_Sheetx.push_back(j * 10000 + xID - 1);
1069 }
1070 }
1071 }
1072
1073 if ((xID >= 0 && vID >= 0) && (vID - 1) >= 0) {
1074 map<int, double>::iterator itv = m_mapQ[j][1].find(vID - 1);
1075 if (RatioV[layer][grid_x][grid_v][0] != 0) {
1076 if (itv == m_mapQ[j][1].end()) {
1077 m_mapQ[j][1][vID - 1] = RatioV[layer][grid_x][grid_v][0];
1078 Save_Gridv.push_back(grid_x * 100 + grid_v * 10 + 0);
1079 Save_IDv.push_back(j * 10000 + vID - 1);
1080 Save_Tv.push_back(
t[i]);
1081 } else {
1082 double Q = (itv->second) + RatioV[layer][grid_x][grid_v][0];
1083 m_mapQ[j][1][vID - 1] = Q;
1084 Save_Gridv.push_back(grid_x * 100 + grid_v * 10 + 0);
1085 Save_IDv.push_back(j * 10000 + vID - 1);
1086 Save_Tv.push_back(
t[i]);
1087 }
1088
1089 vector<int>::iterator result_Sheetv = find(Save_Sheetv.begin(), Save_Sheetv.end(), j * 10000 + vID - 1);
1090 if (result_Sheetv == Save_Sheetv.end()) {
1091 Save_Sheetv.push_back(j * 10000 + vID - 1);
1092 }
1093 }
1094 }
1095 }
1096 }
1097 }
1098 }
1099
1100
1101
1102
1103
1104
1105 std::map<IndexGar,std::vector<double> > hitFFTMap;
1106
1107 if (bShowRef) {
1108 std::map<int, double> mapQ[2][2];
1109
1110 calcMapQFromHitHistMap(hitmap, layer, mapQ);
1111 Vint Save_Sheetx2, Save_Sheetv2;
1112 calcSaveSheetXVFromMapQ(Save_Sheetx2, Save_Sheetv2, mapQ);
1113
1114 compareMap(m_mapQ, mapQ);
1115
1116
1117 compareVector(Save_Sheetx, Save_Sheetx2, "Save_Sheetx", 1e-5);
1118 compareVector(Save_Sheetv, Save_Sheetv2, "Save_Sheetv", 1e-5);
1119 } else {
1120
1121 calcMapQFromHitHistMap(hitmap, layer, m_mapQ);
1122 calcSaveSheetXVFromMapQ(Save_Sheetx, Save_Sheetv, m_mapQ);
1123
1124 calcHitHistFftMap(hitFFTMap, hitmap);
1125 }
1126
1127
1128
1129
1130
1131
1132 double Q_threshold = 1.5e-15 / 1.602176565e-19;
1133 double Q_saturation = 45.e-15 / 1.602176565e-19;
1134 double Q_resolution = 0.256e-15 / 1.602176565e-19;
1135 double T_threshold = 12;
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146 for (int i = 0; i < Save_Sheetx.size(); i++) {
1147 int sheetx_id = Save_Sheetx[i] / 10000;
1148 int stripx_id = Save_Sheetx[i] % 10000;
1149
1150 Save_FinalstripIDx.push_back(Save_Sheetx[i]);
1151
1152 m000_xstripSheet.push_back(sheetx_id);
1153 m000_xstripID.push_back(stripx_id);
1154 m000_xstripQ.push_back(m_mapQ[sheetx_id][0][stripx_id]);
1155
1156 }
1157
1158 for (int i = 0; i < Save_Sheetv.size(); i++) {
1159 int sheetv_id = Save_Sheetv[i] / 10000;
1160 int stripv_id = Save_Sheetv[i] % 10000;
1161
1162 Save_FinalstripIDv.push_back(Save_Sheetv[i]);
1163 m000_vstripSheet.push_back(sheetv_id);
1164 m000_vstripID.push_back(stripv_id);
1165 m000_vstripQ.push_back(m_mapQ[sheetv_id][1][stripv_id]);
1166
1167 }
1168
1169 double Tmin, Tmin2;
1170 std::vector<double> xTfirst;
1171 std::vector<double> vTfirst;
1172
1173 for (int h = 0; h < Save_FinalstripIDx.size(); h++) {
1174
1175 std::map<int, std::vector<int> > electron_hit_tmp;
1176 const int _low = 0;
1177 const int _up = 1000;
1178 const int _nbins = 2000;
1179 double binsize = (double)(_up - _low) / _nbins;
1180 int sheetx_id = Save_FinalstripIDx[h] / 10000;
1181 int stripx_id = Save_FinalstripIDx[h] % 10000;
1182 double histX_bin_Content[_nbins] = {0};
1183 double histX_bin_Content2[_nbins] = {0};
1184 Tmin = Tmin2 = 999999;
1185 if (isDeadStrip(layer,sheetx_id,0,stripx_id)) {
1186 xTfirst.push_back(Tmin);
1187 double T_th = -99.;
1188 m000_xstripT_Branch.push_back(T_th);
1189 double Qin = -99.;
1190 m000_xstripQ_Branch.push_back(Qin);
1191 continue;
1192 };
1193
1194
1195
1196 if (bShowRef) {
1197 int original_affected_elec = 0;
1198
1199 for (int i = 0; i < Save_Gridx.size(); i++) {
1200
1201
1202
1203 int z_IDx = Save_IDx[i];
1204 int start_bin = Save_Tx[i] / binsize;
1205
1206
1207 if (z_IDx == Save_FinalstripIDx[h]) {
1208 if (Save_Tx[i] < Tmin) Tmin = Save_Tx[i];
1209 if (start_bin < _nbins and start_bin >= 0) {
1210 electron_hit_tmp[Save_Gridx[i]].push_back(start_bin);
1211
1212 original_affected_elec++;
1213 }
1214
1215
1216
1217
1218 }
1219 }
1220
1221 for (std::map<int, std::vector<int> >::iterator it = electron_hit_tmp.begin();
1222 it != electron_hit_tmp.end(); it++) {
1223 std::vector<int> &hitlist = it->second;
1224 const int &Save_Grid = it->first;
1225
1226 if (hitlist.size() < electrons_select_method_threhold) {
1227 conv1PerGrid_legacy(Save_Grid, histX_bin_Content, hitlist, layer, 0);
1228 } else {
1229 conv1PerGrid_fft(Save_Grid, histX_bin_Content, hitlist, layer, 0);
1230 }
1231 }
1232
1233 cout << "original_affected_elec " << original_affected_elec << " ";
1234 calcStripCurrent(histX_bin_Content2, Tmin2,hitFFTMap, hitmap, layer, sheetx_id, stripx_id, 0);
1235
1236 if (Tmin != Tmin2) {
1237 cout << "at stripX " << stripx_id << "Tmin: " << Tmin << " Tmin2: " << Tmin2 << "\n";
1238 }
1239 {
1240
1241
1242 compareArray(histX_bin_Content, histX_bin_Content2, _nbins, "hist_bin_content", 1e-5);
1243 string emptyStr = "";
1244 DrawToFile(histX_bin_Content, (emptyStr + "st" + (long)stripx_id + "old").Data());
1245 DrawToFile(histX_bin_Content2, (emptyStr + "st" + (long)stripx_id + "new").Data());
1246 }
1247
1248
1249
1250 } else {
1251
1252 calcStripCurrent(histX_bin_Content2, Tmin,hitFFTMap, hitmap, layer, sheetx_id, stripx_id, 0);
1253
1254 }
1255
1256 xTfirst.push_back(Tmin);
1257
1258 #pragma region
1259
1261
1262 int flg_xT = 0;
1263 double T_th = 0.;
1264 T_threshold = T_thr_V[layer][sheetx_id][0][stripx_id];
1265
1266
1267 for (
int init = 1;
init < _nbins;
init++) {
1268 if (flg_xT == 0 && fabs(h_signalT.GetBinContent(init + 1)) >= fabs(T_threshold)) {
1269 T_th = _low + binsize * (
init - 1) + fabs(T_threshold - h_signalT.GetBinContent(init)) * binsize / fabs(h_signalT.GetBinContent(init + 1) - h_signalT.GetBinContent(init)) + gRandom->Gaus(0, 2);
1270 m000_xstripT_Branch.push_back(T_th);
1271 flg_xT = 1;
1272 }
1273 }
1274 if (flg_xT == 0) {
1275 T_th = -99.;
1276 m000_xstripT_Branch.push_back(T_th);
1277 }
1278 double V_sampling = 0.;
1279 double Qin = 0.;
1280 double Efine = 0.;
1281
1282 if (T_th > 0) {
1283
1285 double T_sample = T_th + sample_delay;
1286 int sample_bin = T_sample / binsize;
1287 double sample_bin_ = T_sample / binsize;
1288 V_sampling = h_signalE.GetBinContent(sample_bin) + (h_signalE.GetBinContent(sample_bin + 1) - h_signalE.GetBinContent(sample_bin)) * double(sample_bin_ - sample_bin);
1289 int over_th = 0;
1290
1291
1292 if (h_signalE.GetMaximum() > E_thr_V[layer][sheetx_id][0][stripx_id]) over_th = 1;
1293
1294 if (over_th == 1) {
1295 Qin = V_sampling*VQ_slope + VQ_const+gRandom->Gaus(0,m_QinGausSigma[0]);
1296 if (m_saturation && Qin > Qsaturation[layer][sheetx_id][0][stripx_id])
1297 Qin = Qsaturation[layer][sheetx_id][0][stripx_id];
1298 } else
1299 Qin = -99;
1300 } else {
1301 V_sampling = -99.;
1302 Qin = -99.;
1303
1304 }
1305
1306 m000_xstripQ_Branch.push_back(Qin);
1307 #pragma endregion
1308
1309 }
1310
1311 for (int h = 0; h < Save_FinalstripIDv.size(); h++) {
1312 std::map<int, std::vector<int> > electron_hit_tmp;
1313 const int _low = 0;
1314 const int _up = 1000;
1315 const int _nbins = 2000;
1316 double binsize = (double)(_up - _low) / _nbins;
1317 int sheetv_id = Save_FinalstripIDv[h] / 10000;
1318 int stripv_id = Save_FinalstripIDv[h] % 10000;
1319 double histV_bin_Content[_nbins] = {0};
1320 Tmin = 999999;
1321
1322 if (isDeadStrip(layer,sheetv_id,1,stripv_id)) {
1323 vTfirst.push_back(Tmin);
1324 double T_th = -99.;
1325 m000_vstripT_Branch.push_back(T_th);
1326 double Qin = -99.;
1327 m000_vstripQ_Branch.push_back(Qin);
1328 continue;
1329 };
1330
1331 calcStripCurrent(histV_bin_Content, Tmin, hitFFTMap,hitmap, layer, sheetv_id, stripv_id, 1);
1332
1333 vTfirst.push_back(Tmin);
1334
1336
1337 int flg_vT = 0;
1338 double T_th = 0.;
1339 T_threshold = T_thr_V[layer][sheetv_id][1][stripv_id];
1340
1341
1342 for (
int init = 1;
init < _nbins;
init++) {
1343 if (flg_vT == 0 && fabs(h_signalT.GetBinContent(init + 1)) >= fabs(T_threshold)) {
1344 T_th = _low + binsize * (
init - 1) + fabs(T_threshold - h_signalT.GetBinContent(init)) * binsize / fabs(h_signalT.GetBinContent(init + 1) - h_signalT.GetBinContent(init)) + gRandom->Gaus(0, 2);
1345 m000_vstripT_Branch.push_back(T_th);
1346 flg_vT = 1;
1347 }
1348 }
1349 if (flg_vT == 0) {
1350 T_th = -99.;
1351 m000_vstripT_Branch.push_back(T_th);
1352 }
1353 double V_sampling = 0.;
1354 double Qin = 0.;
1355 double Efine = 0.;
1356 if (T_th > 0) {
1357
1359 double T_sample = T_th + sample_delay;
1360 int sample_bin = T_sample / binsize;
1361 double sample_bin_ = T_sample / binsize;
1362 V_sampling = h_signalE.GetBinContent(sample_bin) + (h_signalE.GetBinContent(sample_bin + 1) - h_signalE.GetBinContent(sample_bin)) * double(sample_bin_ - sample_bin);
1363 int over_th = 0;
1364
1365 if (h_signalE.GetMaximum() > E_thr_V[layer][sheetv_id][1][stripv_id]) over_th = 1;
1366
1367 if (over_th == 1) {
1368 Qin = V_sampling*VQ_slope + VQ_const+gRandom->Gaus(0,m_QinGausSigma[1]);
1369 if (m_saturation && Qin > Qsaturation[layer][sheetv_id][1][stripv_id])
1370 Qin = Qsaturation[layer][sheetv_id][1][stripv_id];
1371 } else
1372 Qin = -99;
1373 } else {
1374 V_sampling = -99.;
1375 Qin = -99.;
1376
1377 }
1378
1379 m000_vstripQ_Branch.push_back(Qin);
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389 }
1390
1391
1392
1393 double q_to_fC_factor = 1.602176565e-4;
1394
1395
1396
1397 if (storeFlag) {
1398 m_nXstrips = 0;
1399 for (int i = 0; i < m000_xstripSheet.size(); i++) {
1400 m_xstripSheet.push_back(m000_xstripSheet[i]);
1401 m_xstripID.push_back(m000_xstripID[i]);
1402 m_xstripQ.push_back(m000_xstripQ[i] * q_to_fC_factor);
1403 m_xstripT_Branch.push_back(m000_xstripT_Branch[i]);
1404 m_xstripQ_Branch.push_back(m000_xstripQ_Branch[i]);
1405 m_xTfirst.push_back(xTfirst[i]);
1406 m_nXstrips++;
1407 }
1408 m_nVstrips = 0;
1409
1410 for (int i = 0; i < m000_vstripSheet.size(); i++) {
1411 m_vstripSheet.push_back(m000_vstripSheet[i]);
1412 m_vstripID.push_back(m000_vstripID[i]);
1413 m_vstripQ.push_back(m000_vstripQ[i] * q_to_fC_factor);
1414 m_vstripT_Branch.push_back(m000_vstripT_Branch[i]);
1415 m_vstripQ_Branch.push_back(m000_vstripQ_Branch[i]);
1416 m_vTfirst.push_back(vTfirst[i]);
1417 m_nVstrips++;
1418 }
1419 } else {
1420 m_nXstrips = 0;
1421 for (int i = 0; i < m000_xstripSheet.size(); i++) {
1422 if (m000_xstripQ_Branch[i] >= 0) {
1423 m_xstripSheet.push_back(m000_xstripSheet[i]);
1424 m_xstripID.push_back(m000_xstripID[i]);
1425 m_xstripQ.push_back(m000_xstripQ[i] * q_to_fC_factor);
1426 m_xstripT_Branch.push_back(m000_xstripT_Branch[i]);
1427 m_xstripQ_Branch.push_back(m000_xstripQ_Branch[i]);
1428 m_xTfirst.push_back(xTfirst[i]);
1429 m_nXstrips++;
1430
1431 }
1432 }
1433 m_nVstrips = 0;
1434
1435 for (int i = 0; i < m000_vstripSheet.size(); i++) {
1436 if (m000_vstripQ_Branch[i] >= 0) {
1437 m_vstripSheet.push_back(m000_vstripSheet[i]);
1438 m_vstripID.push_back(m000_vstripID[i]);
1439 m_vstripQ.push_back(m000_vstripQ[i] * q_to_fC_factor);
1440 m_vstripT_Branch.push_back(m000_vstripT_Branch[i]);
1441 m_vstripQ_Branch.push_back(m000_vstripQ_Branch[i]);
1442 m_vTfirst.push_back(vTfirst[i]);
1443 m_nVstrips++;
1444
1445 }
1446 }
1447 }
1448
1449
1450
1451}
TH1D Convolution_Ebranch_fft(const double *Input_Curr_plot_001)
return convolve of Input_Curr_plot_001 and T_Branch2, a function; tries to mimic Convolution_Ebranch ...
TH1D Convolution_Tbranch_fft(const double *Input_Curr_plot_001)
return convolve of Input_Curr_plot_001 and T_Branch2, a function; tries to mimic Convolution_Tbranch ...
int getNumberOfSheet() const
double getDist2ClosestXStripCenter(double phi, int &id)
bool OnThePlane(double phi, double z) const
double getDist2ClosestVStripCenter(G4ThreeVector pos, int &id)
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0
virtual CgemGeoLayer * getCgemLayer(int i) const =0