CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripApvGainsDQM Class Reference

#include <SiStripApvGainsDQM.h>

Inheritance diagram for SiStripApvGainsDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es) override
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
unsigned long long getCache (const edm::EventSetup &eSetup) override
 
void getConditionObject (const edm::EventSetup &eSetup) override
 
 SiStripApvGainsDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
 ~SiStripApvGainsDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQM
void analysis (const edm::EventSetup &eSetup_)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, const std::vector< uint32_t > &detIdsOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
 
virtual void end ()
 
std::vector< uint32_t > getCabledModules ()
 
void selectModules (std::vector< uint32_t > &detIds_, const TrackerTopology *tTopo)
 
 SiStripBaseCondObjDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripBaseCondObjDQM ()
 

Private Attributes

edm::ESHandle< SiStripApvGaingainHandle_
 

Additional Inherited Members

- Protected Member Functions inherited from SiStripBaseCondObjDQM
void fillTkMap (const uint32_t &detid, const float &value)
 
std::pair< std::string, uint32_t > getLayerNameAndId (const uint32_t &detId_, const TrackerTopology *tTopo)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
std::vector< uint32_t > GetSameLayerDetId (const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_, const TrackerTopology *tTopo)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
- Protected Attributes inherited from SiStripBaseCondObjDQM
std::vector< uint32_t > activeDetIds
 
std::vector< uint32_t > all_DetIds
 
unsigned long long cacheID_current
 
unsigned long long cacheID_memory
 
std::string CondObj_fillId_
 
std::string CondObj_name_
 
const edm::EventSetupeSetup_
 
edm::ParameterSet fPSet_
 
bool GrandSummary_On_
 
bool HistoMaps_On_
 
edm::ParameterSet hPSet_
 
double maxValue
 
double minValue
 
bool Mod_On_
 
std::map< uint32_t, ModMEsModMEsMap_
 
SiStripDetInfoFileReaderreader
 
std::map< uint32_t, ModMEsSummaryMEsMap_
 
bool SummaryOnLayerLevel_On_
 
bool SummaryOnStringLevel_On_
 
std::unique_ptr< TkHistoMapTk_HM_
 
std::unique_ptr< TkHistoMapTk_HM_H
 
std::unique_ptr< TkHistoMapTk_HM_L
 
TrackerMaptkMap
 
std::vector< int > tkMapScaler
 

Detailed Description

Definition at line 13 of file SiStripApvGainsDQM.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file SiStripApvGainsDQM.cc.

References edm::EventSetup::get(), SiStripBaseCondObjDQM::HistoMaps_On_, edm::ESHandle< T >::product(), and SiStripBaseCondObjDQM::Tk_HM_.

11  :SiStripBaseCondObjDQM(eSetup,iRun,hPSet, fPSet){
12 
13  // Build the Histo_TkMap:
14  if ( HistoMaps_On_ ) {
15  edm::ESHandle<TkDetMap> tkDetMapHandle;
16  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
17  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "SiStrip/Histo_Map","MeanApvGain_TkMap",0.);
18  }
19 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
T get() const
Definition: EventSetup.h:62
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< TkHistoMap > Tk_HM_
SiStripApvGainsDQM::~SiStripApvGainsDQM ( )
override

Definition at line 23 of file SiStripApvGainsDQM.cc.

23 {}

Member Function Documentation

