26 #include "TPaveStats.h" 68 void read(
bool aMechView,
71 std::vector<std::unique_ptr<TkHistoMap>>& aTkMapVec,
72 std::vector<bool>& aValidVec);
107 :
fileName_(iConfig.getUntrackedParameter<
std::
string>(
"InputFileName",
"DQMStore.root")),
110 printDebug_(iConfig.getUntrackedParameter<unsigned
int>(
"PrintDebugMessages", 1)),
114 minVal_(iConfig.getUntrackedParameter<
std::vector<double>>(
"MinValueVec")),
115 maxVal_(iConfig.getUntrackedParameter<
std::vector<double>>(
"MaxValueVec")),
138 std::vector<std::unique_ptr<TkHistoMap>>& aTkMapVec,
139 std::vector<bool>& aValidVec) {
141 lDqmStore->
open(aFile);
144 aTkMapVec.reserve(nHists);
145 aValidVec.reserve(nHists);
148 if (dirName.empty()) {
150 dirName += aFile.substr(aFile.find_last_of(
"_") + 5, 6);
151 dirName +=
"/SiStrip/Run summary";
152 std::cout <<
" -- DirName = " << dirName << std::endl;
158 unsigned int nFailTot = 0;
159 unsigned int nTotTot = 0;
160 for (
unsigned int i(0);
i < nHists;
i++) {
161 std::unique_ptr<TkHistoMap> tkHistoMap{
new TkHistoMap(tkDetMap)};
165 std::vector<MonitorElement*>& lMaps = tkHistoMap->getAllMaps();
167 std::cout <<
" -- map " <<
i <<
", nHistos = " << lMaps.size() << std::endl;
168 unsigned int nFail = 0;
169 unsigned int nTot = 0;
171 for (
unsigned int im(0); im < lMaps.size(); im++) {
173 std::cout <<
" -- Failed to get element " << im <<
" for map " <<
i << std::endl;
182 aValidVec[
i] =
false;
183 aTkMapVec.emplace_back(
std::move(tkHistoMap));
186 if (nFailTot < nTotTot)
187 std::cout <<
" - " << nTotTot - nFailTot <<
"/" << nTotTot <<
" histomaps read with success for file ." << aFile
190 std::cout <<
" - Failed to read any map for file " << aFile <<
". Exiting line ... " << __LINE__ << std::endl;
314 std::cout <<
"End of analyze method: tkmap_ size = " <<
tkmap_.size() << std::endl;
337 std::cout <<
"tkmap_ is NULL for element " <<
i <<
"... continuing ..." << std::endl;
347 std::cout <<
"Warning, tkHistoMap is invalid for element " <<
i <<
"... continuing ..." << std::endl;
361 std::vector<MonitorElement*>& lMaps = aResult->
getAllMaps();
362 const std::vector<MonitorElement*>& lMapsDiff = aSubtr->
getAllMaps();
364 assert(lMaps.size() == lMapsDiff.size());
366 for (
unsigned int im(0); im < lMaps.size(); im++) {
367 if (!lMaps[im] || !lMapsDiff[im]) {
368 std::cout <<
" -- Failed to get element " << im <<
" for maps." << std::endl;
370 (lMaps[im]->getTProfile2D())->Add(lMapsDiff[im]->getTProfile2D(), -1);
BuildTrackerMapPlugin(const edm::ParameterSet &)
std::vector< std::string > tkHistoMapNameVec_
std::vector< double > minVal_
void read(bool aMechView, std::string aFile, const TkDetMap *tkDetMap, std::vector< std::unique_ptr< TkHistoMap >> &aTkMapVec, std::vector< bool > &aValidVec)
const std::vector< MonitorElement * > & getAllMaps() const
std::vector< double > maxVal_
std::vector< std::unique_ptr< TkHistoMap > > tkHistoMapVecDiff_
#define DEFINE_FWK_MODULE(type)
~BuildTrackerMapPlugin() override
void showPalette(bool printflag1)
dqm::legacy::DQMStore DQMStore
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::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)
void subtractMap(TkHistoMap *aResult, const TkHistoMap *aSubtr)
std::vector< TrackerMap * > tkmap_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< std::unique_ptr< TkHistoMap > > tkHistoMapVec_
std::vector< bool > isValidMapDiff_
std::vector< bool > isValidMap_
void loadTkHistoMap(const std::string &path, const std::string &MapName, bool mechanicalView=false)
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
T const * product() const
dqm::legacy::MonitorElement MonitorElement