CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/CastorMonitor/src/CastorTowerJetMonitor.cc

Go to the documentation of this file.
00001 #include "DQM/CastorMonitor/interface/CastorTowerJetMonitor.h"
00002 #include "DQMServices/Core/interface/DQMStore.h"
00003 #include "DQMServices/Core/interface/MonitorElement.h"
00004 
00005 //****************************************************//
00006 //********** CastorTowerJetMonitor: ******************//
00007 //********** Author: Dmytro Volyanskyy   *************//
00008 //********** Date  : 18.03.2011 (first version) ******// 
00009 //****************************************************//
00010 
00011 
00012 //==================================================================//
00013 //======================= Constructor ==============================//
00014 //==================================================================//
00015 CastorTowerJetMonitor::CastorTowerJetMonitor() {  
00016 }
00017 
00018 
00019 //==================================================================//
00020 //======================= Destructor ===============================//
00021 //==================================================================//
00022 CastorTowerJetMonitor::~CastorTowerJetMonitor() {
00023 }
00024 
00025 
00026 //==================================================================//
00027 //=========================== reset  ===============================//
00028 //==================================================================//
00029 void CastorTowerJetMonitor::reset(){
00030 }
00031 
00032 
00033 //==================================================================//
00034 //=========================== done  ===============================//
00035 //==================================================================//
00036 void CastorTowerJetMonitor::done(){
00037 }
00038 
00039 
00040 //==================================================================//
00041 //=========================== setup  ===============================//
00042 //==================================================================//
00043 void CastorTowerJetMonitor::setup(const edm::ParameterSet& ps, DQMStore* dbe){
00044 
00045   CastorBaseMonitor::setup(ps,dbe);
00046   baseFolder_ = rootFolder_+"CastorTowerJetMonitor";
00047    
00048   if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup (start)" << std::endl;
00049   
00051   ievt_=0;  nTowers=0; energyTower =0;  emEnergyTower = 0; hadEnergyTower=0;  femTower=0; etaTower=0; 
00052   phiTower=0; depthTower=0; nJets=0; energyJet =0; etaJet=0; phiJet=0;
00053       
00054   
00055   if ( m_dbe !=NULL ) {
00056     
00057     m_dbe->setCurrentFolder(baseFolder_);
00058     meEVT_ = m_dbe->bookInt("TowerJet Event Number");
00059     meEVT_->Fill(ievt_);
00060         
00061     m_dbe->setCurrentFolder(baseFolder_);
00062   
00064       meCastorTowerEnergy    =  m_dbe->book1D("CASTOR Tower Total Energy","CASTOR Tower Total Energy",200,0,1000);
00065       meCastorTowerEMEnergy  =  m_dbe->book1D("CASTOR Tower EM Energy","CASTOR Tower EM Energy",200,0,1000);
00066       meCastorTowerHADEnergy  =  m_dbe->book1D("CASTOR Tower HAD Energy","CASTOR Tower HAD Energy",200,0,1000);
00067       meCastorTowerFEM   =  m_dbe->book1D("CASTOR Tower fem - EM to Total Energy Fraction","CASTOR fem - EM to Total Energy Fraction",20,0,1.2);
00068       meCastorTowerEta   =  m_dbe->book1D("CASTOR Tower Eta","CASTOR Tower Eta",42,-7,7);
00069       meCastorTowerPhi   =  m_dbe->book1D("CASTOR Tower Phi","CASTOR Tower Phi",35,-3.5,3.5);
00070       meCastorTowerDepth =  m_dbe->book1D("CASTOR Tower Depth","CASTOR Tower Depth",200,0,1000); 
00071       meCastorTowerMultiplicity =  m_dbe->book1D("CASTOR Tower Multiplicity","CASTOR Tower Multiplicity",20,0,20); 
00072       
00073       
00075       meCastorJetEnergy    =  m_dbe->book1D("CASTOR BasicJet Total Energy","CASTOR BasicJet Total Energy",200,0,2000);
00076       meCastorJetEta   =  m_dbe->book1D("CASTOR BasicJet Eta","CASTOR BasicJet Eta",42,-7,7);
00077       meCastorJetPhi   =  m_dbe->book1D("CASTOR BasicJet Phi","CASTOR BasicJet Phi",35,-3.5,3.5);
00078       meCastorJetMultiplicity =  m_dbe->book1D("CASTOR BasicJet Multiplicity","CASTOR BasicJet Multiplicity",16,0,16); 
00079       meCastorJetIDMultiplicity =  m_dbe->book1D("CASTOR JetID Multiplicity","CASTOR JetID Multiplicity",16,0,16); 
00080       //-- add more here.....
00081  
00082    }
00083   
00084   
00085   else{ 
00086    if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup - NO DQMStore service" << std::endl; 
00087   }
00088 
00089   if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::setup (end)" << std::endl;
00090   
00091 
00092   return;
00093 }
00094 
00095 
00096 
00097 
00098 //=============================================================================//
00099 //=========================== processEvent for Towers  ========================//
00100 //============================================================================//
00101 
00102 void  CastorTowerJetMonitor::processEventTowers(const reco::CastorTowerCollection& castorTowers)
00103 {
00104   
00105   
00106  if(fVerbosity>0) 
00107    std::cout << "==>CastorTowerJetMonitor::processEventTowers !!!"<< std::endl;
00108 
00109 
00110   if(!m_dbe) { 
00111     if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventTowers DQMStore is not instantiated!!!"<<std::endl;  
00112     return; 
00113   }
00114 
00115   meEVT_->Fill(ievt_);
00116 
00118   nTowers=0; 
00119 
00123    
00124    if(castorTowers.size()>0){
00125  
00126   //for (size_t l=0; l<castorTowers.size() ; l++) 
00127 
00128 
00129   for(reco::CastorTowerCollection::const_iterator iTower= castorTowers.begin();  iTower!= castorTowers.end(); iTower++) {
00130 
00132       energyTower = iTower->energy();    
00134      emEnergyTower = iTower->emEnergy();  
00136       hadEnergyTower=iTower->hadEnergy();  
00138       femTower=iTower->fem();
00140       etaTower=iTower->eta(); 
00142       phiTower=iTower->phi();
00144       depthTower=iTower->depth(); 
00145       
00146       
00147       if (energyTower>0) {  //-- just a check
00148         
00150       meCastorTowerEnergy->Fill(energyTower);
00151       meCastorTowerEMEnergy->Fill(emEnergyTower);
00152       meCastorTowerHADEnergy->Fill(hadEnergyTower);
00153       meCastorTowerFEM->Fill(femTower);
00154       meCastorTowerEta->Fill(etaTower);
00155       meCastorTowerPhi->Fill(phiTower);
00156       meCastorTowerDepth->Fill(depthTower);
00157         
00158       nTowers++;
00159      }
00160     }
00161   meCastorTowerMultiplicity->Fill(nTowers);
00162    }
00163    
00164    
00165      else {
00166     if(fVerbosity>0) std::cout << "CastorTowerJetMonitor::processEvent NO Castor Towers !!!" << std::endl;
00167   }
00168      
00169    ievt_++;
00170 
00171   return;
00172 }
00173 
00174 
00175 
00176 //=============================================================================//
00177 //=========================== processEvent for BasicJets  =====================//
00178 //============================================================================//
00179 
00180 void  CastorTowerJetMonitor::processEventJets(const  reco::BasicJet& castorBasicJets){
00181   
00182  if(fVerbosity>0) 
00183    std::cout << "==>CastorTowerJetMonitor::processEventJets !!!"<< std::endl;
00184    
00185   if(!m_dbe) { 
00186     if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventJets DQMStore is not instantiated!!!"<<std::endl;  
00187     return; 
00188   }
00189 
00190    nJets=0; 
00192    for(reco::BasicJet::const_iterator ibegin = castorBasicJets.begin(), iend = castorBasicJets.end(), ijet = ibegin; ijet!= iend; ++ijet) {
00193      idx = ijet - ibegin;
00194      nJets++;
00195      //-- leave it empty for now - no time now...
00196      //-- add new stuff here...
00197     }
00198    meCastorJetMultiplicity->Fill(nJets);
00199 
00200     return;
00201 }  
00202 
00203 
00204 //============================================================================//
00205 //=========================== processEvent for JetIDs  =======================//
00206 //============================================================================//
00207 
00208 void  CastorTowerJetMonitor::processEventJetIDs(const reco::CastorJetIDValueMap& castorJetIDs){
00209 
00210 
00211  if(fVerbosity>0) 
00212    std::cout << "==>CastorTowerJetMonitor::processEventJetIDs !!!"<< std::endl;   
00213 
00214  if(!m_dbe) { 
00215     if(fVerbosity>0) std::cout<<"CastorTowerJetMonitor::processEventJetIDs DQMStore is not instantiated!!!"<<std::endl;  
00216     return; 
00217   }  
00218 
00219   nJetIDs=0;
00220 
00222    for(reco::CastorJetIDValueMap::const_iterator iJetID= castorJetIDs.begin();   iJetID!= castorJetIDs.end(); iJetID++) {
00223     //-- leave it empty for now - no time now...  
00224     //-- add new stuff here
00225     nJetIDs++;
00226    }
00227   meCastorJetIDMultiplicity->Fill(nJetIDs);
00228     
00229   
00230   return;
00231 }
00232   
00233 
00234