CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Validation/Geometry/src/MaterialBudgetTrackerHistos.cc

Go to the documentation of this file.
00001 #include "Validation/Geometry/interface/MaterialBudgetTrackerHistos.h"
00002 #include "Validation/Geometry/interface/MaterialBudgetData.h"
00003 
00004 template <class T> const T& max ( const T& a, const T& b ) {
00005   return (b<a)?a:b;     // or: return comp(b,a)?a:b; for the comp version
00006 }
00007 
00008 
00009 
00010 MaterialBudgetTrackerHistos::MaterialBudgetTrackerHistos(MaterialBudgetData* data,
00011                                                          TestHistoMgr* mgr,
00012                                                          const std::string& fileName ): MaterialBudgetFormat( data ), hmgr(mgr)
00013 {
00014   theFileName = fileName;
00015   book();
00016 
00017 }
00018 
00019 
00020 void MaterialBudgetTrackerHistos::book() 
00021 {
00022   std::cout << "=== booking user histos ===" << std::endl;
00023 
00024   // Parameters for 2D histograms
00025   int nzbin = 1200;
00026   float zMax = 3000.;
00027   float zMin = -3000.;
00028   int nrbin = 290;
00029   float rMin = -50.;
00030   float rMax = 1400.;
00031   
00032   // total X0
00033   hmgr->addHistoProf1( new TProfile("10", "MB prof Eta;#eta;x/X_{0} ", 250, -5., 5. ) );
00034   hmgr->addHisto1( new TH1F("11", "Eta " , 501, -5., 5. ) );
00035   hmgr->addHistoProf1( new TProfile("20", "MB prof Phi;#varphi [rad];x/X_{0} ", 180, -3.1416, 3.1416 ) );
00036   hmgr->addHisto1( new TH1F("21", "Phi " , 180, -3.1416, 3.1416 ) );
00037   hmgr->addHistoProf2( new TProfile2D("30", "MB prof Eta  Phi;#eta;#varphi;x/X_{0} ", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00038   hmgr->addHisto2( new TH2F("31", "Eta vs Phi " , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00039   hmgr->addHistoProf1( new TProfile("40", "MB prof R;R [mm];x/X_{0} ", 200, 0., 2000. ) );
00040   hmgr->addHisto1( new TH1F("41", "R " , 200, 0., 2000. ) );
00041   hmgr->addHistoProf2( new TProfile2D("50", "MB prof sum R  z;z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00042   hmgr->addHisto2( new TH2F("999", "Tot track length for MB", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00043   hmgr->addHisto2( new TH2F("51", "R vs z " , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00044   hmgr->addHisto2( new TH2F("60", "MB prof local R  z;z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00045   hmgr->addHisto2( new TH2F("61", "R vs z " , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00046   
00047   // Support
00048   hmgr->addHistoProf1( new TProfile("110", "MB prof Eta [Support];#eta;x/X_{0}", 250, -5.0, 5.0 ) );
00049   hmgr->addHisto1( new TH1F("111", "Eta [Support]" , 501, -5., 5. ) );
00050   hmgr->addHistoProf1( new TProfile("120", "MB prof Phi [Support];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416 ) );
00051   hmgr->addHisto1( new TH1F("121", "Phi [Support]" , 180, -3.1416, 3.1416 ) );
00052   hmgr->addHistoProf2( new TProfile2D("130", "MB prof Eta  Phi [Support];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00053   hmgr->addHisto2( new TH2F("131", "Eta vs Phi [Support]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00054   hmgr->addHistoProf1( new TProfile("140", "MB prof R [Support];R [mm];x/X_{0}", 200, 0., 2000. ) );
00055   hmgr->addHisto1( new TH1F("141", "R [Support]" , 200, 0., 2000. ) );
00056   hmgr->addHistoProf2( new TProfile2D("150", "MB prof sum R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00057   hmgr->addHisto2( new TH2F("151", "R vs z [Support]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00058   hmgr->addHisto2( new TH2F("160", "MB prof local R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00059   hmgr->addHisto2( new TH2F("161", "R vs z [Support]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00060   // Sensitive
00061   hmgr->addHistoProf1( new TProfile("210", "MB prof Eta [Sensitive];#eta;x/X_{0}", 250, -5.0, 5.0 ) );
00062   hmgr->addHisto1( new TH1F("211", "Eta [Sensitive]" , 501, -5., 5. ) );
00063   hmgr->addHistoProf1( new TProfile("220", "MB prof Phi [Sensitive];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416 ) );
00064   hmgr->addHisto1( new TH1F("221", "Phi [Sensitive]" , 180, -3.1416, 3.1416 ) );
00065   hmgr->addHistoProf2( new TProfile2D("230", "MB prof Eta  Phi [Sensitive];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00066   hmgr->addHisto2( new TH2F("231", "Eta vs Phi [Sensitive]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00067   hmgr->addHistoProf1( new TProfile("240", "MB prof R [Sensitive];R [mm];x/X_{0}", 200, 0., 2000. ) );
00068   hmgr->addHisto1( new TH1F("241", "R [Sensitive]" , 200, 0., 2000. ) );
00069   hmgr->addHistoProf2( new TProfile2D("250", "MB prof sum R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00070   hmgr->addHisto2( new TH2F("251", "R vs z [Sensitive]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00071   hmgr->addHisto2( new TH2F("260", "MB prof local R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00072   hmgr->addHisto2( new TH2F("261", "R vs z [Sensitive]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00073   // Cables
00074   hmgr->addHistoProf1( new TProfile("310", "MB prof Eta [Cables];#eta;x/X_{0}", 250, -5.0, 5.0 ) );
00075   hmgr->addHisto1( new TH1F("311", "Eta [Cables]" , 501, -5., 5. ) );
00076   hmgr->addHistoProf1( new TProfile("320", "MB prof Phi [Cables];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416 ) );
00077   hmgr->addHisto1( new TH1F("321", "Phi [Cables]" , 180, -3.1416, 3.1416 ) );
00078   hmgr->addHistoProf2( new TProfile2D("330", "MB prof Eta  Phi [Cables];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00079   hmgr->addHisto2( new TH2F("331", "Eta vs Phi [Cables]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00080   hmgr->addHistoProf1( new TProfile("340", "MB prof R [Cables];R [mm];x/X_{0}", 200, 0., 2000. ) );
00081   hmgr->addHisto1( new TH1F("341", "R [Cables]" , 200, 0., 2000. ) );
00082   hmgr->addHistoProf2( new TProfile2D("350", "MB prof sum R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00083   hmgr->addHisto2( new TH2F("351", "R vs z [Cables]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00084   hmgr->addHisto2( new TH2F("360", "MB prof local R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00085   hmgr->addHisto2( new TH2F("361", "R vs z [Cables]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00086   // Cooling
00087   hmgr->addHistoProf1( new TProfile("410", "MB prof Eta [Cooling];#eta;x/X_{0}", 250, -5.0, 5.0 ) );
00088   hmgr->addHisto1( new TH1F("411", "Eta [Cooling]" , 501, -5., 5. ) );
00089   hmgr->addHistoProf1( new TProfile("420", "MB prof Phi [Cooling];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416 ) );
00090   hmgr->addHisto1( new TH1F("421", "Phi [Cooling]" , 180, -3.1416, 3.1416 ) );
00091   hmgr->addHistoProf2( new TProfile2D("430", "MB prof Eta  Phi [Cooling];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00092   hmgr->addHisto2( new TH2F("431", "Eta vs Phi [Cooling]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00093   hmgr->addHistoProf1( new TProfile("440", "MB prof R [Cooling];R [mm];x/X_{0}", 200, 0., 2000. ) );
00094   hmgr->addHisto1( new TH1F("441", "R [Cooling]" , 200, 0., 2000. ) );
00095   hmgr->addHistoProf2( new TProfile2D("450", "MB prof sum R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00096   hmgr->addHisto2( new TH2F("451", "R vs z [Cooling]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00097   hmgr->addHisto2( new TH2F("460", "MB prof local R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00098   hmgr->addHisto2( new TH2F("461", "R vs z [Cooling]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00099   // Electronics
00100   hmgr->addHistoProf1( new TProfile("510", "MB prof Eta [Electronics];#eta;x/X_{0}", 250, -5.0, 5.0 ) );
00101   hmgr->addHisto1( new TH1F("511", "Eta [Electronics]" , 501, -5., 5. ) );
00102   hmgr->addHistoProf1( new TProfile("520", "MB prof Phi [Electronics];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416 ) );
00103   hmgr->addHisto1( new TH1F("521", "Phi [Electronics]" , 180, -3.1416, 3.1416 ) );
00104   hmgr->addHistoProf2( new TProfile2D("530", "MB prof Eta  Phi [Electronics];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00105   hmgr->addHisto2( new TH2F("531", "Eta vs Phi [Electronics]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00106   hmgr->addHistoProf1( new TProfile("540", "MB prof R [Electronics];R [mm];x/X_{0}", 200, 0., 2000. ) );
00107   hmgr->addHisto1( new TH1F("541", "R [Electronics]" , 200, 0., 2000. ) );
00108   hmgr->addHistoProf2( new TProfile2D("550", "MB prof sum R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00109   hmgr->addHisto2( new TH2F("551", "R vs z [Electronics]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00110   hmgr->addHisto2( new TH2F("560", "MB prof local R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00111   hmgr->addHisto2( new TH2F("561", "R vs z [Electronics]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00112   // Other
00113   hmgr->addHistoProf1( new TProfile("610", "MB prof Eta [Other];#eta;x/X_{0}", 250, -5.0, 5.0 ) );
00114   hmgr->addHisto1( new TH1F("611", "Eta [Other]" , 501, -5., 5. ) );
00115   hmgr->addHistoProf1( new TProfile("620", "MB prof Phi [Other];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416 ) );
00116   hmgr->addHisto1( new TH1F("621", "Phi [Other]" , 180, -3.1416, 3.1416 ) );
00117   hmgr->addHistoProf2( new TProfile2D("630", "MB prof Eta  Phi [Other];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00118   hmgr->addHisto2( new TH2F("631", "Eta vs Phi [Other]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00119   hmgr->addHistoProf1( new TProfile("640", "MB prof R [Other];R [mm];x/X_{0}", 200, 0., 2000. ) );
00120   hmgr->addHisto1( new TH1F("641", "R [Other]" , 200, 0., 2000. ) );
00121   hmgr->addHistoProf2( new TProfile2D("650", "MB prof sum R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00122   hmgr->addHisto2( new TH2F("651", "R vs z [Other]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00123   hmgr->addHisto2( new TH2F("660", "MB prof local R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00124   hmgr->addHisto2( new TH2F("661", "R vs z [Other]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00125   // Air
00126   hmgr->addHistoProf1( new TProfile("710", "MB prof Eta [Air];#eta;x/X_{0}", 250, -5.0, 5.0 ) );
00127   hmgr->addHisto1( new TH1F("711", "Eta [Air]" , 501, -5., 5. ) );
00128   hmgr->addHistoProf1( new TProfile("720", "MB prof Phi [Air];#varphi [rad];x/X_{0}", 180, -3.1416, 3.1416 ) );
00129   hmgr->addHisto1( new TH1F("721", "Phi [Air]" , 180, -3.1416, 3.1416 ) );
00130   hmgr->addHistoProf2( new TProfile2D("730", "MB prof Eta  Phi [Air];#eta;#varphi;x/X_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00131   hmgr->addHisto2( new TH2F("731", "Eta vs Phi [Air]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00132   hmgr->addHistoProf1( new TProfile("740", "MB prof R [Air];R [mm];x/X_{0}", 200, 0., 2000. ) );
00133   hmgr->addHisto1( new TH1F("741", "R [Air]" , 200, 0., 2000. ) );
00134   hmgr->addHistoProf2( new TProfile2D("750", "MB prof sum R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00135   hmgr->addHisto2( new TH2F("751", "R vs z [Air]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00136   hmgr->addHisto2( new TH2F("760", "MB prof local R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00137   hmgr->addHisto2( new TH2F("761", "R vs z [Air]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00138   //
00139   
00140   // total Lambda0
00141   hmgr->addHistoProf1( new TProfile("1010", "MB prof Eta;#eta;#lambda/#lambda_{0} ", 250, -5., 5. ) );
00142   hmgr->addHisto1( new TH1F("1011", "Eta " , 501, -5., 5. ) );
00143   hmgr->addHistoProf1( new TProfile("1020", "MB prof Phi;#varphi [rad];#lambda/#lambda_{0} ", 180, -3.1416, 3.1416 ) );
00144   hmgr->addHisto1( new TH1F("1021", "Phi " , 180, -3.1416, 3.1416 ) );
00145   hmgr->addHistoProf2( new TProfile2D("1030", "MB prof Eta  Phi;#eta;#varphi;#lambda/#lambda_{0} ", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00146   hmgr->addHisto2( new TH2F("1031", "Eta vs Phi " , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00147   
00148   // rr
00149   hmgr->addHistoProf1( new TProfile("1040", "MB prof R;R [mm];#lambda/#lambda_{0} ", 200, 0., 2000. ) );
00150   hmgr->addHisto1( new TH1F("1041", "R " , 200, 0., 2000. ) );
00151   hmgr->addHistoProf2( new TProfile2D("1050", "MB prof sum R  z;z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00152   hmgr->addHisto2( new TH2F("1999", "Tot track length for l0", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00153   hmgr->addHisto2( new TH2F("1051", "R vs z " , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00154   hmgr->addHisto2( new TH2F("1060", "MB prof local R  z;z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00155   hmgr->addHisto2( new TH2F("1061", "R vs z " , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00156   
00157   // Support
00158   hmgr->addHistoProf1( new TProfile("1110", "MB prof Eta [Support];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0 ) );
00159   hmgr->addHisto1( new TH1F("1111", "Eta [Support]" , 501, -5., 5. ) );
00160   hmgr->addHistoProf1( new TProfile("1120", "MB prof Phi [Support];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416 ) );
00161   hmgr->addHisto1( new TH1F("1121", "Phi [Support]" , 180, -3.1416, 3.1416 ) );
00162   hmgr->addHistoProf2( new TProfile2D("1130", "MB prof Eta  Phi [Support];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00163   hmgr->addHisto2( new TH2F("1131", "Eta vs Phi [Support]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00164   hmgr->addHistoProf1( new TProfile("1140", "MB prof R [Support];R [mm];#lambda/#lambda_{0}", 200, 0., 2000. ) );
00165   hmgr->addHisto1( new TH1F("1141", "R [Support]" , 200, 0., 2000. ) );
00166   hmgr->addHistoProf2( new TProfile2D("1150", "MB prof sum R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00167   hmgr->addHisto2( new TH2F("1151", "R vs z [Support]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00168   hmgr->addHisto2( new TH2F("1160", "MB prof local R  z [Support];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00169   hmgr->addHisto2( new TH2F("1161", "R vs z [Support]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00170   // Sensitive
00171   hmgr->addHistoProf1( new TProfile("1210", "MB prof Eta [Sensitive];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0 ) );
00172   hmgr->addHisto1( new TH1F("1211", "Eta [Sensitive]" , 501, -5., 5. ) );
00173   hmgr->addHistoProf1( new TProfile("1220", "MB prof Phi [Sensitive];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416 ) );
00174   hmgr->addHisto1( new TH1F("1221", "Phi [Sensitive]" , 180, -3.1416, 3.1416 ) );
00175   hmgr->addHistoProf2( new TProfile2D("1230", "MB prof Eta  Phi [Sensitive];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00176   hmgr->addHisto2( new TH2F("1231", "Eta vs Phi [Sensitive]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00177   hmgr->addHistoProf1( new TProfile("1240", "MB prof R [Sensitive];R [mm];#lambda/#lambda_{0}", 200, 0., 2000. ) );
00178   hmgr->addHisto1( new TH1F("1241", "R [Sensitive]" , 200, 0., 2000. ) );
00179   hmgr->addHistoProf2( new TProfile2D("1250", "MB prof sum R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00180   hmgr->addHisto2( new TH2F("1251", "R vs z [Sensitive]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00181   hmgr->addHisto2( new TH2F("1260", "MB prof local R  z [Sensitive];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00182   hmgr->addHisto2( new TH2F("1261", "R vs z [Sensitive]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00183   // Cables
00184   hmgr->addHistoProf1( new TProfile("1310", "MB prof Eta [Cables];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0 ) );
00185   hmgr->addHisto1( new TH1F("1311", "Eta [Cables]" , 501, -5., 5. ) );
00186   hmgr->addHistoProf1( new TProfile("1320", "MB prof Phi [Cables];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416 ) );
00187   hmgr->addHisto1( new TH1F("1321", "Phi [Cables]" , 180, -3.1416, 3.1416 ) );
00188   hmgr->addHistoProf2( new TProfile2D("1330", "MB prof Eta  Phi [Cables];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00189   hmgr->addHisto2( new TH2F("1331", "Eta vs Phi [Cables]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00190   hmgr->addHistoProf1( new TProfile("1340", "MB prof R [Cables];R [mm];#lambda/#lambda_{0}", 200, 0., 2000. ) );
00191   hmgr->addHisto1( new TH1F("1341", "R [Cables]" , 200, 0., 2000. ) );
00192   hmgr->addHistoProf2( new TProfile2D("1350", "MB prof sum R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00193   hmgr->addHisto2( new TH2F("1351", "R vs z [Cables]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00194   hmgr->addHisto2( new TH2F("1360", "MB prof local R  z [Cables];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00195   hmgr->addHisto2( new TH2F("1361", "R vs z [Cables]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00196   // Cooling
00197   hmgr->addHistoProf1( new TProfile("1410", "MB prof Eta [Cooling];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0 ) );
00198   hmgr->addHisto1( new TH1F("1411", "Eta [Cooling]" , 501, -5., 5. ) );
00199   hmgr->addHistoProf1( new TProfile("1420", "MB prof Phi [Cooling];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416 ) );
00200   hmgr->addHisto1( new TH1F("1421", "Phi [Cooling]" , 180, -3.1416, 3.1416 ) );
00201   hmgr->addHistoProf2( new TProfile2D("1430", "MB prof Eta  Phi [Cooling];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00202   hmgr->addHisto2( new TH2F("1431", "Eta vs Phi [Cooling]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00203   hmgr->addHistoProf1( new TProfile("1440", "MB prof R [Cooling];R [mm];#lambda/#lambda_{0}", 200, 0., 2000. ) );
00204   hmgr->addHisto1( new TH1F("1441", "R [Cooling]" , 200, 0., 2000. ) );
00205   hmgr->addHistoProf2( new TProfile2D("1450", "MB prof sum R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00206   hmgr->addHisto2( new TH2F("1451", "R vs z [Cooling]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00207   hmgr->addHisto2( new TH2F("1460", "MB prof local R  z [Cooling];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00208   hmgr->addHisto2( new TH2F("1461", "R vs z [Cooling]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00209   // Electronics
00210   hmgr->addHistoProf1( new TProfile("1510", "MB prof Eta [Electronics];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0 ) );
00211   hmgr->addHisto1( new TH1F("1511", "Eta [Electronics]" , 501, -5., 5. ) );
00212   hmgr->addHistoProf1( new TProfile("1520", "MB prof Phi [Electronics];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416 ) );
00213   hmgr->addHisto1( new TH1F("1521", "Phi [Electronics]" , 180, -3.1416, 3.1416 ) );
00214   hmgr->addHistoProf2( new TProfile2D("1530", "MB prof Eta  Phi [Electronics];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00215   hmgr->addHisto2( new TH2F("1531", "Eta vs Phi [Electronics]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00216   hmgr->addHistoProf1( new TProfile("1540", "MB prof R [Electronics];R [mm];#lambda/#lambda_{0}", 200, 0., 2000. ) );
00217   hmgr->addHisto1( new TH1F("1541", "R [Electronics]" , 200, 0., 2000. ) );
00218   hmgr->addHistoProf2( new TProfile2D("1550", "MB prof sum R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00219   hmgr->addHisto2( new TH2F("1551", "R vs z [Electronics]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00220   hmgr->addHisto2( new TH2F("1560", "MB prof local R  z [Electronics];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00221   hmgr->addHisto2( new TH2F("1561", "R vs z [Electronics]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00222   // Other
00223   hmgr->addHistoProf1( new TProfile("1610", "MB prof Eta [Other];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0 ) );
00224   hmgr->addHisto1( new TH1F("1611", "Eta [Other]" , 501, -5., 5. ) );
00225   hmgr->addHistoProf1( new TProfile("1620", "MB prof Phi [Other];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416 ) );
00226   hmgr->addHisto1( new TH1F("1621", "Phi [Other]" , 180, -3.1416, 3.1416 ) );
00227   hmgr->addHistoProf2( new TProfile2D("1630", "MB prof Eta  Phi [Other];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00228   hmgr->addHisto2( new TH2F("1631", "Eta vs Phi [Other]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00229   hmgr->addHistoProf1( new TProfile("1640", "MB prof R [Other];R [mm];#lambda/#lambda_{0}", 200, 0., 2000. ) );
00230   hmgr->addHisto1( new TH1F("1641", "R [Other]" , 200, 0., 2000. ) );
00231   hmgr->addHistoProf2( new TProfile2D("1650", "MB prof sum R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00232   hmgr->addHisto2( new TH2F("1651", "R vs z [Other]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00233   hmgr->addHisto2( new TH2F("1660", "MB prof local R  z [Other];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00234   hmgr->addHisto2( new TH2F("1661", "R vs z [Other]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00235   // Air
00236   hmgr->addHistoProf1( new TProfile("1710", "MB prof Eta [Air];#eta;#lambda/#lambda_{0}", 250, -5.0, 5.0 ) );
00237   hmgr->addHisto1( new TH1F("1711", "Eta [Air]" , 501, -5., 5. ) );
00238   hmgr->addHistoProf1( new TProfile("1720", "MB prof Phi [Air];#varphi [rad];#lambda/#lambda_{0}", 180, -3.1416, 3.1416 ) );
00239   hmgr->addHisto1( new TH1F("1721", "Phi [Air]" , 180, -3.1416, 3.1416 ) );
00240   hmgr->addHistoProf2( new TProfile2D("1730", "MB prof Eta  Phi [Air];#eta;#varphi;#lambda/#lambda_{0}", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00241   hmgr->addHisto2( new TH2F("1731", "Eta vs Phi [Air]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00242   hmgr->addHistoProf1( new TProfile("1740", "MB prof R [Air];R [mm];#lambda/#lambda_{0}", 200, 0., 2000. ) );
00243   hmgr->addHisto1( new TH1F("1741", "R [Air]" , 200, 0., 2000. ) );
00244   hmgr->addHistoProf2( new TProfile2D("1750", "MB prof sum R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00245   hmgr->addHisto2( new TH2F("1751", "R vs z [Air]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00246   hmgr->addHisto2( new TH2F("1760", "MB prof local R  z [Air];z [mm];R [mm];x/X_{0} ", nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00247   hmgr->addHisto2( new TH2F("1761", "R vs z [Air]" , nzbin, zMin, zMax, nrbin, rMin, rMax ) );
00248   //
00249   
00250   // rr
00251   
00252   std::cout << "=== booking user histos done ===" << std::endl;
00253 
00254 }
00255 
00256 
00257 void MaterialBudgetTrackerHistos::fillStartTrack()
00258 {
00259 
00260 }
00261 
00262 
00263 void MaterialBudgetTrackerHistos::fillPerStep()
00264 {
00265 
00266 }
00267 
00268 
00269 void MaterialBudgetTrackerHistos::fillEndTrack()
00270 {
00271   //
00272   // fill histograms and profiles only if the material has been crossed
00273   //
00274   
00275   if( theData->getNumberOfSteps() != 0 ) {
00276     
00277     // Total X0
00278     hmgr->getHisto1(11)->Fill(theData->getEta());
00279     hmgr->getHisto1(21)->Fill(theData->getPhi());
00280     hmgr->getHisto2(31)->Fill(theData->getEta(),theData->getPhi());
00281     
00282     hmgr->getHistoProf1(10)->Fill(theData->getEta(),theData->getTotalMB());
00283     hmgr->getHistoProf1(20)->Fill(theData->getPhi(),theData->getTotalMB());
00284     hmgr->getHistoProf2(30)->Fill(theData->getEta(),theData->getPhi(),theData->getTotalMB());
00285     
00286     // rr
00287     
00288     // Support
00289     hmgr->getHisto1(111)->Fill(theData->getEta());
00290     hmgr->getHisto1(121)->Fill(theData->getPhi());
00291     hmgr->getHisto2(131)->Fill(theData->getEta(),theData->getPhi());
00292     
00293     hmgr->getHistoProf1(110)->Fill(theData->getEta(),theData->getSupportMB());
00294     hmgr->getHistoProf1(120)->Fill(theData->getPhi(),theData->getSupportMB());
00295     hmgr->getHistoProf2(130)->Fill(theData->getEta(),theData->getPhi(),theData->getSupportMB());
00296     
00297     // Sensitive
00298     hmgr->getHisto1(211)->Fill(theData->getEta());
00299     hmgr->getHisto1(221)->Fill(theData->getPhi());
00300     hmgr->getHisto2(231)->Fill(theData->getEta(),theData->getPhi());
00301     
00302     hmgr->getHistoProf1(210)->Fill(theData->getEta(),theData->getSensitiveMB());
00303     hmgr->getHistoProf1(220)->Fill(theData->getPhi(),theData->getSensitiveMB());
00304     hmgr->getHistoProf2(230)->Fill(theData->getEta(),theData->getPhi(),theData->getSensitiveMB());
00305     
00306     // Cables
00307     hmgr->getHisto1(311)->Fill(theData->getEta());
00308     hmgr->getHisto1(321)->Fill(theData->getPhi());
00309     hmgr->getHisto2(331)->Fill(theData->getEta(),theData->getPhi());
00310     
00311     hmgr->getHistoProf1(310)->Fill(theData->getEta(),theData->getCablesMB());
00312     hmgr->getHistoProf1(320)->Fill(theData->getPhi(),theData->getCablesMB());
00313     hmgr->getHistoProf2(330)->Fill(theData->getEta(),theData->getPhi(),theData->getCablesMB());
00314     
00315     // Cooling
00316     hmgr->getHisto1(411)->Fill(theData->getEta());
00317     hmgr->getHisto1(421)->Fill(theData->getPhi());
00318     hmgr->getHisto2(431)->Fill(theData->getEta(),theData->getPhi());
00319     
00320     hmgr->getHistoProf1(410)->Fill(theData->getEta(),theData->getCoolingMB());
00321     hmgr->getHistoProf1(420)->Fill(theData->getPhi(),theData->getCoolingMB());
00322     hmgr->getHistoProf2(430)->Fill(theData->getEta(),theData->getPhi(),theData->getCoolingMB());
00323     
00324     // Electronics
00325     hmgr->getHisto1(511)->Fill(theData->getEta());
00326     hmgr->getHisto1(521)->Fill(theData->getPhi());
00327     hmgr->getHisto2(531)->Fill(theData->getEta(),theData->getPhi());
00328     
00329     hmgr->getHistoProf1(510)->Fill(theData->getEta(),theData->getElectronicsMB());
00330     hmgr->getHistoProf1(520)->Fill(theData->getPhi(),theData->getElectronicsMB());
00331     hmgr->getHistoProf2(530)->Fill(theData->getEta(),theData->getPhi(),theData->getElectronicsMB());
00332     
00333     // Other
00334     hmgr->getHisto1(611)->Fill(theData->getEta());
00335     hmgr->getHisto1(621)->Fill(theData->getPhi());
00336     hmgr->getHisto2(631)->Fill(theData->getEta(),theData->getPhi());
00337     
00338     hmgr->getHistoProf1(610)->Fill(theData->getEta(),theData->getOtherMB());
00339     hmgr->getHistoProf1(620)->Fill(theData->getPhi(),theData->getOtherMB());
00340     hmgr->getHistoProf2(630)->Fill(theData->getEta(),theData->getPhi(),theData->getOtherMB());
00341     
00342     // Air
00343     hmgr->getHisto1(711)->Fill(theData->getEta());
00344     hmgr->getHisto1(721)->Fill(theData->getPhi());
00345     hmgr->getHisto2(731)->Fill(theData->getEta(),theData->getPhi());
00346     
00347     hmgr->getHistoProf1(710)->Fill(theData->getEta(),theData->getAirMB());
00348     hmgr->getHistoProf1(720)->Fill(theData->getPhi(),theData->getAirMB());
00349     hmgr->getHistoProf2(730)->Fill(theData->getEta(),theData->getPhi(),theData->getAirMB());
00350     
00351     //
00352     // Compute the total x/X0 crossed at each step radius for each path
00353     //
00354     //
00355     float theTotalMB_TOT = 0.0;
00356     float theTotalMB_SUP = 0.0;
00357     float theTotalMB_SEN = 0.0;
00358     float theTotalMB_CAB = 0.0;
00359     float theTotalMB_COL = 0.0;
00360     float theTotalMB_ELE = 0.0;
00361     float theTotalMB_OTH = 0.0;
00362     float theTotalMB_AIR = 0.0;
00363     for(int iStep = 0; iStep < theData->getNumberOfSteps(); iStep++) {
00364       theTotalMB_TOT += theData->getStepDmb(iStep);
00365       theTotalMB_SUP += theData->getSupportDmb(iStep);
00366       theTotalMB_SEN += theData->getSensitiveDmb(iStep);
00367       theTotalMB_CAB += theData->getCablesDmb(iStep);
00368       theTotalMB_COL += theData->getCoolingDmb(iStep);
00369       theTotalMB_ELE += theData->getElectronicsDmb(iStep);
00370       theTotalMB_OTH += theData->getOtherDmb(iStep);
00371       theTotalMB_AIR += theData->getAirDmb(iStep);        
00372 
00373       int iSup = 0;
00374       int iSen = 0;
00375       int iCab = 0;
00376       int iCol = 0;
00377       int iEle = 0;
00378       int iOth = 0;
00379       int iAir = 0;
00380       if( theData->getSupportDmb(iStep)>0.     ) { iSup = 1; }
00381       if( theData->getSensitiveDmb(iStep)>0.   ) { iSen = 1; }
00382       if( theData->getCablesDmb(iStep)>0.      ) { iCab = 1; }
00383       if( theData->getCoolingDmb(iStep)>0.     ) { iCol = 1; }
00384       if( theData->getElectronicsDmb(iStep)>0. ) { iEle = 1; }
00385       if( theData->getOtherDmb(iStep)>0.       ) { iOth = 1; }
00386       if( theData->getAirDmb(iStep)>0.         ) { iAir = 1; }
00387 
00388       float deltaRadius = sqrt(
00389                                pow( theData->getStepFinalX(iStep)-theData->getStepInitialX(iStep),2 )
00390                                +
00391                                pow( theData->getStepFinalY(iStep)-theData->getStepInitialY(iStep),2 )
00392                                );
00393       float deltaz = theData->getStepFinalZ(iStep)-theData->getStepInitialZ(iStep) ;
00394       
00395       float x0 = theData->getStepMaterialX0(iStep);
00396 
00397       int nSubStep = 2;
00398       float boxWidth = 0.1;
00399       if( (deltaRadius>boxWidth) || (fabs(deltaz)>boxWidth) ) {
00400         nSubStep = static_cast<int>(max(
00401                        ceil(deltaRadius/boxWidth/2.)*2,
00402                        ceil(fabs(deltaz)/boxWidth/2.)*2
00403                        ));
00404       }
00405       
00406       for(int iSubStep = 1; iSubStep < nSubStep; iSubStep+=2) {
00407 
00408         float subdeltaRadius = deltaRadius/nSubStep;
00409         float polarRadius = sqrt(
00410                                  pow( theData->getStepInitialX(iStep),2 )
00411                                  +
00412                                  pow( theData->getStepInitialY(iStep),2 )
00413                                  ) + iSubStep*subdeltaRadius;
00414 
00415         float subdeltaz = deltaz/nSubStep;
00416         float z = theData->getStepInitialZ(iStep) + iSubStep*subdeltaz;
00417 
00418         float subdelta = sqrt(
00419                               pow ( subdeltaRadius,2 ) + pow( subdeltaz,2 )
00420                               );
00421 
00422         float fillValue=subdelta/x0;
00423 
00424         //
00425         // Average length
00426         hmgr->getHisto2(999)->Fill(z,polarRadius,subdelta);
00427         // Total
00428         hmgr->getHisto1(41)->Fill(polarRadius);
00429         hmgr->getHistoProf1(40)->Fill(polarRadius,theTotalMB_TOT);
00430         hmgr->getHisto2(51)->Fill(z,polarRadius);
00431         hmgr->getHistoProf2(50)->Fill(z,polarRadius,theTotalMB_TOT);
00432         hmgr->getHisto2(61)->Fill(z,polarRadius);
00433         hmgr->getHisto2(60)->Fill(z,polarRadius,fillValue);
00434         // Support
00435         hmgr->getHisto1(141)->Fill(polarRadius);
00436         hmgr->getHistoProf1(140)->Fill(polarRadius,theTotalMB_SUP);
00437         hmgr->getHisto2(151)->Fill(z,polarRadius);
00438         hmgr->getHistoProf2(150)->Fill(z,polarRadius,theTotalMB_SUP);
00439         hmgr->getHisto2(161)->Fill(z,polarRadius);
00440         hmgr->getHisto2(160)->Fill(z,polarRadius,iSup*fillValue);
00441         // Sensitive
00442         hmgr->getHisto1(241)->Fill(polarRadius);
00443         hmgr->getHistoProf1(240)->Fill(polarRadius,theTotalMB_SEN);
00444         hmgr->getHisto2(251)->Fill(z,polarRadius);
00445         hmgr->getHistoProf2(250)->Fill(z,polarRadius,theTotalMB_SEN);
00446         hmgr->getHisto2(261)->Fill(z,polarRadius);
00447         hmgr->getHisto2(260)->Fill(z,polarRadius,iSen*fillValue);
00448         // Cables
00449         hmgr->getHisto1(341)->Fill(polarRadius);
00450         hmgr->getHistoProf1(340)->Fill(polarRadius,theTotalMB_CAB);
00451         hmgr->getHisto2(351)->Fill(z,polarRadius);
00452         hmgr->getHistoProf2(350)->Fill(z,polarRadius,theTotalMB_CAB);
00453         hmgr->getHisto2(361)->Fill(z,polarRadius);
00454         hmgr->getHisto2(360)->Fill(z,polarRadius,iCab*fillValue);
00455         // Cooling
00456         hmgr->getHisto1(441)->Fill(polarRadius);
00457         hmgr->getHistoProf1(440)->Fill(polarRadius,theTotalMB_COL);
00458         hmgr->getHisto2(451)->Fill(z,polarRadius);
00459         hmgr->getHistoProf2(450)->Fill(z,polarRadius,theTotalMB_COL);
00460         hmgr->getHisto2(461)->Fill(z,polarRadius);
00461         hmgr->getHisto2(460)->Fill(z,polarRadius,iCol*fillValue);
00462         // Electronics
00463         hmgr->getHisto1(541)->Fill(polarRadius);
00464         hmgr->getHistoProf1(540)->Fill(polarRadius,theTotalMB_ELE);
00465         hmgr->getHisto2(551)->Fill(z,polarRadius);
00466         hmgr->getHistoProf2(550)->Fill(z,polarRadius,theTotalMB_ELE);
00467         hmgr->getHisto2(561)->Fill(z,polarRadius);
00468         hmgr->getHisto2(560)->Fill(z,polarRadius,iEle*fillValue);
00469         // Other
00470         hmgr->getHisto1(641)->Fill(polarRadius);
00471         hmgr->getHistoProf1(640)->Fill(polarRadius,theTotalMB_OTH);
00472         hmgr->getHisto2(651)->Fill(z,polarRadius);
00473         hmgr->getHistoProf2(650)->Fill(z,polarRadius,theTotalMB_OTH);
00474         hmgr->getHisto2(661)->Fill(z,polarRadius);
00475         hmgr->getHisto2(660)->Fill(z,polarRadius,iOth*fillValue);
00476         // Air
00477         hmgr->getHisto1(741)->Fill(polarRadius);
00478         hmgr->getHistoProf1(740)->Fill(polarRadius,theTotalMB_AIR);
00479         hmgr->getHisto2(751)->Fill(z,polarRadius);
00480         hmgr->getHistoProf2(750)->Fill(z,polarRadius,theTotalMB_AIR);
00481         hmgr->getHisto2(761)->Fill(z,polarRadius);
00482         hmgr->getHisto2(760)->Fill(z,polarRadius,iAir*fillValue);
00483         //
00484       }
00485     }
00486     //
00487     //
00489     //
00490     //
00491     //
00492 
00493     
00494     // Total Lambda0
00495     hmgr->getHisto1(1011)->Fill(theData->getEta());
00496     hmgr->getHisto1(1021)->Fill(theData->getPhi());
00497     hmgr->getHisto2(1031)->Fill(theData->getEta(),theData->getPhi());
00498     
00499     hmgr->getHistoProf1(1010)->Fill(theData->getEta(),theData->getTotalIL());
00500     hmgr->getHistoProf1(1020)->Fill(theData->getPhi(),theData->getTotalIL());
00501     hmgr->getHistoProf2(1030)->Fill(theData->getEta(),theData->getPhi(),theData->getTotalIL());
00502     
00503     // Support
00504     hmgr->getHisto1(1111)->Fill(theData->getEta());
00505     hmgr->getHisto1(1121)->Fill(theData->getPhi());
00506     hmgr->getHisto2(1131)->Fill(theData->getEta(),theData->getPhi());
00507     
00508     hmgr->getHistoProf1(1110)->Fill(theData->getEta(),theData->getSupportIL());
00509     hmgr->getHistoProf1(1120)->Fill(theData->getPhi(),theData->getSupportIL());
00510     hmgr->getHistoProf2(1130)->Fill(theData->getEta(),theData->getPhi(),theData->getSupportIL());
00511     
00512     // Sensitive
00513     hmgr->getHisto1(1211)->Fill(theData->getEta());
00514     hmgr->getHisto1(1221)->Fill(theData->getPhi());
00515     hmgr->getHisto2(1231)->Fill(theData->getEta(),theData->getPhi());
00516     
00517     hmgr->getHistoProf1(1210)->Fill(theData->getEta(),theData->getSensitiveIL());
00518     hmgr->getHistoProf1(1220)->Fill(theData->getPhi(),theData->getSensitiveIL());
00519     hmgr->getHistoProf2(1230)->Fill(theData->getEta(),theData->getPhi(),theData->getSensitiveIL());
00520     
00521     // Cables
00522     hmgr->getHisto1(1311)->Fill(theData->getEta());
00523     hmgr->getHisto1(1321)->Fill(theData->getPhi());
00524     hmgr->getHisto2(1331)->Fill(theData->getEta(),theData->getPhi());
00525     
00526     hmgr->getHistoProf1(1310)->Fill(theData->getEta(),theData->getCablesIL());
00527     hmgr->getHistoProf1(1320)->Fill(theData->getPhi(),theData->getCablesIL());
00528     hmgr->getHistoProf2(1330)->Fill(theData->getEta(),theData->getPhi(),theData->getCablesIL());
00529     
00530     // Cooling
00531     hmgr->getHisto1(1411)->Fill(theData->getEta());
00532     hmgr->getHisto1(1421)->Fill(theData->getPhi());
00533     hmgr->getHisto2(1431)->Fill(theData->getEta(),theData->getPhi());
00534     
00535     hmgr->getHistoProf1(1410)->Fill(theData->getEta(),theData->getCoolingIL());
00536     hmgr->getHistoProf1(1420)->Fill(theData->getPhi(),theData->getCoolingIL());
00537     hmgr->getHistoProf2(1430)->Fill(theData->getEta(),theData->getPhi(),theData->getCoolingIL());
00538     
00539     // Electronics
00540     hmgr->getHisto1(1511)->Fill(theData->getEta());
00541     hmgr->getHisto1(1521)->Fill(theData->getPhi());
00542     hmgr->getHisto2(1531)->Fill(theData->getEta(),theData->getPhi());
00543     
00544     hmgr->getHistoProf1(1510)->Fill(theData->getEta(),theData->getElectronicsIL());
00545     hmgr->getHistoProf1(1520)->Fill(theData->getPhi(),theData->getElectronicsIL());
00546     hmgr->getHistoProf2(1530)->Fill(theData->getEta(),theData->getPhi(),theData->getElectronicsIL());
00547     
00548     // Other
00549     hmgr->getHisto1(1611)->Fill(theData->getEta());
00550     hmgr->getHisto1(1621)->Fill(theData->getPhi());
00551     hmgr->getHisto2(1631)->Fill(theData->getEta(),theData->getPhi());
00552     
00553     hmgr->getHistoProf1(1610)->Fill(theData->getEta(),theData->getOtherIL());
00554     hmgr->getHistoProf1(1620)->Fill(theData->getPhi(),theData->getOtherIL());
00555     hmgr->getHistoProf2(1630)->Fill(theData->getEta(),theData->getPhi(),theData->getOtherIL());
00556     
00557     // Air
00558     hmgr->getHisto1(1711)->Fill(theData->getEta());
00559     hmgr->getHisto1(1721)->Fill(theData->getPhi());
00560     hmgr->getHisto2(1731)->Fill(theData->getEta(),theData->getPhi());
00561     
00562     hmgr->getHistoProf1(1710)->Fill(theData->getEta(),theData->getAirIL());
00563     hmgr->getHistoProf1(1720)->Fill(theData->getPhi(),theData->getAirIL());
00564     hmgr->getHistoProf2(1730)->Fill(theData->getEta(),theData->getPhi(),theData->getAirIL());
00565     
00566     // Compute the total l/l0 crossed at each step radius for each path
00567     float theTotalIL_TOT = 0.0;
00568     float theTotalIL_SUP = 0.0;
00569     float theTotalIL_SEN = 0.0;
00570     float theTotalIL_CAB = 0.0;
00571     float theTotalIL_COL = 0.0;
00572     float theTotalIL_ELE = 0.0;
00573     float theTotalIL_OTH = 0.0;
00574     float theTotalIL_AIR = 0.0;
00575     for(int iStep = 0; iStep < theData->getNumberOfSteps(); iStep++) {
00576       theTotalIL_TOT += theData->getStepDil(iStep);
00577       theTotalIL_SUP += theData->getSupportDil(iStep);
00578       theTotalIL_SEN += theData->getSensitiveDil(iStep);
00579       theTotalIL_CAB += theData->getCablesDil(iStep);
00580       theTotalIL_COL += theData->getCoolingDil(iStep);
00581       theTotalIL_ELE += theData->getElectronicsDil(iStep);
00582       theTotalIL_OTH += theData->getOtherDil(iStep);
00583       theTotalIL_AIR += theData->getAirDil(iStep);
00584 
00585       int iSup = 0;
00586       int iSen = 0;
00587       int iCab = 0;
00588       int iCol = 0;
00589       int iEle = 0;
00590       int iOth = 0;
00591       int iAir = 0;
00592       if( theData->getSupportDil(iStep)>0.     ) { iSup = 1; }
00593       if( theData->getSensitiveDil(iStep)>0.   ) { iSen = 1; }
00594       if( theData->getCablesDil(iStep)>0.      ) { iCab = 1; }
00595       if( theData->getCoolingDil(iStep)>0.     ) { iCol = 1; }
00596       if( theData->getElectronicsDil(iStep)>0. ) { iEle = 1; }
00597       if( theData->getOtherDil(iStep)>0.       ) { iOth = 1; }
00598       if( theData->getAirDil(iStep)>0.         ) { iAir = 1; }
00599 
00600       float deltaRadius = sqrt(
00601                                pow( theData->getStepFinalX(iStep)-theData->getStepInitialX(iStep),2 )
00602                                +
00603                                pow( theData->getStepFinalY(iStep)-theData->getStepInitialY(iStep),2 )
00604                                );
00605       float deltaz = theData->getStepFinalZ(iStep)-theData->getStepInitialZ(iStep) ;
00606       
00607       float il = theData->getStepMaterialLambda0(iStep);
00608 
00609       int nSubStep = 2;
00610       float boxWidth = 0.1;
00611       if( (deltaRadius>boxWidth) || (fabs(deltaz)>boxWidth) ) {
00612         nSubStep = static_cast<int>(max(
00613                        ceil(deltaRadius/boxWidth/2.)*2,
00614                        ceil(fabs(deltaz)/boxWidth/2.)*2
00615                        ));
00616       }
00617       
00618       for(int iSubStep = 1; iSubStep < nSubStep; iSubStep+=2) {
00619 
00620         float subdeltaRadius = deltaRadius/nSubStep;
00621         float polarRadius = sqrt(
00622                                  pow( theData->getStepInitialX(iStep),2 )
00623                                  +
00624                                  pow( theData->getStepInitialY(iStep),2 )
00625                                  ) + iSubStep*subdeltaRadius;
00626 
00627         float subdeltaz = deltaz/nSubStep;
00628         float z = theData->getStepInitialZ(iStep) + iSubStep*subdeltaz;
00629 
00630         float subdelta = sqrt(
00631                               pow ( subdeltaRadius,2 ) + pow( subdeltaz,2 )
00632                               );
00633 
00634         float fillValue=subdelta/il;
00635 
00636         //
00637         // Average length
00638         hmgr->getHisto2(1999)->Fill(z,polarRadius,subdelta);
00639         // Total
00640         hmgr->getHisto1(1041)->Fill(polarRadius);
00641         hmgr->getHistoProf1(1040)->Fill(polarRadius,theTotalIL_TOT);
00642         hmgr->getHisto2(1051)->Fill(z,polarRadius);
00643         hmgr->getHistoProf2(1050)->Fill(z,polarRadius,theTotalIL_TOT);
00644         hmgr->getHisto2(1061)->Fill(z,polarRadius);
00645         hmgr->getHisto2(1060)->Fill(z,polarRadius,fillValue);
00646         // Support
00647         hmgr->getHisto1(1141)->Fill(polarRadius);
00648         hmgr->getHistoProf1(1140)->Fill(polarRadius,theTotalIL_SUP);
00649         hmgr->getHisto2(1151)->Fill(z,polarRadius);
00650         hmgr->getHistoProf2(1150)->Fill(z,polarRadius,theTotalIL_SUP);
00651         hmgr->getHisto2(1161)->Fill(z,polarRadius);
00652         hmgr->getHisto2(1160)->Fill(z,polarRadius,iSup*fillValue);
00653         // Sensitive
00654         hmgr->getHisto1(1241)->Fill(polarRadius);
00655         hmgr->getHistoProf1(1240)->Fill(polarRadius,theTotalIL_SEN);
00656         hmgr->getHisto2(1251)->Fill(z,polarRadius);
00657         hmgr->getHistoProf2(1250)->Fill(z,polarRadius,theTotalIL_SEN);
00658         hmgr->getHisto2(1261)->Fill(z,polarRadius);
00659         hmgr->getHisto2(1260)->Fill(z,polarRadius,iSen*fillValue);
00660         // Cables
00661         hmgr->getHisto1(1341)->Fill(polarRadius);
00662         hmgr->getHistoProf1(1340)->Fill(polarRadius,theTotalIL_CAB);
00663         hmgr->getHisto2(1351)->Fill(z,polarRadius);
00664         hmgr->getHistoProf2(1350)->Fill(z,polarRadius,theTotalIL_CAB);
00665         hmgr->getHisto2(1361)->Fill(z,polarRadius);
00666         hmgr->getHisto2(1360)->Fill(z,polarRadius,iCab*fillValue);
00667         // Cooling
00668         hmgr->getHisto1(1441)->Fill(polarRadius);
00669         hmgr->getHistoProf1(1440)->Fill(polarRadius,theTotalIL_COL);
00670         hmgr->getHisto2(1451)->Fill(z,polarRadius);
00671         hmgr->getHistoProf2(1450)->Fill(z,polarRadius,theTotalIL_COL);
00672         hmgr->getHisto2(1461)->Fill(z,polarRadius);
00673         hmgr->getHisto2(1460)->Fill(z,polarRadius,iCol*fillValue);
00674         // Electronics
00675         hmgr->getHisto1(1541)->Fill(polarRadius);
00676         hmgr->getHistoProf1(1540)->Fill(polarRadius,theTotalIL_ELE);
00677         hmgr->getHisto2(1551)->Fill(z,polarRadius);
00678         hmgr->getHistoProf2(1550)->Fill(z,polarRadius,theTotalIL_ELE);
00679         hmgr->getHisto2(1561)->Fill(z,polarRadius);
00680         hmgr->getHisto2(1560)->Fill(z,polarRadius,iEle*fillValue);
00681         // Other
00682         hmgr->getHisto1(1641)->Fill(polarRadius);
00683         hmgr->getHistoProf1(1640)->Fill(polarRadius,theTotalIL_OTH);
00684         hmgr->getHisto2(1651)->Fill(z,polarRadius);
00685         hmgr->getHistoProf2(1650)->Fill(z,polarRadius,theTotalIL_OTH);
00686         hmgr->getHisto2(1661)->Fill(z,polarRadius);
00687         hmgr->getHisto2(1660)->Fill(z,polarRadius,iOth*fillValue);
00688         // Air
00689         hmgr->getHisto1(1741)->Fill(polarRadius);
00690         hmgr->getHistoProf1(1740)->Fill(polarRadius,theTotalIL_AIR);
00691         hmgr->getHisto2(1751)->Fill(z,polarRadius);
00692         hmgr->getHistoProf2(1750)->Fill(z,polarRadius,theTotalIL_AIR);
00693         hmgr->getHisto2(1761)->Fill(z,polarRadius);
00694         hmgr->getHisto2(1760)->Fill(z,polarRadius,iAir*fillValue);
00695         //
00696       }
00697 
00698     }
00699     
00700     // rr
00701   } else {
00702     std::cout << "*** WARNING This event is out of the acceptance *** " << std::endl;
00703     std::cout << "eta = "      << theData->getEta()
00704               << "\t phi = "   << theData->getPhi()
00705               << "\t x/X0 = "  << theData->getTotalMB()
00706               << "\t l/l0 = "  << theData->getTotalIL()
00707               << "\t steps = " << theData->getNumberOfSteps()
00708               << std::endl;
00709     std::cout << "***" << std::endl;
00710   }
00711 
00712  
00713 }
00714 
00715 void MaterialBudgetTrackerHistos::hend() 
00716 {
00717 
00718   hmgr->getHisto2(60)->Divide(hmgr->getHisto2(999));
00719   hmgr->getHisto2(160)->Divide(hmgr->getHisto2(999));
00720   hmgr->getHisto2(260)->Divide(hmgr->getHisto2(999));
00721   hmgr->getHisto2(360)->Divide(hmgr->getHisto2(999));
00722   hmgr->getHisto2(460)->Divide(hmgr->getHisto2(999));
00723   hmgr->getHisto2(560)->Divide(hmgr->getHisto2(999));
00724   hmgr->getHisto2(660)->Divide(hmgr->getHisto2(999));
00725   hmgr->getHisto2(760)->Divide(hmgr->getHisto2(999));
00726   
00727   hmgr->getHisto2(160)->Divide(hmgr->getHisto2(1999));
00728   hmgr->getHisto2(1160)->Divide(hmgr->getHisto2(1999));
00729   hmgr->getHisto2(1260)->Divide(hmgr->getHisto2(1999));
00730   hmgr->getHisto2(1360)->Divide(hmgr->getHisto2(1999));
00731   hmgr->getHisto2(1460)->Divide(hmgr->getHisto2(1999));
00732   hmgr->getHisto2(1560)->Divide(hmgr->getHisto2(1999));
00733   hmgr->getHisto2(1660)->Divide(hmgr->getHisto2(1999));
00734   hmgr->getHisto2(1760)->Divide(hmgr->getHisto2(1999));
00735   
00736   std::cout << "=== save user histos ===" << std::endl;
00737   hmgr->save( theFileName );
00738 
00739 }
00740 
00741