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
SiStripLorentzAngleDQM Class Reference

#include <SiStripLorentzAngleDQM.h>

Inheritance diagram for SiStripLorentzAngleDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (ModMEs selModME_, uint32_t selDetId_)
 
void fillMEsForLayer (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)
 
 SiStripLorentzAngleDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripLorentzAngleDQM ()
 
- 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_, 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
< SiStripLorentzAngle
lorentzangleHandle_
 

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_)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
std::vector< uint32_t > GetSameLayerDetId (std::vector< uint32_t > activeDetIds, uint32_t selDetId)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
- 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 SiStripLorentzAngleDQM.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file SiStripLorentzAngleDQM.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","LA_TkMap",0.);
12 
13 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
SiStripLorentzAngleDQM::~SiStripLorentzAngleDQM ( )
virtual

Definition at line 19 of file SiStripLorentzAngleDQM.cc.

19 {}

Member Function Documentation

void SiStripLorentzAngleDQM::fillMEsForDet ( ModMEs  selModME_,
uint32_t  selDetId_ 
)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 26 of file SiStripLorentzAngleDQM.h.

26 {};
void SiStripLorentzAngleDQM::fillMEsForLayer ( uint32_t  selDetId_)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 122 of file SiStripLorentzAngleDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, gather_cfg::cout, SiStripHistoId::createHistoLayer(), TkHistoMap::fill(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getStringNameAndId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripSubStructure::getTECDetectors(), SiStripSubStructure::getTIBDetectors(), SiStripSubStructure::getTIDDetectors(), SiStripSubStructure::getTOBDetectors(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, i, align::tib::layerNumber(), lorentzangleHandle_, align::tob::rodNumber(), edm::second(), align::tib::stringNumber(), SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfCumulDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::SummaryOnStringLevel_On_, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

122  {
123 
125 
126 
127  std::string hSummaryOfProfile_description;
128  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
129 
130  std::string hSummary_name;
131 
132  int subDetId_ = ((selDetId_>>25)&0x7);
133 
134  if( subDetId_<3 || subDetId_>6 ){
135  edm::LogError("SiStripLorentzAngleDQM")
136  << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
137  << subDetId_ << " no folder set!"
138  << std::endl;
139  return;
140  }
141 
142  uint32_t selSubDetId_ = ((selDetId_>>25)&0x7);
143  SiStripSubStructure substructure_;
144 
145  std::vector<uint32_t> sameLayerDetIds_;
146  sameLayerDetIds_.clear();
147 
148  if (SummaryOnStringLevel_On_) { //FILLING FOR STRING LEVEL
149 
150  hSummary_name = hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getStringNameAndId(selDetId_).first, "") ;
151  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = SummaryMEsMap_.find(getStringNameAndId(selDetId_).second);
152 
153  ModMEs selME_;
154  if ( selMEsMapIter_ != SummaryMEsMap_.end())
155  selME_ =selMEsMapIter_->second;
156 
157  getSummaryMEs(selME_,selDetId_ );
158 
159  // -----
160  sameLayerDetIds_.clear();
161 
162  if(selSubDetId_==3){ // TIB
163  if(TIBDetId(selDetId_).isInternalString()){
164  substructure_.getTIBDetectors(activeDetIds, sameLayerDetIds_, TIBDetId(selDetId_).layerNumber(),0,1,TIBDetId(selDetId_).stringNumber());
165  }
166  if(TIBDetId(selDetId_).isExternalString()){
167  substructure_.getTIBDetectors(activeDetIds, sameLayerDetIds_, TIBDetId(selDetId_).layerNumber(),0,2,TIBDetId(selDetId_).stringNumber());
168  }
169  }
170  else if(selSubDetId_==4){ // TID
171  substructure_.getTIDDetectors(activeDetIds, sameLayerDetIds_, 0,0,0,0);
172  }
173  else if(selSubDetId_==5){ // TOB
174  substructure_.getTOBDetectors(activeDetIds, sameLayerDetIds_, TOBDetId(selDetId_).layerNumber(),0,TOBDetId(selDetId_).rodNumber());
175  }
176  else if(selSubDetId_==6){ // TEC
177  substructure_.getTECDetectors(activeDetIds, sameLayerDetIds_, 0,0,0,0,0,0);
178  }
179 
180  // -----
181 
182  for(unsigned int i=0;i< sameLayerDetIds_.size(); i++){
183  selME_.SummaryOfProfileDistr->Fill(i+1,lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
184 
185  // Fill the Histo_TkMap+TkMap with the LA:
186  if(HistoMaps_On_ ) Tk_HM_->fill(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
187 
188  std::cout<<sameLayerDetIds_[i]<<"\t"<<lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])<<std::endl;
189 
190  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
191  fillTkMap(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
192  }
193 
194  }
195 
196  std::string hSummaryOfCumul_description;
197  hSummaryOfCumul_description = hPSet_.getParameter<std::string>("SummaryOfCumul_description");
198 
199  std::string hSummaryOfCumul_name;
200 
201  if( subDetId_<3 || subDetId_>6 ){
202  edm::LogError("SiStripLorentzAngleDQM")
203  << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
204  << subDetId_ << " no folder set!"
205  << std::endl;
206  return;
207  }
208 
209  hSummaryOfCumul_name = hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", getStringNameAndId(selDetId_).first, "") ;
210 
211  for(unsigned int i=0;i< sameLayerDetIds_.size(); i++){
212  selME_.SummaryOfCumulDistr->Fill(lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
213  }
214  } //FILLING FOR STRING LEVEL
215 
216 
217  else { //FILLING FOR LAYER LEVEL
218 
219  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_).second);
220 
221  ModMEs selME_;
222  if ( selMEsMapIter_ != SummaryMEsMap_.end())
223  selME_ =selMEsMapIter_->second;
224 
225  getSummaryMEs(selME_,selDetId_ );
226 
227  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
228 
229  hSummary_name = hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_).first, "") ;
230 
231  // -----
232  sameLayerDetIds_.clear();
233 
234  sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_);
235 
236  for(unsigned int i=0;i< sameLayerDetIds_.size(); i++){
237  selME_.SummaryOfProfileDistr->Fill(i+1,lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
238 
239  // Fill the Histo_TkMap with LA:
240  if(HistoMaps_On_ ) Tk_HM_->fill(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
241 
242  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
243  fillTkMap(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
244 
245  }
246 
247  }
248  }//if Fill ...
249 
250  if(hPSet_.getParameter<bool>("FillCumulativeSummaryAtLayerLevel")){
251 
252  std::string hSummaryOfCumul_description;
253  hSummaryOfCumul_description = hPSet_.getParameter<std::string>("SummaryOfCumul_description");
254 
255  std::string hSummaryOfCumul_name;
256 
257  if( subDetId_<3 || subDetId_>6 ){
258  edm::LogError("SiStripLorentzAngleDQM")
259  << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
260  << subDetId_ << " no folder set!"
261  << std::endl;
262  return;
263  }
264 
265  hSummaryOfCumul_name = hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", getLayerNameAndId(selDetId_).first, "") ;
266 
267  for(unsigned int i=0;i< sameLayerDetIds_.size(); i++){
268  selME_.SummaryOfCumulDistr->Fill(lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]));
269  }
270  }//if Fill ...
271  } //FILLING FOR LAYER LEVEL
272 
273 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
unsigned int rodNumber(align::ID)
Rod number increases with phi.
Definition: TOBNameSpace.h:41
std::vector< uint32_t > GetSameLayerDetId(std::vector< uint32_t > activeDetIds, uint32_t selDetId)
edm::ESHandle< SiStripLorentzAngle > lorentzangleHandle_
unsigned int layerNumber(align::ID)
Layer number increases with rho from 1 to 8.
Definition: TIBNameSpace.h:85
void fillTkMap(const uint32_t &detid, const float &value)
U second(std::pair< T, U > const &p)
std::map< uint32_t, ModMEs > SummaryMEsMap_
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:130
bool first
Definition: L1TdeRCT.cc:94
std::pair< std::string, uint32_t > getStringNameAndId(const uint32_t &detId_)
unsigned int stringNumber(align::ID)
Definition: TIBNameSpace.h:51
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0) const
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
std::vector< uint32_t > activeDetIds
tuple cout
Definition: gather_cfg.py:121
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
void SiStripLorentzAngleDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
inlinevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 25 of file SiStripLorentzAngleDQM.h.

