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 6 of file SiStripPedestalsDQM.cc.

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

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

Definition at line 18 of file SiStripPedestalsDQM.cc.

18 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 55 of file SiStripPedestalsDQM.cc.

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

Referenced by fillModMEs().

55  {
56  ModMEs selModME_ = _selModME_;
57  getModMEs(selModME_,selDetId_,tTopo);
58 
59  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
60  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
61 
62  for( int istrip=0;istrip<nStrip;++istrip){
63  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
64  selModME_.ProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
65  }
66  }// istrip
67 
68 }
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 120 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), TkHistoMap::fill(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), 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().

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

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

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

Reimplemented from SiStripBaseCondObjDQM.

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 23 of file SiStripPedestalsDQM.cc.

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

23  {
24 
25  getConditionObject(eSetup);
26  pedestalHandle_->getDetIds(activeDetIds);
27 
28 }
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:55
void SiStripPedestalsDQM::getConditionObject ( const edm::EventSetup eSetup)
inlinevirtual

Member Data Documentation

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