CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Validation/Geometry/src/MaterialBudgetEcalHistos.cc

Go to the documentation of this file.
00001 #include "Validation/Geometry/interface/MaterialBudgetEcalHistos.h"
00002 #include "Validation/Geometry/interface/MaterialBudgetData.h"
00003 
00004 
00005 #include "CLHEP/Units/GlobalSystemOfUnits.h"
00006 
00007 MaterialBudgetEcalHistos::MaterialBudgetEcalHistos(MaterialBudgetData* data, 
00008                                                    TestHistoMgr* mgr,
00009                                                    const std::string& fileName ): MaterialBudgetFormat( data ), hmgr(mgr)
00010 {
00011   theFileName = fileName;
00012   book();
00013 
00014 }
00015 
00016 
00017 void MaterialBudgetEcalHistos::book() 
00018 {
00019   std::cout << "=== booking user histos ===" << std::endl;
00020   
00021   // total X0
00022   hmgr->addHistoProf1( new TProfile("10", "MB prof Eta ", 250, -5., 5. ) );
00023   hmgr->addHisto1( new TH1F("11", "Eta " , 501, -5., 5. ) );
00024   hmgr->addHistoProf1( new TProfile("20", "MB prof Phi ", 180, -3.1416, 3.1416 ) );
00025   hmgr->addHisto1( new TH1F("21", "Phi " , 180, -3.1416, 3.1416 ) );
00026   hmgr->addHistoProf2( new TProfile2D("30", "MB prof Eta  Phi ", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00027   hmgr->addHisto2( new TH2F("31", "Eta vs Phi " , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00028   
00029   // rr
00030   
00031   // Support
00032   hmgr->addHistoProf1( new TProfile("110", "MB prof Eta [Support]", 250, -5.0, 5.0 ) );
00033   hmgr->addHisto1( new TH1F("111", "Eta [Support]" , 501, -5., 5. ) );
00034   hmgr->addHistoProf1( new TProfile("120", "MB prof Phi [Support]", 180, -3.1416, 3.1416 ) );
00035   hmgr->addHisto1( new TH1F("121", "Phi [Support]" , 180, -3.1416, 3.1416 ) );
00036   hmgr->addHistoProf2( new TProfile2D("130", "MB prof Eta  Phi [Support]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00037   hmgr->addHisto2( new TH2F("131", "Eta vs Phi [Support]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00038   // Sensitive
00039   hmgr->addHistoProf1( new TProfile("210", "MB prof Eta [Sensitive]", 250, -5.0, 5.0 ) );
00040   hmgr->addHisto1( new TH1F("211", "Eta [Sensitive]" , 501, -5., 5. ) );
00041   hmgr->addHistoProf1( new TProfile("220", "MB prof Phi [Sensitive]", 180, -3.1416, 3.1416 ) );
00042   hmgr->addHisto1( new TH1F("221", "Phi [Sensitive]" , 180, -3.1416, 3.1416 ) );
00043   hmgr->addHistoProf2( new TProfile2D("230", "MB prof Eta  Phi [Sensitive]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00044   hmgr->addHisto2( new TH2F("231", "Eta vs Phi [Sensitive]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00045   // Cables
00046   hmgr->addHistoProf1( new TProfile("310", "MB prof Eta [Cables]", 250, -5.0, 5.0 ) );
00047   hmgr->addHisto1( new TH1F("311", "Eta [Cables]" , 501, -5., 5. ) );
00048   hmgr->addHistoProf1( new TProfile("320", "MB prof Phi [Cables]", 180, -3.1416, 3.1416 ) );
00049   hmgr->addHisto1( new TH1F("321", "Phi [Cables]" , 180, -3.1416, 3.1416 ) );
00050   hmgr->addHistoProf2( new TProfile2D("330", "MB prof Eta  Phi [Cables]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00051   hmgr->addHisto2( new TH2F("331", "Eta vs Phi [Cables]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00052   // Cooling
00053   hmgr->addHistoProf1( new TProfile("410", "MB prof Eta [Cooling]", 250, -5.0, 5.0 ) );
00054   hmgr->addHisto1( new TH1F("411", "Eta [Cooling]" , 501, -5., 5. ) );
00055   hmgr->addHistoProf1( new TProfile("420", "MB prof Phi [Cooling]", 180, -3.1416, 3.1416 ) );
00056   hmgr->addHisto1( new TH1F("421", "Phi [Cooling]" , 180, -3.1416, 3.1416 ) );
00057   hmgr->addHistoProf2( new TProfile2D("430", "MB prof Eta  Phi [Cooling]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00058   hmgr->addHisto2( new TH2F("431", "Eta vs Phi [Cooling]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00059   // Electronics
00060   hmgr->addHistoProf1( new TProfile("510", "MB prof Eta [Electronics]", 250, -5.0, 5.0 ) );
00061   hmgr->addHisto1( new TH1F("511", "Eta [Electronics]" , 501, -5., 5. ) );
00062   hmgr->addHistoProf1( new TProfile("520", "MB prof Phi [Electronics]", 180, -3.1416, 3.1416 ) );
00063   hmgr->addHisto1( new TH1F("521", "Phi [Electronics]" , 180, -3.1416, 3.1416 ) );
00064   hmgr->addHistoProf2( new TProfile2D("530", "MB prof Eta  Phi [Electronics]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00065   hmgr->addHisto2( new TH2F("531", "Eta vs Phi [Electronics]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00066   // Other
00067   hmgr->addHistoProf1( new TProfile("610", "MB prof Eta [Other]", 250, -5.0, 5.0 ) );
00068   hmgr->addHisto1( new TH1F("611", "Eta [Other]" , 501, -5., 5. ) );
00069   hmgr->addHistoProf1( new TProfile("620", "MB prof Phi [Other]", 180, -3.1416, 3.1416 ) );
00070   hmgr->addHisto1( new TH1F("621", "Phi [Other]" , 180, -3.1416, 3.1416 ) );
00071   hmgr->addHistoProf2( new TProfile2D("630", "MB prof Eta  Phi [Other]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00072   hmgr->addHisto2( new TH2F("631", "Eta vs Phi [Other]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00073   // Air
00074   hmgr->addHistoProf1( new TProfile("710", "MB prof Eta [Air]", 250, -5.0, 5.0 ) );
00075   hmgr->addHisto1( new TH1F("711", "Eta [Air]" , 501, -5., 5. ) );
00076   hmgr->addHistoProf1( new TProfile("720", "MB prof Phi [Air]", 180, -3.1416, 3.1416 ) );
00077   hmgr->addHisto1( new TH1F("721", "Phi [Air]" , 180, -3.1416, 3.1416 ) );
00078   hmgr->addHistoProf2( new TProfile2D("730", "MB prof Eta  Phi [Air]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
00079   hmgr->addHisto2( new TH2F("731", "Eta vs Phi [Air]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
00080   //
00081 
00082   // ECAL specific
00083 
00084   hmgr->addHistoProf1( new TProfile("1001", "MB prof Eta ECAL Barrel", 340, -1.5, 1.5 ) );
00085   hmgr->addHistoProf1( new TProfile("1002", "MB prof Phi ECAL Barrel", 180, -3.1416, 3.1416 ) );
00086   hmgr->addHistoProf1( new TProfile("1003", "MB prof Phi ECAL Barrel SM", 20, 0., 20. ) );
00087   hmgr->addHistoProf1( new TProfile("2003", "MB prof Phi ECAL Barrel SM", 10, 0., 20. ) );
00088   hmgr->addHistoProf1( new TProfile("1004", "MB prof Phi ECAL Barrel SM module 1", 20, 0., 20. ) );
00089   hmgr->addHistoProf1( new TProfile("1005", "MB prof Phi ECAL Barrel SM module 2", 20, 0., 20. ) );
00090   hmgr->addHistoProf1( new TProfile("1006", "MB prof Phi ECAL Barrel SM module 3", 20, 0., 20. ) );
00091   hmgr->addHistoProf1( new TProfile("1007", "MB prof Phi ECAL Barrel SM module 4", 20, 0., 20. ) );
00092 
00093   hmgr->addHistoProf1( new TProfile("1011", "MB prof Eta ECAL Preshower +", 100, 1.65, 2.6 ) );
00094   hmgr->addHistoProf1( new TProfile("1012", "MB prof Phi ECAL Preshower +", 180, -3.1416, 3.1416 ) );
00095   
00096   hmgr->addHistoProf1( new TProfile("1013", "MB prof Eta ECAL Preshower -", 100, -2.6, -1.65 ) );
00097   hmgr->addHistoProf1( new TProfile("1014", "MB prof Phi ECAL Preshower -", 180, -3.1416, 3.1416 ) );
00098   
00099   
00100   // rr
00101   
00102   std::cout << "=== booking user histos done ===" << std::endl;
00103 
00104 }
00105 
00106 
00107 void MaterialBudgetEcalHistos::fillStartTrack()
00108 {
00109 
00110 }
00111 
00112 
00113 void MaterialBudgetEcalHistos::fillPerStep()
00114 {
00115 
00116 }
00117 
00118 
00119 void MaterialBudgetEcalHistos::fillEndTrack()
00120 {
00121   // Total X0
00122   hmgr->getHisto1(11)->Fill(theData->getEta());
00123   hmgr->getHisto1(21)->Fill(theData->getPhi());
00124   hmgr->getHisto2(31)->Fill(theData->getEta(),theData->getPhi());
00125   
00126   hmgr->getHistoProf1(10)->Fill(theData->getEta(),theData->getTotalMB());
00127   hmgr->getHistoProf1(20)->Fill(theData->getPhi(),theData->getTotalMB());
00128   hmgr->getHistoProf2(30)->Fill(theData->getEta(),theData->getPhi(),theData->getTotalMB());
00129   
00130   
00131   // ECAL specific
00132 
00133   if (fabs(theData->getEta()) <= 1.479 ) {
00134     static const double twenty ( 20.*degree ) ;
00135     const double phi ( theData->getPhi()+M_PI ) ;
00136     const double phiModTwenty (( phi - floor(phi/twenty)*twenty )/degree) ;
00137     hmgr->getHistoProf1(1001)->Fill(theData->getEta(),theData->getTotalMB());
00138     hmgr->getHistoProf1(1002)->Fill(theData->getPhi(),theData->getTotalMB());
00139     hmgr->getHistoProf1(1003)->Fill(phiModTwenty,theData->getTotalMB());
00140     hmgr->getHistoProf1(2003)->Fill(phiModTwenty,theData->getTotalMB());
00141     if (fabs(theData->getEta()) >= 0. && fabs(theData->getEta()) < 0.435 ) {
00142       hmgr->getHistoProf1(1004)->Fill(phiModTwenty,theData->getTotalMB());
00143     }
00144     if (fabs(theData->getEta()) >= 0.435 && fabs(theData->getEta()) < 0.783 ) {
00145       hmgr->getHistoProf1(1005)->Fill(phiModTwenty,theData->getTotalMB());
00146     }
00147     if (fabs(theData->getEta()) > 0.783 && fabs(theData->getEta()) <= 1.131 ) {
00148       hmgr->getHistoProf1(1006)->Fill(phiModTwenty,theData->getTotalMB());
00149     }
00150     if (fabs(theData->getEta()) > 1.131 && fabs(theData->getEta()) <= 1.479 ) {
00151       hmgr->getHistoProf1(1007)->Fill(phiModTwenty,theData->getTotalMB());
00152     }
00153     
00154   }
00155 
00156   if (theData->getEta() >= 1.653 && theData->getEta() <= 2.6 ) {
00157     hmgr->getHistoProf1(1011)->Fill(theData->getEta(),theData->getTotalMB());
00158     hmgr->getHistoProf1(1012)->Fill(theData->getPhi(),theData->getTotalMB());
00159   }
00160 
00161   if (theData->getEta() >= -2.6 && theData->getEta() <= -1.653 ) {
00162     hmgr->getHistoProf1(1013)->Fill(theData->getEta(),theData->getTotalMB());
00163     hmgr->getHistoProf1(1014)->Fill(theData->getPhi(),theData->getTotalMB());
00164   }
00165 
00166 
00167   // rr
00168 }
00169 
00170 
00171 void MaterialBudgetEcalHistos::hend() 
00172 {
00173   std::cout << "=== save user histos ===" << std::endl;
00174   hmgr->save( theFileName );
00175 
00176 }
00177