void SiStripApvGainsDQM::fillMEsForDet ( const ModMEs selModME_,
uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 57 of file SiStripApvGainsDQM.cc.

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

Referenced by fillModMEs().

57  {
58  ModMEs selModME_ = _selModME_;
59  std::vector<uint32_t> DetIds;
60  gainHandle_->getDetIds(DetIds);
61 
62  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
63 
64  int nApv = reader->getNumberOfApvsAndStripLength(selDetId_).first;
65 
66  getModMEs(selModME_,selDetId_, tTopo);
67 
68  for( int iapv=0;iapv<nApv;++iapv){
69  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
70  selModME_.ProfileDistr->Fill(iapv+1,gainHandle_->getApvGain(iapv,gainRange));
71  }
72  if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
73  selModME_.CumulDistr ->Fill(gainHandle_->getApvGain(iapv,gainRange));
74  }
75 
76  // Fill the TkMap
77  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
78  fillTkMap(selDetId_, gainHandle_->getApvGain(iapv,gainRange));
79  }
80 
81  }
82 }
T getParameter(std::string const &) const
static float getApvGain(uint16_t apv, const Range &range)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
void getDetIds(std::vector< uint32_t > &DetIds_) const
void fillTkMap(const uint32_t &detid, const float &value)
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripApvGain > gainHandle_
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
const Range getRange(const uint32_t detID) const
void SiStripApvGainsDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 123 of file SiStripApvGainsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripHistoId::createHistoLayer(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), plotBeamSpotDB::first, SiStripBaseCondObjDQM::fPSet_, gainHandle_, SiStripApvGain::getApvGain(), SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripApvGain::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, mps_fire::i, SiStripBaseCondObjDQM::reader, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

123  {
124 
125  int subdetectorId_ = ((selDetId_>>25)&0x7);
126 
127  if( subdetectorId_<3 ||subdetectorId_>6 ){
128  edm::LogError("SiStripApvGainsDQM")
129  << "[SiStripApvGainsDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
130  << subdetectorId_ << " no folder set!"
131  << std::endl;
132  return;
133  }
134  // ----
135 
136  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_,tTopo).second);
137  ModMEs selME_;
138  if ( selMEsMapIter_ != SummaryMEsMap_.end())
139  selME_ =selMEsMapIter_->second;
140  getSummaryMEs(selME_,selDetId_,tTopo);
141 
142  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
143  int nApv = reader->getNumberOfApvsAndStripLength(selDetId_).first;
144 
145  float meanApvGain=0;
146 
148 
149  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
150 
151  // --> profile summary
152  std::string hSummaryOfProfile_description;
153  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
154 
155  std::string hSummaryOfProfile_name;
156  hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description,
157  "layer",
158  getLayerNameAndId(selDetId_,tTopo).first, "") ;
159 
160  for( int iapv=0;iapv<nApv;++iapv){
161 
162  meanApvGain = meanApvGain +gainHandle_ ->getApvGain(iapv,gainRange);
163  selME_.SummaryOfProfileDistr->Fill(iapv+1,gainHandle_->getApvGain(iapv,gainRange));
164 
165  // Fill the TkMap
166  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
167  fillTkMap(selDetId_, gainHandle_->getApvGain(iapv,gainRange));
168  }
169 
170  }// iapv
171 
172  meanApvGain = meanApvGain/nApv;
173 
174  // Fill the TkHistoMap with meanApvgain:
175  if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);
176 
177  }//if Fill ...
178 
179 
180  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
181 
182  // --> summary
183  std::string hSummary_description;
184  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
185 
186  std::string hSummary_name;
187  hSummary_name = hidmanager.createHistoLayer(hSummary_description,
188  "layer",
189  getLayerNameAndId(selDetId_,tTopo).first,
190  "") ;
191 
192 
193  // get detIds belonging to same layer to fill X-axis with detId-number
194 
195  std::vector<uint32_t> sameLayerDetIds_;
196 
197  sameLayerDetIds_.clear();
198 
199  sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_,tTopo);
200 
201  unsigned int iBin=0;
202  for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
203  if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
204  }
205 
206  for( int iapv=0;iapv<nApv;++iapv){
207  meanApvGain = meanApvGain +gainHandle_ ->getApvGain(iapv,gainRange);
208  selME_.SummaryDistr->Fill(iBin,gainHandle_->getApvGain(iapv,gainRange));
209  }//iapv
210  meanApvGain = meanApvGain/nApv;
211 
212  // Fill the TkHistoMap with meanApvgain:
213  // if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);
214 
215  }//if Fill ...
216 }
T getParameter(std::string const &) const
static float getApvGain(uint16_t apv, const Range &range)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
void fillTkMap(const uint32_t &detid, const float &value)
U second(std::pair< T, U > const &p)
std::map< uint32_t, ModMEs > SummaryMEsMap_
SiStripDetInfoFileReader * reader
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripApvGain > gainHandle_
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo)
std::vector< uint32_t > activeDetIds
const Range getRange(const uint32_t detID) const
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::unique_ptr< TkHistoMap > Tk_HM_
void SiStripApvGainsDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 40 of file SiStripApvGainsDQM.cc.

