26 #include "TPaveStats.h" 67 void read(
bool aMechView,
70 std::vector<std::unique_ptr<TkHistoMap>>& aTkMapVec,
71 std::vector<bool>& aValidVec);
110 : fileName_(iConfig.getUntrackedParameter<
std::
string>(
"InputFileName",
"DQMStore.root")),
111 mechanicalView_(iConfig.getUntrackedParameter<
bool>(
"MechanicalView",
true)),
112 folderName_(iConfig.getUntrackedParameter<
std::
string>(
"HistogramFolderName",
"DQMData/")),
113 printDebug_(iConfig.getUntrackedParameter<unsigned
int>(
"PrintDebugMessages", 1)),
114 doDiff_(iConfig.getUntrackedParameter<
bool>(
"DoDifference",
false)),
115 fileNameDiff_(iConfig.getUntrackedParameter<
std::
string>(
"InputFileNameForDiff",
"DQMStore.root")),
116 tkHistoMapNameVec_(iConfig.getUntrackedParameter<
std::
vector<
std::
string>>(
"TkHistoMapNameVec")),
117 minVal_(iConfig.getUntrackedParameter<
std::
vector<double>>(
"MinValueVec")),
118 maxVal_(iConfig.getUntrackedParameter<
std::
vector<double>>(
"MaxValueVec")),
144 std::vector<std::unique_ptr<TkHistoMap>>& aTkMapVec,
145 std::vector<bool>& aValidVec) {
147 lDqmStore->
open(aFile);
150 aTkMapVec.reserve(nHists);
151 aValidVec.reserve(nHists);
156 dirName += aFile.substr(aFile.find_last_of(
'_') + 5, 6);
157 dirName +=
"/SiStrip/Run summary";
163 unsigned int nFailTot = 0;
164 unsigned int nTotTot = 0;
165 for (
unsigned int i(0);
i < nHists;
i++) {
166 std::unique_ptr<TkHistoMap> tkHistoMap{
new TkHistoMap(tkDetMap)};
170 std::vector<MonitorElement*>& lMaps = tkHistoMap->getAllMaps();
172 std::cout <<
" -- map " <<
i <<
", nHistos = " << lMaps.size() << std::endl;
173 unsigned int nFail = 0;
174 unsigned int nTot = 0;
176 for (
unsigned int im(0); im < lMaps.size(); im++) {
178 std::cout <<
" -- Failed to get element " << im <<
" for map " <<
i << std::endl;
187 aValidVec[
i] =
false;
188 aTkMapVec.emplace_back(
std::move(tkHistoMap));
191 if (nFailTot < nTotTot)
192 std::cout <<
" - " << nTotTot - nFailTot <<
"/" << nTotTot <<
" histomaps read with success for file ." << aFile
195 std::cout <<
" - Failed to read any map for file " << aFile <<
". Exiting line ... " << __LINE__ << std::endl;
312 std::cout <<
"End of analyze method: tkmap_ size = " <<
tkmap_.size() << std::endl;
335 std::cout <<
"tkmap_ is NULL for element " <<
i <<
"... continuing ..." << std::endl;
345 std::cout <<
"Warning, tkHistoMap is invalid for element " <<
i <<
"... continuing ..." << std::endl;
359 std::vector<MonitorElement*>& lMaps = aResult->
getAllMaps();
360 const std::vector<MonitorElement*>& lMapsDiff = aSubtr->
getAllMaps();
362 assert(lMaps.size() == lMapsDiff.size());
364 for (
unsigned int im(0); im < lMaps.size(); im++) {
365 if (!lMaps[im] || !lMapsDiff[im]) {
366 std::cout <<
" -- Failed to get element " << im <<
" for maps." << std::endl;
368 (lMaps[im]->getTProfile2D())->
Add(lMapsDiff[im]->getTProfile2D(), -1);
BuildTrackerMapPlugin(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
std::vector< std::string > tkHistoMapNameVec_
std::vector< double > minVal_
const std::vector< MonitorElement * > & getAllMaps() const
void read(bool aMechView, std::string aFile, const TkDetMap *tkDetMap, std::vector< std::unique_ptr< TkHistoMap >> &aTkMapVec, std::vector< bool > &aValidVec)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< double > maxVal_
std::vector< std::unique_ptr< TkHistoMap > > tkHistoMapVecDiff_
~BuildTrackerMapPlugin() override
void showPalette(bool printflag1)
dqm::legacy::DQMStore DQMStore
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 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)
bool getData(T &iHolder) const
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
std::string fileNameDiff_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
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)
dqm::legacy::MonitorElement MonitorElement
DQM_DEPRECATED bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)