CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiStripApvGainsDQM Class Reference

#include <SiStripApvGainsDQM.h>

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

Private Attributes

edm::ESHandle< SiStripApvGaingainHandle_

Detailed Description

Definition at line 13 of file SiStripApvGainsDQM.h.


Constructor & Destructor Documentation

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

Definition at line 8 of file SiStripApvGainsDQM.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","MeanApvGain_TkMap",0.);

}
SiStripApvGainsDQM::~SiStripApvGainsDQM ( ) [virtual]

Definition at line 19 of file SiStripApvGainsDQM.cc.

{}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 48 of file SiStripApvGainsDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), SiStripBaseCondObjDQM::fPSet_, gainHandle_, SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::hPSet_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, and SiStripBaseCondObjDQM::reader.

Referenced by fillModMEs().

                                                                          {
  
  std::vector<uint32_t> DetIds;
  gainHandle_->getDetIds(DetIds);

  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
  
  int nApv =  reader->getNumberOfApvsAndStripLength(selDetId_).first;
    
  getModMEs(selModME_,selDetId_);
 
  for( int iapv=0;iapv<nApv;++iapv){
      if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
        selModME_.ProfileDistr->Fill(iapv+1,gainHandle_->getApvGain(iapv,gainRange));
      }
      if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
        selModME_.CumulDistr  ->Fill(gainHandle_->getApvGain(iapv,gainRange));
      }

    // Fill the TkMap
    if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
      fillTkMap(selDetId_, gainHandle_->getApvGain(iapv,gainRange));
    }

  }
}
void SiStripApvGainsDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
) [virtual]

Implements SiStripBaseCondObjDQM.

Definition at line 109 of file SiStripApvGainsDQM.cc.

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

Referenced by fillSummaryMEs().

                                                                                                {
    
  int subdetectorId_ = ((selDetId_>>25)&0x7);
  
  if( subdetectorId_<3 ||subdetectorId_>6 ){ 
    edm::LogError("SiStripApvGainsDQM")
      << "[SiStripApvGainsDQM::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_);
  
  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
  int nApv =  reader->getNumberOfApvsAndStripLength(selDetId_).first;
  
  float meanApvGain=0;

  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 iapv=0;iapv<nApv;++iapv){
    
        meanApvGain = meanApvGain +gainHandle_ ->getApvGain(iapv,gainRange);
        selME_.SummaryOfProfileDistr->Fill(iapv+1,gainHandle_->getApvGain(iapv,gainRange));

    // Fill the TkMap
    if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
      fillTkMap(selDetId_, gainHandle_->getApvGain(iapv,gainRange));
    }

    }// iapv

    meanApvGain  = meanApvGain/nApv;

    // Fill the TkHistoMap with meanApvgain:
    if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);

  }//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, 
                                                "") ;


    // 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;}
    }

    for( int iapv=0;iapv<nApv;++iapv){
        meanApvGain = meanApvGain +gainHandle_ ->getApvGain(iapv,gainRange);
        selME_.SummaryDistr->Fill(iBin,gainHandle_->getApvGain(iapv,gainRange));
    }//iapv
    meanApvGain  = meanApvGain/nApv;

    // Fill the TkHistoMap with meanApvgain:
    //    if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);

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

Reimplemented from SiStripBaseCondObjDQM.

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 76 of file SiStripApvGainsDQM.cc.

References alignmentValidation::c1, 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")){

      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 SiStripApvGainsDQM::getActiveDetIds ( const edm::EventSetup eSetup) [virtual]
unsigned long long SiStripApvGainsDQM::getCache ( const edm::EventSetup eSetup) [inline, virtual]

Implements SiStripBaseCondObjDQM.

Definition at line 32 of file SiStripApvGainsDQM.h.

References edm::EventSetup::get().

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

Member Data Documentation