25 {};
void SiStripLorentzAngleDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 42 of file SiStripLorentzAngleDQM.cc.

References alignmentValidation::c1, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::getStringNameAndId(), MonitorElement::getTH1(), MonitorElement::getTProfile(), SiStripBaseCondObjDQM::hPSet_, i, mergeVDriftHistosByStation::name, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfCumulDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::SummaryOnLayerLevel_On_, and SiStripBaseCondObjDQM::SummaryOnStringLevel_On_.

42  {
43 
44  // -----
45  // LA on layer-level : fill at once all detIds belonging to same layer when encountering first detID in the layer
46 
47  bool fillNext = true;
48  for(unsigned int i=0;i<selectedDetIds.size();i++){
49  int subDetId_ = ((selectedDetIds[i]>>25)&0x7);
50  if( subDetId_<3 ||subDetId_>6 ){
51  edm::LogError("SiStripLorentzAngle")
52  << "[SiStripLorentzAngle::fillSummaryMEs] WRONG INPUT : no such subdetector type : "
53  << subDetId_ << " and detId " << selectedDetIds[i] << " therefore no filling!"
54  << std::endl;
55  }
56  else if (SummaryOnLayerLevel_On_) {
57  if( fillNext) { fillMEsForLayer(/*SummaryMEsMap_,*/ selectedDetIds[i]);}
58  if( getLayerNameAndId(selectedDetIds[i+1])==getLayerNameAndId(selectedDetIds[i])){ fillNext=false;}
59  else { fillNext=true;}
60  }
61  else if (SummaryOnStringLevel_On_) {
62  if( fillNext) { fillMEsForLayer(/*SummaryMEsMap_,*/ selectedDetIds[i]);}
63  if( getStringNameAndId(selectedDetIds[i+1])==getStringNameAndId(selectedDetIds[i])){ fillNext=false;}
64  else { fillNext=true;}
65  }
66  }
67 
68  for (std::map<uint32_t, ModMEs>::iterator iter=SummaryMEsMap_.begin(); iter!=SummaryMEsMap_.end(); iter++){
69 
70  ModMEs selME;
71  selME = iter->second;
72 
74 
75  if (fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")){
76 
77  TCanvas c1("c1");
78  selME.SummaryOfProfileDistr->getTProfile()->Draw();
79  std::string name (selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
80  name+=".png";
81  c1.Print(name.c_str());
82  }
83 
84  if (fPSet_.getParameter<bool>("OutputCumulativeSummaryAtLayerLevelAsImage")){
85 
86  TCanvas c2("c2");
87  selME.SummaryOfCumulDistr->getTH1()->Draw();
88  std::string name2 (selME.SummaryOfCumulDistr->getTH1()->GetTitle());
89  name2+=".png";
90  c2.Print(name2.c_str());
91  }
92 
93  }
94  else{
95  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")){
96 
97  TCanvas c1("c1");
98  selME.SummaryOfProfileDistr->getTProfile()->Draw();
99  std::string name (selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
100  name+=".png";
101  c1.Print(name.c_str());
102  }
103 
104  if(hPSet_.getParameter<bool>("FillCumulativeSummaryAtLayerLevel") && fPSet_.getParameter<bool>("OutputCumulativeSummaryAtLayerLevelAsImage")){
105 
106  TCanvas c1("c1");
107  selME.SummaryOfCumulDistr->getTH1()->Draw();
108  std::string name (selME.SummaryOfCumulDistr->getTH1()->GetTitle());
109  name+=".png";
110  c1.Print(name.c_str());
111  }
112  }
113 
114  }
115 
116 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::map< uint32_t, ModMEs > SummaryMEsMap_
std::pair< std::string, uint32_t > getStringNameAndId(const uint32_t &detId_)
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
void fillMEsForLayer(uint32_t selDetId_)
void SiStripLorentzAngleDQM::getActiveDetIds ( const edm::EventSetup eSetup)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripLorentzAngleDQM.cc.

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

24  {
25 
26  getConditionObject(eSetup);
27 
28  std::map<uint32_t,float>::const_iterator LAMapIter_;
29  std::map<uint32_t,float> LAMap_ = lorentzangleHandle_->getLorentzAngles();
30 
31  for( LAMapIter_ = LAMap_.begin();
32  LAMapIter_!= LAMap_.end(); LAMapIter_++){
33 
34  activeDetIds.push_back((*LAMapIter_).first);
35  }
36 
37 }
edm::ESHandle< SiStripLorentzAngle > lorentzangleHandle_
std::vector< uint32_t > activeDetIds
void getConditionObject(const edm::EventSetup &eSetup)
unsigned long long SiStripLorentzAngleDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripLorentzAngleDQM.h.

References edm::EventSetup::get().

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

Member Data Documentation

edm::ESHandle<SiStripLorentzAngle> SiStripLorentzAngleDQM::lorentzangleHandle_
private

Definition at line 39 of file SiStripLorentzAngleDQM.h.

Referenced by fillMEsForLayer(), getActiveDetIds(), and getConditionObject().