CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiStripThresholdDQM Class Reference

#include <SiStripThresholdDQM.h>

Inheritance diagram for SiStripThresholdDQM:
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)
 SiStripThresholdDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
virtual ~SiStripThresholdDQM ()

Private Attributes

edm::ESHandle< SiStripThresholdthresholdHandle_
std::string WhichThreshold

Detailed Description

Definition at line 13 of file SiStripThresholdDQM.h.


Constructor & Destructor Documentation

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

Definition at line 7 of file SiStripThresholdDQM.cc.

References edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::Tk_HM_H, SiStripBaseCondObjDQM::Tk_HM_L, and WhichThreshold.

                                                                      :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){
  WhichThreshold=hPSet.getParameter<std::string>("WhichThreshold");

  // Build the Histo_TkMap:
  if(HistoMaps_On_ ){
    if(WhichThreshold=="Low") Tk_HM_L = new TkHistoMap("SiStrip/Histo_Map","LowThresh_TkMap",0.);
    if(WhichThreshold=="High") Tk_HM_H = new TkHistoMap("SiStrip/Histo_Map","HighThresh_TkMap",0.);
  }
}
SiStripThresholdDQM::~SiStripThresholdDQM ( ) [virtual]

Definition at line 24 of file SiStripThresholdDQM.cc.

{}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 61 of file SiStripThresholdDQM.cc.

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

Referenced by fillModMEs().

                                                                           {

  std::vector<uint32_t> DetIds;
  thresholdHandle_->getDetIds(DetIds);
    
 
  SiStripThreshold::Range ThresholdRange = thresholdHandle_->getRange(selDetId_);
  int nStrip =  reader->getNumberOfApvsAndStripLength(selDetId_).first*128;


    getModMEs(selModME_,selDetId_);


    
  for( int istrip=0;istrip<nStrip;++istrip){
    try{      
      if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
        if(WhichThreshold=="Low")
          selModME_.ProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getLth());
        if(WhichThreshold=="High")
          selModME_.ProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getHth());
      }
    } 
    catch(cms::Exception& e){
      edm::LogError("SiStripThresholdDQM")          
        << "[SiStripThresholdDQM::fillMEsForDet] cms::Exception accessing thresholdHandle_->getData(istrip,ThresholdRange) for strip "  
        << istrip 
        << " and detid " 
        << selDetId_  
        << " :  " 
        << e.what() ;
    }
  }// istrip
  
    
} 
void SiStripThresholdDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
) [virtual]

Implements SiStripBaseCondObjDQM.

Definition at line 119 of file SiStripThresholdDQM.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, SiStripBaseCondObjDQM::reader, edm::second(), SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, thresholdHandle_, SiStripBaseCondObjDQM::Tk_HM_H, SiStripBaseCondObjDQM::Tk_HM_L, cms::Exception::what(), and WhichThreshold.

Referenced by fillSummaryMEs().

                                                                                                 {

  // ----
  int subdetectorId_ = ((selDetId_>>25)&0x7);
    
  if( subdetectorId_<3 || subdetectorId_>6 ){ 
    edm::LogError("SiStripThresholdDQM")
      << "[SiStripThresholdDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
      << subdetectorId_ << " no folder set!" 
      << std::endl;
    return;
  }
  // ----
     
   std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = selMEsMap_.find(getLayerNameAndId(selDetId_).second);
   ModMEs selME_;
   selME_ =selMEsMapIter_->second;
   getSummaryMEs(selME_,selDetId_);

    
   SiStripThreshold::Range ThresholdRange = thresholdHandle_->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"){
          if(WhichThreshold=="Low"){
            selME_.SummaryOfProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getLth());
            if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) fillTkMap(selDetId_, thresholdHandle_->getData(istrip,ThresholdRange).getLth());
          }
          if(WhichThreshold=="High"){
            selME_.SummaryOfProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getHth());
            if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) fillTkMap(selDetId_, thresholdHandle_->getData(istrip,ThresholdRange).getHth());
          }
        }
      } 
      catch(cms::Exception& e){
        edm::LogError("SiStripThresholdDQM")          
          << "[SiStripThresholdDQM::fillMEsForLayer] cms::Exception accessing thresholdHandle_->getData(istrip,ThresholdRange) for strip "  
          << istrip 
          << " and detid " 
          << selDetId_  
          << " :  " 
          << e.what() ;
      }
    }// 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 meanLowThreshold=0;
    float meanHighThreshold=0;
  
    for( int istrip=0;istrip<nStrip;++istrip){
    
      try{
        meanLowThreshold = meanLowThreshold + thresholdHandle_->getData(istrip,ThresholdRange).getLth();
        meanHighThreshold = meanHighThreshold + thresholdHandle_->getData(istrip,ThresholdRange).getHth();
      }
      catch(cms::Exception& e){
        edm::LogError("SiStripNoisesDQM")          
          << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing thresholdHandle_->getThreshold(istrip,ThresholdRange) for strip "  
          << istrip 
          << "and detid " 
          << selDetId_  
          << " :  " 
          << e.what() ;      
      }
    
    }//istrip
  
  
    meanLowThreshold = meanLowThreshold/nStrip;
    meanHighThreshold = meanHighThreshold/nStrip;
  
  
    // -----
    // get detIds belonging to same layer to fill X-axis with detId-number
  
    std::vector<uint32_t> sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_);
  
    unsigned int iBin=0;
    for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
      if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
    }   
  
    if(WhichThreshold=="Low"){
      selME_.SummaryDistr->Fill(iBin,meanLowThreshold);
      if(HistoMaps_On_ ) Tk_HM_L->fill(selDetId_, meanLowThreshold);
    }
    if(WhichThreshold=="High"){
      selME_.SummaryDistr->Fill(iBin,meanHighThreshold);
      if(HistoMaps_On_ )Tk_HM_H->fill(selDetId_, meanHighThreshold);
    }
  
  }//if Fill ...
  


}  
void SiStripThresholdDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds) [virtual]

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 40 of file SiStripThresholdDQM.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 SiStripThresholdDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds) [virtual]

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 105 of file SiStripThresholdDQM.cc.

References fillMEsForLayer(), and SiStripBaseCondObjDQM::SummaryMEsMap_.

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripThresholdDQM.h.

References edm::EventSetup::get().

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

Member Data Documentation

std::string SiStripThresholdDQM::WhichThreshold [private]

Definition at line 40 of file SiStripThresholdDQM.h.

Referenced by fillMEsForDet(), fillMEsForLayer(), and SiStripThresholdDQM().