CMS 3D CMS Logo

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

#include <CalibTracker/SiStripQuality/plugins/SiStripQualityStatistics.cc>

Inheritance diagram for SiStripQualityStatistics:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 SiStripQualityStatistics (const edm::ParameterSet &)
 
 ~SiStripQualityStatistics () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void EndJob ()
 
void SetBadComponents (int, int, SiStripQuality::BadComponent &)
 

Private Attributes

std::string dataLabel_
 
edm::FileInPath fp_
 
unsigned long long m_cacheID_
 
int NBadComponent [4][19][4]
 
int NTkBadComponent [4]
 
SiStripDetInfoFileReaderreader
 
bool saveTkHistoMap_
 
std::stringstream ssV [4][19]
 
std::unique_ptr< TkHistoMaptkhisto
 
TrackerMaptkMap
 
std::string TkMapFileName_
 
TrackerMaptkMapFullIOVs
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 25 of file SiStripQualityStatistics.h.

Constructor & Destructor Documentation

SiStripQualityStatistics::SiStripQualityStatistics ( const edm::ParameterSet iConfig)
explicit

Definition at line 31 of file SiStripQualityStatistics.cc.

References fp_, edm::FileInPath::fullPath(), reader, tkhisto, and tkMapFullIOVs.

31  :
32  m_cacheID_(0),
33  dataLabel_(iConfig.getUntrackedParameter<std::string>("dataLabel","")),
34  TkMapFileName_(iConfig.getUntrackedParameter<std::string>("TkMapFileName","")),
35  fp_(iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
36  saveTkHistoMap_(iConfig.getUntrackedParameter<bool>("SaveTkHistoMap",true)),
37  tkMap(nullptr),tkMapFullIOVs(nullptr)
38 {
40 
41  tkMapFullIOVs=new TrackerMap( "BadComponents" );
42  tkhisto=nullptr;
43 }
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< TkHistoMap > tkhisto
std::string fullPath() const
Definition: FileInPath.cc:197
SiStripDetInfoFileReader * reader
SiStripQualityStatistics::~SiStripQualityStatistics ( )
override

Definition at line 45 of file SiStripQualityStatistics.cc.

References EndJob().

46 {
47  this->EndJob();
48 }

Member Function Documentation

void SiStripQualityStatistics::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Definition at line 69 of file SiStripQualityStatistics.cc.

References dataLabel_, SiStripBadStrip::decode(), edm::EventID::event(), corrVsCorr::filename, symbols::filetype, TrackerMap::fill(), TrackerMap::fillc(), edm::EventSetup::get(), SiStripDetInfoFileReader::getAllDetIds(), SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), mps_fire::i, edm::EventBase::id(), SiStripQuality::IsModuleUsable(), gen::k, LogDebug, edm::EventBase::luminosityBlock(), m_cacheID_, NBadComponent, NTkBadComponent, TrackerMap::print(), edm::ESHandle< T >::product(), SiStripBadStrip::data::range, reader, edm::EventID::run(), TrackerMap::save(), SetBadComponents(), ssV, str, AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), edm::EventBase::time(), tkhisto, tkMap, TkMapFileName_, tkMapFullIOVs, StripSubdetector::TOB, TrackerTopology::tobLayer(), edm::Timestamp::value(), and globals_cff::x1.

