44 #include "TPaveText.h" 45 #include "TImageDump.h" 47 #include "TStopwatch.h" 49 #include "TPaveLabel.h" 70 " Creating SiPixelInformationExtractor " <<
"\n" ;
81 " Deleting SiPixelInformationExtractor " <<
"\n" ;
98 if( qtype.find(
"TH1") != string::npos )
101 }
else if ( qtype.find(
"TH2") != string::npos ) {
103 }
else if ( qtype.find(
"TH3") != string::npos ) {
116 vector<string>&
items) {
118 for (multimap<string, string>::const_iterator it = req_map.begin();
119 it != req_map.end(); it++) {
120 if (it->first == item_name) {
121 items.push_back(it->second);
133 multimap<string,string>::iterator
pos = req_map.find(item_name);
134 if (pos != req_map.end())
return true;
145 std::multimap<std::string,std::string>::const_iterator
pos = req_map.find(item_name);
147 if (pos != req_map.end()) {
154 std::multimap<std::string,std::string>::iterator
pos = req_map.find(item_name);
156 if (pos != req_map.end()) {
170 else col =
"#0000ff";
178 for (vector<QReport*>::const_iterator it = reports.begin(); it != reports.end();
180 status = (*it)->getStatus();
181 if (status > istat) istat =
status;
193 else name=
"images/LI_blue.gif";
201 for (vector<QReport*>::const_iterator it = reports.begin(); it != reports.end();
203 status = (*it)->getStatus();
204 if (status > istat) istat =
status;
215 pair<double,double> & norm)
217 double normalizationX = 1 ;
218 double normalizationY = 1 ;
224 pair<double,double> normX ;
225 pair<double,double> normY ;
229 if( theMEType.find(
"TH1") != string::npos)
231 meanX = (double)theME->
getMean();
233 normalizationX = fabs( normX.second - normX.first) ;
234 if( normalizationX == 0 ) {normalizationX=1.E-20;}
235 colorValue = meanX / normalizationX ;
236 norm.first = normX.first ;
237 norm.second = normX.second ;
240 if( theMEType.find(
"TH2") != string::npos)
242 meanX = (double)theME->
getMean(1);
243 meanY = (double)theME->
getMean(2);
245 normalizationX = fabs( normX.second - normX.first) ;
246 normalizationY = fabs( normY.second - normY.first) ;
247 if( normalizationX == 0 ) {normalizationX=1.E-20;}
248 if( normalizationY == 0 ) {normalizationY=1.E-20;}
249 double cVX = meanX / normalizationX ;
250 double cVY = meanY / normalizationY ;
251 colorValue =
sqrt(cVX*cVX + cVY*cVY) ;
252 if( normalizationX >= normalizationY )
254 norm.first = normX.first;
255 norm.second = normX.second ;
257 norm.first = normY.first;
258 norm.second = normY.second ;
270 pair<double,double>& norm,
274 double normHigh = 0 ;
276 if( theMEType.find(
"TH1") != string::npos)
279 norm.first = normLow ;
280 norm.second = normHigh ;
289 pair<double,double>& normX,
290 pair<double,double>& normY,
294 double normHigh = 0 ;
296 if( theMEType.find(
"TH2") != string::npos )
299 normX.first = normLow ;
300 normX.second = normHigh ;
302 normY.first = normLow ;
303 normY.second = normHigh ;
314 const string& mEName = mE->
getName();
318 if( mEName.find(
"_3") != string::npos )
320 string detIdString = mEName.substr((mEName.find_last_of(
"_"))+1,9);
321 std::istringstream isst;
322 isst.str(detIdString);
362 nevents_ = (iGetter.
get(
"Pixel/EventInfo/processedEvents"))->getIntValue();
366 myfile_.open (
"NoisyPixelList.txt", ios::app);
367 myfile_ <<
"Noise summary, ran over " <<
nevents_ <<
" events, threshold was set to " << noiseRate_ << std::endl;
369 string currDir = iBooker.
pwd();
370 string dname = currDir.substr(currDir.find_last_of(
"/")+1);
373 if(dname.find(
"Module_")!=string::npos){
374 vector<string> meVec = iGetter.
getMEs();
375 for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
376 string full_path = currDir +
"/" + (*it);
377 if(full_path.find(
"hitmap_siPixelDigis")!=string::npos){
380 int detid=
getDetId(me);
int pixcol=-1;
int pixrow=-1;
381 std::vector<std::pair<std::pair<int, int>,
float> > noisyPixelsInModule;
382 TH2F * hothisto = me->
getTH2F();
384 for(
int i=1;
i!=hothisto->GetNbinsX()+1;
i++){
385 for(
int j=1; j!=hothisto->GetNbinsY()+1; j++){
387 if(me->
getPathname().find(
"Barrel")!=string::npos){
390 }
else if(me->
getPathname().find(
"Endcap")!=string::npos){
394 if(value > noiseRate_){
398 std::pair<int, int> address(pixcol, pixrow);
399 std::pair<std::pair<int, int>,
float> PixelStats(address, value);
400 noisyPixelsInModule.push_back(PixelStats);
409 vector<string> subDirVec = iGetter.
getSubdirs();
410 for (vector<string>::const_iterator ic = subDirVec.begin();
411 ic != subDirVec.end(); ic++) {
412 if((*ic).find(
"AdditionalPixelErrors")!=string::npos)
continue;
416 findNoisyPixels(iBooker,iGetter,init,noiseRate_,noiseRateDenominator_,theCablingMap);
424 if(currDir ==
"Pixel/EventInfo/reportSummaryContents"){
425 std::vector<std::pair<sipixelobjects::DetectorIndex,double> > pixelvec;
426 std::map<uint32_t,int> myfedmap;
427 std::map<uint32_t,std::string> mynamemap;
430 int n_noisyrocs_all = 0;
431 int n_noisyrocs_barrel = 0;
432 int n_noisyrocs_endcap = 0;
433 int n_verynoisyrocs_all = 0;
434 int n_verynoisyrocs_barrel = 0;
435 int n_verynoisyrocs_endcap = 0;
437 for(
int fid = 0; fid < 40; fid++){
438 for(
std::map<uint32_t, std::vector< std::pair<std::pair<int, int>,
float> > >::const_iterator it =
noisyDetIds_.begin();
440 uint32_t detid = (*it).first;
441 std::vector< std::pair<std::pair<int, int>,
float> > noisyPixels = (*it).second;
443 for(
int fedid=0; fedid<=40; ++fedid){
445 uint32_t newDetId = detid;
451 if(fid == realfedID){
452 if(realfedID==-1)
continue;
454 uint32_t detSubId = detId.
subdetId();
456 bool HalfModule =
false;
459 outputname = nameworker.
name();
460 }
else if(detSubId == 1){
462 outputname = nameworker.
name();
468 std::map<int,int> myrocmap;
469 myfedmap[detid]=realfedID;
472 for(std::vector< std::pair< std::pair<int,int>,
float> >::const_iterator pxl = noisyPixels.begin();
473 pxl != noisyPixels.end(); pxl++){
474 std::pair<int,int> offlineaddress = (*pxl).first;
475 float Noise_frac = (*pxl).second;
476 int offlineColumn = offlineaddress.first;
477 int offlineRow = offlineaddress.second;
483 formatter.toCabling(cabling,detector);
491 assert(realfedID >= 0);
492 assert(cabling.
link >= 0);
493 assert(cabling.
roc >= 0);
495 static_cast<unsigned int>(cabling.
link),
496 static_cast<unsigned int>(cabling.
roc)};
500 int onlineColumn = locpixel.
rocCol();
501 int onlineRow= locpixel.
rocRow();
510 if((detSubId == 1) && (outputname.find(
"mO")!=string::npos || outputname.find(
"mI")!=string::npos) && (HalfModule)){
517 myfile_ <<
"NAME: "<<outputname<<
" , DETID: "<<detid<<
" , OFFLINE: col,row: "<<offlineColumn<<
","<<offlineRow<<
" \t , ONLINE: roc,col,row: "<<rocnumber<<
","<<onlineColumn<<
","<<onlineRow<<
" \t , fed,dcol,pixid,link: "<<realfedID<<
","<<loc.
dcol<<
","<<loc.
pxid<<
","<<cabling.
link <<
", Noise fraction: " << Noise_frac << std::endl;
519 for(std::map<int, int>::const_iterator nrc = myrocmap.begin(); nrc != myrocmap.end(); nrc++){
520 if((*nrc).second > 0){
523 n_noisyrocs_endcap++;
524 }
else if(detSubId == 1){
525 n_noisyrocs_barrel++;}
527 if((*nrc).second > 40){
528 n_verynoisyrocs_all++;
530 n_verynoisyrocs_endcap++;
531 }
else if(detSubId == 1){
532 n_verynoisyrocs_barrel++;}
539 myfile_ <<
"There are " << n_noisyrocs_all <<
" noisy ROCs (ROCs with at least 1 noisy pixel) in the entire detector. " << n_noisyrocs_endcap <<
" are in the FPIX and " << n_noisyrocs_barrel <<
" are in the BPIX. " << endl;
540 myfile_ <<
"There are " << n_verynoisyrocs_all <<
" highly noisy ROCs (ROCs with at least 10% of all pixels passing the noise threshold) in the entire detector. " << n_verynoisyrocs_endcap <<
" are in the FPIX and " << n_verynoisyrocs_barrel <<
" are in the BPIX. " << endl;
const std::string & getPathname() const
get pathname of parent folder
TObject * getRootObject() const
MonitorElement * get(const std::string &path)
const std::string & getName() const
get name of ME
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
identify pixel inside single ROC
std::string name() const override
from base class
bool isHalfModule() const
full or half module
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
MonitorElement * book1D(Args &&...args)
std::string name() const override
from base class
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
double collumn and pixel ID in double collumn representation
void setCurrentFolder(const std::string &fullpath)
const std::string & pwd()
int getNbinsY() const
get # of bins in Y-axis
return(e1-e2)*(e1-e2)+dp *dp
void setCurrentFolder(const std::string &fullpath)
std::vector< std::string > getSubdirs()
static const int STATUS_OK
int getNbinsX() const
get # of bins in X-axis
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const override
std::vector< std::string > getMEs()
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const