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)
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo)
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es)
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es)
 
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 ()
 
- 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_)
 
 SiStripBaseCondObjDQM (const edm::EventSetup &eSetup, 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_
 
TkHistoMapTk_HM_
 
TkHistoMapTk_HM_H
 
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::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 8 of file SiStripApvGainsDQM.cc.

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

10  :SiStripBaseCondObjDQM(eSetup,hPSet, fPSet){
11 
12  // Build the Histo_TkMap:
13  if(HistoMaps_On_ ) Tk_HM_ = new TkHistoMap("SiStrip/Histo_Map","MeanApvGain_TkMap",0.);
14 
15 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
SiStripApvGainsDQM::~SiStripApvGainsDQM ( )
virtual

Definition at line 19 of file SiStripApvGainsDQM.cc.

19 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 53 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().

53  {
54  ModMEs selModME_ = _selModME_;
55  std::vector<uint32_t> DetIds;
56  gainHandle_->getDetIds(DetIds);
57 
58  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
59 
60  int nApv = reader->getNumberOfApvsAndStripLength(selDetId_).first;
61 
62  getModMEs(selModME_,selDetId_, tTopo);
63 
64  for( int iapv=0;iapv<nApv;++iapv){
65  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
66  selModME_.ProfileDistr->Fill(iapv+1,gainHandle_->getApvGain(iapv,gainRange));
67  }
68  if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
69  selModME_.CumulDistr ->Fill(gainHandle_->getApvGain(iapv,gainRange));
70  }
71 
72  // Fill the TkMap
73  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
74  fillTkMap(selDetId_, gainHandle_->getApvGain(iapv,gainRange));
75  }
76 
77  }
78 }
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 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 119 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(), TkHistoMap::setBinContent(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 36 of file SiStripApvGainsDQM.cc.

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

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 81 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.

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

Implements SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripApvGainsDQM.cc.

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

24  {
25 
26  getConditionObject(eSetup);
28 
29 }
void getDetIds(std::vector< uint32_t > &DetIds_) const
void getConditionObject(const edm::EventSetup &eSetup)
edm::ESHandle< SiStripApvGain > gainHandle_
std::vector< uint32_t > activeDetIds
unsigned long long SiStripApvGainsDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 32 of file SiStripApvGainsDQM.h.

References edm::EventSetup::get().

32 { return eSetup.get<SiStripApvGainRcd>().cacheIdentifier();}
const T & get() const
Definition: EventSetup.h:55
void SiStripApvGainsDQM::getConditionObject ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 34 of file SiStripApvGainsDQM.h.

References SiStripBaseCondObjDQM::cacheID_current, SiStripBaseCondObjDQM::cacheID_memory, gainHandle_, and edm::EventSetup::get().

Referenced by getActiveDetIds().

34  {
35  eSetup.get<SiStripApvGainRcd>().get(gainHandle_);
37  }
unsigned long long cacheID_memory
edm::ESHandle< SiStripApvGain > gainHandle_
const T & get() const
Definition: EventSetup.h:55
unsigned long long cacheID_current

Member Data Documentation

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