CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiStripPedestalsDQM Class Reference

#include <SiStripPedestalsDQM.h>

Inheritance diagram for SiStripPedestalsDQM:
SiStripBaseCondObjDQM

List of all members.

Public Member Functions

void fillMEsForDet (ModMEs selModME_, uint32_t selDetId_)
void fillMEsForLayer (std::map< uint32_t, ModMEs > selModMEsMap_, uint32_t selDetId_)
void fillModMEs (const std::vector< uint32_t > &selectedDetIds)
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds)
void getActiveDetIds (const edm::EventSetup &eSetup)
unsigned long long getCache (const edm::EventSetup &eSetup)
void getConditionObject (const edm::EventSetup &eSetup)
 SiStripPedestalsDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
virtual ~SiStripPedestalsDQM ()

Private Attributes

edm::ESHandle< SiStripPedestalspedestalHandle_

Detailed Description

Definition at line 13 of file SiStripPedestalsDQM.h.


Constructor & Destructor Documentation

SiStripPedestalsDQM::SiStripPedestalsDQM ( const edm::EventSetup eSetup,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 6 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::HistoMaps_On_, and SiStripBaseCondObjDQM::Tk_HM_.

                                                                      :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){

  // Build the Histo_TkMap:
  if(HistoMaps_On_ ) Tk_HM_ = new TkHistoMap("SiStrip/Histo_Map","MeanPed_TkMap",0.);
}
SiStripPedestalsDQM::~SiStripPedestalsDQM ( ) [virtual]

Definition at line 18 of file SiStripPedestalsDQM.cc.

{}

Member Function Documentation

void SiStripPedestalsDQM::fillMEsForDet ( ModMEs  selModME_,
uint32_t  selDetId_ 
) [virtual]

Implements SiStripBaseCondObjDQM.

Definition at line 51 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, MonitorElement::Fill(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), pedestalHandle_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, SiStripBaseCondObjDQM::reader, and cms::Exception::what().

Referenced by fillModMEs().

                                                                           {
  
  getModMEs(selModME_,selDetId_);
  
  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
  int nStrip =  reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
  
  for( int istrip=0;istrip<nStrip;++istrip){
    try{      
      if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
        selModME_.ProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
      }
    } 
    catch(cms::Exception& e){
      edm::LogError("SiStripPedestalsDQM")          
        << "[SiStripPedestalsDQM::fillMEsForDet] cms::Exception accessing pedestalHandle_->getPed(istrip,pedRange) for strip "  
        << istrip 
        << " and detid " 
        << selDetId_  
        << " :  " 
        << e.what() ;
    }
  }// istrip
  
}    
void SiStripPedestalsDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
) [virtual]

Implements SiStripBaseCondObjDQM.

Definition at line 122 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), MonitorElement::Fill(), TkHistoMap::fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, i, pedestalHandle_, SiStripBaseCondObjDQM::reader, edm::second(), SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::Tk_HM_, and cms::Exception::what().

