26 #include "TPaveStats.h"
64 virtual void endJob()
override;
66 void read(
bool aMechView,
68 std::vector<TkHistoMap*> & aTkMapVec,
69 std::vector<bool> & aValidVec);
109 : fileName_(iConfig.getUntrackedParameter<std::
string>(
"InputFileName",
"DQMStore.root")),
110 mechanicalView_(iConfig.getUntrackedParameter<bool>(
"MechanicalView",
true)),
111 folderName_(iConfig.getUntrackedParameter<std::
string>(
"HistogramFolderName",
"DQMData/")),
112 printDebug_(iConfig.getUntrackedParameter<unsigned int>(
"PrintDebugMessages",1)),
113 doDiff_(iConfig.getUntrackedParameter<bool>(
"DoDifference",
false)),
114 fileNameDiff_(iConfig.getUntrackedParameter<std::
string>(
"InputFileNameForDiff",
"DQMStore.root")),
115 tkHistoMapNameVec_(iConfig.getUntrackedParameter<std::vector<std::
string> >(
"TkHistoMapNameVec")),
116 minVal_(iConfig.getUntrackedParameter<std::vector<double> >(
"MinValueVec")),
117 maxVal_(iConfig.getUntrackedParameter<std::vector<double> >(
"MaxValueVec")),
118 pset_(iConfig.getParameter<edm::
ParameterSet>(
"TkmapParameters"))
154 std::vector<TkHistoMap*> & aTkMapVec,
155 std::vector<bool> & aValidVec)
159 lDqmStore->
open(aFile);
160 std::vector<TkHistoMap *> tkHistoMap;
163 tkHistoMap.resize(nHists,0);
164 aValidVec.resize(nHists,
true);
169 dirName += aFile.substr(aFile.find_last_of(
"_")+5,6);
170 dirName +=
"/SiStrip/Run summary";
171 std::cout <<
" -- DirName = " << dirName << std::endl;
177 unsigned int nFailTot=0;
178 unsigned int nTotTot = 0;
179 for (
unsigned int i(0);
i<nHists;
i++){
185 std::vector<MonitorElement*>& lMaps = tkHistoMap[
i]->getAllMaps();
187 std::cout <<
" -- map " <<
i <<
", nHistos = " << lMaps.size() << std::endl;
188 unsigned int nFail=0;
191 for (
unsigned int im(0); im<lMaps.size(); im++){
193 std::cout <<
" -- Failed to get element " << im <<
" for map " <<
i << std::endl;
201 if (nFail == nTot) aValidVec[
i] =
false;
202 aTkMapVec.push_back(tkHistoMap[
i]);
205 if (nFailTot < nTotTot)
std::cout <<
" - " << nTotTot-nFailTot <<
"/" << nTotTot
206 <<
" histomaps read with success for file ." << aFile << std::endl;
208 std::cout <<
" - Failed to read any map for file " << aFile <<
". Exiting line ... " << __LINE__ << std::endl;
333 std::cout <<
"End of analyze method: tkmap_ size = " <<
tkmap_.size() << std::endl;
363 std::cout <<
"tkmap_ is NULL for element " <<
i <<
"... continuing ..." << std::endl;
374 std::cout <<
"Warning, tkHistoMap is invalid for element " <<
i <<
"... continuing ..." << std::endl;
399 std::vector<MonitorElement*>& lMaps = aResult->
getAllMaps();
400 std::vector<MonitorElement*>& lMapsDiff = aSubtr->
getAllMaps();
402 assert(lMaps.size() == lMapsDiff.size());
404 for (
unsigned int im(0); im<lMaps.size(); im++){
405 if (!lMaps[im] || !lMapsDiff[im]) {
406 std::cout <<
" -- Failed to get element " << im <<
" for maps." << std::endl;
409 (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_
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)
T const * product() const
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_