CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DQM/SiPixelMonitorClient/src/SiPixelDcsInfo.cc

Go to the documentation of this file.
00001 #include "DQM/SiPixelMonitorClient/interface/SiPixelDcsInfo.h"
00002 //#include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00003 #include "CondFormats/RunInfo/interface/RunInfo.h"
00004 #include "CondFormats/RunInfo/interface/RunSummary.h"
00005 #include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
00006 
00007 using namespace std;
00008 using namespace edm;
00009 SiPixelDcsInfo::SiPixelDcsInfo(const edm::ParameterSet& ps) {
00010  
00011 //  DCSPixelRange_.first  = ps.getUntrackedParameter<unsigned int>("MinimumPixelDcsChannel", 0);
00012 //  DCSPixelRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumPixelDcsChannel", 39);
00013   
00014 //  NumberOfDcsChannels_ =DCSPixelRange_.second -  DCSPixelRange_.first +1;
00015   NumberOfDcsChannels_ = 100;
00016 }
00017 
00018 SiPixelDcsInfo::~SiPixelDcsInfo(){}
00019 
00020 void SiPixelDcsInfo::beginLuminosityBlock(const LuminosityBlock& lumiBlock, const  EventSetup& iSetup){}
00021 
00022 
00023 void SiPixelDcsInfo::endLuminosityBlock(const edm::LuminosityBlock&  lumiBlock, const  edm::EventSetup& iSetup){
00024   edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("RunInfoRcd"));
00025   if(0 != iSetup.find( recordKey ) ) {
00026     // cout<<"record key found"<<endl;
00027     //get DCS channel information
00028 //    ESHandle<RunInfo> sumDCS;
00029 //    iSetup.get<RunInfoRcd>().get(sumDCS);    
00030 //    vector<int> DcsChannelsInIds= sumDCS->m_dcs_in;   
00031 
00032 /*    int DcsCount=0;
00033     int DcsCountBarrel=0;
00034     int DcsCountEndcap=0;
00035 */
00036     //loop on all active DCS channels
00037 /*    for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
00038       int fedID=FedsInIds[fedItr];
00039       //make sure fed id is in allowed range  
00040       //cout<<fedID<<endl;   
00041       if(fedID>=FEDRange_.first && fedID<=FEDRange_.second){
00042         ++FedCount;
00043         if(fedID>=0 && fedID<=31){
00044           ++FedCountBarrel;
00045         }else if(fedID>=32 && fedID<=39){
00046           ++FedCountEndcap;
00047         }
00048       }
00049     }   
00050 */
00051     //Fill active dcs fraction ME's
00052 //    if(NumberOfFeds_>0){
00053       //all Pixel:
00054       Fraction_->Fill(1.);
00055       //Barrel:
00056       FractionBarrel_->Fill(1.);
00057       //Endcap:
00058       FractionEndcap_->Fill(1.);
00059 /*    }else{
00060       Fraction_->Fill(-1);
00061       FractionBarrel_->Fill(-1);
00062       FractionEndcap_->Fill(-1);
00063     }
00064 
00065   }else{      
00066     Fraction_->Fill(-1);    
00067     FractionBarrel_->Fill(-1);
00068     FractionEndcap_->Fill(-1);
00069 */ 
00070     return; 
00071   }
00072 }
00073 
00074 void SiPixelDcsInfo::endRun(const edm::Run&  r, const  edm::EventSetup& iSetup){
00075   edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("RunInfoRcd"));
00076   if(0 != iSetup.find( recordKey ) ) {
00077     // cout<<"record key found"<<endl;
00078     //get DCS channel information
00079 //    ESHandle<RunInfo> sumDCS;
00080 //    iSetup.get<RunInfoRcd>().get(sumDCS);    
00081 //    vector<int> DcsChannelsInIds= sumDCS->m_dcs_in;   
00082 
00083 /*    int DcsCount=0;
00084     int DcsCountBarrel=0;
00085     int DcsCountEndcap=0;
00086 */
00087     //loop on all active DCS channels
00088 /*    for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
00089       int fedID=FedsInIds[fedItr];
00090       //make sure fed id is in allowed range  
00091       //cout<<fedID<<endl;   
00092       if(fedID>=FEDRange_.first && fedID<=FEDRange_.second){
00093         ++FedCount;
00094         if(fedID>=0 && fedID<=31){
00095           ++FedCountBarrel;
00096         }else if(fedID>=32 && fedID<=39){
00097           ++FedCountEndcap;
00098         }
00099       }
00100     }   
00101 */
00102     //Fill active dcs fraction ME's
00103 //    if(NumberOfFeds_>0){
00104       //all Pixel:
00105       Fraction_->Fill(1.);
00106       //Barrel:
00107       FractionBarrel_->Fill(1.);
00108       //Endcap:
00109       FractionEndcap_->Fill(1.);
00110 /*    }else{
00111       Fraction_->Fill(-1);
00112       FractionBarrel_->Fill(-1);
00113       FractionEndcap_->Fill(-1);
00114     }
00115 
00116   }else{      
00117     Fraction_->Fill(-1);    
00118     FractionBarrel_->Fill(-1);
00119     FractionEndcap_->Fill(-1);
00120 */ 
00121     return; 
00122   }
00123 }
00124 
00125 
00126 void SiPixelDcsInfo::beginJob(){
00127 
00128   dbe_ = 0;
00129   dbe_ = Service<DQMStore>().operator->();
00130   
00131  
00132   dbe_->setCurrentFolder("Pixel/EventInfo");
00133   Fraction_= dbe_->bookFloat("DCSSummary");  
00134   dbe_->setCurrentFolder("Pixel/EventInfo/DCSContents");
00135   FractionBarrel_= dbe_->bookFloat("PixelBarrelFraction");  
00136   FractionEndcap_= dbe_->bookFloat("PixelEndcapFraction");  
00137 }
00138 
00139 
00140 void SiPixelDcsInfo::endJob() {}
00141 
00142 
00143 
00144 void SiPixelDcsInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){}
00145