26 #include "TPaveStats.h"
62 virtual void endJob()
override;
64 void read(
bool aMechView,
66 std::vector<TkHistoMap*> & aTkMapVec,
67 std::vector<bool> & aValidVec);
107 : fileName_(iConfig.getUntrackedParameter<std::
string>(
"InputFileName",
"DQMStore.root")),
108 mechanicalView_(iConfig.getUntrackedParameter<bool>(
"MechanicalView",
true)),
109 folderName_(iConfig.getUntrackedParameter<std::
string>(
"HistogramFolderName",
"DQMData/")),
110 printDebug_(iConfig.getUntrackedParameter<unsigned int>(
"PrintDebugMessages",1)),
111 doDiff_(iConfig.getUntrackedParameter<bool>(
"DoDifference",
false)),
112 fileNameDiff_(iConfig.getUntrackedParameter<std::
string>(
"InputFileNameForDiff",
"DQMStore.root")),
113 tkHistoMapNameVec_(iConfig.getUntrackedParameter<std::vector<std::
string> >(
"TkHistoMapNameVec")),
114 minVal_(iConfig.getUntrackedParameter<std::vector<double> >(
"MinValueVec")),
115 maxVal_(iConfig.getUntrackedParameter<std::vector<double> >(
"MaxValueVec")),
116 pset_(iConfig.getParameter<edm::
ParameterSet>(
"TkmapParameters"))
152 std::vector<TkHistoMap*> & aTkMapVec,
153 std::vector<bool> & aValidVec)
157 lDqmStore->
open(aFile);
158 std::vector<TkHistoMap *> tkHistoMap;
161 tkHistoMap.resize(nHists,0);
162 aValidVec.resize(nHists,
true);
167 dirName += aFile.substr(aFile.find_last_of(
"_")+5,6);
168 dirName +=
"/SiStrip/Run summary";
169 std::cout <<
" -- DirName = " << dirName << std::endl;
175 unsigned int nFailTot=0;
176 unsigned int nTotTot = 0;
177 for (
unsigned int i(0);
i<nHists;
i++){
183 std::vector<MonitorElement*>& lMaps = tkHistoMap[
i]->getAllMaps();
185 std::cout <<
" -- map " <<
i <<
", nHistos = " << lMaps.size() << std::endl;
186 unsigned int nFail=0;
189 for (
unsigned int im(0); im<lMaps.size(); im++){
191 std::cout <<
" -- Failed to get element " << im <<
" for map " <<
i << std::endl;
199 if (nFail == nTot) aValidVec[
i] =
false;
200 aTkMapVec.push_back(tkHistoMap[
i]);
203 if (nFailTot < nTotTot)
std::cout <<
" - " << nTotTot-nFailTot <<
"/" << nTotTot
204 <<
" histomaps read with success for file ." << aFile << std::endl;
206 std::cout <<
" - Failed to read any map for file " << aFile <<
". Exiting line ... " << __LINE__ << std::endl;
327 std::cout <<
"End of analyze method: tkmap_ size = " <<
tkmap_.size() << std::endl;
357 std::cout <<
"tkmap_ is NULL for element " <<
i <<
"... continuing ..." << std::endl;
368 std::cout <<
"Warning, tkHistoMap is invalid for element " <<
i <<
"... continuing ..." << std::endl;
393 std::vector<MonitorElement*>& lMaps = aResult->
getAllMaps();
394 std::vector<MonitorElement*>& lMapsDiff = aSubtr->
getAllMaps();
396 assert(lMaps.size() == lMapsDiff.size());
398 for (
unsigned int im(0); im<lMaps.size(); im++){
399 if (!lMaps[im] || !lMapsDiff[im]) {
400 std::cout <<
" -- Failed to get element " << im <<
" for maps." << std::endl;
403 (lMaps[im]->getTProfile2D())->Add(lMapsDiff[im]->
getTProfile2D(),-1);
BuildTrackerMapPlugin(const edm::ParameterSet &)
std::vector< MonitorElement * > & getAllMaps()
#define DEFINE_FWK_MODULE(type)
std::vector< std::string > tkHistoMapNameVec_
std::vector< double > minVal_
std::vector< double > maxVal_
void showPalette(bool printflag1)
void setPalette(int numpalette)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
std::vector< TkHistoMap * > tkHistoMapVec_
TProfile2D * getTProfile2D(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
std::string fileNameDiff_
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=100+(90+100)*31+300, int height=150+(2940+150)*1+300)
std::vector< TrackerMap * > tkmap_
virtual void endJob() override
void read(bool aMechView, std::string aFile, std::vector< TkHistoMap * > &aTkMapVec, std::vector< bool > &aValidVec)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< bool > isValidMapDiff_
std::vector< bool > isValidMap_
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
volatile std::atomic< bool > shutdown_flag false
void subtractMap(TkHistoMap *&aResult, TkHistoMap *&aSubtr)
virtual void beginJob() override
std::vector< TkHistoMap * > tkHistoMapVecDiff_