File indexing completed on 2023-01-17 23:57:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <memory>
0010 #include <string>
0011 #include <iostream>
0012
0013 #include "DataFormats/Common/interface/Handle.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016
0017 #include "FWCore/Framework/interface/Frameworkfwd.h"
0018 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0019
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/Framework/interface/MakerMacros.h"
0022
0023
0024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0025 #include "FWCore/ServiceRegistry/interface/Service.h"
0026 #include "FWCore/Utilities/interface/InputTag.h"
0027
0028 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
0029 #include "DataFormats/Common/interface/DetSetVector.h"
0030 #include "DataFormats/Common/interface/Ref.h"
0031 #include "DataFormats/DetId/interface/DetId.h"
0032
0033 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
0034 #include "DataFormats/TrackerCommon/interface/PixelBarrelName.h"
0035
0036 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0037 #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h"
0038 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0039 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0040 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
0041 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0042
0043 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
0044
0045
0046 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
0047 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0048 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0049 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0050 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
0051
0052
0053 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0054 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
0055 #include "DataFormats/Common/interface/TriggerResults.h"
0056 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
0057 #include "FWCore/Common/interface/TriggerNames.h"
0058
0059
0060 #include "DataFormats/Scalers/interface/Level1TriggerScalers.h"
0061
0062
0063 #include "DataFormats/Luminosity/interface/LumiSummary.h"
0064 #include "DataFormats/Luminosity/interface/LumiDetails.h"
0065 #include "DataFormats/Common/interface/ConditionsInEdm.h"
0066 #include "RecoLuminosity/LumiProducer/interface/LumiCorrector.h"
0067
0068
0069 #include "DataFormats/VertexReco/interface/Vertex.h"
0070 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0071
0072
0073 #include "FWCore/ServiceRegistry/interface/Service.h"
0074 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0075
0076
0077 #include <TROOT.h>
0078 #include <TChain.h>
0079 #include <TFile.h>
0080 #include <TF1.h>
0081 #include <TH2F.h>
0082 #include <TH1F.h>
0083 #include <TProfile.h>
0084
0085 #define NEW_ID
0086 #ifdef NEW_ID
0087 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0088 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0089 #else
0090 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
0091 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
0092 #endif
0093
0094 #include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
0095
0096 using namespace std;
0097
0098 #define HISTOS
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111 #define BX_NEW
0112
0113
0114 #ifdef BX_NEW
0115
0116 class getBX {
0117 public:
0118 getBX(void);
0119 ~getBX(void);
0120 static int find(int bx);
0121
0122 private:
0123 };
0124
0125 getBX::getBX(void) { edm::LogPrint("TestClusters") << " bx ctor "; }
0126
0127 getBX::~getBX(void) {}
0128
0129 int getBX::find(int bx) {
0130
0131
0132 const int limit = 3394;
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150 const int coll_num = 1368;
0151 const int coll[1368] = {
0152 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102,
0153 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 146, 148,
0154 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186,
0155 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 226, 228, 230, 232,
0156 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270,
0157 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 306, 308, 310, 312, 314, 316,
0158 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354,
0159 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 413, 415, 417, 419, 421, 423, 425, 427,
0160 429, 431, 433, 435, 437, 439, 441, 443, 445, 447, 449, 451, 453, 455, 457, 459, 461, 463, 465,
0161 467, 469, 471, 473, 475, 477, 479, 481, 483, 493, 495, 497, 499, 501, 503, 505, 507, 509, 511,
0162 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549,
0163 551, 553, 555, 557, 559, 561, 563, 573, 575, 577, 579, 581, 583, 585, 587, 589, 591, 593, 595,
0164 597, 599, 601, 603, 605, 607, 609, 611, 613, 615, 617, 619, 621, 623, 625, 627, 629, 631, 633,
0165 635, 637, 639, 641, 643, 653, 655, 657, 659, 661, 663, 665, 667, 669, 671, 673, 675, 677, 679,
0166 681, 683, 685, 687, 689, 691, 693, 695, 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, 717,
0167 719, 721, 723, 773, 775, 777, 779, 781, 783, 785, 787, 789, 791, 793, 795, 797, 799, 801, 803,
0168 805, 807, 809, 811, 813, 815, 817, 819, 821, 823, 825, 827, 829, 831, 833, 835, 837, 839, 841,
0169 843, 853, 855, 857, 859, 861, 863, 865, 867, 869, 871, 873, 875, 877, 879, 881, 883, 885, 887,
0170 889, 891, 893, 895, 897, 899, 901, 903, 905, 907, 909, 911, 913, 915, 917, 919, 921, 923, 960,
0171 962, 964, 966, 968, 970, 972, 974, 976, 978, 980, 982, 984, 986, 988, 990, 992, 994, 996, 998,
0172 1000, 1002, 1004, 1006, 1008, 1010, 1012, 1014, 1016, 1018, 1020, 1022, 1024, 1026, 1028, 1030, 1040, 1042, 1044,
0173 1046, 1048, 1050, 1052, 1054, 1056, 1058, 1060, 1062, 1064, 1066, 1068, 1070, 1072, 1074, 1076, 1078, 1080, 1082,
0174 1084, 1086, 1088, 1090, 1092, 1094, 1096, 1098, 1100, 1102, 1104, 1106, 1108, 1110, 1120, 1122, 1124, 1126, 1128,
0175 1130, 1132, 1134, 1136, 1138, 1140, 1142, 1144, 1146, 1148, 1150, 1152, 1154, 1156, 1158, 1160, 1162, 1164, 1166,
0176 1168, 1170, 1172, 1174, 1176, 1178, 1180, 1182, 1184, 1186, 1188, 1190, 1200, 1202, 1204, 1206, 1208, 1210, 1212,
0177 1214, 1216, 1218, 1220, 1222, 1224, 1226, 1228, 1230, 1232, 1234, 1236, 1238, 1240, 1242, 1244, 1246, 1248, 1250,
0178 1252, 1254, 1256, 1258, 1260, 1262, 1264, 1266, 1268, 1270, 1307, 1309, 1311, 1313, 1315, 1317, 1319, 1321, 1323,
0179 1325, 1327, 1329, 1331, 1333, 1335, 1337, 1339, 1341, 1343, 1345, 1347, 1349, 1351, 1353, 1355, 1357, 1359, 1361,
0180 1363, 1365, 1367, 1369, 1371, 1373, 1375, 1377, 1387, 1389, 1391, 1393, 1395, 1397, 1399, 1401, 1403, 1405, 1407,
0181 1409, 1411, 1413, 1415, 1417, 1419, 1421, 1423, 1425, 1427, 1429, 1431, 1433, 1435, 1437, 1439, 1441, 1443, 1445,
0182 1447, 1449, 1451, 1453, 1455, 1457, 1467, 1469, 1471, 1473, 1475, 1477, 1479, 1481, 1483, 1485, 1487, 1489, 1491,
0183 1493, 1495, 1497, 1499, 1501, 1503, 1505, 1507, 1509, 1511, 1513, 1515, 1517, 1519, 1521, 1523, 1525, 1527, 1529,
0184 1531, 1533, 1535, 1537, 1547, 1549, 1551, 1553, 1555, 1557, 1559, 1561, 1563, 1565, 1567, 1569, 1571, 1573, 1575,
0185 1577, 1579, 1581, 1583, 1585, 1587, 1589, 1591, 1593, 1595, 1597, 1599, 1601, 1603, 1605, 1607, 1609, 1611, 1613,
0186 1615, 1617, 1667, 1669, 1671, 1673, 1675, 1677, 1679, 1681, 1683, 1685, 1687, 1689, 1691, 1693, 1695, 1697, 1699,
0187 1701, 1703, 1705, 1707, 1709, 1711, 1713, 1715, 1717, 1719, 1721, 1723, 1725, 1727, 1729, 1731, 1733, 1735, 1737,
0188 1747, 1749, 1751, 1753, 1755, 1757, 1759, 1761, 1763, 1765, 1767, 1769, 1771, 1773, 1775, 1777, 1779, 1781, 1783,
0189 1785, 1787, 1789, 1791, 1793, 1795, 1797, 1799, 1801, 1803, 1805, 1807, 1809, 1811, 1813, 1815, 1817, 1854, 1856,
0190 1858, 1860, 1862, 1864, 1866, 1868, 1870, 1872, 1874, 1876, 1878, 1880, 1882, 1884, 1886, 1888, 1890, 1892, 1894,
0191 1896, 1898, 1900, 1902, 1904, 1906, 1908, 1910, 1912, 1914, 1916, 1918, 1920, 1922, 1924, 1934, 1936, 1938, 1940,
0192 1942, 1944, 1946, 1948, 1950, 1952, 1954, 1956, 1958, 1960, 1962, 1964, 1966, 1968, 1970, 1972, 1974, 1976, 1978,
0193 1980, 1982, 1984, 1986, 1988, 1990, 1992, 1994, 1996, 1998, 2000, 2002, 2004, 2014, 2016, 2018, 2020, 2022, 2024,
0194 2026, 2028, 2030, 2032, 2034, 2036, 2038, 2040, 2042, 2044, 2046, 2048, 2050, 2052, 2054, 2056, 2058, 2060, 2062,
0195 2064, 2066, 2068, 2070, 2072, 2074, 2076, 2078, 2080, 2082, 2084, 2094, 2096, 2098, 2100, 2102, 2104, 2106, 2108,
0196 2110, 2112, 2114, 2116, 2118, 2120, 2122, 2124, 2126, 2128, 2130, 2132, 2134, 2136, 2138, 2140, 2142, 2144, 2146,
0197 2148, 2150, 2152, 2154, 2156, 2158, 2160, 2162, 2164, 2201, 2203, 2205, 2207, 2209, 2211, 2213, 2215, 2217, 2219,
0198 2221, 2223, 2225, 2227, 2229, 2231, 2233, 2235, 2237, 2239, 2241, 2243, 2245, 2247, 2249, 2251, 2253, 2255, 2257,
0199 2259, 2261, 2263, 2265, 2267, 2269, 2271, 2281, 2283, 2285, 2287, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303,
0200 2305, 2307, 2309, 2311, 2313, 2315, 2317, 2319, 2321, 2323, 2325, 2327, 2329, 2331, 2333, 2335, 2337, 2339, 2341,
0201 2343, 2345, 2347, 2349, 2351, 2361, 2363, 2365, 2367, 2369, 2371, 2373, 2375, 2377, 2379, 2381, 2383, 2385, 2387,
0202 2389, 2391, 2393, 2395, 2397, 2399, 2401, 2403, 2405, 2407, 2409, 2411, 2413, 2415, 2417, 2419, 2421, 2423, 2425,
0203 2427, 2429, 2431, 2441, 2443, 2445, 2447, 2449, 2451, 2453, 2455, 2457, 2459, 2461, 2463, 2465, 2467, 2469, 2471,
0204 2473, 2475, 2477, 2479, 2481, 2483, 2485, 2487, 2489, 2491, 2493, 2495, 2497, 2499, 2501, 2503, 2505, 2507, 2509,
0205 2511, 2549, 2551, 2553, 2555, 2557, 2559, 2561, 2563, 2565, 2567, 2569, 2571, 2573, 2575, 2577, 2579, 2581, 2583,
0206 2585, 2587, 2589, 2591, 2593, 2595, 2597, 2599, 2601, 2603, 2605, 2607, 2609, 2611, 2613, 2615, 2617, 2619, 2629,
0207 2631, 2633, 2635, 2637, 2639, 2641, 2643, 2645, 2647, 2649, 2651, 2653, 2655, 2657, 2659, 2661, 2663, 2665, 2667,
0208 2669, 2671, 2673, 2675, 2677, 2679, 2681, 2683, 2685, 2687, 2689, 2691, 2693, 2695, 2697, 2699, 2736, 2738, 2740,
0209 2742, 2744, 2746, 2748, 2750, 2752, 2754, 2756, 2758, 2760, 2762, 2764, 2766, 2768, 2770, 2772, 2774, 2776, 2778,
0210 2780, 2782, 2784, 2786, 2788, 2790, 2792, 2794, 2796, 2798, 2800, 2802, 2804, 2806, 2816, 2818, 2820, 2822, 2824,
0211 2826, 2828, 2830, 2832, 2834, 2836, 2838, 2840, 2842, 2844, 2846, 2848, 2850, 2852, 2854, 2856, 2858, 2860, 2862,
0212 2864, 2866, 2868, 2870, 2872, 2874, 2876, 2878, 2880, 2882, 2884, 2886, 2896, 2898, 2900, 2902, 2904, 2906, 2908,
0213 2910, 2912, 2914, 2916, 2918, 2920, 2922, 2924, 2926, 2928, 2930, 2932, 2934, 2936, 2938, 2940, 2942, 2944, 2946,
0214 2948, 2950, 2952, 2954, 2956, 2958, 2960, 2962, 2964, 2966, 2976, 2978, 2980, 2982, 2984, 2986, 2988, 2990, 2992,
0215 2994, 2996, 2998, 3000, 3002, 3004, 3006, 3008, 3010, 3012, 3014, 3016, 3018, 3020, 3022, 3024, 3026, 3028, 3030,
0216 3032, 3034, 3036, 3038, 3040, 3042, 3044, 3046, 3083, 3085, 3087, 3089, 3091, 3093, 3095, 3097, 3099, 3101, 3103,
0217 3105, 3107, 3109, 3111, 3113, 3115, 3117, 3119, 3121, 3123, 3125, 3127, 3129, 3131, 3133, 3135, 3137, 3139, 3141,
0218 3143, 3145, 3147, 3149, 3151, 3153, 3163, 3165, 3167, 3169, 3171, 3173, 3175, 3177, 3179, 3181, 3183, 3185, 3187,
0219 3189, 3191, 3193, 3195, 3197, 3199, 3201, 3203, 3205, 3207, 3209, 3211, 3213, 3215, 3217, 3219, 3221, 3223, 3225,
0220 3227, 3229, 3231, 3233, 3243, 3245, 3247, 3249, 3251, 3253, 3255, 3257, 3259, 3261, 3263, 3265, 3267, 3269, 3271,
0221 3273, 3275, 3277, 3279, 3281, 3283, 3285, 3287, 3289, 3291, 3293, 3295, 3297, 3299, 3301, 3303, 3305, 3307, 3309,
0222 3311, 3313, 3323, 3325, 3327, 3329, 3331, 3333, 3335, 3337, 3339, 3341, 3343, 3345, 3347, 3349, 3351, 3353, 3355,
0223 3357, 3359, 3361, 3363, 3365, 3367, 3369, 3371, 3373, 3375, 3377, 3379, 3381, 3383, 3385, 3387, 3389, 3391, 3393};
0224 const int beam1_num = 6;
0225 const int beam1[6] = {1, 3, 5, 7, 9, 11};
0226 const int beam2_num = 6;
0227 const int beam2[6] = {
0228 13,
0229 15,
0230 17,
0231 19,
0232 21,
0233 23,
0234 };
0235
0236 if (bx > limit)
0237 return (-1);
0238
0239
0240
0241 for (int i = 0; i < coll_num; ++i) {
0242 if (bx == coll[i])
0243 return (3);
0244 else if (bx == (coll[i] + 1))
0245 return (4);
0246 }
0247
0248
0249 for (int i = 0; i < beam1_num; ++i) {
0250 if (bx == beam1[i])
0251 return (1);
0252 else if (bx == (beam1[i] + 1))
0253 return (5);
0254 }
0255
0256
0257 for (int i = 0; i < beam2_num; ++i) {
0258 if (bx == beam2[i])
0259 return (2);
0260 else if (bx == (beam2[i] + 1))
0261 return (6);
0262 }
0263
0264 return 0;
0265 }
0266
0267 #endif
0268
0269
0270 #ifdef BX
0271 class getBX {
0272 public:
0273 getBX(void);
0274 ~getBX(void);
0275 int find(int bx);
0276
0277 private:
0278 int limit;
0279 int trains;
0280 int train_start[40];
0281 int train_stop[40];
0282 int beam1_start[40];
0283 int beam1_stop[40];
0284 int beam2_start[40];
0285 int beam2_stop[40];
0286 };
0287
0288 getBX::getBX(void) {
0289 limit = 1841;
0290 trains = 22;
0291 int count = 0;
0292
0293
0294 train_start[count] = 7;
0295 train_stop[count] = 24;
0296 beam1_start[count] = 1;
0297 beam1_stop[count] = 5;
0298 beam2_start[count] = 25;
0299 beam2_stop[count] = 29;
0300
0301
0302 count++;
0303 train_start[count] = 66;
0304 train_stop[count] = 137;
0305 beam1_start[count] = -1;
0306 beam1_stop[count] = -1;
0307 beam2_start[count] = -1;
0308 beam2_stop[count] = -1;
0309
0310
0311 count++;
0312 train_start[count] = 146;
0313 train_stop[count] = 217;
0314 beam1_start[count] = -1;
0315 beam1_stop[count] = -1;
0316 beam2_start[count] = -1;
0317 beam2_stop[count] = -1;
0318
0319
0320 count++;
0321 train_start[count] = 226;
0322 train_stop[count] = 297;
0323 beam1_start[count] = -1;
0324 beam1_stop[count] = -1;
0325 beam2_start[count] = -1;
0326 beam2_stop[count] = -1;
0327
0328
0329 count++;
0330 train_start[count] = 306;
0331 train_stop[count] = 377;
0332 beam1_start[count] = -1;
0333 beam1_stop[count] = -1;
0334 beam2_start[count] = -1;
0335 beam2_stop[count] = -1;
0336
0337
0338 count++;
0339 train_start[count] = 413;
0340 train_stop[count] = 484;
0341 beam1_start[count] = -1;
0342 beam1_stop[count] = -1;
0343 beam2_start[count] = -1;
0344 beam2_stop[count] = -1;
0345
0346
0347 count++;
0348 train_start[count] = 493;
0349 train_stop[count] = 564;
0350 beam1_start[count] = -1;
0351 beam1_stop[count] = -1;
0352 beam2_start[count] = -1;
0353 beam2_stop[count] = -1;
0354
0355
0356 count++;
0357 train_start[count] = 573;
0358 train_stop[count] = 644;
0359 beam1_start[count] = -1;
0360 beam1_stop[count] = -1;
0361 beam2_start[count] = -1;
0362 beam2_stop[count] = -1;
0363
0364
0365 count++;
0366 train_start[count] = 653;
0367 train_stop[count] = 724;
0368 beam1_start[count] = -1;
0369 beam1_stop[count] = -1;
0370 beam2_start[count] = -1;
0371 beam2_stop[count] = -1;
0372
0373
0374 count++;
0375 train_start[count] = 773;
0376 train_stop[count] = 844;
0377 beam1_start[count] = -1;
0378 beam1_stop[count] = -1;
0379 beam2_start[count] = -1;
0380 beam2_stop[count] = -1;
0381
0382
0383 count++;
0384 train_start[count] = 853;
0385 train_stop[count] = 924;
0386 beam1_start[count] = -1;
0387 beam1_stop[count] = -1;
0388 beam2_start[count] = -1;
0389 beam2_stop[count] = -1;
0390
0391
0392 count++;
0393 train_start[count] = 960;
0394 train_stop[count] = 1031;
0395 beam1_start[count] = -1;
0396 beam1_stop[count] = -1;
0397 beam2_start[count] = -1;
0398 beam2_stop[count] = -1;
0399
0400
0401 count++;
0402 train_start[count] = 1040;
0403 train_stop[count] = 1111;
0404 beam1_start[count] = -1;
0405 beam1_stop[count] = -1;
0406 beam2_start[count] = -1;
0407 beam2_stop[count] = -1;
0408
0409
0410 count++;
0411 train_start[count] = 1120;
0412 train_stop[count] = 1191;
0413 beam1_start[count] = -1;
0414 beam1_stop[count] = -1;
0415 beam2_start[count] = -1;
0416 beam2_stop[count] = -1;
0417
0418
0419 count++;
0420 train_start[count] = 1200;
0421 train_stop[count] = 1271;
0422 beam1_start[count] = -1;
0423 beam1_stop[count] = -1;
0424 beam2_start[count] = -1;
0425 beam2_stop[count] = -1;
0426
0427
0428 count++;
0429 train_start[count] = 1307;
0430 train_stop[count] = 1378;
0431 beam1_start[count] = -1;
0432 beam1_stop[count] = -1;
0433 beam2_start[count] = -1;
0434 beam2_stop[count] = -1;
0435
0436
0437 count++;
0438 train_start[count] = 1387;
0439 train_stop[count] = 1458;
0440 beam1_start[count] = -1;
0441 beam1_stop[count] = -1;
0442 beam2_start[count] = -1;
0443 beam2_stop[count] = -1;
0444
0445
0446 count++;
0447 train_start[count] = 1467;
0448 train_stop[count] = 1538;
0449 beam1_start[count] = -1;
0450 beam1_stop[count] = -1;
0451 beam2_start[count] = -1;
0452 beam2_stop[count] = -1;
0453
0454
0455 count++;
0456 train_start[count] = 1547;
0457 train_stop[count] = 1618;
0458 beam1_start[count] = -1;
0459 beam1_stop[count] = -1;
0460 beam2_start[count] = -1;
0461 beam2_stop[count] = -1;
0462
0463
0464 count++;
0465 train_start[count] = 1667;
0466 train_stop[count] = 1726;
0467 beam1_start[count] = 1727;
0468 beam1_stop[count] = 1734;
0469 beam2_start[count] = 1655;
0470 beam2_stop[count] = 1666;
0471
0472
0473 count++;
0474 train_start[count] = 1735;
0475 train_stop[count] = 1738;
0476 beam1_start[count] = -1;
0477 beam1_stop[count] = -1;
0478 beam2_start[count] = -1;
0479 beam2_stop[count] = -1;
0480
0481
0482 count++;
0483 train_start[count] = 1747;
0484 train_stop[count] = 1806;
0485 beam1_start[count] = 1807;
0486 beam1_stop[count] = 1818;
0487 beam2_start[count] = 1739;
0488 beam2_stop[count] = 1745;
0489
0490 edm::LogPrint("TestClusters") << " number of trains " << trains << " " << limit;
0491 }
0492
0493 getBX::~getBX(void) {}
0494
0495 int getBX::find(int bx) {
0496
0497
0498 if (bx > limit)
0499 return (-1);
0500
0501
0502
0503 for (int train = 0; train < trains; ++train) {
0504
0505
0506 for (int b = train_start[train]; b <= train_stop[train]; b += 2) {
0507
0508 if (bx == b)
0509 return (3);
0510 else if (bx == (b + 1))
0511 return (4);
0512 }
0513
0514 if (beam1_start[train] != -1) {
0515 for (int b = beam1_start[train]; b <= beam1_stop[train]; b += 2) {
0516
0517 if (bx == b)
0518 return (1);
0519 else if (bx == (b + 1))
0520 return (5);
0521 }
0522 }
0523
0524 if (beam2_start[train] != -1) {
0525 for (int b = beam2_start[train]; b <= beam2_stop[train]; b += 2) {
0526
0527 if (bx == b)
0528 return (2);
0529 else if (bx == (b + 1))
0530 return (6);
0531 }
0532 }
0533
0534 }
0535
0536
0537
0538 return 0;
0539 }
0540
0541 #endif
0542
0543
0544
0545
0546
0547 int rocId(int col, int row) {
0548 int rocRow = row / 80;
0549 int rocCol = col / 52;
0550 int rocId = rocCol + rocRow * 8;
0551 return rocId;
0552 }
0553
0554
0555 #ifdef ROC_EFF
0556
0557 class rocEfficiency {
0558 public:
0559 rocEfficiency(void);
0560 ~rocEfficiency(void);
0561 void addPixel(int layer, int ladder, int module, int roc);
0562 float getRoc(int layer, int ladder, int module, int roc);
0563 float getModule(int layer, int ladder, int module, float &half1, float &half2);
0564
0565
0566
0567 inline int transformLadder1(int ladder) {
0568 if (ladder > 10 || ladder < -10 || ladder == 0) {
0569 edm::LogPrint("TestClusters") << " wrong ladder-1 id " << ladder << edm::LogPrint("TestClusters");
0570 return (-1);
0571 }
0572 if (ladder < 0)
0573 return (ladder + 10);
0574 else
0575 return (ladder + 10 - 1);
0576 };
0577 inline int transformLadder2(int ladder) {
0578 if (ladder > 16 || ladder < -16 || ladder == 0) {
0579 edm::LogPrint("TestClusters") << " wrong ladder-2 id " << ladder << edm::LogPrint("TestClusters");
0580 return (-1);
0581 }
0582 if (ladder < 0)
0583 return (ladder + 16);
0584 else
0585 return (ladder + 16 - 1);
0586 };
0587 inline int transformLadder3(int ladder) {
0588 if (ladder > 22 || ladder < -22 || ladder == 0) {
0589 edm::LogPrint("TestClusters") << " wrong ladder-3 id " << ladder << edm::LogPrint("TestClusters");
0590 return (-1);
0591 }
0592 if (ladder < 0)
0593 return (ladder + 22);
0594 else
0595 return (ladder + 22 - 1);
0596 };
0597 inline int transformModule(int module) {
0598 if (module > 4 || module < -4 || module == 0) {
0599 edm::LogPrint("TestClusters") << " wrong module id " << module << edm::LogPrint("TestClusters");
0600 return (-1);
0601 }
0602 if (module < 0)
0603 return (module + 4);
0604 else
0605 return (module + 4 - 1);
0606 };
0607
0608 private:
0609 int pixelsLayer1[20][8][16];
0610 int pixelsLayer2[32][8][16];
0611 int pixelsLayer3[44][8][16];
0612 };
0613
0614 rocEfficiency::rocEfficiency(void) {
0615 edm::LogPrint("TestClusters") << " clear";
0616 for (int lad1 = 0; lad1 < 20; ++lad1)
0617 for (int mod1 = 0; mod1 < 8; ++mod1)
0618 for (int roc1 = 0; roc1 < 16; ++roc1)
0619 pixelsLayer1[lad1][mod1][roc1] = 0;
0620
0621 for (int lad2 = 0; lad2 < 32; ++lad2)
0622 for (int mod2 = 0; mod2 < 8; ++mod2)
0623 for (int roc2 = 0; roc2 < 16; ++roc2)
0624 pixelsLayer2[lad2][mod2][roc2] = 0;
0625
0626 for (int lad3 = 0; lad3 < 44; ++lad3)
0627 for (int mod3 = 0; mod3 < 8; ++mod3)
0628 for (int roc3 = 0; roc3 < 16; ++roc3)
0629 pixelsLayer3[lad3][mod3][roc3] = 0;
0630 }
0631
0632 rocEfficiency::~rocEfficiency(void) {
0633
0634
0635
0636
0637
0638
0639
0640
0641 }
0642
0643 void rocEfficiency::addPixel(int layer, int ladder, int module, int roc) {
0644 if (roc < 0 || roc >= 16) {
0645 edm::LogPrint("TestClusters") << " wrong roc number " << roc;
0646 return;
0647 }
0648
0649 int module0 = transformModule(module);
0650 if (module0 < 0 || module0 >= 8) {
0651 edm::LogPrint("TestClusters") << " wrong module index " << module0 << " " << module;
0652 return;
0653 }
0654
0655 int ladder0 = 0;
0656 switch (layer) {
0657 case 1:
0658 ladder0 = transformLadder1(ladder);
0659
0660 if (ladder0 < 0 || ladder0 >= 20)
0661 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0662 else
0663 pixelsLayer1[ladder0][module0][roc]++;
0664 break;
0665 case 2:
0666 ladder0 = transformLadder2(ladder);
0667 if (ladder0 < 0 || ladder0 >= 32)
0668 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0669 else
0670 pixelsLayer2[ladder0][module0][roc]++;
0671 break;
0672 case 3:
0673 ladder0 = transformLadder3(ladder);
0674 if (ladder0 < 0 || ladder0 >= 44)
0675 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0676 else
0677 pixelsLayer3[ladder0][module0][roc]++;
0678 break;
0679 default:
0680 break;
0681 }
0682 }
0683
0684 float rocEfficiency::getRoc(int layer, int ladder, int module, int roc) {
0685 if (roc < 0 || roc >= 16) {
0686 edm::LogPrint("TestClusters") << " wrong roc number " << roc;
0687 return -1.;
0688 }
0689 int module0 = transformModule(module);
0690 if (module0 < 0 || module0 >= 8) {
0691 edm::LogPrint("TestClusters") << " wrong module index " << module0 << " " << module;
0692 return -1.;
0693 }
0694
0695 float count = 0.;
0696 int ladder0 = 0;
0697
0698 switch (layer) {
0699 case 1:
0700 if ((abs(ladder) == 1 || abs(ladder) == 10) && roc > 7) {
0701 count = -1.;
0702 } else {
0703 ladder0 = transformLadder1(ladder);
0704 if (ladder0 < 0 || ladder0 >= 20) {
0705 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0706 count = -1.;
0707 } else
0708 count = float(pixelsLayer1[ladder0][module0][roc]);
0709
0710 }
0711 break;
0712 case 2:
0713 if ((abs(ladder) == 1 || abs(ladder) == 16) && roc > 7) {
0714 count = -1.;
0715 } else {
0716 ladder0 = transformLadder2(ladder);
0717 if (ladder0 < 0 || ladder0 >= 32) {
0718 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0719 count = -1.;
0720 } else
0721 count = float(pixelsLayer2[ladder0][module0][roc]);
0722 }
0723 break;
0724 case 3:
0725 if ((abs(ladder) == 1 || abs(ladder) == 22) && roc > 7) {
0726 count = -1;
0727 } else {
0728 ladder0 = transformLadder3(ladder);
0729 if (ladder0 < 0 || ladder0 >= 44) {
0730 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0731 count = -1.;
0732 } else
0733 count = float(pixelsLayer3[ladder0][module0][roc]);
0734 }
0735 break;
0736 default:
0737 break;
0738 }
0739 return count;
0740 }
0741
0742
0743 float rocEfficiency::getModule(int layer, int ladder, int module, float &half1, float &half2) {
0744 half1 = 0;
0745 half2 = 0;
0746 int module0 = transformModule(module);
0747 if (module0 < 0 || module0 >= 8) {
0748 edm::LogPrint("TestClusters") << " wrong module index " << module0 << " " << module;
0749 return -1.;
0750 }
0751
0752 float count = 0;
0753 int rocs = 0;
0754 int ladder0 = 0;
0755
0756 switch (layer) {
0757 case 1:
0758 ladder0 = transformLadder1(ladder);
0759 if (ladder0 < 0 || ladder0 >= 20) {
0760 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0761 return -1.;
0762 }
0763 for (int roc = 0; roc < 16; ++roc) {
0764
0765 float tmp = float(pixelsLayer1[ladder0][module0][roc]);
0766 count += tmp;
0767 if (roc < 8)
0768 half1 += tmp;
0769 else
0770 half2 += tmp;
0771 if (tmp > 0)
0772 rocs++;
0773 }
0774 break;
0775
0776 case 2:
0777 ladder0 = transformLadder2(ladder);
0778 if (ladder0 < 0 || ladder0 >= 32) {
0779 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0780 return -1.;
0781 }
0782 for (int roc = 0; roc < 16; ++roc) {
0783
0784 float tmp = float(pixelsLayer2[ladder0][module0][roc]);
0785 count += tmp;
0786 if (roc < 8)
0787 half1 += tmp;
0788 else
0789 half2 += tmp;
0790 if (tmp > 0)
0791 rocs++;
0792 }
0793 break;
0794
0795 case 3:
0796 ladder0 = transformLadder3(ladder);
0797 if (ladder0 < 0 || ladder0 >= 44) {
0798 edm::LogPrint("TestClusters") << " wrong ladder index " << ladder0 << " " << ladder;
0799 return -1.;
0800 }
0801 for (int roc = 0; roc < 16; ++roc) {
0802
0803 float tmp = float(pixelsLayer3[ladder0][module0][roc]);
0804 count += tmp;
0805 if (roc < 8)
0806 half1 += tmp;
0807 else
0808 half2 += tmp;
0809 if (tmp > 0)
0810 rocs++;
0811 }
0812 break;
0813
0814 default:
0815 break;
0816 }
0817
0818 if (rocs > 0)
0819 count = count / float(rocs);
0820 if (count < 0)
0821 edm::LogPrint("TestClusters") << " VERY VERY WRONG " << count;
0822 return count;
0823 }
0824
0825 #endif
0826
0827
0828
0829 class TestClusters : public edm::one::EDAnalyzer<edm::one::SharedResources> {
0830 public:
0831 explicit TestClusters(const edm::ParameterSet &conf);
0832 virtual ~TestClusters();
0833 virtual void analyze(const edm::Event &e, const edm::EventSetup &c) override;
0834 virtual void beginJob() override;
0835 virtual void endJob() override;
0836
0837 private:
0838
0839 bool PRINT;
0840 int select1, select2;
0841 int countEvents, countAllEvents;
0842 double sumClusters, sumPixels, countLumi;
0843
0844
0845
0846
0847 edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > myClus;
0848 edm::EDGetTokenT<LumiSummary> lumiSummaryToken_;
0849 edm::EDGetTokenT<LumiDetails> lumiDetailsToken_;
0850 edm::EDGetTokenT<edm::ConditionsInLumiBlock> condToken_;
0851 edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> l1gtrrToken_;
0852 edm::EDGetTokenT<Level1TriggerScalersCollection> l1tsToken_;
0853 edm::EDGetTokenT<edm::TriggerResults> hltToken_;
0854 edm::EDGetTokenT<reco::VertexCollection> vtxToken_;
0855
0856 edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoToken_;
0857 edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomToken_;
0858
0859
0860 TH1D *hdetunit;
0861 TH1D *hpixid, *hpixsubid, *hlayerid, *hladder1id, *hladder2id, *hladder3id, *hz1id, *hz2id, *hz3id;
0862
0863 TH1D *hcharge1, *hcharge2, *hcharge3, *hcharge4, *hcharge5;
0864
0865 TH1D *hpixcharge1, *hpixcharge2, *hpixcharge3, *hpixcharge4, *hpixcharge5;
0866
0867 TH1D *hpcols1, *hpcols2, *hpcols3, *hprows1, *hprows2, *hprows3;
0868 TH1D *hsize1, *hsize2, *hsize3, *hsizex1, *hsizex2, *hsizex3, *hsizey1, *hsizey2, *hsizey3;
0869
0870
0871
0872
0873
0874
0875 #if defined(BX) || defined(BX_NEW)
0876 TH1D *hchargebx1, *hchargebx2, *hchargebx3, *hchargebx4, *hchargebx5, *hchargebx6;
0877 TH1D *hpixChargebx1, *hpixChargebx2, *hpixChargebx3, *hpixChargebx4, *hpixChargebx5, *hpixChargebx6;
0878 TH1D *hsizebx1, *hsizebx2, *hsizebx3, *hsizebx4, *hsizebx5, *hsizebx6;
0879
0880 #endif
0881
0882 TH1D *hclusPerDet1, *hclusPerDet2, *hclusPerDet3;
0883 TH1D *hpixPerDet1, *hpixPerDet2, *hpixPerDet3;
0884 TH1D *hpixPerLink1, *hpixPerLink2, *hpixPerLink3;
0885 TH1D *hclusPerLay1, *hclusPerLay2, *hclusPerLay3;
0886 TH1D *hpixPerLay1, *hpixPerLay2, *hpixPerLay3;
0887 TH1D *hdetsPerLay1, *hdetsPerLay2, *hdetsPerLay3;
0888 TH1D *hclus, *hclusBPix, *hclusFPix, *hdigis, *hdigis2, *hdigisB, *hdigisF;
0889
0890
0891 TH1D *hclus2, *hclus5;
0892
0893 TH1D *hdets, *hdets2;
0894
0895 TH1D *hpixDiskR1, *hpixDiskR2;
0896
0897 TH2F *hDetsMap1, *hDetsMap2, *hDetsMap3;
0898 TH2F *hDetMap1, *hDetMap2, *hDetMap3;
0899 TH2F *hpDetMap1, *hpDetMap2, *hpDetMap3;
0900 TH2F *hsizeDetMap1, *hsizeDetMap2, *hsizeDetMap3;
0901
0902
0903
0904 TH2F *hpixDetMap1, *hpixDetMap2, *hpixDetMap3;
0905 TH2F *hcluDetMap1, *hcluDetMap2, *hcluDetMap3;
0906
0907
0908
0909
0910 TH2F *hpixDetMap10, *hpixDetMap20, *hpixDetMap30;
0911 TH2F *hpixDetMap11, *hpixDetMap12, *hpixDetMap13, *hpixDetMap14, *hpixDetMap15;
0912 TH2F *hpixDetMap21, *hpixDetMap22, *hpixDetMap23, *hpixDetMap24, *hpixDetMap25;
0913 TH2F *hpixDetMap31, *hpixDetMap32, *hpixDetMap33, *hpixDetMap34, *hpixDetMap35;
0914 TH2F *hpixDetMap16, *hpixDetMap17, *hpixDetMap18, *hpixDetMap19;
0915 TH2F *hpixDetMap26, *hpixDetMap27, *hpixDetMap28, *hpixDetMap29;
0916 TH2F *hpixDetMap36, *hpixDetMap37, *hpixDetMap38, *hpixDetMap39;
0917
0918
0919
0920 TH1D *hevent, *hlumi, *hlumi0, *hlumi1, *hlumi10, *hlumi11, *hlumi12, *hlumi13,
0921 *hlumi14;
0922 TH1D *hbx, *hbx0, *hbx1, *hbx2, *hbx3, *hbx4, *hbx5, *hbx6, *hbx7;
0923 TH1D *hmaxPixPerDet;
0924
0925 TH1D *hclusPerDisk1, *hclusPerDisk2, *hclusPerDisk3, *hclusPerDisk4;
0926 TH1D *hpixPerDisk1, *hpixPerDisk2, *hpixPerDisk3, *hpixPerDisk4;
0927 TH1D *hl1a, *hl1t, *hltt;
0928 TH1D *hl1a1, *hl1t1;
0929 TH1D *hlt1, *hlt2, *hlt3;
0930
0931 TH1D *hpixPerDet11, *hpixPerDet12, *hpixPerDet13, *hpixPerDet14;
0932 TH1D *hpixPerDet21, *hpixPerDet22, *hpixPerDet23, *hpixPerDet24;
0933 TH1D *hpixPerDet31, *hpixPerDet32, *hpixPerDet33, *hpixPerDet34;
0934
0935
0936 TH1D *hgz1, *hgz2, *hgz3;
0937
0938 TH1D *hintg, *hinst, *hpvs;
0939
0940 #ifdef USE_RESYNCS
0941 TH1D *htest1, *htest2, *htest3, *htest4, *htest5, *htest6;
0942 #endif
0943
0944 TProfile *hclumult1, *hclumult2, *hclumult3;
0945 TProfile *hclumultx1, *hclumultx2, *hclumultx3;
0946 TProfile *hclumulty1, *hclumulty2, *hclumulty3;
0947 TProfile *hcluchar1, *hcluchar2, *hcluchar3;
0948 TProfile *hpixchar1, *hpixchar2, *hpixchar3;
0949 TProfile *hclusls, *hpixls, *hinstls, *hinstlsbx;
0950 TProfile *hpvls, *hclupv, *hpixpv;
0951 TProfile *hcharCluls, *hcharPixls, *hsizeCluls, *hsizeXCluls;
0952 TProfile *hpixbx, *hclubx, *hpvbx, *hcharClubx, *hcharPixbx, *hsizeClubx, *hsizeYClubx;
0953 TProfile *hinstbx;
0954 TProfile *hcharCluLumi, *hcharPixLumi, *hsizeCluLumi, *hsizeXCluLumi, *hsizeYCluLumi;
0955
0956 TProfile *hcluLumi, *hpixLumi;
0957
0958
0959
0960
0961
0962
0963
0964 #ifdef INSTLUMI_STUDIES
0965 TProfile *hcluslsn, *hpixlsn;
0966 TProfile *hpixbl, *hpixb1l, *hpixb2l, *hpixb3l, *hpixfl, *hpixfml, *hpixfpl;
0967 TProfile *hclusbl, *hclusb1l, *hclusb2l, *hclusb3l, *hclusfl, *hclusfml, *hclusfpl;
0968 TProfile *hpixbxn, *hclubxn, *hpvbxn;
0969 #endif
0970
0971 #ifdef VDM_STUDIES
0972 TProfile *hcharCluls1, *hcharPixls1, *hsizeCluls1, *hsizeXCluls1;
0973 TProfile *hcharCluls2, *hcharPixls2, *hsizeCluls2, *hsizeXCluls2;
0974 TProfile *hcharCluls3, *hcharPixls3, *hsizeCluls3, *hsizeXCluls3;
0975 TProfile *hclusls1, *hpixls1, *hclusls2, *hpixls2, *hclusls3, *hpixls3;
0976 #endif
0977
0978 #ifdef ROC_EFF
0979 rocEfficiency *pixEff;
0980
0981 TH2F *hbadMap1, *hbadMap2, *hbadMap3;
0982 TH2F *hrocHits1ls, *hrocHits2ls, *hrocHits3ls, *hmoduleHits1ls, *hmoduleHits2ls, *hmoduleHits3ls;
0983 TH1D *hcountInRoc1, *hcountInRoc2, *hcountInRoc3, *hcountInRoc12, *hcountInRoc22, *hcountInRoc32;
0984 #endif
0985
0986 #ifdef BX
0987 getBX *getbx;
0988 #endif
0989
0990
0991 LumiCorrector *lumiCorrector;
0992 };
0993
0994
0995
0996 TestClusters::TestClusters(edm::ParameterSet const &conf) {
0997 usesResource(TFileService::kSharedResource);
0998 PRINT = conf.getUntrackedParameter<bool>("Verbosity", false);
0999 select1 = conf.getUntrackedParameter<int>("Select1", 0);
1000 select2 = conf.getUntrackedParameter<int>("Select2", 0);
1001 if (PRINT)
1002 edm::LogPrint("TestClusters") << " Construct ";
1003
1004
1005 myClus = consumes<edmNew::DetSetVector<SiPixelCluster> >(conf.getParameter<edm::InputTag>("src"));
1006 lumiSummaryToken_ = consumes<LumiSummary>(edm::InputTag("lumiProducer"));
1007 lumiDetailsToken_ = consumes<LumiDetails>(edm::InputTag("lumiProducer"));
1008 condToken_ = consumes<edm::ConditionsInLumiBlock>(edm::InputTag("conditionsInEdm"));
1009 l1gtrrToken_ = consumes<L1GlobalTriggerReadoutRecord>(edm::InputTag("gtDigis"));
1010 l1tsToken_ = consumes<Level1TriggerScalersCollection>(edm::InputTag("scalersRawToDigi"));
1011 hltToken_ = consumes<edm::TriggerResults>(edm::InputTag("TriggerResults", "", "HLT"));
1012 vtxToken_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
1013 trackerTopoToken_ = esConsumes<TrackerTopology, TrackerTopologyRcd>();
1014 trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
1015 }
1016
1017 TestClusters::~TestClusters() = default;
1018
1019
1020 void TestClusters::beginJob() {
1021 edm::LogPrint("TestClusters") << "Initialize PixelClusterTest ";
1022
1023 edm::Service<TFileService> fs;
1024
1025
1026
1027 hladder1id = fs->make<TH1D>("hladder1id", "Ladder L1 id", 23, -11.5, 11.5);
1028 hladder2id = fs->make<TH1D>("hladder2id", "Ladder L2 id", 35, -17.5, 17.5);
1029 hladder3id = fs->make<TH1D>("hladder3id", "Ladder L3 id", 47, -23.5, 23.5);
1030 hz1id = fs->make<TH1D>("hz1id", "Z-index id L1", 11, -5.5, 5.5);
1031 hz2id = fs->make<TH1D>("hz2id", "Z-index id L2", 11, -5.5, 5.5);
1032 hz3id = fs->make<TH1D>("hz3id", "Z-index id L3", 11, -5.5, 5.5);
1033
1034 int sizeH = 200;
1035 float lowH = -0.5;
1036 float highH = 199.5;
1037
1038 hclusPerDet1 = fs->make<TH1D>("hclusPerDet1", "Clus per det l1", sizeH, lowH, highH);
1039 hclusPerDet2 = fs->make<TH1D>("hclusPerDet2", "Clus per det l2", sizeH, lowH, highH);
1040 hclusPerDet3 = fs->make<TH1D>("hclusPerDet3", "Clus per det l3", sizeH, lowH, highH);
1041
1042 sizeH = 1000;
1043 highH = 1999.5;
1044 hpixPerDet1 = fs->make<TH1D>("hpixPerDet1", "Pix per det l1", sizeH, lowH, highH);
1045 hpixPerDet2 = fs->make<TH1D>("hpixPerDet2", "Pix per det l2", sizeH, lowH, highH);
1046 hpixPerDet3 = fs->make<TH1D>("hpixPerDet3", "Pix per det l3", sizeH, lowH, highH);
1047
1048 hpixPerDet11 = fs->make<TH1D>("hpixPerDet11", "Pix per det l1 - ring 1", sizeH, lowH, highH);
1049 hpixPerDet12 = fs->make<TH1D>("hpixPerDet12", "Pix per det l1 - ring 2", sizeH, lowH, highH);
1050 hpixPerDet13 = fs->make<TH1D>("hpixPerDet13", "Pix per det l1 - ring 3", sizeH, lowH, highH);
1051 hpixPerDet14 = fs->make<TH1D>("hpixPerDet14", "Pix per det l1 - ring 4", sizeH, lowH, highH);
1052 hpixPerDet21 = fs->make<TH1D>("hpixPerDet21", "Pix per det l2 - ring 1", sizeH, lowH, highH);
1053 hpixPerDet22 = fs->make<TH1D>("hpixPerDet22", "Pix per det l2 - ring 2", sizeH, lowH, highH);
1054 hpixPerDet23 = fs->make<TH1D>("hpixPerDet23", "Pix per det l2 - ring 3", sizeH, lowH, highH);
1055 hpixPerDet24 = fs->make<TH1D>("hpixPerDet24", "Pix per det l2 - ring 4", sizeH, lowH, highH);
1056 hpixPerDet31 = fs->make<TH1D>("hpixPerDet31", "Pix per det l3 - ring 1", sizeH, lowH, highH);
1057 hpixPerDet32 = fs->make<TH1D>("hpixPerDet32", "Pix per det l3 - ring 2", sizeH, lowH, highH);
1058 hpixPerDet33 = fs->make<TH1D>("hpixPerDet33", "Pix per det l3 - ring 3", sizeH, lowH, highH);
1059 hpixPerDet34 = fs->make<TH1D>("hpixPerDet34", "Pix per det l3 - ring 4", sizeH, lowH, highH);
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074 sizeH = 1000;
1075 highH = 999.5;
1076 hpixPerLink1 = fs->make<TH1D>("hpixPerLink1", "Pix per link l1", sizeH, lowH, highH);
1077 hpixPerLink2 = fs->make<TH1D>("hpixPerLink2", "Pix per link l2", sizeH, lowH, highH);
1078 hpixPerLink3 = fs->make<TH1D>("hpixPerLink3", "Pix per link l3", sizeH, lowH, highH);
1079
1080 sizeH = 5000;
1081 #ifdef HI
1082 highH = 19999.5;
1083 #else
1084 highH = 4999.5;
1085 #endif
1086
1087 hclusPerLay1 = fs->make<TH1D>("hclusPerLay1", "Clus per layer l1", sizeH, lowH, highH);
1088 hclusPerLay2 = fs->make<TH1D>("hclusPerLay2", "Clus per layer l2", sizeH, lowH, highH);
1089 hclusPerLay3 = fs->make<TH1D>("hclusPerLay3", "Clus per layer l3", sizeH, lowH, highH);
1090
1091 hclus = fs->make<TH1D>("hclus", "Clus per event", sizeH, lowH, 5. * highH);
1092 hclusBPix = fs->make<TH1D>("hclusBPix", "Bpix Clus per event", sizeH, lowH, 4. * highH);
1093 hclusFPix = fs->make<TH1D>("hclusFPix", "Fpix Clus per event", sizeH, lowH, 2. * highH);
1094
1095 #ifdef HI
1096 highH = 3999.5;
1097 #else
1098 highH = 1999.5;
1099 #endif
1100
1101 hclusPerDisk1 = fs->make<TH1D>("hclusPerDisk1", "Clus per disk1", sizeH, lowH, highH);
1102 hclusPerDisk2 = fs->make<TH1D>("hclusPerDisk2", "Clus per disk2", sizeH, lowH, highH);
1103 hclusPerDisk3 = fs->make<TH1D>("hclusPerDisk3", "Clus per disk3", sizeH, lowH, highH);
1104 hclusPerDisk4 = fs->make<TH1D>("hclusPerDisk4", "Clus per disk4", sizeH, lowH, highH);
1105
1106 #ifdef HI
1107 highH = 9999.5;
1108 #else
1109 highH = 3999.5;
1110 #endif
1111
1112 hpixPerDisk1 = fs->make<TH1D>("hpixPerDisk1", "Pix per disk1", sizeH, lowH, highH);
1113 hpixPerDisk2 = fs->make<TH1D>("hpixPerDisk2", "Pix per disk2", sizeH, lowH, highH);
1114 hpixPerDisk3 = fs->make<TH1D>("hpixPerDisk3", "Pix per disk3", sizeH, lowH, highH);
1115 hpixPerDisk4 = fs->make<TH1D>("hpixPerDisk4", "Pix per disk4", sizeH, lowH, highH);
1116
1117 sizeH = 2000;
1118 #ifdef HI
1119 highH = 99999.5;
1120 #else
1121 highH = 19999.5;
1122 #endif
1123
1124 hpixPerLay1 = fs->make<TH1D>("hpixPerLay1", "Pix per layer l1", sizeH, lowH, highH);
1125 hpixPerLay2 = fs->make<TH1D>("hpixPerLay2", "Pix per layer l2", sizeH, lowH, highH);
1126 hpixPerLay3 = fs->make<TH1D>("hpixPerLay3", "Pix per layer l3", sizeH, lowH, highH);
1127
1128 hdigis = fs->make<TH1D>("hdigis", "All Digis in clus per event", sizeH, lowH, 5. * highH);
1129 hdigisB = fs->make<TH1D>("hdigisB", "BPix Digis in clus per event", sizeH, lowH, 4. * highH);
1130 hdigisF = fs->make<TH1D>("hdigisF", "FPix Digis in clus per event", sizeH, lowH, 2. * highH);
1131 hdigis2 = fs->make<TH1D>("hdigis2", "Digis per event - zoomed", 1000, -0.5, 999.5);
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150 sizeH = 1000;
1151 #ifdef HI
1152 highH = 19999.5;
1153 #else
1154 highH = 4999.5;
1155 #endif
1156
1157 hclus2 = fs->make<TH1D>("hclus2", "Clus per event - zoomed", 1000, -0.5, 999.5);
1158
1159
1160 hclus5 = fs->make<TH1D>("hclus5", "Clus per event", sizeH, lowH, highH);
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181 hdetsPerLay1 = fs->make<TH1D>("hdetsPerLay1", "Full dets per layer l1", 161, -0.5, 160.5);
1182 hdetsPerLay3 = fs->make<TH1D>("hdetsPerLay3", "Full dets per layer l3", 353, -0.5, 352.5);
1183 hdetsPerLay2 = fs->make<TH1D>("hdetsPerLay2", "Full dets per layer l2", 257, -0.5, 256.5);
1184
1185 hdets2 = fs->make<TH1D>("hdets2", "Dets per event", 2000, 0.5, 1999.5);
1186 hdets = fs->make<TH1D>("hdets", "Dets per event", 2000, -0.5, 1999.5);
1187 hmaxPixPerDet = fs->make<TH1D>("hmaxPixPerDet", "Max pixels per det", 1000, -0.5, 999.5);
1188
1189 sizeH = 400;
1190 lowH = 0.;
1191 highH = 100.0;
1192 hcharge1 = fs->make<TH1D>("hcharge1", "Clu charge l1", sizeH, 0., highH);
1193 hcharge2 = fs->make<TH1D>("hcharge2", "Clu charge l2", sizeH, 0., highH);
1194 hcharge3 = fs->make<TH1D>("hcharge3", "Clu charge l3", sizeH, 0., highH);
1195 hcharge4 = fs->make<TH1D>("hcharge4", "Clu charge d1", sizeH, 0., highH);
1196 hcharge5 = fs->make<TH1D>("hcharge5", "Clu charge d2", sizeH, 0., highH);
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216 #if defined(BX) || defined(BX_NEW)
1217 hchargebx1 = fs->make<TH1D>("hchargebx1", "Clu charge", 100, 0., highH);
1218 hchargebx2 = fs->make<TH1D>("hchargebx2", "Clu charge", 100, 0., highH);
1219 hchargebx3 = fs->make<TH1D>("hchargebx3", "Clu charge", 100, 0., highH);
1220 hchargebx4 = fs->make<TH1D>("hchargebx4", "Clu charge", 100, 0., highH);
1221 hchargebx5 = fs->make<TH1D>("hchargebx5", "Clu charge", 100, 0., highH);
1222 hchargebx6 = fs->make<TH1D>("hchargebx6", "Clu charge", 100, 0., highH);
1223 sizeH = 300;
1224 highH = 60.0;
1225 hpixChargebx1 = fs->make<TH1D>("hpixChargebx1", "Pix charge", sizeH, 0., highH);
1226 hpixChargebx2 = fs->make<TH1D>("hpixChargebx2", "Pix charge", sizeH, 0., highH);
1227 hpixChargebx3 = fs->make<TH1D>("hpixChargebx3", "Pix charge", sizeH, 0., highH);
1228 hpixChargebx5 = fs->make<TH1D>("hpixChargebx5", "Pix charge", sizeH, 0., highH);
1229 hpixChargebx6 = fs->make<TH1D>("hpixChargebx6", "Pix charge", sizeH, 0., highH);
1230
1231 sizeH = 200;
1232 highH = 199.5;
1233 hsizebx1 = fs->make<TH1D>("hsizebx1", "clu size", sizeH, -0.5, highH);
1234 hsizebx2 = fs->make<TH1D>("hsizebx2", "clu size", sizeH, -0.5, highH);
1235 hsizebx3 = fs->make<TH1D>("hsizebx3", "clu size", sizeH, -0.5, highH);
1236 hsizebx5 = fs->make<TH1D>("hsizebx5", "clu size", sizeH, -0.5, highH);
1237 hsizebx6 = fs->make<TH1D>("hsizebx6", "clu size", sizeH, -0.5, highH);
1238 #endif
1239
1240 sizeH = 300;
1241 highH = 60.0;
1242 hpixcharge1 = fs->make<TH1D>("hpixcharge1", "Pix charge l1", sizeH, 0., highH);
1243 hpixcharge2 = fs->make<TH1D>("hpixcharge2", "Pix charge l2", sizeH, 0., highH);
1244 hpixcharge3 = fs->make<TH1D>("hpixcharge3", "Pix charge l3", sizeH, 0., highH);
1245 hpixcharge4 = fs->make<TH1D>("hpixcharge4", "Pix charge d1", sizeH, 0., highH);
1246 hpixcharge5 = fs->make<TH1D>("hpixcharge5", "Pix charge d2", sizeH, 0., highH);
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262 hpcols1 = fs->make<TH1D>("hpcols1", "Layer 1 pix cols", 500, -0.5, 499.5);
1263 hpcols2 = fs->make<TH1D>("hpcols2", "Layer 2 pix cols", 500, -0.5, 499.5);
1264 hpcols3 = fs->make<TH1D>("hpcols3", "Layer 3 pix cols", 500, -0.5, 499.5);
1265
1266 hprows1 = fs->make<TH1D>("hprows1", "Layer 1 pix rows", 200, -0.5, 199.5);
1267 hprows2 = fs->make<TH1D>("hprows2", "Layer 2 pix rows", 200, -0.5, 199.5);
1268 hprows3 = fs->make<TH1D>("hprows3", "layer 3 pix rows", 200, -0.5, 199.5);
1269
1270 sizeH = 1000;
1271 highH = 999.5;
1272 hsize1 = fs->make<TH1D>("hsize1", "layer 1 clu size", sizeH, -0.5, highH);
1273 hsize2 = fs->make<TH1D>("hsize2", "layer 2 clu size", sizeH, -0.5, highH);
1274 hsize3 = fs->make<TH1D>("hsize3", "layer 3 clu size", sizeH, -0.5, highH);
1275
1276
1277
1278
1279 hsizex1 = fs->make<TH1D>("hsizex1", "lay1 clu size in x", 100, -0.5, 99.5);
1280 hsizex2 = fs->make<TH1D>("hsizex2", "lay2 clu size in x", 100, -0.5, 99.5);
1281 hsizex3 = fs->make<TH1D>("hsizex3", "lay3 clu size in x", 100, -0.5, 99.5);
1282
1283
1284
1285
1286
1287
1288 hsizey1 = fs->make<TH1D>("hsizey1", "lay1 clu size in y", 100, -0.5, 99.5);
1289 hsizey2 = fs->make<TH1D>("hsizey2", "lay2 clu size in y", 100, -0.5, 99.5);
1290 hsizey3 = fs->make<TH1D>("hsizey3", "lay3 clu size in y", 100, -0.5, 99.5);
1291
1292
1293
1294
1295
1296
1297
1298 hpixDiskR1 = fs->make<TH1D>("hpixDiskR1", "pix vs. r, disk 1", 200, 0., 20.);
1299 hpixDiskR2 = fs->make<TH1D>("hpixDiskR2", "pix vs. r, disk 2", 200, 0., 20.);
1300
1301 hevent = fs->make<TH1D>("hevent", "event", 100, 0, 10000000.);
1302
1303
1304 hlumi1 = fs->make<TH1D>("hlumi1", "lumi", 2000, 0, 2000.);
1305 hlumi0 = fs->make<TH1D>("hlumi0", "lumi", 2000, 0, 2000.);
1306 hlumi = fs->make<TH1D>("hlumi", "lumi", 2000, 0, 2000.);
1307 hlumi10 = fs->make<TH1D>("hlumi10", "lumi10", 2000, 0, 2000.);
1308 hlumi11 = fs->make<TH1D>("hlumi11", "lumi11", 2000, 0, 2000.);
1309 hlumi12 = fs->make<TH1D>("hlumi12", "lumi12", 2000, 0, 2000.);
1310 hlumi13 = fs->make<TH1D>("hlumi13", "lumi13", 2000, 0, 2000.);
1311 hlumi14 = fs->make<TH1D>("hlumi14", "lumi14", 2000, 0, 2000.);
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323 hbx6 = fs->make<TH1D>("hbx6", "bx", 4000, 0, 4000.);
1324 hbx5 = fs->make<TH1D>("hbx5", "bx", 4000, 0, 4000.);
1325 hbx4 = fs->make<TH1D>("hbx4", "bx", 4000, 0, 4000.);
1326 hbx3 = fs->make<TH1D>("hbx3", "bx", 4000, 0, 4000.);
1327 hbx2 = fs->make<TH1D>("hbx2", "bx", 4000, 0, 4000.);
1328 hbx1 = fs->make<TH1D>("hbx1", "bx", 4000, 0, 4000.);
1329 hbx0 = fs->make<TH1D>("hbx0", "bx", 4000, 0, 4000.);
1330 hbx = fs->make<TH1D>("hbx", "bx", 4000, 0, 4000.);
1331
1332 hl1a = fs->make<TH1D>("hl1a", "l1a", 128, -0.5, 127.5);
1333 hl1t = fs->make<TH1D>("hl1t", "l1t", 128, -0.5, 127.5);
1334 hltt = fs->make<TH1D>("hltt", "ltt", 128, -0.5, 127.5);
1335 hl1t1 = fs->make<TH1D>("hl1t1", "l1t1", 128, -0.5, 127.5);
1336 hl1a1 = fs->make<TH1D>("hl1a1", "l1a1", 128, -0.5, 127.5);
1337
1338
1339
1340
1341
1342 hlt1 = fs->make<TH1D>("hlt1", "hlt1", 256, -0.5, 255.5);
1343 hlt2 = fs->make<TH1D>("hlt2", "hlt2", 256, -0.5, 255.5);
1344 hlt3 = fs->make<TH1D>("hlt3", "hlt3", 256, -0.5, 255.5);
1345
1346 hgz1 = fs->make<TH1D>("hgz1", "layer1, clu global z", 600, -30., 30.);
1347 hgz2 = fs->make<TH1D>("hgz2", "layer2, clu global z", 600, -30., 30.);
1348 hgz3 = fs->make<TH1D>("hgz3", "layer3, clu global z", 600, -30., 30.);
1349
1350 #ifdef USE_RESYNCS
1351 htest1 = fs->make<TH1D>("htest1", "test1", 1000, 0., 1000.);
1352 htest2 = fs->make<TH1D>("htest2", "test2", 1000, 0., 1000.);
1353 htest3 = fs->make<TH1D>("htest3", "test3", 1000, 0., 3.0E8);
1354 htest4 = fs->make<TH1D>("htest4", "test4", 1000, 0., 3.0E8);
1355 #endif
1356
1357
1358 hDetsMap1 = fs->make<TH2F>("hDetsMap1", " ", 9, -4.5, 4.5, 21, -10.5, 10.5);
1359 hDetsMap1->SetOption("colz");
1360 hDetsMap2 = fs->make<TH2F>("hDetsMap2", " ", 9, -4.5, 4.5, 33, -16.5, 16.5);
1361 hDetsMap2->SetOption("colz");
1362 hDetsMap3 = fs->make<TH2F>("hDetsMap3", " ", 9, -4.5, 4.5, 45, -22.5, 22.5);
1363 hDetsMap3->SetOption("colz");
1364
1365 hDetMap1 = fs->make<TH2F>("hDetMap1", " ", 9, -4.5, 4.5, 21, -10.5, 10.5);
1366 hDetMap1->SetOption("colz");
1367 hDetMap2 = fs->make<TH2F>("hDetMap2", " ", 9, -4.5, 4.5, 33, -16.5, 16.5);
1368 hDetMap2->SetOption("colz");
1369 hDetMap3 = fs->make<TH2F>("hDetMap3", " ", 9, -4.5, 4.5, 45, -22.5, 22.5);
1370 hDetMap3->SetOption("colz");
1371
1372 hpDetMap1 = fs->make<TH2F>("hpDetMap1", " ", 9, -4.5, 4.5, 21, -10.5, 10.5);
1373 hpDetMap1->SetOption("colz");
1374 hpDetMap2 = fs->make<TH2F>("hpDetMap2", " ", 9, -4.5, 4.5, 33, -16.5, 16.5);
1375 hpDetMap2->SetOption("colz");
1376 hpDetMap3 = fs->make<TH2F>("hpDetMap3", " ", 9, -4.5, 4.5, 45, -22.5, 22.5);
1377 hpDetMap3->SetOption("colz");
1378
1379 hsizeDetMap1 = fs->make<TH2F>("hsizeDetMap1", " ", 9, -4.5, 4.5, 21, -10.5, 10.5);
1380 hsizeDetMap1->SetOption("colz");
1381 hsizeDetMap2 = fs->make<TH2F>("hsizeDetMap2", " ", 9, -4.5, 4.5, 33, -16.5, 16.5);
1382 hsizeDetMap2->SetOption("colz");
1383 hsizeDetMap3 = fs->make<TH2F>("hsizeDetMap3", " ", 9, -4.5, 4.5, 45, -22.5, 22.5);
1384 hsizeDetMap3->SetOption("colz");
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400 hpixDetMap1 = fs->make<TH2F>("hpixDetMap1", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1401 hpixDetMap2 = fs->make<TH2F>("hpixDetMap2", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1402 hpixDetMap3 = fs->make<TH2F>("hpixDetMap3", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1403
1404 hcluDetMap1 = fs->make<TH2F>("hcluDetMap1", "clu det layer 1", 416, 0., 416., 160, 0., 160.);
1405 hcluDetMap2 = fs->make<TH2F>("hcluDetMap2", "clu det layer 1", 416, 0., 416., 160, 0., 160.);
1406 hcluDetMap3 = fs->make<TH2F>("hcluDetMap3", "clu det layer 1", 416, 0., 416., 160, 0., 160.);
1407
1408
1409 hpixDetMap10 = fs->make<TH2F>("hpixDetMap10", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1410 hpixDetMap20 = fs->make<TH2F>("hpixDetMap20", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1411 hpixDetMap30 = fs->make<TH2F>("hpixDetMap30", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1412 hpixDetMap11 = fs->make<TH2F>("hpixDetMap11", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1413 hpixDetMap12 = fs->make<TH2F>("hpixDetMap12", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1414 hpixDetMap13 = fs->make<TH2F>("hpixDetMap13", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1415 hpixDetMap14 = fs->make<TH2F>("hpixDetMap14", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1416 hpixDetMap15 = fs->make<TH2F>("hpixDetMap15", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1417 hpixDetMap16 = fs->make<TH2F>("hpixDetMap16", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1418 hpixDetMap17 = fs->make<TH2F>("hpixDetMap17", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1419 hpixDetMap18 = fs->make<TH2F>("hpixDetMap18", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1420 hpixDetMap19 = fs->make<TH2F>("hpixDetMap19", "pix det layer 1", 416, 0., 416., 160, 0., 160.);
1421
1422 hpixDetMap21 = fs->make<TH2F>("hpixDetMap21", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1423 hpixDetMap22 = fs->make<TH2F>("hpixDetMap22", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1424 hpixDetMap23 = fs->make<TH2F>("hpixDetMap23", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1425 hpixDetMap24 = fs->make<TH2F>("hpixDetMap24", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1426 hpixDetMap25 = fs->make<TH2F>("hpixDetMap25", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1427 hpixDetMap26 = fs->make<TH2F>("hpixDetMap26", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1428 hpixDetMap27 = fs->make<TH2F>("hpixDetMap27", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1429 hpixDetMap28 = fs->make<TH2F>("hpixDetMap28", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1430 hpixDetMap29 = fs->make<TH2F>("hpixDetMap29", "pix det layer 2", 416, 0., 416., 160, 0., 160.);
1431
1432 hpixDetMap31 = fs->make<TH2F>("hpixDetMap31", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1433 hpixDetMap32 = fs->make<TH2F>("hpixDetMap32", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1434 hpixDetMap33 = fs->make<TH2F>("hpixDetMap33", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1435 hpixDetMap34 = fs->make<TH2F>("hpixDetMap34", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1436 hpixDetMap35 = fs->make<TH2F>("hpixDetMap35", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1437 hpixDetMap36 = fs->make<TH2F>("hpixDetMap36", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1438 hpixDetMap37 = fs->make<TH2F>("hpixDetMap37", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1439 hpixDetMap38 = fs->make<TH2F>("hpixDetMap38", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1440 hpixDetMap39 = fs->make<TH2F>("hpixDetMap39", "pix det layer 3", 416, 0., 416., 160, 0., 160.);
1441
1442
1443
1444
1445
1446 hclumult1 = fs->make<TProfile>("hclumult1", "cluster size layer 1", 56, -28., 28., 0.0, 100.);
1447 hclumult2 = fs->make<TProfile>("hclumult2", "cluster size layer 2", 56, -28., 28., 0.0, 100.);
1448 hclumult3 = fs->make<TProfile>("hclumult3", "cluster size layer 3", 56, -28., 28., 0.0, 100.);
1449
1450 hclumultx1 = fs->make<TProfile>("hclumultx1", "cluster x-size layer 1", 56, -28., 28., 0.0, 100.);
1451 hclumultx2 = fs->make<TProfile>("hclumultx2", "cluster x-size layer 2", 56, -28., 28., 0.0, 100.);
1452 hclumultx3 = fs->make<TProfile>("hclumultx3", "cluster x-size layer 3", 56, -28., 28., 0.0, 100.);
1453
1454 hclumulty1 = fs->make<TProfile>("hclumulty1", "cluster y-size layer 1", 56, -28., 28., 0.0, 100.);
1455 hclumulty2 = fs->make<TProfile>("hclumulty2", "cluster y-size layer 2", 56, -28., 28., 0.0, 100.);
1456 hclumulty3 = fs->make<TProfile>("hclumulty3", "cluster y-size layer 3", 56, -28., 28., 0.0, 100.);
1457
1458 hcluchar1 = fs->make<TProfile>("hcluchar1", "cluster char layer 1", 56, -28., 28., 0.0, 1000.);
1459 hcluchar2 = fs->make<TProfile>("hcluchar2", "cluster char layer 2", 56, -28., 28., 0.0, 1000.);
1460 hcluchar3 = fs->make<TProfile>("hcluchar3", "cluster char layer 3", 56, -28., 28., 0.0, 1000.);
1461
1462 hpixchar1 = fs->make<TProfile>("hpixchar1", "pix char layer 1", 56, -28., 28., 0.0, 1000.);
1463 hpixchar2 = fs->make<TProfile>("hpixchar2", "pix char layer 2", 56, -28., 28., 0.0, 1000.);
1464 hpixchar3 = fs->make<TProfile>("hpixchar3", "pix char layer 3", 56, -28., 28., 0.0, 1000.);
1465
1466 sizeH = 1000;
1467 highH = 3000.;
1468 hclusls = fs->make<TProfile>("hclusls", "clus vs ls", sizeH, 0., highH, 0.0, 30000.);
1469 hpixls = fs->make<TProfile>("hpixls", "pix vs ls ", sizeH, 0., highH, 0.0, 100000.);
1470 hpvls = fs->make<TProfile>("hpvls", "pvs vs ls", sizeH, 0., highH, 0.0, 10000.);
1471
1472
1473 hcharCluls = fs->make<TProfile>("hcharCluls", "clu char vs ls", sizeH, 0., highH, 0.0, 100.);
1474 hcharPixls = fs->make<TProfile>("hcharPixls", "pix char vs ls", sizeH, 0., highH, 0.0, 100.);
1475 hsizeCluls = fs->make<TProfile>("hsizeCluls", "clu size vs ls", sizeH, 0., highH, 0.0, 1000.);
1476 hsizeXCluls = fs->make<TProfile>("hsizeXCluls", "clu size-x vs ls", sizeH, 0., highH, 0.0, 100.);
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495 sizeH = 1000;
1496 highH = 3000.;
1497
1498
1499
1500 hpixpv = fs->make<TProfile>("hpixpv", "pix vs pv", 1000, 0., 20000, 0.0, 1000.);
1501 hclupv = fs->make<TProfile>("hclupv", "clu vs pv", 1000, 0., 10000, 0.0, 1000.);
1502
1503
1504 hinstls = fs->make<TProfile>("hinstls", "inst bx lumi vs ls ", sizeH, 0., highH, 0.0, 1000.);
1505 hinstlsbx = fs->make<TProfile>("hinstlsbx", "inst bx lumi vs ls ", sizeH, 0., highH, 0.0, 1000.);
1506
1507
1508
1509 hpixbx = fs->make<TProfile>("hpixbx", "pix vs bx ", 4000, -0.5, 3999.5, 0.0, 1000000.);
1510 hclubx = fs->make<TProfile>("hclubx", "clu vs bx ", 4000, -0.5, 3999.5, 0.0, 1000000.);
1511 hpvbx = fs->make<TProfile>("hpvbx", "pv vs bx ", 4000, -0.5, 3999.5, 0.0, 1000000.);
1512
1513
1514
1515
1516 hcharClubx = fs->make<TProfile>("hcharClubx", "clu charge vs bx ", 4000, -0.5, 3999.5, 0.0, 100.);
1517 hcharPixbx = fs->make<TProfile>("hcharPixbx", "pix charge vs bx ", 4000, -0.5, 3999.5, 0.0, 100.);
1518 hsizeClubx = fs->make<TProfile>("hsizeClubx", "clu size vs bx ", 4000, -0.5, 3999.5, 0.0, 1000.);
1519 hsizeYClubx = fs->make<TProfile>("hsizeYClubx", "clu size-y vs bx ", 4000, -0.5, 3999.5, 0.0, 1000.);
1520
1521 hinstbx = fs->make<TProfile>("hinstbx", "inst lumi vs bx ", 4000, -0.5, 3999.5, 0.0, 100.);
1522
1523 hcluLumi = fs->make<TProfile>("hcluLumi", "clus vs inst lumi", 100, 0.0, 10., 0.0, 100000.);
1524 hpixLumi = fs->make<TProfile>("hpixLumi", "pixs vs inst lumi", 100, 0.0, 10., 0.0, 100000.);
1525 hcharCluLumi = fs->make<TProfile>("hcharCluLumi", "clu char vs inst lumi", 100, 0.0, 10., 0.0, 100.);
1526 hcharPixLumi = fs->make<TProfile>("hcharPixLumi", "pix char vs inst lumi", 100, 0.0, 10., 0.0, 100.);
1527 hsizeCluLumi = fs->make<TProfile>("hsizeCluLumi", "clu size vs inst lumi", 100, 0.0, 10., 0.0, 100.);
1528 hsizeXCluLumi = fs->make<TProfile>("hsizeXCluLumi", "clu size-x vs inst lumi", 100, 0.0, 10., 0.0, 100.);
1529 hsizeYCluLumi = fs->make<TProfile>("hsizeYCluLumi", "clu size-y vs inst lumi", 100, 0.0, 10., 0.0, 100.);
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565 hinst = fs->make<TH1D>("hinst", "inst lumi", 100, 0.0, 10.);
1566 hpvs = fs->make<TH1D>("hpvs", "pvs", 100, -0.5, 99.5);
1567
1568 #ifdef VDM_STUDIES
1569 hcharCluls1 = fs->make<TProfile>("hcharCluls1", "clu char vs ls", sizeH, 0., highH, 0.0, 100.);
1570 hcharPixls1 = fs->make<TProfile>("hcharPixls1", "pix char vs ls", sizeH, 0., highH, 0.0, 100.);
1571 hsizeCluls1 = fs->make<TProfile>("hsizeCluls1", "clu size vs ls", sizeH, 0., highH, 0.0, 1000.);
1572 hsizeXCluls1 = fs->make<TProfile>("hsizeXCluls1", "clu size-x vs ls", sizeH, 0., highH, 0.0, 100.);
1573 hcharCluls2 = fs->make<TProfile>("hcharCluls2", "clu char vs ls", sizeH, 0., highH, 0.0, 100.);
1574 hcharPixls2 = fs->make<TProfile>("hcharPixls2", "pix char vs ls", sizeH, 0., highH, 0.0, 100.);
1575 hsizeCluls2 = fs->make<TProfile>("hsizeCluls2", "clu size vs ls", sizeH, 0., highH, 0.0, 1000.);
1576 hsizeXCluls2 = fs->make<TProfile>("hsizeXCluls2", "clu size-x vs ls", sizeH, 0., highH, 0.0, 100.);
1577 hcharCluls3 = fs->make<TProfile>("hcharCluls3", "clu char vs ls", sizeH, 0., highH, 0.0, 100.);
1578 hcharPixls3 = fs->make<TProfile>("hcharPixls3", "pix char vs ls", sizeH, 0., highH, 0.0, 100.);
1579 hsizeCluls3 = fs->make<TProfile>("hsizeCluls3", "clu size vs ls", sizeH, 0., highH, 0.0, 1000.);
1580 hsizeXCluls3 = fs->make<TProfile>("hsizeXCluls3", "clu size-x vs ls", sizeH, 0., highH, 0.0, 100.);
1581 hclusls1 = fs->make<TProfile>("hclusls1", "clus vs ls", sizeH, 0., highH, 0.0, 30000.);
1582 hpixls1 = fs->make<TProfile>("hpixls1", "pix vs ls ", sizeH, 0., highH, 0.0, 100000.);
1583 hclusls2 = fs->make<TProfile>("hclusls2", "clus vs ls", sizeH, 0., highH, 0.0, 30000.);
1584 hpixls2 = fs->make<TProfile>("hpixls2", "pix vs ls ", sizeH, 0., highH, 0.0, 100000.);
1585 hclusls3 = fs->make<TProfile>("hclusls3", "clus vs ls", sizeH, 0., highH, 0.0, 30000.);
1586 hpixls3 = fs->make<TProfile>("hpixls3", "pix vs ls ", sizeH, 0., highH, 0.0, 100000.);
1587 #endif
1588
1589 #ifdef INSTLUMI_STUDIES
1590 hcluslsn = fs->make<TProfile>("hcluslsn", "clus/lumi", sizeH, 0., highH, 0.0, 30000.);
1591 hpixlsn = fs->make<TProfile>("hpixlsn", "pix/lumi ", sizeH, 0., highH, 0.0, 100000.);
1592 sizeH = 100;
1593 highH = 10.;
1594 hpixbl = fs->make<TProfile>("hpixbl", "pixb vs lumi ", sizeH, 0., highH, 0.0, 100000.);
1595 hclusbl = fs->make<TProfile>("hclusbl", "clusb vs lumi", sizeH, 0., highH, 0.0, 30000.);
1596 hpixb1l = fs->make<TProfile>("hpixb1l", "pixb1 vs lumi", sizeH, 0., highH, 0.0, 100000.);
1597 hclusb1l = fs->make<TProfile>("hclusb1l", "clusb1 vs lumi", sizeH, 0., highH, 0.0, 30000.);
1598 hpixb2l = fs->make<TProfile>("hpixb2l", "pixb2 vs lumi ", sizeH, 0., highH, 0.0, 100000.);
1599 hclusb2l = fs->make<TProfile>("hclusb2l", "clusb2 vs lumi", sizeH, 0., highH, 0.0, 30000.);
1600 hpixb3l = fs->make<TProfile>("hpixb3l", "pixb3 vs lumi ", sizeH, 0., highH, 0.0, 100000.);
1601 hclusb3l = fs->make<TProfile>("hclusb3l", "clusb3 vs lumi", sizeH, 0., highH, 0.0, 30000.);
1602 hpixfl = fs->make<TProfile>("hpixfl", "pixf vs lumi ", sizeH, 0., highH, 0.0, 100000.);
1603 hclusfl = fs->make<TProfile>("hclusfl", "clusf vs lumi", sizeH, 0., highH, 0.0, 30000.);
1604 hpixfml = fs->make<TProfile>("hpixfml", "pixfm vs lumi ", sizeH, 0., highH, 0.0, 100000.);
1605 hclusfml = fs->make<TProfile>("hclusfml", "clusfm vs lumi", sizeH, 0., highH, 0.0, 30000.);
1606 hpixfpl = fs->make<TProfile>("hpixfpl", "pixfp vs lumi ", sizeH, 0., highH, 0.0, 100000.);
1607 hclusfpl = fs->make<TProfile>("hclusfpl", "clusfp vs lumi", sizeH, 0., highH, 0.0, 30000.);
1608
1609 hpixbxn = fs->make<TProfile>("hpixbxn", "pix/lumi vs bx ", 4000, -0.5, 3999.5, 0.0, 1000000.);
1610 hclubxn = fs->make<TProfile>("hclubxn", "clu/lumi vs bx ", 4000, -0.5, 3999.5, 0.0, 1000000.);
1611 hpvbxn = fs->make<TProfile>("hpvbxn", "pv/lumi vs bx ", 4000, -0.5, 3999.5, 0.0, 1000000.);
1612 #endif
1613
1614 #ifdef ROC_EFF
1615
1616 hbadMap1 = fs->make<TH2F>("hbadMap1", " ", 9, -4.5, 4.5, 21, -10.5, 10.5);
1617 hbadMap1->SetOption("colz");
1618 hbadMap2 = fs->make<TH2F>("hbadMap2", " ", 9, -4.5, 4.5, 33, -16.5, 16.5);
1619 hbadMap2->SetOption("colz");
1620 hbadMap3 = fs->make<TH2F>("hbadMap3", " ", 9, -4.5, 4.5, 45, -22.5, 22.5);
1621 hbadMap3->SetOption("colz");
1622
1623 hrocHits1ls = fs->make<TH2F>("hrocHits1ls", " ", 1000, 0., 3000., 10, 0., 10.);
1624 hrocHits1ls->SetOption("colz");
1625 hrocHits2ls = fs->make<TH2F>("hrocHits2ls", " ", 1000, 0., 3000., 10, 0., 10.);
1626 hrocHits2ls->SetOption("colz");
1627 hrocHits3ls = fs->make<TH2F>("hrocHits3ls", " ", 1000, 0., 3000., 10, 0., 10.);
1628 hrocHits3ls->SetOption("colz");
1629
1630 hcountInRoc1 = fs->make<TH1D>("hcountInRoc1", "roc 1 count", 10000, -0.5, 999999.5);
1631 hcountInRoc2 = fs->make<TH1D>("hcountInRoc2", "roc 2 count", 10000, -0.5, 999999.5);
1632 hcountInRoc3 = fs->make<TH1D>("hcountInRoc3", "roc 3 count", 10000, -0.5, 999999.5);
1633 hcountInRoc12 = fs->make<TH1D>("hcountInRoc12", "roc 1 count norm", 500, -0.5, 4.5);
1634 hcountInRoc22 = fs->make<TH1D>("hcountInRoc22", "roc 2 count norm", 500, -0.5, 4.5);
1635 hcountInRoc32 = fs->make<TH1D>("hcountInRoc32", "roc 3 count norm", 500, -0.5, 4.5);
1636
1637
1638
1639
1640
1641
1642
1643
1644 #endif
1645
1646 countEvents = 0;
1647 countAllEvents = 0;
1648 sumClusters = 0., sumPixels = 0.;
1649 countLumi = 0.;
1650
1651
1652
1653
1654 #ifdef ROC_EFF
1655
1656 pixEff = new rocEfficiency();
1657 #endif
1658
1659 #ifdef BX
1660 getbx = new getBX();
1661 #endif
1662
1663 lumiCorrector = new LumiCorrector();
1664 }
1665
1666 void TestClusters::endJob() {
1667 double norm = 1;
1668 #ifdef ROC_EFF
1669 double totClusters = sumClusters;
1670 #endif
1671
1672 if (countEvents > 0) {
1673 sumClusters = sumClusters / float(countEvents);
1674 sumPixels = sumPixels / float(countEvents);
1675 norm = 1. / float(countEvents);
1676 }
1677
1678 countLumi /= 1000.;
1679 double c1 = 0, c2 = 0;
1680 double c3 = hinst->GetMean();
1681 if (c3 > 0.) {
1682 c1 = sumClusters / c3;
1683 c2 = sumPixels / c3;
1684 }
1685
1686 edm::LogPrint("TestClusters") << " End PixelClusTest, events all/with hits= " << countAllEvents << "/" << countEvents
1687 << " clus/pix per full event " << sumClusters << "/" << sumPixels;
1688 edm::LogPrint("TestClusters") << " Lumi = " << countLumi << " still the /10 bug? "
1689 << "clu and pix per lumi unit" << c1 << " " << c2;
1690
1691
1692 hsizeDetMap1->Divide(hsizeDetMap1, hDetMap1, 1., 1.);
1693 hsizeDetMap2->Divide(hsizeDetMap2, hDetMap2, 1., 1.);
1694 hsizeDetMap3->Divide(hsizeDetMap3, hDetMap3, 1., 1.);
1695
1696
1697 hDetsMap1->Scale(norm);
1698 hDetsMap2->Scale(norm);
1699 hDetsMap3->Scale(norm);
1700 hDetMap1->Scale(norm);
1701 hDetMap2->Scale(norm);
1702 hDetMap3->Scale(norm);
1703 hpDetMap1->Scale(norm);
1704 hpDetMap2->Scale(norm);
1705 hpDetMap3->Scale(norm);
1706 hpixDetMap1->Scale(norm);
1707 hpixDetMap2->Scale(norm);
1708 hpixDetMap3->Scale(norm);
1709 hcluDetMap1->Scale(norm);
1710 hcluDetMap2->Scale(norm);
1711 hcluDetMap3->Scale(norm);
1712
1713 #ifdef ROC_EFF
1714
1715 double clusPerROC = totClusters / 15000.;
1716 if (clusPerROC < 1000.) {
1717 edm::LogPrint("TestClusters")
1718 << " The average number of clusters per ROC is too low to do teh ROF efficiency analysis " << clusPerROC;
1719
1720 } else {
1721
1722 int deadRocs1 = 0, ineffRocs1 = 0, deadRocs2 = 0, ineffRocs2 = 0, deadRocs3 = 0, ineffRocs3 = 0;
1723 const int ladders1[20] = {-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
1724 const int ladders2[32] = {-16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1,
1725 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
1726 const int ladders3[44] = {-22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8,
1727 -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8,
1728 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22};
1729 const int modules[8] = {-4, -3, -2, -1, 1, 2, 3, 4};
1730 const float effCut = 0.25;
1731 float half1 = 1, half2 = 0;
1732
1733
1734 for (int ilad = 0; ilad < 20; ++ilad) {
1735 int lad = ladders1[ilad];
1736 for (int imod = 0; imod < 8; ++imod) {
1737 int mod = modules[imod];
1738 half1 = 0;
1739 half2 = 0;
1740 float count = pixEff->getModule(1, lad, mod, half1, half2);
1741
1742 if (count < 1.)
1743 continue;
1744 for (int roc = 0; roc < 16; ++roc) {
1745 if (roc < 8 && half1 == 0)
1746 continue;
1747 else if (roc > 7 && half2 == 0)
1748 continue;
1749 float tmp = pixEff->getRoc(1, lad, mod, roc);
1750 if (tmp < 0.) {
1751 if ((abs(lad) == 1 || abs(lad) == 10) && (roc > 7)) {
1752 continue;
1753 } else {
1754 edm::LogPrint("TestClusters")
1755 << " Layer1, wrong number of hits, roc " << tmp << " " << lad << " " << mod << " " << roc;
1756 }
1757 } else if (tmp == 0.) {
1758 deadRocs1++;
1759 edm::LogPrint("TestClusters") << " layer1, dead roc " << lad << " " << mod << " " << roc << " - " << count
1760 << " " << half1 << " " << half2;
1761 } else {
1762 hcountInRoc1->Fill(tmp);
1763 float tmp1 = tmp / count;
1764
1765 hcountInRoc12->Fill(tmp1);
1766 if (abs(1. - tmp1) > effCut) {
1767 ineffRocs1++;
1768 edm::LogPrint("TestClusters") << "LOW-EFF/NOISY ROC, Layer 1: " << tmp1 << "/" << tmp << " ladder " << lad
1769 << " module " << mod << " roc(false #) " << roc;
1770 hbadMap1->Fill(float(mod), float(lad));
1771 }
1772 }
1773 }
1774 }
1775 }
1776
1777 for (int ilad = 0; ilad < 32; ++ilad) {
1778 int lad = ladders2[ilad];
1779 for (int imod = 0; imod < 8; ++imod) {
1780 int mod = modules[imod];
1781 half1 = 0;
1782 half2 = 0;
1783 float count = pixEff->getModule(2, lad, mod, half1, half2);
1784
1785 if (count < 1.)
1786 continue;
1787 for (int roc = 0; roc < 16; ++roc) {
1788 if (roc < 8 && half1 == 0)
1789 continue;
1790 else if (roc > 7 && half2 == 0)
1791 continue;
1792 float tmp = pixEff->getRoc(2, lad, mod, roc);
1793 if (tmp < 0.) {
1794 if ((abs(lad) == 1 || abs(lad) == 16) && (roc > 7)) {
1795 continue;
1796 } else {
1797 edm::LogPrint("TestClusters")
1798 << " Layer 2, wrong number of hits, roc " << tmp << " " << lad << " " << mod << " " << roc;
1799 }
1800 } else if (tmp == 0.) {
1801 deadRocs2++;
1802 edm::LogPrint("TestClusters") << " layer2, dead roc " << lad << " " << mod << " " << roc << " - " << count
1803 << " " << half1 << " " << half2;
1804 } else {
1805 hcountInRoc2->Fill(tmp);
1806 float tmp1 = tmp / count;
1807
1808 hcountInRoc22->Fill(tmp1);
1809 if (abs(1. - tmp1) > effCut) {
1810 ineffRocs2++;
1811 edm::LogPrint("TestClusters") << "LOW-EFF/NOISY ROC, Layer 2: " << tmp1 << "/" << tmp << " ladder " << lad
1812 << " module " << mod << " roc(false) " << roc;
1813 hbadMap2->Fill(float(mod), float(lad));
1814 }
1815 }
1816 }
1817 }
1818 }
1819
1820 for (int ilad = 0; ilad < 44; ++ilad) {
1821 int lad = ladders3[ilad];
1822 for (int imod = 0; imod < 8; ++imod) {
1823 int mod = modules[imod];
1824 half1 = 0;
1825 half2 = 0;
1826 float count = pixEff->getModule(3, lad, mod, half1, half2);
1827
1828 if (count < 1.)
1829 continue;
1830 for (int roc = 0; roc < 16; ++roc) {
1831 float tmp = pixEff->getRoc(3, lad, mod, roc);
1832 if (tmp < 0.) {
1833 if ((abs(lad) == 1 || abs(lad) == 22) && (roc > 7)) {
1834 continue;
1835 } else {
1836 edm::LogPrint("TestClusters")
1837 << " Layer 3: wrong number of hits, roc " << tmp << " " << lad << " " << mod << " " << roc;
1838 }
1839 } else if (tmp == 0.) {
1840 deadRocs3++;
1841 edm::LogPrint("TestClusters") << " layer3, dead roc " << lad << " " << mod << " " << roc << " - " << count
1842 << " " << half1 << " " << half2;
1843 } else {
1844 hcountInRoc3->Fill(tmp);
1845 float tmp1 = tmp / count;
1846
1847 hcountInRoc32->Fill(tmp1);
1848 if (abs(1. - tmp1) > effCut) {
1849 ineffRocs3++;
1850 edm::LogPrint("TestClusters") << "LOW-EFF/NOISY ROC, Layer 3: " << tmp1 << "/" << tmp << " ladder " << lad
1851 << " module " << mod << " roc(false) " << roc;
1852 hbadMap3->Fill(float(mod), float(lad));
1853 }
1854 }
1855 }
1856 }
1857 }
1858
1859 edm::LogPrint("TestClusters") << " Bad Rocs " << deadRocs1 << " " << deadRocs2 << " " << deadRocs3
1860 << ", Inefficient Rocs " << ineffRocs1 << " " << ineffRocs2 << " " << ineffRocs3;
1861 }
1862
1863 #endif
1864 }
1865
1866
1867 void TestClusters::analyze(const edm::Event &e, const edm::EventSetup &es) {
1868 using namespace edm;
1869
1870 const int selectEvent = -1;
1871
1872 static RunNumber_t runNumberOld = -1;
1873 static int countRuns = 0;
1874
1875
1876
1877
1878 edm::ESHandle<TrackerGeometry> geom = es.getHandle(trackerGeomToken_);
1879 const TrackerGeometry &theTracker(*geom);
1880
1881 countAllEvents++;
1882 RunNumber_t const run = e.id().run();
1883 EventNumber_t const event = e.id().event();
1884 LuminosityBlockNumber_t const lumiBlock = e.luminosityBlock();
1885
1886 int bx = e.bunchCrossing();
1887 int orbit = e.orbitNumber();
1888
1889 hbx0->Fill(float(bx));
1890 hlumi0->Fill(float(lumiBlock));
1891
1892
1893
1894
1895 float instlumi = 0;
1896
1897
1898 #ifdef Lumi
1899 float instlumiAv = 0, instlumiBx = 0;
1900
1901
1902 edm::LuminosityBlock const &iLumi = e.getLuminosityBlock();
1903 edm::Handle<LumiSummary> lumi;
1904 edm::Handle<LumiDetails> ld;
1905 iLumi.getByToken(lumiSummaryToken_, lumi);
1906 iLumi.getByToken(lumiDetailsToken_, ld);
1907
1908 edm::Handle<edm::ConditionsInLumiBlock> cond;
1909 iLumi.getByToken(condToken_, cond);
1910
1911
1912
1913
1914 if (lumi.isValid()) {
1915
1916
1917 float tmp0 = (lumi->avgInsDelLumi());
1918
1919
1920 const int nbx = 1331;
1921 float corr = lumiCorrector->TotalNormOcc1((tmp0 / 1000.), nbx);
1922
1923
1924 float tmp1 = tmp0 * corr;
1925
1926 float tmp2 = tmp1 / float(nbx) / 1000.;
1927 instlumiAv = tmp2;
1928
1929 if (ld.isValid()) {
1930 instlumiBx = ld->lumiValue(LumiDetails::kOCC1, bx) * 6.37;
1931 }
1932
1933
1934
1935
1936 } else {
1937
1938 }
1939
1940 hinst->Fill(float(instlumiBx));
1941
1942 hinstls->Fill(float(lumiBlock), float(instlumiAv));
1943 hinstlsbx->Fill(float(lumiBlock), float(instlumiBx));
1944 hinstbx->Fill(float(bx), float(instlumiBx));
1945
1946
1947
1948
1949 instlumi = instlumiBx;
1950
1951 #endif
1952
1953
1954 int numPVsGood = 0;
1955 if (select2 < 11 && run > 165000) {
1956 edm::Handle<reco::VertexCollection> vertices;
1957 e.getByToken(vtxToken_, vertices);
1958
1959
1960 if (!vertices.failedToGet() && vertices.isValid()) {
1961 for (reco::VertexCollection::const_iterator iVertex = vertices->begin(); iVertex != vertices->end(); ++iVertex) {
1962 if (!iVertex->isValid())
1963 continue;
1964 if (iVertex->isFake())
1965 continue;
1966 numPVsGood++;
1967
1968 if (PRINT) {
1969 edm::LogPrint("TestClusters") << "vertex";
1970 edm::LogPrint("TestClusters") << ": x " << iVertex->x();
1971 edm::LogPrint("TestClusters") << ", y " << iVertex->y();
1972 edm::LogPrint("TestClusters") << ", z " << iVertex->z();
1973 edm::LogPrint("TestClusters") << ", ndof " << iVertex->ndof();
1974 edm::LogPrint("TestClusters") << ", sumpt " << iVertex->p4().pt();
1975 edm::LogPrint("TestClusters");
1976 }
1977 }
1978 }
1979
1980 hpvs->Fill(float(numPVsGood));
1981 hpvls->Fill(float(lumiBlock), float(numPVsGood));
1982
1983
1984
1985
1986 }
1987
1988 int bxId = -1;
1989 #ifdef BX
1990
1991 bxId = getbx->find(bx);
1992
1993 #endif
1994
1995 #ifdef BX_NEW
1996
1997 bxId = getBX::find(bx);
1998
1999 #endif
2000
2001 #if defined(BX) || defined(BX_NEW)
2002 if (bxId == 3)
2003 hbx1->Fill(float(bx));
2004 else if (bxId == 4)
2005 hbx2->Fill(float(bx));
2006 else if (bxId == 1)
2007 hbx3->Fill(float(bx));
2008 else if (bxId == 2)
2009 hbx4->Fill(float(bx));
2010 else if (bxId == 5 || bxId == 6)
2011 hbx5->Fill(float(bx));
2012 else if (bxId == 0)
2013 hbx6->Fill(float(bx));
2014
2015 #endif
2016
2017
2018 edm::Handle<edmNew::DetSetVector<SiPixelCluster> > clusters;
2019
2020 e.getByToken(myClus, clusters);
2021
2022 const edmNew::DetSetVector<SiPixelCluster> &input = *clusters;
2023 int numOf = input.size();
2024
2025
2026
2027
2028
2029
2030
2031 if (PRINT)
2032 edm::LogPrint("TestClusters") << "run " << run << " event " << event << " bx " << bx << " lumi " << lumiBlock
2033 << " orbit " << orbit << " " << numOf << " lumi " << instlumi;
2034
2035
2036
2037
2038
2039
2040
2041 #ifdef L1
2042
2043 Handle<L1GlobalTriggerReadoutRecord> L1GTRR;
2044 e.getByToken(l1gtrrToken_, L1GTRR);
2045
2046 if (L1GTRR.isValid()) {
2047
2048 const L1GtPsbWord psb = L1GTRR->gtPsbWord(0xbb09, 0);
2049 int techLowNonPres = 65536 * psb.bData(0) + psb.aData(0);
2050 int techHighNonPres = 65536 * psb.bData(1) + psb.aData(1);
2051
2052
2053
2054
2055
2056
2057 for (unsigned int i = 0; i < L1GTRR->decisionWord().size(); ++i) {
2058 int l1flag = L1GTRR->decisionWord()[i];
2059 int t1flag = L1GTRR->technicalTriggerWord()[i];
2060 int techflag = 0;
2061 if (i < 32)
2062 techflag = (techLowNonPres & (0x1 << i));
2063 else if (i < 64)
2064 techflag = (techHighNonPres & (0x1 << i));
2065
2066 if (l1flag > 0) {
2067
2068 hl1a->Fill(float(i));
2069
2070
2071
2072
2073
2074 }
2075 if (techflag > 0 && i < 64) {
2076
2077 hl1t->Fill(float(i));
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088 }
2089 if (t1flag > 0 && i < 64) {
2090
2091 hltt->Fill(float(i));
2092 }
2093
2094 }
2095
2096
2097 }
2098 #endif
2099
2100
2101
2102
2103
2104
2105
2106
2107 bool hlt[256];
2108 for (int i = 0; i < 256; ++i)
2109 hlt[i] = false;
2110
2111 #ifdef HLT
2112
2113 edm::TriggerNames TrigNames;
2114 edm::Handle<edm::TriggerResults> HLTResults;
2115
2116
2117 e.getByToken(hltToken_, HLTResults);
2118 if ((HLTResults.isValid() == true) && (HLTResults->size() > 0)) {
2119
2120 const edm::TriggerNames &TrigNames = e.triggerNames(*HLTResults);
2121
2122
2123
2124 for (unsigned int i = 0; i < TrigNames.triggerNames().size(); i++) {
2125 if (countAllEvents == 1)
2126 edm::LogPrint("TestClusters") << i << " " << TrigNames.triggerName(i);
2127
2128 if ((HLTResults->wasrun(TrigNames.triggerIndex(TrigNames.triggerName(i))) == true) &&
2129 (HLTResults->accept(TrigNames.triggerIndex(TrigNames.triggerName(i))) == true) &&
2130 (HLTResults->error(TrigNames.triggerIndex(TrigNames.triggerName(i))) == false)) {
2131 hlt[i] = true;
2132 hlt1->Fill(float(i));
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149 }
2150
2151 }
2152 }
2153 #endif
2154
2155 #ifdef USE_RESYNCS
2156 Handle<Level1TriggerScalersCollection> l1ts;
2157 e.getByToken(l1tsToken_, l1ts);
2158
2159 if (l1ts->size() > 0) {
2160 int r1 = (*l1ts)[0].lastResync();
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171 float t1 = r1 / 2.621E5;
2172 float t2 = (orbit - r1) * 88.924E-6;
2173
2174
2175
2176
2177
2178 htest1->Fill(t1);
2179 htest2->Fill(t2);
2180 htest3->Fill(float(r1));
2181 htest4->Fill(float(orbit));
2182 }
2183
2184 #endif
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202 hdets->Fill(float(numOf));
2203
2204
2205
2206
2207 if (select1 <= 0) {
2208 if (numOf < 4)
2209 return;
2210 }
2211 else {
2212 if (numOf < select1)
2213 return;
2214 }
2215
2216 hevent->Fill(float(event));
2217 hlumi->Fill(float(lumiBlock));
2218 hbx->Fill(float(bx));
2219
2220 for (unsigned int i = 0; i < 256; i++)
2221 if (hlt[i] == true)
2222 hlt2->Fill(float(i));
2223
2224 if (run != runNumberOld) {
2225 runNumberOld = run;
2226 countRuns++;
2227 }
2228 switch (countRuns) {
2229 case 1: {
2230 hlumi10->Fill(float(lumiBlock));
2231 break;
2232 }
2233 case 2: {
2234 hlumi11->Fill(float(lumiBlock));
2235 break;
2236 }
2237 case 3: {
2238 hlumi12->Fill(float(lumiBlock));
2239 break;
2240 }
2241 case 4: {
2242 hlumi13->Fill(float(lumiBlock));
2243 break;
2244 }
2245 case 5: {
2246 hlumi14->Fill(float(lumiBlock));
2247 break;
2248 }
2249
2250
2251
2252
2253
2254 default:
2255 edm::LogPrint("TestClusters") << " too many runs " << countRuns;
2256 }
2257
2258 #ifdef NEW_ID
2259
2260 edm::ESHandle<TrackerTopology> tTopo = es.getHandle(trackerTopoToken_);
2261 #endif
2262
2263
2264
2265 countEvents++;
2266 int numberOfDetUnits = 0;
2267 int numberOfClusters = 0;
2268 int numberOfPixels = 0;
2269 int numberOfNoneEdgePixels = 0;
2270 int numberOfDetUnits1 = 0;
2271 int numOfClustersPerDet1 = 0;
2272 int numOfClustersPerLay1 = 0;
2273 int numberOfDetUnits2 = 0;
2274 int numOfClustersPerDet2 = 0;
2275 int numOfClustersPerLay2 = 0;
2276 int numberOfDetUnits3 = 0;
2277 int numOfClustersPerDet3 = 0;
2278 int numOfClustersPerLay3 = 0;
2279
2280 int numOfPixPerLay1 = 0;
2281 int numOfPixPerLay2 = 0;
2282 int numOfPixPerLay3 = 0;
2283
2284 int numOfPixPerDet1 = 0;
2285 int numOfPixPerDet2 = 0;
2286 int numOfPixPerDet3 = 0;
2287
2288 int numOfPixPerLink11 = 0;
2289 int numOfPixPerLink12 = 0;
2290 int numOfPixPerLink21 = 0;
2291 int numOfPixPerLink22 = 0;
2292
2293
2294 int maxClusPerDet = 0;
2295 int maxPixPerDet = 0;
2296 unsigned int maxPixPerClu = 0;
2297
2298 int numOfClustersPerDisk1 = 0;
2299 int numOfClustersPerDisk2 = 0;
2300 int numOfClustersPerDisk3 = 0;
2301 int numOfClustersPerDisk4 = 0;
2302 int numOfPixPerDisk1 = 0;
2303 int numOfPixPerDisk2 = 0;
2304 int numOfPixPerDisk3 = 0;
2305 int numOfPixPerDisk4 = 0;
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315 edmNew::DetSetVector<SiPixelCluster>::const_iterator DSViter = input.begin();
2316 for (; DSViter != input.end(); DSViter++) {
2317
2318 unsigned int detid = DSViter->detId();
2319
2320 DetId detId = DetId(detid);
2321 unsigned int detType = detId.det();
2322 unsigned int subid = detId.subdetId();
2323
2324 if (PRINT)
2325 edm::LogPrint("TestClusters") << "Det: " << detId.rawId() << " " << detId.null() << " " << detType << " "
2326 << subid;
2327
2328 #ifdef HISTOS
2329
2330
2331
2332 #endif
2333
2334 if (detType != 1)
2335 continue;
2336 ++numberOfDetUnits;
2337
2338
2339
2340
2341
2342
2343 const PixelGeomDetUnit *theGeomDet = dynamic_cast<const PixelGeomDetUnit *>(theTracker.idToDet(detId));
2344 double detZ = theGeomDet->surface().position().z();
2345 double detR = theGeomDet->surface().position().perp();
2346
2347
2348
2349
2350
2351
2352
2353 const PixelTopology *topol = &(theGeomDet->specificTopology());
2354
2355
2356 unsigned int layerC = 0;
2357 unsigned int ladderC = 0;
2358 unsigned int zindex = 0;
2359 int shell = 0;
2360 int sector = 0;
2361 int ladder = 0;
2362 int layer = 0;
2363 int module = 0;
2364 bool half = false;
2365
2366
2367 unsigned int disk = 0;
2368 unsigned int blade = 0;
2369 unsigned int zindexF = 0;
2370 unsigned int side = 0;
2371 unsigned int panel = 0;
2372
2373 edmNew::DetSet<SiPixelCluster>::const_iterator clustIt;
2374
2375
2376 if (subid == 2) {
2377
2378 #ifdef NEW_ID
2379 disk = tTopo->pxfDisk(detid);
2380 blade = tTopo->pxfBlade(detid);
2381 zindex = tTopo->pxfModule(detid);
2382 side = tTopo->pxfSide(detid);
2383 panel = tTopo->pxfPanel(detid);
2384 #else
2385 PXFDetId pdetId = PXFDetId(detid);
2386 disk = pdetId.disk();
2387 blade = pdetId.blade();
2388 moduleF = pdetId.module();
2389 side = pdetId.side();
2390 panel = pdetId.panel();
2391 #endif
2392
2393 if (PRINT)
2394 edm::LogPrint("TestClusters") << " forward det, disk " << disk << ", blade " << blade << ", module " << zindexF
2395 << ", side " << side << ", panel " << panel << " pos = " << detZ << " " << detR;
2396
2397 } else if (subid == 1) {
2398
2399 #ifdef NEW_ID
2400 layerC = tTopo->pxbLayer(detid);
2401 ladderC = tTopo->pxbLadder(detid);
2402 zindex = tTopo->pxbModule(detid);
2403 PixelBarrelName pbn(detid);
2404 #else
2405 PXBDetId pdetId = PXBDetId(detid);
2406
2407
2408
2409 layerC = pdetId.layer();
2410
2411 ladderC = pdetId.ladder();
2412
2413 zindex = pdetId.module();
2414
2415 PixelBarrelName pbn(pdetId);
2416 #endif
2417
2418
2419 PixelBarrelName::Shell sh = pbn.shell();
2420 sector = pbn.sectorName();
2421 ladder = pbn.ladderName();
2422 layer = pbn.layerName();
2423 module = pbn.moduleName();
2424 half = pbn.isHalfModule();
2425 shell = int(sh);
2426
2427 if (shell == 1 || shell == 2)
2428 module = -module;
2429
2430 if (shell == 1 || shell == 3)
2431 ladder = -ladder;
2432
2433 if (PRINT) {
2434 edm::LogPrint("TestClusters") << " Barrel layer, ladder, module " << layerC << " " << ladderC << " " << zindex
2435 << " " << sh << "(" << shell << ") " << sector << " " << layer << " " << ladder
2436 << " " << module << " " << half;
2437
2438
2439
2440
2441
2442 }
2443
2444 }
2445
2446 if (PRINT) {
2447 edm::LogPrint("TestClusters") << "List clusters : ";
2448 edm::LogPrint("TestClusters") << "Num Charge Size SizeX SizeY X Y Xmin Xmax Ymin Ymax Edge";
2449 }
2450
2451
2452 for (clustIt = DSViter->begin(); clustIt != DSViter->end(); clustIt++) {
2453 sumClusters++;
2454 numberOfClusters++;
2455 float ch = float(clustIt->charge()) / 1000.;
2456 int size = clustIt->size();
2457 int sizeX = clustIt->sizeX();
2458 int sizeY = clustIt->sizeY();
2459 float x = clustIt->x();
2460 float y = clustIt->y();
2461
2462 int minPixelRow = clustIt->minPixelRow();
2463 int maxPixelRow = clustIt->maxPixelRow();
2464 int minPixelCol = clustIt->minPixelCol();
2465 int maxPixelCol = clustIt->maxPixelCol();
2466
2467
2468
2469 bool edgeHitX = (topol->isItEdgePixelInX(minPixelRow)) || (topol->isItEdgePixelInX(maxPixelRow));
2470 bool edgeHitY = (topol->isItEdgePixelInY(minPixelCol)) || (topol->isItEdgePixelInY(maxPixelCol));
2471
2472 bool edgeHitX2 = false;
2473 bool edgeHitY2 = false;
2474
2475 if (PRINT)
2476 edm::LogPrint("TestClusters") << numberOfClusters << " " << ch << " " << size << " " << sizeX << " " << sizeY
2477 << " " << x << " " << y << " " << minPixelRow << " " << maxPixelRow << " "
2478 << minPixelCol << " " << maxPixelCol << " " << edgeHitX << " " << edgeHitY;
2479
2480
2481 LocalPoint lp = topol->localPosition(MeasurementPoint(x, y));
2482 float lx = lp.x();
2483 float ly = lp.y();
2484
2485 float zPos = detZ - ly;
2486 float rPos = detR + lx;
2487
2488
2489 const vector<SiPixelCluster::Pixel> &pixelsVec = clustIt->pixels();
2490 if (PRINT)
2491 edm::LogPrint("TestClusters") << " Pixels in this cluster ";
2492
2493
2494 bool edgeInX = false;
2495 bool edgeInY = false;
2496
2497
2498
2499
2500 if (pixelsVec.size() > maxPixPerClu)
2501 maxPixPerClu = pixelsVec.size();
2502
2503 for (unsigned int i = 0; i < pixelsVec.size(); ++i) {
2504 sumPixels++;
2505 numberOfPixels++;
2506 float pixx = pixelsVec[i].x;
2507 float pixy = pixelsVec[i].y;
2508 float adc = (float(pixelsVec[i].adc) / 1000.);
2509 #ifdef ROC_EFF
2510 int roc = rocId(int(pixy), int(pixx));
2511 #endif
2512
2513
2514 bool bigInX = topol->isItBigPixelInX(int(pixx));
2515 bool bigInY = topol->isItBigPixelInY(int(pixy));
2516 if (!(bigInX || bigInY))
2517 numberOfNoneEdgePixels++;
2518
2519 #ifdef HISTOS
2520
2521 if (subid == 1 && (selectEvent == -1 || countEvents == selectEvent)) {
2522 if (layer == 1) {
2523 numOfPixPerDet1++;
2524 numOfPixPerLay1++;
2525
2526 hpixcharge1->Fill(adc);
2527 hpixDetMap1->Fill(pixy, pixx);
2528 hpDetMap1->Fill(float(module), float(ladder));
2529
2530
2531 hpcols1->Fill(pixy);
2532 hprows1->Fill(pixx);
2533
2534 if (ladder == -1 && module == -1)
2535 hpixDetMap10->Fill(pixy, pixx);
2536
2537
2538 else if (ladder == 2 && module == 8)
2539 hpixDetMap11->Fill(pixy, pixx);
2540 else if (ladder == 2 && module == -2)
2541 hpixDetMap12->Fill(pixy, pixx);
2542
2543 else if (ladder == -9 && module == 4)
2544 hpixDetMap13->Fill(pixy, pixx);
2545 else if (ladder == -8 && module == -4)
2546 hpixDetMap14->Fill(pixy, pixx);
2547 else if (ladder == 6 && module == 4)
2548 hpixDetMap15->Fill(pixy, pixx);
2549 else if (ladder == 9 && module == 4)
2550 hpixDetMap16->Fill(pixy, pixx);
2551 else if (ladder == -3 && module == -3)
2552 hpixDetMap17->Fill(pixy, pixx);
2553 else if (ladder == -7 && module == -4)
2554 hpixDetMap18->Fill(pixy, pixx);
2555 else if (ladder == -5 && module == -4)
2556 hpixDetMap19->Fill(pixy, pixx);
2557
2558
2559
2560
2561
2562 if (pixx < 80.)
2563 numOfPixPerLink11++;
2564 else
2565 numOfPixPerLink12++;
2566
2567 hpixchar1->Fill(zPos, adc);
2568 hcharPixbx->Fill(bx, adc);
2569 hcharPixls->Fill(lumiBlock, adc);
2570 hcharPixLumi->Fill(instlumi, adc);
2571
2572 #ifdef VDM_STUDIES
2573 hcharPixls1->Fill(lumiBlock, adc);
2574 #endif
2575
2576 #if defined(BX) || defined(BX_NEW)
2577 if (bxId > -1) {
2578 if (bxId == 3)
2579 hpixChargebx1->Fill(adc);
2580 else if (bxId == 4)
2581 hpixChargebx2->Fill(adc);
2582 else if (bxId == 0)
2583 hpixChargebx6->Fill(adc);
2584 else if (bxId == 1)
2585 hpixChargebx3->Fill(adc);
2586 else if (bxId == 2)
2587 hpixChargebx3->Fill(adc);
2588 else if (bxId == 5 || bxId == 6)
2589 hpixChargebx5->Fill(adc);
2590 else
2591 edm::LogPrint("TestClusters") << " wrong bx id " << bxId;
2592 }
2593 #endif
2594
2595 #ifdef ROC_EFF
2596 pixEff->addPixel(1, ladder, module, roc);
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618 if (ladder == -9 && module == 4 && roc == 12)
2619 hrocHits1ls->Fill(float(lumiBlock), 0);
2620 else if (ladder == -7 && module == -4 && roc == 3)
2621 hrocHits1ls->Fill(float(lumiBlock), 1);
2622 else if (ladder == -5 && module == -4 && roc == 11)
2623 hrocHits1ls->Fill(float(lumiBlock), 2);
2624 else if (ladder == 2 && module == -2 && roc == 1)
2625 hrocHits1ls->Fill(float(lumiBlock), 3);
2626 else if (ladder == 8 && module == 2 && roc == 1)
2627 hrocHits1ls->Fill(float(lumiBlock), 4);
2628
2629 #endif
2630
2631 } else if (layer == 2) {
2632 numOfPixPerDet2++;
2633 numOfPixPerLay2++;
2634
2635 hpcols2->Fill(pixy);
2636 hprows2->Fill(pixx);
2637
2638 if (ladder == -11 && module == -2)
2639 hpixDetMap20->Fill(pixy, pixx);
2640 else if (ladder == -7 && module == -3)
2641 hpixDetMap21->Fill(pixy, pixx);
2642 else if (ladder == -2 && module == 1)
2643 hpixDetMap22->Fill(pixy, pixx);
2644 else if (ladder == -14 && module == 4)
2645 hpixDetMap23->Fill(pixy, pixx);
2646 else if (ladder == -14 && module == 1)
2647 hpixDetMap24->Fill(pixy, pixx);
2648 else if (ladder == -14 && module == -1)
2649 hpixDetMap25->Fill(pixy, pixx);
2650
2651 else if (ladder == -4 && module == 4)
2652 hpixDetMap26->Fill(pixy, pixx);
2653 else if (ladder == 6 && module == -2)
2654 hpixDetMap27->Fill(pixy, pixx);
2655
2656
2657 else if (ladder == -10 && module == -3)
2658 hpixDetMap28->Fill(pixy, pixx);
2659 else if (ladder == 14 && module == 3)
2660 hpixDetMap29->Fill(pixy, pixx);
2661
2662 if (pixx < 80.)
2663 numOfPixPerLink21++;
2664 else
2665 numOfPixPerLink22++;
2666
2667 #if defined(BX) || defined(BX_NEW)
2668 if (bxId > -1) {
2669 if (bxId == 3)
2670 hpixChargebx1->Fill(adc);
2671 else if (bxId == 4)
2672 hpixChargebx2->Fill(adc);
2673 else if (bxId == 0)
2674 hpixChargebx6->Fill(adc);
2675 else if (bxId == 1)
2676 hpixChargebx3->Fill(adc);
2677 else if (bxId == 2)
2678 hpixChargebx3->Fill(adc);
2679 else if (bxId == 5 || bxId == 6)
2680 hpixChargebx5->Fill(adc);
2681 else
2682 edm::LogPrint("TestClusters") << " wrong bx id " << bxId;
2683 }
2684 #endif
2685
2686 #ifdef ROC_EFF
2687 pixEff->addPixel(2, ladder, module, roc);
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710 if (ladder == -2 && module == 1 && roc == 10)
2711 hrocHits2ls->Fill(float(lumiBlock), 0);
2712 else if (ladder == 10 && module == -3 && roc == 2)
2713 hrocHits2ls->Fill(float(lumiBlock), 1);
2714 else if (ladder == 15 && module == 3 && roc == 7)
2715 hrocHits2ls->Fill(float(lumiBlock), 2);
2716
2717 #endif
2718
2719 hpixcharge2->Fill(adc);
2720 hpixDetMap2->Fill(pixy, pixx);
2721 hpDetMap2->Fill(float(module), float(ladder));
2722
2723
2724 hpixchar2->Fill(zPos, adc);
2725 hcharPixbx->Fill(bx, adc);
2726 hcharPixls->Fill(lumiBlock, adc);
2727 hcharPixLumi->Fill(instlumi, adc);
2728
2729 #ifdef VDM_STUDIES
2730 hcharPixls2->Fill(lumiBlock, adc);
2731 #endif
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742 } else if (layer == 3) {
2743 numOfPixPerDet3++;
2744 numOfPixPerLay3++;
2745
2746 hpixcharge3->Fill(adc);
2747 hpixDetMap3->Fill(pixy, pixx);
2748
2749 hpDetMap3->Fill(float(module), float(ladder));
2750
2751
2752 hpcols3->Fill(pixy);
2753 hprows3->Fill(pixx);
2754
2755 if (ladder == -5 && module == -4)
2756 hpixDetMap30->Fill(pixy, pixx);
2757 else if (ladder == 9 && module == 4)
2758 hpixDetMap31->Fill(pixy, pixx);
2759 else if (ladder == 15 && module == -3)
2760 hpixDetMap32->Fill(pixy, pixx);
2761 else if (ladder == 17 && module == -4)
2762 hpixDetMap33->Fill(pixy, pixx);
2763
2764
2765 else if (ladder == -6 && module == -1)
2766 hpixDetMap34->Fill(pixy, pixx);
2767 else if (ladder == -13 && module == 4)
2768 hpixDetMap35->Fill(pixy, pixx);
2769 else if (ladder == 14 && module == -4)
2770 hpixDetMap36->Fill(pixy, pixx);
2771 else if (ladder == -6 && module == 2)
2772 hpixDetMap37->Fill(pixy, pixx);
2773 else if (ladder == 19 && module == -4)
2774 hpixDetMap38->Fill(pixy, pixx);
2775
2776
2777 else if (ladder == -7 && module == -4)
2778 hpixDetMap39->Fill(pixy, pixx);
2779
2780 hpixchar3->Fill(zPos, adc);
2781 hcharPixbx->Fill(bx, adc);
2782 hcharPixls->Fill(lumiBlock, adc);
2783 hcharPixLumi->Fill(instlumi, adc);
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797 #ifdef VDM_STUDIES
2798 hcharPixls3->Fill(lumiBlock, adc);
2799 #endif
2800
2801 #if defined(BX) || defined(BX_NEW)
2802 if (bxId > -1) {
2803 if (bxId == 3)
2804 hpixChargebx1->Fill(adc);
2805 else if (bxId == 4)
2806 hpixChargebx2->Fill(adc);
2807 else if (bxId == 0)
2808 hpixChargebx6->Fill(adc);
2809 else if (bxId == 1)
2810 hpixChargebx3->Fill(adc);
2811 else if (bxId == 2)
2812 hpixChargebx3->Fill(adc);
2813 else if (bxId == 5 || bxId == 6)
2814 hpixChargebx5->Fill(adc);
2815 else
2816 edm::LogPrint("TestClusters") << " wrong bx id " << bxId;
2817 }
2818 #endif
2819
2820 #ifdef ROC_EFF
2821 pixEff->addPixel(3, ladder, module, roc);
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844 if (ladder == -13 && module == 4 && roc == 12)
2845 hrocHits3ls->Fill(float(lumiBlock), 0);
2846 else if (ladder == -7 && module == -4 && roc == 15)
2847 hrocHits3ls->Fill(float(lumiBlock), 1);
2848 else if (ladder == -6 && module == -2 && roc == 10)
2849 hrocHits3ls->Fill(float(lumiBlock), 2);
2850
2851
2852
2853 #endif
2854
2855 }
2856
2857 } else if (subid == 2 && (selectEvent == -1 || countEvents == selectEvent)) {
2858
2859
2860 if (disk == 1) {
2861 if (side == 1)
2862 numOfPixPerDisk2++;
2863 else if (side == 2)
2864 numOfPixPerDisk3++;
2865 else
2866 edm::LogPrint("TestClusters") << " unknown side " << side;
2867
2868 hpixcharge4->Fill(adc);
2869 hpixDiskR1->Fill(rPos);
2870
2871 } else if (disk == 2) {
2872
2873 if (side == 1)
2874 numOfPixPerDisk1++;
2875 else if (side == 2)
2876 numOfPixPerDisk4++;
2877 else
2878 edm::LogPrint("TestClusters") << " unknown side " << side;
2879
2880 hpixcharge5->Fill(adc);
2881 hpixDiskR2->Fill(rPos);
2882
2883 } else
2884 edm::LogPrint("TestClusters") << " unknown disk " << disk;
2885
2886 }
2887
2888 #endif
2889
2890
2891 edgeInX = topol->isItEdgePixelInX(int(pixx));
2892 edgeInY = topol->isItEdgePixelInY(int(pixy));
2893
2894 if (PRINT)
2895 edm::LogPrint("TestClusters") << i << " " << pixx << " " << pixy << " " << adc << " " << bigInX << " "
2896 << bigInY << " " << edgeInX << " " << edgeInY;
2897
2898 if (edgeInX)
2899 edgeHitX2 = true;
2900 if (edgeInY)
2901 edgeHitY2 = true;
2902
2903
2904
2905 }
2906
2907 #ifdef HISTOS
2908
2909
2910 if (subid == 1 && (selectEvent == -1 || countEvents == selectEvent)) {
2911
2912
2913 if (layer == 1) {
2914
2915 hDetMap1->Fill(float(module), float(ladder));
2916 hsizeDetMap1->Fill(float(module), float(ladder), float(size));
2917
2918
2919
2920 hcluDetMap1->Fill(y, x);
2921 hcharge1->Fill(ch);
2922
2923
2924 hsize1->Fill(float(size));
2925 hsizex1->Fill(float(sizeX));
2926 hsizey1->Fill(float(sizeY));
2927 numOfClustersPerDet1++;
2928 numOfClustersPerLay1++;
2929
2930
2931
2932
2933
2934
2935
2936 hgz1->Fill(zPos);
2937 hclumult1->Fill(zPos, size);
2938 hclumultx1->Fill(zPos, sizeX);
2939 hclumulty1->Fill(zPos, sizeY);
2940 hcluchar1->Fill(zPos, ch);
2941
2942 #if defined(BX) || defined(BX_NEW)
2943 if (bxId > -1) {
2944 if (bxId == 3) {
2945 hchargebx1->Fill(ch);
2946 hsizebx1->Fill(size);
2947 }
2948 else if (bxId == 4) {
2949 hchargebx2->Fill(ch);
2950 hsizebx2->Fill(size);
2951 }
2952 else if (bxId == 0) {
2953 hchargebx6->Fill(ch);
2954 hsizebx6->Fill(size);
2955 }
2956 else if (bxId == 1) {
2957 hchargebx3->Fill(ch);
2958 hsizebx3->Fill(size);
2959 }
2960 else if (bxId == 2) {
2961 hchargebx4->Fill(ch);
2962 hsizebx3->Fill(size);
2963 }
2964 else if (bxId == 5 || bxId == 6) {
2965 hchargebx5->Fill(ch);
2966 hsizebx5->Fill(size);
2967 }
2968 else
2969 edm::LogPrint("TestClusters") << " wrong bx id " << bxId;
2970 }
2971
2972 #endif
2973
2974 hcharClubx->Fill(bx, ch);
2975 hsizeClubx->Fill(bx, size);
2976 hsizeYClubx->Fill(bx, sizeY);
2977 hcharCluls->Fill(lumiBlock, ch);
2978 hsizeCluls->Fill(lumiBlock, size);
2979 hsizeXCluls->Fill(lumiBlock, sizeX);
2980
2981 hcharCluLumi->Fill(instlumi, ch);
2982 hsizeCluLumi->Fill(instlumi, size);
2983 hsizeXCluLumi->Fill(instlumi, sizeX);
2984 hsizeYCluLumi->Fill(instlumi, sizeY);
2985
2986
2987
2988
2989
2990 #ifdef VDM_STUDIES
2991 hcharCluls1->Fill(lumiBlock, ch);
2992 hsizeCluls1->Fill(lumiBlock, size);
2993 hsizeXCluls1->Fill(lumiBlock, sizeX);
2994 #endif
2995
2996 } else if (layer == 2) {
2997 hDetMap2->Fill(float(module), float(ladder));
2998 hsizeDetMap2->Fill(float(module), float(ladder), float(size));
2999
3000
3001
3002 hcluDetMap2->Fill(y, x);
3003 hcharge2->Fill(ch);
3004
3005
3006 hsize2->Fill(float(size));
3007 hsizex2->Fill(float(sizeX));
3008 hsizey2->Fill(float(sizeY));
3009 numOfClustersPerDet2++;
3010 numOfClustersPerLay2++;
3011
3012 hgz2->Fill(zPos);
3013 hclumult2->Fill(zPos, size);
3014 hclumultx2->Fill(zPos, sizeX);
3015 hclumulty2->Fill(zPos, sizeY);
3016 hcluchar2->Fill(zPos, ch);
3017
3018 if ((ladder == -11 && module == -1) || (ladder == -11 && module == 1)) {
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034 }
3035
3036 #if defined(BX) || defined(BX_NEW)
3037 if (bxId > -1) {
3038 if (bxId == 3) {
3039 hchargebx1->Fill(ch);
3040 hsizebx1->Fill(size);
3041 }
3042 else if (bxId == 4) {
3043 hchargebx2->Fill(ch);
3044 hsizebx2->Fill(size);
3045 }
3046 else if (bxId == 0) {
3047 hchargebx6->Fill(ch);
3048 hsizebx6->Fill(size);
3049 }
3050 else if (bxId == 1) {
3051 hchargebx3->Fill(ch);
3052 hsizebx3->Fill(size);
3053 }
3054 else if (bxId == 2) {
3055 hchargebx4->Fill(ch);
3056 hsizebx3->Fill(size);
3057 }
3058 else if (bxId == 5 || bxId == 6) {
3059 hchargebx5->Fill(ch);
3060 hsizebx5->Fill(size);
3061 }
3062 else
3063 edm::LogPrint("TestClusters") << " wrong bx id " << bxId;
3064 }
3065 #endif
3066
3067 hcharClubx->Fill(bx, ch);
3068 hsizeClubx->Fill(bx, size);
3069 hsizeYClubx->Fill(bx, sizeY);
3070 hcharCluls->Fill(lumiBlock, ch);
3071 hsizeCluls->Fill(lumiBlock, size);
3072 hsizeXCluls->Fill(lumiBlock, sizeX);
3073 hcharCluLumi->Fill(instlumi, ch);
3074 hsizeCluLumi->Fill(instlumi, size);
3075 hsizeXCluLumi->Fill(instlumi, sizeX);
3076 hsizeYCluLumi->Fill(instlumi, sizeY);
3077
3078
3079
3080
3081
3082 #ifdef VDM_STUDIES
3083 hcharCluls2->Fill(lumiBlock, ch);
3084 hsizeCluls2->Fill(lumiBlock, size);
3085 hsizeXCluls2->Fill(lumiBlock, sizeX);
3086 #endif
3087
3088 } else if (layer == 3) {
3089 hDetMap3->Fill(float(module), float(ladder));
3090 hsizeDetMap3->Fill(float(module), float(ladder), float(size));
3091
3092
3093
3094 hcluDetMap3->Fill(y, x);
3095 hcharge3->Fill(ch);
3096
3097
3098 hsize3->Fill(float(size));
3099 hsizex3->Fill(float(sizeX));
3100 hsizey3->Fill(float(sizeY));
3101 numOfClustersPerDet3++;
3102 numOfClustersPerLay3++;
3103
3104 hgz3->Fill(zPos);
3105 hclumult3->Fill(zPos, size);
3106 hclumultx3->Fill(zPos, sizeX);
3107 hclumulty3->Fill(zPos, sizeY);
3108 hcluchar3->Fill(zPos, ch);
3109
3110 #if defined(BX) || defined(BX_NEW)
3111 if (bxId > -1) {
3112 if (bxId == 3) {
3113 hchargebx1->Fill(ch);
3114 hsizebx1->Fill(size);
3115 }
3116 else if (bxId == 4) {
3117 hchargebx2->Fill(ch);
3118 hsizebx2->Fill(size);
3119 }
3120 else if (bxId == 0) {
3121 hchargebx6->Fill(ch);
3122 hsizebx6->Fill(size);
3123 }
3124 else if (bxId == 1) {
3125 hchargebx3->Fill(ch);
3126 hsizebx3->Fill(size);
3127 }
3128 else if (bxId == 2) {
3129 hchargebx4->Fill(ch);
3130 hsizebx3->Fill(size);
3131 }
3132 else if (bxId == 5 || bxId == 6) {
3133 hchargebx5->Fill(ch);
3134 hsizebx5->Fill(size);
3135 }
3136 else
3137 edm::LogPrint("TestClusters") << " wrong bx id " << bxId;
3138 }
3139 #endif
3140
3141 hcharClubx->Fill(bx, ch);
3142 hsizeClubx->Fill(bx, size);
3143 hsizeYClubx->Fill(bx, sizeY);
3144 hcharCluls->Fill(lumiBlock, ch);
3145 hsizeCluls->Fill(lumiBlock, size);
3146 hsizeXCluls->Fill(lumiBlock, sizeX);
3147 hcharCluLumi->Fill(instlumi, ch);
3148 hsizeCluLumi->Fill(instlumi, size);
3149 hsizeXCluLumi->Fill(instlumi, sizeX);
3150 hsizeYCluLumi->Fill(instlumi, sizeY);
3151
3152
3153
3154
3155
3156 #ifdef VDM_STUDIES
3157 hcharCluls3->Fill(lumiBlock, ch);
3158 hsizeCluls3->Fill(lumiBlock, size);
3159 hsizeXCluls3->Fill(lumiBlock, sizeX);
3160 #endif
3161
3162 }
3163
3164 } else if (subid == 2 && (selectEvent == -1 || countEvents == selectEvent)) {
3165
3166
3167 if (disk == 1) {
3168 if (side == 1) {
3169 numOfClustersPerDisk2++;
3170
3171 } else if (side == 2) {
3172 numOfClustersPerDisk3++;
3173
3174 } else
3175 edm::LogPrint("TestClusters") << " unknown side " << side;
3176
3177 hcharge4->Fill(ch);
3178
3179 } else if (disk == 2) {
3180
3181 if (side == 1) {
3182 numOfClustersPerDisk1++;
3183
3184 } else if (side == 2) {
3185 numOfClustersPerDisk4++;
3186
3187 } else
3188 edm::LogPrint("TestClusters") << " unknown side " << side;
3189
3190 hcharge5->Fill(ch);
3191
3192 } else
3193 edm::LogPrint("TestClusters") << " unknown disk " << disk;
3194
3195 }
3196
3197 #endif
3198
3199 if ((edgeHitX != edgeHitX2) && sizeX < 64)
3200 edm::LogPrint("TestClusters") << " wrong egdeX " << edgeHitX << " " << edgeHitX2;
3201 if ((edgeHitY != edgeHitY2) && sizeY < 64)
3202 edm::LogPrint("TestClusters") << " wrong egdeY " << edgeHitY << " " << edgeHitY2;
3203
3204 }
3205
3206 if (numOfClustersPerDet1 > maxClusPerDet)
3207 maxClusPerDet = numOfClustersPerDet1;
3208 if (numOfClustersPerDet2 > maxClusPerDet)
3209 maxClusPerDet = numOfClustersPerDet2;
3210 if (numOfClustersPerDet3 > maxClusPerDet)
3211 maxClusPerDet = numOfClustersPerDet3;
3212
3213 if (PRINT) {
3214 if (layer == 1)
3215 edm::LogPrint("TestClusters") << "Lay1: number of clusters per det = " << numOfClustersPerDet1;
3216 else if (layer == 2)
3217 edm::LogPrint("TestClusters") << "Lay2: number of clusters per det = " << numOfClustersPerDet1;
3218 else if (layer == 3)
3219 edm::LogPrint("TestClusters") << "Lay3: number of clusters per det = " << numOfClustersPerDet1;
3220 }
3221
3222 #ifdef HISTOS
3223 if (subid == 1 && (selectEvent == -1 || countEvents == selectEvent)) {
3224
3225
3226
3227
3228
3229 if (layer == 1) {
3230 hladder1id->Fill(float(ladder));
3231 hz1id->Fill(float(module));
3232 ++numberOfDetUnits1;
3233 hclusPerDet1->Fill(float(numOfClustersPerDet1));
3234 hpixPerDet1->Fill(float(numOfPixPerDet1));
3235 if (numOfPixPerDet1 > maxPixPerDet)
3236 maxPixPerDet = numOfPixPerDet1;
3237
3238 hpixPerLink1->Fill(float(numOfPixPerLink11));
3239 hpixPerLink1->Fill(float(numOfPixPerLink12));
3240 hDetsMap1->Fill(float(module), float(ladder));
3241
3242 if (abs(module) == 1)
3243 hpixPerDet11->Fill(float(numOfPixPerDet1));
3244 else if (abs(module) == 2)
3245 hpixPerDet12->Fill(float(numOfPixPerDet1));
3246 else if (abs(module) == 3)
3247 hpixPerDet13->Fill(float(numOfPixPerDet1));
3248 else if (abs(module) == 4)
3249 hpixPerDet14->Fill(float(numOfPixPerDet1));
3250
3251 numOfClustersPerDet1 = 0;
3252 numOfPixPerDet1 = 0;
3253 numOfPixPerLink11 = 0;
3254 numOfPixPerLink12 = 0;
3255
3256 } else if (layer == 2) {
3257 hladder2id->Fill(float(ladder));
3258 hz2id->Fill(float(module));
3259 ++numberOfDetUnits2;
3260 hclusPerDet2->Fill(float(numOfClustersPerDet2));
3261 hpixPerDet2->Fill(float(numOfPixPerDet2));
3262 if (numOfPixPerDet2 > maxPixPerDet)
3263 maxPixPerDet = numOfPixPerDet2;
3264 hpixPerLink2->Fill(float(numOfPixPerLink21));
3265 hpixPerLink2->Fill(float(numOfPixPerLink22));
3266 hDetsMap2->Fill(float(module), float(ladder));
3267
3268 if (abs(module) == 1)
3269 hpixPerDet21->Fill(float(numOfPixPerDet2));
3270 else if (abs(module) == 2)
3271 hpixPerDet22->Fill(float(numOfPixPerDet2));
3272 else if (abs(module) == 3)
3273 hpixPerDet23->Fill(float(numOfPixPerDet2));
3274 else if (abs(module) == 4)
3275 hpixPerDet24->Fill(float(numOfPixPerDet2));
3276
3277 numOfClustersPerDet2 = 0;
3278 numOfPixPerDet2 = 0;
3279 numOfPixPerLink21 = 0;
3280 numOfPixPerLink22 = 0;
3281
3282 } else if (layer == 3) {
3283 hladder3id->Fill(float(ladder));
3284 hz3id->Fill(float(module));
3285 ++numberOfDetUnits3;
3286 hclusPerDet3->Fill(float(numOfClustersPerDet3));
3287 hpixPerDet3->Fill(float(numOfPixPerDet3));
3288 if (numOfPixPerDet3 > maxPixPerDet)
3289 maxPixPerDet = numOfPixPerDet3;
3290 hDetsMap3->Fill(float(module), float(ladder));
3291
3292 if (abs(module) == 1)
3293 hpixPerDet31->Fill(float(numOfPixPerDet3));
3294 else if (abs(module) == 2)
3295 hpixPerDet32->Fill(float(numOfPixPerDet3));
3296 else if (abs(module) == 3)
3297 hpixPerDet33->Fill(float(numOfPixPerDet3));
3298 else if (abs(module) == 4)
3299 hpixPerDet34->Fill(float(numOfPixPerDet3));
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313 numOfClustersPerDet3 = 0;
3314 numOfPixPerDet3 = 0;
3315
3316
3317 }
3318
3319 }
3320
3321 #endif
3322
3323 }
3324
3325 if (PRINT || countEvents == selectEvent) {
3326 edm::LogPrint("TestClusters") << "run " << run << " event " << event << " bx " << bx << " lumi " << lumiBlock
3327 << " orbit " << orbit << " " << countEvents;
3328 edm::LogPrint("TestClusters") << "Num of pix " << numberOfPixels << " num of clus " << numberOfClusters
3329 << " max clus per det " << maxClusPerDet << " max pix per clu " << maxPixPerClu
3330 << " count " << countEvents;
3331 edm::LogPrint("TestClusters") << "Number of clusters per Lay1,2,3: " << numOfClustersPerLay1 << " "
3332 << numOfClustersPerLay2 << " " << numOfClustersPerLay3;
3333 edm::LogPrint("TestClusters") << "Number of pixels per Lay1,2,3: " << numOfPixPerLay1 << " " << numOfPixPerLay2
3334 << " " << numOfPixPerLay3;
3335 edm::LogPrint("TestClusters") << "Number of dets with clus in Lay1,2,3: " << numberOfDetUnits1 << " "
3336 << numberOfDetUnits2 << " " << numberOfDetUnits3;
3337 }
3338
3339 #ifdef HISTOS
3340
3341
3342 if ((selectEvent == -1 || countEvents == selectEvent)) {
3343 hdets2->Fill(float(numOf));
3344 hlumi1->Fill(float(lumiBlock));
3345
3346
3347
3348
3349
3350
3351 hdigis->Fill(float(numberOfPixels));
3352 hdigis2->Fill(float(numberOfPixels));
3353
3354 int pixb = numOfPixPerLay1 + numOfPixPerLay2 + numOfPixPerLay3;
3355 hdigisB->Fill(float(pixb));
3356 int pixf = numOfPixPerDisk1 + numOfPixPerDisk2 + numOfPixPerDisk3 + numOfPixPerDisk4;
3357 hdigisF->Fill(float(pixf));
3358
3359 hclus->Fill(float(numberOfClusters));
3360 hclus2->Fill(float(numberOfClusters));
3361
3362
3363
3364 hclupv->Fill(float(numberOfClusters), float(numPVsGood));
3365 hpixpv->Fill(float(numberOfPixels), float(numPVsGood));
3366
3367
3368
3369
3370
3371
3372
3373 int clusb = numOfClustersPerLay1 + numOfClustersPerLay2 + numOfClustersPerLay3;
3374 hclusBPix->Fill(float(clusb));
3375
3376 int clusf = numOfClustersPerDisk1 + numOfClustersPerDisk2 + numOfClustersPerDisk3 + numOfClustersPerDisk4;
3377 hclusFPix->Fill(float(clusf));
3378
3379 hclus5->Fill(float(numberOfNoneEdgePixels));
3380 hclusls->Fill(float(lumiBlock), float(numberOfClusters));
3381 hpixls->Fill(float(lumiBlock), float(numberOfPixels));
3382
3383 hclubx->Fill(float(bx), float(numberOfClusters));
3384 hpixbx->Fill(float(bx), float(numberOfPixels));
3385 hpvbx->Fill(float(bx), float(numPVsGood));
3386
3387 #ifdef VDM_STUDIES
3388 hclusls1->Fill(float(lumiBlock), float(numOfClustersPerLay1));
3389 hpixls1->Fill(float(lumiBlock), float(numOfPixPerLay1));
3390 hclusls2->Fill(float(lumiBlock), float(numOfClustersPerLay2));
3391 hpixls2->Fill(float(lumiBlock), float(numOfPixPerLay2));
3392 hclusls3->Fill(float(lumiBlock), float(numOfClustersPerLay3));
3393 hpixls3->Fill(float(lumiBlock), float(numOfPixPerLay3));
3394 #endif
3395
3396 if (instlumi > 0.) {
3397 hcluLumi->Fill(instlumi, float(numberOfClusters));
3398 hpixLumi->Fill(instlumi, float(numberOfPixels));
3399
3400 #ifdef INSTLUMI_STUDIES
3401
3402 float tmp = float(numberOfClusters) / instlumi;
3403 hcluslsn->Fill(float(lumiBlock), tmp);
3404 tmp = float(numberOfPixels) / instlumi;
3405 hpixlsn->Fill(float(lumiBlock), tmp);
3406
3407
3408 tmp = float(pixb);
3409 hpixbl->Fill(instlumi, tmp);
3410
3411 tmp = float(numOfPixPerLay1);
3412 hpixb1l->Fill(instlumi, tmp);
3413 tmp = float(numOfPixPerLay2);
3414 hpixb2l->Fill(instlumi, tmp);
3415 tmp = float(numOfPixPerLay3);
3416 hpixb3l->Fill(instlumi, tmp);
3417
3418 tmp = float(pixf);
3419 hpixfl->Fill(instlumi, tmp);
3420
3421 tmp = float(numOfPixPerDisk1 + numOfPixPerDisk2);
3422 hpixfml->Fill(instlumi, tmp);
3423 tmp = float(numOfPixPerDisk3 + numOfPixPerDisk4);
3424 hpixfpl->Fill(instlumi, tmp);
3425
3426 tmp = float(clusb);
3427 hclusbl->Fill(instlumi, tmp);
3428 tmp = float(numOfClustersPerLay1);
3429 hclusb1l->Fill(instlumi, tmp);
3430 tmp = float(numOfClustersPerLay2);
3431 hclusb2l->Fill(instlumi, tmp);
3432 tmp = float(numOfClustersPerLay3);
3433 hclusb3l->Fill(instlumi, tmp);
3434
3435 tmp = float(clusf);
3436 hclusfl->Fill(instlumi, tmp);
3437 tmp = float(numOfClustersPerDisk1 + numOfClustersPerDisk2);
3438 hclusfml->Fill(instlumi, tmp);
3439 tmp = float(numOfClustersPerDisk3 + numOfClustersPerDisk4);
3440 hclusfpl->Fill(instlumi, tmp);
3441
3442
3443 tmp = float(numberOfClusters) / instlumi;
3444 hclubxn->Fill(float(bx), tmp);
3445 tmp = float(numberOfPixels) / instlumi;
3446 hpixbxn->Fill(float(bx), tmp);
3447 tmp = float(numPVsGood) / instlumi;
3448 hpvbxn->Fill(float(bx), tmp);
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459 #endif
3460
3461 }
3462
3463 hclusPerLay1->Fill(float(numOfClustersPerLay1));
3464 hclusPerLay2->Fill(float(numOfClustersPerLay2));
3465 hclusPerLay3->Fill(float(numOfClustersPerLay3));
3466 hpixPerLay1->Fill(float(numOfPixPerLay1));
3467 hpixPerLay2->Fill(float(numOfPixPerLay2));
3468 hpixPerLay3->Fill(float(numOfPixPerLay3));
3469 if (numOfClustersPerLay1 > 0)
3470 hdetsPerLay1->Fill(float(numberOfDetUnits1));
3471 if (numOfClustersPerLay2 > 0)
3472 hdetsPerLay2->Fill(float(numberOfDetUnits2));
3473 if (numOfClustersPerLay3 > 0)
3474 hdetsPerLay3->Fill(float(numberOfDetUnits3));
3475
3476 hclusPerDisk1->Fill(float(numOfClustersPerDisk1));
3477 hclusPerDisk2->Fill(float(numOfClustersPerDisk2));
3478 hclusPerDisk3->Fill(float(numOfClustersPerDisk3));
3479 hclusPerDisk4->Fill(float(numOfClustersPerDisk4));
3480
3481 hpixPerDisk1->Fill(float(numOfPixPerDisk1));
3482 hpixPerDisk2->Fill(float(numOfPixPerDisk2));
3483 hpixPerDisk3->Fill(float(numOfPixPerDisk3));
3484 hpixPerDisk4->Fill(float(numOfPixPerDisk4));
3485
3486 hmaxPixPerDet->Fill(float(maxPixPerDet));
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536 #ifdef SEB
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574 #endif
3575
3576 #ifdef L1
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640 if (L1GTRR.isValid()) {
3641
3642
3643 for (unsigned int i = 0; i < L1GTRR->decisionWord().size(); ++i) {
3644 int l1flag = L1GTRR->decisionWord()[i];
3645 int t1flag = L1GTRR->technicalTriggerWord()[i];
3646 if (l1flag > 0)
3647 hl1a1->Fill(float(i));
3648 if (t1flag > 0 && i < 64)
3649 hl1t1->Fill(float(i));
3650 }
3651 }
3652
3653
3654 for (unsigned int i = 0; i < 256; i++)
3655 if (hlt[i])
3656 hlt3->Fill(float(i));
3657
3658 #endif
3659
3660 }
3661
3662 #endif
3663
3664 }
3665
3666
3667 DEFINE_FWK_MODULE(TestClusters);