Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:17

0001 #include "Validation/Geometry/interface/MaterialBudgetTrackerHistos.h"
0002 #include "Validation/Geometry/interface/MaterialBudgetData.h"
0003 
0004 template <class T>
0005 const T& max(const T& a, const T& b) {
0006   return (b < a) ? a : b;  // or: return comp(b,a)?a:b; for the comp version
0007 }
0008 
0009 MaterialBudgetTrackerHistos::MaterialBudgetTrackerHistos(std::shared_ptr<MaterialBudgetData> data,
0010                                                          std::shared_ptr<TestHistoMgr> mgr,
0011                                                          const std::string& fileName)
0012     : MaterialBudgetFormat(data), hmgr(mgr) {
0013   theFileName = fileName;
0014   book();
0015 }
0016 
0017 void MaterialBudgetTrackerHistos::book() {
0018   edm::LogInfo("MaterialBudget") << " MaterialBudgetTrackerHistos: Booking Histos";
0019 
0020   // Parameters for 2D histograms
0021   int nzbin = 1200;
0022   float zMax = 3000.;
0023   float zMin = -3000.;
0024   int nrbin = 290;
0025   float rMin = -50.;
0026   float rMax = 1400.;
0027 
0028   // total X0
0029   hmgr->addHistoProf1(new TProfile("10", "MB prof Eta [Total];#eta;x/X_{0} ", 250, -5., 5.));
0030   hmgr->addHisto1(new TH1F("11", "Eta ", 501, -5., 5.));
0031   hmgr->addHistoProf1(new TProfile("20", "MB prof Phi [Total];#varphi [rad];x/X_{0} ", 180, -3.1416, 3.1416));
0032   hmgr->addHisto1(new TH1F("21", "Phi ", 180, -3.1416, 3.1416));
0033   hmgr->addHistoProf2(
0034       new TProfile2D("30", "MB prof Eta  Phi [Total];#eta;#varphi;x/X_{0} ", 250, -5., 5., 180, -3.1416, 3.1416));
0035   hmgr->addHisto2(new TH2F("31", "Eta vs Phi ", 501, -5., 5., 180, -3.1416, 3.1416));
0036   hmgr->addHistoProf1(new TProfile("40", "MB prof R [Total];R [mm];x/X_{0} ", 200, 0., 2000.));
0037   hmgr->addHisto1(new TH1F("41", "R ", 200, 0., 2000.));
0038   hmgr->addHistoProf2(
0039       new TProfile2D("50", "MB prof sum R  z [Total];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0040   hmgr->addHisto2(new TH2F("999", "Tot track length for MB", nzbin, zMin, zMax, nrbin, rMin, rMax));
0041   hmgr->addHisto2(new TH2F("51", "R vs z ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0042   hmgr->addHisto2(new TH2F("60", "MB prof local R  z;z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0043   hmgr->addHisto2(new TH2F("61", "R vs z ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0044 
0045   // Support
0046   hmgr->addHistoProf1(new TProfile("110", "MB prof Eta [Support];#eta;x/X_{0}", 250, -5.0, 5.0));
0047   hmgr->addHisto1(new TH1F("111", "Eta [Support]", 501, -5., 5.));
0048   hmgr->addHistoProf1(new TProfile("120", "MB prof Phi [Support];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416));
0049   hmgr->addHisto1(new TH1F("121", "Phi [Support]", 180, -3.1416, 3.1416));
0050   hmgr->addHistoProf2(
0051       new TProfile2D("130", "MB prof Eta  Phi [Support];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0052   hmgr->addHisto2(new TH2F("131", "Eta vs Phi [Support]", 501, -5., 5., 180, -3.1416, 3.1416));
0053   hmgr->addHistoProf1(new TProfile("140", "MB prof R [Support];R [mm];x/X_{0}", 200, 0., 2000.));
0054   hmgr->addHisto1(new TH1F("141", "R [Support]", 200, 0., 2000.));
0055   hmgr->addHistoProf2(
0056       new TProfile2D("150", "MB prof sum R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0057   hmgr->addHisto2(new TH2F("151", "R vs z [Support]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0058   hmgr->addHisto2(
0059       new TH2F("160", "MB prof local R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0060   hmgr->addHisto2(new TH2F("161", "R vs z [Support]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0061 
0062   // Sensitive
0063   hmgr->addHistoProf1(new TProfile("210", "MB prof Eta [Sensitive];#eta;x/X_{0}", 250, -5.0, 5.0));
0064   hmgr->addHisto1(new TH1F("211", "Eta [Sensitive]", 501, -5., 5.));
0065   hmgr->addHistoProf1(new TProfile("220", "MB prof Phi [Sensitive];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416));
0066   hmgr->addHisto1(new TH1F("221", "Phi [Sensitive]", 180, -3.1416, 3.1416));
0067   hmgr->addHistoProf2(
0068       new TProfile2D("230", "MB prof Eta  Phi [Sensitive];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0069   hmgr->addHisto2(new TH2F("231", "Eta vs Phi [Sensitive]", 501, -5., 5., 180, -3.1416, 3.1416));
0070   hmgr->addHistoProf1(new TProfile("240", "MB prof R [Sensitive];R [mm];x/X_{0}", 200, 0., 2000.));
0071   hmgr->addHisto1(new TH1F("241", "R [Sensitive]", 200, 0., 2000.));
0072   hmgr->addHistoProf2(new TProfile2D(
0073       "250", "MB prof sum R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0074   hmgr->addHisto2(new TH2F("251", "R vs z [Sensitive]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0075   hmgr->addHisto2(
0076       new TH2F("260", "MB prof local R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0077   hmgr->addHisto2(new TH2F("261", "R vs z [Sensitive]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0078   // Cables
0079   hmgr->addHistoProf1(new TProfile("310", "MB prof Eta [Cables];#eta;x/X_{0}", 250, -5.0, 5.0));
0080   hmgr->addHisto1(new TH1F("311", "Eta [Cables]", 501, -5., 5.));
0081   hmgr->addHistoProf1(new TProfile("320", "MB prof Phi [Cables];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416));
0082   hmgr->addHisto1(new TH1F("321", "Phi [Cables]", 180, -3.1416, 3.1416));
0083   hmgr->addHistoProf2(
0084       new TProfile2D("330", "MB prof Eta  Phi [Cables];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0085   hmgr->addHisto2(new TH2F("331", "Eta vs Phi [Cables]", 501, -5., 5., 180, -3.1416, 3.1416));
0086   hmgr->addHistoProf1(new TProfile("340", "MB prof R [Cables];R [mm];x/X_{0}", 200, 0., 2000.));
0087   hmgr->addHisto1(new TH1F("341", "R [Cables]", 200, 0., 2000.));
0088   hmgr->addHistoProf2(
0089       new TProfile2D("350", "MB prof sum R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0090   hmgr->addHisto2(new TH2F("351", "R vs z [Cables]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0091   hmgr->addHisto2(
0092       new TH2F("360", "MB prof local R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0093   hmgr->addHisto2(new TH2F("361", "R vs z [Cables]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0094   // Cooling
0095   hmgr->addHistoProf1(new TProfile("410", "MB prof Eta [Cooling];#eta;x/X_{0}", 250, -5.0, 5.0));
0096   hmgr->addHisto1(new TH1F("411", "Eta [Cooling]", 501, -5., 5.));
0097   hmgr->addHistoProf1(new TProfile("420", "MB prof Phi [Cooling];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416));
0098   hmgr->addHisto1(new TH1F("421", "Phi [Cooling]", 180, -3.1416, 3.1416));
0099   hmgr->addHistoProf2(
0100       new TProfile2D("430", "MB prof Eta  Phi [Cooling];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0101   hmgr->addHisto2(new TH2F("431", "Eta vs Phi [Cooling]", 501, -5., 5., 180, -3.1416, 3.1416));
0102   hmgr->addHistoProf1(new TProfile("440", "MB prof R [Cooling];R [mm];x/X_{0}", 200, 0., 2000.));
0103   hmgr->addHisto1(new TH1F("441", "R [Cooling]", 200, 0., 2000.));
0104   hmgr->addHistoProf2(
0105       new TProfile2D("450", "MB prof sum R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0106   hmgr->addHisto2(new TH2F("451", "R vs z [Cooling]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0107   hmgr->addHisto2(
0108       new TH2F("460", "MB prof local R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0109   hmgr->addHisto2(new TH2F("461", "R vs z [Cooling]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0110   // Electronics
0111   hmgr->addHistoProf1(new TProfile("510", "MB prof Eta [Electronics];#eta;x/X_{0}", 250, -5.0, 5.0));
0112   hmgr->addHisto1(new TH1F("511", "Eta [Electronics]", 501, -5., 5.));
0113   hmgr->addHistoProf1(new TProfile("520", "MB prof Phi [Electronics];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416));
0114   hmgr->addHisto1(new TH1F("521", "Phi [Electronics]", 180, -3.1416, 3.1416));
0115   hmgr->addHistoProf2(
0116       new TProfile2D("530", "MB prof Eta  Phi [Electronics];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0117   hmgr->addHisto2(new TH2F("531", "Eta vs Phi [Electronics]", 501, -5., 5., 180, -3.1416, 3.1416));
0118   hmgr->addHistoProf1(new TProfile("540", "MB prof R [Electronics];R [mm];x/X_{0}", 200, 0., 2000.));
0119   hmgr->addHisto1(new TH1F("541", "R [Electronics]", 200, 0., 2000.));
0120   hmgr->addHistoProf2(new TProfile2D(
0121       "550", "MB prof sum R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0122   hmgr->addHisto2(new TH2F("551", "R vs z [Electronics]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0123   hmgr->addHisto2(
0124       new TH2F("560", "MB prof local R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0125   hmgr->addHisto2(new TH2F("561", "R vs z [Electronics]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0126   // Other
0127   hmgr->addHistoProf1(new TProfile("610", "MB prof Eta [Other];#eta;x/X_{0}", 250, -5.0, 5.0));
0128   hmgr->addHisto1(new TH1F("611", "Eta [Other]", 501, -5., 5.));
0129   hmgr->addHistoProf1(new TProfile("620", "MB prof Phi [Other];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416));
0130   hmgr->addHisto1(new TH1F("621", "Phi [Other]", 180, -3.1416, 3.1416));
0131   hmgr->addHistoProf2(
0132       new TProfile2D("630", "MB prof Eta  Phi [Other];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0133   hmgr->addHisto2(new TH2F("631", "Eta vs Phi [Other]", 501, -5., 5., 180, -3.1416, 3.1416));
0134   hmgr->addHistoProf1(new TProfile("640", "MB prof R [Other];R [mm];x/X_{0}", 200, 0., 2000.));
0135   hmgr->addHisto1(new TH1F("641", "R [Other]", 200, 0., 2000.));
0136   hmgr->addHistoProf2(
0137       new TProfile2D("650", "MB prof sum R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0138   hmgr->addHisto2(new TH2F("651", "R vs z [Other]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0139   hmgr->addHisto2(
0140       new TH2F("660", "MB prof local R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0141   hmgr->addHisto2(new TH2F("661", "R vs z [Other]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0142   // Air
0143   hmgr->addHistoProf1(new TProfile("710", "MB prof Eta [Air];#eta;x/X_{0}", 250, -5.0, 5.0));
0144   hmgr->addHisto1(new TH1F("711", "Eta [Air]", 501, -5., 5.));
0145   hmgr->addHistoProf1(new TProfile("720", "MB prof Phi [Air];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416));
0146   hmgr->addHisto1(new TH1F("721", "Phi [Air]", 180, -3.1416, 3.1416));
0147   hmgr->addHistoProf2(
0148       new TProfile2D("730", "MB prof Eta  Phi [Air];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0149   hmgr->addHisto2(new TH2F("731", "Eta vs Phi [Air]", 501, -5., 5., 180, -3.1416, 3.1416));
0150   hmgr->addHistoProf1(new TProfile("740", "MB prof R [Air];R [mm];x/X_{0}", 200, 0., 2000.));
0151   hmgr->addHisto1(new TH1F("741", "R [Air]", 200, 0., 2000.));
0152   hmgr->addHistoProf2(
0153       new TProfile2D("750", "MB prof sum R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0154   hmgr->addHisto2(new TH2F("751", "R vs z [Air]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0155   hmgr->addHisto2(
0156       new TH2F("760", "MB prof local R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0157   hmgr->addHisto2(new TH2F("761", "R vs z [Air]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0158   //
0159 
0160   // total Lambda0
0161   hmgr->addHistoProf1(new TProfile("1010", "MB prof Eta [Total];#eta;#lambda/#lambda_{0} ", 250, -5., 5.));
0162   hmgr->addHisto1(new TH1F("1011", "Eta ", 501, -5., 5.));
0163   hmgr->addHistoProf1(
0164       new TProfile("1020", "MB prof Phi [Total];#varphi [rad];#lambda/#lambda_{0} ", 180, -3.1416, 3.1416));
0165   hmgr->addHisto1(new TH1F("1021", "Phi ", 180, -3.1416, 3.1416));
0166   hmgr->addHistoProf2(new TProfile2D(
0167       "1030", "MB prof Eta  Phi [Total];#eta;#varphi;#lambda/#lambda_{0} ", 250, -5., 5., 180, -3.1416, 3.1416));
0168   hmgr->addHisto2(new TH2F("1031", "Eta vs Phi ", 501, -5., 5., 180, -3.1416, 3.1416));
0169 
0170   // rr
0171   hmgr->addHistoProf1(new TProfile("1040", "MB prof R [Total];R [mm];#lambda/#lambda_{0} ", 200, 0., 2000.));
0172   hmgr->addHisto1(new TH1F("1041", "R ", 200, 0., 2000.));
0173   hmgr->addHistoProf2(
0174       new TProfile2D("1050", "MB prof sum R  z [Total];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0175   hmgr->addHisto2(new TH2F("1999", "Tot track length for l0", nzbin, zMin, zMax, nrbin, rMin, rMax));
0176   hmgr->addHisto2(new TH2F("1051", "R vs z ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0177   hmgr->addHisto2(new TH2F("1060", "MB prof local R  z;z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0178   hmgr->addHisto2(new TH2F("1061", "R vs z ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0179 
0180   // Support
0181   hmgr->addHistoProf1(new TProfile("1110", "MB prof Eta [Support];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0));
0182   hmgr->addHisto1(new TH1F("1111", "Eta [Support]", 501, -5., 5.));
0183   hmgr->addHistoProf1(
0184       new TProfile("1120", "MB prof Phi [Support];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416));
0185   hmgr->addHisto1(new TH1F("1121", "Phi [Support]", 180, -3.1416, 3.1416));
0186   hmgr->addHistoProf2(new TProfile2D(
0187       "1130", "MB prof Eta  Phi [Support];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0188   hmgr->addHisto2(new TH2F("1131", "Eta vs Phi [Support]", 501, -5., 5., 180, -3.1416, 3.1416));
0189   hmgr->addHistoProf1(new TProfile("1140", "MB prof R [Support];R [mm];#lambda/#lambda_{0}", 200, 0., 2000.));
0190   hmgr->addHisto1(new TH1F("1141", "R [Support]", 200, 0., 2000.));
0191   hmgr->addHistoProf2(new TProfile2D(
0192       "1150", "MB prof sum R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0193   hmgr->addHisto2(new TH2F("1151", "R vs z [Support]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0194   hmgr->addHisto2(
0195       new TH2F("1160", "MB prof local R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0196   hmgr->addHisto2(new TH2F("1161", "R vs z [Support]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0197   // Sensitive
0198   hmgr->addHistoProf1(new TProfile("1210", "MB prof Eta [Sensitive];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0));
0199   hmgr->addHisto1(new TH1F("1211", "Eta [Sensitive]", 501, -5., 5.));
0200   hmgr->addHistoProf1(
0201       new TProfile("1220", "MB prof Phi [Sensitive];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416));
0202   hmgr->addHisto1(new TH1F("1221", "Phi [Sensitive]", 180, -3.1416, 3.1416));
0203   hmgr->addHistoProf2(new TProfile2D(
0204       "1230", "MB prof Eta  Phi [Sensitive];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0205   hmgr->addHisto2(new TH2F("1231", "Eta vs Phi [Sensitive]", 501, -5., 5., 180, -3.1416, 3.1416));
0206   hmgr->addHistoProf1(new TProfile("1240", "MB prof R [Sensitive];R [mm];#lambda/#lambda_{0}", 200, 0., 2000.));
0207   hmgr->addHisto1(new TH1F("1241", "R [Sensitive]", 200, 0., 2000.));
0208   hmgr->addHistoProf2(new TProfile2D(
0209       "1250", "MB prof sum R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0210   hmgr->addHisto2(new TH2F("1251", "R vs z [Sensitive]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0211   hmgr->addHisto2(
0212       new TH2F("1260", "MB prof local R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0213   hmgr->addHisto2(new TH2F("1261", "R vs z [Sensitive]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0214   // Cables
0215   hmgr->addHistoProf1(new TProfile("1310", "MB prof Eta [Cables];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0));
0216   hmgr->addHisto1(new TH1F("1311", "Eta [Cables]", 501, -5., 5.));
0217   hmgr->addHistoProf1(
0218       new TProfile("1320", "MB prof Phi [Cables];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416));
0219   hmgr->addHisto1(new TH1F("1321", "Phi [Cables]", 180, -3.1416, 3.1416));
0220   hmgr->addHistoProf2(new TProfile2D(
0221       "1330", "MB prof Eta  Phi [Cables];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0222   hmgr->addHisto2(new TH2F("1331", "Eta vs Phi [Cables]", 501, -5., 5., 180, -3.1416, 3.1416));
0223   hmgr->addHistoProf1(new TProfile("1340", "MB prof R [Cables];R [mm];#lambda/#lambda_{0}", 200, 0., 2000.));
0224   hmgr->addHisto1(new TH1F("1341", "R [Cables]", 200, 0., 2000.));
0225   hmgr->addHistoProf2(
0226       new TProfile2D("1350", "MB prof sum R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0227   hmgr->addHisto2(new TH2F("1351", "R vs z [Cables]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0228   hmgr->addHisto2(
0229       new TH2F("1360", "MB prof local R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0230   hmgr->addHisto2(new TH2F("1361", "R vs z [Cables]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0231   // Cooling
0232   hmgr->addHistoProf1(new TProfile("1410", "MB prof Eta [Cooling];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0));
0233   hmgr->addHisto1(new TH1F("1411", "Eta [Cooling]", 501, -5., 5.));
0234   hmgr->addHistoProf1(
0235       new TProfile("1420", "MB prof Phi [Cooling];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416));
0236   hmgr->addHisto1(new TH1F("1421", "Phi [Cooling]", 180, -3.1416, 3.1416));
0237   hmgr->addHistoProf2(new TProfile2D(
0238       "1430", "MB prof Eta  Phi [Cooling];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0239   hmgr->addHisto2(new TH2F("1431", "Eta vs Phi [Cooling]", 501, -5., 5., 180, -3.1416, 3.1416));
0240   hmgr->addHistoProf1(new TProfile("1440", "MB prof R [Cooling];R [mm];#lambda/#lambda_{0}", 200, 0., 2000.));
0241   hmgr->addHisto1(new TH1F("1441", "R [Cooling]", 200, 0., 2000.));
0242   hmgr->addHistoProf2(new TProfile2D(
0243       "1450", "MB prof sum R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0244   hmgr->addHisto2(new TH2F("1451", "R vs z [Cooling]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0245   hmgr->addHisto2(
0246       new TH2F("1460", "MB prof local R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0247   hmgr->addHisto2(new TH2F("1461", "R vs z [Cooling]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0248   // Electronics
0249   hmgr->addHistoProf1(new TProfile("1510", "MB prof Eta [Electronics];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0));
0250   hmgr->addHisto1(new TH1F("1511", "Eta [Electronics]", 501, -5., 5.));
0251   hmgr->addHistoProf1(
0252       new TProfile("1520", "MB prof Phi [Electronics];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416));
0253   hmgr->addHisto1(new TH1F("1521", "Phi [Electronics]", 180, -3.1416, 3.1416));
0254   hmgr->addHistoProf2(new TProfile2D(
0255       "1530", "MB prof Eta  Phi [Electronics];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0256   hmgr->addHisto2(new TH2F("1531", "Eta vs Phi [Electronics]", 501, -5., 5., 180, -3.1416, 3.1416));
0257   hmgr->addHistoProf1(new TProfile("1540", "MB prof R [Electronics];R [mm];#lambda/#lambda_{0}", 200, 0., 2000.));
0258   hmgr->addHisto1(new TH1F("1541", "R [Electronics]", 200, 0., 2000.));
0259   hmgr->addHistoProf2(new TProfile2D(
0260       "1550", "MB prof sum R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0261   hmgr->addHisto2(new TH2F("1551", "R vs z [Electronics]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0262   hmgr->addHisto2(new TH2F(
0263       "1560", "MB prof local R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0264   hmgr->addHisto2(new TH2F("1561", "R vs z [Electronics]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0265   // Other
0266   hmgr->addHistoProf1(new TProfile("1610", "MB prof Eta [Other];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0));
0267   hmgr->addHisto1(new TH1F("1611", "Eta [Other]", 501, -5., 5.));
0268   hmgr->addHistoProf1(
0269       new TProfile("1620", "MB prof Phi [Other];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416));
0270   hmgr->addHisto1(new TH1F("1621", "Phi [Other]", 180, -3.1416, 3.1416));
0271   hmgr->addHistoProf2(new TProfile2D(
0272       "1630", "MB prof Eta  Phi [Other];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0273   hmgr->addHisto2(new TH2F("1631", "Eta vs Phi [Other]", 501, -5., 5., 180, -3.1416, 3.1416));
0274   hmgr->addHistoProf1(new TProfile("1640", "MB prof R [Other];R [mm];#lambda/#lambda_{0}", 200, 0., 2000.));
0275   hmgr->addHisto1(new TH1F("1641", "R [Other]", 200, 0., 2000.));
0276   hmgr->addHistoProf2(
0277       new TProfile2D("1650", "MB prof sum R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0278   hmgr->addHisto2(new TH2F("1651", "R vs z [Other]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0279   hmgr->addHisto2(
0280       new TH2F("1660", "MB prof local R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0281   hmgr->addHisto2(new TH2F("1661", "R vs z [Other]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0282   // Air
0283   hmgr->addHistoProf1(new TProfile("1710", "MB prof Eta [Air];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0));
0284   hmgr->addHisto1(new TH1F("1711", "Eta [Air]", 501, -5., 5.));
0285   hmgr->addHistoProf1(
0286       new TProfile("1720", "MB prof Phi [Air];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416));
0287   hmgr->addHisto1(new TH1F("1721", "Phi [Air]", 180, -3.1416, 3.1416));
0288   hmgr->addHistoProf2(new TProfile2D(
0289       "1730", "MB prof Eta  Phi [Air];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416));
0290   hmgr->addHisto2(new TH2F("1731", "Eta vs Phi [Air]", 501, -5., 5., 180, -3.1416, 3.1416));
0291   hmgr->addHistoProf1(new TProfile("1740", "MB prof R [Air];R [mm];#lambda/#lambda_{0}", 200, 0., 2000.));
0292   hmgr->addHisto1(new TH1F("1741", "R [Air]", 200, 0., 2000.));
0293   hmgr->addHistoProf2(
0294       new TProfile2D("1750", "MB prof sum R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0295   hmgr->addHisto2(new TH2F("1751", "R vs z [Air]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0296   hmgr->addHisto2(
0297       new TH2F("1760", "MB prof local R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax));
0298   hmgr->addHisto2(new TH2F("1761", "R vs z [Air]", nzbin, zMin, zMax, nrbin, rMin, rMax));
0299 }
0300 
0301 void MaterialBudgetTrackerHistos::fillStartTrack() {}
0302 
0303 void MaterialBudgetTrackerHistos::fillPerStep() {}
0304 
0305 void MaterialBudgetTrackerHistos::fillEndTrack() {
0306   //
0307   // fill histograms and profiles only if the material has been crossed
0308   //
0309 
0310   if (theData->getNumberOfSteps() != 0) {
0311     // Total X0
0312     hmgr->getHisto1(11)->Fill(theData->getEta());
0313     hmgr->getHisto1(21)->Fill(theData->getPhi());
0314     hmgr->getHisto2(31)->Fill(theData->getEta(), theData->getPhi());
0315 
0316     hmgr->getHistoProf1(10)->Fill(theData->getEta(), theData->getTotalMB());
0317     hmgr->getHistoProf1(20)->Fill(theData->getPhi(), theData->getTotalMB());
0318     hmgr->getHistoProf2(30)->Fill(theData->getEta(), theData->getPhi(), theData->getTotalMB());
0319 
0320     // rr
0321 
0322     // Support
0323     hmgr->getHisto1(111)->Fill(theData->getEta());
0324     hmgr->getHisto1(121)->Fill(theData->getPhi());
0325     hmgr->getHisto2(131)->Fill(theData->getEta(), theData->getPhi());
0326 
0327     hmgr->getHistoProf1(110)->Fill(theData->getEta(), theData->getSupportMB());
0328     hmgr->getHistoProf1(120)->Fill(theData->getPhi(), theData->getSupportMB());
0329     hmgr->getHistoProf2(130)->Fill(theData->getEta(), theData->getPhi(), theData->getSupportMB());
0330 
0331     // Sensitive
0332     hmgr->getHisto1(211)->Fill(theData->getEta());
0333     hmgr->getHisto1(221)->Fill(theData->getPhi());
0334     hmgr->getHisto2(231)->Fill(theData->getEta(), theData->getPhi());
0335 
0336     hmgr->getHistoProf1(210)->Fill(theData->getEta(), theData->getSensitiveMB());
0337     hmgr->getHistoProf1(220)->Fill(theData->getPhi(), theData->getSensitiveMB());
0338     hmgr->getHistoProf2(230)->Fill(theData->getEta(), theData->getPhi(), theData->getSensitiveMB());
0339 
0340     // Cables
0341     hmgr->getHisto1(311)->Fill(theData->getEta());
0342     hmgr->getHisto1(321)->Fill(theData->getPhi());
0343     hmgr->getHisto2(331)->Fill(theData->getEta(), theData->getPhi());
0344 
0345     hmgr->getHistoProf1(310)->Fill(theData->getEta(), theData->getCablesMB());
0346     hmgr->getHistoProf1(320)->Fill(theData->getPhi(), theData->getCablesMB());
0347     hmgr->getHistoProf2(330)->Fill(theData->getEta(), theData->getPhi(), theData->getCablesMB());
0348 
0349     // Cooling
0350     hmgr->getHisto1(411)->Fill(theData->getEta());
0351     hmgr->getHisto1(421)->Fill(theData->getPhi());
0352     hmgr->getHisto2(431)->Fill(theData->getEta(), theData->getPhi());
0353 
0354     hmgr->getHistoProf1(410)->Fill(theData->getEta(), theData->getCoolingMB());
0355     hmgr->getHistoProf1(420)->Fill(theData->getPhi(), theData->getCoolingMB());
0356     hmgr->getHistoProf2(430)->Fill(theData->getEta(), theData->getPhi(), theData->getCoolingMB());
0357 
0358     // Electronics
0359     hmgr->getHisto1(511)->Fill(theData->getEta());
0360     hmgr->getHisto1(521)->Fill(theData->getPhi());
0361     hmgr->getHisto2(531)->Fill(theData->getEta(), theData->getPhi());
0362 
0363     hmgr->getHistoProf1(510)->Fill(theData->getEta(), theData->getElectronicsMB());
0364     hmgr->getHistoProf1(520)->Fill(theData->getPhi(), theData->getElectronicsMB());
0365     hmgr->getHistoProf2(530)->Fill(theData->getEta(), theData->getPhi(), theData->getElectronicsMB());
0366 
0367     // Other
0368     hmgr->getHisto1(611)->Fill(theData->getEta());
0369     hmgr->getHisto1(621)->Fill(theData->getPhi());
0370     hmgr->getHisto2(631)->Fill(theData->getEta(), theData->getPhi());
0371 
0372     hmgr->getHistoProf1(610)->Fill(theData->getEta(), theData->getOtherMB());
0373     hmgr->getHistoProf1(620)->Fill(theData->getPhi(), theData->getOtherMB());
0374     hmgr->getHistoProf2(630)->Fill(theData->getEta(), theData->getPhi(), theData->getOtherMB());
0375 
0376     // Air
0377     hmgr->getHisto1(711)->Fill(theData->getEta());
0378     hmgr->getHisto1(721)->Fill(theData->getPhi());
0379     hmgr->getHisto2(731)->Fill(theData->getEta(), theData->getPhi());
0380 
0381     hmgr->getHistoProf1(710)->Fill(theData->getEta(), theData->getAirMB());
0382     hmgr->getHistoProf1(720)->Fill(theData->getPhi(), theData->getAirMB());
0383     hmgr->getHistoProf2(730)->Fill(theData->getEta(), theData->getPhi(), theData->getAirMB());
0384 
0385     //
0386     // Compute the total x/X0 crossed at each step radius for each path
0387     //
0388     //
0389     float theTotalMB_TOT = 0.0;
0390     float theTotalMB_SUP = 0.0;
0391     float theTotalMB_SEN = 0.0;
0392     float theTotalMB_CAB = 0.0;
0393     float theTotalMB_COL = 0.0;
0394     float theTotalMB_ELE = 0.0;
0395     float theTotalMB_OTH = 0.0;
0396     float theTotalMB_AIR = 0.0;
0397     for (int iStep = 0; iStep < theData->getNumberOfSteps(); iStep++) {
0398       theTotalMB_TOT += theData->getStepDmb(iStep);
0399       theTotalMB_SUP += theData->getSupportDmb(iStep);
0400       theTotalMB_SEN += theData->getSensitiveDmb(iStep);
0401       theTotalMB_CAB += theData->getCablesDmb(iStep);
0402       theTotalMB_COL += theData->getCoolingDmb(iStep);
0403       theTotalMB_ELE += theData->getElectronicsDmb(iStep);
0404       theTotalMB_OTH += theData->getOtherDmb(iStep);
0405       theTotalMB_AIR += theData->getAirDmb(iStep);
0406 
0407       int iSup = 0;
0408       int iSen = 0;
0409       int iCab = 0;
0410       int iCol = 0;
0411       int iEle = 0;
0412       int iOth = 0;
0413       int iAir = 0;
0414       if (theData->getSupportDmb(iStep) > 0.) {
0415         iSup = 1;
0416       }
0417       if (theData->getSensitiveDmb(iStep) > 0.) {
0418         iSen = 1;
0419       }
0420       if (theData->getCablesDmb(iStep) > 0.) {
0421         iCab = 1;
0422       }
0423       if (theData->getCoolingDmb(iStep) > 0.) {
0424         iCol = 1;
0425       }
0426       if (theData->getElectronicsDmb(iStep) > 0.) {
0427         iEle = 1;
0428       }
0429       if (theData->getOtherDmb(iStep) > 0.) {
0430         iOth = 1;
0431       }
0432       if (theData->getAirDmb(iStep) > 0.) {
0433         iAir = 1;
0434       }
0435 
0436       float deltaRadius = sqrt(pow(theData->getStepFinalX(iStep) - theData->getStepInitialX(iStep), 2) +
0437                                pow(theData->getStepFinalY(iStep) - theData->getStepInitialY(iStep), 2));
0438       float deltaz = theData->getStepFinalZ(iStep) - theData->getStepInitialZ(iStep);
0439 
0440       float x0 = theData->getStepMaterialX0(iStep);
0441 
0442       int nSubStep = 2;
0443       float boxWidth = 0.1;
0444       if ((deltaRadius > boxWidth) || (fabs(deltaz) > boxWidth)) {
0445         nSubStep = static_cast<int>(max(ceil(deltaRadius / boxWidth / 2.) * 2, ceil(fabs(deltaz) / boxWidth / 2.) * 2));
0446       }
0447 
0448       for (int iSubStep = 1; iSubStep < nSubStep; iSubStep += 2) {
0449         float subdeltaRadius = deltaRadius / nSubStep;
0450         float polarRadius = sqrt(pow(theData->getStepInitialX(iStep), 2) + pow(theData->getStepInitialY(iStep), 2)) +
0451                             iSubStep * subdeltaRadius;
0452 
0453         float subdeltaz = deltaz / nSubStep;
0454         float z = theData->getStepInitialZ(iStep) + iSubStep * subdeltaz;
0455 
0456         float subdelta = sqrt(pow(subdeltaRadius, 2) + pow(subdeltaz, 2));
0457 
0458         float fillValue = subdelta / x0;
0459 
0460         //
0461         // Average length
0462         hmgr->getHisto2(999)->Fill(z, polarRadius, subdelta);
0463         // Total
0464         hmgr->getHisto1(41)->Fill(polarRadius);
0465         hmgr->getHistoProf1(40)->Fill(polarRadius, theTotalMB_TOT);
0466         hmgr->getHisto2(51)->Fill(z, polarRadius);
0467         hmgr->getHistoProf2(50)->Fill(z, polarRadius, theTotalMB_TOT);
0468         hmgr->getHisto2(61)->Fill(z, polarRadius);
0469         hmgr->getHisto2(60)->Fill(z, polarRadius, fillValue);
0470         // Support
0471         hmgr->getHisto1(141)->Fill(polarRadius);
0472         hmgr->getHistoProf1(140)->Fill(polarRadius, theTotalMB_SUP);
0473         hmgr->getHisto2(151)->Fill(z, polarRadius);
0474         hmgr->getHistoProf2(150)->Fill(z, polarRadius, theTotalMB_SUP);
0475         hmgr->getHisto2(161)->Fill(z, polarRadius);
0476         hmgr->getHisto2(160)->Fill(z, polarRadius, iSup * fillValue);
0477         // Sensitive
0478         hmgr->getHisto1(241)->Fill(polarRadius);
0479         hmgr->getHistoProf1(240)->Fill(polarRadius, theTotalMB_SEN);
0480         hmgr->getHisto2(251)->Fill(z, polarRadius);
0481         hmgr->getHistoProf2(250)->Fill(z, polarRadius, theTotalMB_SEN);
0482         hmgr->getHisto2(261)->Fill(z, polarRadius);
0483         hmgr->getHisto2(260)->Fill(z, polarRadius, iSen * fillValue);
0484         // Cables
0485         hmgr->getHisto1(341)->Fill(polarRadius);
0486         hmgr->getHistoProf1(340)->Fill(polarRadius, theTotalMB_CAB);
0487         hmgr->getHisto2(351)->Fill(z, polarRadius);
0488         hmgr->getHistoProf2(350)->Fill(z, polarRadius, theTotalMB_CAB);
0489         hmgr->getHisto2(361)->Fill(z, polarRadius);
0490         hmgr->getHisto2(360)->Fill(z, polarRadius, iCab * fillValue);
0491         // Cooling
0492         hmgr->getHisto1(441)->Fill(polarRadius);
0493         hmgr->getHistoProf1(440)->Fill(polarRadius, theTotalMB_COL);
0494         hmgr->getHisto2(451)->Fill(z, polarRadius);
0495         hmgr->getHistoProf2(450)->Fill(z, polarRadius, theTotalMB_COL);
0496         hmgr->getHisto2(461)->Fill(z, polarRadius);
0497         hmgr->getHisto2(460)->Fill(z, polarRadius, iCol * fillValue);
0498         // Electronics
0499         hmgr->getHisto1(541)->Fill(polarRadius);
0500         hmgr->getHistoProf1(540)->Fill(polarRadius, theTotalMB_ELE);
0501         hmgr->getHisto2(551)->Fill(z, polarRadius);
0502         hmgr->getHistoProf2(550)->Fill(z, polarRadius, theTotalMB_ELE);
0503         hmgr->getHisto2(561)->Fill(z, polarRadius);
0504         hmgr->getHisto2(560)->Fill(z, polarRadius, iEle * fillValue);
0505         // Other
0506         hmgr->getHisto1(641)->Fill(polarRadius);
0507         hmgr->getHistoProf1(640)->Fill(polarRadius, theTotalMB_OTH);
0508         hmgr->getHisto2(651)->Fill(z, polarRadius);
0509         hmgr->getHistoProf2(650)->Fill(z, polarRadius, theTotalMB_OTH);
0510         hmgr->getHisto2(661)->Fill(z, polarRadius);
0511         hmgr->getHisto2(660)->Fill(z, polarRadius, iOth * fillValue);
0512         // Air
0513         hmgr->getHisto1(741)->Fill(polarRadius);
0514         hmgr->getHistoProf1(740)->Fill(polarRadius, theTotalMB_AIR);
0515         hmgr->getHisto2(751)->Fill(z, polarRadius);
0516         hmgr->getHistoProf2(750)->Fill(z, polarRadius, theTotalMB_AIR);
0517         hmgr->getHisto2(761)->Fill(z, polarRadius);
0518         hmgr->getHisto2(760)->Fill(z, polarRadius, iAir * fillValue);
0519         //
0520       }
0521     }
0522     //
0523     //
0524     ////////////////////////////////////////////////////////////////////////////////////////////
0525     //
0526     //
0527     //
0528 
0529     // Total Lambda0
0530     hmgr->getHisto1(1011)->Fill(theData->getEta());
0531     hmgr->getHisto1(1021)->Fill(theData->getPhi());
0532     hmgr->getHisto2(1031)->Fill(theData->getEta(), theData->getPhi());
0533 
0534     hmgr->getHistoProf1(1010)->Fill(theData->getEta(), theData->getTotalIL());
0535     hmgr->getHistoProf1(1020)->Fill(theData->getPhi(), theData->getTotalIL());
0536     hmgr->getHistoProf2(1030)->Fill(theData->getEta(), theData->getPhi(), theData->getTotalIL());
0537 
0538     // Support
0539     hmgr->getHisto1(1111)->Fill(theData->getEta());
0540     hmgr->getHisto1(1121)->Fill(theData->getPhi());
0541     hmgr->getHisto2(1131)->Fill(theData->getEta(), theData->getPhi());
0542 
0543     hmgr->getHistoProf1(1110)->Fill(theData->getEta(), theData->getSupportIL());
0544     hmgr->getHistoProf1(1120)->Fill(theData->getPhi(), theData->getSupportIL());
0545     hmgr->getHistoProf2(1130)->Fill(theData->getEta(), theData->getPhi(), theData->getSupportIL());
0546 
0547     // Sensitive
0548     hmgr->getHisto1(1211)->Fill(theData->getEta());
0549     hmgr->getHisto1(1221)->Fill(theData->getPhi());
0550     hmgr->getHisto2(1231)->Fill(theData->getEta(), theData->getPhi());
0551 
0552     hmgr->getHistoProf1(1210)->Fill(theData->getEta(), theData->getSensitiveIL());
0553     hmgr->getHistoProf1(1220)->Fill(theData->getPhi(), theData->getSensitiveIL());
0554     hmgr->getHistoProf2(1230)->Fill(theData->getEta(), theData->getPhi(), theData->getSensitiveIL());
0555 
0556     // Cables
0557     hmgr->getHisto1(1311)->Fill(theData->getEta());
0558     hmgr->getHisto1(1321)->Fill(theData->getPhi());
0559     hmgr->getHisto2(1331)->Fill(theData->getEta(), theData->getPhi());
0560 
0561     hmgr->getHistoProf1(1310)->Fill(theData->getEta(), theData->getCablesIL());
0562     hmgr->getHistoProf1(1320)->Fill(theData->getPhi(), theData->getCablesIL());
0563     hmgr->getHistoProf2(1330)->Fill(theData->getEta(), theData->getPhi(), theData->getCablesIL());
0564 
0565     // Cooling
0566     hmgr->getHisto1(1411)->Fill(theData->getEta());
0567     hmgr->getHisto1(1421)->Fill(theData->getPhi());
0568     hmgr->getHisto2(1431)->Fill(theData->getEta(), theData->getPhi());
0569 
0570     hmgr->getHistoProf1(1410)->Fill(theData->getEta(), theData->getCoolingIL());
0571     hmgr->getHistoProf1(1420)->Fill(theData->getPhi(), theData->getCoolingIL());
0572     hmgr->getHistoProf2(1430)->Fill(theData->getEta(), theData->getPhi(), theData->getCoolingIL());
0573 
0574     // Electronics
0575     hmgr->getHisto1(1511)->Fill(theData->getEta());
0576     hmgr->getHisto1(1521)->Fill(theData->getPhi());
0577     hmgr->getHisto2(1531)->Fill(theData->getEta(), theData->getPhi());
0578 
0579     hmgr->getHistoProf1(1510)->Fill(theData->getEta(), theData->getElectronicsIL());
0580     hmgr->getHistoProf1(1520)->Fill(theData->getPhi(), theData->getElectronicsIL());
0581     hmgr->getHistoProf2(1530)->Fill(theData->getEta(), theData->getPhi(), theData->getElectronicsIL());
0582 
0583     // Other
0584     hmgr->getHisto1(1611)->Fill(theData->getEta());
0585     hmgr->getHisto1(1621)->Fill(theData->getPhi());
0586     hmgr->getHisto2(1631)->Fill(theData->getEta(), theData->getPhi());
0587 
0588     hmgr->getHistoProf1(1610)->Fill(theData->getEta(), theData->getOtherIL());
0589     hmgr->getHistoProf1(1620)->Fill(theData->getPhi(), theData->getOtherIL());
0590     hmgr->getHistoProf2(1630)->Fill(theData->getEta(), theData->getPhi(), theData->getOtherIL());
0591 
0592     // Air
0593     hmgr->getHisto1(1711)->Fill(theData->getEta());
0594     hmgr->getHisto1(1721)->Fill(theData->getPhi());
0595     hmgr->getHisto2(1731)->Fill(theData->getEta(), theData->getPhi());
0596 
0597     hmgr->getHistoProf1(1710)->Fill(theData->getEta(), theData->getAirIL());
0598     hmgr->getHistoProf1(1720)->Fill(theData->getPhi(), theData->getAirIL());
0599     hmgr->getHistoProf2(1730)->Fill(theData->getEta(), theData->getPhi(), theData->getAirIL());
0600 
0601     // Compute the total l/l0 crossed at each step radius for each path
0602     float theTotalIL_TOT = 0.0;
0603     float theTotalIL_SUP = 0.0;
0604     float theTotalIL_SEN = 0.0;
0605     float theTotalIL_CAB = 0.0;
0606     float theTotalIL_COL = 0.0;
0607     float theTotalIL_ELE = 0.0;
0608     float theTotalIL_OTH = 0.0;
0609     float theTotalIL_AIR = 0.0;
0610     for (int iStep = 0; iStep < theData->getNumberOfSteps(); iStep++) {
0611       theTotalIL_TOT += theData->getStepDil(iStep);
0612       theTotalIL_SUP += theData->getSupportDil(iStep);
0613       theTotalIL_SEN += theData->getSensitiveDil(iStep);
0614       theTotalIL_CAB += theData->getCablesDil(iStep);
0615       theTotalIL_COL += theData->getCoolingDil(iStep);
0616       theTotalIL_ELE += theData->getElectronicsDil(iStep);
0617       theTotalIL_OTH += theData->getOtherDil(iStep);
0618       theTotalIL_AIR += theData->getAirDil(iStep);
0619 
0620       int iSup = 0;
0621       int iSen = 0;
0622       int iCab = 0;
0623       int iCol = 0;
0624       int iEle = 0;
0625       int iOth = 0;
0626       int iAir = 0;
0627       if (theData->getSupportDil(iStep) > 0.) {
0628         iSup = 1;
0629       }
0630       if (theData->getSensitiveDil(iStep) > 0.) {
0631         iSen = 1;
0632       }
0633       if (theData->getCablesDil(iStep) > 0.) {
0634         iCab = 1;
0635       }
0636       if (theData->getCoolingDil(iStep) > 0.) {
0637         iCol = 1;
0638       }
0639       if (theData->getElectronicsDil(iStep) > 0.) {
0640         iEle = 1;
0641       }
0642       if (theData->getOtherDil(iStep) > 0.) {
0643         iOth = 1;
0644       }
0645       if (theData->getAirDil(iStep) > 0.) {
0646         iAir = 1;
0647       }
0648 
0649       float deltaRadius = sqrt(pow(theData->getStepFinalX(iStep) - theData->getStepInitialX(iStep), 2) +
0650                                pow(theData->getStepFinalY(iStep) - theData->getStepInitialY(iStep), 2));
0651       float deltaz = theData->getStepFinalZ(iStep) - theData->getStepInitialZ(iStep);
0652 
0653       float il = theData->getStepMaterialLambda0(iStep);
0654 
0655       int nSubStep = 2;
0656       float boxWidth = 0.1;
0657       if ((deltaRadius > boxWidth) || (fabs(deltaz) > boxWidth)) {
0658         nSubStep = static_cast<int>(max(ceil(deltaRadius / boxWidth / 2.) * 2, ceil(fabs(deltaz) / boxWidth / 2.) * 2));
0659       }
0660 
0661       for (int iSubStep = 1; iSubStep < nSubStep; iSubStep += 2) {
0662         float subdeltaRadius = deltaRadius / nSubStep;
0663         float polarRadius = sqrt(pow(theData->getStepInitialX(iStep), 2) + pow(theData->getStepInitialY(iStep), 2)) +
0664                             iSubStep * subdeltaRadius;
0665 
0666         float subdeltaz = deltaz / nSubStep;
0667         float z = theData->getStepInitialZ(iStep) + iSubStep * subdeltaz;
0668 
0669         float subdelta = sqrt(pow(subdeltaRadius, 2) + pow(subdeltaz, 2));
0670 
0671         float fillValue = subdelta / il;
0672 
0673         //
0674         // Average length
0675         hmgr->getHisto2(1999)->Fill(z, polarRadius, subdelta);
0676         // Total
0677         hmgr->getHisto1(1041)->Fill(polarRadius);
0678         hmgr->getHistoProf1(1040)->Fill(polarRadius, theTotalIL_TOT);
0679         hmgr->getHisto2(1051)->Fill(z, polarRadius);
0680         hmgr->getHistoProf2(1050)->Fill(z, polarRadius, theTotalIL_TOT);
0681         hmgr->getHisto2(1061)->Fill(z, polarRadius);
0682         hmgr->getHisto2(1060)->Fill(z, polarRadius, fillValue);
0683         // Support
0684         hmgr->getHisto1(1141)->Fill(polarRadius);
0685         hmgr->getHistoProf1(1140)->Fill(polarRadius, theTotalIL_SUP);
0686         hmgr->getHisto2(1151)->Fill(z, polarRadius);
0687         hmgr->getHistoProf2(1150)->Fill(z, polarRadius, theTotalIL_SUP);
0688         hmgr->getHisto2(1161)->Fill(z, polarRadius);
0689         hmgr->getHisto2(1160)->Fill(z, polarRadius, iSup * fillValue);
0690         // Sensitive
0691         hmgr->getHisto1(1241)->Fill(polarRadius);
0692         hmgr->getHistoProf1(1240)->Fill(polarRadius, theTotalIL_SEN);
0693         hmgr->getHisto2(1251)->Fill(z, polarRadius);
0694         hmgr->getHistoProf2(1250)->Fill(z, polarRadius, theTotalIL_SEN);
0695         hmgr->getHisto2(1261)->Fill(z, polarRadius);
0696         hmgr->getHisto2(1260)->Fill(z, polarRadius, iSen * fillValue);
0697         // Cables
0698         hmgr->getHisto1(1341)->Fill(polarRadius);
0699         hmgr->getHistoProf1(1340)->Fill(polarRadius, theTotalIL_CAB);
0700         hmgr->getHisto2(1351)->Fill(z, polarRadius);
0701         hmgr->getHistoProf2(1350)->Fill(z, polarRadius, theTotalIL_CAB);
0702         hmgr->getHisto2(1361)->Fill(z, polarRadius);
0703         hmgr->getHisto2(1360)->Fill(z, polarRadius, iCab * fillValue);
0704         // Cooling
0705         hmgr->getHisto1(1441)->Fill(polarRadius);
0706         hmgr->getHistoProf1(1440)->Fill(polarRadius, theTotalIL_COL);
0707         hmgr->getHisto2(1451)->Fill(z, polarRadius);
0708         hmgr->getHistoProf2(1450)->Fill(z, polarRadius, theTotalIL_COL);
0709         hmgr->getHisto2(1461)->Fill(z, polarRadius);
0710         hmgr->getHisto2(1460)->Fill(z, polarRadius, iCol * fillValue);
0711         // Electronics
0712         hmgr->getHisto1(1541)->Fill(polarRadius);
0713         hmgr->getHistoProf1(1540)->Fill(polarRadius, theTotalIL_ELE);
0714         hmgr->getHisto2(1551)->Fill(z, polarRadius);
0715         hmgr->getHistoProf2(1550)->Fill(z, polarRadius, theTotalIL_ELE);
0716         hmgr->getHisto2(1561)->Fill(z, polarRadius);
0717         hmgr->getHisto2(1560)->Fill(z, polarRadius, iEle * fillValue);
0718         // Other
0719         hmgr->getHisto1(1641)->Fill(polarRadius);
0720         hmgr->getHistoProf1(1640)->Fill(polarRadius, theTotalIL_OTH);
0721         hmgr->getHisto2(1651)->Fill(z, polarRadius);
0722         hmgr->getHistoProf2(1650)->Fill(z, polarRadius, theTotalIL_OTH);
0723         hmgr->getHisto2(1661)->Fill(z, polarRadius);
0724         hmgr->getHisto2(1660)->Fill(z, polarRadius, iOth * fillValue);
0725         // Air
0726         hmgr->getHisto1(1741)->Fill(polarRadius);
0727         hmgr->getHistoProf1(1740)->Fill(polarRadius, theTotalIL_AIR);
0728         hmgr->getHisto2(1751)->Fill(z, polarRadius);
0729         hmgr->getHistoProf2(1750)->Fill(z, polarRadius, theTotalIL_AIR);
0730         hmgr->getHisto2(1761)->Fill(z, polarRadius);
0731         hmgr->getHisto2(1760)->Fill(z, polarRadius, iAir * fillValue);
0732         //
0733       }
0734     }
0735 
0736     // rr
0737   } else {
0738     edm::LogWarning("MaterialBudget") << "MaterialBudgetTrackerHistos: This event is out of the acceptance:"
0739                                       << "eta = " << theData->getEta() << "\t phi = " << theData->getPhi()
0740                                       << "\t x/X0 = " << theData->getTotalMB() << "\t l/l0 = " << theData->getTotalIL()
0741                                       << "\t steps = " << theData->getNumberOfSteps();
0742   }
0743 }
0744 
0745 void MaterialBudgetTrackerHistos::endOfRun() {
0746   // Prefered method to include any instruction
0747   // once all the tracks are done
0748 
0749   hmgr->getHisto2(60)->Divide(hmgr->getHisto2(999));
0750   hmgr->getHisto2(160)->Divide(hmgr->getHisto2(999));
0751   hmgr->getHisto2(260)->Divide(hmgr->getHisto2(999));
0752   hmgr->getHisto2(360)->Divide(hmgr->getHisto2(999));
0753   hmgr->getHisto2(460)->Divide(hmgr->getHisto2(999));
0754   hmgr->getHisto2(560)->Divide(hmgr->getHisto2(999));
0755   hmgr->getHisto2(660)->Divide(hmgr->getHisto2(999));
0756   hmgr->getHisto2(760)->Divide(hmgr->getHisto2(999));
0757 
0758   hmgr->getHisto2(160)->Divide(hmgr->getHisto2(1999));
0759   hmgr->getHisto2(1160)->Divide(hmgr->getHisto2(1999));
0760   hmgr->getHisto2(1260)->Divide(hmgr->getHisto2(1999));
0761   hmgr->getHisto2(1360)->Divide(hmgr->getHisto2(1999));
0762   hmgr->getHisto2(1460)->Divide(hmgr->getHisto2(1999));
0763   hmgr->getHisto2(1560)->Divide(hmgr->getHisto2(1999));
0764   hmgr->getHisto2(1660)->Divide(hmgr->getHisto2(1999));
0765   hmgr->getHisto2(1760)->Divide(hmgr->getHisto2(1999));
0766 
0767   edm::LogInfo("MaterialBudget") << "MaterialBudgetTrackerHistos: Saving Histograms to: " << theFileName;
0768   hmgr->save(theFileName);
0769 }