69  {
70  //Retrieve tracker topology from geometry
72  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
73  const TrackerTopology* const tTopo = tTopoHandle.product();
74  if ( ( ! tkhisto ) && ( ! TkMapFileName_.empty() ) ) {
75  edm::ESHandle<TkDetMap> tkDetMapHandle;
76  iSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
77  //here the baseline (the value of the empty,not assigned bins) is put to -1 (default is zero)
78  tkhisto = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "BadComp","BadComp",-1.);
79  }
80 
81  unsigned long long cacheID = iSetup.get<SiStripQualityRcd>().cacheIdentifier();
82 
83  std::stringstream ss;
84 
85  if (m_cacheID_ == cacheID)
86  return;
87 
88  m_cacheID_ = cacheID;
89 
90  edm::ESHandle<SiStripQuality> SiStripQuality_;
91  iSetup.get<SiStripQualityRcd>().get(dataLabel_,SiStripQuality_);
92 
93  for(int i=0;i<4;++i){
94  NTkBadComponent[i]=0;
95  for(int j=0;j<19;++j){
96  ssV[i][j].str("");
97  for(int k=0;k<4;++k)
98  NBadComponent[i][j][k]=0;
99  }
100  }
101 
102  if (tkMap)
103  delete tkMap;
104  tkMap=new TrackerMap( "BadComponents" );
105 
106 
107  ss.str("");
108  std::vector<uint32_t> detids=reader->getAllDetIds();
109  std::vector<uint32_t>::const_iterator idet=detids.begin();
110  for(;idet!=detids.end();++idet){
111  ss << "detid " << (*idet) << " IsModuleUsable " << SiStripQuality_->IsModuleUsable((*idet)) << "\n";
112  if (SiStripQuality_->IsModuleUsable((*idet)))
113  tkMap->fillc(*idet,0x00ff00);
114  }
115  LogDebug("SiStripQualityStatistics") << ss.str() << std::endl;
116 
117 
118  std::vector<SiStripQuality::BadComponent> BC = SiStripQuality_->getBadComponentList();
119 
120  for (size_t i=0;i<BC.size();++i){
121 
122  //&&&&&&&&&&&&&
123  //Full Tk
124  //&&&&&&&&&&&&&
125 
126  if (BC[i].BadModule)
127  NTkBadComponent[0]++;
128  if (BC[i].BadFibers)
129  NTkBadComponent[1]+= ( (BC[i].BadFibers>>2)&0x1 )+ ( (BC[i].BadFibers>>1)&0x1 ) + ( (BC[i].BadFibers)&0x1 );
130  if (BC[i].BadApvs)
131  NTkBadComponent[2]+= ( (BC[i].BadApvs>>5)&0x1 )+ ( (BC[i].BadApvs>>4)&0x1 ) + ( (BC[i].BadApvs>>3)&0x1 ) +
132  ( (BC[i].BadApvs>>2)&0x1 )+ ( (BC[i].BadApvs>>1)&0x1 ) + ( (BC[i].BadApvs)&0x1 );
133 
134  //&&&&&&&&&&&&&&&&&
135  //Single SubSyste
136  //&&&&&&&&&&&&&&&&&
137  int component;
138  DetId detectorId=DetId(BC[i].detid);
139  int subDet = detectorId.subdetId();
140  if ( subDet == StripSubdetector::TIB ){
141  //&&&&&&&&&&&&&&&&&
142  //TIB
143  //&&&&&&&&&&&&&&&&&
144 
145  component=tTopo->tibLayer(BC[i].detid);
146  SetBadComponents(0, component, BC[i]);
147 
148  } else if ( subDet == StripSubdetector::TID ) {
149  //&&&&&&&&&&&&&&&&&
150  //TID
151  //&&&&&&&&&&&&&&&&&
152 
153  component=tTopo->tidSide(BC[i].detid)==2?tTopo->tidWheel(BC[i].detid):tTopo->tidWheel(BC[i].detid)+3;
154  SetBadComponents(1, component, BC[i]);
155 
156  } else if ( subDet == StripSubdetector::TOB ) {
157  //&&&&&&&&&&&&&&&&&
158  //TOB
159  //&&&&&&&&&&&&&&&&&
160 
161  component=tTopo->tobLayer(BC[i].detid);
162  SetBadComponents(2, component, BC[i]);
163 
164  } else if ( subDet == StripSubdetector::TEC ) {
165  //&&&&&&&&&&&&&&&&&
166  //TEC
167  //&&&&&&&&&&&&&&&&&
168 
169  component=tTopo->tecSide(BC[i].detid)==2?tTopo->tecWheel(BC[i].detid):tTopo->tecWheel(BC[i].detid)+9;
170  SetBadComponents(3, component, BC[i]);
171 
172  }
173  }
174 
175  //&&&&&&&&&&&&&&&&&&
176  // Single Strip Info
177  //&&&&&&&&&&&&&&&&&&
178  float percentage=0;
179 
180  SiStripQuality::RegistryIterator rbegin = SiStripQuality_->getRegistryVectorBegin();
181  SiStripQuality::RegistryIterator rend = SiStripQuality_->getRegistryVectorEnd();
182 
183  for (SiStripBadStrip::RegistryIterator rp=rbegin; rp != rend; ++rp) {
184  uint32_t detid=rp->detid;
185 
186  int subdet=-999; int component=-999;
187  DetId detectorId=DetId(detid);
188  int subDet = detectorId.subdetId();
189  if ( subDet == StripSubdetector::TIB ){
190  subdet=0;
191  component=tTopo->tibLayer(detid);
192  } else if ( subDet == StripSubdetector::TID ) {
193  subdet=1;
194  component=tTopo->tidSide(detid)==2?tTopo->tidWheel(detid):tTopo->tidWheel(detid)+3;
195  } else if ( subDet == StripSubdetector::TOB ) {
196  subdet=2;
197  component=tTopo->tobLayer(detid);
198  } else if ( subDet == StripSubdetector::TEC ) {
199  subdet=3;
200  component=tTopo->tecSide(detid)==2?tTopo->tecWheel(detid):tTopo->tecWheel(detid)+9;
201  }
202 
203  SiStripQuality::Range sqrange = SiStripQuality::Range( SiStripQuality_->getDataVectorBegin()+rp->ibegin , SiStripQuality_->getDataVectorBegin()+rp->iend );
204 
205  percentage=0;
206  for(int it=0;it<sqrange.second-sqrange.first;it++){
207  unsigned int range=SiStripQuality_->decode( *(sqrange.first+it) ).range;
208  NTkBadComponent[3]+=range;
209  NBadComponent[subdet][0][3]+=range;
210  NBadComponent[subdet][component][3]+=range;
211  percentage+=range;
212  }
213  if(percentage!=0)
214  percentage/=128.*reader->getNumberOfApvsAndStripLength(detid).first;
215  if(percentage>1)
216  edm::LogError("SiStripQualityStatistics") << "PROBLEM detid " << detid << " value " << percentage<< std::endl;
217 
218  //------- Global Statistics on percentage of bad components along the IOVs ------//
219  tkMapFullIOVs->fill(detid,percentage);
220  if(tkhisto!=nullptr)
221  tkhisto->fill(detid,percentage);
222  }
223 
224 
225  //&&&&&&&&&&&&&&&&&&
226  // printout
227  //&&&&&&&&&&&&&&&&&&
228 
229  ss.str("");
230  ss << "\n-----------------\nNew IOV starting from run " << e.id().run() << " event " << e.id().event() << " lumiBlock " << e.luminosityBlock() << " time " << e.time().value() << " chacheID " << m_cacheID_ << "\n-----------------\n";
231  ss << "\n-----------------\nGlobal Info\n-----------------";
232  ss << "\nBadComponent \t Modules \tFibers \tApvs\tStrips\n----------------------------------------------------------------";
233  ss << "\nTracker:\t\t"<<NTkBadComponent[0]<<"\t"<<NTkBadComponent[1]<<"\t"<<NTkBadComponent[2]<<"\t"<<NTkBadComponent[3];
234  ss<< "\n";
235  ss << "\nTIB:\t\t\t"<<NBadComponent[0][0][0]<<"\t"<<NBadComponent[0][0][1]<<"\t"<<NBadComponent[0][0][2]<<"\t"<<NBadComponent[0][0][3];
236  ss << "\nTID:\t\t\t"<<NBadComponent[1][0][0]<<"\t"<<NBadComponent[1][0][1]<<"\t"<<NBadComponent[1][0][2]<<"\t"<<NBadComponent[1][0][3];
237  ss << "\nTOB:\t\t\t"<<NBadComponent[2][0][0]<<"\t"<<NBadComponent[2][0][1]<<"\t"<<NBadComponent[2][0][2]<<"\t"<<NBadComponent[2][0][3];
238  ss << "\nTEC:\t\t\t"<<NBadComponent[3][0][0]<<"\t"<<NBadComponent[3][0][1]<<"\t"<<NBadComponent[3][0][2]<<"\t"<<NBadComponent[3][0][3];
239  ss << "\n";
240 
241  for (int i=1;i<5;++i)
242  ss << "\nTIB Layer " << i << " :\t\t"<<NBadComponent[0][i][0]<<"\t"<<NBadComponent[0][i][1]<<"\t"<<NBadComponent[0][i][2]<<"\t"<<NBadComponent[0][i][3];
243  ss << "\n";
244  for (int i=1;i<4;++i)
245  ss << "\nTID+ Disk " << i << " :\t\t"<<NBadComponent[1][i][0]<<"\t"<<NBadComponent[1][i][1]<<"\t"<<NBadComponent[1][i][2]<<"\t"<<NBadComponent[1][i][3];
246  for (int i=4;i<7;++i)
247  ss << "\nTID- Disk " << i-3 << " :\t\t"<<NBadComponent[1][i][0]<<"\t"<<NBadComponent[1][i][1]<<"\t"<<NBadComponent[1][i][2]<<"\t"<<NBadComponent[1][i][3];
248  ss << "\n";
249  for (int i=1;i<7;++i)
250  ss << "\nTOB Layer " << i << " :\t\t"<<NBadComponent[2][i][0]<<"\t"<<NBadComponent[2][i][1]<<"\t"<<NBadComponent[2][i][2]<<"\t"<<NBadComponent[2][i][3];
251  ss << "\n";
252  for (int i=1;i<10;++i)
253  ss << "\nTEC+ Disk " << i << " :\t\t"<<NBadComponent[3][i][0]<<"\t"<<NBadComponent[3][i][1]<<"\t"<<NBadComponent[3][i][2]<<"\t"<<NBadComponent[3][i][3];
254  for (int i=10;i<19;++i)
255  ss << "\nTEC- Disk " << i-9 << " :\t\t"<<NBadComponent[3][i][0]<<"\t"<<NBadComponent[3][i][1]<<"\t"<<NBadComponent[3][i][2]<<"\t"<<NBadComponent[3][i][3];
256  ss<< "\n";
257 
258  ss << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers Apvs\n----------------------------------------------------------------";
259  for (int i=1;i<5;++i)
260  ss << "\nTIB Layer " << i << " :" << ssV[0][i].str();
261  ss << "\n";
262  for (int i=1;i<4;++i)
263  ss << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
264  for (int i=4;i<7;++i)
265  ss << "\nTID- Disk " << i-3 << " :" << ssV[1][i].str();
266  ss << "\n";
267  for (int i=1;i<7;++i)
268  ss << "\nTOB Layer " << i << " :" << ssV[2][i].str();
269  ss << "\n";
270  for (int i=1;i<10;++i)
271  ss << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
272  for (int i=10;i<19;++i)
273  ss << "\nTEC- Disk " << i-9 << " :" << ssV[3][i].str();
274 
275 
276  edm::LogInfo("SiStripQualityStatistics") << ss.str() << std::endl;
277 
279  std::stringstream sRun; sRun.str("");
280  sRun << "_Run_" << std::setw(6) << std::setfill('0')<< e.id().run() << std::setw(0) ;
281 
282  if (filename!=""){
283  filename.insert(filename.find("."),sRun.str());
284  tkMap->save(true,0,0,filename);
285  filename.erase(filename.begin()+filename.find("."),filename.end());
286  tkMap->print(true,0,0,filename);
287  }
288 }
#define LogDebug(id)
unsigned short range
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
const std::vector< BadComponent > & getBadComponentList() const
unsigned int tibLayer(const DetId &id) const
void SetBadComponents(int, int, SiStripQuality::BadComponent &)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
unsigned int tidWheel(const DetId &id) const
Registry::const_iterator RegistryIterator
RegistryIterator getRegistryVectorEnd() const
unsigned int tidSide(const DetId &id) const
const std::vector< uint32_t > & getAllDetIds() const
bool IsModuleUsable(const uint32_t &detid) const
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:699
filetype
Definition: symbols.py:48
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:109
std::stringstream ssV[4][19]
int k[5][pyjets_maxn]
ContainerIterator getDataVectorBegin() const
Definition: DetId.h:18
std::unique_ptr< TkHistoMap > tkhisto
RegistryIterator getRegistryVectorBegin() const
edm::EventID id() const
Definition: EventBase.h:60
std::pair< ContainerIterator, ContainerIterator > Range
T get() const
Definition: EventSetup.h:63
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
Definition: TrackerMap.cc:2442
SiStripDetInfoFileReader * reader
#define str(s)
unsigned int tecWheel(const DetId &id) const
T const * product() const
Definition: ESHandle.h:86
TimeValue_t value() const
Definition: Timestamp.h:56
edm::Timestamp time() const
Definition: EventBase.h:61
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2786
data decode(const unsigned int &value) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
void SiStripQualityStatistics::bookHistograms ( DQMStore::IBooker ,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 65 of file SiStripQualityStatistics.cc.

66 {
67 }
void SiStripQualityStatistics::EndJob ( )
private

Definition at line 50 of file SiStripQualityStatistics.cc.

References corrVsCorr::filename, TrackerMap::print(), TrackerMap::save(), saveTkHistoMap_, AlCaHLTBitMon_QueryRunRegistry::string, tkhisto, TkMapFileName_, and tkMapFullIOVs.

Referenced by ~SiStripQualityStatistics().

50  {
51 
53  if (filename!=""){
54  tkMapFullIOVs->save(false,0,0,filename);
55  filename.erase(filename.begin()+filename.find("."),filename.end());
56  tkMapFullIOVs->print(false,0,0,filename);
57 
58  if(saveTkHistoMap_){
59  tkhisto->save(filename+".root");
60  tkhisto->saveAsCanvas(filename+"_Canvas.root","E");
61  }
62  }
63 }
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:699
std::unique_ptr< TkHistoMap > tkhisto
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
Definition: TrackerMap.cc:2442
void SiStripQualityStatistics::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 291 of file SiStripQualityStatistics.cc.

References SiStripQuality::BadComponent::BadApvs, SiStripQuality::BadComponent::BadFibers, SiStripQuality::BadComponent::BadModule, SiStripQuality::BadComponent::detid, TrackerMap::fillc(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), mps_fire::i, NBadComponent, reader, ssV, tkMap, and globals_cff::x1.

Referenced by analyze().

291  {
292 
293  int napv=reader->getNumberOfApvsAndStripLength(BC.detid).first;
294 
295  ssV[i][component] << "\n\t\t "
296  << BC.detid
297  << " \t " << BC.BadModule << " \t "
298  << ( (BC.BadFibers)&0x1 ) << " ";
299  if (napv==4)
300  ssV[i][component] << "x " <<( (BC.BadFibers>>1)&0x1 );
301 
302  if (napv==6)
303  ssV[i][component] << ( (BC.BadFibers>>1)&0x1 ) << " "
304  << ( (BC.BadFibers>>2)&0x1 );
305  ssV[i][component] << " \t "
306  << ( (BC.BadApvs)&0x1 ) << " "
307  << ( (BC.BadApvs>>1)&0x1 ) << " ";
308  if (napv==4)
309  ssV[i][component] << "x x " << ( (BC.BadApvs>>2)&0x1 ) << " "
310  << ( (BC.BadApvs>>3)&0x1 );
311  if (napv==6)
312  ssV[i][component] << ( (BC.BadApvs>>2)&0x1 ) << " "
313  << ( (BC.BadApvs>>3)&0x1 ) << " "
314  << ( (BC.BadApvs>>4)&0x1 ) << " "
315  << ( (BC.BadApvs>>5)&0x1 ) << " ";
316 
317  if (BC.BadApvs){
318  NBadComponent[i][0][2]+= ( (BC.BadApvs>>5)&0x1 )+ ( (BC.BadApvs>>4)&0x1 ) + ( (BC.BadApvs>>3)&0x1 ) +
319  ( (BC.BadApvs>>2)&0x1 )+ ( (BC.BadApvs>>1)&0x1 ) + ( (BC.BadApvs)&0x1 );
320  NBadComponent[i][component][2]+= ( (BC.BadApvs>>5)&0x1 )+ ( (BC.BadApvs>>4)&0x1 ) + ( (BC.BadApvs>>3)&0x1 ) +
321  ( (BC.BadApvs>>2)&0x1 )+ ( (BC.BadApvs>>1)&0x1 ) + ( (BC.BadApvs)&0x1 );
322  tkMap->fillc(BC.detid,0xff0000);
323  }
324  if (BC.BadFibers){
325  NBadComponent[i][0][1]+= ( (BC.BadFibers>>2)&0x1 )+ ( (BC.BadFibers>>1)&0x1 ) + ( (BC.BadFibers)&0x1 );
326  NBadComponent[i][component][1]+= ( (BC.BadFibers>>2)&0x1 )+ ( (BC.BadFibers>>1)&0x1 ) + ( (BC.BadFibers)&0x1 );
327  tkMap->fillc(BC.detid,0x0000ff);
328  }
329  if (BC.BadModule){
330  NBadComponent[i][0][0]++;
331  NBadComponent[i][component][0]++;
332  tkMap->fillc(BC.detid,0x0);
333  }
334 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:109
std::stringstream ssV[4][19]
SiStripDetInfoFileReader * reader

Member Data Documentation

std::string SiStripQualityStatistics::dataLabel_
private

Definition at line 42 of file SiStripQualityStatistics.h.

Referenced by analyze().

edm::FileInPath SiStripQualityStatistics::fp_
private

Definition at line 44 of file SiStripQualityStatistics.h.

Referenced by SiStripQualityStatistics().

unsigned long long SiStripQualityStatistics::m_cacheID_
private

Definition at line 41 of file SiStripQualityStatistics.h.

Referenced by analyze().

int SiStripQualityStatistics::NBadComponent[4][19][4]
private

Definition at line 48 of file SiStripQualityStatistics.h.

Referenced by analyze(), and SetBadComponents().

int SiStripQualityStatistics::NTkBadComponent[4]
private

Definition at line 47 of file SiStripQualityStatistics.h.

Referenced by analyze().

SiStripDetInfoFileReader* SiStripQualityStatistics::reader
private

Definition at line 55 of file SiStripQualityStatistics.h.

Referenced by analyze(), SetBadComponents(), and SiStripQualityStatistics().

bool SiStripQualityStatistics::saveTkHistoMap_
private

Definition at line 45 of file SiStripQualityStatistics.h.

Referenced by EndJob().

std::stringstream SiStripQualityStatistics::ssV[4][19]
private

Definition at line 52 of file SiStripQualityStatistics.h.

Referenced by analyze(), and SetBadComponents().

std::unique_ptr<TkHistoMap> SiStripQualityStatistics::tkhisto
private

Definition at line 56 of file SiStripQualityStatistics.h.

Referenced by analyze(), EndJob(), and SiStripQualityStatistics().

TrackerMap* SiStripQualityStatistics::tkMap
private

Definition at line 54 of file SiStripQualityStatistics.h.

Referenced by analyze(), and SetBadComponents().

std::string SiStripQualityStatistics::TkMapFileName_
private

Definition at line 43 of file SiStripQualityStatistics.h.

Referenced by analyze(), and EndJob().

TrackerMap * SiStripQualityStatistics::tkMapFullIOVs
private

Definition at line 54 of file SiStripQualityStatistics.h.

Referenced by analyze(), EndJob(), and SiStripQualityStatistics().