References fillMEsForDet(), edm::EventSetup::get(), and edm::ESHandle< T >::product().

40  {
41 
42  //Retrieve tracker topology from geometry
44  es.get<TrackerTopologyRcd>().get(tTopoHandle);
45  const TrackerTopology* const tTopo = tTopoHandle.product();
46 
47  ModMEs CondObj_ME;
48 
49  for(std::vector<uint32_t>::const_iterator detIter_ =selectedDetIds.begin();
50  detIter_!=selectedDetIds.end();++detIter_){
51  fillMEsForDet(CondObj_ME,*detIter_,tTopo);
52  }
53 }
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
T get() const
Definition: EventSetup.h:62
T const * product() const
Definition: ESHandle.h:86
void SiStripApvGainsDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 85 of file SiStripApvGainsDQM.cc.

References alignmentValidation::c1, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), MonitorElement::getTH1(), MonitorElement::getTProfile(), SiStripBaseCondObjDQM::hPSet_, dataset::name, edm::ESHandle< T >::product(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr.

85  {
86 
87  //Retrieve tracker topology from geometry
89  es.get<TrackerTopologyRcd>().get(tTopoHandle);
90  const TrackerTopology* const tTopo = tTopoHandle.product();
91 
92  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
93  detIter_!= selectedDetIds.end();detIter_++){
94  fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo);
95  }
96 
97  for (std::map<uint32_t, ModMEs>::iterator iter=SummaryMEsMap_.begin(); iter!=SummaryMEsMap_.end(); iter++){
98 
99  ModMEs selME;
100  selME = iter->second;
101 
102  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")){
103 
104  TCanvas c1("c1");
105  selME.SummaryOfProfileDistr->getTProfile()->Draw();
106  std::string name (selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
107  name+=".png";
108  c1.Print(name.c_str());
109  }
110  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")){
111 
112  TCanvas c1("c1");
113  selME.SummaryDistr->getTH1()->Draw();
114  std::string name (selME.SummaryDistr->getTH1()->GetTitle());
115  name+=".png";
116  c1.Print(name.c_str());
117  }
118  }
119 
120 }
T getParameter(std::string const &) const
void fillMEsForLayer(uint32_t selDetId_, const TrackerTopology *tTopo) override
std::map< uint32_t, ModMEs > SummaryMEsMap_
T get() const
Definition: EventSetup.h:62
T const * product() const
Definition: ESHandle.h:86
void SiStripApvGainsDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 28 of file SiStripApvGainsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, gainHandle_, getConditionObject(), and SiStripApvGain::getDetIds().

28  {
29 
30  getConditionObject(eSetup);
32 
33 }
void getConditionObject(const edm::EventSetup &eSetup) override
void getDetIds(std::vector< uint32_t > &DetIds_) const
edm::ESHandle< SiStripApvGain > gainHandle_
std::vector< uint32_t > activeDetIds
unsigned long long SiStripApvGainsDQM::getCache ( const edm::EventSetup eSetup)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 33 of file SiStripApvGainsDQM.h.

References edm::EventSetup::get().

33 { return eSetup.get<SiStripApvGainRcd>().cacheIdentifier();}
T get() const
Definition: EventSetup.h:62
void SiStripApvGainsDQM::getConditionObject ( const edm::EventSetup eSetup)
inlineoverridevirtual

Member Data Documentation

edm::ESHandle<SiStripApvGain> SiStripApvGainsDQM::gainHandle_
private