26 #include "TPaveStats.h" 66 void read(
bool aMechView,
69 std::vector<std::unique_ptr<TkHistoMap>> & aTkMapVec,
70 std::vector<bool> & aValidVec);
110 :
fileName_(iConfig.getUntrackedParameter<
std::
string>(
"InputFileName",
"DQMStore.root")),
113 printDebug_(iConfig.getUntrackedParameter<unsigned
int>(
"PrintDebugMessages",1)),
117 minVal_(iConfig.getUntrackedParameter<
std::vector<double> >(
"MinValueVec")),
118 maxVal_(iConfig.getUntrackedParameter<
std::vector<double> >(
"MaxValueVec")),
146 std::vector<std::unique_ptr<TkHistoMap>>& aTkMapVec,
147 std::vector<bool>& aValidVec)
151 lDqmStore->
open(aFile);
154 aTkMapVec.reserve(nHists);
155 aValidVec.reserve(nHists);
160 dirName += aFile.substr(aFile.find_last_of(
"_")+5,6);
161 dirName +=
"/SiStrip/Run summary";
162 std::cout <<
" -- DirName = " << dirName << std::endl;
168 unsigned int nFailTot=0;
169 unsigned int nTotTot = 0;
170 for (
unsigned int i(0);
i<nHists;
i++){
172 std::unique_ptr<TkHistoMap> tkHistoMap{
new TkHistoMap(tkDetMap)};
176 std::vector<MonitorElement*>& lMaps = tkHistoMap->getAllMaps();
178 std::cout <<
" -- map " <<
i <<
", nHistos = " << lMaps.size() << std::endl;
179 unsigned int nFail=0;
182 for (
unsigned int im(0); im<lMaps.size(); im++){
184 std::cout <<
" -- Failed to get element " << im <<
" for map " <<
i << std::endl;
192 if (nFail == nTot) aValidVec[
i] =
false;
193 aTkMapVec.emplace_back(
std::move(tkHistoMap));
196 if (nFailTot < nTotTot)
std::cout <<
" - " << nTotTot-nFailTot <<
"/" << nTotTot
197 <<
" histomaps read with success for file ." << aFile << std::endl;
199 std::cout <<
" - Failed to read any map for file " << aFile <<
". Exiting line ... " << __LINE__ << std::endl;
306 static bool firstEvent =
true;
332 std::cout <<
"End of analyze method: tkmap_ size = " <<
tkmap_.size() << std::endl;
362 std::cout <<
"tkmap_ is NULL for element " <<
i <<
"... continuing ..." << std::endl;
373 std::cout <<
"Warning, tkHistoMap is invalid for element " <<
i <<
"... continuing ..." << std::endl;
397 std::vector<MonitorElement*>& lMaps = aResult->
getAllMaps();
398 const std::vector<MonitorElement*>& lMapsDiff = aSubtr->
getAllMaps();
400 assert(lMaps.size() == lMapsDiff.size());
402 for (
unsigned int im(0); im<lMaps.size(); im++){
403 if (!lMaps[im] || !lMapsDiff[im]) {
404 std::cout <<
" -- Failed to get element " << im <<
" for maps." << std::endl;
407 (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_
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_
~BuildTrackerMapPlugin() override
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)
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
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)
T const * product() const