#include <DQM/SiStripMonitorSummary/interface/SiStripNoisesDQM.h>
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) |
SiStripNoisesDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet) | |
virtual | ~SiStripNoisesDQM () |
Private Attributes | |
edm::ESHandle< SiStripApvGain > | gainHandle_ |
bool | gainRenormalisation_ |
edm::ESHandle< SiStripNoises > | noiseHandle_ |
Definition at line 14 of file SiStripNoisesDQM.h.
SiStripNoisesDQM::SiStripNoisesDQM | ( | const edm::EventSetup & | eSetup, | |
edm::ParameterSet const & | hPSet, | |||
edm::ParameterSet const & | fPSet | |||
) |
Definition at line 7 of file SiStripNoisesDQM.cc.
References gainHandle_, gainRenormalisation_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), and SiStripBaseCondObjDQM::hPSet_.
00009 :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){ 00010 gainRenormalisation_ = hPSet_.getParameter<bool>("GainRenormalisation"); 00011 if( gainRenormalisation_){ eSetup.get<SiStripApvGainRcd>().get(gainHandle_);} 00012 }
SiStripNoisesDQM::~SiStripNoisesDQM | ( | ) | [virtual] |
Definition at line 45 of file SiStripNoisesDQM.cc.
References SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, e, MonitorElement::Fill(), gainHandle_, gainRenormalisation_, SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), noiseHandle_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, SiStripBaseCondObjDQM::reader, and cms::Exception::what().
Referenced by fillModMEs().
00045 { 00046 00047 std::vector<uint32_t> DetIds; 00048 noiseHandle_->getDetIds(DetIds); 00049 00050 SiStripNoises::Range noiseRange = noiseHandle_->getRange(selDetId_); 00051 00052 int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128; 00053 00054 getModMEs(selModME_,selDetId_); 00055 00056 float gainFactor; 00057 00058 for( int istrip=0;istrip<nStrip;++istrip){ 00059 try{ 00060 if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){ 00061 if( gainRenormalisation_){ 00062 SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_); 00063 gainFactor= gainHandle_ ->getStripGain(istrip,gainRange); 00064 selModME_.ProfileDistr->Fill(istrip+1,noiseHandle_->getNoise(istrip,noiseRange)/gainFactor); 00065 } 00066 else{ 00067 selModME_.ProfileDistr->Fill(istrip+1,noiseHandle_->getNoise(istrip,noiseRange)); 00068 } 00069 } 00070 if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){ 00071 if( gainRenormalisation_){ 00072 SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_); 00073 gainFactor= gainHandle_ ->getStripGain(istrip,gainRange); 00074 selModME_.CumulDistr->Fill(noiseHandle_->getNoise(istrip,noiseRange)/gainFactor); 00075 } 00076 else { 00077 selModME_.CumulDistr ->Fill(noiseHandle_->getNoise(istrip,noiseRange)); 00078 } 00079 } 00080 } 00081 catch(cms::Exception& e){ 00082 edm::LogError("SiStripNoisesDQM") 00083 << "[SiStripNoisesDQM::fillMEsForDet] cms::Exception accessing noiseHandle_->getNoise(istrip,noiseRange) for strip " 00084 << istrip 00085 << " and detid " 00086 << selDetId_ 00087 << " : " 00088 << e.what() ; 00089 } 00090 } 00091 }
void SiStripNoisesDQM::fillMEsForLayer | ( | std::map< uint32_t, ModMEs > | selModMEsMap_, | |
uint32_t | selDetId_ | |||
) |
Cumulative distr. for Noise:
Definition at line 106 of file SiStripNoisesDQM.cc.
References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), e, lat::endl(), MonitorElement::Fill(), first, gainHandle_, gainRenormalisation_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getStringNameAndId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::hPSet_, i, noiseHandle_, SiStripBaseCondObjDQM::reader, edm::second(), SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfCumulDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, and cms::Exception::what().
Referenced by fillSummaryMEs().
00106 { 00107 00108 // ---- 00109 int subdetectorId_ = ((selDetId_>>25)&0x7); 00110 00111 if( subdetectorId_<3 ||subdetectorId_>6 ){ 00112 edm::LogError("SiStripNoisesDQM") 00113 << "[SiStripNoisesDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : " 00114 << subdetectorId_ << " no folder set!" 00115 << std::endl; 00116 return; 00117 } 00118 // ---- 00119 00120 std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = selMEsMap_.find(getLayerNameAndId(selDetId_).second); 00121 ModMEs selME_; 00122 selME_ =selMEsMapIter_->second; 00123 getSummaryMEs(selME_,selDetId_); 00124 00125 SiStripNoises::Range noiseRange = noiseHandle_->getRange(selDetId_); 00126 int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128; 00127 00128 SiStripHistoId hidmanager; 00129 float gainFactor=1; 00130 00131 if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){ 00132 // --> profile summary 00133 std::string hSummaryOfProfile_description; 00134 hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description"); 00135 00136 std::string hSummaryOfProfile_name; 00137 hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description, 00138 "layer", 00139 getLayerNameAndId(selDetId_).first, 00140 "") ; 00141 for( int istrip=0;istrip<nStrip;++istrip){ 00142 00143 try{ 00144 if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){ 00145 if(gainRenormalisation_ ){ 00146 SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_); 00147 gainFactor= gainHandle_ ->getStripGain(istrip,gainRange); 00148 selME_.SummaryOfProfileDistr->Fill(istrip+1,noiseHandle_->getNoise(istrip,noiseRange)/gainFactor); 00149 } 00150 else{ 00151 selME_.SummaryOfProfileDistr->Fill(istrip+1,noiseHandle_->getNoise(istrip,noiseRange)); 00152 } 00153 } 00154 } 00155 catch(cms::Exception& e){ 00156 edm::LogError("SiStripNoisesDQM") 00157 << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing noiseHandle_->getNoise(istrip,noiseRange) for strip " 00158 << istrip 00159 << " and detid " 00160 << selDetId_ 00161 << " : " 00162 << e.what() ; 00163 } 00164 }// istrip 00165 }//if fill 00166 00167 if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){ 00168 // --> cumul summary 00169 std::string hSummary_description; 00170 hSummary_description = hPSet_.getParameter<std::string>("Summary_description"); 00171 00172 std::string hSummary_name; 00173 hSummary_name = hidmanager.createHistoLayer(hSummary_description, 00174 "layer", 00175 getLayerNameAndId(selDetId_).first, 00176 "") ; 00177 gainFactor=1; 00178 00179 float meanNoise=0; 00180 00181 for( int istrip=0;istrip<nStrip;++istrip){ 00182 00183 if( gainRenormalisation_){ 00184 SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_); 00185 gainFactor= gainHandle_ ->getStripGain(istrip,gainRange); 00186 try{ 00187 meanNoise = meanNoise +noiseHandle_->getNoise(istrip,noiseRange)/gainFactor; 00188 } 00189 catch(cms::Exception& e){ 00190 edm::LogError("SiStripNoisesDQM") 00191 << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing noiseHandle_->getNoise(istrip,noiseRange) for strip " 00192 << istrip 00193 << "and detid " 00194 << selDetId_ 00195 << " : " 00196 << e.what() ; 00197 } 00198 } 00199 else { 00200 try{ 00201 meanNoise = meanNoise +noiseHandle_->getNoise(istrip,noiseRange)/gainFactor; 00202 } 00203 catch(cms::Exception& e){ 00204 edm::LogError("SiStripNoisesDQM") 00205 << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing noiseHandle_->getNoise(istrip,noiseRange) for strip " 00206 << istrip 00207 << "and detid " 00208 << selDetId_ 00209 << " : " 00210 << e.what() ; 00211 } 00212 } 00213 }//istrip 00214 meanNoise = meanNoise/nStrip; 00215 // get detIds belonging to same layer to fill X-axis with detId-number 00216 00217 std::vector<uint32_t> sameLayerDetIds_; 00218 00219 sameLayerDetIds_.clear(); 00220 00221 sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_); 00222 00223 00224 unsigned int iBin=0; 00225 for(unsigned int i=0;i<sameLayerDetIds_.size();i++){ 00226 if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;} 00227 } 00228 selME_.SummaryDistr->Fill(iBin,meanNoise); 00229 00230 00231 }//if fill 00232 00234 if(hPSet_.getParameter<bool>("FillCumulativeSummaryAtLayerLevel")){ 00235 std::string hSummaryOfCumul_description; 00236 hSummaryOfCumul_description = hPSet_.getParameter<std::string>("Cumul_description"); 00237 00238 std::string hSummaryOfCumul_name; 00239 hSummaryOfCumul_name = hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", getStringNameAndId(selDetId_).first, "") ; 00240 00241 for( int istrip=0;istrip<nStrip;++istrip){ 00242 try{ 00243 if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){ 00244 if(gainRenormalisation_){ 00245 SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_); 00246 gainFactor= gainHandle_ ->getStripGain(istrip,gainRange); 00247 selME_.SummaryOfCumulDistr->Fill(noiseHandle_->getNoise(istrip,noiseRange)/gainFactor); 00248 } 00249 else{ 00250 selME_.SummaryOfCumulDistr->Fill(noiseHandle_->getNoise(istrip,noiseRange)); 00251 } 00252 } 00253 } 00254 catch(cms::Exception& e){ 00255 edm::LogError("SiStripNoisesDQM") 00256 << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing noiseHandle_->getNoise(istrip,noiseRange) for strip " 00257 << istrip 00258 << "and detid " 00259 << selDetId_ 00260 << " : " 00261 << e.what() ; 00262 } 00263 }//istrip 00264 }//if fill 00265 // ----- 00266 }
void SiStripNoisesDQM::fillModMEs | ( | const std::vector< uint32_t > & | selectedDetIds | ) | [virtual] |
Implements SiStripBaseCondObjDQM.
Definition at line 32 of file SiStripNoisesDQM.cc.
References fillMEsForDet().
00032 { 00033 00034 ModMEs CondObj_ME; 00035 00036 for(std::vector<uint32_t>::const_iterator detIter_=selectedDetIds.begin(); 00037 detIter_!=selectedDetIds.end();++detIter_){ 00038 fillMEsForDet(CondObj_ME,*detIter_); 00039 } 00040 }
void SiStripNoisesDQM::fillSummaryMEs | ( | const std::vector< uint32_t > & | selectedDetIds | ) | [virtual] |
Implements SiStripBaseCondObjDQM.
Definition at line 94 of file SiStripNoisesDQM.cc.
References fillMEsForLayer(), and SiStripBaseCondObjDQM::SummaryMEsMap_.
00094 { 00095 00096 for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); 00097 detIter_!= selectedDetIds.end();detIter_++){ 00098 fillMEsForLayer(SummaryMEsMap_, *detIter_); 00099 00100 } 00101 }
void SiStripNoisesDQM::getActiveDetIds | ( | const edm::EventSetup & | eSetup | ) | [virtual] |
Implements SiStripBaseCondObjDQM.
Definition at line 21 of file SiStripNoisesDQM.cc.
References SiStripBaseCondObjDQM::activeDetIds, getConditionObject(), noiseHandle_, and SiStripBaseCondObjDQM::selectModules().
00021 { 00022 00023 getConditionObject(eSetup); 00024 noiseHandle_->getDetIds(activeDetIds); 00025 selectModules(activeDetIds); 00026 00027 }
unsigned long long SiStripNoisesDQM::getCache | ( | const edm::EventSetup & | eSetup | ) | [inline, virtual] |
Implements SiStripBaseCondObjDQM.
Definition at line 32 of file SiStripNoisesDQM.h.
References edm::EventSetup::get().
00032 { return eSetup.get<SiStripNoisesRcd>().cacheIdentifier();}
void SiStripNoisesDQM::getConditionObject | ( | const edm::EventSetup & | eSetup | ) | [inline, virtual] |
Implements SiStripBaseCondObjDQM.
Definition at line 34 of file SiStripNoisesDQM.h.
References SiStripBaseCondObjDQM::cacheID_current, SiStripBaseCondObjDQM::cacheID_memory, edm::EventSetup::get(), and noiseHandle_.
Referenced by getActiveDetIds().
00034 { 00035 eSetup.get<SiStripNoisesRcd>().get(noiseHandle_); 00036 cacheID_memory = cacheID_current; 00037 }
Definition at line 42 of file SiStripNoisesDQM.h.
Referenced by fillMEsForDet(), fillMEsForLayer(), and SiStripNoisesDQM().
bool SiStripNoisesDQM::gainRenormalisation_ [private] |
Definition at line 40 of file SiStripNoisesDQM.h.
Referenced by fillMEsForDet(), fillMEsForLayer(), and SiStripNoisesDQM().
Definition at line 41 of file SiStripNoisesDQM.h.
Referenced by fillMEsForDet(), fillMEsForLayer(), getActiveDetIds(), and getConditionObject().