36 dataLabel_(iConfig.getUntrackedParameter<std::string>(
"dataLabel",
"")),
37 TkMapFileName_(iConfig.getUntrackedParameter<std::string>(
"TkMapFileName",
"")),
38 fp_(iConfig.getUntrackedParameter<edm::
FileInPath>(
"file",edm::
FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
39 saveTkHistoMap_(iConfig.getUntrackedParameter<bool>(
"SaveTkHistoMap",
true)),
40 tkMap(0),tkMapFullIOVs(0)
56 filename.erase(filename.begin()+filename.find(
"."),filename.end());
82 for(
int j=0;
j<19;++
j){
96 std::vector<uint32_t>::const_iterator idet=detids.begin();
97 for(;idet!=detids.end();++idet){
98 ss <<
"detid " << (*idet) <<
" IsModuleUsable " << SiStripQuality_->IsModuleUsable((*idet)) <<
"\n";
99 if (SiStripQuality_->IsModuleUsable((*idet)))
102 LogDebug(
"SiStripQualityStatistics") << ss.str() << std::endl;
105 std::vector<SiStripQuality::BadComponent> BC = SiStripQuality_->getBadComponentList();
107 for (
size_t i=0;
i<BC.size();++
i){
116 NTkBadComponent[1]+= ( (BC[
i].BadFibers>>2)&0x1 )+ ( (BC[
i].BadFibers>>1)&0x1 ) + ( (BC[
i].BadFibers)&0x1 );
118 NTkBadComponent[2]+= ( (BC[
i].BadApvs>>5)&0x1 )+ ( (BC[
i].BadApvs>>4)&0x1 ) + ( (BC[
i].BadApvs>>3)&0x1 ) +
119 ( (BC[
i].BadApvs>>2)&0x1 )+ ( (BC[
i].BadApvs>>1)&0x1 ) + ( (BC[
i].BadApvs)&0x1 );
171 uint32_t
detid=rp->detid;
173 int subdet=-999;
int component=-999;
192 for(
int it=0;it<sqrange.second-sqrange.first;it++){
193 unsigned int range=SiStripQuality_->decode( *(sqrange.first+it) ).range;
202 edm::LogError(
"SiStripQualityStatistics") <<
"PROBLEM detid " << detid <<
" value " << percentage<< std::endl;
216 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";
217 ss <<
"\n-----------------\nGlobal Info\n-----------------";
218 ss <<
"\nBadComponent \t Modules \tFibers \tApvs\tStrips\n----------------------------------------------------------------";
222 ss <<
"\nTID:\t\t\t"<<NBadComponent[1][0][0]<<
"\t"<<NBadComponent[1][0][1]<<
"\t"<<NBadComponent[1][0][2]<<
"\t"<<NBadComponent[1][0][3];
223 ss <<
"\nTOB:\t\t\t"<<NBadComponent[2][0][0]<<
"\t"<<NBadComponent[2][0][1]<<
"\t"<<NBadComponent[2][0][2]<<
"\t"<<NBadComponent[2][0][3];
224 ss <<
"\nTEC:\t\t\t"<<NBadComponent[3][0][0]<<
"\t"<<NBadComponent[3][0][1]<<
"\t"<<NBadComponent[3][0][2]<<
"\t"<<NBadComponent[3][0][3];
227 for (
int i=1;
i<5;++
i)
228 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];
230 for (
int i=1;
i<4;++
i)
231 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];
232 for (
int i=4;
i<7;++
i)
233 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];
235 for (
int i=1;
i<7;++
i)
236 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];
238 for (
int i=1;
i<10;++
i)
239 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];
240 for (
int i=10;
i<19;++
i)
241 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];
244 ss <<
"\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers Apvs\n----------------------------------------------------------------";
245 for (
int i=1;
i<5;++
i)
246 ss <<
"\nTIB Layer " <<
i <<
" :" <<
ssV[0][
i].str();
248 for (
int i=1;
i<4;++
i)
249 ss <<
"\nTID+ Disk " <<
i <<
" :" <<
ssV[1][
i].str();
250 for (
int i=4;
i<7;++
i)
251 ss <<
"\nTID- Disk " <<
i-3 <<
" :" <<
ssV[1][
i].str();
253 for (
int i=1;
i<7;++
i)
254 ss <<
"\nTOB Layer " <<
i <<
" :" <<
ssV[2][
i].str();
256 for (
int i=1;
i<10;++
i)
257 ss <<
"\nTEC+ Disk " <<
i <<
" :" <<
ssV[3][
i].str();
258 for (
int i=10;
i<19;++
i)
259 ss <<
"\nTEC- Disk " <<
i-9 <<
" :" <<
ssV[3][
i].str();
262 edm::LogInfo(
"SiStripQualityStatistics") << ss.str() << std::endl;
265 std::stringstream sRun; sRun.str(
"");
266 sRun <<
"_Run_" << std::setw(6) << std::setfill(
'0')<< e.
id().
run() << std::setw(0) ;
269 filename.insert(filename.find(
"."),sRun.str());
271 filename.erase(filename.begin()+filename.find(
"."),filename.end());
281 ssV[
i][component] <<
"\n\t\t "
291 ssV[
i][component] <<
" \t "
293 << ( (BC.
BadApvs>>1)&0x1 ) <<
" ";
295 ssV[
i][component] <<
"x x " << ( (BC.
BadApvs>>2)&0x1 ) <<
" "
298 ssV[
i][component] << ( (BC.
BadApvs>>2)&0x1 ) <<
" "
299 << ( (BC.
BadApvs>>3)&0x1 ) <<
" "
300 << ( (BC.
BadApvs>>4)&0x1 ) <<
" "
301 << ( (BC.
BadApvs>>5)&0x1 ) <<
" ";
std::string TkMapFileName_
EventNumber_t event() const
unsigned int layer() const
layer id
void SetBadComponents(int, int, SiStripQuality::BadComponent &)
TrackerMap * tkMapFullIOVs
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
edm::LuminosityBlockNumber_t luminosityBlock() const
int NBadComponent[4][19][4]
Registry::const_iterator RegistryIterator
unsigned int side() const
positive or negative id
void saveAsCanvas(std::string filename, std::string options="", std::string mode="RECREATE")
void analyze(const edm::Event &, const edm::EventSetup &)
void save(std::string filename)
const std::vector< uint32_t > & getAllDetIds() const
void fill(uint32_t &detid, float value)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void fillc(int idmod, int RGBcode)
std::stringstream ssV[4][19]
tuple SiStripDetInfoFileReader
Detector identifier class for the strip tracker.
TimeValue_t value() const
unsigned int side() const
positive or negative id
unsigned long long m_cacheID_
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
std::pair< ContainerIterator, ContainerIterator > Range
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
SiStripDetInfoFileReader * reader
SiStripQualityStatistics(const edm::ParameterSet &)
std::string fullPath() const
edm::Timestamp time() const
void fill(int layer, int ring, int nmod, float x)
unsigned int wheel() const
wheel id