Referenced by fillSummaryMEs().

                                                                                                 {

  // ----
  int subdetectorId_ = ((selDetId_>>25)&0x7);
    
  if( subdetectorId_<3 || subdetectorId_>6 ){ 
    edm::LogError("SiStripPedestalsDQM")
      << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
      << subdetectorId_ << " no folder set!" 
      << std::endl;
    return;
  }
  // ----

//     // Cumulative distribution with average Ped value on a layer (not needed):  
     
  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = selMEsMap_.find(getLayerNameAndId(selDetId_).second);
  ModMEs selME_;
  selME_ =selMEsMapIter_->second;
  getSummaryMEs(selME_,selDetId_);
    
  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
  
  int nStrip =  reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
  
  SiStripHistoId hidmanager;

   if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
  
     // --> profile summary    
  
     std::string hSummaryOfProfile_description;
     hSummaryOfProfile_description  = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
  
     std::string hSummaryOfProfile_name; 
  
  
    hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description, 
                                                         "layer", 
                                                         getLayerNameAndId(selDetId_).first, 
                                                         "") ;
 
    for( int istrip=0;istrip<nStrip;++istrip){
    
      try{ 
        if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
          selME_.SummaryOfProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
        }
      }
      catch(cms::Exception& e){
        edm::LogError("SiStripPedestalsDQM")          
          << "[SiStripPedestalsDQM::fillMEsForLayer] cms::Exception accessing pedestalHandle_->getPed(istrip,pedRange) for strip "  
          << istrip 
          << " and detid " 
          << selDetId_  
          << " :  " 
          << e.what() ;
      }

      //fill the TkMap
    if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
      fillTkMap(selDetId_, pedestalHandle_->getPed(istrip,pedRange));
    }

    }// istrip  
   }//if Fill ...

  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){

    // -->  summary  
  
    std::string hSummary_description;
    hSummary_description  = hPSet_.getParameter<std::string>("Summary_description");
  
    std::string hSummary_name; 
    hSummary_name = hidmanager.createHistoLayer(hSummary_description, 
                                                "layer", 
                                                getLayerNameAndId(selDetId_).first, 
                                                "") ;
    float meanPedestal=0;
  
    for( int istrip=0;istrip<nStrip;++istrip){
    
      try{
        meanPedestal = meanPedestal + pedestalHandle_->getPed(istrip,pedRange);
      }
      catch(cms::Exception& e){
        edm::LogError("SiStripNoisesDQM")          
          << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing pedestalHandle_->getPed(istrip,pedRange) for strip "  
          << istrip 
          << "and detid " 
          << selDetId_  
          << " :  " 
          << e.what() ;      
      }
    
    }//istrip
  
    meanPedestal = meanPedestal/nStrip;


    // -----
    // get detIds belonging to same layer to fill X-axis with detId-number
  
    std::vector<uint32_t> sameLayerDetIds_;
  
    sameLayerDetIds_.clear();

    sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_);
  
  
    unsigned int iBin=0;
    for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
      if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
    }   
  
    selME_.SummaryDistr->Fill(iBin,meanPedestal);

    // Fill the Histo_TkMap with the mean Pedestal:
    if(HistoMaps_On_ ) Tk_HM_->fill(selDetId_, meanPedestal);


  }//if Fill ...
  
  
  
} 
void SiStripPedestalsDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds) [virtual]

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 33 of file SiStripPedestalsDQM.cc.

References fillMEsForDet().

                                                                              {
   
  ModMEs CondObj_ME;
  
  
  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
      detIter_!= selectedDetIds.end();detIter_++){
      
    fillMEsForDet(CondObj_ME,*detIter_);
      
  }
}    
void SiStripPedestalsDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds) [virtual]

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 81 of file SiStripPedestalsDQM.cc.

References alignmentValidation::c1, SiStripBaseCondObjDQM::CondObj_fillId_, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, edm::ParameterSet::getParameter(), MonitorElement::getTH1(), MonitorElement::getTProfile(), SiStripBaseCondObjDQM::hPSet_, mergeVDriftHistosByStation::name, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr.

                                                                                  {
   
  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
      detIter_!= selectedDetIds.end();detIter_++){
    fillMEsForLayer(SummaryMEsMap_, *detIter_);
  }

  for (std::map<uint32_t, ModMEs>::iterator iter=SummaryMEsMap_.begin(); iter!=SummaryMEsMap_.end(); iter++){

    ModMEs selME;
    selME = iter->second;

    if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")){

      if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){

        TCanvas c1("c1");
        selME.SummaryOfProfileDistr->getTProfile()->Draw();
        std::string name (selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
        name+=".png";
        c1.Print(name.c_str());
      }
    }
    if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")){

      TCanvas c1("c1");
      selME.SummaryDistr->getTH1()->Draw();
      std::string name (selME.SummaryDistr->getTH1()->GetTitle());
      name+=".png";
      c1.Print(name.c_str());
    }

  }

}           
void SiStripPedestalsDQM::getActiveDetIds ( const edm::EventSetup eSetup) [virtual]
unsigned long long SiStripPedestalsDQM::getCache ( const edm::EventSetup eSetup) [inline, virtual]

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripPedestalsDQM.h.

References edm::EventSetup::get().

{ return eSetup.get<SiStripPedestalsRcd>().cacheIdentifier();}
void SiStripPedestalsDQM::getConditionObject ( const edm::EventSetup eSetup) [inline, virtual]

Member Data Documentation