test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiStripPedestalsDQM Class Reference

#include <SiStripPedestalsDQM.h>

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

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 11 of file SiStripPedestalsDQM.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file SiStripPedestalsDQM.cc.

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

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

Definition at line 19 of file SiStripPedestalsDQM.cc.

19 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 56 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, MonitorElement::Fill(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), pedestalHandle_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, and SiStripBaseCondObjDQM::reader.

Referenced by fillModMEs().

56  {
57  ModMEs selModME_ = _selModME_;
58  getModMEs(selModME_,selDetId_,tTopo);
59 
60  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
61  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
62 
63  for( int istrip=0;istrip<nStrip;++istrip){
64  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
65  selModME_.ProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
66  }
67  }// istrip
68 
69 }
edm::ESHandle< SiStripPedestals > pedestalHandle_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
SiStripDetInfoFileReader * reader
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
void SiStripPedestalsDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 121 of file SiStripPedestalsDQM.cc.

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

Referenced by fillSummaryMEs().

121  {
122 
123  // ----
124  int subdetectorId_ = ((selDetId_>>25)&0x7);
125 
126  if( subdetectorId_<3 || subdetectorId_>6 ){
127  edm::LogError("SiStripPedestalsDQM")
128  << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
129  << subdetectorId_ << " no folder set!"
130  << std::endl;
131  return;
132  }
133  // ----
134 
135 // // Cumulative distribution with average Ped value on a layer (not needed):
136 
137  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_,tTopo).second);
138  ModMEs selME_;
139  if ( selMEsMapIter_ != SummaryMEsMap_.end())
140  selME_ =selMEsMapIter_->second;
141  getSummaryMEs(selME_,selDetId_,tTopo);
142 
143  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
144 
145  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
146 
148 
149  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
150 
151  // --> profile summary
152 
153  std::string hSummaryOfProfile_description;
154  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
155 
156  std::string hSummaryOfProfile_name;
157 
158 
159  hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description,
160  "layer",
161  getLayerNameAndId(selDetId_,tTopo).first,
162  "") ;
163 
164  for( int istrip=0;istrip<nStrip;++istrip){
165 
166  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
167  selME_.SummaryOfProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
168  }
169 
170  //fill the TkMap
171  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
172  fillTkMap(selDetId_, pedestalHandle_->getPed(istrip,pedRange));
173  }
174 
175  }// istrip
176  }//if Fill ...
177 
178  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
179 
180  // --> summary
181 
182  std::string hSummary_description;
183  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
184 
185  std::string hSummary_name;
186  hSummary_name = hidmanager.createHistoLayer(hSummary_description,
187  "layer",
188  getLayerNameAndId(selDetId_,tTopo).first,
189  "") ;
190  float meanPedestal=0;
191 
192  for( int istrip=0;istrip<nStrip;++istrip){
193 
194  meanPedestal = meanPedestal + pedestalHandle_->getPed(istrip,pedRange);
195 
196  }//istrip
197 
198  meanPedestal = meanPedestal/nStrip;
199 
200 
201  // -----
202  // get detIds belonging to same layer to fill X-axis with detId-number
203 
204  std::vector<uint32_t> sameLayerDetIds_;
205 
206  sameLayerDetIds_.clear();
207 
208  sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_,tTopo);
209 
210 
211  unsigned int iBin=0;
212  for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
213  if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
214  }
215 
216  selME_.SummaryDistr->Fill(iBin,meanPedestal);
217 
218  // Fill the Histo_TkMap with the mean Pedestal:
219  if(HistoMaps_On_ ) Tk_HM_->fill(selDetId_, meanPedestal);
220 
221 
222  }//if Fill ...
223 
224 
225 
226 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
edm::ESHandle< SiStripPedestals > pedestalHandle_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
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
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:180
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo)
std::vector< uint32_t > activeDetIds
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
void SiStripPedestalsDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 34 of file SiStripPedestalsDQM.cc.

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

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 75 of file SiStripPedestalsDQM.cc.

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, getConditionObject(), and pedestalHandle_.

24  {
25 
26  getConditionObject(eSetup);
27  pedestalHandle_->getDetIds(activeDetIds);
28 
29 }
edm::ESHandle< SiStripPedestals > pedestalHandle_
void getConditionObject(const edm::EventSetup &eSetup)
std::vector< uint32_t > activeDetIds
unsigned long long SiStripPedestalsDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 29 of file SiStripPedestalsDQM.h.

References edm::EventSetup::get().

29 { return eSetup.get<SiStripPedestalsRcd>().cacheIdentifier();}
const T & get() const
Definition: EventSetup.h:56
void SiStripPedestalsDQM::getConditionObject ( const edm::EventSetup eSetup)
inlinevirtual

Member Data Documentation

edm::ESHandle<SiStripPedestals> SiStripPedestalsDQM::pedestalHandle_
private