tracking_eff.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4. #include <TSystem.h>
  5. #include "filval.hpp"
  6. #include "root_filval.hpp"
  7. #include "analysis/TrackingNtupleObjs.hpp"
  8. SeedCollection seeds;
  9. SimTrackCollection sim_tracks;
  10. SimVertexCollection sim_vertices;
  11. TrackCollection gsf_tracks;
  12. void register_objects(TrackingDataSet& tds){
  13. seeds.init(tds);
  14. sim_tracks.init(tds);
  15. sim_vertices.init(tds);
  16. gsf_tracks.init(tds);
  17. }
  18. struct {
  19. Value<float>* x;
  20. Value<float>* y;
  21. Value<float>* z;
  22. Value<float>* sigma_x;
  23. Value<float>* sigma_y;
  24. Value<float>* sigma_z;
  25. } bs;
  26. template <typename T>
  27. struct KinColl {
  28. T* pt;
  29. T* eta;
  30. T* phi;
  31. };
  32. bool in_lum_region(const SimVertex& vertex) {
  33. /* Here approximate the luminous region as a cylinder with length 5*\sigma_z and radius
  34. * sqrt(\simga_x^2 + \sigma_y^2) centered as beamspot position.
  35. */
  36. float dx = vertex.x() - bs.x->get();
  37. float dy = vertex.y() - bs.y->get();
  38. float dz = vertex.z() - bs.z->get();
  39. auto radius = static_cast<float>(5 * sqrt(pow(bs.sigma_x->get(), 2) + pow(bs.sigma_y->get(), 2)));
  40. float half_len = 5*bs.sigma_z->get();
  41. return sqrt(dx*dx + dy*dy) < radius and abs(dz) < half_len;
  42. };
  43. bool is_good_sim(const SimTrack& sim_track) {
  44. const auto& vertex = sim_vertices[sim_track.parentVtxIdx()];
  45. return abs(sim_track.pdgId()) == 11 and in_lum_region(vertex);
  46. };
  47. bool is_good_fake(const SimTrack& sim_track) {
  48. const auto& vertex = sim_vertices[sim_track.parentVtxIdx()];
  49. return abs(sim_track.pdgId()) != 11 and sim_track.q() != 0 and in_lum_region(vertex);
  50. };
  51. bool is_good_seed(const Seed& seed, float hoe_cut) {
  52. return seed.isECALDriven() and seed.hoe() < hoe_cut;
  53. }
  54. float reco_energy_rel_err(const SimTrack& sim_track, const Seed& seed) {
  55. return (sim_track.pt() - seed.Et()) / sim_track.pt() ;
  56. }
  57. float reco_energy_rel_err(const SimTrack& sim_track, const Track& track) {
  58. return (sim_track.pt() - track.pt()) / sim_track.pt() ;
  59. }
  60. template<typename TrackOrSeed>
  61. bool reco_energy_consistent(const SimTrack& sim_track, const TrackOrSeed& track, float consistency_cut=0.1) {
  62. return fabs(reco_energy_rel_err(sim_track, track)) < consistency_cut;
  63. }
  64. double deltaR(const SimTrack& sim_track, const Track& gsf_track) {
  65. return sqrt(pow(sim_track.eta() - gsf_track.eta(), 2.0) +
  66. pow(sim_track.phi() - gsf_track.phi(), 2.0));
  67. }
  68. void run(bool silent){
  69. using namespace std;
  70. using namespace fv;
  71. using namespace fv_root;
  72. auto file_list = the_config->get_source_files();
  73. string output_filename = the_config->get_output_filename();
  74. TrackingDataSet tds(output_filename, file_list, "trackingNtuple/tree");
  75. register_objects(tds);
  76. auto hoe_cut = the_config->get("hoe_cut").as<float>(999);
  77. bs = {
  78. tds.track_branch<float>("bsp_x"),
  79. tds.track_branch<float>("bsp_y"),
  80. tds.track_branch<float>("bsp_z"),
  81. tds.track_branch<float>("bsp_sigmax"),
  82. tds.track_branch<float>("bsp_sigmay"),
  83. tds.track_branch<float>("bsp_sigmaz")
  84. };
  85. enum TMType {
  86. NoMatch = 0,
  87. SeedMatched = 1,
  88. TrackMatched = 2,
  89. SeedAndTrackMatched = 3,
  90. };
  91. std::map<std::tuple<int, int>, ContainerTH2<float>*> residuals_dRz;
  92. std::map<std::tuple<int, int>, ContainerTH2<float>*> residuals_dPhi;
  93. std::map<std::tuple<int, int, int>, ContainerTH2<float>*> BPIX_residuals_dRz;
  94. std::map<std::tuple<int, int, int>, ContainerTH2<float>*> BPIX_residuals_dPhi;
  95. std::map<std::tuple<int, int, int>, ContainerTH2<float>*> FPIX_residuals_dRz;
  96. std::map<std::tuple<int, int, int>, ContainerTH2<float>*> FPIX_residuals_dPhi;
  97. stringstream name;
  98. auto set_name = [&name](const std::string& var, const std::string& region,
  99. const int& layer, const int& hit, const int& tm_type) {
  100. name.str("");
  101. name << var << "_" << region;
  102. if (layer)
  103. name << "_L" << layer;
  104. name << "_H" << hit << "_v_Et";
  105. switch (tm_type) {
  106. case NoMatch:
  107. name << "_NoMatch";
  108. break;
  109. case SeedMatched:
  110. name << "_SeedMatched";
  111. break;
  112. case TrackMatched:
  113. name << "_TrackMatched";
  114. break;
  115. case SeedAndTrackMatched:
  116. name << "_SeedAndTrackMatched";
  117. break;
  118. default:
  119. break;
  120. }
  121. };
  122. THParams hist_params;
  123. for (int hit=1; hit<=3; hit++) {
  124. for (int tm_type = NoMatch; tm_type <= SeedAndTrackMatched; tm_type++) {
  125. for (int layer=1; layer<=4; layer++) {
  126. hist_params = (hit == 1) ? THParams::lookup("dRz_v_Et") : THParams::lookup("dRz_v_Et_outer_hits");
  127. set_name("dRz", "BPIX", layer, hit, tm_type);
  128. BPIX_residuals_dRz[make_tuple(layer, hit, tm_type)] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  129. set_name("dRz", "FPIX", layer, hit, tm_type);
  130. FPIX_residuals_dRz[make_tuple(layer, hit, tm_type)] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  131. hist_params = (hit == 1) ? THParams::lookup("dPhi_v_Et") : THParams::lookup("dPhi_v_Et_outer_hits");
  132. set_name("dPhi", "BPIX", layer, hit, tm_type);
  133. BPIX_residuals_dPhi[make_tuple(layer, hit, tm_type)] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  134. set_name("dPhi", "FPIX", layer, hit, tm_type);
  135. FPIX_residuals_dPhi[make_tuple(layer, hit, tm_type)] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  136. }
  137. hist_params = (hit == 1) ? THParams::lookup("dRz_v_Et") : THParams::lookup("dRz_v_Et_outer_hits");
  138. set_name("dRz", "ALL", 0, hit, tm_type);
  139. residuals_dRz[std::make_tuple(hit, tm_type)] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  140. hist_params = (hit == 1) ? THParams::lookup("dPhi_v_Et") : THParams::lookup("dPhi_v_Et_outer_hits");
  141. set_name("dPhi", "ALL", 0, hit, tm_type);
  142. residuals_dPhi[make_tuple(hit, tm_type)] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  143. }
  144. }
  145. std::map<int,vector<float>> eta_regions = {{1, {0.0, 1.1, 1.8, 3.0}},
  146. {2, {0.0, 1.4, 2.3, 3.0}},
  147. {3, {0.0, 1.0, 2.0, 3.0}}};
  148. auto get_region = [&eta_regions](int hit, float eta) {
  149. auto regions = eta_regions[hit];
  150. if (regions.size() <= 1) return 1;
  151. float abseta = abs(eta);
  152. for (int r_idx=1; r_idx < regions.size(); r_idx++) {
  153. if (abseta > regions[r_idx-1] and abseta < regions[r_idx]) {
  154. return r_idx;
  155. }
  156. }
  157. return static_cast<int>(regions.size());
  158. };
  159. std::map<int, ContainerTH2<float>*> dPhi_residuals_v_eta;
  160. std::map<int, ContainerTH2<float>*> dRz_residuals_v_eta;
  161. std::map<std::pair<int, int>, ContainerTH2<float>*> dPhi_residuals_v_region;
  162. std::map<std::pair<int, int>, ContainerTH2<float>*> dRz_residuals_v_region;
  163. for (int hit=1; hit<=3; hit++) {
  164. name.str("");
  165. name << "dPhi_residuals_v_eta_H" << hit;
  166. hist_params = (hit==1) ? THParams::lookup("dPhi_v_eta") : THParams::lookup("dPhi_v_eta_outer_hits");
  167. dPhi_residuals_v_eta[hit] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  168. name.str("");
  169. name << "dRz_residuals_v_eta_H" << hit;
  170. hist_params = (hit==1) ? THParams::lookup("dRz_v_eta") : THParams::lookup("dRz_v_eta_outer_hits");
  171. dRz_residuals_v_eta[hit] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  172. for (int region=1; region<=eta_regions[hit].size()-1; region++){
  173. hist_params = (hit==1) ? THParams::lookup("dRz_v_Et") : THParams::lookup("dRz_v_Et_outer_hits");
  174. name.str("");
  175. name << "dRz_residuals_H" << hit << "_R" << region;
  176. dRz_residuals_v_region[{hit, region}] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  177. hist_params = (hit==1) ? THParams::lookup("dPhi_v_Et") : THParams::lookup("dPhi_v_Et_outer_hits");
  178. name.str("");
  179. name << "dPhi_residuals_H" << hit << "_R" << region;
  180. dPhi_residuals_v_region[{hit, region}] = tds.register_container<ContainerTH2<float>>(name.str(), hist_params);
  181. }
  182. }
  183. KinColl<EfficiencyContainer<float>> seed_eff = {
  184. tds.register_container<EfficiencyContainer<float>>("seed_eff_v_pt", THParams::lookup("eff_v_pt")),
  185. tds.register_container<EfficiencyContainer<float>>("seed_eff_v_eta", THParams::lookup("eff_v_eta")),
  186. tds.register_container<EfficiencyContainer<float>>("seed_eff_v_phi", THParams::lookup("eff_v_phi"))};
  187. KinColl<EfficiencyContainer<float>> seed_pur = {
  188. tds.register_container<EfficiencyContainer<float>>("seed_pur_v_pt", THParams::lookup("pur_v_pt")),
  189. tds.register_container<EfficiencyContainer<float>>("seed_pur_v_eta", THParams::lookup("pur_v_eta")),
  190. tds.register_container<EfficiencyContainer<float>>("seed_pur_v_phi", THParams::lookup("pur_v_phi"))};
  191. KinColl<EfficiencyContainer<float>> tracking_eff = {
  192. tds.register_container<EfficiencyContainer<float>>("tracking_eff_v_pt", THParams::lookup("eff_v_pt")),
  193. tds.register_container<EfficiencyContainer<float>>("tracking_eff_v_eta", THParams::lookup("eff_v_eta")),
  194. tds.register_container<EfficiencyContainer<float>>("tracking_eff_v_phi", THParams::lookup("eff_v_phi"))};
  195. KinColl<EfficiencyContainer<float>> tracking_pur = {
  196. tds.register_container<EfficiencyContainer<float>>("tracking_pur_v_pt", THParams::lookup("pur_v_pt")),
  197. tds.register_container<EfficiencyContainer<float>>("tracking_pur_v_eta", THParams::lookup("pur_v_eta")),
  198. tds.register_container<EfficiencyContainer<float>>("tracking_pur_v_phi", THParams::lookup("pur_v_phi"))};
  199. KinColl<EfficiencyContainer<float>> tracking_eff_dR = {
  200. tds.register_container<EfficiencyContainer<float>>("tracking_eff_v_pt_dR", THParams::lookup("eff_v_pt")),
  201. tds.register_container<EfficiencyContainer<float>>("tracking_eff_v_eta_dR", THParams::lookup("eff_v_eta")),
  202. tds.register_container<EfficiencyContainer<float>>("tracking_eff_v_phi_dR", THParams::lookup("eff_v_phi"))};
  203. KinColl<EfficiencyContainer<float>> tracking_pur_dR = {
  204. tds.register_container<EfficiencyContainer<float>>("tracking_pur_v_pt_dR", THParams::lookup("pur_v_pt")),
  205. tds.register_container<EfficiencyContainer<float>>("tracking_pur_v_eta_dR", THParams::lookup("pur_v_eta")),
  206. tds.register_container<EfficiencyContainer<float>>("tracking_pur_v_phi_dR", THParams::lookup("pur_v_phi"))};
  207. auto& hit_vs_layer_barrel = *tds.register_container<ContainerTH2<int>>("hit_vs_layer_barrel", THParams::lookup("hit_vs_layer"));
  208. auto& hit_vs_layer_forward = *tds.register_container<ContainerTH2<int>>("hit_vs_layer_forward", THParams::lookup("hit_vs_layer"));
  209. auto& gsf_tracks_nmatch_sim_tracks = *tds.register_container<ContainerTH1<size_t>>("gsf_tracks_nmatch_sim_tracks ", THParams::lookup("gsf_tracks_nmatch_sim_tracks"));
  210. auto& ecal_energy_resolution = *tds.register_container<ContainerTH1<float>>("ecal_energy_resolution ", THParams::lookup("ecal_energy_resolution"));
  211. auto& n_seeds = *tds.register_container<ContainerTH1<size_t>>("n_seeds", THParams::lookup("n_seeds"));
  212. while (tds.next(!silent)) {
  213. for (const auto& sim_track : sim_tracks) {
  214. if (!is_good_sim(sim_track)) continue;
  215. if (seeds.size() == 0) continue;
  216. for (const auto &seed_idx : sim_track.seedIdx()) {
  217. const Seed& seed = seeds[seed_idx];
  218. if (!is_good_seed(seed, hoe_cut)) continue;
  219. ecal_energy_resolution.fill(reco_energy_rel_err(sim_track, seed));
  220. }
  221. }
  222. // Seeding Efficiency
  223. for (const auto& sim_track : sim_tracks) {
  224. if (!is_good_sim(sim_track)) continue;
  225. if (seeds.size() == 0) continue;
  226. bool matched = false;
  227. for (const auto& seed_idx : sim_track.seedIdx()) {
  228. const Seed& seed = seeds[seed_idx];
  229. if (is_good_seed(seed, hoe_cut)) {
  230. matched=true;
  231. break;
  232. }
  233. }
  234. if (abs(sim_track.eta()) < 2.4)
  235. seed_eff.pt->fill(sim_track.pt(), matched);
  236. if (sim_track.pt() > 20.0)
  237. seed_eff.eta->fill(sim_track.eta(), matched);
  238. if (abs(sim_track.eta()) < 2.4 and sim_track.pt() > 20)
  239. seed_eff.phi->fill(sim_track.phi(), matched);
  240. }
  241. // Tracking Efficiency
  242. for (const auto& sim_track : sim_tracks) {
  243. if (!is_good_sim(sim_track)) continue;
  244. if (gsf_tracks.size() == 0) continue;
  245. bool matched = false;
  246. for (const auto& track_idx : sim_track.trkIdx()) {
  247. const Seed& seed = seeds[gsf_tracks[track_idx].seedIdx()];
  248. if (is_good_seed(seed, hoe_cut)) {
  249. matched=true;
  250. break;
  251. }
  252. }
  253. if (abs(sim_track.eta()) < 2.4)
  254. tracking_eff.pt->fill(sim_track.pt(), matched);
  255. if (sim_track.pt() > 20.0)
  256. tracking_eff.eta->fill(sim_track.eta(), matched);
  257. if (abs(sim_track.eta()) < 2.4 and sim_track.pt() > 20)
  258. tracking_eff.phi->fill(sim_track.phi(), matched);
  259. // dR-matching
  260. matched = false;
  261. for (const auto& gsf_track : gsf_tracks) {
  262. const Seed& seed = seeds[gsf_track.seedIdx()];
  263. double dR = deltaR(sim_track, gsf_track);
  264. if (is_good_seed(seed, hoe_cut) and dR < 0.2) {
  265. matched = true;
  266. break;
  267. }
  268. }
  269. if (abs(sim_track.eta()) < 2.4)
  270. tracking_eff_dR.pt->fill(sim_track.pt(), matched);
  271. if (sim_track.pt() > 20.0)
  272. tracking_eff_dR.eta->fill(sim_track.eta(), matched);
  273. if (abs(sim_track.eta()) < 2.4 and sim_track.pt() > 20)
  274. tracking_eff_dR.phi->fill(sim_track.phi(), matched);
  275. }
  276. // Seeding Purity
  277. for (const auto& seed : seeds) {
  278. if (!is_good_seed(seed, hoe_cut)) continue;
  279. bool match = false;
  280. for (const auto& sim_track_idx : seed.simTrkIdx()) {
  281. if(is_good_sim(sim_tracks[sim_track_idx])) {
  282. match = true;
  283. break;
  284. }
  285. }
  286. if (abs(seed.eta()) < 2.4)
  287. seed_pur.pt->fill(seed.pt(), match);
  288. if (seed.pt() > 20)
  289. seed_pur.eta->fill(seed.eta(), match);
  290. if (abs(seed.eta()) < 2.4 and seed.pt() > 20)
  291. seed_pur.phi->fill(seed.phi(), match);
  292. }
  293. // Tracking Purity
  294. for (const auto& gsf_track : gsf_tracks) {
  295. gsf_tracks_nmatch_sim_tracks.fill(gsf_track.simTrkIdx().size());
  296. const Seed& seed = seeds[gsf_track.seedIdx()];
  297. if (!is_good_seed(seed, hoe_cut)) continue;
  298. bool matched = false;
  299. for (const auto& sim_track_idx : gsf_track.simTrkIdx()) {
  300. if (is_good_sim(sim_tracks[sim_track_idx])) {
  301. matched = true;
  302. break;
  303. }
  304. }
  305. if (abs(gsf_track.eta()) < 2.4)
  306. tracking_pur.pt->fill(gsf_track.pt(), matched);
  307. if (gsf_track.pt() > 20)
  308. tracking_pur.eta->fill(gsf_track.eta(), matched);
  309. if (abs(gsf_track.eta()) < 2.4 and gsf_track.pt() > 20)
  310. tracking_pur.phi->fill(gsf_track.phi(), matched);
  311. // dR-matching
  312. matched = false;
  313. for (const auto& sim_track : sim_tracks) {
  314. double dR = deltaR(sim_track, gsf_track);
  315. if (is_good_sim(sim_track) and dR < 0.2) {
  316. matched = true;
  317. break;
  318. }
  319. }
  320. if (abs(gsf_track.eta()) < 2.4)
  321. tracking_pur_dR.pt->fill(gsf_track.pt(), matched);
  322. if (gsf_track.pt() > 20.0)
  323. tracking_pur_dR.eta->fill(gsf_track.eta(), matched);
  324. if (abs(gsf_track.eta()) < 2.4 and gsf_track.pt() > 20)
  325. tracking_pur_dR.phi->fill(gsf_track.phi(), matched);
  326. }
  327. // Hit Residuals
  328. for (const auto& seed : seeds) {
  329. if (seed.trkIdx() < 0) continue; // require that seed produced gsf-track
  330. if (!is_good_seed(seed, hoe_cut)) continue;
  331. bool is_seed_sim_matched = false;
  332. for (const auto& sim_track_idx : seed.simTrkIdx()) {
  333. const SimTrack& sim_track = sim_tracks[sim_track_idx];
  334. if (is_good_sim(sim_track) and reco_energy_consistent(sim_track, seed)) {
  335. is_seed_sim_matched = true;
  336. break;
  337. }
  338. }
  339. bool is_track_sim_matched = false;
  340. const auto the_track = gsf_tracks[seed.trkIdx()];
  341. for (const auto& sim_track_idx : the_track.simTrkIdx()) {
  342. const SimTrack& sim_track = sim_tracks[sim_track_idx];
  343. if (is_good_sim(sim_track) and reco_energy_consistent(sim_track, the_track)) {
  344. is_track_sim_matched = true;
  345. break;
  346. }
  347. }
  348. std::vector<TMType> tm_types;
  349. if (is_seed_sim_matched and is_track_sim_matched) {
  350. tm_types = {SeedAndTrackMatched, SeedMatched, TrackMatched};
  351. } else if (is_seed_sim_matched) {
  352. tm_types = {SeedMatched};
  353. } else if (is_track_sim_matched) {
  354. tm_types = {TrackMatched};
  355. } else {
  356. tm_types = {NoMatch};
  357. }
  358. vector<int> hits_valid;
  359. vector<float> hits_dRz;
  360. vector<float> hits_dPhi;
  361. if (the_track.q() == 1) {
  362. hits_valid = seed.isValidPos();
  363. hits_dRz = seed.dRZPos();
  364. hits_dPhi = seed.dPhiPos();
  365. } else {
  366. hits_valid = seed.isValidNeg();
  367. hits_dRz = seed.dRZNeg();
  368. hits_dPhi = seed.dPhiNeg();
  369. }
  370. const vector<int>& hits_isBarrel = seed.isBarrel();
  371. const vector<int>& hits_layerOrDiskNr = seed.layerOrDiskNr();
  372. for (const auto& tm_type : tm_types) {
  373. size_t nHits = hits_valid.size();
  374. for (size_t hit_idx = 0; hit_idx < nHits; hit_idx++) {
  375. if (!hits_valid[hit_idx]) continue;
  376. bool isBarrel = hits_isBarrel[hit_idx] == 1;
  377. int layerOrDiskNr = hits_layerOrDiskNr[hit_idx];
  378. float dRz = abs(hits_dRz[hit_idx]);
  379. float dPhi = abs(hits_dPhi[hit_idx]);
  380. int eta_region = get_region(static_cast<int>(hit_idx + 1), seed.eta());
  381. if (is_seed_sim_matched) {
  382. dRz_residuals_v_eta[hit_idx + 1]->fill(dRz, abs(seed.eta()));
  383. dPhi_residuals_v_eta[hit_idx + 1]->fill(dPhi, abs(seed.eta()));
  384. dRz_residuals_v_region[make_pair(hit_idx + 1, eta_region)]->fill(dRz, seed.Et());
  385. dPhi_residuals_v_region[make_pair(hit_idx + 1, eta_region)]->fill(dPhi, seed.Et());
  386. }
  387. residuals_dRz[make_tuple(hit_idx + 1, tm_type)]->fill(dRz, seed.Et());
  388. residuals_dPhi[make_tuple(hit_idx + 1, tm_type)]->fill(dPhi, seed.Et());
  389. if (layerOrDiskNr == -1) continue; // subDet is not set w/ old seeding
  390. if (isBarrel)
  391. hit_vs_layer_barrel.fill(layerOrDiskNr, static_cast<const int &>(hit_idx + 1));
  392. else
  393. hit_vs_layer_forward.fill(layerOrDiskNr, static_cast<const int &>(hit_idx + 1));
  394. if (isBarrel) {
  395. BPIX_residuals_dRz[make_tuple(layerOrDiskNr, hit_idx + 1, tm_type)]->fill(dRz, seed.Et());
  396. BPIX_residuals_dPhi[make_tuple(layerOrDiskNr, hit_idx + 1, tm_type)]->fill(dPhi, seed.Et());
  397. } else {
  398. FPIX_residuals_dRz[make_tuple(layerOrDiskNr, hit_idx + 1, tm_type)]->fill(dRz, seed.Et());
  399. FPIX_residuals_dPhi[make_tuple(layerOrDiskNr, hit_idx + 1, tm_type)]->fill(dPhi, seed.Et());
  400. }
  401. }
  402. }
  403. }
  404. n_seeds.fill(seeds.size());
  405. }
  406. tds.save_all();
  407. }
  408. int main(int argc, char * argv[]){
  409. using namespace fv_util;
  410. ArgParser args(argc, argv);
  411. bool silent = args.cmd_option_exists("-s");
  412. if(args.cmd_option_exists("-c")) {
  413. init_config(args.get_cmd_option("-c"));
  414. args.update_config();
  415. init_log(LogPriority::kLogInfo);
  416. // gSystem->Load("libfilval.so");
  417. run(silent);
  418. } else {
  419. cout << "Usage: ./" << argv[0] << " (-s) -c config_file.yaml" << endl;
  420. }
  421. return 0;
  422. }