12 using namespace sistrip;
25 mask_(pset.existsAs<bool>(
"vetoModules") ? pset.getParameter<bool>(
"vetoModules") :
true),
26 fedMaskVector_(pset.existsAs<std::
vector<uint32_t> >(
"fedMaskVector")
27 ? pset.getParameter<std::
vector<uint32_t> >(
"fedMaskVector")
28 : std::
vector<uint32_t>()),
29 fecMaskVector_(pset.existsAs<std::
vector<uint32_t> >(
"fecMaskVector")
30 ? pset.getParameter<std::
vector<uint32_t> >(
"fecMaskVector")
31 : std::
vector<uint32_t>()),
32 ringVector_(pset.existsAs<std::
vector<uint32_t> >(
"ringVector")
33 ? pset.getParameter<std::
vector<uint32_t> >(
"ringVector")
34 : std::
vector<uint32_t>()),
35 ccuVector_(pset.existsAs<std::
vector<uint32_t> >(
"ccuVector")
36 ? pset.getParameter<std::
vector<uint32_t> >(
"ccuVector")
37 : std::
vector<uint32_t>()),
38 i2cChanVector_(pset.existsAs<std::
vector<uint32_t> >(
"i2cChanVector")
39 ? pset.getParameter<std::
vector<uint32_t> >(
"i2cChanVector")
40 : std::
vector<uint32_t>()),
41 lldChanVector_(pset.existsAs<std::
vector<uint32_t> >(
"lldChanVector")
42 ? pset.getParameter<std::
vector<uint32_t> >(
"lldChanVector")
43 : std::
vector<uint32_t>()),
45 dataWithMaskCached_(
false) {
47 <<
" Constructing object...";
52 <<
" NULL pointer to DQMStore!";
68 dataWithMaskCached_(
false) {
70 <<
" Constructing object...";
77 <<
" Destructing object...";
85 ss <<
" [Histo::" << __func__ <<
"]" << std::endl
86 <<
" Histogram title : " <<
title_ << std::endl
87 <<
" MonitorElement* : 0x" << std::hex << std::setw(8) << std::setfill(
'0') <<
me_ << std::endl
88 <<
std::dec <<
" CollateME* : 0x" << std::hex << std::setw(8) << std::setfill(
'0') <<
cme_ << std::endl
96 if (contents.empty()) {
98 <<
" Found no histograms!";
103 std::vector<std::string>::const_iterator istr = contents.begin();
104 while (istr != contents.end()) {
106 std::string source_dir = istr->substr(0, istr->find(
":"));
113 client_dir = client_dir.substr(0, client_dir.size() - 1);
118 std::vector<MonitorElement*> me_list = bei->
getContents(source_dir);
119 std::vector<MonitorElement*>::iterator ime = me_list.begin();
120 for (; ime != me_list.end(); ime++) {
123 <<
" NULL pointer to MonitorElement!";
132 if (pos != std::string::npos) {
134 if (!value.empty()) {
136 <<
" Found string \"" << title.substr(pos, std::string::npos) <<
"\" with value \""
138 if (!(bei->
get(client_dir +
"/" + title.substr(pos, std::string::npos)))) {
142 <<
" Booked string \"" << title.substr(pos, std::string::npos)
143 <<
"\" in directory \"" << client_dir <<
"\"";
146 std::stringstream
ss;
163 if (contents.empty()) {
165 <<
" Found no histograms!";
170 std::vector<std::string>::const_iterator istr = contents.begin();
171 while (istr != contents.end()) {
173 std::string source_dir = istr->substr(0, istr->find(
":"));
180 client_dir = client_dir.substr(0, client_dir.size() - 1);
185 std::vector<MonitorElement*> me_list = bei->
getContents(source_dir);
187 if (me_list.empty()) {
189 <<
" No MonitorElements found in dir " << source_dir;
193 std::vector<MonitorElement*>::iterator ime = me_list.begin();
194 for (; ime != me_list.end(); ime++) {
197 <<
" NULL pointer to MonitorElement!";
206 if (pos != std::string::npos) {
208 if (!value.empty()) {
210 <<
" Found string \"" << title.substr(pos, std::string::npos) <<
"\" with value \""
212 if (!(bei->
get(client_dir +
sistrip::dir_ + title.substr(pos, std::string::npos)))) {
216 <<
" Booked string \"" << title.substr(pos, std::string::npos)
217 <<
"\" in directory \"" << client_dir <<
"\"";
228 <<
" Unable to extract RunType!";
236 if (contents.empty()) {
238 <<
" Found no histograms!";
243 std::vector<std::string>::const_iterator istr = contents.begin();
244 while (istr != contents.end()) {
246 std::string source_dir = istr->substr(0, istr->find(
":"));
253 client_dir = client_dir.substr(0, client_dir.size() - 1);
257 std::vector<MonitorElement*> me_list = bei->
getContents(source_dir);
258 std::vector<MonitorElement*>::iterator ime = me_list.begin();
259 for (; ime != me_list.end(); ime++) {
262 <<
" NULL pointer to MonitorElement!";
269 if (pos == std::string::npos)
270 pos = title.find(
"isha");
271 if (pos == std::string::npos)
272 pos = title.find(
"vfs");
273 if (pos != std::string::npos) {
274 int value = (*ime)->getIntValue();
277 <<
"[CommissioningHistograms::" << __func__ <<
"]"
278 <<
" Found \"" << title.substr(pos, std::string::npos) <<
"\" with value \"" << value <<
"\"";
279 if (!(bei->
get(client_dir +
"/" + title.substr(pos, std::string::npos)))) {
281 bei->
bookInt(title.substr(pos, std::string::npos))->
Fill(value);
283 <<
"[CommissioningHistograms::" << __func__ <<
"]"
284 <<
" Booked \"" << title.substr(pos, std::string::npos) <<
"\" in directory \"" << client_dir <<
"\"";
299 <<
" Extracting available histograms...";
304 <<
" NULL pointer to DQMStore!";
309 if (contents.empty()) {
311 <<
" Empty contents vector!";
316 std::vector<std::string>::const_iterator idir;
317 for (idir = contents.begin(); idir != contents.end(); idir++) {
324 std::string source_dir = idir->substr(0, idir->find(
":"));
357 client_dir = client_dir.substr(0, client_dir.size() - 1);
365 std::vector<MonitorElement*>::iterator ime = me_list.begin();
366 for (; ime != me_list.end(); ime++) {
378 std::stringstream
ss;
379 ss <<
"[CommissioningHistograms::" << __func__ <<
"]"
380 <<
" Unexpected granularity for histogram title: " << std::endl
381 <<
title <<
" found in path " << std::endl
385 channel =
title.channel();
421 HistosMap::iterator ihistos =
histos_.find(key);
422 if (ihistos !=
histos_.end()) {
423 Histos::iterator ihis = ihistos->second.begin();
424 while (!histo && ihis < ihistos->
second.end()) {
425 if ((*ime)->getName() == (*ihis)->title_) {
436 histo->
title_ = (*ime)->getName();
440 histo->
me_ =
bei_->
get(client_dir +
"/" + (*ime)->getName());
443 <<
" NULL pointer to MonitorElement!";
453 <<
" Found histograms for " <<
histos_.size()
454 <<
" structures in cached histogram map!";
461 <<
" (Derived) implementation to come...";
467 Analyses::iterator ianal =
data().begin();
468 Analyses::iterator janal =
data().end();
469 for (; ianal != janal; ++ianal) {
471 std::stringstream
ss;
472 ianal->second->print(ss);
473 if (ianal->second->isValid()) {
485 std::stringstream
good;
486 std::stringstream bad;
488 Analyses::iterator ianal =
data().begin();
489 Analyses::iterator janal =
data().end();
490 for (; ianal != janal; ++ianal) {
492 if (ianal->second->isValid()) {
493 ianal->second->summary(good);
495 ianal->second->summary(bad);
500 if (good.str().empty()) {
501 good <<
"None found!";
504 <<
" Printing summary of good analyses:"
508 if (bad.str().empty()) {
512 <<
" Printing summary of bad analyses:"
521 <<
" Printing histogram map, which has " <<
histos_.size() <<
" entries...";
522 HistosMap::const_iterator ihistos =
histos_.begin();
523 for (; ihistos !=
histos_.end(); ihistos++) {
524 std::stringstream
ss;
525 ss <<
" Found " << ihistos->second.size() <<
" histogram(s) for key: " << std::endl
527 Histos::const_iterator ihisto = ihistos->second.begin();
528 for (; ihisto != ihistos->second.end(); ihisto++) {
530 (*ihisto)->
print(ss);
532 ss <<
" NULL pointer to Histo object!";
543 <<
" Clearing histogram map...";
544 HistosMap::iterator ihistos =
histos_.begin();
545 for (; ihistos !=
histos_.end(); ihistos++) {
546 Histos::iterator ihisto = ihistos->second.begin();
547 for (; ihisto != ihistos->second.end(); ihisto++) {
552 ihistos->second.clear();
579 <<
" No analyses generated!";
594 summary =
histogram(mon, pres, view, dir, xbins);
613 std::stringstream
ss;
617 if (ss.str().find(
".root") == std::string::npos) {
625 if (std::getenv(scratch.c_str()) !=
nullptr) {
626 dir = std::getenv(scratch.c_str());
637 if (partitionName.empty())
641 << run_number <<
".root";
646 <<
" Saving histograms to root file"
647 <<
" (This may take some time!)";
651 <<
" Saved histograms to root file \"" << ss.str() <<
"\"!";
660 const uint32_t&
xbins,
662 const float& xhigh) {
673 float high =
static_cast<float>(
xbins);
676 me =
bei_->
book1D(name, name, xbins, xlow, xhigh);
678 me =
bei_->
book1D(name, name, xbins, 0., high);
681 me =
bei_->
book1D(name, name, xbins, 0., high);
690 <<
"\" Unable to create summary plot!";
696 <<
" Created summary plot with name \"" << me->
getName() <<
"\" in directory \""
700 <<
" NULL pointer to MonitorElement!"
701 <<
" Unable to create summary plot!";
708 <<
" Unable to extract root object!"
709 <<
" Returning NULL pointer!";
725 Analyses::iterator ianal =
data_.begin();
726 Analyses::iterator janal =
data_.end();
727 for (; ianal != janal; ++ianal) {
731 bool maskThisAnal_ =
false;
734 maskThisAnal_ =
true;
744 maskThisAnal_ =
true;
747 if (
mask_ && !maskThisAnal_)
749 else if (!
mask_ && maskThisAnal_)
static std::string name(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
static const char runNumber_[]
Log< level::Info, true > LogVerbatim
void save(std::string &filename, uint32_t run_number=0, std::string partitionName="")
void print(std::stringstream &ss) const override
std::vector< uint32_t > lldChanVector_
const uint32_t & fedKey() const
TH1 * histogram(const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1.*sistrip::invalid_, const float &xhigh=1.*sistrip::invalid_)
Analyses & data(bool getMaskedData=false)
const uint16_t & fecRing() const
void print(std::stringstream &) const
Utility class that holds histogram title.
A container class for generic run and event-related info, information required by the commissioning a...
CommissioningHistograms()
static const uint32_t invalid32_
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
std::vector< uint32_t > fecMaskVector_
static const char dqmClientFileName_[]
void setCurrentFolder(std::string const &fullpath) override
std::vector< uint32_t > ccuVector_
const std::string & getName() const
get name of ME
static const char mlDqmClient_[]
const uint16_t & lldChan() const
static const uint16_t FED_ADC_RANGE
virtual void printAnalyses()
std::string pwd() override
const uint16_t & fecSlot() const
Log< level::Error, false > LogError
static const uint16_t valid_
virtual void printSummary()
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
const uint32_t & key() const
static const char undefinedView_[]
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
const sistrip::Granularity & granularity() const
U second(std::pair< T, U > const &p)
static std::string view(const sistrip::View &)
static std::string runType(const sistrip::RunType &)
std::vector< uint32_t > i2cChanVector_
std::vector< uint32_t > fedMaskVector_
void extractHistograms(const std::vector< std::string > &)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static sistrip::RunType runType(DQMStore *const, const std::vector< std::string > &)
static const char taskId_[]
virtual MonitorElement * get(std::string const &fullpath) const
uint32_t init(const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &top_level_dir, const sistrip::Granularity &, const std::map< uint32_t, CommissioningAnalysis * > &data)
tuple key
prepare the HTCondor submission files and eventually submit them
DQMStore *const bei() const
Base utility class that identifies a position within a logical structure of the strip tracker...
const uint32_t & fecKey() const
const std::string & path() const
static uint32_t runNumber(DQMStore *const, const std::vector< std::string > &)
Utility class that identifies a position within the strip tracker geometrical structure, down to the level of an APV25 chip.
int extract(std::vector< int > *output, const std::string &dati)
auto const good
min quality of good
virtual ~CommissioningHistograms()
static std::string presentation(const sistrip::Presentation &)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
const uint16_t & ccuAddr() const
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
static const uint16_t invalid_
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
virtual void createSummaryHisto(const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
static void copyCustomInformation(DQMStore *const, const std::vector< std::string > &)
std::map< uint32_t, CommissioningAnalysis * > Analyses
const uint16_t & ccuChan() const
const uint16_t & fedId() const
Abstract base for derived classes that provide analysis of commissioning histograms.
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
static const char collate_[]
void remove(std::string pattern="")
std::vector< uint32_t > ringVector_
void fill(TH1 &summary_histo)
virtual void histoAnalysis(bool debug)