diff --git a/DQM/EcalMonitorDbModule/interface/DBReaderWorkers.h b/DQM/EcalMonitorDbModule/interface/DBReaderWorkers.h index e190132c1b5f9..77e751fb5091e 100644 --- a/DQM/EcalMonitorDbModule/interface/DBReaderWorkers.h +++ b/DQM/EcalMonitorDbModule/interface/DBReaderWorkers.h @@ -11,303 +11,246 @@ #include namespace ecaldqm { -class DBReaderWorker { -public: - DBReaderWorker(std::string const &_name, edm::ParameterSet const &) - : name_(_name), verbosity_(0) {} - virtual ~DBReaderWorker() {} - - virtual std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) = 0; - - void setVerbosity(int _v) { verbosity_ = _v; } - - std::string const &getName() const { return name_; } - -protected: - std::string const name_; - int verbosity_; -}; - -class CrystalConsistencyReader : public DBReaderWorker { -public: - CrystalConsistencyReader(edm::ParameterSet const &_ps) - : DBReaderWorker("CrystalConsistencyReader", _ps) {} - ~CrystalConsistencyReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TTConsistencyReader : public DBReaderWorker { -public: - TTConsistencyReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TTConsistencyReader", _ps) {} - ~TTConsistencyReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class MemChConsistencyReader : public DBReaderWorker { -public: - MemChConsistencyReader(edm::ParameterSet const &_ps) - : DBReaderWorker("MemChConsistencyReader", _ps) {} - ~MemChConsistencyReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class MemTTConsistencyReader : public DBReaderWorker { -public: - MemTTConsistencyReader(edm::ParameterSet const &_ps) - : DBReaderWorker("MemTTConsistencyReader", _ps) {} - ~MemTTConsistencyReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class LaserBlueReader : public DBReaderWorker { -public: - LaserBlueReader(edm::ParameterSet const &_ps) - : DBReaderWorker("LaserBlueReader", _ps) {} - ~LaserBlueReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TimingLaserBlueCrystalReader : public DBReaderWorker { -public: - TimingLaserBlueCrystalReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TimingLaserBlueCrystalReader", _ps) {} - ~TimingLaserBlueCrystalReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PNBlueReader : public DBReaderWorker { -public: - PNBlueReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PNBlueReader", _ps) {} - ~PNBlueReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class LaserGreenReader : public DBReaderWorker { -public: - LaserGreenReader(edm::ParameterSet const &_ps) - : DBReaderWorker("LaserGreenReader", _ps) {} - ~LaserGreenReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TimingLaserGreenCrystalReader : public DBReaderWorker { -public: - TimingLaserGreenCrystalReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TimingLaserGreenCrystalReader", _ps) {} - ~TimingLaserGreenCrystalReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PNGreenReader : public DBReaderWorker { -public: - PNGreenReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PNGreenReader", _ps) {} - ~PNGreenReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class LaserIRedReader : public DBReaderWorker { -public: - LaserIRedReader(edm::ParameterSet const &_ps) - : DBReaderWorker("LaserIRedReader", _ps) {} - ~LaserIRedReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TimingLaserIRedCrystalReader : public DBReaderWorker { -public: - TimingLaserIRedCrystalReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TimingLaserIRedCrystalReader", _ps) {} - ~TimingLaserIRedCrystalReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PNIRedReader : public DBReaderWorker { -public: - PNIRedReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PNIRedReader", _ps) {} - ~PNIRedReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class LaserRedReader : public DBReaderWorker { -public: - LaserRedReader(edm::ParameterSet const &_ps) - : DBReaderWorker("LaserRedReader", _ps) {} - ~LaserRedReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TimingLaserRedCrystalReader : public DBReaderWorker { -public: - TimingLaserRedCrystalReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TimingLaserRedCrystalReader", _ps) {} - ~TimingLaserRedCrystalReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PNRedReader : public DBReaderWorker { -public: - PNRedReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PNRedReader", _ps) {} - ~PNRedReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PedestalsReader : public DBReaderWorker { -public: - PedestalsReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PedestalsReader", _ps) {} - ~PedestalsReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PNPedReader : public DBReaderWorker { -public: - PNPedReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PNPedReader", _ps) {} - ~PNPedReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PedestalsOnlineReader : public DBReaderWorker { -public: - PedestalsOnlineReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PedestalsOnlineReader", _ps) {} - ~PedestalsOnlineReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TestPulseReader : public DBReaderWorker { -public: - TestPulseReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TestPulseReader", _ps) {} - ~TestPulseReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PulseShapeReader : public DBReaderWorker { -public: - PulseShapeReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PulseShapeReader", _ps) {} - ~PulseShapeReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class PNMGPAReader : public DBReaderWorker { -public: - PNMGPAReader(edm::ParameterSet const &_ps) - : DBReaderWorker("PNMGPAReader", _ps) {} - ~PNMGPAReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TimingCrystalReader : public DBReaderWorker { -public: - TimingCrystalReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TimingCrystalReader", _ps) {} - ~TimingCrystalReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class Led1Reader : public DBReaderWorker { -public: - Led1Reader(edm::ParameterSet const &_ps) - : DBReaderWorker("Led1Reader", _ps) {} - ~Led1Reader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TimingLed1CrystalReader : public DBReaderWorker { -public: - TimingLed1CrystalReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TimingLed1CrystalReader", _ps) {} - ~TimingLed1CrystalReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class Led2Reader : public DBReaderWorker { -public: - Led2Reader(edm::ParameterSet const &_ps) - : DBReaderWorker("Led2Reader", _ps) {} - ~Led2Reader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class TimingLed2CrystalReader : public DBReaderWorker { -public: - TimingLed2CrystalReader(edm::ParameterSet const &_ps) - : DBReaderWorker("TimingLed2CrystalReader", _ps) {} - ~TimingLed2CrystalReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; - -class OccupancyReader : public DBReaderWorker { -public: - OccupancyReader(edm::ParameterSet const &_ps) - : DBReaderWorker("OccupancyReader", _ps) {} - ~OccupancyReader() override {} - - std::map run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) override; -}; -} // namespace ecaldqm + class DBReaderWorker { + public: + DBReaderWorker(std::string const &_name, edm::ParameterSet const &) : name_(_name), verbosity_(0) {} + virtual ~DBReaderWorker() {} + + virtual std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) = 0; + + void setVerbosity(int _v) { verbosity_ = _v; } + + std::string const &getName() const { return name_; } + + protected: + std::string const name_; + int verbosity_; + }; + + class CrystalConsistencyReader : public DBReaderWorker { + public: + CrystalConsistencyReader(edm::ParameterSet const &_ps) : DBReaderWorker("CrystalConsistencyReader", _ps) {} + ~CrystalConsistencyReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TTConsistencyReader : public DBReaderWorker { + public: + TTConsistencyReader(edm::ParameterSet const &_ps) : DBReaderWorker("TTConsistencyReader", _ps) {} + ~TTConsistencyReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class MemChConsistencyReader : public DBReaderWorker { + public: + MemChConsistencyReader(edm::ParameterSet const &_ps) : DBReaderWorker("MemChConsistencyReader", _ps) {} + ~MemChConsistencyReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class MemTTConsistencyReader : public DBReaderWorker { + public: + MemTTConsistencyReader(edm::ParameterSet const &_ps) : DBReaderWorker("MemTTConsistencyReader", _ps) {} + ~MemTTConsistencyReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class LaserBlueReader : public DBReaderWorker { + public: + LaserBlueReader(edm::ParameterSet const &_ps) : DBReaderWorker("LaserBlueReader", _ps) {} + ~LaserBlueReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TimingLaserBlueCrystalReader : public DBReaderWorker { + public: + TimingLaserBlueCrystalReader(edm::ParameterSet const &_ps) : DBReaderWorker("TimingLaserBlueCrystalReader", _ps) {} + ~TimingLaserBlueCrystalReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PNBlueReader : public DBReaderWorker { + public: + PNBlueReader(edm::ParameterSet const &_ps) : DBReaderWorker("PNBlueReader", _ps) {} + ~PNBlueReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class LaserGreenReader : public DBReaderWorker { + public: + LaserGreenReader(edm::ParameterSet const &_ps) : DBReaderWorker("LaserGreenReader", _ps) {} + ~LaserGreenReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TimingLaserGreenCrystalReader : public DBReaderWorker { + public: + TimingLaserGreenCrystalReader(edm::ParameterSet const &_ps) + : DBReaderWorker("TimingLaserGreenCrystalReader", _ps) {} + ~TimingLaserGreenCrystalReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PNGreenReader : public DBReaderWorker { + public: + PNGreenReader(edm::ParameterSet const &_ps) : DBReaderWorker("PNGreenReader", _ps) {} + ~PNGreenReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class LaserIRedReader : public DBReaderWorker { + public: + LaserIRedReader(edm::ParameterSet const &_ps) : DBReaderWorker("LaserIRedReader", _ps) {} + ~LaserIRedReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TimingLaserIRedCrystalReader : public DBReaderWorker { + public: + TimingLaserIRedCrystalReader(edm::ParameterSet const &_ps) : DBReaderWorker("TimingLaserIRedCrystalReader", _ps) {} + ~TimingLaserIRedCrystalReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PNIRedReader : public DBReaderWorker { + public: + PNIRedReader(edm::ParameterSet const &_ps) : DBReaderWorker("PNIRedReader", _ps) {} + ~PNIRedReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class LaserRedReader : public DBReaderWorker { + public: + LaserRedReader(edm::ParameterSet const &_ps) : DBReaderWorker("LaserRedReader", _ps) {} + ~LaserRedReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TimingLaserRedCrystalReader : public DBReaderWorker { + public: + TimingLaserRedCrystalReader(edm::ParameterSet const &_ps) : DBReaderWorker("TimingLaserRedCrystalReader", _ps) {} + ~TimingLaserRedCrystalReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PNRedReader : public DBReaderWorker { + public: + PNRedReader(edm::ParameterSet const &_ps) : DBReaderWorker("PNRedReader", _ps) {} + ~PNRedReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PedestalsReader : public DBReaderWorker { + public: + PedestalsReader(edm::ParameterSet const &_ps) : DBReaderWorker("PedestalsReader", _ps) {} + ~PedestalsReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PNPedReader : public DBReaderWorker { + public: + PNPedReader(edm::ParameterSet const &_ps) : DBReaderWorker("PNPedReader", _ps) {} + ~PNPedReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PedestalsOnlineReader : public DBReaderWorker { + public: + PedestalsOnlineReader(edm::ParameterSet const &_ps) : DBReaderWorker("PedestalsOnlineReader", _ps) {} + ~PedestalsOnlineReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TestPulseReader : public DBReaderWorker { + public: + TestPulseReader(edm::ParameterSet const &_ps) : DBReaderWorker("TestPulseReader", _ps) {} + ~TestPulseReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PulseShapeReader : public DBReaderWorker { + public: + PulseShapeReader(edm::ParameterSet const &_ps) : DBReaderWorker("PulseShapeReader", _ps) {} + ~PulseShapeReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class PNMGPAReader : public DBReaderWorker { + public: + PNMGPAReader(edm::ParameterSet const &_ps) : DBReaderWorker("PNMGPAReader", _ps) {} + ~PNMGPAReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TimingCrystalReader : public DBReaderWorker { + public: + TimingCrystalReader(edm::ParameterSet const &_ps) : DBReaderWorker("TimingCrystalReader", _ps) {} + ~TimingCrystalReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class Led1Reader : public DBReaderWorker { + public: + Led1Reader(edm::ParameterSet const &_ps) : DBReaderWorker("Led1Reader", _ps) {} + ~Led1Reader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TimingLed1CrystalReader : public DBReaderWorker { + public: + TimingLed1CrystalReader(edm::ParameterSet const &_ps) : DBReaderWorker("TimingLed1CrystalReader", _ps) {} + ~TimingLed1CrystalReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class Led2Reader : public DBReaderWorker { + public: + Led2Reader(edm::ParameterSet const &_ps) : DBReaderWorker("Led2Reader", _ps) {} + ~Led2Reader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class TimingLed2CrystalReader : public DBReaderWorker { + public: + TimingLed2CrystalReader(edm::ParameterSet const &_ps) : DBReaderWorker("TimingLed2CrystalReader", _ps) {} + ~TimingLed2CrystalReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; + + class OccupancyReader : public DBReaderWorker { + public: + OccupancyReader(edm::ParameterSet const &_ps) : DBReaderWorker("OccupancyReader", _ps) {} + ~OccupancyReader() override {} + + std::map run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override; + }; +} // namespace ecaldqm #endif diff --git a/DQM/EcalMonitorDbModule/interface/DBWriterWorkers.h b/DQM/EcalMonitorDbModule/interface/DBWriterWorkers.h index 3821d79f217eb..9537cd1a01e51 100644 --- a/DQM/EcalMonitorDbModule/interface/DBWriterWorkers.h +++ b/DQM/EcalMonitorDbModule/interface/DBWriterWorkers.h @@ -15,129 +15,123 @@ class DQMStore; namespace ecaldqm { -class DBWriterWorker { -public: - DBWriterWorker(std::string const &, edm::ParameterSet const &); - virtual ~DBWriterWorker() {} - - void retrieveSource(DQMStore::IGetter &); - virtual bool run(EcalCondDBInterface *, MonRunIOV &) = 0; - - bool runsOn(std::string const &_runType) const { - return runTypes_.find(_runType) != runTypes_.end(); - } - - void setVerbosity(int _v) { verbosity_ = _v; } - - std::string const &getName() const { return name_; } - bool isActive() const { return active_; } - -protected: - std::string const name_; - std::set runTypes_; - MESetCollection source_; - bool active_; - int verbosity_; -}; - -class IntegrityWriter : public DBWriterWorker { -public: - IntegrityWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("Integrity", _ps) {} - ~IntegrityWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; -}; - -class LaserWriter : public DBWriterWorker { -public: - LaserWriter(edm::ParameterSet const &); - ~LaserWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; - -private: - std::map wlToME_; -}; - -class PedestalWriter : public DBWriterWorker { -public: - PedestalWriter(edm::ParameterSet const &); - ~PedestalWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; - -private: - std::map gainToME_; - std::map pnGainToME_; -}; - -class PresampleWriter : public DBWriterWorker { -public: - PresampleWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("Presample", _ps) {} - ~PresampleWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; -}; - -class TestPulseWriter : public DBWriterWorker { -public: - TestPulseWriter(edm::ParameterSet const &); - ~TestPulseWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; - -private: - std::map gainToME_; - std::map pnGainToME_; -}; - -class TimingWriter : public DBWriterWorker { -public: - TimingWriter(edm::ParameterSet const &_ps) : DBWriterWorker("Timing", _ps) {} - ~TimingWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; -}; - -class LedWriter : public DBWriterWorker { -public: - LedWriter(edm::ParameterSet const &); - ~LedWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; - -private: - std::map wlToME_; -}; - -class OccupancyWriter : public DBWriterWorker { -public: - OccupancyWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("Occupancy", _ps) {} - ~OccupancyWriter() override {} - - bool run(EcalCondDBInterface *, MonRunIOV &) override; -}; - -class SummaryWriter : public DBWriterWorker { -public: - SummaryWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("Summary", _ps), taskList_(0), outcome_(0), - processedEvents_(0) {} - ~SummaryWriter() override {} - - void setTaskList(int _list) { taskList_ = _list; } - void setOutcome(int _outcome) { outcome_ = _outcome; } - void setProcessedEvents(unsigned _n) { processedEvents_ = _n; } - bool run(EcalCondDBInterface *, MonRunIOV &) override; - -private: - int taskList_; - int outcome_; - unsigned processedEvents_; -}; -} // namespace ecaldqm + class DBWriterWorker { + public: + DBWriterWorker(std::string const &, edm::ParameterSet const &); + virtual ~DBWriterWorker() {} + + void retrieveSource(DQMStore::IGetter &); + virtual bool run(EcalCondDBInterface *, MonRunIOV &) = 0; + + bool runsOn(std::string const &_runType) const { return runTypes_.find(_runType) != runTypes_.end(); } + + void setVerbosity(int _v) { verbosity_ = _v; } + + std::string const &getName() const { return name_; } + bool isActive() const { return active_; } + + protected: + std::string const name_; + std::set runTypes_; + MESetCollection source_; + bool active_; + int verbosity_; + }; + + class IntegrityWriter : public DBWriterWorker { + public: + IntegrityWriter(edm::ParameterSet const &_ps) : DBWriterWorker("Integrity", _ps) {} + ~IntegrityWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + }; + + class LaserWriter : public DBWriterWorker { + public: + LaserWriter(edm::ParameterSet const &); + ~LaserWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + + private: + std::map wlToME_; + }; + + class PedestalWriter : public DBWriterWorker { + public: + PedestalWriter(edm::ParameterSet const &); + ~PedestalWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + + private: + std::map gainToME_; + std::map pnGainToME_; + }; + + class PresampleWriter : public DBWriterWorker { + public: + PresampleWriter(edm::ParameterSet const &_ps) : DBWriterWorker("Presample", _ps) {} + ~PresampleWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + }; + + class TestPulseWriter : public DBWriterWorker { + public: + TestPulseWriter(edm::ParameterSet const &); + ~TestPulseWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + + private: + std::map gainToME_; + std::map pnGainToME_; + }; + + class TimingWriter : public DBWriterWorker { + public: + TimingWriter(edm::ParameterSet const &_ps) : DBWriterWorker("Timing", _ps) {} + ~TimingWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + }; + + class LedWriter : public DBWriterWorker { + public: + LedWriter(edm::ParameterSet const &); + ~LedWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + + private: + std::map wlToME_; + }; + + class OccupancyWriter : public DBWriterWorker { + public: + OccupancyWriter(edm::ParameterSet const &_ps) : DBWriterWorker("Occupancy", _ps) {} + ~OccupancyWriter() override {} + + bool run(EcalCondDBInterface *, MonRunIOV &) override; + }; + + class SummaryWriter : public DBWriterWorker { + public: + SummaryWriter(edm::ParameterSet const &_ps) + : DBWriterWorker("Summary", _ps), taskList_(0), outcome_(0), processedEvents_(0) {} + ~SummaryWriter() override {} + + void setTaskList(int _list) { taskList_ = _list; } + void setOutcome(int _outcome) { outcome_ = _outcome; } + void setProcessedEvents(unsigned _n) { processedEvents_ = _n; } + bool run(EcalCondDBInterface *, MonRunIOV &) override; + + private: + int taskList_; + int outcome_; + unsigned processedEvents_; + }; +} // namespace ecaldqm #endif diff --git a/DQM/EcalMonitorDbModule/interface/EcalBarrelMonitorDbModule.h b/DQM/EcalMonitorDbModule/interface/EcalBarrelMonitorDbModule.h index d69c05736d8d8..c1eff2063c8e9 100644 --- a/DQM/EcalMonitorDbModule/interface/EcalBarrelMonitorDbModule.h +++ b/DQM/EcalMonitorDbModule/interface/EcalBarrelMonitorDbModule.h @@ -23,7 +23,6 @@ class DQMStore; class MonitorElementsDb; class EcalBarrelMonitorDbModule : public edm::EDAnalyzer { - public: /// Constructor EcalBarrelMonitorDbModule(const edm::ParameterSet &ps); diff --git a/DQM/EcalMonitorDbModule/interface/LogicIDTranslation.h b/DQM/EcalMonitorDbModule/interface/LogicIDTranslation.h index 3129fef1b886d..6634889562eea 100644 --- a/DQM/EcalMonitorDbModule/interface/LogicIDTranslation.h +++ b/DQM/EcalMonitorDbModule/interface/LogicIDTranslation.h @@ -12,15 +12,15 @@ #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h" namespace ecaldqm { -EcalLogicID ecalID(); -EcalLogicID subdetID(EcalSubdetector); -EcalLogicID crystalID(DetId const &); -EcalLogicID towerID(EcalElectronicsId const &); -EcalLogicID memChannelID(EcalPnDiodeDetId const &); -EcalLogicID memTowerID(EcalElectronicsId const &); -EcalLogicID lmPNID(EcalPnDiodeDetId const &); + EcalLogicID ecalID(); + EcalLogicID subdetID(EcalSubdetector); + EcalLogicID crystalID(DetId const &); + EcalLogicID towerID(EcalElectronicsId const &); + EcalLogicID memChannelID(EcalPnDiodeDetId const &); + EcalLogicID memTowerID(EcalElectronicsId const &); + EcalLogicID lmPNID(EcalPnDiodeDetId const &); -DetId toDetId(EcalLogicID const &); -} // namespace ecaldqm + DetId toDetId(EcalLogicID const &); +} // namespace ecaldqm #endif diff --git a/DQM/EcalMonitorDbModule/interface/MonitorElementsDb.h b/DQM/EcalMonitorDbModule/interface/MonitorElementsDb.h index c80bd8f9ee686..c622b2c55f200 100644 --- a/DQM/EcalMonitorDbModule/interface/MonitorElementsDb.h +++ b/DQM/EcalMonitorDbModule/interface/MonitorElementsDb.h @@ -25,7 +25,6 @@ class MonitorElement; class DQMStore; class MonitorElementsDb { - friend class EcalBarrelMonitorDbModule; public: @@ -37,8 +36,7 @@ class MonitorElementsDb { protected: /// Analyze - void analyze(const edm::Event &e, const edm::EventSetup &c, - coral::ISessionProxy *s); + void analyze(const edm::Event &e, const edm::EventSetup &c, coral::ISessionProxy *s); // BeginJob void beginJob(void); @@ -61,4 +59,4 @@ class MonitorElementsDb { DQMStore *dqmStore_; }; -#endif // MonitorElementsDb_H +#endif // MonitorElementsDb_H diff --git a/DQM/EcalMonitorDbModule/interface/MonitorXMLParser.h b/DQM/EcalMonitorDbModule/interface/MonitorXMLParser.h index 039145d3fab79..fa3feced8fa92 100644 --- a/DQM/EcalMonitorDbModule/interface/MonitorXMLParser.h +++ b/DQM/EcalMonitorDbModule/interface/MonitorXMLParser.h @@ -50,7 +50,6 @@ struct DB_ME { // - - - - - - - - - - - - - - - - - - - - class TagNames { - public: XMLCh *TAG_DBE; XMLCh *TAG_ME; @@ -100,14 +99,11 @@ class TagNames { ATTR_NAME(xercesc::XMLString::transcode("name")), ATTR_ARG(xercesc::XMLString::transcode("arg")), ATTR_ALIAS(xercesc::XMLString::transcode("alias")) { - return; } ~TagNames() noexcept(false) { - try { - xercesc::XMLString::release(&TAG_DBE); xercesc::XMLString::release(&TAG_ME); xercesc::XMLString::release(&TAG_1D); @@ -130,7 +126,6 @@ class TagNames { xercesc::XMLString::release(&ATTR_ALIAS); } catch (xercesc::XMLException &e) { - char *message = xercesc::XMLString::transcode(e.getMessage()); std::ostringstream buf; @@ -141,7 +136,6 @@ class TagNames { throw(std::runtime_error(buf.str())); } catch (const xercesc::DOMException &e) { - char *message = xercesc::XMLString::transcode(e.getMessage()); std::ostringstream buf; @@ -153,12 +147,11 @@ class TagNames { } } -}; // class TagNames +}; // class TagNames // - - - - - - - - - - - - - - - - - - - - class MonitorXMLParser { - private: std::vector DBMonitoringElements_; std::string xmlFile_; @@ -171,12 +164,10 @@ class MonitorXMLParser { ~MonitorXMLParser() throw(); - const std::vector &getDB_ME(void) const { - return (DBMonitoringElements_); - } + const std::vector &getDB_ME(void) const { return (DBMonitoringElements_); } void load() noexcept(false); -}; // class MonitorXMLParser +}; // class MonitorXMLParser -#endif // MonitorXMLParser_h +#endif // MonitorXMLParser_h diff --git a/DQM/EcalMonitorDbModule/plugins/EcalBarrelMonitorDbModule.cc b/DQM/EcalMonitorDbModule/plugins/EcalBarrelMonitorDbModule.cc index cb970ffb2ac87..4d422283f9295 100644 --- a/DQM/EcalMonitorDbModule/plugins/EcalBarrelMonitorDbModule.cc +++ b/DQM/EcalMonitorDbModule/plugins/EcalBarrelMonitorDbModule.cc @@ -25,17 +25,14 @@ #include "FWCore/Framework/interface/MakerMacros.h" -EcalBarrelMonitorDbModule::EcalBarrelMonitorDbModule( - const edm::ParameterSet &ps) { - +EcalBarrelMonitorDbModule::EcalBarrelMonitorDbModule(const edm::ParameterSet &ps) { dqmStore_ = edm::Service().operator->(); prefixME_ = ps.getUntrackedParameter("prefixME", ""); xmlFile_ = ps.getUntrackedParameter("xmlFile", ""); if (!xmlFile_.empty()) { - std::cout << "Monitor Elements from DB xml source file is " << xmlFile_ - << std::endl; + std::cout << "Monitor Elements from DB xml source file is " << xmlFile_ << std::endl; } sleepTime_ = ps.getUntrackedParameter("sleepTime", 0); @@ -61,13 +58,11 @@ EcalBarrelMonitorDbModule::EcalBarrelMonitorDbModule( } EcalBarrelMonitorDbModule::~EcalBarrelMonitorDbModule() { - if (ME_Db_) delete ME_Db_; } void EcalBarrelMonitorDbModule::beginJob(void) { - icycle_ = 0; if (ME_Db_) @@ -75,17 +70,13 @@ void EcalBarrelMonitorDbModule::beginJob(void) { } void EcalBarrelMonitorDbModule::endJob(void) { - if (ME_Db_) ME_Db_->endJob(); - std::cout << "EcalBarrelMonitorDbModule: endJob, icycle = " << icycle_ - << std::endl; + std::cout << "EcalBarrelMonitorDbModule: endJob, icycle = " << icycle_ << std::endl; } -void EcalBarrelMonitorDbModule::analyze(const edm::Event &e, - const edm::EventSetup &c) { - +void EcalBarrelMonitorDbModule::analyze(const edm::Event &e, const edm::EventSetup &c) { icycle_++; std::cout << "EcalBarrelMonitorDbModule: icycle = " << icycle_ << std::endl; @@ -95,13 +86,11 @@ void EcalBarrelMonitorDbModule::analyze(const edm::Event &e, context.loadComponent("CORAL/Services/ConnectionService"); context.loadComponent("CORAL/Services/EnvironmentAuthenticationService"); coral::IHandle connectionService = - context.query( - "CORAL/Services/ConnectionService"); + context.query("CORAL/Services/ConnectionService"); context.loadComponent("CORAL/RelationalPlugins/oracle"); // Set configuration parameters - coral::IConnectionServiceConfiguration &config = - connectionService->configuration(); + coral::IConnectionServiceConfiguration &config = connectionService->configuration(); config.setConnectionRetrialPeriod(1); config.setConnectionRetrialTimeOut(10); @@ -117,7 +106,6 @@ void EcalBarrelMonitorDbModule::analyze(const edm::Event &e, } if (!htmlDir_.empty()) { - ME_Db_->htmlOutput(htmlDir_); } diff --git a/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc b/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc index 8881ed5fe83bd..5d0e8823aacdb 100644 --- a/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc +++ b/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc @@ -8,13 +8,14 @@ #include "FWCore/ServiceRegistry/interface/Service.h" EcalCondDBReader::EcalCondDBReader(edm::ParameterSet const &_ps) - : db_(nullptr), monIOV_(), worker_(nullptr), + : db_(nullptr), + monIOV_(), + worker_(nullptr), formula_(_ps.getUntrackedParameter("formula")), meSet_(ecaldqm::createMESet(_ps.getUntrackedParameterSet("plot"))), verbosity_(_ps.getUntrackedParameter("verbosity")) { std::string table(_ps.getUntrackedParameter("table")); - edm::ParameterSet const &workerParams( - _ps.getUntrackedParameterSet("workerParams")); + edm::ParameterSet const &workerParams(_ps.getUntrackedParameterSet("workerParams")); if (table == "CrystalConsistency") worker_ = new ecaldqm::CrystalConsistencyReader(workerParams); @@ -88,13 +89,12 @@ EcalCondDBReader::EcalCondDBReader(edm::ParameterSet const &_ps) edm::LogInfo("EcalDQM") << "Establishing DB connection"; try { - db = std::unique_ptr( - new EcalCondDBInterface(DBName, userName, password)); + db = std::unique_ptr(new EcalCondDBInterface(DBName, userName, password)); } catch (std::runtime_error &re) { if (!hostName.empty()) { try { - db = std::unique_ptr(new EcalCondDBInterface( - hostName, DBName, userName, password, hostPort)); + db = std::unique_ptr( + new EcalCondDBInterface(hostName, DBName, userName, password, hostPort)); } catch (std::runtime_error &re2) { throw cms::Exception("DBError") << re2.what(); } @@ -106,8 +106,7 @@ EcalCondDBReader::EcalCondDBReader(edm::ParameterSet const &_ps) std::string location(_ps.getUntrackedParameter("location")); int runNumber(_ps.getUntrackedParameter("runNumber")); - std::string monRunGeneralTag( - _ps.getUntrackedParameter("monRunGeneralTag")); + std::string monRunGeneralTag(_ps.getUntrackedParameter("monRunGeneralTag")); if (verbosity_ > 0) edm::LogInfo("EcalDQM") << "Initializing DB entry"; @@ -117,15 +116,13 @@ EcalCondDBReader::EcalCondDBReader(edm::ParameterSet const &_ps) try { runTag = db_->fetchRunIOV(location, runNumber).getRunTag(); } catch (std::exception &) { - edm::LogError("EcalDQM") << "Cannot fetch RunIOV for location=" << location - << " runNumber=" << runNumber; + edm::LogError("EcalDQM") << "Cannot fetch RunIOV for location=" << location << " runNumber=" << runNumber; throw; } MonVersionDef versionDef; - versionDef.setMonitoringVersion( - "test01"); // the only mon_ver in mon_version_def table as of September - // 2012 + versionDef.setMonitoringVersion("test01"); // the only mon_ver in mon_version_def table as of September + // 2012 MonRunTag monTag; monTag.setMonVersionDef(versionDef); monTag.setGeneralTag(monRunGeneralTag); @@ -133,10 +130,8 @@ EcalCondDBReader::EcalCondDBReader(edm::ParameterSet const &_ps) try { monIOV_ = db_->fetchMonRunIOV(&runTag, &monTag, runNumber, 1); } catch (std::runtime_error &e) { - edm::LogError("EcalDQM") - << "Cannot fetch MonRunIOV for location=" << location - << " runNumber=" << runNumber - << " monVersion=test01 monRunGeneralTag=" << monRunGeneralTag; + edm::LogError("EcalDQM") << "Cannot fetch MonRunIOV for location=" << location << " runNumber=" << runNumber + << " monVersion=test01 monRunGeneralTag=" << monRunGeneralTag; throw; } @@ -149,12 +144,10 @@ EcalCondDBReader::~EcalCondDBReader() { delete meSet_; } -void EcalCondDBReader::dqmEndJob(DQMStore::IBooker &_ibooker, - DQMStore::IGetter &) { +void EcalCondDBReader::dqmEndJob(DQMStore::IBooker &_ibooker, DQMStore::IGetter &) { meSet_->book(_ibooker); std::map values(worker_->run(db_, monIOV_, formula_)); - for (std::map::const_iterator vItr(values.begin()); - vItr != values.end(); ++vItr) + for (std::map::const_iterator vItr(values.begin()); vItr != values.end(); ++vItr) meSet_->setBinContent(vItr->first, vItr->second); } diff --git a/DQM/EcalMonitorDbModule/plugins/EcalCondDBWriter.cc b/DQM/EcalMonitorDbModule/plugins/EcalCondDBWriter.cc index 3ebb2a6c1975e..ed58f3101c407 100644 --- a/DQM/EcalMonitorDbModule/plugins/EcalCondDBWriter.cc +++ b/DQM/EcalMonitorDbModule/plugins/EcalCondDBWriter.cc @@ -14,22 +14,19 @@ void setBit(int &_bitArray, unsigned _iBit) { _bitArray |= (0x1 << _iBit); } -bool getBit(int &_bitArray, unsigned _iBit) { - return (_bitArray & (0x1 << _iBit)) != 0; -} +bool getBit(int &_bitArray, unsigned _iBit) { return (_bitArray & (0x1 << _iBit)) != 0; } EcalCondDBWriter::EcalCondDBWriter(edm::ParameterSet const &_ps) - : runNumber_(0), db_(nullptr), + : runNumber_(0), + db_(nullptr), location_(_ps.getUntrackedParameter("location")), runType_(_ps.getUntrackedParameter("runType")), runGeneralTag_(_ps.getUntrackedParameter("runGeneralTag")), - monRunGeneralTag_( - _ps.getUntrackedParameter("monRunGeneralTag")), + monRunGeneralTag_(_ps.getUntrackedParameter("monRunGeneralTag")), summaryWriter_(_ps.getUntrackedParameterSet("workerParams")), verbosity_(_ps.getUntrackedParameter("verbosity")), executed_(false) { - std::vector inputRootFiles( - _ps.getUntrackedParameter>("inputRootFiles")); + std::vector inputRootFiles(_ps.getUntrackedParameter>("inputRootFiles")); if (inputRootFiles.empty()) throw cms::Exception("Configuration") << "No input ROOT file given"; @@ -48,14 +45,12 @@ EcalCondDBWriter::EcalCondDBWriter(edm::ParameterSet const &_ps) TPRegexp pat("DQM_V[0-9]+(?:|_[0-9a-zA-Z]+)_R([0-9]+)"); std::unique_ptr matches(pat.MatchS(fileName.c_str())); if (matches->GetEntries() == 0) - throw cms::Exception("Configuration") - << "Input file " << fileName << " is not an DQM output"; + throw cms::Exception("Configuration") << "Input file " << fileName << " is not an DQM output"; if (iF == 0) runNumber_ = TString(matches->At(1)->GetName()).Atoi(); else if (TString(matches->At(1)->GetName()).Atoi() != runNumber_) - throw cms::Exception("Configuration") - << "Input files disagree in run number"; + throw cms::Exception("Configuration") << "Input files disagree in run number"; dqmStore.open(fileName, false, "", "", DQMStore::StripRunDirs); } @@ -72,13 +67,12 @@ EcalCondDBWriter::EcalCondDBWriter(edm::ParameterSet const &_ps) edm::LogInfo("EcalDQM") << "Establishing DB connection"; try { - db = std::unique_ptr( - new EcalCondDBInterface(DBName, userName, password)); + db = std::unique_ptr(new EcalCondDBInterface(DBName, userName, password)); } catch (std::runtime_error &re) { if (!hostName.empty()) { try { - db = std::unique_ptr(new EcalCondDBInterface( - hostName, DBName, userName, password, hostPort)); + db = std::unique_ptr( + new EcalCondDBInterface(hostName, DBName, userName, password, hostPort)); } catch (std::runtime_error &re2) { throw cms::Exception("DBError") << re2.what(); } @@ -91,8 +85,7 @@ EcalCondDBWriter::EcalCondDBWriter(edm::ParameterSet const &_ps) if (verbosity_ > 0) edm::LogInfo("EcalDQM") << " Done."; - edm::ParameterSet const &workerParams( - _ps.getUntrackedParameterSet("workerParams")); + edm::ParameterSet const &workerParams(_ps.getUntrackedParameterSet("workerParams")); workers_[Integrity] = new ecaldqm::IntegrityWriter(workerParams); workers_[Cosmic] = nullptr; @@ -125,8 +118,7 @@ EcalCondDBWriter::~EcalCondDBWriter() { delete workers_[iC]; } -void EcalCondDBWriter::dqmEndJob(DQMStore::IBooker &, - DQMStore::IGetter &_igetter) { +void EcalCondDBWriter::dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &_igetter) { if (executed_) return; @@ -144,8 +136,7 @@ void EcalCondDBWriter::dqmEndJob(DQMStore::IBooker &, if (!_igetter.dirExists(dirs[iD] + "/EventInfo")) continue; - MonitorElement *timeStampME( - _igetter.get(dirs[iD] + "/EventInfo/runStartTimeStamp")); + MonitorElement *timeStampME(_igetter.get(dirs[iD] + "/EventInfo/runStartTimeStamp")); if (timeStampME) { double timeStampValue(timeStampME->getFloatValue()); uint64_t seconds(timeStampValue); @@ -153,16 +144,14 @@ void EcalCondDBWriter::dqmEndJob(DQMStore::IBooker &, timeStampInFile = (seconds << 32) | microseconds; } - MonitorElement *eventsME( - _igetter.get(dirs[iD] + "/EventInfo/processedEvents")); + MonitorElement *eventsME(_igetter.get(dirs[iD] + "/EventInfo/processedEvents")); if (eventsME) processedEvents = eventsME->getIntValue(); if (timeStampInFile != 0 && processedEvents != 0) { if (verbosity_ > 1) - edm::LogInfo("EcalDQM") - << " Event info found; timestamp=" << timeStampInFile - << " processedEvents=" << processedEvents; + edm::LogInfo("EcalDQM") << " Event info found; timestamp=" << timeStampInFile + << " processedEvents=" << processedEvents; break; } } @@ -173,8 +162,7 @@ void EcalCondDBWriter::dqmEndJob(DQMStore::IBooker &, //////////////////////// SOURCE INITIALIZATION ////////////////////////// if (verbosity_ > 0) - edm::LogInfo("EcalDQM") - << "Setting up source MonitorElements for given run type " << runType_; + edm::LogInfo("EcalDQM") << "Setting up source MonitorElements for given run type " << runType_; int taskList(0); for (unsigned iC(0); iC < nTasks; ++iC) { @@ -203,8 +191,7 @@ void EcalCondDBWriter::dqmEndJob(DQMStore::IBooker &, std::cerr << e.what(); if (timeStampInFile == 0) - throw cms::Exception("Initialization") - << "Time stamp for the run could not be found"; + throw cms::Exception("Initialization") << "Time stamp for the run could not be found"; LocationDef locationDef; locationDef.setLocation(location_); @@ -233,9 +220,8 @@ void EcalCondDBWriter::dqmEndJob(DQMStore::IBooker &, // runIOV.getRunTag().getRunTypeDef().getRunType(); MonVersionDef versionDef; - versionDef.setMonitoringVersion( - "test01"); // the only mon_ver in mon_version_def table as of September - // 2012 + versionDef.setMonitoringVersion("test01"); // the only mon_ver in mon_version_def table as of September + // 2012 MonRunTag monTag; monTag.setMonVersionDef(versionDef); monTag.setGeneralTag(monRunGeneralTag_); diff --git a/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc b/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc index 75647da4c9f3f..2379a69517665 100644 --- a/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc +++ b/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc @@ -12,8 +12,7 @@ #include EcalDQMStatusWriter::EcalDQMStatusWriter(edm::ParameterSet const &_ps) - : channelStatus_(), towerStatus_(), - firstRun_(_ps.getUntrackedParameter("firstRun")) { + : channelStatus_(), towerStatus_(), firstRun_(_ps.getUntrackedParameter("firstRun")) { std::ifstream inputFile(_ps.getUntrackedParameter("inputFile")); if (!inputFile.is_open()) throw cms::Exception("Invalid input for EcalDQMStatusWriter"); @@ -24,18 +23,15 @@ EcalDQMStatusWriter::EcalDQMStatusWriter(edm::ParameterSet const &_ps) statusManager.writeToObj(channelStatus_, towerStatus_); } -void EcalDQMStatusWriter::analyze(edm::Event const &, - edm::EventSetup const &_es) { - cond::service::PoolDBOutputService &dbOutput( - *edm::Service()); +void EcalDQMStatusWriter::analyze(edm::Event const &, edm::EventSetup const &_es) { + cond::service::PoolDBOutputService &dbOutput(*edm::Service()); if (firstRun_ == dbOutput.endOfTime()) return; dbOutput.writeOne(&channelStatus_, firstRun_, "EcalDQMChannelStatusRcd"); dbOutput.writeOne(&towerStatus_, firstRun_, "EcalDQMTowerStatusRcd"); - firstRun_ = - dbOutput.endOfTime(); // avoid accidentally re-writing the conditions + firstRun_ = dbOutput.endOfTime(); // avoid accidentally re-writing the conditions } DEFINE_FWK_MODULE(EcalDQMStatusWriter); diff --git a/DQM/EcalMonitorDbModule/src/DBReaderWorkers.cc b/DQM/EcalMonitorDbModule/src/DBReaderWorkers.cc index 4b84d184e8b27..2fef1d257a6cb 100644 --- a/DQM/EcalMonitorDbModule/src/DBReaderWorkers.cc +++ b/DQM/EcalMonitorDbModule/src/DBReaderWorkers.cc @@ -51,672 +51,377 @@ #include "TString.h" namespace ecaldqm { -typedef std::map ReturnType; + typedef std::map ReturnType; -template -ReturnType fetchAndFill( - std::map const &_extractors, - EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { - typedef std::map DataSet; - typedef double (*DataExtractor)(DataType const &); - typedef std::map ExtractorList; + template + ReturnType fetchAndFill(std::map const &_extractors, + EcalCondDBInterface *_db, + MonRunIOV &_iov, + std::string const &_formula) { + typedef std::map DataSet; + typedef double (*DataExtractor)(DataType const &); + typedef std::map ExtractorList; - ExtractorList varMap; + ExtractorList varMap; - for (typename ExtractorList::const_iterator eItr(_extractors.begin()); - eItr != _extractors.end(); ++eItr) - if (_formula.find(eItr->first) != std::string::npos) - varMap[eItr->first] = eItr->second; + for (typename ExtractorList::const_iterator eItr(_extractors.begin()); eItr != _extractors.end(); ++eItr) + if (_formula.find(eItr->first) != std::string::npos) + varMap[eItr->first] = eItr->second; - if (varMap.size() > 4) - throw cms::Exception("EcalDQM") << _formula << " has too many variables"; + if (varMap.size() > 4) + throw cms::Exception("EcalDQM") << _formula << " has too many variables"; - TString formula(_formula); + TString formula(_formula); - unsigned iV(0); - char varChars[4][2] = {"x", "y", "z", "t"}; - for (typename ExtractorList::iterator vItr(varMap.begin()); - vItr != varMap.end(); ++vItr) - formula.ReplaceAll(vItr->first, varChars[iV++]); + unsigned iV(0); + char varChars[4][2] = {"x", "y", "z", "t"}; + for (typename ExtractorList::iterator vItr(varMap.begin()); vItr != varMap.end(); ++vItr) + formula.ReplaceAll(vItr->first, varChars[iV++]); - TFormula tformula("formula", formula); - if (tformula.Compile() != 0) - throw cms::Exception("EcalDQM") << _formula << " could not be compiled"; + TFormula tformula("formula", formula); + if (tformula.Compile() != 0) + throw cms::Exception("EcalDQM") << _formula << " could not be compiled"; - DataSet dataSet; - _db->fetchDataSet(&dataSet, &_iov); + DataSet dataSet; + _db->fetchDataSet(&dataSet, &_iov); - ReturnType result; + ReturnType result; - for (typename DataSet::const_iterator dItr(dataSet.begin()); - dItr != dataSet.end(); ++dItr) { - double vars[4]; - iV = 0; - for (typename ExtractorList::iterator vItr(varMap.begin()); - vItr != varMap.end(); ++vItr) - vars[iV++] = vItr->second(dItr->second); + for (typename DataSet::const_iterator dItr(dataSet.begin()); dItr != dataSet.end(); ++dItr) { + double vars[4]; + iV = 0; + for (typename ExtractorList::iterator vItr(varMap.begin()); vItr != varMap.end(); ++vItr) + vars[iV++] = vItr->second(dItr->second); - result[toDetId(dItr->first)] = tformula.EvalPar(vars); + result[toDetId(dItr->first)] = tformula.EvalPar(vars); + } + + return result; + } + + ReturnType CrystalConsistencyReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["processed_events"] = [](MonCrystalConsistencyDat const &dat) { return double(dat.getProcessedEvents()); }; + extList["problematic_events"] = [](MonCrystalConsistencyDat const &dat) { + return double(dat.getProblematicEvents()); + }; + extList["problems_id"] = [](MonCrystalConsistencyDat const &dat) { return double(dat.getProblemsID()); }; + extList["problems_gain_zero"] = [](MonCrystalConsistencyDat const &dat) { + return double(dat.getProblemsGainZero()); + }; + extList["problems_gain_switch"] = [](MonCrystalConsistencyDat const &dat) { + return double(dat.getProblemsGainSwitch()); + }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TTConsistencyReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["processed_events"] = [](MonTTConsistencyDat const &dat) { return double(dat.getProcessedEvents()); }; + extList["problematic_events"] = [](MonTTConsistencyDat const &dat) { return double(dat.getProblematicEvents()); }; + extList["problems_id"] = [](MonTTConsistencyDat const &dat) { return double(dat.getProblemsID()); }; + extList["problems_size"] = [](MonTTConsistencyDat const &dat) { return double(dat.getProblemsSize()); }; + extList["problems_LV1"] = [](MonTTConsistencyDat const &dat) { return double(dat.getProblemsLV1()); }; + extList["problems_bunch_X"] = [](MonTTConsistencyDat const &dat) { return double(dat.getProblemsBunchX()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType MemChConsistencyReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["processed_events"] = [](MonMemChConsistencyDat const &dat) { return double(dat.getProcessedEvents()); }; + extList["problematic_events"] = [](MonMemChConsistencyDat const &dat) { + return double(dat.getProblematicEvents()); + }; + extList["problems_id"] = [](MonMemChConsistencyDat const &dat) { return double(dat.getProblemsID()); }; + extList["problems_gain_zero"] = [](MonMemChConsistencyDat const &dat) { return double(dat.getProblemsGainZero()); }; + extList["problems_gain_switch"] = [](MonMemChConsistencyDat const &dat) { + return double(dat.getProblemsGainSwitch()); + }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType MemTTConsistencyReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["processed_events"] = [](MonMemTTConsistencyDat const &dat) { return double(dat.getProcessedEvents()); }; + extList["problematic_events"] = [](MonMemTTConsistencyDat const &dat) { + return double(dat.getProblematicEvents()); + }; + extList["problems_id"] = [](MonMemTTConsistencyDat const &dat) { return double(dat.getProblemsID()); }; + extList["problems_size"] = [](MonMemTTConsistencyDat const &dat) { return double(dat.getProblemsSize()); }; + extList["problems_LV1"] = [](MonMemTTConsistencyDat const &dat) { return double(dat.getProblemsLV1()); }; + extList["problems_bunch_X"] = [](MonMemTTConsistencyDat const &dat) { return double(dat.getProblemsBunchX()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType LaserBlueReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["apd_mean"] = [](MonLaserBlueDat const &dat) { return double(dat.getAPDMean()); }; + extList["apd_rms"] = [](MonLaserBlueDat const &dat) { return double(dat.getAPDRMS()); }; + extList["apd_over_pn_mean"] = [](MonLaserBlueDat const &dat) { return double(dat.getAPDOverPNMean()); }; + extList["apd_over_pn_rms"] = [](MonLaserBlueDat const &dat) { return double(dat.getAPDOverPNRMS()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TimingLaserBlueCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, std::string const &) { + return ReturnType(); } - return result; -} - -ReturnType CrystalConsistencyReader::run(EcalCondDBInterface *_db, - MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["processed_events"] = [](MonCrystalConsistencyDat const &dat) { - return double(dat.getProcessedEvents()); - }; - extList["problematic_events"] = [](MonCrystalConsistencyDat const &dat) { - return double(dat.getProblematicEvents()); - }; - extList["problems_id"] = [](MonCrystalConsistencyDat const &dat) { - return double(dat.getProblemsID()); - }; - extList["problems_gain_zero"] = [](MonCrystalConsistencyDat const &dat) { - return double(dat.getProblemsGainZero()); - }; - extList["problems_gain_switch"] = [](MonCrystalConsistencyDat const &dat) { - return double(dat.getProblemsGainSwitch()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TTConsistencyReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["processed_events"] = [](MonTTConsistencyDat const &dat) { - return double(dat.getProcessedEvents()); - }; - extList["problematic_events"] = [](MonTTConsistencyDat const &dat) { - return double(dat.getProblematicEvents()); - }; - extList["problems_id"] = [](MonTTConsistencyDat const &dat) { - return double(dat.getProblemsID()); - }; - extList["problems_size"] = [](MonTTConsistencyDat const &dat) { - return double(dat.getProblemsSize()); - }; - extList["problems_LV1"] = [](MonTTConsistencyDat const &dat) { - return double(dat.getProblemsLV1()); - }; - extList["problems_bunch_X"] = [](MonTTConsistencyDat const &dat) { - return double(dat.getProblemsBunchX()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType MemChConsistencyReader::run(EcalCondDBInterface *_db, - MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["processed_events"] = [](MonMemChConsistencyDat const &dat) { - return double(dat.getProcessedEvents()); - }; - extList["problematic_events"] = [](MonMemChConsistencyDat const &dat) { - return double(dat.getProblematicEvents()); - }; - extList["problems_id"] = [](MonMemChConsistencyDat const &dat) { - return double(dat.getProblemsID()); - }; - extList["problems_gain_zero"] = [](MonMemChConsistencyDat const &dat) { - return double(dat.getProblemsGainZero()); - }; - extList["problems_gain_switch"] = [](MonMemChConsistencyDat const &dat) { - return double(dat.getProblemsGainSwitch()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType MemTTConsistencyReader::run(EcalCondDBInterface *_db, - MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["processed_events"] = [](MonMemTTConsistencyDat const &dat) { - return double(dat.getProcessedEvents()); - }; - extList["problematic_events"] = [](MonMemTTConsistencyDat const &dat) { - return double(dat.getProblematicEvents()); - }; - extList["problems_id"] = [](MonMemTTConsistencyDat const &dat) { - return double(dat.getProblemsID()); - }; - extList["problems_size"] = [](MonMemTTConsistencyDat const &dat) { - return double(dat.getProblemsSize()); - }; - extList["problems_LV1"] = [](MonMemTTConsistencyDat const &dat) { - return double(dat.getProblemsLV1()); - }; - extList["problems_bunch_X"] = [](MonMemTTConsistencyDat const &dat) { - return double(dat.getProblemsBunchX()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType LaserBlueReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["apd_mean"] = [](MonLaserBlueDat const &dat) { - return double(dat.getAPDMean()); - }; - extList["apd_rms"] = [](MonLaserBlueDat const &dat) { - return double(dat.getAPDRMS()); - }; - extList["apd_over_pn_mean"] = [](MonLaserBlueDat const &dat) { - return double(dat.getAPDOverPNMean()); - }; - extList["apd_over_pn_rms"] = [](MonLaserBlueDat const &dat) { - return double(dat.getAPDOverPNRMS()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TimingLaserBlueCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) { - return ReturnType(); -} - -ReturnType PNBlueReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["adc_mean_g1"] = [](MonPNBlueDat const &dat) { - return double(dat.getADCMeanG1()); - }; - extList["adc_rms_g1"] = [](MonPNBlueDat const &dat) { - return double(dat.getADCRMSG1()); - }; - extList["ped_mean_g1"] = [](MonPNBlueDat const &dat) { - return double(dat.getPedMeanG1()); - }; - extList["ped_rms_g1"] = [](MonPNBlueDat const &dat) { - return double(dat.getPedRMSG1()); - }; - extList["adc_mean_g16"] = [](MonPNBlueDat const &dat) { - return double(dat.getADCMeanG16()); - }; - extList["adc_rms_g16"] = [](MonPNBlueDat const &dat) { - return double(dat.getADCRMSG16()); - }; - extList["ped_mean_g16"] = [](MonPNBlueDat const &dat) { - return double(dat.getPedMeanG16()); - }; - extList["ped_rms_g16"] = [](MonPNBlueDat const &dat) { - return double(dat.getPedMeanG16()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType LaserGreenReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["apd_mean"] = [](MonLaserGreenDat const &dat) { - return double(dat.getAPDMean()); - }; - extList["apd_rms"] = [](MonLaserGreenDat const &dat) { - return double(dat.getAPDRMS()); - }; - extList["apd_over_pn_mean"] = [](MonLaserGreenDat const &dat) { - return double(dat.getAPDOverPNMean()); - }; - extList["apd_over_pn_rms"] = [](MonLaserGreenDat const &dat) { - return double(dat.getAPDOverPNRMS()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TimingLaserGreenCrystalReader::run(EcalCondDBInterface *, - MonRunIOV &, - std::string const &) { - return ReturnType(); -} - -ReturnType PNGreenReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["adc_mean_g1"] = [](MonPNGreenDat const &dat) { - return double(dat.getADCMeanG1()); - }; - extList["adc_rms_g1"] = [](MonPNGreenDat const &dat) { - return double(dat.getADCRMSG1()); - }; - extList["ped_mean_g1"] = [](MonPNGreenDat const &dat) { - return double(dat.getPedMeanG1()); - }; - extList["ped_rms_g1"] = [](MonPNGreenDat const &dat) { - return double(dat.getPedRMSG1()); - }; - extList["adc_mean_g16"] = [](MonPNGreenDat const &dat) { - return double(dat.getADCMeanG16()); - }; - extList["adc_rms_g16"] = [](MonPNGreenDat const &dat) { - return double(dat.getADCRMSG16()); - }; - extList["ped_mean_g16"] = [](MonPNGreenDat const &dat) { - return double(dat.getPedMeanG16()); - }; - extList["ped_rms_g16"] = [](MonPNGreenDat const &dat) { - return double(dat.getPedMeanG16()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType LaserIRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["apd_mean"] = [](MonLaserIRedDat const &dat) { - return double(dat.getAPDMean()); - }; - extList["apd_rms"] = [](MonLaserIRedDat const &dat) { - return double(dat.getAPDRMS()); - }; - extList["apd_over_pn_mean"] = [](MonLaserIRedDat const &dat) { - return double(dat.getAPDOverPNMean()); - }; - extList["apd_over_pn_rms"] = [](MonLaserIRedDat const &dat) { - return double(dat.getAPDOverPNRMS()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TimingLaserIRedCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) { - return ReturnType(); -} - -ReturnType PNIRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["adc_mean_g1"] = [](MonPNIRedDat const &dat) { - return double(dat.getADCMeanG1()); - }; - extList["adc_rms_g1"] = [](MonPNIRedDat const &dat) { - return double(dat.getADCRMSG1()); - }; - extList["ped_mean_g1"] = [](MonPNIRedDat const &dat) { - return double(dat.getPedMeanG1()); - }; - extList["ped_rms_g1"] = [](MonPNIRedDat const &dat) { - return double(dat.getPedRMSG1()); - }; - extList["adc_mean_g16"] = [](MonPNIRedDat const &dat) { - return double(dat.getADCMeanG16()); - }; - extList["adc_rms_g16"] = [](MonPNIRedDat const &dat) { - return double(dat.getADCRMSG16()); - }; - extList["ped_mean_g16"] = [](MonPNIRedDat const &dat) { - return double(dat.getPedMeanG16()); - }; - extList["ped_rms_g16"] = [](MonPNIRedDat const &dat) { - return double(dat.getPedMeanG16()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType LaserRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["apd_mean"] = [](MonLaserRedDat const &dat) { - return double(dat.getAPDMean()); - }; - extList["apd_rms"] = [](MonLaserRedDat const &dat) { - return double(dat.getAPDRMS()); - }; - extList["apd_over_pn_mean"] = [](MonLaserRedDat const &dat) { - return double(dat.getAPDOverPNMean()); - }; - extList["apd_over_pn_rms"] = [](MonLaserRedDat const &dat) { - return double(dat.getAPDOverPNRMS()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TimingLaserRedCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) { - return ReturnType(); -} - -ReturnType PNRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["adc_mean_g1"] = [](MonPNRedDat const &dat) { - return double(dat.getADCMeanG1()); - }; - extList["adc_rms_g1"] = [](MonPNRedDat const &dat) { - return double(dat.getADCRMSG1()); - }; - extList["ped_mean_g1"] = [](MonPNRedDat const &dat) { - return double(dat.getPedMeanG1()); - }; - extList["ped_rms_g1"] = [](MonPNRedDat const &dat) { - return double(dat.getPedRMSG1()); - }; - extList["adc_mean_g16"] = [](MonPNRedDat const &dat) { - return double(dat.getADCMeanG16()); - }; - extList["adc_rms_g16"] = [](MonPNRedDat const &dat) { - return double(dat.getADCRMSG16()); - }; - extList["ped_mean_g16"] = [](MonPNRedDat const &dat) { - return double(dat.getPedMeanG16()); - }; - extList["ped_rms_g16"] = [](MonPNRedDat const &dat) { - return double(dat.getPedMeanG16()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType PedestalsReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["ped_mean_g1"] = [](MonPedestalsDat const &dat) { - return double(dat.getPedMeanG1()); - }; - extList["ped_rms_g1"] = [](MonPedestalsDat const &dat) { - return double(dat.getPedRMSG1()); - }; - extList["ped_mean_g6"] = [](MonPedestalsDat const &dat) { - return double(dat.getPedMeanG6()); - }; - extList["ped_rms_g6"] = [](MonPedestalsDat const &dat) { - return double(dat.getPedRMSG6()); - }; - extList["ped_mean_g12"] = [](MonPedestalsDat const &dat) { - return double(dat.getPedMeanG12()); - }; - extList["ped_rms_g12"] = [](MonPedestalsDat const &dat) { - return double(dat.getPedRMSG12()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType PNPedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["ped_mean_g1"] = [](MonPNPedDat const &dat) { - return double(dat.getPedMeanG1()); - }; - extList["ped_rms_g1"] = [](MonPNPedDat const &dat) { - return double(dat.getPedRMSG1()); - }; - extList["ped_mean_g16"] = [](MonPNPedDat const &dat) { - return double(dat.getPedMeanG16()); - }; - extList["ped_rms_g16"] = [](MonPNPedDat const &dat) { - return double(dat.getPedRMSG16()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType PedestalsOnlineReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["adc_mean_g12"] = [](MonPedestalsOnlineDat const &dat) { - return double(dat.getADCMeanG12()); - }; - extList["adc_rms_g12"] = [](MonPedestalsOnlineDat const &dat) { - return double(dat.getADCRMSG12()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TestPulseReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["adc_mean_g1"] = [](MonTestPulseDat const &dat) { - return double(dat.getADCMeanG1()); - }; - extList["adc_rms_g1"] = [](MonTestPulseDat const &dat) { - return double(dat.getADCRMSG1()); - }; - extList["adc_mean_g6"] = [](MonTestPulseDat const &dat) { - return double(dat.getADCMeanG6()); - }; - extList["adc_rms_g6"] = [](MonTestPulseDat const &dat) { - return double(dat.getADCRMSG6()); - }; - extList["adc_mean_g12"] = [](MonTestPulseDat const &dat) { - return double(dat.getADCMeanG12()); - }; - extList["adc_rms_g12"] = [](MonTestPulseDat const &dat) { - return double(dat.getADCRMSG12()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType PulseShapeReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["g1_avg_sample_01"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[0]); - }; - extList["g1_avg_sample_02"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[1]); - }; - extList["g1_avg_sample_03"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[2]); - }; - extList["g1_avg_sample_04"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[3]); - }; - extList["g1_avg_sample_05"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[4]); - }; - extList["g1_avg_sample_06"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[5]); - }; - extList["g1_avg_sample_07"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[6]); - }; - extList["g1_avg_sample_08"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[7]); - }; - extList["g1_avg_sample_09"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[8]); - }; - extList["g1_avg_sample_10"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(1)[9]); - }; - extList["g6_avg_sample_01"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[0]); - }; - extList["g6_avg_sample_02"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[1]); - }; - extList["g6_avg_sample_03"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[2]); - }; - extList["g6_avg_sample_04"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[3]); - }; - extList["g6_avg_sample_05"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[4]); - }; - extList["g6_avg_sample_06"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[5]); - }; - extList["g6_avg_sample_07"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[6]); - }; - extList["g6_avg_sample_08"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[7]); - }; - extList["g6_avg_sample_09"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[8]); - }; - extList["g6_avg_sample_10"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(6)[9]); - }; - extList["g12_avg_sample_01"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[0]); - }; - extList["g12_avg_sample_02"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[1]); - }; - extList["g12_avg_sample_03"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[2]); - }; - extList["g12_avg_sample_04"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[3]); - }; - extList["g12_avg_sample_05"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[4]); - }; - extList["g12_avg_sample_06"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[5]); - }; - extList["g12_avg_sample_07"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[6]); - }; - extList["g12_avg_sample_08"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[7]); - }; - extList["g12_avg_sample_09"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[8]); - }; - extList["g12_avg_sample_10"] = [](MonPulseShapeDat const &dat) { - return double(dat.getSamples(12)[9]); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType PNMGPAReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["adc_mean_g1"] = [](MonPNMGPADat const &dat) { - return double(dat.getADCMeanG1()); - }; - extList["adc_rms_g1"] = [](MonPNMGPADat const &dat) { - return double(dat.getADCRMSG1()); - }; - extList["ped_mean_g1"] = [](MonPNMGPADat const &dat) { - return double(dat.getPedMeanG1()); - }; - extList["ped_rms_g1"] = [](MonPNMGPADat const &dat) { - return double(dat.getPedRMSG1()); - }; - extList["adc_mean_g16"] = [](MonPNMGPADat const &dat) { - return double(dat.getADCMeanG16()); - }; - extList["adc_rms_g16"] = [](MonPNMGPADat const &dat) { - return double(dat.getADCRMSG16()); - }; - extList["ped_mean_g16"] = [](MonPNMGPADat const &dat) { - return double(dat.getPedMeanG16()); - }; - extList["ped_rms_g16"] = [](MonPNMGPADat const &dat) { - return double(dat.getPedRMSG16()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TimingCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) { - return ReturnType(); -} - -ReturnType Led1Reader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["vpt_mean"] = [](MonLed1Dat const &dat) { - return double(dat.getVPTMean()); - }; - extList["vpt_rms"] = [](MonLed1Dat const &dat) { - return double(dat.getVPTRMS()); - }; - extList["vpt_over_pn_mean"] = [](MonLed1Dat const &dat) { - return double(dat.getVPTOverPNMean()); - }; - extList["vpt_over_pn_rms"] = [](MonLed1Dat const &dat) { - return double(dat.getVPTOverPNRMS()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TimingLed1CrystalReader::run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) { - return ReturnType(); -} - -ReturnType Led2Reader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["vpt_mean"] = [](MonLed2Dat const &dat) { - return double(dat.getVPTMean()); - }; - extList["vpt_rms"] = [](MonLed2Dat const &dat) { - return double(dat.getVPTRMS()); - }; - extList["vpt_over_pn_mean"] = [](MonLed2Dat const &dat) { - return double(dat.getVPTOverPNMean()); - }; - extList["vpt_over_pn_rms"] = [](MonLed2Dat const &dat) { - return double(dat.getVPTOverPNRMS()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} - -ReturnType TimingLed2CrystalReader::run(EcalCondDBInterface *, MonRunIOV &, - std::string const &) { - return ReturnType(); -} - -ReturnType OccupancyReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, - std::string const &_formula) { - std::map extList; - - extList["events_over_low_threshold"] = [](MonOccupancyDat const &dat) { - return double(dat.getEventsOverLowThreshold()); - }; - extList["events_over_high_threshold"] = [](MonOccupancyDat const &dat) { - return double(dat.getEventsOverHighThreshold()); - }; - extList["avg_energy"] = [](MonOccupancyDat const &dat) { - return double(dat.getAvgEnergy()); - }; - - return fetchAndFill(extList, _db, _iov, _formula); -} -} // namespace ecaldqm + ReturnType PNBlueReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["adc_mean_g1"] = [](MonPNBlueDat const &dat) { return double(dat.getADCMeanG1()); }; + extList["adc_rms_g1"] = [](MonPNBlueDat const &dat) { return double(dat.getADCRMSG1()); }; + extList["ped_mean_g1"] = [](MonPNBlueDat const &dat) { return double(dat.getPedMeanG1()); }; + extList["ped_rms_g1"] = [](MonPNBlueDat const &dat) { return double(dat.getPedRMSG1()); }; + extList["adc_mean_g16"] = [](MonPNBlueDat const &dat) { return double(dat.getADCMeanG16()); }; + extList["adc_rms_g16"] = [](MonPNBlueDat const &dat) { return double(dat.getADCRMSG16()); }; + extList["ped_mean_g16"] = [](MonPNBlueDat const &dat) { return double(dat.getPedMeanG16()); }; + extList["ped_rms_g16"] = [](MonPNBlueDat const &dat) { return double(dat.getPedMeanG16()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType LaserGreenReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["apd_mean"] = [](MonLaserGreenDat const &dat) { return double(dat.getAPDMean()); }; + extList["apd_rms"] = [](MonLaserGreenDat const &dat) { return double(dat.getAPDRMS()); }; + extList["apd_over_pn_mean"] = [](MonLaserGreenDat const &dat) { return double(dat.getAPDOverPNMean()); }; + extList["apd_over_pn_rms"] = [](MonLaserGreenDat const &dat) { return double(dat.getAPDOverPNRMS()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TimingLaserGreenCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, std::string const &) { + return ReturnType(); + } + + ReturnType PNGreenReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["adc_mean_g1"] = [](MonPNGreenDat const &dat) { return double(dat.getADCMeanG1()); }; + extList["adc_rms_g1"] = [](MonPNGreenDat const &dat) { return double(dat.getADCRMSG1()); }; + extList["ped_mean_g1"] = [](MonPNGreenDat const &dat) { return double(dat.getPedMeanG1()); }; + extList["ped_rms_g1"] = [](MonPNGreenDat const &dat) { return double(dat.getPedRMSG1()); }; + extList["adc_mean_g16"] = [](MonPNGreenDat const &dat) { return double(dat.getADCMeanG16()); }; + extList["adc_rms_g16"] = [](MonPNGreenDat const &dat) { return double(dat.getADCRMSG16()); }; + extList["ped_mean_g16"] = [](MonPNGreenDat const &dat) { return double(dat.getPedMeanG16()); }; + extList["ped_rms_g16"] = [](MonPNGreenDat const &dat) { return double(dat.getPedMeanG16()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType LaserIRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["apd_mean"] = [](MonLaserIRedDat const &dat) { return double(dat.getAPDMean()); }; + extList["apd_rms"] = [](MonLaserIRedDat const &dat) { return double(dat.getAPDRMS()); }; + extList["apd_over_pn_mean"] = [](MonLaserIRedDat const &dat) { return double(dat.getAPDOverPNMean()); }; + extList["apd_over_pn_rms"] = [](MonLaserIRedDat const &dat) { return double(dat.getAPDOverPNRMS()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TimingLaserIRedCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, std::string const &) { + return ReturnType(); + } + + ReturnType PNIRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["adc_mean_g1"] = [](MonPNIRedDat const &dat) { return double(dat.getADCMeanG1()); }; + extList["adc_rms_g1"] = [](MonPNIRedDat const &dat) { return double(dat.getADCRMSG1()); }; + extList["ped_mean_g1"] = [](MonPNIRedDat const &dat) { return double(dat.getPedMeanG1()); }; + extList["ped_rms_g1"] = [](MonPNIRedDat const &dat) { return double(dat.getPedRMSG1()); }; + extList["adc_mean_g16"] = [](MonPNIRedDat const &dat) { return double(dat.getADCMeanG16()); }; + extList["adc_rms_g16"] = [](MonPNIRedDat const &dat) { return double(dat.getADCRMSG16()); }; + extList["ped_mean_g16"] = [](MonPNIRedDat const &dat) { return double(dat.getPedMeanG16()); }; + extList["ped_rms_g16"] = [](MonPNIRedDat const &dat) { return double(dat.getPedMeanG16()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType LaserRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["apd_mean"] = [](MonLaserRedDat const &dat) { return double(dat.getAPDMean()); }; + extList["apd_rms"] = [](MonLaserRedDat const &dat) { return double(dat.getAPDRMS()); }; + extList["apd_over_pn_mean"] = [](MonLaserRedDat const &dat) { return double(dat.getAPDOverPNMean()); }; + extList["apd_over_pn_rms"] = [](MonLaserRedDat const &dat) { return double(dat.getAPDOverPNRMS()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TimingLaserRedCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, std::string const &) { + return ReturnType(); + } + + ReturnType PNRedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["adc_mean_g1"] = [](MonPNRedDat const &dat) { return double(dat.getADCMeanG1()); }; + extList["adc_rms_g1"] = [](MonPNRedDat const &dat) { return double(dat.getADCRMSG1()); }; + extList["ped_mean_g1"] = [](MonPNRedDat const &dat) { return double(dat.getPedMeanG1()); }; + extList["ped_rms_g1"] = [](MonPNRedDat const &dat) { return double(dat.getPedRMSG1()); }; + extList["adc_mean_g16"] = [](MonPNRedDat const &dat) { return double(dat.getADCMeanG16()); }; + extList["adc_rms_g16"] = [](MonPNRedDat const &dat) { return double(dat.getADCRMSG16()); }; + extList["ped_mean_g16"] = [](MonPNRedDat const &dat) { return double(dat.getPedMeanG16()); }; + extList["ped_rms_g16"] = [](MonPNRedDat const &dat) { return double(dat.getPedMeanG16()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType PedestalsReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["ped_mean_g1"] = [](MonPedestalsDat const &dat) { return double(dat.getPedMeanG1()); }; + extList["ped_rms_g1"] = [](MonPedestalsDat const &dat) { return double(dat.getPedRMSG1()); }; + extList["ped_mean_g6"] = [](MonPedestalsDat const &dat) { return double(dat.getPedMeanG6()); }; + extList["ped_rms_g6"] = [](MonPedestalsDat const &dat) { return double(dat.getPedRMSG6()); }; + extList["ped_mean_g12"] = [](MonPedestalsDat const &dat) { return double(dat.getPedMeanG12()); }; + extList["ped_rms_g12"] = [](MonPedestalsDat const &dat) { return double(dat.getPedRMSG12()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType PNPedReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["ped_mean_g1"] = [](MonPNPedDat const &dat) { return double(dat.getPedMeanG1()); }; + extList["ped_rms_g1"] = [](MonPNPedDat const &dat) { return double(dat.getPedRMSG1()); }; + extList["ped_mean_g16"] = [](MonPNPedDat const &dat) { return double(dat.getPedMeanG16()); }; + extList["ped_rms_g16"] = [](MonPNPedDat const &dat) { return double(dat.getPedRMSG16()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType PedestalsOnlineReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["adc_mean_g12"] = [](MonPedestalsOnlineDat const &dat) { return double(dat.getADCMeanG12()); }; + extList["adc_rms_g12"] = [](MonPedestalsOnlineDat const &dat) { return double(dat.getADCRMSG12()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TestPulseReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["adc_mean_g1"] = [](MonTestPulseDat const &dat) { return double(dat.getADCMeanG1()); }; + extList["adc_rms_g1"] = [](MonTestPulseDat const &dat) { return double(dat.getADCRMSG1()); }; + extList["adc_mean_g6"] = [](MonTestPulseDat const &dat) { return double(dat.getADCMeanG6()); }; + extList["adc_rms_g6"] = [](MonTestPulseDat const &dat) { return double(dat.getADCRMSG6()); }; + extList["adc_mean_g12"] = [](MonTestPulseDat const &dat) { return double(dat.getADCMeanG12()); }; + extList["adc_rms_g12"] = [](MonTestPulseDat const &dat) { return double(dat.getADCRMSG12()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType PulseShapeReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["g1_avg_sample_01"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[0]); }; + extList["g1_avg_sample_02"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[1]); }; + extList["g1_avg_sample_03"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[2]); }; + extList["g1_avg_sample_04"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[3]); }; + extList["g1_avg_sample_05"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[4]); }; + extList["g1_avg_sample_06"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[5]); }; + extList["g1_avg_sample_07"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[6]); }; + extList["g1_avg_sample_08"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[7]); }; + extList["g1_avg_sample_09"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[8]); }; + extList["g1_avg_sample_10"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(1)[9]); }; + extList["g6_avg_sample_01"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[0]); }; + extList["g6_avg_sample_02"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[1]); }; + extList["g6_avg_sample_03"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[2]); }; + extList["g6_avg_sample_04"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[3]); }; + extList["g6_avg_sample_05"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[4]); }; + extList["g6_avg_sample_06"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[5]); }; + extList["g6_avg_sample_07"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[6]); }; + extList["g6_avg_sample_08"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[7]); }; + extList["g6_avg_sample_09"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[8]); }; + extList["g6_avg_sample_10"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(6)[9]); }; + extList["g12_avg_sample_01"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[0]); }; + extList["g12_avg_sample_02"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[1]); }; + extList["g12_avg_sample_03"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[2]); }; + extList["g12_avg_sample_04"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[3]); }; + extList["g12_avg_sample_05"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[4]); }; + extList["g12_avg_sample_06"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[5]); }; + extList["g12_avg_sample_07"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[6]); }; + extList["g12_avg_sample_08"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[7]); }; + extList["g12_avg_sample_09"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[8]); }; + extList["g12_avg_sample_10"] = [](MonPulseShapeDat const &dat) { return double(dat.getSamples(12)[9]); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType PNMGPAReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["adc_mean_g1"] = [](MonPNMGPADat const &dat) { return double(dat.getADCMeanG1()); }; + extList["adc_rms_g1"] = [](MonPNMGPADat const &dat) { return double(dat.getADCRMSG1()); }; + extList["ped_mean_g1"] = [](MonPNMGPADat const &dat) { return double(dat.getPedMeanG1()); }; + extList["ped_rms_g1"] = [](MonPNMGPADat const &dat) { return double(dat.getPedRMSG1()); }; + extList["adc_mean_g16"] = [](MonPNMGPADat const &dat) { return double(dat.getADCMeanG16()); }; + extList["adc_rms_g16"] = [](MonPNMGPADat const &dat) { return double(dat.getADCRMSG16()); }; + extList["ped_mean_g16"] = [](MonPNMGPADat const &dat) { return double(dat.getPedMeanG16()); }; + extList["ped_rms_g16"] = [](MonPNMGPADat const &dat) { return double(dat.getPedRMSG16()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TimingCrystalReader::run(EcalCondDBInterface *, MonRunIOV &, std::string const &) { return ReturnType(); } + + ReturnType Led1Reader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["vpt_mean"] = [](MonLed1Dat const &dat) { return double(dat.getVPTMean()); }; + extList["vpt_rms"] = [](MonLed1Dat const &dat) { return double(dat.getVPTRMS()); }; + extList["vpt_over_pn_mean"] = [](MonLed1Dat const &dat) { return double(dat.getVPTOverPNMean()); }; + extList["vpt_over_pn_rms"] = [](MonLed1Dat const &dat) { return double(dat.getVPTOverPNRMS()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TimingLed1CrystalReader::run(EcalCondDBInterface *, MonRunIOV &, std::string const &) { + return ReturnType(); + } + + ReturnType Led2Reader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["vpt_mean"] = [](MonLed2Dat const &dat) { return double(dat.getVPTMean()); }; + extList["vpt_rms"] = [](MonLed2Dat const &dat) { return double(dat.getVPTRMS()); }; + extList["vpt_over_pn_mean"] = [](MonLed2Dat const &dat) { return double(dat.getVPTOverPNMean()); }; + extList["vpt_over_pn_rms"] = [](MonLed2Dat const &dat) { return double(dat.getVPTOverPNRMS()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } + + ReturnType TimingLed2CrystalReader::run(EcalCondDBInterface *, MonRunIOV &, std::string const &) { + return ReturnType(); + } + + ReturnType OccupancyReader::run(EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula) { + std::map extList; + + extList["events_over_low_threshold"] = [](MonOccupancyDat const &dat) { + return double(dat.getEventsOverLowThreshold()); + }; + extList["events_over_high_threshold"] = [](MonOccupancyDat const &dat) { + return double(dat.getEventsOverHighThreshold()); + }; + extList["avg_energy"] = [](MonOccupancyDat const &dat) { return double(dat.getAvgEnergy()); }; + + return fetchAndFill(extList, _db, _iov, _formula); + } +} // namespace ecaldqm diff --git a/DQM/EcalMonitorDbModule/src/DBWriterWorkers.cc b/DQM/EcalMonitorDbModule/src/DBWriterWorkers.cc index 96f54ee0180a3..7fecd416f3339 100644 --- a/DQM/EcalMonitorDbModule/src/DBWriterWorkers.cc +++ b/DQM/EcalMonitorDbModule/src/DBWriterWorkers.cc @@ -52,58 +52,43 @@ #include "FWCore/Utilities/interface/Exception.h" namespace ecaldqm { -enum Quality { - kBad = 0, - kGood = 1, - kUnknown = 2, - kMBad = 3, - kMGood = 4, - kMUnknown = 5 -}; - -bool qualityOK(int _quality) { - return (_quality != kBad && _quality != kUnknown); -} - -DBWriterWorker::DBWriterWorker(std::string const &_name, - edm::ParameterSet const &_ps) - : name_(_name), runTypes_(), source_(), active_(false) { - edm::ParameterSet const ¶ms(_ps.getUntrackedParameterSet(name_)); - - std::vector runTypes( - params.getUntrackedParameter>("runTypes")); - for (unsigned iT(0); iT < runTypes.size(); ++iT) - runTypes_.insert(runTypes[iT]); - - if (!params.existsAs("source", false)) - return; - - edm::ParameterSet const &sourceParams( - params.getUntrackedParameterSet("source")); - std::vector const &meNames(sourceParams.getParameterNames()); - for (unsigned iP(0); iP < meNames.size(); ++iP) { - std::string meName(meNames[iP]); - edm::ParameterSet const &meParam( - sourceParams.getUntrackedParameterSet(meName)); - source_.insert(meName, createMESet(meParam)); - } -} - -void DBWriterWorker::retrieveSource(DQMStore::IGetter &_igetter) { - std::string failedPath; - for (MESetCollection::iterator sItr(this->source_.begin()); - sItr != this->source_.end(); ++sItr) { - if (!sItr->second->retrieve(_igetter, &failedPath)) { - edm::LogError("EcalDQM") << name_ << ": MESet " << sItr->first << "@" - << failedPath << " not found"; - this->active_ = false; + enum Quality { kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3, kMGood = 4, kMUnknown = 5 }; + + bool qualityOK(int _quality) { return (_quality != kBad && _quality != kUnknown); } + + DBWriterWorker::DBWriterWorker(std::string const &_name, edm::ParameterSet const &_ps) + : name_(_name), runTypes_(), source_(), active_(false) { + edm::ParameterSet const ¶ms(_ps.getUntrackedParameterSet(name_)); + + std::vector runTypes(params.getUntrackedParameter>("runTypes")); + for (unsigned iT(0); iT < runTypes.size(); ++iT) + runTypes_.insert(runTypes[iT]); + + if (!params.existsAs("source", false)) return; + + edm::ParameterSet const &sourceParams(params.getUntrackedParameterSet("source")); + std::vector const &meNames(sourceParams.getParameterNames()); + for (unsigned iP(0); iP < meNames.size(); ++iP) { + std::string meName(meNames[iP]); + edm::ParameterSet const &meParam(sourceParams.getUntrackedParameterSet(meName)); + source_.insert(meName, createMESet(meParam)); } } -} -bool IntegrityWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + void DBWriterWorker::retrieveSource(DQMStore::IGetter &_igetter) { + std::string failedPath; + for (MESetCollection::iterator sItr(this->source_.begin()); sItr != this->source_.end(); ++sItr) { + if (!sItr->second->retrieve(_igetter, &failedPath)) { + edm::LogError("EcalDQM") << name_ << ": MESet " << sItr->first << "@" << failedPath << " not found"; + this->active_ = false; + return; + } + } + } + + bool IntegrityWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses OccupancyTask.Digi (h_) PNDiodeTask.Occupancy (hmem_) @@ -122,130 +107,55 @@ bool IntegrityWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { PNIntegrityClient.QualitySummary */ - bool result(true); - - std::map crystalConsistencies; - std::map towerConsistencies; - std::map memChannelConsistencies; - std::map memTowerConsistencies; - - MESet const &digiME(source_.at("Digi")); - MESet const &gainME(source_.at("Gain")); - MESet const &chidME(source_.at("ChId")); - MESet const &gainswitchME(source_.at("GainSwitch")); - MESet const &qualityME(source_.at("Quality")); - - MESet const &toweridME(source_.at("TowerId")); - MESet const &blocksizeME(source_.at("BlockSize")); - MESet const &l1aME(source_.at("L1AFE")); - MESet const &bxME(source_.at("BXFE")); - - MESet const &memdigiME(source_.at("MEMDigi")); - MESet const &memchidME(source_.at("MEMChId")); - MESet const &memgainME(source_.at("MEMGain")); - MESet const &pnqualityME(source_.at("PNQuality")); - - MESet const &memtoweridME(source_.at("MEMTowerId")); - MESet const &memblocksizeME(source_.at("MEMBlockSize")); - - if (verbosity_ > 1) - edm::LogInfo("EcalDQM") << " Looping over crystals"; - - MESet::const_iterator dEnd(digiME.end()); - MESet::const_iterator qItr(qualityME); - for (MESet::const_iterator dItr(digiME.beginChannel()); dItr != dEnd; - dItr.toNextChannel()) { - DetId id(dItr->getId()); - - int nDigis(dItr->getBinContent()); - int gain(gainME.getBinContent(id)); - int chid(chidME.getBinContent(id)); - int gainswitch(gainswitchME.getBinContent(id)); - qItr = dItr; - - if (gain > 0 || chid > 0 || gainswitch > 0) { - MonCrystalConsistencyDat &data(crystalConsistencies[crystalID(id)]); - data.setProcessedEvents(nDigis); - data.setProblematicEvents(gain + chid + gainswitch); - data.setProblemsGainZero(gain); - data.setProblemsID(chid); - data.setProblemsGainSwitch(gainswitch); - - int channelStatus(qItr->getBinContent()); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); - data.setTaskStatus(channelBad); - - result &= qualityOK(channelStatus); - } - } - - if (verbosity_ > 1) - edm::LogInfo("EcalDQM") << " Looping over towers"; + bool result(true); - for (unsigned iDCC(kEEmLow); iDCC <= kEBpHigh; ++iDCC) { - for (unsigned iTower(1); iTower <= 68; ++iTower) { - if (!ccuExists(iDCC + 1, iTower)) - continue; - - EcalElectronicsId eid(iDCC + 1, iTower, 1, 1); - std::vector channels( - getElectronicsMap()->dccTowerConstituents(iDCC + 1, iTower)); - int nDigis(0); - bool towerBad(false); - for (unsigned iD(0); iD < channels.size(); ++iD) { - int n(digiME.getBinContent(channels[iD])); - if (n > nDigis) - nDigis = n; - int channelStatus(qualityME.getBinContent(channels[iD])); - if (channelStatus == kBad || channelStatus == kMBad) - towerBad = true; - } + std::map crystalConsistencies; + std::map towerConsistencies; + std::map memChannelConsistencies; + std::map memTowerConsistencies; - int towerid(toweridME.getBinContent(eid)); - int blocksize(blocksizeME.getBinContent(eid)); - int l1a(l1aME.getBinContent(iDCC + 1, iTower)); - int bx(bxME.getBinContent(iDCC + 1, iTower)); + MESet const &digiME(source_.at("Digi")); + MESet const &gainME(source_.at("Gain")); + MESet const &chidME(source_.at("ChId")); + MESet const &gainswitchME(source_.at("GainSwitch")); + MESet const &qualityME(source_.at("Quality")); - if (towerid > 0 || blocksize > 0 || l1a > 0 || bx > 0) { - MonTTConsistencyDat &data(towerConsistencies[towerID(eid)]); - data.setProcessedEvents(nDigis); - data.setProblematicEvents(towerid + blocksize + l1a + bx); - data.setProblemsID(towerid); - data.setProblemsSize(blocksize); - data.setProblemsLV1(l1a); - data.setProblemsBunchX(bx); - data.setTaskStatus(towerBad); - - result &= !towerBad; - } - } - } + MESet const &toweridME(source_.at("TowerId")); + MESet const &blocksizeME(source_.at("BlockSize")); + MESet const &l1aME(source_.at("L1AFE")); + MESet const &bxME(source_.at("BXFE")); - if (verbosity_ > 1) - edm::LogInfo("EcalDQM") << " Looping over MEM channels and towers"; + MESet const &memdigiME(source_.at("MEMDigi")); + MESet const &memchidME(source_.at("MEMChId")); + MESet const &memgainME(source_.at("MEMGain")); + MESet const &pnqualityME(source_.at("PNQuality")); - for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { - unsigned iDCC(memDCC[iMD]); + MESet const &memtoweridME(source_.at("MEMTowerId")); + MESet const &memblocksizeME(source_.at("MEMBlockSize")); - int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); + if (verbosity_ > 1) + edm::LogInfo("EcalDQM") << " Looping over crystals"; - for (unsigned iPN(1); iPN <= 10; ++iPN) { - EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); - - int nDigis(memdigiME.getBinContent(pnid)); - int memchid(memchidME.getBinContent(pnid)); - int memgain(memgainME.getBinContent(pnid)); + MESet::const_iterator dEnd(digiME.end()); + MESet::const_iterator qItr(qualityME); + for (MESet::const_iterator dItr(digiME.beginChannel()); dItr != dEnd; dItr.toNextChannel()) { + DetId id(dItr->getId()); - if (memchid > 0 || memgain > 0) { - MonMemChConsistencyDat &data( - memChannelConsistencies[memChannelID(pnid)]); + int nDigis(dItr->getBinContent()); + int gain(gainME.getBinContent(id)); + int chid(chidME.getBinContent(id)); + int gainswitch(gainswitchME.getBinContent(id)); + qItr = dItr; + if (gain > 0 || chid > 0 || gainswitch > 0) { + MonCrystalConsistencyDat &data(crystalConsistencies[crystalID(id)]); data.setProcessedEvents(nDigis); - data.setProblematicEvents(memchid + memgain); - data.setProblemsID(memchid); - data.setProblemsGainZero(memgain); + data.setProblematicEvents(gain + chid + gainswitch); + data.setProblemsGainZero(gain); + data.setProblemsID(chid); + data.setProblemsGainSwitch(gainswitch); - int channelStatus(pnqualityME.getBinContent(pnid)); + int channelStatus(qItr->getBinContent()); bool channelBad(channelStatus == kBad || channelStatus == kMBad); data.setTaskStatus(channelBad); @@ -253,97 +163,166 @@ bool IntegrityWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { } } - for (unsigned iTower(69); iTower <= 70; ++iTower) { - EcalElectronicsId eid(iDCC + 1, iTower, 1, 1); + if (verbosity_ > 1) + edm::LogInfo("EcalDQM") << " Looping over towers"; + + for (unsigned iDCC(kEEmLow); iDCC <= kEBpHigh; ++iDCC) { + for (unsigned iTower(1); iTower <= 68; ++iTower) { + if (!ccuExists(iDCC + 1, iTower)) + continue; + + EcalElectronicsId eid(iDCC + 1, iTower, 1, 1); + std::vector channels(getElectronicsMap()->dccTowerConstituents(iDCC + 1, iTower)); + int nDigis(0); + bool towerBad(false); + for (unsigned iD(0); iD < channels.size(); ++iD) { + int n(digiME.getBinContent(channels[iD])); + if (n > nDigis) + nDigis = n; + int channelStatus(qualityME.getBinContent(channels[iD])); + if (channelStatus == kBad || channelStatus == kMBad) + towerBad = true; + } + + int towerid(toweridME.getBinContent(eid)); + int blocksize(blocksizeME.getBinContent(eid)); + int l1a(l1aME.getBinContent(iDCC + 1, iTower)); + int bx(bxME.getBinContent(iDCC + 1, iTower)); + + if (towerid > 0 || blocksize > 0 || l1a > 0 || bx > 0) { + MonTTConsistencyDat &data(towerConsistencies[towerID(eid)]); + data.setProcessedEvents(nDigis); + data.setProblematicEvents(towerid + blocksize + l1a + bx); + data.setProblemsID(towerid); + data.setProblemsSize(blocksize); + data.setProblemsLV1(l1a); + data.setProblemsBunchX(bx); + data.setTaskStatus(towerBad); + + result &= !towerBad; + } + } + } + + if (verbosity_ > 1) + edm::LogInfo("EcalDQM") << " Looping over MEM channels and towers"; + + for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { + unsigned iDCC(memDCC[iMD]); + + int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); - int nDigis(0); - bool towerBad(false); for (unsigned iPN(1); iPN <= 10; ++iPN) { EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); - int n(memdigiME.getBinContent(pnid)); - if (n > nDigis) - nDigis = n; - int channelStatus(pnqualityME.getBinContent(pnid)); - if (channelStatus == kBad || channelStatus == kMBad) - towerBad = true; + + int nDigis(memdigiME.getBinContent(pnid)); + int memchid(memchidME.getBinContent(pnid)); + int memgain(memgainME.getBinContent(pnid)); + + if (memchid > 0 || memgain > 0) { + MonMemChConsistencyDat &data(memChannelConsistencies[memChannelID(pnid)]); + + data.setProcessedEvents(nDigis); + data.setProblematicEvents(memchid + memgain); + data.setProblemsID(memchid); + data.setProblemsGainZero(memgain); + + int channelStatus(pnqualityME.getBinContent(pnid)); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + data.setTaskStatus(channelBad); + + result &= qualityOK(channelStatus); + } } - int towerid(memtoweridME.getBinContent(eid)); - int blocksize(memblocksizeME.getBinContent(eid)); + for (unsigned iTower(69); iTower <= 70; ++iTower) { + EcalElectronicsId eid(iDCC + 1, iTower, 1, 1); + + int nDigis(0); + bool towerBad(false); + for (unsigned iPN(1); iPN <= 10; ++iPN) { + EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); + int n(memdigiME.getBinContent(pnid)); + if (n > nDigis) + nDigis = n; + int channelStatus(pnqualityME.getBinContent(pnid)); + if (channelStatus == kBad || channelStatus == kMBad) + towerBad = true; + } - if (towerid > 0 || blocksize > 0) { - MonMemTTConsistencyDat &data(memTowerConsistencies[memTowerID(eid)]); + int towerid(memtoweridME.getBinContent(eid)); + int blocksize(memblocksizeME.getBinContent(eid)); - data.setProcessedEvents(nDigis); - data.setProblematicEvents(towerid + blocksize); - data.setProblemsID(towerid); - data.setProblemsSize(blocksize); - data.setTaskStatus(towerBad); + if (towerid > 0 || blocksize > 0) { + MonMemTTConsistencyDat &data(memTowerConsistencies[memTowerID(eid)]); - result &= !towerBad; + data.setProcessedEvents(nDigis); + data.setProblematicEvents(towerid + blocksize); + data.setProblemsID(towerid); + data.setProblemsSize(blocksize); + data.setTaskStatus(towerBad); + + result &= !towerBad; + } } } - } - if (verbosity_ > 1) - edm::LogInfo("EcalDQM") << " Inserting data"; + if (verbosity_ > 1) + edm::LogInfo("EcalDQM") << " Inserting data"; - try { - if (!crystalConsistencies.empty()) { - if (verbosity_ > 2) - edm::LogInfo("EcalDQM") << " crystalConsistencies"; - _db->insertDataArraySet(&crystalConsistencies, &_iov); - } - if (!towerConsistencies.empty()) { - if (verbosity_ > 2) - edm::LogInfo("EcalDQM") << " towerConsistencies"; - _db->insertDataArraySet(&towerConsistencies, &_iov); - } - if (!memChannelConsistencies.empty()) { - if (verbosity_ > 2) - edm::LogInfo("EcalDQM") << " memChannelConsistencies"; - _db->insertDataArraySet(&memChannelConsistencies, &_iov); - } - if (!memTowerConsistencies.empty()) { - if (verbosity_ > 2) - edm::LogInfo("EcalDQM") << " memTowerConsistencies"; - _db->insertDataArraySet(&memTowerConsistencies, &_iov); + try { + if (!crystalConsistencies.empty()) { + if (verbosity_ > 2) + edm::LogInfo("EcalDQM") << " crystalConsistencies"; + _db->insertDataArraySet(&crystalConsistencies, &_iov); + } + if (!towerConsistencies.empty()) { + if (verbosity_ > 2) + edm::LogInfo("EcalDQM") << " towerConsistencies"; + _db->insertDataArraySet(&towerConsistencies, &_iov); + } + if (!memChannelConsistencies.empty()) { + if (verbosity_ > 2) + edm::LogInfo("EcalDQM") << " memChannelConsistencies"; + _db->insertDataArraySet(&memChannelConsistencies, &_iov); + } + if (!memTowerConsistencies.empty()) { + if (verbosity_ > 2) + edm::LogInfo("EcalDQM") << " memTowerConsistencies"; + _db->insertDataArraySet(&memTowerConsistencies, &_iov); + } + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); } - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); + + return result; } - return result; -} - -LaserWriter::LaserWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("Laser", _ps), wlToME_() { - std::vector laserWavelengths( - _ps.getUntrackedParameter>("laserWavelengths")); - - // wavelengths are not necessarily ordered - // create a map wl -> MESet index - // using Amplitude here but any multi-wavelength plot is fine - - MESet::PathReplacements repl; - - MESetMulti const &litude( - static_cast(source_.at("Amplitude"))); - unsigned nWL(laserWavelengths.size()); - for (unsigned iWL(0); iWL != nWL; ++iWL) { - int wl(laserWavelengths[iWL]); - if (wl <= 0 || wl >= 5) - throw cms::Exception("InvalidConfiguration") << "Laser Wavelength"; - repl["wl"] = std::to_string(wl); - wlToME_[wl] = amplitude.getIndex(repl); + LaserWriter::LaserWriter(edm::ParameterSet const &_ps) : DBWriterWorker("Laser", _ps), wlToME_() { + std::vector laserWavelengths(_ps.getUntrackedParameter>("laserWavelengths")); + + // wavelengths are not necessarily ordered + // create a map wl -> MESet index + // using Amplitude here but any multi-wavelength plot is fine + + MESet::PathReplacements repl; + + MESetMulti const &litude(static_cast(source_.at("Amplitude"))); + unsigned nWL(laserWavelengths.size()); + for (unsigned iWL(0); iWL != nWL; ++iWL) { + int wl(laserWavelengths[iWL]); + if (wl <= 0 || wl >= 5) + throw cms::Exception("InvalidConfiguration") << "Laser Wavelength"; + repl["wl"] = std::to_string(wl); + wlToME_[wl] = amplitude.getIndex(repl); + } } -} -bool LaserWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + bool LaserWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses LaserTask.Amplitude (h01, h03, h05, h07) LaserTask.AOverP (h02, h04, h06, h08) @@ -354,281 +333,274 @@ bool LaserWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { PNDiodeTask.Pedestal (i13, i14, i15, i16) */ - bool result(true); - - std::map l1Amp; - std::map l1Time; - std::map l1PN; - std::map l2Amp; - std::map l2Time; - std::map l2PN; - std::map l3Amp; - std::map l3Time; - std::map l3PN; - std::map l4Amp; - std::map l4Time; - std::map l4PN; - - MESet const &ME(source_.at("Amplitude")); - MESet const &aopME(source_.at("AOverP")); - MESet const &timeME(source_.at("Timing")); - MESet const &qualityME(source_.at("Quality")); - - MESet const &pnME(source_.at("PNAmplitude")); - MESet const &pnQualityME(source_.at("PNQuality")); - MESet const &pnPedestalME(source_.at("PNPedestal")); - - for (std::map::iterator wlItr(wlToME_.begin()); - wlItr != wlToME_.end(); ++wlItr) { - int wl(wlItr->first); - unsigned iM(wlItr->second); - - static_cast(ampME).use(iM); - static_cast(aopME).use(iM); - static_cast(timeME).use(iM); - static_cast(qualityME).use(iM); - static_cast(pnME).use(iM); - static_cast(pnQualityME).use(iM); - - MESet::const_iterator aEnd(ampME.end()); - MESet::const_iterator qItr(qualityME); - MESet::const_iterator oItr(aopME); - MESet::const_iterator tItr(timeME); - for (MESet::const_iterator aItr(ampME.beginChannel()); aItr != aEnd; - aItr.toNextChannel()) { - float aEntries(aItr->getBinEntries()); - if (aEntries < 1.) - continue; - - qItr = aItr; - oItr = aItr; - tItr = aItr; + bool result(true); + + std::map l1Amp; + std::map l1Time; + std::map l1PN; + std::map l2Amp; + std::map l2Time; + std::map l2PN; + std::map l3Amp; + std::map l3Time; + std::map l3PN; + std::map l4Amp; + std::map l4Time; + std::map l4PN; + + MESet const &ME(source_.at("Amplitude")); + MESet const &aopME(source_.at("AOverP")); + MESet const &timeME(source_.at("Timing")); + MESet const &qualityME(source_.at("Quality")); + + MESet const &pnME(source_.at("PNAmplitude")); + MESet const &pnQualityME(source_.at("PNQuality")); + MESet const &pnPedestalME(source_.at("PNPedestal")); + + for (std::map::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr) { + int wl(wlItr->first); + unsigned iM(wlItr->second); + + static_cast(ampME).use(iM); + static_cast(aopME).use(iM); + static_cast(timeME).use(iM); + static_cast(qualityME).use(iM); + static_cast(pnME).use(iM); + static_cast(pnQualityME).use(iM); + + MESet::const_iterator aEnd(ampME.end()); + MESet::const_iterator qItr(qualityME); + MESet::const_iterator oItr(aopME); + MESet::const_iterator tItr(timeME); + for (MESet::const_iterator aItr(ampME.beginChannel()); aItr != aEnd; aItr.toNextChannel()) { + float aEntries(aItr->getBinEntries()); + if (aEntries < 1.) + continue; - DetId id(aItr->getId()); + qItr = aItr; + oItr = aItr; + tItr = aItr; - float ampMean(aItr->getBinContent()); - float ampRms(aItr->getBinError() * std::sqrt(aEntries)); + DetId id(aItr->getId()); - float aopEntries(oItr->getBinEntries()); - float aopMean(oItr->getBinContent()); - float aopRms(oItr->getBinError() * std::sqrt(aopEntries)); + float ampMean(aItr->getBinContent()); + float ampRms(aItr->getBinError() * std::sqrt(aEntries)); - float timeEntries(tItr->getBinEntries()); - float timeMean(tItr->getBinContent()); - float timeRms(tItr->getBinError() * std::sqrt(timeEntries)); + float aopEntries(oItr->getBinEntries()); + float aopMean(oItr->getBinContent()); + float aopRms(oItr->getBinError() * std::sqrt(aopEntries)); - int channelStatus(qItr->getBinContent()); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); - - EcalLogicID logicID(crystalID(id)); - - switch (wl) { - case 1: { - MonLaserBlueDat &aData(l1Amp[logicID]); - aData.setAPDMean(ampMean); - aData.setAPDRMS(ampRms); - aData.setAPDOverPNMean(aopMean); - aData.setAPDOverPNRMS(aopRms); - aData.setTaskStatus(channelBad); - - MonTimingLaserBlueCrystalDat &tData(l1Time[logicID]); - tData.setTimingMean(timeMean); - tData.setTimingRMS(timeRms); - tData.setTaskStatus(channelBad); - } break; - case 2: { - MonLaserGreenDat &aData(l2Amp[logicID]); - aData.setAPDMean(ampMean); - aData.setAPDRMS(ampRms); - aData.setAPDOverPNMean(aopMean); - aData.setAPDOverPNRMS(aopRms); - aData.setTaskStatus(channelBad); - - MonTimingLaserGreenCrystalDat &tData(l2Time[logicID]); - tData.setTimingMean(timeMean); - tData.setTimingRMS(timeRms); - tData.setTaskStatus(channelBad); - } break; - case 3: { - MonLaserIRedDat &aData(l3Amp[logicID]); - aData.setAPDMean(ampMean); - aData.setAPDRMS(ampRms); - aData.setAPDOverPNMean(aopMean); - aData.setAPDOverPNRMS(aopRms); - aData.setTaskStatus(channelBad); - - MonTimingLaserIRedCrystalDat &tData(l3Time[logicID]); - tData.setTimingMean(timeMean); - tData.setTimingRMS(timeRms); - tData.setTaskStatus(channelBad); - } break; - case 4: { - MonLaserRedDat &aData(l4Amp[logicID]); - aData.setAPDMean(ampMean); - aData.setAPDRMS(ampRms); - aData.setAPDOverPNMean(aopMean); - aData.setAPDOverPNRMS(aopRms); - aData.setTaskStatus(channelBad); - - MonTimingLaserRedCrystalDat &tData(l4Time[logicID]); - tData.setTimingMean(timeMean); - tData.setTimingRMS(timeRms); - tData.setTaskStatus(channelBad); - } break; - } - result &= qualityOK(channelStatus); - } - - for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { - unsigned iDCC(memDCC[iMD]); - - int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); - - for (unsigned iPN(1); iPN <= 10; ++iPN) { - EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); + float timeEntries(tItr->getBinEntries()); + float timeMean(tItr->getBinContent()); + float timeRms(tItr->getBinError() * std::sqrt(timeEntries)); - float entries(pnME.getBinEntries(pnid)); - if (entries < 1.) - continue; - - float mean(pnME.getBinContent(pnid)); - float rms(pnME.getBinError(pnid) * std::sqrt(entries)); - - float pedestalEntries(pnPedestalME.getBinEntries(pnid)); - float pedestalMean(pnPedestalME.getBinContent(pnid)); - float pedestalRms(pnPedestalME.getBinError(pnid) * - std::sqrt(pedestalEntries)); - - int channelStatus(pnQualityME.getBinContent(pnid)); + int channelStatus(qItr->getBinContent()); bool channelBad(channelStatus == kBad || channelStatus == kMBad); + EcalLogicID logicID(crystalID(id)); + switch (wl) { - case 1: { - MonPNBlueDat &data(l1PN[lmPNID(pnid)]); - data.setADCMeanG1(-1.); - data.setADCRMSG1(-1.); - data.setPedMeanG1(-1.); - data.setPedRMSG1(-1.); - data.setADCMeanG16(mean); - data.setADCRMSG16(rms); - data.setPedMeanG16(pedestalMean); - data.setPedRMSG16(pedestalRms); - data.setTaskStatus(channelBad); - } break; - case 2: { - MonPNGreenDat &data(l2PN[lmPNID(pnid)]); - data.setADCMeanG1(-1.); - data.setADCRMSG1(-1.); - data.setPedMeanG1(-1.); - data.setPedRMSG1(-1.); - data.setADCMeanG16(mean); - data.setADCRMSG16(rms); - data.setPedMeanG16(pedestalMean); - data.setPedRMSG16(pedestalRms); - data.setTaskStatus(channelBad); - } break; - case 3: { - MonPNIRedDat &data(l3PN[lmPNID(pnid)]); - data.setADCMeanG1(-1.); - data.setADCRMSG1(-1.); - data.setPedMeanG1(-1.); - data.setPedRMSG1(-1.); - data.setADCMeanG16(mean); - data.setADCRMSG16(rms); - data.setPedMeanG16(pedestalMean); - data.setPedRMSG16(pedestalRms); - data.setTaskStatus(channelBad); - } break; - case 4: { - MonPNRedDat &data(l4PN[lmPNID(pnid)]); - data.setADCMeanG1(-1.); - data.setADCRMSG1(-1.); - data.setPedMeanG1(-1.); - data.setPedRMSG1(-1.); - data.setADCMeanG16(mean); - data.setADCRMSG16(rms); - data.setPedMeanG16(pedestalMean); - data.setPedRMSG16(pedestalRms); - data.setTaskStatus(channelBad); - } break; + case 1: { + MonLaserBlueDat &aData(l1Amp[logicID]); + aData.setAPDMean(ampMean); + aData.setAPDRMS(ampRms); + aData.setAPDOverPNMean(aopMean); + aData.setAPDOverPNRMS(aopRms); + aData.setTaskStatus(channelBad); + + MonTimingLaserBlueCrystalDat &tData(l1Time[logicID]); + tData.setTimingMean(timeMean); + tData.setTimingRMS(timeRms); + tData.setTaskStatus(channelBad); + } break; + case 2: { + MonLaserGreenDat &aData(l2Amp[logicID]); + aData.setAPDMean(ampMean); + aData.setAPDRMS(ampRms); + aData.setAPDOverPNMean(aopMean); + aData.setAPDOverPNRMS(aopRms); + aData.setTaskStatus(channelBad); + + MonTimingLaserGreenCrystalDat &tData(l2Time[logicID]); + tData.setTimingMean(timeMean); + tData.setTimingRMS(timeRms); + tData.setTaskStatus(channelBad); + } break; + case 3: { + MonLaserIRedDat &aData(l3Amp[logicID]); + aData.setAPDMean(ampMean); + aData.setAPDRMS(ampRms); + aData.setAPDOverPNMean(aopMean); + aData.setAPDOverPNRMS(aopRms); + aData.setTaskStatus(channelBad); + + MonTimingLaserIRedCrystalDat &tData(l3Time[logicID]); + tData.setTimingMean(timeMean); + tData.setTimingRMS(timeRms); + tData.setTaskStatus(channelBad); + } break; + case 4: { + MonLaserRedDat &aData(l4Amp[logicID]); + aData.setAPDMean(ampMean); + aData.setAPDRMS(ampRms); + aData.setAPDOverPNMean(aopMean); + aData.setAPDOverPNRMS(aopRms); + aData.setTaskStatus(channelBad); + + MonTimingLaserRedCrystalDat &tData(l4Time[logicID]); + tData.setTimingMean(timeMean); + tData.setTimingRMS(timeRms); + tData.setTaskStatus(channelBad); + } break; } - result &= qualityOK(channelStatus); } + + for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { + unsigned iDCC(memDCC[iMD]); + + int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); + + for (unsigned iPN(1); iPN <= 10; ++iPN) { + EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); + + float entries(pnME.getBinEntries(pnid)); + if (entries < 1.) + continue; + + float mean(pnME.getBinContent(pnid)); + float rms(pnME.getBinError(pnid) * std::sqrt(entries)); + + float pedestalEntries(pnPedestalME.getBinEntries(pnid)); + float pedestalMean(pnPedestalME.getBinContent(pnid)); + float pedestalRms(pnPedestalME.getBinError(pnid) * std::sqrt(pedestalEntries)); + + int channelStatus(pnQualityME.getBinContent(pnid)); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + + switch (wl) { + case 1: { + MonPNBlueDat &data(l1PN[lmPNID(pnid)]); + data.setADCMeanG1(-1.); + data.setADCRMSG1(-1.); + data.setPedMeanG1(-1.); + data.setPedRMSG1(-1.); + data.setADCMeanG16(mean); + data.setADCRMSG16(rms); + data.setPedMeanG16(pedestalMean); + data.setPedRMSG16(pedestalRms); + data.setTaskStatus(channelBad); + } break; + case 2: { + MonPNGreenDat &data(l2PN[lmPNID(pnid)]); + data.setADCMeanG1(-1.); + data.setADCRMSG1(-1.); + data.setPedMeanG1(-1.); + data.setPedRMSG1(-1.); + data.setADCMeanG16(mean); + data.setADCRMSG16(rms); + data.setPedMeanG16(pedestalMean); + data.setPedRMSG16(pedestalRms); + data.setTaskStatus(channelBad); + } break; + case 3: { + MonPNIRedDat &data(l3PN[lmPNID(pnid)]); + data.setADCMeanG1(-1.); + data.setADCRMSG1(-1.); + data.setPedMeanG1(-1.); + data.setPedRMSG1(-1.); + data.setADCMeanG16(mean); + data.setADCRMSG16(rms); + data.setPedMeanG16(pedestalMean); + data.setPedRMSG16(pedestalRms); + data.setTaskStatus(channelBad); + } break; + case 4: { + MonPNRedDat &data(l4PN[lmPNID(pnid)]); + data.setADCMeanG1(-1.); + data.setADCRMSG1(-1.); + data.setPedMeanG1(-1.); + data.setPedRMSG1(-1.); + data.setADCMeanG16(mean); + data.setADCRMSG16(rms); + data.setPedMeanG16(pedestalMean); + data.setPedRMSG16(pedestalRms); + data.setTaskStatus(channelBad); + } break; + } + + result &= qualityOK(channelStatus); + } + } } - } - try { - if (!l1Amp.empty()) - _db->insertDataArraySet(&l1Amp, &_iov); - if (!l1Time.empty()) - _db->insertDataArraySet(&l1Time, &_iov); - if (!l1PN.empty()) - _db->insertDataArraySet(&l1PN, &_iov); - if (!l2Amp.empty()) - _db->insertDataArraySet(&l2Amp, &_iov); - if (!l2Time.empty()) - _db->insertDataArraySet(&l2Time, &_iov); - if (!l2PN.empty()) - _db->insertDataArraySet(&l2PN, &_iov); - if (!l3Amp.empty()) - _db->insertDataArraySet(&l3Amp, &_iov); - if (!l3Time.empty()) - _db->insertDataArraySet(&l3Time, &_iov); - if (!l3PN.empty()) - _db->insertDataArraySet(&l3PN, &_iov); - if (!l4Amp.empty()) - _db->insertDataArraySet(&l4Amp, &_iov); - if (!l4Time.empty()) - _db->insertDataArraySet(&l4Time, &_iov); - if (!l4PN.empty()) - _db->insertDataArraySet(&l4PN, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); - } + try { + if (!l1Amp.empty()) + _db->insertDataArraySet(&l1Amp, &_iov); + if (!l1Time.empty()) + _db->insertDataArraySet(&l1Time, &_iov); + if (!l1PN.empty()) + _db->insertDataArraySet(&l1PN, &_iov); + if (!l2Amp.empty()) + _db->insertDataArraySet(&l2Amp, &_iov); + if (!l2Time.empty()) + _db->insertDataArraySet(&l2Time, &_iov); + if (!l2PN.empty()) + _db->insertDataArraySet(&l2PN, &_iov); + if (!l3Amp.empty()) + _db->insertDataArraySet(&l3Amp, &_iov); + if (!l3Time.empty()) + _db->insertDataArraySet(&l3Time, &_iov); + if (!l3PN.empty()) + _db->insertDataArraySet(&l3PN, &_iov); + if (!l4Amp.empty()) + _db->insertDataArraySet(&l4Amp, &_iov); + if (!l4Time.empty()) + _db->insertDataArraySet(&l4Time, &_iov); + if (!l4PN.empty()) + _db->insertDataArraySet(&l4PN, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - return result; -} - -PedestalWriter::PedestalWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("Pedestal", _ps), gainToME_(), pnGainToME_() { - std::vector MGPAGains( - _ps.getUntrackedParameter>("MGPAGains")); - std::vector MGPAGainsPN( - _ps.getUntrackedParameter>("MGPAGainsPN")); - - MESet::PathReplacements repl; - - MESetMulti const &pedestal( - static_cast(source_.at("Pedestal"))); - unsigned nG(MGPAGains.size()); - for (unsigned iG(0); iG != nG; ++iG) { - int gain(MGPAGains[iG]); - if (gain != 1 && gain != 6 && gain != 12) - throw cms::Exception("InvalidConfiguration") << "MGPA gain"; - repl["gain"] = std::to_string(gain); - gainToME_[gain] = pedestal.getIndex(repl); + return result; } - repl.clear(); - - MESetMulti const &pnPedestal( - static_cast(source_.at("PNPedestal"))); - unsigned nGPN(MGPAGainsPN.size()); - for (unsigned iG(0); iG != nGPN; ++iG) { - int gain(MGPAGainsPN[iG]); - if (gain != 1 && gain != 16) - throw cms::Exception("InvalidConfiguration") << "PN MGPA gain"; - repl["pngain"] = std::to_string(gain); - pnGainToME_[gain] = pnPedestal.getIndex(repl); + PedestalWriter::PedestalWriter(edm::ParameterSet const &_ps) + : DBWriterWorker("Pedestal", _ps), gainToME_(), pnGainToME_() { + std::vector MGPAGains(_ps.getUntrackedParameter>("MGPAGains")); + std::vector MGPAGainsPN(_ps.getUntrackedParameter>("MGPAGainsPN")); + + MESet::PathReplacements repl; + + MESetMulti const &pedestal(static_cast(source_.at("Pedestal"))); + unsigned nG(MGPAGains.size()); + for (unsigned iG(0); iG != nG; ++iG) { + int gain(MGPAGains[iG]); + if (gain != 1 && gain != 6 && gain != 12) + throw cms::Exception("InvalidConfiguration") << "MGPA gain"; + repl["gain"] = std::to_string(gain); + gainToME_[gain] = pedestal.getIndex(repl); + } + + repl.clear(); + + MESetMulti const &pnPedestal(static_cast(source_.at("PNPedestal"))); + unsigned nGPN(MGPAGainsPN.size()); + for (unsigned iG(0); iG != nGPN; ++iG) { + int gain(MGPAGainsPN[iG]); + if (gain != 1 && gain != 16) + throw cms::Exception("InvalidConfiguration") << "PN MGPA gain"; + repl["pngain"] = std::to_string(gain); + pnGainToME_[gain] = pnPedestal.getIndex(repl); + } } -} -bool PedestalWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + bool PedestalWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses PedestalTask.Pedestal (h01, h02, h03) PedestalTask.PNPedestal (i01, i02) @@ -636,121 +608,65 @@ bool PedestalWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { PedestalClient.PNQualitySummary (meg04, meg05) */ - bool result(true); + bool result(true); - std::map pedestals; - std::map pnPedestals; + std::map pedestals; + std::map pnPedestals; - MESet const &pedestalME(source_.at("Pedestal")); - MESet const &qualityME(source_.at("Quality")); + MESet const &pedestalME(source_.at("Pedestal")); + MESet const &qualityME(source_.at("Quality")); - MESet const &pnPedestalME(source_.at("PNPedestal")); - MESet const &pnQualityME(source_.at("PNQuality")); - - for (std::map::iterator gainItr(gainToME_.begin()); - gainItr != gainToME_.end(); ++gainItr) { - int gain(gainItr->first); - int iM(gainItr->second); - - static_cast(pedestalME).use(iM); - static_cast(qualityME).use(iM); - - MESet::const_iterator pEnd(pedestalME.end()); - MESet::const_iterator qItr(qualityME); - for (MESet::const_iterator pItr(pedestalME.beginChannel()); pItr != pEnd; - pItr.toNextChannel()) { - float entries(pItr->getBinEntries()); - if (entries < 1.) - continue; - - qItr = pItr; - - float mean(pItr->getBinContent()); - float rms(pItr->getBinError() * std::sqrt(entries)); - - EcalLogicID logicID(crystalID(pItr->getId())); - if (pedestals.find(logicID) == pedestals.end()) { - MonPedestalsDat &insertion(pedestals[logicID]); - insertion.setPedMeanG1(-1.); - insertion.setPedRMSG1(-1.); - insertion.setPedMeanG6(-1.); - insertion.setPedRMSG6(-1.); - insertion.setPedMeanG12(-1.); - insertion.setPedRMSG12(-1.); - insertion.setTaskStatus(false); - } - - MonPedestalsDat &data(pedestals[logicID]); - switch (gain) { - case 1: - data.setPedMeanG1(mean); - data.setPedRMSG1(rms); - break; - case 6: - data.setPedMeanG6(mean); - data.setPedRMSG6(rms); - break; - case 12: - data.setPedMeanG12(mean); - data.setPedRMSG12(rms); - break; - } - - int channelStatus(qItr->getBinContent()); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); - if (channelBad) - data.setTaskStatus(true); - - result &= qualityOK(channelStatus); - } - } - - for (std::map::iterator gainItr(pnGainToME_.begin()); - gainItr != pnGainToME_.end(); ++gainItr) { - int gain(gainItr->first); - int iM(gainItr->second); - - static_cast(pnPedestalME).use(iM); - static_cast(pnQualityME).use(iM); - - for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { - unsigned iDCC(memDCC[iMD]); + MESet const &pnPedestalME(source_.at("PNPedestal")); + MESet const &pnQualityME(source_.at("PNQuality")); - int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); + for (std::map::iterator gainItr(gainToME_.begin()); gainItr != gainToME_.end(); ++gainItr) { + int gain(gainItr->first); + int iM(gainItr->second); - for (unsigned iPN(1); iPN <= 10; ++iPN) { - EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); + static_cast(pedestalME).use(iM); + static_cast(qualityME).use(iM); - float entries(pnPedestalME.getBinEntries(pnid)); + MESet::const_iterator pEnd(pedestalME.end()); + MESet::const_iterator qItr(qualityME); + for (MESet::const_iterator pItr(pedestalME.beginChannel()); pItr != pEnd; pItr.toNextChannel()) { + float entries(pItr->getBinEntries()); if (entries < 1.) continue; - float mean(pnPedestalME.getBinContent(pnid)); - float rms(pnPedestalME.getBinError(pnid) * std::sqrt(entries)); + qItr = pItr; + + float mean(pItr->getBinContent()); + float rms(pItr->getBinError() * std::sqrt(entries)); - EcalLogicID logicID(lmPNID(pnid)); - if (pnPedestals.find(logicID) == pnPedestals.end()) { - MonPNPedDat &insertion(pnPedestals[logicID]); + EcalLogicID logicID(crystalID(pItr->getId())); + if (pedestals.find(logicID) == pedestals.end()) { + MonPedestalsDat &insertion(pedestals[logicID]); insertion.setPedMeanG1(-1.); insertion.setPedRMSG1(-1.); - insertion.setPedMeanG16(-1.); - insertion.setPedRMSG16(-1.); + insertion.setPedMeanG6(-1.); + insertion.setPedRMSG6(-1.); + insertion.setPedMeanG12(-1.); + insertion.setPedRMSG12(-1.); insertion.setTaskStatus(false); } - MonPNPedDat &data(pnPedestals[lmPNID(pnid)]); + MonPedestalsDat &data(pedestals[logicID]); switch (gain) { - case 1: - data.setPedMeanG1(mean); - data.setPedRMSG1(rms); - break; - case 16: - data.setPedMeanG16(mean); - data.setPedRMSG16(rms); - break; + case 1: + data.setPedMeanG1(mean); + data.setPedRMSG1(rms); + break; + case 6: + data.setPedMeanG6(mean); + data.setPedRMSG6(rms); + break; + case 12: + data.setPedMeanG12(mean); + data.setPedRMSG12(rms); + break; } - int channelStatus(pnQualityME.getBinContent(pnid)); + int channelStatus(qItr->getBinContent()); bool channelBad(channelStatus == kBad || channelStatus == kMBad); if (channelBad) data.setTaskStatus(true); @@ -758,110 +674,158 @@ bool PedestalWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { result &= qualityOK(channelStatus); } } - } - try { - if (!pedestals.empty()) - _db->insertDataArraySet(&pedestals, &_iov); - if (!pnPedestals.empty()) - _db->insertDataArraySet(&pnPedestals, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); - } + for (std::map::iterator gainItr(pnGainToME_.begin()); gainItr != pnGainToME_.end(); ++gainItr) { + int gain(gainItr->first); + int iM(gainItr->second); + + static_cast(pnPedestalME).use(iM); + static_cast(pnQualityME).use(iM); + + for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { + unsigned iDCC(memDCC[iMD]); + + int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); + + for (unsigned iPN(1); iPN <= 10; ++iPN) { + EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); + + float entries(pnPedestalME.getBinEntries(pnid)); + if (entries < 1.) + continue; + + float mean(pnPedestalME.getBinContent(pnid)); + float rms(pnPedestalME.getBinError(pnid) * std::sqrt(entries)); + + EcalLogicID logicID(lmPNID(pnid)); + if (pnPedestals.find(logicID) == pnPedestals.end()) { + MonPNPedDat &insertion(pnPedestals[logicID]); + insertion.setPedMeanG1(-1.); + insertion.setPedRMSG1(-1.); + insertion.setPedMeanG16(-1.); + insertion.setPedRMSG16(-1.); + insertion.setTaskStatus(false); + } + + MonPNPedDat &data(pnPedestals[lmPNID(pnid)]); + switch (gain) { + case 1: + data.setPedMeanG1(mean); + data.setPedRMSG1(rms); + break; + case 16: + data.setPedMeanG16(mean); + data.setPedRMSG16(rms); + break; + } + + int channelStatus(pnQualityME.getBinContent(pnid)); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + if (channelBad) + data.setTaskStatus(true); + + result &= qualityOK(channelStatus); + } + } + } + + try { + if (!pedestals.empty()) + _db->insertDataArraySet(&pedestals, &_iov); + if (!pnPedestals.empty()) + _db->insertDataArraySet(&pnPedestals, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - return result; -} + return result; + } -bool PresampleWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + bool PresampleWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses PresampleTask.Pedestal (h03) PresampleClient.Quality (meg03) */ - bool result(true); + bool result(true); - std::map pedestals; + std::map pedestals; + + MESet const &pedestalME(source_.at("Pedestal")); + MESet const &qualityME(source_.at("Quality")); + + MESet::const_iterator pEnd(pedestalME.end()); + MESet::const_iterator qItr(qualityME); + for (MESet::const_iterator pItr(pedestalME.beginChannel()); pItr != pEnd; pItr.toNextChannel()) { + float entries(pItr->getBinEntries()); + if (entries < 1.) + continue; - MESet const &pedestalME(source_.at("Pedestal")); - MESet const &qualityME(source_.at("Quality")); + qItr = pItr; - MESet::const_iterator pEnd(pedestalME.end()); - MESet::const_iterator qItr(qualityME); - for (MESet::const_iterator pItr(pedestalME.beginChannel()); pItr != pEnd; - pItr.toNextChannel()) { - float entries(pItr->getBinEntries()); - if (entries < 1.) - continue; + float mean(pItr->getBinContent()); + float rms(pItr->getBinError() * std::sqrt(entries)); - qItr = pItr; + MonPedestalsOnlineDat &data(pedestals[crystalID(pItr->getId())]); + data.setADCMeanG12(mean); + data.setADCRMSG12(rms); - float mean(pItr->getBinContent()); - float rms(pItr->getBinError() * std::sqrt(entries)); + int channelStatus(qItr->getBinContent()); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + data.setTaskStatus(channelBad); - MonPedestalsOnlineDat &data(pedestals[crystalID(pItr->getId())]); - data.setADCMeanG12(mean); - data.setADCRMSG12(rms); + result &= qualityOK(channelStatus); + } - int channelStatus(qItr->getBinContent()); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); - data.setTaskStatus(channelBad); + try { + if (!pedestals.empty()) + _db->insertDataArraySet(&pedestals, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - result &= qualityOK(channelStatus); + return result; } - try { - if (!pedestals.empty()) - _db->insertDataArraySet(&pedestals, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); - } + TestPulseWriter::TestPulseWriter(edm::ParameterSet const &_ps) + : DBWriterWorker("TestPulse", _ps), gainToME_(), pnGainToME_() { + std::vector MGPAGains(_ps.getUntrackedParameter>("MGPAGains")); + std::vector MGPAGainsPN(_ps.getUntrackedParameter>("MGPAGainsPN")); + + MESet::PathReplacements repl; + + MESetMulti const &litude(static_cast(source_.at("Amplitude"))); + unsigned nG(MGPAGains.size()); + for (unsigned iG(0); iG != nG; ++iG) { + int gain(MGPAGains[iG]); + if (gain != 1 && gain != 6 && gain != 12) + throw cms::Exception("InvalidConfiguration") << "MGPA gain"; + repl["gain"] = std::to_string(gain); + gainToME_[gain] = amplitude.getIndex(repl); + } - return result; -} - -TestPulseWriter::TestPulseWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("TestPulse", _ps), gainToME_(), pnGainToME_() { - std::vector MGPAGains( - _ps.getUntrackedParameter>("MGPAGains")); - std::vector MGPAGainsPN( - _ps.getUntrackedParameter>("MGPAGainsPN")); - - MESet::PathReplacements repl; - - MESetMulti const &litude( - static_cast(source_.at("Amplitude"))); - unsigned nG(MGPAGains.size()); - for (unsigned iG(0); iG != nG; ++iG) { - int gain(MGPAGains[iG]); - if (gain != 1 && gain != 6 && gain != 12) - throw cms::Exception("InvalidConfiguration") << "MGPA gain"; - repl["gain"] = std::to_string(gain); - gainToME_[gain] = amplitude.getIndex(repl); - } + repl.clear(); - repl.clear(); - - MESetMulti const &pnAmplitude( - static_cast(source_.at("PNAmplitude"))); - unsigned nGPN(MGPAGainsPN.size()); - for (unsigned iG(0); iG != nGPN; ++iG) { - int gain(MGPAGainsPN[iG]); - if (gain != 1 && gain != 16) - throw cms::Exception("InvalidConfiguration") << "PN MGPA gain"; - repl["pngain"] = std::to_string(gain); - pnGainToME_[gain] = pnAmplitude.getIndex(repl); + MESetMulti const &pnAmplitude(static_cast(source_.at("PNAmplitude"))); + unsigned nGPN(MGPAGainsPN.size()); + for (unsigned iG(0); iG != nGPN; ++iG) { + int gain(MGPAGainsPN[iG]); + if (gain != 1 && gain != 16) + throw cms::Exception("InvalidConfiguration") << "PN MGPA gain"; + repl["pngain"] = std::to_string(gain); + pnGainToME_[gain] = pnAmplitude.getIndex(repl); + } } -} -bool TestPulseWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + bool TestPulseWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses TestPulseTask.Amplitude (ha01, ha02, ha03) TestPulseTask.Shape (me_hs01, me_hs02, me_hs03) @@ -871,279 +835,271 @@ bool TestPulseWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { TestPulseClient.PNQualitySummary (meg04, meg05) */ - bool result(true); + bool result(true); - std::map amplitude; - std::map shape; - std::map pnAmplitude; + std::map amplitude; + std::map shape; + std::map pnAmplitude; - MESet const &litudeME(source_.at("Amplitude")); - MESet const &shapeME(source_.at("Shape")); - MESet const &qualityME(source_.at("Quality")); + MESet const &litudeME(source_.at("Amplitude")); + MESet const &shapeME(source_.at("Shape")); + MESet const &qualityME(source_.at("Quality")); - MESet const &pnAmplitudeME(source_.at("PNAmplitude")); - MESet const &pnPedestalME(source_.at("PNPedestal")); - MESet const &pnQualityME(source_.at("PNQuality")); + MESet const &pnAmplitudeME(source_.at("PNAmplitude")); + MESet const &pnPedestalME(source_.at("PNPedestal")); + MESet const &pnQualityME(source_.at("PNQuality")); - for (std::map::iterator gainItr(gainToME_.begin()); - gainItr != gainToME_.end(); ++gainItr) { - int gain(gainItr->first); - int iM(gainItr->second); + for (std::map::iterator gainItr(gainToME_.begin()); gainItr != gainToME_.end(); ++gainItr) { + int gain(gainItr->first); + int iM(gainItr->second); - static_cast(amplitudeME).use(iM); - static_cast(shapeME).use(iM); - static_cast(qualityME).use(iM); + static_cast(amplitudeME).use(iM); + static_cast(shapeME).use(iM); + static_cast(qualityME).use(iM); - MESet::const_iterator aEnd(amplitudeME.end()); - MESet::const_iterator qItr(qualityME); - for (MESet::const_iterator aItr(amplitudeME.beginChannel()); aItr != aEnd; - aItr.toNextChannel()) { - float entries(aItr->getBinEntries()); - if (entries < 1.) - continue; - - qItr = aItr; - - float mean(aItr->getBinContent()); - float rms(aItr->getBinError() * std::sqrt(entries)); - - EcalLogicID logicID(crystalID(aItr->getId())); - if (amplitude.find(logicID) == amplitude.end()) { - MonTestPulseDat &insertion(amplitude[logicID]); - insertion.setADCMeanG1(-1.); - insertion.setADCRMSG1(-1.); - insertion.setADCMeanG6(-1.); - insertion.setADCRMSG6(-1.); - insertion.setADCMeanG12(-1.); - insertion.setADCRMSG12(-1.); - insertion.setTaskStatus(false); - } - - MonTestPulseDat &data(amplitude[logicID]); - switch (gain) { - case 1: - data.setADCMeanG1(mean); - data.setADCRMSG1(rms); - break; - case 6: - data.setADCMeanG6(mean); - data.setADCRMSG6(rms); - break; - case 12: - data.setADCMeanG12(mean); - data.setADCRMSG12(rms); - break; - } - - int channelStatus(qItr->getBinContent()); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); - if (channelBad) - data.setTaskStatus(true); + MESet::const_iterator aEnd(amplitudeME.end()); + MESet::const_iterator qItr(qualityME); + for (MESet::const_iterator aItr(amplitudeME.beginChannel()); aItr != aEnd; aItr.toNextChannel()) { + float entries(aItr->getBinEntries()); + if (entries < 1.) + continue; - result &= qualityOK(channelStatus); - } + qItr = aItr; - for (unsigned iSM(0); iSM < 54; ++iSM) { - std::vector samples(10, 0.); - std::vector ids(getElectronicsMap()->dccConstituents(iSM + 1)); - unsigned nId(ids.size()); - unsigned nChannels(0); - EcalLogicID logicID; - for (unsigned iD(0); iD < nId; ++iD) { - DetId &id(ids[iD]); + float mean(aItr->getBinContent()); + float rms(aItr->getBinError() * std::sqrt(entries)); - if (iD == 0) - logicID = crystalID(id); + EcalLogicID logicID(crystalID(aItr->getId())); + if (amplitude.find(logicID) == amplitude.end()) { + MonTestPulseDat &insertion(amplitude[logicID]); + insertion.setADCMeanG1(-1.); + insertion.setADCRMSG1(-1.); + insertion.setADCMeanG6(-1.); + insertion.setADCRMSG6(-1.); + insertion.setADCMeanG12(-1.); + insertion.setADCRMSG12(-1.); + insertion.setTaskStatus(false); + } - if (shapeME.getBinEntries(id, 1) < 1.) - continue; + MonTestPulseDat &data(amplitude[logicID]); + switch (gain) { + case 1: + data.setADCMeanG1(mean); + data.setADCRMSG1(rms); + break; + case 6: + data.setADCMeanG6(mean); + data.setADCRMSG6(rms); + break; + case 12: + data.setADCMeanG12(mean); + data.setADCRMSG12(rms); + break; + } - ++nChannels; + int channelStatus(qItr->getBinContent()); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + if (channelBad) + data.setTaskStatus(true); - for (int i(0); i < 10; ++i) - samples[i] += shapeME.getBinContent(id, i + 1); + result &= qualityOK(channelStatus); } - if (nChannels == 0) - continue; - - for (int i(0); i < 10; ++i) - samples[i] /= nChannels; - - if (shape.find(logicID) == shape.end()) { - MonPulseShapeDat &insertion(shape[logicID]); - std::vector defval(10, -1.); - insertion.setSamples(defval, 1); - insertion.setSamples(defval, 6); - insertion.setSamples(defval, 12); - } + for (unsigned iSM(0); iSM < 54; ++iSM) { + std::vector samples(10, 0.); + std::vector ids(getElectronicsMap()->dccConstituents(iSM + 1)); + unsigned nId(ids.size()); + unsigned nChannels(0); + EcalLogicID logicID; + for (unsigned iD(0); iD < nId; ++iD) { + DetId &id(ids[iD]); - MonPulseShapeDat &data(shape[logicID]); - data.setSamples(samples, gain); - } - } + if (iD == 0) + logicID = crystalID(id); - for (std::map::iterator gainItr(pnGainToME_.begin()); - gainItr != pnGainToME_.end(); ++gainItr) { - int gain(gainItr->first); - int iM(gainItr->second); + if (shapeME.getBinEntries(id, 1) < 1.) + continue; - static_cast(pnAmplitudeME).use(iM); - static_cast(pnQualityME).use(iM); + ++nChannels; - for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { - unsigned iDCC(memDCC[iMD]); - - int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); - - for (unsigned iPN(1); iPN <= 10; ++iPN) { - EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); + for (int i(0); i < 10; ++i) + samples[i] += shapeME.getBinContent(id, i + 1); + } - float entries(pnAmplitudeME.getBinEntries(pnid)); - if (entries < 1.) + if (nChannels == 0) continue; - float mean(pnAmplitudeME.getBinContent(pnid)); - float rms(pnAmplitudeME.getBinError(pnid) * std::sqrt(entries)); - float pedestalEntries(pnPedestalME.getBinEntries(pnid)); - float pedestalMean(pnPedestalME.getBinContent(pnid)); - float pedestalRms(pnPedestalME.getBinError(pnid) * - std::sqrt(pedestalEntries)); - - EcalLogicID logicID(lmPNID(pnid)); - if (pnAmplitude.find(logicID) == pnAmplitude.end()) { - MonPNMGPADat &insertion(pnAmplitude[logicID]); - insertion.setADCMeanG1(-1.); - insertion.setADCRMSG1(-1.); - insertion.setPedMeanG1(-1.); - insertion.setPedRMSG1(-1.); - insertion.setADCMeanG16(-1.); - insertion.setADCRMSG16(-1.); - insertion.setPedMeanG16(-1.); - insertion.setPedRMSG16(-1.); - insertion.setTaskStatus(false); - } - - MonPNMGPADat &data(pnAmplitude[lmPNID(pnid)]); - switch (gain) { - case 1: - data.setADCMeanG1(mean); - data.setADCRMSG1(rms); - // dynamic pedestal not measured for G1 - // data.setPedMeanG1(pedestalMean); - // data.setPedRMSG1(pedestalRms); - break; - case 16: - data.setADCMeanG16(mean); - data.setADCRMSG16(rms); - data.setPedMeanG16(pedestalMean); - data.setPedRMSG16(pedestalRms); - break; + for (int i(0); i < 10; ++i) + samples[i] /= nChannels; + + if (shape.find(logicID) == shape.end()) { + MonPulseShapeDat &insertion(shape[logicID]); + std::vector defval(10, -1.); + insertion.setSamples(defval, 1); + insertion.setSamples(defval, 6); + insertion.setSamples(defval, 12); } - int channelStatus(pnQualityME.getBinContent(pnid)); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); - if (channelBad) - data.setTaskStatus(true); + MonPulseShapeDat &data(shape[logicID]); + data.setSamples(samples, gain); + } + } - result &= qualityOK(channelStatus); + for (std::map::iterator gainItr(pnGainToME_.begin()); gainItr != pnGainToME_.end(); ++gainItr) { + int gain(gainItr->first); + int iM(gainItr->second); + + static_cast(pnAmplitudeME).use(iM); + static_cast(pnQualityME).use(iM); + + for (unsigned iMD(0); iMD < memDCC.size(); ++iMD) { + unsigned iDCC(memDCC[iMD]); + + int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel); + + for (unsigned iPN(1); iPN <= 10; ++iPN) { + EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN); + + float entries(pnAmplitudeME.getBinEntries(pnid)); + if (entries < 1.) + continue; + + float mean(pnAmplitudeME.getBinContent(pnid)); + float rms(pnAmplitudeME.getBinError(pnid) * std::sqrt(entries)); + float pedestalEntries(pnPedestalME.getBinEntries(pnid)); + float pedestalMean(pnPedestalME.getBinContent(pnid)); + float pedestalRms(pnPedestalME.getBinError(pnid) * std::sqrt(pedestalEntries)); + + EcalLogicID logicID(lmPNID(pnid)); + if (pnAmplitude.find(logicID) == pnAmplitude.end()) { + MonPNMGPADat &insertion(pnAmplitude[logicID]); + insertion.setADCMeanG1(-1.); + insertion.setADCRMSG1(-1.); + insertion.setPedMeanG1(-1.); + insertion.setPedRMSG1(-1.); + insertion.setADCMeanG16(-1.); + insertion.setADCRMSG16(-1.); + insertion.setPedMeanG16(-1.); + insertion.setPedRMSG16(-1.); + insertion.setTaskStatus(false); + } + + MonPNMGPADat &data(pnAmplitude[lmPNID(pnid)]); + switch (gain) { + case 1: + data.setADCMeanG1(mean); + data.setADCRMSG1(rms); + // dynamic pedestal not measured for G1 + // data.setPedMeanG1(pedestalMean); + // data.setPedRMSG1(pedestalRms); + break; + case 16: + data.setADCMeanG16(mean); + data.setADCRMSG16(rms); + data.setPedMeanG16(pedestalMean); + data.setPedRMSG16(pedestalRms); + break; + } + + int channelStatus(pnQualityME.getBinContent(pnid)); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + if (channelBad) + data.setTaskStatus(true); + + result &= qualityOK(channelStatus); + } } } - } - try { - if (!amplitude.empty()) - _db->insertDataArraySet(&litude, &_iov); - if (!shape.empty()) - _db->insertDataSet(&shape, &_iov); - if (!pnAmplitude.empty()) - _db->insertDataArraySet(&pnAmplitude, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); - } + try { + if (!amplitude.empty()) + _db->insertDataArraySet(&litude, &_iov); + if (!shape.empty()) + _db->insertDataSet(&shape, &_iov); + if (!pnAmplitude.empty()) + _db->insertDataArraySet(&pnAmplitude, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - return result; -} + return result; + } -bool TimingWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + bool TimingWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses TimingTask.TimeMap (h01) TimingClient.Quality (meg01) */ - bool result(true); + bool result(true); + + std::map timing; - std::map timing; + MESet const &timingME(source_.at("Timing")); + MESet const &qualityME(source_.at("Quality")); + + MESet::const_iterator tEnd(timingME.end()); + MESet::const_iterator qItr(qualityME); + for (MESet::const_iterator tItr(timingME.beginChannel()); tItr != tEnd; tItr.toNextChannel()) { + float entries(tItr->getBinEntries()); + if (entries < 1.) + continue; - MESet const &timingME(source_.at("Timing")); - MESet const &qualityME(source_.at("Quality")); + qItr = tItr; - MESet::const_iterator tEnd(timingME.end()); - MESet::const_iterator qItr(qualityME); - for (MESet::const_iterator tItr(timingME.beginChannel()); tItr != tEnd; - tItr.toNextChannel()) { - float entries(tItr->getBinEntries()); - if (entries < 1.) - continue; + float mean(tItr->getBinContent()); + float rms(tItr->getBinError() * std::sqrt(entries)); - qItr = tItr; + MonTimingCrystalDat &data(timing[crystalID(tItr->getId())]); + data.setTimingMean(mean); + data.setTimingRMS(rms); - float mean(tItr->getBinContent()); - float rms(tItr->getBinError() * std::sqrt(entries)); + int channelStatus(qItr->getBinContent()); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + data.setTaskStatus(channelBad); - MonTimingCrystalDat &data(timing[crystalID(tItr->getId())]); - data.setTimingMean(mean); - data.setTimingRMS(rms); + result &= qualityOK(channelStatus); + } - int channelStatus(qItr->getBinContent()); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); - data.setTaskStatus(channelBad); + try { + if (!timing.empty()) + _db->insertDataArraySet(&timing, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - result &= qualityOK(channelStatus); + return result; } - try { - if (!timing.empty()) - _db->insertDataArraySet(&timing, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); - } + LedWriter::LedWriter(edm::ParameterSet const &_ps) : DBWriterWorker("Led", _ps), wlToME_() { + std::vector ledWavelengths(_ps.getUntrackedParameter>("ledWavelengths")); + + // wavelengths are not necessarily ordered + // create a map wl -> MESet index + // using Amplitude here but any multi-wavelength plot is fine + + MESet::PathReplacements repl; - return result; -} - -LedWriter::LedWriter(edm::ParameterSet const &_ps) - : DBWriterWorker("Led", _ps), wlToME_() { - std::vector ledWavelengths( - _ps.getUntrackedParameter>("ledWavelengths")); - - // wavelengths are not necessarily ordered - // create a map wl -> MESet index - // using Amplitude here but any multi-wavelength plot is fine - - MESet::PathReplacements repl; - - MESetMulti const &litude( - static_cast(source_.at("Amplitude"))); - unsigned nWL(ledWavelengths.size()); - for (unsigned iWL(0); iWL != nWL; ++iWL) { - int wl(ledWavelengths[iWL]); - if (wl != 1 && wl != 2) - throw cms::Exception("InvalidConfiguration") << "Led Wavelength"; - repl["wl"] = std::to_string(wl); - wlToME_[wl] = amplitude.getIndex(repl); + MESetMulti const &litude(static_cast(source_.at("Amplitude"))); + unsigned nWL(ledWavelengths.size()); + for (unsigned iWL(0); iWL != nWL; ++iWL) { + int wl(ledWavelengths[iWL]); + if (wl != 1 && wl != 2) + throw cms::Exception("InvalidConfiguration") << "Led Wavelength"; + repl["wl"] = std::to_string(wl); + wlToME_[wl] = amplitude.getIndex(repl); + } } -} -bool LedWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + bool LedWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses LedTask.Amplitude (h01, h03) LedTask.AOverP (h02, h04) @@ -1154,251 +1110,247 @@ x LedClient.PNQualitySummary (meg09, meg10) x PNDiodeTask.Pedestal (i13, i14) */ - bool result(true); - - std::map l1Amp; - std::map l1Time; - // std::map l1PN; - std::map l2Amp; - std::map l2Time; - // std::map l2PN; - - MESet const &ME(source_.at("Amplitude")); - MESet const &aopME(source_.at("AOverP")); - MESet const &timeME(source_.at("Timing")); - MESet const &qualityME(source_.at("Quality")); - - // MESet const& pnME(source_.at("PNAmplitude")); - // MESet const& pnQualityME(source_.at("PNQuality")); - // MESet const& pnPedestalME(source_.at("PNPedestal")); - - for (std::map::iterator wlItr(wlToME_.begin()); - wlItr != wlToME_.end(); ++wlItr) { - int wl(wlItr->first); - unsigned iM(wlItr->second); - - static_cast(ampME).use(iM); - static_cast(aopME).use(iM); - static_cast(timeME).use(iM); - static_cast(qualityME).use(iM); - // static_cast(pnME).use(iM); - // static_cast(pnQualityME).use(iM); - - MESet::const_iterator aEnd(ampME.end()); - MESet::const_iterator qItr(qualityME); - MESet::const_iterator oItr(aopME); - MESet::const_iterator tItr(timeME); - for (MESet::const_iterator aItr(ampME.beginChannel()); aItr != aEnd; - aItr.toNextChannel()) { - float aEntries(aItr->getBinEntries()); - if (aEntries < 1.) - continue; + bool result(true); + + std::map l1Amp; + std::map l1Time; + // std::map l1PN; + std::map l2Amp; + std::map l2Time; + // std::map l2PN; + + MESet const &ME(source_.at("Amplitude")); + MESet const &aopME(source_.at("AOverP")); + MESet const &timeME(source_.at("Timing")); + MESet const &qualityME(source_.at("Quality")); + + // MESet const& pnME(source_.at("PNAmplitude")); + // MESet const& pnQualityME(source_.at("PNQuality")); + // MESet const& pnPedestalME(source_.at("PNPedestal")); + + for (std::map::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr) { + int wl(wlItr->first); + unsigned iM(wlItr->second); + + static_cast(ampME).use(iM); + static_cast(aopME).use(iM); + static_cast(timeME).use(iM); + static_cast(qualityME).use(iM); + // static_cast(pnME).use(iM); + // static_cast(pnQualityME).use(iM); + + MESet::const_iterator aEnd(ampME.end()); + MESet::const_iterator qItr(qualityME); + MESet::const_iterator oItr(aopME); + MESet::const_iterator tItr(timeME); + for (MESet::const_iterator aItr(ampME.beginChannel()); aItr != aEnd; aItr.toNextChannel()) { + float aEntries(aItr->getBinEntries()); + if (aEntries < 1.) + continue; - qItr = aItr; - oItr = aItr; - tItr = aItr; + qItr = aItr; + oItr = aItr; + tItr = aItr; - DetId id(aItr->getId()); + DetId id(aItr->getId()); - float ampMean(aItr->getBinContent()); - float ampRms(aItr->getBinError() * std::sqrt(aEntries)); + float ampMean(aItr->getBinContent()); + float ampRms(aItr->getBinError() * std::sqrt(aEntries)); - float aopEntries(oItr->getBinEntries()); - float aopMean(oItr->getBinContent()); - float aopRms(oItr->getBinError() * std::sqrt(aopEntries)); + float aopEntries(oItr->getBinEntries()); + float aopMean(oItr->getBinContent()); + float aopRms(oItr->getBinError() * std::sqrt(aopEntries)); - float timeEntries(tItr->getBinEntries()); - float timeMean(tItr->getBinContent()); - float timeRms(tItr->getBinError() * std::sqrt(timeEntries)); + float timeEntries(tItr->getBinEntries()); + float timeMean(tItr->getBinContent()); + float timeRms(tItr->getBinError() * std::sqrt(timeEntries)); - int channelStatus(qItr->getBinContent()); - bool channelBad(channelStatus == kBad || channelStatus == kMBad); + int channelStatus(qItr->getBinContent()); + bool channelBad(channelStatus == kBad || channelStatus == kMBad); + + EcalLogicID logicID(crystalID(id)); - EcalLogicID logicID(crystalID(id)); - - switch (wl) { - case 1: { - MonLed1Dat &aData(l1Amp[logicID]); - aData.setVPTMean(ampMean); - aData.setVPTRMS(ampRms); - aData.setVPTOverPNMean(aopMean); - aData.setVPTOverPNRMS(aopRms); - aData.setTaskStatus(channelBad); - - MonTimingLed1CrystalDat &tData(l1Time[logicID]); - tData.setTimingMean(timeMean); - tData.setTimingRMS(timeRms); - tData.setTaskStatus(channelBad); - } break; - case 2: { - MonLed2Dat &aData(l2Amp[logicID]); - aData.setVPTMean(ampMean); - aData.setVPTRMS(ampRms); - aData.setVPTOverPNMean(aopMean); - aData.setVPTOverPNRMS(aopRms); - aData.setTaskStatus(channelBad); - - MonTimingLed2CrystalDat &tData(l2Time[logicID]); - tData.setTimingMean(timeMean); - tData.setTimingRMS(timeRms); - tData.setTaskStatus(channelBad); - } break; + switch (wl) { + case 1: { + MonLed1Dat &aData(l1Amp[logicID]); + aData.setVPTMean(ampMean); + aData.setVPTRMS(ampRms); + aData.setVPTOverPNMean(aopMean); + aData.setVPTOverPNRMS(aopRms); + aData.setTaskStatus(channelBad); + + MonTimingLed1CrystalDat &tData(l1Time[logicID]); + tData.setTimingMean(timeMean); + tData.setTimingRMS(timeRms); + tData.setTaskStatus(channelBad); + } break; + case 2: { + MonLed2Dat &aData(l2Amp[logicID]); + aData.setVPTMean(ampMean); + aData.setVPTRMS(ampRms); + aData.setVPTOverPNMean(aopMean); + aData.setVPTOverPNRMS(aopRms); + aData.setTaskStatus(channelBad); + + MonTimingLed2CrystalDat &tData(l2Time[logicID]); + tData.setTimingMean(timeMean); + tData.setTimingRMS(timeRms); + tData.setTaskStatus(channelBad); + } break; + } + result &= qualityOK(channelStatus); } - result &= qualityOK(channelStatus); + + // for(unsigned iMD(0); iMD < memDCC.size(); ++iMD){ + // unsigned iDCC(memDCC[iMD]); + + // if(iDCC >= kEBmLow && iDCC <= kEBpHigh) continue; + + // for(unsigned iPN(1); iPN <= 10; ++iPN){ + // EcalPnDiodeDetId pnid(EcalEndcap, iDCC + 1, iPN); + + // float entries(pnME.getBinEntries(pnid)); + // if(entries < 1.) continue; + + // float mean(pnME.getBinContent(pnid)); + // float rms(pnME.getBinError(pnid) * std::sqrt(entries)); + + // float pedestalEntries(pnPedestalME.getBinEntries(pnid)); + // float pedestalMean(pnPedestalME.getBinContent(pnid)); + // float pedestalRms(pnPedestalME.getBinError(pnid) * + // std::sqrt(pedestalEntries)); + + // int channelStatus(pnQualityME.getBinContent(pnid)); + // bool channelBad(channelStatus == kBad || channelStatus == + // kMBad); + + // switch(wl){ + // case 1: + // { + // MonPNLed1Dat& data(l1PN[lmPNID(pnid)]); + // data.setADCMeanG1(-1.); + // data.setADCRMSG1(-1.); + // data.setPedMeanG1(-1.); + // data.setPedRMSG1(-1.); + // data.setADCMeanG16(mean); + // data.setADCRMSG16(rms); + // data.setPedMeanG16(pedestalMean); + // data.setPedRMSG16(pedestalRms); + // data.setTaskStatus(channelBad); + // } + // break; + // case 2: + // { + // MonPNLed2Dat& data(l2PN[lmPNID(pnid)]); + // data.setADCMeanG1(-1.); + // data.setADCRMSG1(-1.); + // data.setPedMeanG1(-1.); + // data.setPedRMSG1(-1.); + // data.setADCMeanG16(mean); + // data.setADCRMSG16(rms); + // data.setPedMeanG16(pedestalMean); + // data.setPedRMSG16(pedestalRms); + // data.setTaskStatus(channelBad); + // } + // break; + // } + + // result &= qualityOK(channelStatus); + + // } + // } } - // for(unsigned iMD(0); iMD < memDCC.size(); ++iMD){ - // unsigned iDCC(memDCC[iMD]); - - // if(iDCC >= kEBmLow && iDCC <= kEBpHigh) continue; - - // for(unsigned iPN(1); iPN <= 10; ++iPN){ - // EcalPnDiodeDetId pnid(EcalEndcap, iDCC + 1, iPN); - - // float entries(pnME.getBinEntries(pnid)); - // if(entries < 1.) continue; - - // float mean(pnME.getBinContent(pnid)); - // float rms(pnME.getBinError(pnid) * std::sqrt(entries)); - - // float pedestalEntries(pnPedestalME.getBinEntries(pnid)); - // float pedestalMean(pnPedestalME.getBinContent(pnid)); - // float pedestalRms(pnPedestalME.getBinError(pnid) * - // std::sqrt(pedestalEntries)); - - // int channelStatus(pnQualityME.getBinContent(pnid)); - // bool channelBad(channelStatus == kBad || channelStatus == - // kMBad); - - // switch(wl){ - // case 1: - // { - // MonPNLed1Dat& data(l1PN[lmPNID(pnid)]); - // data.setADCMeanG1(-1.); - // data.setADCRMSG1(-1.); - // data.setPedMeanG1(-1.); - // data.setPedRMSG1(-1.); - // data.setADCMeanG16(mean); - // data.setADCRMSG16(rms); - // data.setPedMeanG16(pedestalMean); - // data.setPedRMSG16(pedestalRms); - // data.setTaskStatus(channelBad); - // } - // break; - // case 2: - // { - // MonPNLed2Dat& data(l2PN[lmPNID(pnid)]); - // data.setADCMeanG1(-1.); - // data.setADCRMSG1(-1.); - // data.setPedMeanG1(-1.); - // data.setPedRMSG1(-1.); - // data.setADCMeanG16(mean); - // data.setADCRMSG16(rms); - // data.setPedMeanG16(pedestalMean); - // data.setPedRMSG16(pedestalRms); - // data.setTaskStatus(channelBad); - // } - // break; - // } - - // result &= qualityOK(channelStatus); - - // } - // } - } + try { + if (!l1Amp.empty()) + _db->insertDataArraySet(&l1Amp, &_iov); + if (!l1Time.empty()) + _db->insertDataArraySet(&l1Time, &_iov); + // if(l1PN.size() > 0) + // _db->insertDataArraySet(&l1PN, &_iov); + if (!l2Amp.empty()) + _db->insertDataArraySet(&l2Amp, &_iov); + if (!l2Time.empty()) + _db->insertDataArraySet(&l2Time, &_iov); + // if(l2PN.size() > 0) + // _db->insertDataArraySet(&l2PN, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - try { - if (!l1Amp.empty()) - _db->insertDataArraySet(&l1Amp, &_iov); - if (!l1Time.empty()) - _db->insertDataArraySet(&l1Time, &_iov); - // if(l1PN.size() > 0) - // _db->insertDataArraySet(&l1PN, &_iov); - if (!l2Amp.empty()) - _db->insertDataArraySet(&l2Amp, &_iov); - if (!l2Time.empty()) - _db->insertDataArraySet(&l2Time, &_iov); - // if(l2PN.size() > 0) - // _db->insertDataArraySet(&l2PN, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); + return result; } - return result; -} - -bool OccupancyWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - /* + bool OccupancyWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + /* uses OccupancyTask.Digi (i01) EnergyTask.HitMap (i02) */ - std::map occupancy; + std::map occupancy; - MESet const &occupancyME(source_.at("Occupancy")); - MESet const &energyME(source_.at("Energy")); + MESet const &occupancyME(source_.at("Occupancy")); + MESet const &energyME(source_.at("Energy")); - MESet::const_iterator oEnd(occupancyME.end()); - MESet::const_iterator eItr(energyME); - for (MESet::const_iterator oItr(occupancyME.beginChannel()); oItr != oEnd; - oItr.toNextChannel()) { + MESet::const_iterator oEnd(occupancyME.end()); + MESet::const_iterator eItr(energyME); + for (MESet::const_iterator oItr(occupancyME.beginChannel()); oItr != oEnd; oItr.toNextChannel()) { + if (oItr->getME()->getTH1()->GetEntries() < 1000.) + continue; - if (oItr->getME()->getTH1()->GetEntries() < 1000.) - continue; + int entries(oItr->getBinContent()); + if (entries < 10) + continue; - int entries(oItr->getBinContent()); - if (entries < 10) - continue; + eItr = oItr; - eItr = oItr; + int eEntries(eItr->getBinEntries()); + float energy(eEntries > 10 ? eItr->getBinContent() : -1.); - int eEntries(eItr->getBinEntries()); - float energy(eEntries > 10 ? eItr->getBinContent() : -1.); + MonOccupancyDat &data(occupancy[crystalID(oItr->getId())]); + data.setEventsOverLowThreshold(entries); + data.setEventsOverHighThreshold(eEntries); + data.setAvgEnergy(energy); + } - MonOccupancyDat &data(occupancy[crystalID(oItr->getId())]); - data.setEventsOverLowThreshold(entries); - data.setEventsOverHighThreshold(eEntries); - data.setAvgEnergy(energy); - } + try { + if (!occupancy.empty()) + _db->insertDataArraySet(&occupancy, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - try { - if (!occupancy.empty()) - _db->insertDataArraySet(&occupancy, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); + return true; } - return true; -} - -bool SummaryWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { - std::map dataset; - MonRunDat &runDat(dataset[ecalID()]); - - // CURRENTLY ONLY WRITING SUCCESS - MonRunOutcomeDef outcomeDef; - outcomeDef.setShortDesc("success"); - - runDat.setNumEvents(processedEvents_); - runDat.setMonRunOutcomeDef(outcomeDef); - runDat.setTaskList(taskList_); - runDat.setTaskOutcome(outcome_); - - try { - _db->insertDataSet(&dataset, &_iov); - } catch (std::runtime_error &e) { - if (std::string(e.what()).find("unique constraint") != std::string::npos) - edm::LogWarning("EcalDQM") << e.what(); - else - throw cms::Exception("DBError") << e.what(); - } + bool SummaryWriter::run(EcalCondDBInterface *_db, MonRunIOV &_iov) { + std::map dataset; + MonRunDat &runDat(dataset[ecalID()]); + + // CURRENTLY ONLY WRITING SUCCESS + MonRunOutcomeDef outcomeDef; + outcomeDef.setShortDesc("success"); + + runDat.setNumEvents(processedEvents_); + runDat.setMonRunOutcomeDef(outcomeDef); + runDat.setTaskList(taskList_); + runDat.setTaskOutcome(outcome_); + + try { + _db->insertDataSet(&dataset, &_iov); + } catch (std::runtime_error &e) { + if (std::string(e.what()).find("unique constraint") != std::string::npos) + edm::LogWarning("EcalDQM") << e.what(); + else + throw cms::Exception("DBError") << e.what(); + } - return true; -} -} // namespace ecaldqm + return true; + } +} // namespace ecaldqm diff --git a/DQM/EcalMonitorDbModule/src/LogicIDTranslation.cc b/DQM/EcalMonitorDbModule/src/LogicIDTranslation.cc index 72a8c4f5d36e1..85149bb24976c 100644 --- a/DQM/EcalMonitorDbModule/src/LogicIDTranslation.cc +++ b/DQM/EcalMonitorDbModule/src/LogicIDTranslation.cc @@ -5,87 +5,79 @@ #include "FWCore/Utilities/interface/Exception.h" namespace ecaldqm { -EcalLogicID ecalID() { return EcalLogicID("ECAL", 1); } + EcalLogicID ecalID() { return EcalLogicID("ECAL", 1); } -EcalLogicID subdetID(EcalSubdetector _subdet) { - switch (_subdet) { - case EcalBarrel: - return EcalLogicID("EB", 1000000000UL); - case EcalEndcap: - return EcalLogicID("EE", 2000000000UL); - default: - throw cms::Exception("UndefinedLogicID"); + EcalLogicID subdetID(EcalSubdetector _subdet) { + switch (_subdet) { + case EcalBarrel: + return EcalLogicID("EB", 1000000000UL); + case EcalEndcap: + return EcalLogicID("EE", 2000000000UL); + default: + throw cms::Exception("UndefinedLogicID"); + } } -} -EcalLogicID crystalID(DetId const &_id) { - unsigned iDCC(dccId(_id) - 1); - if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { - EEDetId eeid(_id); - return EcalLogicID("EE_crystal_number", - 2010000000UL + 1000000 * (eeid.positiveZ() ? 2 : 0) + - 1000 * eeid.ix() + eeid.iy(), - eeid.zside(), eeid.ix(), eeid.iy()); - } else { - int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); - EBDetId ebid(_id); - return EcalLogicID("EB_crystal_number", - 1011000000UL + 10000 * ism + ebid.ic(), ism, ebid.ic()); + EcalLogicID crystalID(DetId const &_id) { + unsigned iDCC(dccId(_id) - 1); + if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { + EEDetId eeid(_id); + return EcalLogicID("EE_crystal_number", + 2010000000UL + 1000000 * (eeid.positiveZ() ? 2 : 0) + 1000 * eeid.ix() + eeid.iy(), + eeid.zside(), + eeid.ix(), + eeid.iy()); + } else { + int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); + EBDetId ebid(_id); + return EcalLogicID("EB_crystal_number", 1011000000UL + 10000 * ism + ebid.ic(), ism, ebid.ic()); + } } -} -EcalLogicID towerID(EcalElectronicsId const &_id) { - unsigned iDCC(_id.dccId() - 1); - if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { - return EcalLogicID("EE_readout_tower", - 2110000000UL + 100 * (601 + iDCC) + _id.towerId(), - 601 + iDCC, _id.towerId()); - } else { - int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); - return EcalLogicID("EB_trigger_tower", - 1021000000UL + 10000 * ism + _id.towerId(), ism, - _id.towerId()); + EcalLogicID towerID(EcalElectronicsId const &_id) { + unsigned iDCC(_id.dccId() - 1); + if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { + return EcalLogicID( + "EE_readout_tower", 2110000000UL + 100 * (601 + iDCC) + _id.towerId(), 601 + iDCC, _id.towerId()); + } else { + int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); + return EcalLogicID("EB_trigger_tower", 1021000000UL + 10000 * ism + _id.towerId(), ism, _id.towerId()); + } } -} -EcalLogicID memChannelID(EcalPnDiodeDetId const &_id) { - // using the PN ID degenerates the logic ID - 50 time samples are actually - // split into 5 channels each - unsigned iDCC(_id.iDCCId() - 1); - int memId((_id.iPnId() - 1) % 5 + ((_id.iPnId() - 1) / 5) * 25 + 1); - if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { - return EcalLogicID("EE_mem_channel", 100 * (601 + iDCC) + memId, 601 + iDCC, - memId); - } else { - int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); - return EcalLogicID("EB_mem_channel", 1191000000UL + 10000 * ism + memId, - ism, memId); + EcalLogicID memChannelID(EcalPnDiodeDetId const &_id) { + // using the PN ID degenerates the logic ID - 50 time samples are actually + // split into 5 channels each + unsigned iDCC(_id.iDCCId() - 1); + int memId((_id.iPnId() - 1) % 5 + ((_id.iPnId() - 1) / 5) * 25 + 1); + if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { + return EcalLogicID("EE_mem_channel", 100 * (601 + iDCC) + memId, 601 + iDCC, memId); + } else { + int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); + return EcalLogicID("EB_mem_channel", 1191000000UL + 10000 * ism + memId, ism, memId); + } } -} -EcalLogicID memTowerID(EcalElectronicsId const &_id) { - unsigned iDCC(_id.dccId() - 1); - if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { - return EcalLogicID("EE_mem_TT", 100 * (601 + iDCC) + _id.towerId(), - 601 + iDCC, _id.towerId()); - } else { - int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); - return EcalLogicID("EB_mem_TT", 1181000000UL + 10000 * ism + _id.towerId(), - ism, _id.towerId()); + EcalLogicID memTowerID(EcalElectronicsId const &_id) { + unsigned iDCC(_id.dccId() - 1); + if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { + return EcalLogicID("EE_mem_TT", 100 * (601 + iDCC) + _id.towerId(), 601 + iDCC, _id.towerId()); + } else { + int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); + return EcalLogicID("EB_mem_TT", 1181000000UL + 10000 * ism + _id.towerId(), ism, _id.towerId()); + } } -} -EcalLogicID lmPNID(EcalPnDiodeDetId const &_id) { - unsigned iDCC(_id.iDCCId() - 1); - int pnid(_id.iPnId()); - if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { - return EcalLogicID("EE_LM_PN", 100 * (601 + iDCC) + pnid, 601 + iDCC, pnid); - } else { - int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); - return EcalLogicID("EB_LM_PN", 1131000000UL + 10000 * ism + pnid, ism, - pnid); + EcalLogicID lmPNID(EcalPnDiodeDetId const &_id) { + unsigned iDCC(_id.iDCCId() - 1); + int pnid(_id.iPnId()); + if (iDCC <= kEEmHigh || iDCC >= kEEpLow) { + return EcalLogicID("EE_LM_PN", 100 * (601 + iDCC) + pnid, 601 + iDCC, pnid); + } else { + int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow); + return EcalLogicID("EB_LM_PN", 1131000000UL + 10000 * ism + pnid, ism, pnid); + } } -} -DetId toDetId(EcalLogicID const &_id) { return DetId(); } -} // namespace ecaldqm + DetId toDetId(EcalLogicID const &_id) { return DetId(); } +} // namespace ecaldqm diff --git a/DQM/EcalMonitorDbModule/src/MonitorElementsDb.cc b/DQM/EcalMonitorDbModule/src/MonitorElementsDb.cc index 54b4956508fad..63a9b8fdb75cc 100644 --- a/DQM/EcalMonitorDbModule/src/MonitorElementsDb.cc +++ b/DQM/EcalMonitorDbModule/src/MonitorElementsDb.cc @@ -31,9 +31,7 @@ #include "DQM/EcalMonitorDbModule/interface/MonitorElementsDb.h" -MonitorElementsDb::MonitorElementsDb(const edm::ParameterSet &ps, - std::string &xmlFile) { - +MonitorElementsDb::MonitorElementsDb(const edm::ParameterSet &ps, std::string &xmlFile) { xmlFile_ = xmlFile; dqmStore_ = edm::Service().operator->(); @@ -41,7 +39,6 @@ MonitorElementsDb::MonitorElementsDb(const edm::ParameterSet &ps, prefixME_ = ps.getUntrackedParameter("prefixME", ""); if (dqmStore_) { - dqmStore_->setCurrentFolder(prefixME_); parser_ = new MonitorXMLParser(xmlFile_); @@ -57,29 +54,40 @@ MonitorElementsDb::MonitorElementsDb(const edm::ParameterSet &ps, MEinfo_ = parser_->getDB_ME(); for (unsigned int i = 0; i < MEinfo_.size(); i++) { - MonitorElement *tmp; tmp = nullptr; if (strcmp(MEinfo_[i].type.c_str(), "th1d") == 0) { - tmp = dqmStore_->book1D(MEinfo_[i].title, MEinfo_[i].title, - MEinfo_[i].xbins, MEinfo_[i].xfrom, - MEinfo_[i].xto); + tmp = dqmStore_->book1D(MEinfo_[i].title, MEinfo_[i].title, MEinfo_[i].xbins, MEinfo_[i].xfrom, MEinfo_[i].xto); } else if (strcmp(MEinfo_[i].type.c_str(), "th2d") == 0) { - tmp = dqmStore_->book2D(MEinfo_[i].title, MEinfo_[i].title, - MEinfo_[i].xbins, MEinfo_[i].xfrom, - MEinfo_[i].xto, MEinfo_[i].ybins, - MEinfo_[i].yfrom, MEinfo_[i].yto); + tmp = dqmStore_->book2D(MEinfo_[i].title, + MEinfo_[i].title, + MEinfo_[i].xbins, + MEinfo_[i].xfrom, + MEinfo_[i].xto, + MEinfo_[i].ybins, + MEinfo_[i].yfrom, + MEinfo_[i].yto); } else if (strcmp(MEinfo_[i].type.c_str(), "tprofile") == 0) { - tmp = dqmStore_->bookProfile(MEinfo_[i].title, MEinfo_[i].title, - MEinfo_[i].xbins, MEinfo_[i].xfrom, - MEinfo_[i].xto, MEinfo_[i].ybins, - MEinfo_[i].yfrom, MEinfo_[i].yto); + tmp = dqmStore_->bookProfile(MEinfo_[i].title, + MEinfo_[i].title, + MEinfo_[i].xbins, + MEinfo_[i].xfrom, + MEinfo_[i].xto, + MEinfo_[i].ybins, + MEinfo_[i].yfrom, + MEinfo_[i].yto); } else if (strcmp(MEinfo_[i].type.c_str(), "tprofile2d") == 0) { - tmp = dqmStore_->bookProfile2D( - MEinfo_[i].title, MEinfo_[i].title, MEinfo_[i].xbins, - MEinfo_[i].xfrom, MEinfo_[i].xto, MEinfo_[i].ybins, - MEinfo_[i].yfrom, MEinfo_[i].yto, MEinfo_[i].zbins, - MEinfo_[i].zfrom, MEinfo_[i].zto); + tmp = dqmStore_->bookProfile2D(MEinfo_[i].title, + MEinfo_[i].title, + MEinfo_[i].xbins, + MEinfo_[i].xfrom, + MEinfo_[i].xto, + MEinfo_[i].ybins, + MEinfo_[i].yfrom, + MEinfo_[i].yto, + MEinfo_[i].zbins, + MEinfo_[i].zfrom, + MEinfo_[i].zto); } MEs_.push_back(tmp); @@ -94,18 +102,14 @@ MonitorElementsDb::~MonitorElementsDb() { delete parser_; } void MonitorElementsDb::beginJob(void) { ievt_ = 0; } void MonitorElementsDb::endJob(void) { - - std::cout << "MonitorElementsDb: analyzed " << ievt_ << " events" - << std::endl; + std::cout << "MonitorElementsDb: analyzed " << ievt_ << " events" << std::endl; for (unsigned int i = 0; i < MEs_.size(); i++) { if (MEs_[i] != nullptr) dqmStore_->removeElement(MEs_[i]->getName()); } } -void MonitorElementsDb::analyze(const edm::Event &e, const edm::EventSetup &c, - coral::ISessionProxy *session) { - +void MonitorElementsDb::analyze(const edm::Event &e, const edm::EventSetup &c, coral::ISessionProxy *session) { ievt_++; bool atLeastAQuery; @@ -114,19 +118,15 @@ void MonitorElementsDb::analyze(const edm::Event &e, const edm::EventSetup &c, std::vector vars; if (session) { - for (unsigned int i = 0; i < MEinfo_.size(); i++) { - // i-th ME... if (MEs_[i] != nullptr && (ievt_ % MEinfo_[i].ncycle) == 0) { - MEs_[i]->Reset(); vars.clear(); try { - atLeastAQuery = true; session->transaction().start(true); @@ -136,20 +136,14 @@ void MonitorElementsDb::analyze(const edm::Event &e, const edm::EventSetup &c, coral::IQuery *query = schema.newQuery(); for (unsigned int j = 0; j < MEinfo_[i].queries.size(); j++) { - if (strcmp(MEinfo_[i].queries[j].query.c_str(), "addToTableList") == - 0) { + if (strcmp(MEinfo_[i].queries[j].query.c_str(), "addToTableList") == 0) { query->addToTableList(MEinfo_[i].queries[j].arg); - } else if (strcmp(MEinfo_[i].queries[j].query.c_str(), - "addToOutputList") == 0) { - query->addToOutputList(MEinfo_[i].queries[j].arg, - MEinfo_[i].queries[j].alias); + } else if (strcmp(MEinfo_[i].queries[j].query.c_str(), "addToOutputList") == 0) { + query->addToOutputList(MEinfo_[i].queries[j].arg, MEinfo_[i].queries[j].alias); vars.push_back(MEinfo_[i].queries[j].alias); - } else if (strcmp(MEinfo_[i].queries[j].query.c_str(), - "setCondition") == 0) { - query->setCondition(MEinfo_[i].queries[j].arg, - coral::AttributeList()); - } else if (strcmp(MEinfo_[i].queries[j].query.c_str(), - "addToOrderList") == 0) { + } else if (strcmp(MEinfo_[i].queries[j].query.c_str(), "setCondition") == 0) { + query->setCondition(MEinfo_[i].queries[j].arg, coral::AttributeList()); + } else if (strcmp(MEinfo_[i].queries[j].query.c_str(), "addToOrderList") == 0) { query->addToOrderList(MEinfo_[i].queries[j].arg); } } @@ -206,20 +200,15 @@ void MonitorElementsDb::analyze(const edm::Event &e, const edm::EventSetup &c, } void MonitorElementsDb::htmlOutput(std::string &htmlDir) { - gStyle->SetOptStat(0); gStyle->SetOptFit(); gStyle->SetPalette(1, nullptr); for (unsigned int i = 0; i < MEinfo_.size(); i++) { - if (MEs_[i] != nullptr && (ievt_ % MEinfo_[i].ncycle) == 0) { - TCanvas *c1; - int n = - MEinfo_[i].xbins > MEinfo_[i].ybins - ? int(round(float(MEinfo_[i].xbins) / float(MEinfo_[i].ybins))) - : int(round(float(MEinfo_[i].ybins) / float(MEinfo_[i].xbins))); + int n = MEinfo_[i].xbins > MEinfo_[i].ybins ? int(round(float(MEinfo_[i].xbins) / float(MEinfo_[i].ybins))) + : int(round(float(MEinfo_[i].ybins) / float(MEinfo_[i].xbins))); if (MEinfo_[i].xbins > MEinfo_[i].ybins) { c1 = new TCanvas("c1", "dummy", 400 * n, 400); } else { diff --git a/DQM/EcalMonitorDbModule/src/MonitorXMLParser.cc b/DQM/EcalMonitorDbModule/src/MonitorXMLParser.cc index af0ee9633511b..53ffe81aaf478 100644 --- a/DQM/EcalMonitorDbModule/src/MonitorXMLParser.cc +++ b/DQM/EcalMonitorDbModule/src/MonitorXMLParser.cc @@ -16,13 +16,10 @@ #include "DQM/EcalMonitorDbModule/interface/MonitorXMLParser.h" MonitorXMLParser::MonitorXMLParser(const std::string &fromFile) { - try { - cms::concurrency::xercesInitialize(); } catch (xercesc::XMLException &e) { - char *message = xercesc::XMLString::transcode(e.getMessage()); std::cerr << "XML toolkit initialization error: " << message << std::endl; @@ -40,7 +37,6 @@ MonitorXMLParser::MonitorXMLParser(const std::string &fromFile) { // - - - - - - - - - - - - - - - - - MonitorXMLParser::~MonitorXMLParser() throw() { - try { cms::concurrency::xercesTerminate(); } catch (xercesc::XMLException &e) { @@ -56,9 +52,7 @@ MonitorXMLParser::~MonitorXMLParser() throw() { // - - - - - - - - - - - - - - - - - void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { - if (xercesc::XMLString::equals(tags_->TAG_ME, element->getTagName())) { - char *c; std::stringstream s; DB_ME me; @@ -66,16 +60,13 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { meok = false; - xercesc::DOMNodeList *d1Nodes = - element->getElementsByTagName(tags_->TAG_1D); + xercesc::DOMNodeList *d1Nodes = element->getElementsByTagName(tags_->TAG_1D); const XMLSize_t d1Count = d1Nodes->getLength(); for (XMLSize_t d1Index = 0; d1Index < d1Count; ++d1Index) { - xercesc::DOMNode *d1Node = d1Nodes->item(d1Index); - xercesc::DOMElement *d1Element = - dynamic_cast(d1Node); + xercesc::DOMElement *d1Element = dynamic_cast(d1Node); const XMLCh *d1titleXMLCh = d1Element->getAttribute(tags_->ATTR_TITLE); c = xercesc::XMLString::transcode(d1titleXMLCh); @@ -127,16 +118,13 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { me.zto = 0.0; } - xercesc::DOMNodeList *d2Nodes = - element->getElementsByTagName(tags_->TAG_2D); + xercesc::DOMNodeList *d2Nodes = element->getElementsByTagName(tags_->TAG_2D); const XMLSize_t d2Count = d2Nodes->getLength(); for (XMLSize_t d2Index = 0; d2Index < d2Count; ++d2Index) { - xercesc::DOMNode *d2Node = d2Nodes->item(d2Index); - xercesc::DOMElement *d2Element = - dynamic_cast(d2Node); + xercesc::DOMElement *d2Element = dynamic_cast(d2Node); const XMLCh *d2titleXMLCh = d2Element->getAttribute(tags_->ATTR_TITLE); c = xercesc::XMLString::transcode(d2titleXMLCh); @@ -206,16 +194,13 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { me.zto = 0.0; } - xercesc::DOMNodeList *tpNodes = - element->getElementsByTagName(tags_->TAG_TPROFILE); + xercesc::DOMNodeList *tpNodes = element->getElementsByTagName(tags_->TAG_TPROFILE); const XMLSize_t tpCount = tpNodes->getLength(); for (XMLSize_t tpIndex = 0; tpIndex < tpCount; ++tpIndex) { - xercesc::DOMNode *tpNode = tpNodes->item(tpIndex); - xercesc::DOMElement *tpElement = - dynamic_cast(tpNode); + xercesc::DOMElement *tpElement = dynamic_cast(tpNode); const XMLCh *tptitleXMLCh = tpElement->getAttribute(tags_->ATTR_TITLE); c = xercesc::XMLString::transcode(tptitleXMLCh); @@ -285,35 +270,29 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { me.zto = 0.0; } - xercesc::DOMNodeList *tp2dNodes = - element->getElementsByTagName(tags_->TAG_TPROFILE2D); + xercesc::DOMNodeList *tp2dNodes = element->getElementsByTagName(tags_->TAG_TPROFILE2D); const XMLSize_t tp2dCount = tp2dNodes->getLength(); for (XMLSize_t tp2dIndex = 0; tp2dIndex < tp2dCount; ++tp2dIndex) { - xercesc::DOMNode *tp2dNode = tp2dNodes->item(tp2dIndex); - xercesc::DOMElement *tp2dElement = - dynamic_cast(tp2dNode); + xercesc::DOMElement *tp2dElement = dynamic_cast(tp2dNode); - const XMLCh *tp2dtitleXMLCh = - tp2dElement->getAttribute(tags_->ATTR_TITLE); + const XMLCh *tp2dtitleXMLCh = tp2dElement->getAttribute(tags_->ATTR_TITLE); c = xercesc::XMLString::transcode(tp2dtitleXMLCh); me.type = "tprofile2d"; me.title = c; meok = true; xercesc::XMLString::release(&c); - const XMLCh *tp2dxbinsXMLCh = - tp2dElement->getAttribute(tags_->ATTR_XBINS); + const XMLCh *tp2dxbinsXMLCh = tp2dElement->getAttribute(tags_->ATTR_XBINS); c = xercesc::XMLString::transcode(tp2dxbinsXMLCh); s.clear(); s.str(c); s >> me.xbins; xercesc::XMLString::release(&c); - const XMLCh *tp2dxfromXMLCh = - tp2dElement->getAttribute(tags_->ATTR_XFROM); + const XMLCh *tp2dxfromXMLCh = tp2dElement->getAttribute(tags_->ATTR_XFROM); c = xercesc::XMLString::transcode(tp2dxfromXMLCh); s.clear(); s.str(c); @@ -327,16 +306,14 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { s >> me.xto; xercesc::XMLString::release(&c); - const XMLCh *tp2dybinsXMLCh = - tp2dElement->getAttribute(tags_->ATTR_YBINS); + const XMLCh *tp2dybinsXMLCh = tp2dElement->getAttribute(tags_->ATTR_YBINS); c = xercesc::XMLString::transcode(tp2dybinsXMLCh); s.clear(); s.str(c); s >> me.ybins; xercesc::XMLString::release(&c); - const XMLCh *tp2dyfromXMLCh = - tp2dElement->getAttribute(tags_->ATTR_YFROM); + const XMLCh *tp2dyfromXMLCh = tp2dElement->getAttribute(tags_->ATTR_YFROM); c = xercesc::XMLString::transcode(tp2dyfromXMLCh); s.clear(); s.str(c); @@ -350,16 +327,14 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { s >> me.yto; xercesc::XMLString::release(&c); - const XMLCh *tp2dzbinsXMLCh = - tp2dElement->getAttribute(tags_->ATTR_ZBINS); + const XMLCh *tp2dzbinsXMLCh = tp2dElement->getAttribute(tags_->ATTR_ZBINS); c = xercesc::XMLString::transcode(tp2dzbinsXMLCh); s.clear(); s.str(c); s >> me.zbins; xercesc::XMLString::release(&c); - const XMLCh *tp2dzfromXMLCh = - tp2dElement->getAttribute(tags_->ATTR_ZFROM); + const XMLCh *tp2dzfromXMLCh = tp2dElement->getAttribute(tags_->ATTR_ZFROM); c = xercesc::XMLString::transcode(tp2dzfromXMLCh); s.clear(); s.str(c); @@ -373,8 +348,7 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { s >> me.zto; xercesc::XMLString::release(&c); - const XMLCh *tp2dncycleXMLCh = - tp2dElement->getAttribute(tags_->ATTR_NCYCLE); + const XMLCh *tp2dncycleXMLCh = tp2dElement->getAttribute(tags_->ATTR_NCYCLE); c = xercesc::XMLString::transcode(tp2dncycleXMLCh); s.clear(); s.str(c); @@ -389,16 +363,13 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { xercesc::XMLString::release(&c); } - xercesc::DOMNodeList *qNodes = - element->getElementsByTagName(tags_->TAG_QUERY); + xercesc::DOMNodeList *qNodes = element->getElementsByTagName(tags_->TAG_QUERY); const XMLSize_t qCount = qNodes->getLength(); for (XMLSize_t qIndex = 0; qIndex < qCount; ++qIndex) { - xercesc::DOMNode *qNode = qNodes->item(qIndex); - xercesc::DOMElement *qElement = - dynamic_cast(qNode); + xercesc::DOMElement *qElement = dynamic_cast(qNode); const XMLCh *nameXMLCh = qElement->getAttribute(tags_->ATTR_NAME); c = xercesc::XMLString::transcode(nameXMLCh); @@ -424,19 +395,17 @@ void MonitorXMLParser::handleElement(xercesc::DOMElement *element) { if (meok) DBMonitoringElements_.push_back(me); } -} // handleElement() +} // handleElement() // - - - - - - - - - - - - - - - - - - - void MonitorXMLParser::load() noexcept(false) { - parser_->setValidationScheme(xercesc::XercesDOMParser::Val_Never); parser_->setDoNamespaces(false); parser_->setDoSchema(false); parser_->setLoadExternalDTD(false); try { - parser_->parse(xmlFile_.c_str()); xercesc::DOMDocument *xmlDoc = parser_->getDocument(); @@ -448,7 +417,6 @@ void MonitorXMLParser::load() noexcept(false) { } if (xercesc::XMLString::equals(tags_->TAG_DBE, dbe->getTagName())) { - xercesc::DOMNodeList *children = dbe->getChildNodes(); const XMLSize_t nodeCount = children->getLength(); @@ -463,15 +431,13 @@ void MonitorXMLParser::load() noexcept(false) { continue; } - xercesc::DOMElement *currentElement = - dynamic_cast(currentNode); + xercesc::DOMElement *currentElement = dynamic_cast(currentNode); handleElement(currentElement); } } } catch (xercesc::XMLException &e) { - char *message = xercesc::XMLString::transcode(e.getMessage()); std::ostringstream buf; @@ -482,7 +448,6 @@ void MonitorXMLParser::load() noexcept(false) { throw(std::runtime_error(buf.str())); } catch (const xercesc::DOMException &e) { - char *message = xercesc::XMLString::transcode(e.getMessage()); std::ostringstream buf; @@ -495,4 +460,4 @@ void MonitorXMLParser::load() noexcept(false) { return; -} // load() +} // load() diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelActionExecutor.h b/DQM/SiPixelMonitorClient/interface/SiPixelActionExecutor.h index 09c09550f1511..a2a903d135d42 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelActionExecutor.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelActionExecutor.h @@ -24,16 +24,14 @@ enum funcType { EachBinContent, Entries, Mean, Sum, WeightedSum }; #define PI 3.141592 #define PI_2 1.570796 -#define NLev1 \ - 4 // Number of HalfCylinders in Endcap or number of Shells in Barrel, which is - // bigger -#define NLev2 \ - 3 // Number of Disks in Endcap or number of Layers in Barrel, which is bigger -#define NLev3 \ - 22 // Number of Blades in Endcap or number of Ladders in Barrel, which is - // bigger -#define NLev4 \ - 7 // Number of Modules - different for Endcap and Barrel, which is bigger +// Number of HalfCylinders in Endcap or number of Shells in Barrel, which is bigger +#define NLev1 4 +// Number of Disks in Endcap or number of Layers in Barrel, which is bigger +#define NLev2 3 +// Number of Blades in Endcap or number of Ladders in Barrel, which is bigger +#define NLev3 22 +// Number of Modules - different for Endcap and Barrel, which is bigger +#define NLev4 7 #define NCyl 4 #define NDisk 2 @@ -49,35 +47,29 @@ enum funcType { EachBinContent, Entries, Mean, Sum, WeightedSum }; // End for Tracker Map class SiPixelActionExecutor { - public: SiPixelActionExecutor(bool offlineXMLfile, bool Tier0Flag); ~SiPixelActionExecutor(); - void createSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - bool isUpgrade); + void createSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade); void bookDeviations(DQMStore::IBooker &iBooker, bool isUpgrade); void bookEfficiency(DQMStore::IBooker &iBooker, bool isUpgrade); - void createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - bool isUpgrade); - void fillEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - bool isbarrel, bool isUpgrade); - void fillEfficiencySummary(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter); - void bookOccupancyPlots(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, bool hiRes, - bool isbarrel); - void bookOccupancyPlots(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, bool hiRes); + void createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade); + void fillEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isbarrel, bool isUpgrade); + void fillEfficiencySummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter); + void bookOccupancyPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool hiRes, bool isbarrel); + void bookOccupancyPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool hiRes); void createOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter); - void normaliseAvDigiOcc(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter); - void normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, int lumisec); - bool readConfiguration(int &tkmap_freq, int &sum_barrel_freq, - int &sum_endcap_freq, int &sum_grandbarrel_freq, - int &sum_grandendcap_freq, int &message_limit, - int &source_type, int &calib_type); + void normaliseAvDigiOcc(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter); + void normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumisec); + bool readConfiguration(int &tkmap_freq, + int &sum_barrel_freq, + int &sum_endcap_freq, + int &sum_grandbarrel_freq, + int &sum_grandendcap_freq, + int &message_limit, + int &source_type, + int &calib_type); bool readConfiguration(int &tkmap_freq, int &summary_freq); void readConfiguration(); int getLadder(const std::string &dname); @@ -85,19 +77,21 @@ class SiPixelActionExecutor { private: MonitorElement *getSummaryME(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, std::string me_name, + DQMStore::IGetter &iGetter, + std::string me_name, bool isUpgrade); - MonitorElement *getFEDSummaryME(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, - std::string me_name); - void GetBladeSubdirs(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - std::vector &blade_subdirs); - void fillSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - std::string dir_name, std::vector &me_names, - bool isbarrel, bool isUpgrade); + MonitorElement *getFEDSummaryME(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, std::string me_name); + void GetBladeSubdirs(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, std::vector &blade_subdirs); + void fillSummary(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + std::string dir_name, + std::vector &me_names, + bool isbarrel, + bool isUpgrade); void fillDeviations(DQMStore::IGetter &iGetter); void fillFEDErrorSummary(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, std::string dir_name, + DQMStore::IGetter &iGetter, + std::string dir_name, std::vector &me_names); void fillGrandBarrelSummaryHistos(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, @@ -107,12 +101,13 @@ class SiPixelActionExecutor { DQMStore::IGetter &iGetter, std::vector &me_names, bool isUpgrade); - void getGrandSummaryME(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - int nbin, std::string &me_name, + void getGrandSummaryME(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + int nbin, + std::string &me_name, std::vector &mes); - void fillOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - bool isbarrel); + void fillOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isbarrel); SiPixelConfigParser *configParser_; SiPixelConfigWriter *configWriter_; diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelCertification.h b/DQM/SiPixelMonitorClient/interface/SiPixelCertification.h index e34679e738978..9b7b47dfb37b3 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelCertification.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelCertification.h @@ -28,7 +28,8 @@ class SiPixelCertification : public DQMEDHarvester { ~SiPixelCertification() override; private: - void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, + void dqmEndLuminosityBlock(DQMStore::IBooker &, + DQMStore::IGetter &, const edm::LuminosityBlock &, const edm::EventSetup &) override; void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h b/DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h index 7817381aacfc1..5b1733711697c 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h @@ -15,7 +15,6 @@ #include class SiPixelConfigParser : public DQMParserBase { - public: // Constructor SiPixelConfigParser(); @@ -24,23 +23,16 @@ class SiPixelConfigParser : public DQMParserBase { ~SiPixelConfigParser() override; // get List of MEs for TrackerMap - bool getMENamesForTrackerMap(std::string &tkmap_name, - std::vector &me_names); + bool getMENamesForTrackerMap(std::string &tkmap_name, std::vector &me_names); bool getFrequencyForTrackerMap(int &u_freq); - bool getMENamesForTree(std::string &structure_name, - std::vector &me_names); - bool getMENamesForBarrelSummary(std::string &structure_name, - std::vector &me_names); - bool getMENamesForEndcapSummary(std::string &structure_name, - std::vector &me_names); - bool getMENamesForFEDErrorSummary(std::string &structure_name, - std::vector &me_names); + bool getMENamesForTree(std::string &structure_name, std::vector &me_names); + bool getMENamesForBarrelSummary(std::string &structure_name, std::vector &me_names); + bool getMENamesForEndcapSummary(std::string &structure_name, std::vector &me_names); + bool getMENamesForFEDErrorSummary(std::string &structure_name, std::vector &me_names); bool getFrequencyForBarrelSummary(int &u_freq); bool getFrequencyForEndcapSummary(int &u_freq); - bool getMENamesForGrandBarrelSummary(std::string &structure_name, - std::vector &me_names); - bool getMENamesForGrandEndcapSummary(std::string &structure_name, - std::vector &me_names); + bool getMENamesForGrandBarrelSummary(std::string &structure_name, std::vector &me_names); + bool getMENamesForGrandEndcapSummary(std::string &structure_name, std::vector &me_names); bool getFrequencyForGrandBarrelSummary(int &u_freq); bool getFrequencyForGrandEndcapSummary(int &u_freq); bool getMessageLimitForQTests(int &u_freq); diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h b/DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h index 773ccbcdaaf08..836c87fcf3f72 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h @@ -23,7 +23,6 @@ #include class SiPixelConfigWriter { - public: /// Creator SiPixelConfigWriter(); diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelContinuousPalette.h b/DQM/SiPixelMonitorClient/interface/SiPixelContinuousPalette.h index c786158e95a96..aef15f9f31fa6 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelContinuousPalette.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelContinuousPalette.h @@ -13,31 +13,25 @@ */ namespace SiPixelContinuousPalette { -constexpr int r[] = { - 255, 134, 122, 110, 98, 86, 74, 63, 51, 39, 27, 15, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 22, 34, 46, 57, - 69, 81, 93, 105, 117, 129, 141, 153, 165, 176, 188, 200, 212, 224, 236, - 248, 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}; + constexpr int r[] = {255, 134, 122, 110, 98, 86, 74, 63, 51, 39, 27, 15, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 22, 34, 46, 57, 69, 81, 93, 105, 117, 129, 141, 153, + 165, 176, 188, 200, 212, 224, 236, 248, 250, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}; -constexpr int g[] = { - 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 32, 44, 56, 68, 80, 91, 103, 115, 127, 139, 151, 163, 175, 187, 199, - 210, 222, 234, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 238, 226, 214, 202, 190, 178, 166, 154, 142, 131, 119, 107, - 95, 83, 71, 59, 47, 35, 23, 12, 0, 0}; -constexpr int b[] = { - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 253, 251, 239, 227, 216, 204, 192, 180, 168, 156, 144, - 132, 120, 108, 97, 85, 73, 61, 49, 37, 25, 13, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -} // namespace SiPixelContinuousPalette + constexpr int g[] = {255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 32, 44, + 56, 68, 80, 91, 103, 115, 127, 139, 151, 163, 175, 187, 199, 210, 222, 234, 246, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 238, 226, 214, 202, 190, 178, 166, + 154, 142, 131, 119, 107, 95, 83, 71, 59, 47, 35, 23, 12, 0, 0}; + constexpr int b[] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 253, 251, 239, 227, 216, 204, 192, 180, 168, 156, 144, 132, 120, 108, 97, 85, 73, + 61, 49, 37, 25, 13, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +} // namespace SiPixelContinuousPalette #endif diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelDaqInfo.h b/DQM/SiPixelMonitorClient/interface/SiPixelDaqInfo.h index 60af87c6d8501..fe7ae53975090 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelDaqInfo.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelDaqInfo.h @@ -30,7 +30,8 @@ class SiPixelDaqInfo : public DQMEDHarvester { ~SiPixelDaqInfo() override; private: - void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, + void dqmEndLuminosityBlock(DQMStore::IBooker &, + DQMStore::IGetter &, const edm::LuminosityBlock &, const edm::EventSetup &) override; void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelDataQuality.h b/DQM/SiPixelMonitorClient/interface/SiPixelDataQuality.h index 8e8311acedf14..f5fde4bd0b381 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelDataQuality.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelDataQuality.h @@ -35,30 +35,32 @@ class SiPixelEDAClient; class SiPixelDataQuality { - public: SiPixelDataQuality(bool offlineXMLfile); ~SiPixelDataQuality(); int getDetId(MonitorElement *mE); - void bookGlobalQualityFlag(DQMStore::IBooker &iBooker, bool Tier0Flag, - int nFEDs); + void bookGlobalQualityFlag(DQMStore::IBooker &iBooker, bool Tier0Flag, int nFEDs); - void computeGlobalQualityFlag(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, bool init, - int nFEDs, bool Tier0Flag); + void computeGlobalQualityFlag( + DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag); - void computeGlobalQualityFlagByLumi(DQMStore::IGetter &iGetter, bool init, - int nFEDs, bool Tier0Flag, + void computeGlobalQualityFlagByLumi(DQMStore::IGetter &iGetter, + bool init, + int nFEDs, + bool Tier0Flag, int nEvents_lastLS_, int nErrorsBarrel_lastLS_, int nErrorsEndcap_lastLS_); void fillGlobalQualityPlot(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, bool init, + DQMStore::IGetter &iGetter, + bool init, edm::ESHandle theCablingMap, - int nFEDs, bool Tier0Flag, int lumisec); + int nFEDs, + bool Tier0Flag, + int lumisec); private: bool offlineXMLfile_; diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelEDAClient.h b/DQM/SiPixelMonitorClient/interface/SiPixelEDAClient.h index 732020df3b9a8..2b7c01e00a060 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelEDAClient.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelEDAClient.h @@ -27,7 +27,6 @@ class SiPixelDataQuality; class SiPixelActionExecutor; class SiPixelEDAClient : public DQMEDHarvester { - public: SiPixelEDAClient(const edm::ParameterSet &ps); ~SiPixelEDAClient() override; @@ -38,8 +37,7 @@ class SiPixelEDAClient : public DQMEDHarvester { DQMStore::IGetter &iGetter, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c) override; - void dqmEndJob(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter) override; + void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override; private: unsigned long long m_cacheID_; diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelInformationExtractor.h b/DQM/SiPixelMonitorClient/interface/SiPixelInformationExtractor.h index f961eff0840bb..52101cf349c12 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelInformationExtractor.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelInformationExtractor.h @@ -37,44 +37,40 @@ class SiPixelEDAClient; class SiPixelWebInterface; class SiPixelInformationExtractor { - public: SiPixelInformationExtractor(bool offlineXMLfile); ~SiPixelInformationExtractor(); - void computeStatus(MonitorElement *mE, double &colorValue, - std::pair &norm); - void getNormalization(MonitorElement *mE, std::pair &norm, - std::string theMEType); - void getNormalization2D(MonitorElement *mE, std::pair &normX, + void computeStatus(MonitorElement *mE, double &colorValue, std::pair &norm); + void getNormalization(MonitorElement *mE, std::pair &norm, std::string theMEType); + void getNormalization2D(MonitorElement *mE, + std::pair &normX, std::pair &normY, std::string theMEType); int getDetId(MonitorElement *mE); std::string getMEType(MonitorElement *mE); void readConfiguration(); - bool readConfiguration( - std::map> &layoutMap, - std::map> &qtestsMap, - std::map> &meQTestsMap); + bool readConfiguration(std::map> &layoutMap, + std::map> &qtestsMap, + std::map> &meQTestsMap); - void bookNoisyPixels(DQMStore::IBooker &iBooker, float noiseRate, - bool Tier0Flag); + void bookNoisyPixels(DQMStore::IBooker &iBooker, float noiseRate, bool Tier0Flag); - void findNoisyPixels(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - bool init, float noiseRate, int noiseRateDenominator, + void findNoisyPixels(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + bool init, + float noiseRate, + int noiseRateDenominator, edm::ESHandle theCablingMap); private: void getItemList(const std::multimap &req_map, - std::string item_name, std::vector &items); - bool hasItem(std::multimap &req_map, - std::string item_name); - std::string - getItemValue(const std::multimap &req_map, - std::string item_name); - std::string getItemValue(std::multimap &req_map, - std::string item_name); + std::string item_name, + std::vector &items); + bool hasItem(std::multimap &req_map, std::string item_name); + std::string getItemValue(const std::multimap &req_map, std::string item_name); + std::string getItemValue(std::multimap &req_map, std::string item_name); void createDummiesFromLayout(); void selectImage(std::string &name, int status); void selectImage(std::string &name, std::vector &reports); @@ -104,8 +100,7 @@ class SiPixelInformationExtractor { std::ofstream myfile_; int nevents_; - std::map, float>>> - noisyDetIds_; + std::map, float>>> noisyDetIds_; bool endOfModules_; MonitorElement *EventRateBarrelPixels; diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelLayoutParser.h b/DQM/SiPixelMonitorClient/interface/SiPixelLayoutParser.h index b11f333774fa8..5a0b2d9426cf0 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelLayoutParser.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelLayoutParser.h @@ -15,7 +15,6 @@ #include class SiPixelLayoutParser : public DQMParserBase { - public: // Constructor SiPixelLayoutParser(); diff --git a/DQM/SiPixelMonitorClient/interface/SiPixelUtility.h b/DQM/SiPixelMonitorClient/interface/SiPixelUtility.h index d4a4c643da31d..64a4e12e85eda 100644 --- a/DQM/SiPixelMonitorClient/interface/SiPixelUtility.h +++ b/DQM/SiPixelMonitorClient/interface/SiPixelUtility.h @@ -20,13 +20,10 @@ class SiPixelUtility { public: static int getMEList(std::string name, std::vector &values); - static bool checkME(std::string element, std::string name, - std::string &full_path); - static int getMEList(std::string name, std::string &dir_path, - std::vector &me_names); + static bool checkME(std::string element, std::string name, std::string &full_path); + static int getMEList(std::string name, std::string &dir_path, std::vector &me_names); - static void split(const std::string &str, std::vector &tokens, - const std::string &delimiters = " "); + static void split(const std::string &str, std::vector &tokens, const std::string &delimiters = " "); static void getStatusColor(int status, int &rval, int &gval, int &bval); static void getStatusColor(int status, int &icol, std::string &tag); static void getStatusColor(double status, int &rval, int &gval, int &bval); @@ -35,11 +32,8 @@ class SiPixelUtility { static int computeHistoBin(std::string &module_path); static int computeErrorCode(DQMStore *bei, std::string &module_path); static int computeErrorCode(int status); - static void - fillPaveText(TPaveText *pave, - const std::map> &messages); - static void createStatusLegendMessages( - std::map> &messages); + static void fillPaveText(TPaveText *pave, const std::map> &messages); + static void createStatusLegendMessages(std::map> &messages); static std::map sourceCodeMap(); static void setDrawingOption(TH1 *hist, float xlow = -1., float xhigh = -1.); static std::vector getQTestNameList(MonitorElement *me); diff --git a/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc b/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc index b9b4b199f96a2..28e4165c34614 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc @@ -25,8 +25,7 @@ using namespace std; // // -- Constructor // -SiPixelActionExecutor::SiPixelActionExecutor(bool offlineXMLfile, - bool Tier0Flag) +SiPixelActionExecutor::SiPixelActionExecutor(bool offlineXMLfile, bool Tier0Flag) : offlineXMLfile_(offlineXMLfile), Tier0Flag_(Tier0Flag) { edm::LogInfo("SiPixelActionExecutor") << " Creating SiPixelActionExecutor " << "\n"; @@ -54,11 +53,9 @@ SiPixelActionExecutor::~SiPixelActionExecutor() { void SiPixelActionExecutor::readConfiguration() { string localPath; if (offlineXMLfile_) - localPath = - string("DQM/SiPixelMonitorClient/test/sipixel_tier0_config.xml"); + localPath = string("DQM/SiPixelMonitorClient/test/sipixel_tier0_config.xml"); else - localPath = string( - "DQM/SiPixelMonitorClient/test/sipixel_monitorelement_config.xml"); + localPath = string("DQM/SiPixelMonitorClient/test/sipixel_monitorelement_config.xml"); if (configParser_ == nullptr) { configParser_ = new SiPixelConfigParser(); configParser_->getDocument(edm::FileInPath(localPath).fullPath()); @@ -68,19 +65,21 @@ void SiPixelActionExecutor::readConfiguration() { // // -- Read Configuration File // -bool SiPixelActionExecutor::readConfiguration( - int &tkmap_freq, int &sum_barrel_freq, int &sum_endcap_freq, - int &sum_grandbarrel_freq, int &sum_grandendcap_freq, int &message_limit_, - int &source_type_, int &calib_type_) { +bool SiPixelActionExecutor::readConfiguration(int &tkmap_freq, + int &sum_barrel_freq, + int &sum_endcap_freq, + int &sum_grandbarrel_freq, + int &sum_grandendcap_freq, + int &message_limit_, + int &source_type_, + int &calib_type_) { // printing cout<<"Entering // SiPixelActionExecutor::readConfiguration..."<getDocument(edm::FileInPath(localPath).fullPath()); @@ -92,33 +91,28 @@ bool SiPixelActionExecutor::readConfiguration( return false; } if (!configParser_->getFrequencyForBarrelSummary(sum_barrel_freq)) { - edm::LogInfo("SiPixelActionExecutor") - << "Failed to read Barrel Summary configuration parameters!! " - << "\n"; + edm::LogInfo("SiPixelActionExecutor") << "Failed to read Barrel Summary configuration parameters!! " + << "\n"; return false; } if (!configParser_->getFrequencyForEndcapSummary(sum_endcap_freq)) { - edm::LogInfo("SiPixelActionExecutor") - << "Failed to read Endcap Summary configuration parameters!! " - << "\n"; + edm::LogInfo("SiPixelActionExecutor") << "Failed to read Endcap Summary configuration parameters!! " + << "\n"; return false; } if (!configParser_->getFrequencyForGrandBarrelSummary(sum_grandbarrel_freq)) { - edm::LogInfo("SiPixelActionExecutor") - << "Failed to read Grand Barrel Summary configuration parameters!! " - << "\n"; + edm::LogInfo("SiPixelActionExecutor") << "Failed to read Grand Barrel Summary configuration parameters!! " + << "\n"; return false; } if (!configParser_->getFrequencyForGrandEndcapSummary(sum_grandendcap_freq)) { - edm::LogInfo("SiPixelActionExecutor") - << "Failed to read Grand Endcap Summary configuration parameters!! " - << "\n"; + edm::LogInfo("SiPixelActionExecutor") << "Failed to read Grand Endcap Summary configuration parameters!! " + << "\n"; return false; } if (!configParser_->getMessageLimitForQTests(message_limit_)) { - edm::LogInfo("SiPixelActionExecutor") - << "Failed to read QTest Message Limit" - << "\n"; + edm::LogInfo("SiPixelActionExecutor") << "Failed to read QTest Message Limit" + << "\n"; return false; } if (!configParser_->getSourceType(source_type_)) { @@ -136,17 +130,14 @@ bool SiPixelActionExecutor::readConfiguration( return true; } //============================================================================================================= -bool SiPixelActionExecutor::readConfiguration(int &tkmap_freq, - int &summary_freq) { +bool SiPixelActionExecutor::readConfiguration(int &tkmap_freq, int &summary_freq) { // printing cout<<"Entering // SiPixelActionExecutor::readConfiguration..."<getDocument(edm::FileInPath(localPath).fullPath()); @@ -158,9 +149,8 @@ bool SiPixelActionExecutor::readConfiguration(int &tkmap_freq, return false; } if (!configParser_->getFrequencyForBarrelSummary(summary_freq)) { - edm::LogInfo("SiPixelActionExecutor") - << "Failed to read Summary configuration parameters!! " - << "\n"; + edm::LogInfo("SiPixelActionExecutor") << "Failed to read Summary configuration parameters!! " + << "\n"; return false; } // printing cout<<"...leaving @@ -169,9 +159,7 @@ bool SiPixelActionExecutor::readConfiguration(int &tkmap_freq, } //============================================================================================================= -void SiPixelActionExecutor::createSummary(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, - bool isUpgrade) { +void SiPixelActionExecutor::createSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade) { // To be majorly overhauled and split into two, I guess. // cout<<"entering SiPixelActionExecutor::createSummary..."< barrel_me_names; string localPath; if (offlineXMLfile_) - localPath = - string("DQM/SiPixelMonitorClient/test/sipixel_tier0_config.xml"); + localPath = string("DQM/SiPixelMonitorClient/test/sipixel_tier0_config.xml"); else - localPath = string( - "DQM/SiPixelMonitorClient/test/sipixel_monitorelement_config.xml"); + localPath = string("DQM/SiPixelMonitorClient/test/sipixel_monitorelement_config.xml"); // cout<<"*********************ATTENTION! LOCALPATH= "<getDocument(edm::FileInPath(localPath).fullPath()); } - if (!configParser_->getMENamesForBarrelSummary(barrel_structure_name, - barrel_me_names)) { + if (!configParser_->getMENamesForBarrelSummary(barrel_structure_name, barrel_me_names)) { cout << "SiPixelActionExecutor::createSummary: Failed to read Barrel " "Summary configuration parameters!! "; return; @@ -200,16 +185,14 @@ void SiPixelActionExecutor::createSummary(DQMStore::IBooker &iBooker, iBooker.setCurrentFolder("Pixel/"); iGetter.setCurrentFolder("Pixel/"); fillSummary(iBooker, iGetter, barrel_structure_name, barrel_me_names, true, - isUpgrade); // Barrel + isUpgrade); // Barrel iBooker.setCurrentFolder("Pixel/"); iGetter.setCurrentFolder("Pixel/"); string endcap_structure_name; vector endcap_me_names; - if (!configParser_->getMENamesForEndcapSummary(endcap_structure_name, - endcap_me_names)) { - edm::LogInfo("SiPixelActionExecutor") - << "Failed to read Endcap Summary configuration parameters!! " - << "\n"; + if (!configParser_->getMENamesForEndcapSummary(endcap_structure_name, endcap_me_names)) { + edm::LogInfo("SiPixelActionExecutor") << "Failed to read Endcap Summary configuration parameters!! " + << "\n"; return; } @@ -219,16 +202,14 @@ void SiPixelActionExecutor::createSummary(DQMStore::IBooker &iBooker, iGetter.setCurrentFolder("Pixel/"); fillSummary(iBooker, iGetter, endcap_structure_name, endcap_me_names, false, - isUpgrade); // Endcap + isUpgrade); // Endcap iBooker.setCurrentFolder("Pixel/"); iGetter.setCurrentFolder("Pixel/"); - if (source_type_ == 0 || source_type_ == 5 || - source_type_ == 20) { // do this only if RawData source is present + if (source_type_ == 0 || source_type_ == 5 || source_type_ == 20) { // do this only if RawData source is present string federror_structure_name; vector federror_me_names; - if (!configParser_->getMENamesForFEDErrorSummary(federror_structure_name, - federror_me_names)) { + if (!configParser_->getMENamesForFEDErrorSummary(federror_structure_name, federror_me_names)) { cout << "SiPixelActionExecutor::createSummary: Failed to read FED Error " "Summary configuration parameters!! "; return; @@ -236,8 +217,7 @@ void SiPixelActionExecutor::createSummary(DQMStore::IBooker &iBooker, iBooker.setCurrentFolder("Pixel/"); iGetter.setCurrentFolder("Pixel/"); - fillFEDErrorSummary(iBooker, iGetter, federror_structure_name, - federror_me_names); + fillFEDErrorSummary(iBooker, iGetter, federror_structure_name, federror_me_names); iBooker.setCurrentFolder("Pixel/"); iGetter.setCurrentFolder("Pixel/"); } @@ -248,8 +228,7 @@ void SiPixelActionExecutor::createSummary(DQMStore::IBooker &iBooker, } //============================================================================================================= -void SiPixelActionExecutor::bookDeviations(DQMStore::IBooker &iBooker, - bool isUpgrade) { +void SiPixelActionExecutor::bookDeviations(DQMStore::IBooker &iBooker, bool isUpgrade) { int nBPixModules; if (isUpgrade) { nBPixModules = 1184; @@ -260,41 +239,29 @@ void SiPixelActionExecutor::bookDeviations(DQMStore::IBooker &iBooker, iBooker.cd(); iBooker.setCurrentFolder("Pixel/Barrel"); DEV_adc_Barrel = iBooker.book1D( - "DEV_adc_Barrel", "Deviation from reference;Module;-", - nBPixModules, 0., nBPixModules); - DEV_ndigis_Barrel = - iBooker.book1D("DEV_ndigis_Barrel", - "Deviation from reference;Module;-", - nBPixModules, 0., nBPixModules); - DEV_charge_Barrel = - iBooker.book1D("DEV_charge_Barrel", - "Deviation from reference;Module;-", - nBPixModules, 0., nBPixModules); - DEV_nclusters_Barrel = iBooker.book1D( - "DEV_nclusters_Barrel", - "Deviation from reference;Module;-", - nBPixModules, 0., nBPixModules); + "DEV_adc_Barrel", "Deviation from reference;Module;-", nBPixModules, 0., nBPixModules); + DEV_ndigis_Barrel = iBooker.book1D( + "DEV_ndigis_Barrel", "Deviation from reference;Module;-", nBPixModules, 0., nBPixModules); + DEV_charge_Barrel = iBooker.book1D( + "DEV_charge_Barrel", "Deviation from reference;Module;-", nBPixModules, 0., nBPixModules); + DEV_nclusters_Barrel = iBooker.book1D("DEV_nclusters_Barrel", + "Deviation from reference;Module;-", + nBPixModules, + 0., + nBPixModules); DEV_size_Barrel = iBooker.book1D( - "DEV_size_Barrel", "Deviation from reference;Module;-", - nBPixModules, 0., nBPixModules); + "DEV_size_Barrel", "Deviation from reference;Module;-", nBPixModules, 0., nBPixModules); iBooker.cd(); iBooker.setCurrentFolder("Pixel/Endcap"); - DEV_adc_Endcap = iBooker.book1D( - "DEV_adc_Endcap", "Deviation from reference;Module;-", 672, - 0., 672.); - DEV_ndigis_Endcap = iBooker.book1D( - "DEV_ndigis_Endcap", - "Deviation from reference;Module;-", 672, 0., 672.); - DEV_charge_Endcap = iBooker.book1D( - "DEV_charge_Endcap", - "Deviation from reference;Module;-", 672, 0., 672.); + DEV_adc_Endcap = iBooker.book1D("DEV_adc_Endcap", "Deviation from reference;Module;-", 672, 0., 672.); + DEV_ndigis_Endcap = + iBooker.book1D("DEV_ndigis_Endcap", "Deviation from reference;Module;-", 672, 0., 672.); + DEV_charge_Endcap = + iBooker.book1D("DEV_charge_Endcap", "Deviation from reference;Module;-", 672, 0., 672.); DEV_nclusters_Endcap = iBooker.book1D( - "DEV_nclusters_Endcap", - "Deviation from reference;Module;-", 672, 0., - 672.); - DEV_size_Endcap = iBooker.book1D( - "DEV_size_Endcap", "Deviation from reference;Module;-", - 672, 0., 672.); + "DEV_nclusters_Endcap", "Deviation from reference;Module;-", 672, 0., 672.); + DEV_size_Endcap = + iBooker.book1D("DEV_size_Endcap", "Deviation from reference;Module;-", 672, 0., 672.); iBooker.cd(); } @@ -457,17 +424,14 @@ void SiPixelActionExecutor::fillDeviations(DQMStore::IGetter &iGetter) { void SiPixelActionExecutor::GetBladeSubdirs(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, vector &blade_subdirs) { - blade_subdirs.clear(); vector panels = iGetter.getSubdirs(); vector modules; - for (vector::const_iterator it = panels.begin(); it != panels.end(); - it++) { + for (vector::const_iterator it = panels.begin(); it != panels.end(); it++) { iGetter.cd(*it); iBooker.cd(*it); modules = iGetter.getSubdirs(); - for (vector::const_iterator m_it = modules.begin(); - m_it != modules.end(); m_it++) { + for (vector::const_iterator m_it = modules.begin(); m_it != modules.end(); m_it++) { blade_subdirs.push_back(*m_it); } } @@ -478,9 +442,9 @@ void SiPixelActionExecutor::GetBladeSubdirs(DQMStore::IBooker &iBooker, void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, string dir_name, - vector &me_names, bool isbarrel, + vector &me_names, + bool isbarrel, bool isUpgrade) { - // cout<<"entering SiPixelActionExecutor::fillSummary..."< sum_mes; - for (vector::const_iterator iv = me_names.begin(); - iv != me_names.end(); iv++) { + for (vector::const_iterator iv = me_names.begin(); iv != me_names.end(); iv++) { if (source_type_ == 5 || source_type_ == 6) { - if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || - (*iv) == "chanNmbr" || (*iv) == "TBMType" || (*iv) == "EvtNbr" || - (*iv) == "evtSize" || (*iv) == "linkId" || (*iv) == "ROCId" || - (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || - (*iv) == "TBMMessage" || (*iv) == "Type36Hitmap") + if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || (*iv) == "chanNmbr" || + (*iv) == "TBMType" || (*iv) == "EvtNbr" || (*iv) == "evtSize" || (*iv) == "linkId" || (*iv) == "ROCId" || + (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || (*iv) == "TBMMessage" || + (*iv) == "Type36Hitmap") prefix = "SUMRAW"; else if ((*iv) == "ndigis" || (*iv) == "adc") prefix = "SUMDIG"; - else if ((*iv) == "nclusters" || (*iv) == "x" || (*iv) == "y" || - (*iv) == "charge" || (*iv) == "size" || (*iv) == "sizeX" || - (*iv) == "sizeY" || (*iv) == "minrow" || (*iv) == "maxrow" || - (*iv) == "mincol" || (*iv) == "maxcol") + else if ((*iv) == "nclusters" || (*iv) == "x" || (*iv) == "y" || (*iv) == "charge" || (*iv) == "size" || + (*iv) == "sizeX" || (*iv) == "sizeY" || (*iv) == "minrow" || (*iv) == "maxrow" || (*iv) == "mincol" || + (*iv) == "maxcol") prefix = "SUMCLU"; if (currDir.find("Track") != string::npos) prefix = "SUMTRK"; else if ((*iv) == "residualX" || (*iv) == "residualY") prefix = "SUMTRK"; - else if ((*iv) == "ClustX" || (*iv) == "ClustY" || - (*iv) == "nRecHits" || (*iv) == "ErrorX" || (*iv) == "ErrorY") + else if ((*iv) == "ClustX" || (*iv) == "ClustY" || (*iv) == "nRecHits" || (*iv) == "ErrorX" || + (*iv) == "ErrorY") prefix = "SUMHIT"; - else if ((*iv) == "Gain1d" || (*iv) == "GainChi2NDF1d" || - (*iv) == "GainChi2Prob1d" || (*iv) == "Pedestal1d" || - (*iv) == "GainNPoints1d" || (*iv) == "GainHighPoint1d" || - (*iv) == "GainLowPoint1d" || (*iv) == "GainEndPoint1d" || - (*iv) == "GainFitResult2d" || (*iv) == "GainDynamicRange2d" || - (*iv) == "GainSaturate2d" || - (*iv) == "ScurveChi2ProbSummary" || - (*iv) == "ScurveFitResultSummary" || - (*iv) == "ScurveSigmasSummary" || - (*iv) == "ScurveThresholdSummary" || - (*iv) == "pixelAliveSummary" || + else if ((*iv) == "Gain1d" || (*iv) == "GainChi2NDF1d" || (*iv) == "GainChi2Prob1d" || (*iv) == "Pedestal1d" || + (*iv) == "GainNPoints1d" || (*iv) == "GainHighPoint1d" || (*iv) == "GainLowPoint1d" || + (*iv) == "GainEndPoint1d" || (*iv) == "GainFitResult2d" || (*iv) == "GainDynamicRange2d" || + (*iv) == "GainSaturate2d" || (*iv) == "ScurveChi2ProbSummary" || (*iv) == "ScurveFitResultSummary" || + (*iv) == "ScurveSigmasSummary" || (*iv) == "ScurveThresholdSummary" || (*iv) == "pixelAliveSummary" || (*iv) == "SiPixelErrorsCalibDigis") prefix = "SUMCAL"; } MonitorElement *temp; string tag; - if ((*iv).find("residual") != string::npos) { // track residuals - tag = prefix + "_" + (*iv) + "_mean_" + - currDir.substr(currDir.find(dir_name)); + if ((*iv).find("residual") != string::npos) { // track residuals + tag = prefix + "_" + (*iv) + "_mean_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); - tag = prefix + "_" + (*iv) + "_RMS_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_RMS_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); - } else if (prefix == "SUMCAL") { // calibrations - if ((*iv) == "Gain1d" || (*iv) == "GainChi2NDF1d" || - (*iv) == "GainChi2Prob1d" || (*iv) == "GainNPoints1d" || - (*iv) == "GainHighPoint1d" || (*iv) == "GainLowPoint1d" || - (*iv) == "GainEndPoint1d" || (*iv) == "GainDynamicRange2d" || - (*iv) == "GainSaturate2d" || (*iv) == "Pedestal1d" || - (*iv) == "ScurveChi2ProbSummary" || - (*iv) == "ScurveFitResultSummary" || - (*iv) == "ScurveSigmasSummary" || + } else if (prefix == "SUMCAL") { // calibrations + if ((*iv) == "Gain1d" || (*iv) == "GainChi2NDF1d" || (*iv) == "GainChi2Prob1d" || (*iv) == "GainNPoints1d" || + (*iv) == "GainHighPoint1d" || (*iv) == "GainLowPoint1d" || (*iv) == "GainEndPoint1d" || + (*iv) == "GainDynamicRange2d" || (*iv) == "GainSaturate2d" || (*iv) == "Pedestal1d" || + (*iv) == "ScurveChi2ProbSummary" || (*iv) == "ScurveFitResultSummary" || (*iv) == "ScurveSigmasSummary" || (*iv) == "ScurveThresholdSummary") { - tag = prefix + "_" + (*iv) + "_mean_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_mean_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); - tag = prefix + "_" + (*iv) + "_RMS_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_RMS_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); } else if ((*iv) == "SiPixelErrorsCalibDigis") { - tag = prefix + "_" + (*iv) + "_NCalibErrors_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_NCalibErrors_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); } else if ((*iv) == "GainFitResult2d") { - tag = prefix + "_" + (*iv) + "_NNegativeFits_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_NNegativeFits_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); } else if ((*iv) == "pixelAliveSummary") { - tag = prefix + "_" + (*iv) + "_FracOfPerfectPix_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_FracOfPerfectPix_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); - tag = prefix + "_" + (*iv) + "_mean_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_mean_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); } } else { - tag = - prefix + "_" + (*iv) + "_" + currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); if ((*iv) == "ndigis") { - tag = prefix + "_" + (*iv) + "FREQ_" + - currDir.substr(currDir.find(dir_name)); + tag = prefix + "_" + (*iv) + "FREQ_" + currDir.substr(currDir.find(dir_name)); temp = getSummaryME(iBooker, iGetter, tag, isUpgrade); sum_mes.push_back(temp); } if (prefix == "SUMDIG" && (*iv) == "adc") { - tag = "ALLMODS_" + (*iv) + "COMB_" + - currDir.substr(currDir.find(dir_name)); + tag = "ALLMODS_" + (*iv) + "COMB_" + currDir.substr(currDir.find(dir_name)); temp = nullptr; string fullpathname = iBooker.pwd() + "/" + tag; temp = iGetter.get(fullpathname); @@ -611,17 +551,15 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, sum_mes.push_back(temp); } if (prefix == "SUMCLU" && (*iv) == "charge") { - tag = "ALLMODS_" + (*iv) + "COMB_" + - currDir.substr(currDir.find(dir_name)); + tag = "ALLMODS_" + (*iv) + "COMB_" + currDir.substr(currDir.find(dir_name)); temp = nullptr; string fullpathname = iBooker.pwd() + "/" + tag; temp = iGetter.get(fullpathname); if (temp) { temp->Reset(); } else { - temp = - iBooker.book1D(tag.c_str(), tag.c_str(), 100, 0., - 200.); // To look to get the size automatically + temp = iBooker.book1D(tag.c_str(), tag.c_str(), 100, 0., + 200.); // To look to get the size automatically } sum_mes.push_back(temp); } @@ -638,12 +576,10 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, GetBladeSubdirs(iBooker, iGetter, subdirs); int ndet = 0; - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { if (prefix != "SUMOFF" && (*it).find("Module_") == string::npos) continue; - if (prefix == "SUMOFF" && - (*it).find(isbarrel ? "Layer_" : "Disk_") == string::npos) + if (prefix == "SUMOFF" && (*it).find(isbarrel ? "Layer_" : "Disk_") == string::npos) continue; iBooker.cd(*it); iGetter.cd(*it); @@ -651,10 +587,8 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, vector contents = iGetter.getMEs(); - for (vector::const_iterator isum = sum_mes.begin(); - isum != sum_mes.end(); isum++) { - for (vector::const_iterator im = contents.begin(); - im != contents.end(); im++) { + for (vector::const_iterator isum = sum_mes.begin(); isum != sum_mes.end(); isum++) { + for (vector::const_iterator im = contents.begin(); im != contents.end(); im++) { string sname = ((*isum)->getName()); string tname = " "; tname = sname.substr(7, (sname.find("_", 7) - 6)); @@ -662,14 +596,11 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, tname = "adc_"; if (sname.find("ALLMODS_chargeCOMB_") != string::npos) tname = "charge_"; - if (sname.find("_charge_") != string::npos && - sname.find("Track_") == string::npos) + if (sname.find("_charge_") != string::npos && sname.find("Track_") == string::npos) tname = "charge_"; - if (sname.find("_nclusters_") != string::npos && - sname.find("Track_") == string::npos) + if (sname.find("_nclusters_") != string::npos && sname.find("Track_") == string::npos) tname = "nclusters_"; - if (sname.find("_size_") != string::npos && - sname.find("Track_") == string::npos) + if (sname.find("_size_") != string::npos && sname.find("Track_") == string::npos) tname = "size_"; if (sname.find("_charge_OffTrack_") != string::npos) tname = "charge_OffTrack_"; @@ -698,21 +629,17 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, MonitorElement *me = iGetter.get(fullpathname); if (me) { - if (sname.find("_charge") != string::npos && - sname.find("Track_") == string::npos && + if (sname.find("_charge") != string::npos && sname.find("Track_") == string::npos && me->getName().find("Track_") != string::npos) continue; - if (sname.find("_nclusters_") != string::npos && - sname.find("Track_") == string::npos && + if (sname.find("_nclusters_") != string::npos && sname.find("Track_") == string::npos && me->getName().find("Track_") != string::npos) continue; - if (sname.find("_size") != string::npos && - sname.find("Track_") == string::npos && + if (sname.find("_size") != string::npos && sname.find("Track_") == string::npos && me->getName().find("Track_") != string::npos) continue; // fill summary histos: - if (sname.find("_RMS_") != string::npos && - sname.find("GainDynamicRange2d") == string::npos && + if (sname.find("_RMS_") != string::npos && sname.find("GainDynamicRange2d") == string::npos && sname.find("GainSaturate2d") == string::npos) { (*isum)->Fill(ndet, me->getRMS()); } else if (sname.find("GainDynamicRange2d") != string::npos || @@ -723,8 +650,7 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, for (int cols = 1; cols != me->getNbinsX() + 1; cols++) for (int rows = 1; rows != me->getNbinsY() + 1; rows++) { SumOfEntries += me->getBinContent(cols, rows); - SumOfSquaredEntries += (me->getBinContent(cols, rows)) * - (me->getBinContent(cols, rows)); + SumOfSquaredEntries += (me->getBinContent(cols, rows)) * (me->getBinContent(cols, rows)); SumOfPixels++; } @@ -738,8 +664,7 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, float nlast = me->getBinContent(me->getNbinsX()); float nall = (me->getTH1F())->Integral(1, 11); (*isum)->Fill(ndet, nlast / nall); - } else if (sname.find("_NCalibErrors_") != string::npos || - sname.find("FREQ_") != string::npos) { + } else if (sname.find("_NCalibErrors_") != string::npos || sname.find("FREQ_") != string::npos) { float nall = me->getEntries(); (*isum)->Fill(ndet, nall); } else if (sname.find("GainFitResult2d") != string::npos) { @@ -762,14 +687,12 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, if (me1) { for (int jj = 1; jj < 16; jj++) { if (me1->getBinContent(jj) > 0.) { - if (jj == 6) { // errorType=30 (reset) + if (jj == 6) { // errorType=30 (reset) string path2 = path1; - path2 = path2.replace(path2.find("errorType"), 9, - "TBMMessage"); + path2 = path2.replace(path2.find("errorType"), 9, "TBMMessage"); MonitorElement *me2 = iGetter.get(path2); if (me2) - if (me2->getBinContent(6) > 0. || - me2->getBinContent(7) > 0.) + if (me2->getBinContent(6) > 0. || me2->getBinContent(7) > 0.) notReset = false; } } @@ -777,36 +700,26 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, } if (notReset) (*isum)->Fill(ndet, me1->getEntries()); - } else if ((sname.find("_charge_") != string::npos && - sname.find("Track_") == string::npos && + } else if ((sname.find("_charge_") != string::npos && sname.find("Track_") == string::npos && me->getName().find("Track_") == string::npos) || - (sname.find("_charge_") != string::npos && - sname.find("_OnTrack_") != string::npos && + (sname.find("_charge_") != string::npos && sname.find("_OnTrack_") != string::npos && me->getName().find("_OnTrack_") != string::npos) || - (sname.find("_charge_") != string::npos && - sname.find("_OffTrack_") != string::npos && + (sname.find("_charge_") != string::npos && sname.find("_OffTrack_") != string::npos && me->getName().find("_OffTrack_") != string::npos) || - (sname.find("_nclusters_") != string::npos && - sname.find("Track_") == string::npos && + (sname.find("_nclusters_") != string::npos && sname.find("Track_") == string::npos && me->getName().find("Track_") == string::npos) || - (sname.find("_nclusters_") != string::npos && - sname.find("_OnTrack_") != string::npos && + (sname.find("_nclusters_") != string::npos && sname.find("_OnTrack_") != string::npos && me->getName().find("_OnTrack_") != string::npos) || - (sname.find("_nclusters_") != string::npos && - sname.find("_OffTrack_") != string::npos && + (sname.find("_nclusters_") != string::npos && sname.find("_OffTrack_") != string::npos && me->getName().find("_OffTrack_") != string::npos) || - (sname.find("_size") != string::npos && - sname.find("Track_") == string::npos && + (sname.find("_size") != string::npos && sname.find("Track_") == string::npos && me->getName().find("Track_") == string::npos) || - (sname.find("_size") != string::npos && - sname.find("_OnTrack_") != string::npos && + (sname.find("_size") != string::npos && sname.find("_OnTrack_") != string::npos && me->getName().find("_OnTrack_") != string::npos) || - (sname.find("_size") != string::npos && - sname.find("_OffTrack_") != string::npos && + (sname.find("_size") != string::npos && sname.find("_OffTrack_") != string::npos && me->getName().find("_OffTrack_") != string::npos)) { (*isum)->Fill(ndet, me->getMean()); - } else if (sname.find("_charge_") == string::npos && - sname.find("_nclusters_") == string::npos && + } else if (sname.find("_charge_") == string::npos && sname.find("_nclusters_") == string::npos && sname.find("_size") == string::npos) { (*isum)->Fill(ndet, me->getMean()); } @@ -823,19 +736,13 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, } string title = " "; if (sname.find("_RMS_") != string::npos) { - title = "RMS of " + sname.substr(7, (sname.find("_", 7) - 7)) + - " per module"; + title = "RMS of " + sname.substr(7, (sname.find("_", 7) - 7)) + " per module"; } else if (sname.find("_FracOfPerfectPix_") != string::npos) { - title = "FracOfPerfectPix " + - sname.substr(7, (sname.find("_", 7) - 7)) + - " per module"; + title = "FracOfPerfectPix " + sname.substr(7, (sname.find("_", 7) - 7)) + " per module"; } else if (sname.find("_NCalibErrors_") != string::npos) { - title = "Number of CalibErrors " + - sname.substr(7, (sname.find("_", 7) - 7)) + - " per module"; + title = "Number of CalibErrors " + sname.substr(7, (sname.find("_", 7) - 7)) + " per module"; } else if (sname.find("_NNegativeFits_") != string::npos) { - title = "Number of pixels with neg. fit result " + - sname.substr(7, (sname.find("_", 7) - 7)) + + title = "Number of pixels with neg. fit result " + sname.substr(7, (sname.find("_", 7) - 7)) + " per module"; } else if (sname.find("FREQ_") != string::npos) { title = "NEvents with digis per module"; @@ -852,11 +759,10 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, title = "Total number of errors per Module"; } else { if (prefix == "SUMOFF") - title = "Mean " + sname.substr(7, (sname.find("_", 7) - 7)) + - (isbarrel ? " per Ladder" : " per Blade"); + title = + "Mean " + sname.substr(7, (sname.find("_", 7) - 7)) + (isbarrel ? " per Ladder" : " per Blade"); else - title = "Mean " + sname.substr(7, (sname.find("_", 7) - 7)) + - " per Module"; + title = "Mean " + sname.substr(7, (sname.find("_", 7) - 7)) + " per Module"; } (*isum)->setAxisTitle(title, 2); } @@ -867,17 +773,15 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, iBooker.goUp(); iGetter.setCurrentFolder(iBooker.pwd()); if (dir_name.find("Blade") == 0) { - iBooker.goUp(); // Going up a second time if we are processing the Blade + iBooker.goUp(); // Going up a second time if we are processing the Blade iGetter.setCurrentFolder(iBooker.pwd()); } - } // end for it (subdirs) + } // end for it (subdirs) } else { vector subdirs = iGetter.getSubdirs(); // printing cout << "#\t" << iBooker.pwd() << endl; if (isbarrel) { - - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { // cout << "##\t" << iBooker.pwd() << "\t" //<< //(*it) << endl; @@ -888,30 +792,25 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, } iBooker.cd(*it); iGetter.cd(*it); - if ((*it).find("Endcap") != string::npos || - (*it).find("AdditionalPixelErrors") != string::npos) + if ((*it).find("Endcap") != string::npos || (*it).find("AdditionalPixelErrors") != string::npos) continue; fillSummary(iBooker, iGetter, dir_name, me_names, true, - isUpgrade); // Barrel + isUpgrade); // Barrel iBooker.goUp(); iGetter.setCurrentFolder(iBooker.pwd()); } string grandbarrel_structure_name; vector grandbarrel_me_names; - if (!configParser_->getMENamesForGrandBarrelSummary( - grandbarrel_structure_name, grandbarrel_me_names)) { + if (!configParser_->getMENamesForGrandBarrelSummary(grandbarrel_structure_name, grandbarrel_me_names)) { cout << "SiPixelActionExecutor::createSummary: Failed to read Grand " "Barrel Summary configuration parameters!! "; return; } - fillGrandBarrelSummaryHistos(iBooker, iGetter, grandbarrel_me_names, - isUpgrade); + fillGrandBarrelSummaryHistos(iBooker, iGetter, grandbarrel_me_names, isUpgrade); - } else // Endcap + } else // Endcap { - - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { if ((iBooker.pwd()).find("Barrel") != string::npos || (iBooker.pwd()).find("AdditionalPixelErrors") != string::npos) { iBooker.goUp(); @@ -919,24 +818,21 @@ void SiPixelActionExecutor::fillSummary(DQMStore::IBooker &iBooker, } iBooker.cd(*it); iGetter.cd(*it); - if ((*it).find("Barrel") != string::npos || - (*it).find("AdditionalPixelErrors") != string::npos) + if ((*it).find("Barrel") != string::npos || (*it).find("AdditionalPixelErrors") != string::npos) continue; fillSummary(iBooker, iGetter, dir_name, me_names, false, - isUpgrade); // Endcap + isUpgrade); // Endcap iBooker.goUp(); iGetter.setCurrentFolder(iBooker.pwd()); } string grandendcap_structure_name; vector grandendcap_me_names; - if (!configParser_->getMENamesForGrandEndcapSummary( - grandendcap_structure_name, grandendcap_me_names)) { + if (!configParser_->getMENamesForGrandEndcapSummary(grandendcap_structure_name, grandendcap_me_names)) { cout << "SiPixelActionExecutor::createSummary: Failed to read Grand " "Endcap Summary configuration parameters!! "; return; } - fillGrandEndcapSummaryHistos(iBooker, iGetter, grandendcap_me_names, - isUpgrade); + fillGrandEndcapSummaryHistos(iBooker, iGetter, grandendcap_me_names, isUpgrade); } } // cout<<"...leaving SiPixelActionExecutor::fillSummary!"< sum_mes; - for (vector::const_iterator iv = me_names.begin(); - iv != me_names.end(); iv++) { + for (vector::const_iterator iv = me_names.begin(); iv != me_names.end(); iv++) { bool isBooked = false; vector contents = iGetter.getMEs(); - for (vector::const_iterator im = contents.begin(); - im != contents.end(); im++) + for (vector::const_iterator im = contents.begin(); im != contents.end(); im++) if ((*im).find(*iv) != string::npos) isBooked = true; if (source_type_ == 5 || source_type_ == 6) { - if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || - (*iv) == "chanNmbr" || (*iv) == "TBMType" || (*iv) == "EvtNbr" || - (*iv) == "evtSize" || (*iv) == "linkId" || (*iv) == "ROCId" || - (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || - (*iv) == "TBMMessage" || (*iv) == "Type36Hitmap" || - (*iv) == "FedChLErr" || (*iv) == "FedChNErr" || - (*iv) == "FedETypeNErr") + if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || (*iv) == "chanNmbr" || + (*iv) == "TBMType" || (*iv) == "EvtNbr" || (*iv) == "evtSize" || (*iv) == "linkId" || (*iv) == "ROCId" || + (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || (*iv) == "TBMMessage" || + (*iv) == "Type36Hitmap" || (*iv) == "FedChLErr" || (*iv) == "FedChNErr" || (*iv) == "FedETypeNErr") prefix = "SUMRAW"; } - if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || - (*iv) == "chanNmbr" || (*iv) == "TBMType" || (*iv) == "EvtNbr" || - (*iv) == "evtSize" || (*iv) == "linkId" || (*iv) == "ROCId" || - (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || - (*iv) == "TBMMessage" || (*iv) == "Type36Hitmap") { + if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || (*iv) == "chanNmbr" || + (*iv) == "TBMType" || (*iv) == "EvtNbr" || (*iv) == "evtSize" || (*iv) == "linkId" || (*iv) == "ROCId" || + (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || (*iv) == "TBMMessage" || + (*iv) == "Type36Hitmap") { string tag = prefix + "_" + (*iv) + "_FEDErrors"; MonitorElement *temp = getFEDSummaryME(iBooker, iGetter, tag); sum_mes.push_back(temp); - } else if ((*iv) == "FedChLErr" || (*iv) == "FedChNErr" || - (*iv) == "FedETypeNErr") { + } else if ((*iv) == "FedChLErr" || (*iv) == "FedChNErr" || (*iv) == "FedETypeNErr") { string tag = prefix + "_" + (*iv); MonitorElement *temp; if ((*iv) == "FedChLErr") { if (!isBooked) - temp = iBooker.book2D("FedChLErr", "Type of last error", 40, -0.5, - 39.5, 37, 0., 37.); + temp = iBooker.book2D("FedChLErr", "Type of last error", 40, -0.5, 39.5, 37, 0., 37.); else { string fullpathname = iBooker.pwd() + "/" + (*iv); temp = iGetter.get(fullpathname); temp->Reset(); } - } // If I don't reset this one, then I instead start adding error - // codes.. + } // If I don't reset this one, then I instead start adding error + // codes.. if ((*iv) == "FedChNErr") { if (!isBooked) - temp = iBooker.book2D("FedChNErr", "Total number of errors", 40, - -0.5, 39.5, 37, 0., 37.); + temp = iBooker.book2D("FedChNErr", "Total number of errors", 40, -0.5, 39.5, 37, 0., 37.); else { string fullpathname = iBooker.pwd() + "/" + (*iv); temp = iGetter.get(fullpathname); temp->Reset(); } - } // If I don't reset this one, then I instead start adding error - // codes.. + } // If I don't reset this one, then I instead start adding error + // codes.. if ((*iv) == "FedETypeNErr") { if (!isBooked) { - temp = iBooker.book2D("FedETypeNErr", "Number of each error type", - 40, -0.5, 39.5, 21, 0., 21.); + temp = iBooker.book2D("FedETypeNErr", "Number of each error type", 40, -0.5, 39.5, 21, 0., 21.); temp->setBinLabel(1, "ROC of 25", 2); temp->setBinLabel(2, "Gap word", 2); temp->setBinLabel(3, "Dummy word", 2); @@ -1039,8 +925,8 @@ void SiPixelActionExecutor::fillFEDErrorSummary(DQMStore::IBooker &iBooker, string fullpathname = iBooker.pwd() + "/" + (*iv); temp = iGetter.get(fullpathname); temp->Reset(); - } // If I don't reset this one, then I instead start adding error - // codes.. + } // If I don't reset this one, then I instead start adding error + // codes.. } sum_mes.push_back(temp); } @@ -1052,8 +938,7 @@ void SiPixelActionExecutor::fillFEDErrorSummary(DQMStore::IBooker &iBooker, } vector subdirs = iGetter.getSubdirs(); int ndet = 0; - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { if ((*it).find("FED_") == string::npos) continue; iBooker.cd(*it); @@ -1065,10 +950,8 @@ void SiPixelActionExecutor::fillFEDErrorSummary(DQMStore::IBooker &iBooker, ndet++; vector contents = iGetter.getMEs(); - for (vector::const_iterator isum = sum_mes.begin(); - isum != sum_mes.end(); isum++) { - for (vector::const_iterator im = contents.begin(); - im != contents.end(); im++) { + for (vector::const_iterator isum = sum_mes.begin(); isum != sum_mes.end(); isum++) { + for (vector::const_iterator im = contents.begin(); im != contents.end(); im++) { if (((*im).find("FedChNErr") != std::string::npos && (*isum)->getName().find("FedChNErr") != std::string::npos) || ((*im).find("FedChLErr") != std::string::npos && @@ -1103,25 +986,21 @@ void SiPixelActionExecutor::fillFEDErrorSummary(DQMStore::IBooker &iBooker, if (me1) { for (int jj = 1; jj < 16; jj++) { if (me1->getBinContent(jj) > 0.) { - if (jj == 6) { // errorType=30 (reset) + if (jj == 6) { // errorType=30 (reset) string path2 = path1; - path2 = path2.replace(path2.find("errorType"), 9, - "TBMMessage"); + path2 = path2.replace(path2.find("errorType"), 9, "TBMMessage"); MonitorElement *me2 = iGetter.get(path2); if (me2) - if (me2->getBinContent(6) > 0. || - me2->getBinContent(7) > 0.) + if (me2->getBinContent(6) > 0. || me2->getBinContent(7) > 0.) notReset = false; } } } } if (notReset) - (*isum)->setBinContent(ndet, (*isum)->getBinContent(ndet) + - me1->getEntries()); + (*isum)->setBinContent(ndet, (*isum)->getBinContent(ndet) + me1->getEntries()); } else - (*isum)->setBinContent(ndet, (*isum)->getBinContent(ndet) + - me->getEntries()); + (*isum)->setBinContent(ndet, (*isum)->getBinContent(ndet) + me->getEntries()); } (*isum)->setAxisTitle("FED #", 1); string title = " "; @@ -1137,10 +1016,8 @@ void SiPixelActionExecutor::fillFEDErrorSummary(DQMStore::IBooker &iBooker, } } else { vector subdirs = iGetter.getSubdirs(); - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { - if ((*it).find("Endcap") != string::npos || - (*it).find("Barrel") != string::npos) + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { + if ((*it).find("Endcap") != string::npos || (*it).find("Barrel") != string::npos) continue; iBooker.cd(*it); iGetter.cd(*it); @@ -1154,9 +1031,10 @@ void SiPixelActionExecutor::fillFEDErrorSummary(DQMStore::IBooker &iBooker, } //============================================================================================================= -void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( - DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - vector &me_names, bool isUpgrade) { +void SiPixelActionExecutor::fillGrandBarrelSummaryHistos(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + vector &me_names, + bool isUpgrade) { // cout<<"Entering // SiPixelActionExecutor::fillGrandBarrelSummaryHistos...:"< gsum_mes; @@ -1164,9 +1042,8 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( string path_name = iBooker.pwd(); string dir_name = path_name.substr(path_name.find_last_of("/") + 1); if ((dir_name.find("DQMData") == 0) || (dir_name.find("Pixel") == 0) || - (dir_name.find("AdditionalPixelErrors") == 0) || - (dir_name.find("Endcap") == 0) || (dir_name.find("HalfCylinder") == 0) || - (dir_name.find("Disk") == 0) || (dir_name.find("Blade") == 0) || + (dir_name.find("AdditionalPixelErrors") == 0) || (dir_name.find("Endcap") == 0) || + (dir_name.find("HalfCylinder") == 0) || (dir_name.find("Disk") == 0) || (dir_name.find("Blade") == 0) || (dir_name.find("Panel") == 0)) return; vector subdirs = iGetter.getSubdirs(); @@ -1177,8 +1054,7 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( int nbin_subdir = 0; int cnt = 0; bool first_subdir = true; - for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); - it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { cnt++; iBooker.cd(*it); iGetter.cd(*it); @@ -1203,14 +1079,11 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( else if (source_type_ == 20) prefix = "SUMOFF"; - for (vector::const_iterator im = contents.begin(); - im != contents.end(); im++) { - for (vector::const_iterator iv = me_names.begin(); - iv != me_names.end(); iv++) { + for (vector::const_iterator im = contents.begin(); im != contents.end(); im++) { + for (vector::const_iterator iv = me_names.begin(); iv != me_names.end(); iv++) { string var = "_" + (*iv) + "_"; if ((*im).find(var) != string::npos) { - if ((var == "_charge_" || var == "_nclusters_" || var == "_size_" || - var == "_sizeX_" || var == "_sizeY_") && + if ((var == "_charge_" || var == "_nclusters_" || var == "_size_" || var == "_sizeX_" || var == "_sizeY_") && (*im).find("Track_") != string::npos) continue; string full_path = (*it) + "/" + (*im); @@ -1218,64 +1091,42 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( if (!me) continue; if (source_type_ == 5 || source_type_ == 6) { - if ((*iv) == "errorType" || (*iv) == "NErrors" || - (*iv) == "fullType" || (*iv) == "chanNmbr" || - (*iv) == "TBMType" || (*iv) == "EvtNbr" || (*iv) == "evtSize" || - (*iv) == "linkId" || (*iv) == "ROCId" || (*iv) == "DCOLId" || - (*iv) == "PXId" || (*iv) == "ROCNmbr" || + if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || (*iv) == "chanNmbr" || + (*iv) == "TBMType" || (*iv) == "EvtNbr" || (*iv) == "evtSize" || (*iv) == "linkId" || + (*iv) == "ROCId" || (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || (*iv) == "TBMMessage" || (*iv) == "Type36Hitmap") prefix = "SUMRAW"; - else if ((*iv) == "ndigis" || (*iv) == "adc" || - (*iv) == "ndigisFREQ" || (*iv) == "adcCOMB") + else if ((*iv) == "ndigis" || (*iv) == "adc" || (*iv) == "ndigisFREQ" || (*iv) == "adcCOMB") prefix = "SUMDIG"; - else if ((*iv) == "nclusters" || (*iv) == "x" || (*iv) == "y" || - (*iv) == "charge" || (*iv) == "chargeCOMB" || - (*iv) == "size" || (*iv) == "sizeX" || (*iv) == "sizeY" || - (*iv) == "minrow" || (*iv) == "maxrow" || - (*iv) == "mincol" || (*iv) == "maxcol") + else if ((*iv) == "nclusters" || (*iv) == "x" || (*iv) == "y" || (*iv) == "charge" || + (*iv) == "chargeCOMB" || (*iv) == "size" || (*iv) == "sizeX" || (*iv) == "sizeY" || + (*iv) == "minrow" || (*iv) == "maxrow" || (*iv) == "mincol" || (*iv) == "maxcol") prefix = "SUMCLU"; if (currDir.find("Track") != string::npos) prefix = "SUMTRK"; - else if ((*iv) == "residualX_mean" || (*iv) == "residualY_mean" || - (*iv) == "residualX_RMS" || (*iv) == "residualY_RMS") + else if ((*iv) == "residualX_mean" || (*iv) == "residualY_mean" || (*iv) == "residualX_RMS" || + (*iv) == "residualY_RMS") prefix = "SUMTRK"; - else if ((*iv) == "ClustX" || (*iv) == "ClustY" || - (*iv) == "nRecHits" || (*iv) == "ErrorX" || + else if ((*iv) == "ClustX" || (*iv) == "ClustY" || (*iv) == "nRecHits" || (*iv) == "ErrorX" || (*iv) == "ErrorY") prefix = "SUMHIT"; - else if ((*iv) == "Gain1d_mean" || (*iv) == "GainChi2NDF1d_mean" || - (*iv) == "GainChi2Prob1d_mean" || - (*iv) == "Pedestal1d_mean" || - (*iv) == "ScurveChi2ProbSummary_mean" || - (*iv) == "ScurveFitResultSummary_mean" || - (*iv) == "ScurveSigmasSummary_mean" || - (*iv) == "ScurveThresholdSummary_mean" || - (*iv) == "Gain1d_RMS" || (*iv) == "GainChi2NDF1d_RMS" || - (*iv) == "GainChi2Prob1d_RMS" || - (*iv) == "Pedestal1d_RMS" || - (*iv) == "GainNPoints1d_mean" || - (*iv) == "GainNPoints1d_RMS" || - (*iv) == "GainHighPoint1d_mean" || - (*iv) == "GainHighPoint1d_RMS" || - (*iv) == "GainLowPoint1d_mean" || - (*iv) == "GainLowPoint1d_RMS" || - (*iv) == "GainEndPoint1d_mean" || - (*iv) == "GainEndPoint1d_RMS" || - (*iv) == "GainFitResult2d_mean" || - (*iv) == "GainFitResult2d_RMS" || - (*iv) == "GainDynamicRange2d_mean" || - (*iv) == "GainDynamicRange2d_RMS" || - (*iv) == "GainSaturate2d_mean" || - (*iv) == "GainSaturate2d_RMS" || - (*iv) == "ScurveChi2ProbSummary_RMS" || - (*iv) == "ScurveFitResultSummary_RMS" || - (*iv) == "ScurveSigmasSummary_RMS" || - (*iv) == "ScurveThresholdSummary_RMS" || - (*iv) == "pixelAliveSummary_mean" || - (*iv) == "pixelAliveSummary_FracOfPerfectPix" || + else if ((*iv) == "Gain1d_mean" || (*iv) == "GainChi2NDF1d_mean" || (*iv) == "GainChi2Prob1d_mean" || + (*iv) == "Pedestal1d_mean" || (*iv) == "ScurveChi2ProbSummary_mean" || + (*iv) == "ScurveFitResultSummary_mean" || (*iv) == "ScurveSigmasSummary_mean" || + (*iv) == "ScurveThresholdSummary_mean" || (*iv) == "Gain1d_RMS" || (*iv) == "GainChi2NDF1d_RMS" || + (*iv) == "GainChi2Prob1d_RMS" || (*iv) == "Pedestal1d_RMS" || (*iv) == "GainNPoints1d_mean" || + (*iv) == "GainNPoints1d_RMS" || (*iv) == "GainHighPoint1d_mean" || + (*iv) == "GainHighPoint1d_RMS" || (*iv) == "GainLowPoint1d_mean" || + (*iv) == "GainLowPoint1d_RMS" || (*iv) == "GainEndPoint1d_mean" || (*iv) == "GainEndPoint1d_RMS" || + (*iv) == "GainFitResult2d_mean" || (*iv) == "GainFitResult2d_RMS" || + (*iv) == "GainDynamicRange2d_mean" || (*iv) == "GainDynamicRange2d_RMS" || + (*iv) == "GainSaturate2d_mean" || (*iv) == "GainSaturate2d_RMS" || + (*iv) == "ScurveChi2ProbSummary_RMS" || (*iv) == "ScurveFitResultSummary_RMS" || + (*iv) == "ScurveSigmasSummary_RMS" || (*iv) == "ScurveThresholdSummary_RMS" || + (*iv) == "pixelAliveSummary_mean" || (*iv) == "pixelAliveSummary_FracOfPerfectPix" || (*iv) == "SiPixelErrorsCalibDigis_NCalibErrors") prefix = "SUMCAL"; - } // end source_type if + } // end source_type if if (first_subdir && !isUpgrade) { nbin = me->getTH1F()->GetNbinsX(); @@ -1288,8 +1139,7 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( nbin = 256; else if (dir_name == "Barrel") nbin = 768; - else if (prefix == "SUMOFF" && - dir_name.find("Shell") != string::npos) + else if (prefix == "SUMOFF" && dir_name.find("Shell") != string::npos) nbin = 48; else if (dir_name.find("Shell") != string::npos) nbin = 192; @@ -1308,8 +1158,7 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( nbin = 256; else if (dir_name == "Barrel") nbin = 1184; - else if (prefix == "SUMOFF" && - dir_name.find("Shell") != string::npos) + else if (prefix == "SUMOFF" && dir_name.find("Shell") != string::npos) nbin = 74; else if (dir_name.find("Shell") != string::npos) nbin = 296; @@ -1319,8 +1168,7 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( getGrandSummaryME(iBooker, iGetter, nbin, me_name, gsum_mes); } - for (vector::const_iterator igm = gsum_mes.begin(); - igm != gsum_mes.end(); igm++) { + for (vector::const_iterator igm = gsum_mes.begin(); igm != gsum_mes.end(); igm++) { if ((*igm)->getName().find(var) != string::npos) { if (prefix == "SUMOFF") (*igm)->setAxisTitle("Ladders", 1); @@ -1334,19 +1182,15 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( // Setting title string title = ""; - if ((*igm)->getName().find("NErrors_") != string::npos && - prefix == "SUMOFF") + if ((*igm)->getName().find("NErrors_") != string::npos && prefix == "SUMOFF") title = "Total number of errors per Ladder"; - else if ((*igm)->getName().find("NErrors_") != string::npos && - prefix == "SUMRAW") + else if ((*igm)->getName().find("NErrors_") != string::npos && prefix == "SUMRAW") title = "Total number of errors per Module"; else if (prefix == "SUMOFF") title = "mean " + (*iv) + " per Ladder"; - else if ((*igm)->getName().find("FREQ_") != string::npos && - prefix != "SUMOFF") + else if ((*igm)->getName().find("FREQ_") != string::npos && prefix != "SUMOFF") title = "NEvents with digis per Module"; - else if ((*igm)->getName().find("FREQ_") != string::npos && - prefix == "SUMOFF") + else if ((*igm)->getName().find("FREQ_") != string::npos && prefix == "SUMOFF") title = "NEvents with digis per Ladder/Blade"; else if ((*igm)->getName().find("adcCOMB_") != string::npos) title = "NDigis"; @@ -1358,11 +1202,9 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( // Setting binning if (!isUpgrade) { - if ((*igm)->getName().find("ALLMODS_adcCOMB_") != - string::npos) { + if ((*igm)->getName().find("ALLMODS_adcCOMB_") != string::npos) { nbin_subdir = 128; - } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != - string::npos) { + } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != string::npos) { nbin_subdir = 100; } else if ((*igm)->getName().find("Ladder") != string::npos) { nbin_i = 0; @@ -1426,11 +1268,9 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( } } } else if (isUpgrade) { - if ((*igm)->getName().find("ALLMODS_adcCOMB_") != - string::npos) { + if ((*igm)->getName().find("ALLMODS_adcCOMB_") != string::npos) { nbin_subdir = 128; - } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != - string::npos) { + } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != string::npos) { nbin_subdir = 100; } else if ((*igm)->getName().find("Ladder") != string::npos) { nbin_i = 0; @@ -1443,15 +1283,15 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( if (iDir == 0) { nbin_i = 0; nbin_subdir = 24; - } // 40(2*20)-->24(2*12) + } // 40(2*20)-->24(2*12) else if (iDir == 1) { nbin_i = 24; nbin_subdir = 56; - } // 64(32*2)-->56(2*28) + } // 64(32*2)-->56(2*28) else if (iDir == 2) { nbin_i = 80; nbin_subdir = 88; - } // 88(44*2)-->same88(44*2) + } // 88(44*2)-->same88(44*2) else if (iDir == 3) { nbin_i = 168; nbin_subdir = 128; @@ -1460,15 +1300,15 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( if (iDir == 0) { nbin_i = 0; nbin_subdir = 6; - } // 10-->6 + } // 10-->6 else if (iDir == 1) { nbin_i = 6; nbin_subdir = 14; - } // 16-->14 + } // 16-->14 else if (iDir == 2) { nbin_i = 20; nbin_subdir = 22; - } // 22-->same22 + } // 22-->same22 else if (iDir == 3) { nbin_i = 42; nbin_subdir = 32; @@ -1479,11 +1319,11 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( if (iDir == 0) { nbin_i = 0; nbin_subdir = 296; - } // 192=76 8/4-->296=1184/4 + } // 192=76 8/4-->296=1184/4 else if (iDir == 1) { nbin_i = 296; nbin_subdir = 296; - } // 296*2,*3,*4=1184 + } // 296*2,*3,*4=1184 else if (iDir == 2) { nbin_i = 592; nbin_subdir = 296; @@ -1498,11 +1338,11 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( if (iDir == 0) { nbin_i = 0; nbin_subdir = 74; - } // 48=192/4-->74=296/4 + } // 48=192/4-->74=296/4 else if (iDir == 1) { nbin_i = 74; nbin_subdir = 74; - } // 74*2,...*4=296 + } // 74*2,...*4=296 else if (iDir == 2) { nbin_i = 148; nbin_subdir = 74; @@ -1527,8 +1367,7 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( (*igm)->getName().find("Track_") == string::npos && me->getName().find("charge_") != string::npos && me->getName().find("Track_") == string::npos) || - ((*igm)->getName().find("nclusters_") != - string::npos && + ((*igm)->getName().find("nclusters_") != string::npos && (*igm)->getName().find("Track_") == string::npos && me->getName().find("nclusters_") != string::npos && me->getName().find("Track_") == string::npos) || @@ -1536,33 +1375,20 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( (*igm)->getName().find("Track_") == string::npos && me->getName().find("size_") != string::npos && me->getName().find("Track_") == string::npos) || - ((*igm)->getName().find("charge_OffTrack_") != - string::npos && - me->getName().find("charge_OffTrack_") != - string::npos) || - ((*igm)->getName().find("nclusters_OffTrack_") != - string::npos && - me->getName().find("nclusters_OffTrack_") != - string::npos) || - ((*igm)->getName().find("size_OffTrack_") != - string::npos && - me->getName().find("size_OffTrack_") != - string::npos) || - ((*igm)->getName().find("charge_OnTrack_") != - string::npos && - me->getName().find("charge_OnTrack_") != - string::npos) || - ((*igm)->getName().find("nclusters_OnTrack_") != - string::npos && - me->getName().find("nclusters_OnTrack_") != - string::npos) || - ((*igm)->getName().find("size_OnTrack_") != - string::npos && - me->getName().find("size_OnTrack_") != - string::npos) || + ((*igm)->getName().find("charge_OffTrack_") != string::npos && + me->getName().find("charge_OffTrack_") != string::npos) || + ((*igm)->getName().find("nclusters_OffTrack_") != string::npos && + me->getName().find("nclusters_OffTrack_") != string::npos) || + ((*igm)->getName().find("size_OffTrack_") != string::npos && + me->getName().find("size_OffTrack_") != string::npos) || + ((*igm)->getName().find("charge_OnTrack_") != string::npos && + me->getName().find("charge_OnTrack_") != string::npos) || + ((*igm)->getName().find("nclusters_OnTrack_") != string::npos && + me->getName().find("nclusters_OnTrack_") != string::npos) || + ((*igm)->getName().find("size_OnTrack_") != string::npos && + me->getName().find("size_OnTrack_") != string::npos) || ((*igm)->getName().find("charge_") == string::npos && - (*igm)->getName().find("nclusters_") == - string::npos && + (*igm)->getName().find("nclusters_") == string::npos && (*igm)->getName().find("size_") == string::npos)) { for (int k = 1; k < nbin_subdir + 1; k++) if (me->getBinContent(k) > 0) @@ -1573,23 +1399,24 @@ void SiPixelActionExecutor::fillGrandBarrelSummaryHistos( if (me->getBinContent(k) > 0) (*igm)->setBinContent(k + nbin_i, me->getBinContent(k)); } - } // end var in igm (gsum_mes) - } // end igm loop - } // end var in im (contents) - } // end of iv loop - } // end of im loop + } // end var in igm (gsum_mes) + } // end igm loop + } // end var in im (contents) + } // end of iv loop + } // end of im loop iDir++; - first_subdir = false; // We are done processing the first directory, we - // don't add any new MEs in the future passes. - } // end of it loop (subdirs) + first_subdir = false; // We are done processing the first directory, we + // don't add any new MEs in the future passes. + } // end of it loop (subdirs) // cout<<"...leaving // SiPixelActionExecutor::fillGrandBarrelSummaryHistos!"< &me_names, bool isUpgrade) { +void SiPixelActionExecutor::fillGrandEndcapSummaryHistos(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + vector &me_names, + bool isUpgrade) { // printing cout<<"Entering // SiPixelActionExecutor::fillGrandEndcapSummaryHistos..."< gsum_mes; @@ -1597,9 +1424,8 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( string path_name = iBooker.pwd(); string dir_name = path_name.substr(path_name.find_last_of("/") + 1); if ((dir_name.find("DQMData") == 0) || (dir_name.find("Pixel") == 0) || - (dir_name.find("AdditionalPixelErrors") == 0) || - (dir_name.find("Barrel") == 0) || (dir_name.find("Shell") == 0) || - (dir_name.find("Layer") == 0) || (dir_name.find("Ladder") == 0)) + (dir_name.find("AdditionalPixelErrors") == 0) || (dir_name.find("Barrel") == 0) || + (dir_name.find("Shell") == 0) || (dir_name.find("Layer") == 0) || (dir_name.find("Ladder") == 0)) return; vector subdirs = iGetter.getSubdirs(); int iDir = 0; @@ -1608,8 +1434,7 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( int nbin_subdir = 0; int cnt = 0; bool first_subdir = true; - for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); - it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { cnt++; iBooker.cd(*it); iGetter.cd(*it); @@ -1633,14 +1458,11 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( else if (source_type_ == 20) prefix = "SUMOFF"; - for (vector::const_iterator im = contents.begin(); - im != contents.end(); im++) { - for (vector::const_iterator iv = me_names.begin(); - iv != me_names.end(); iv++) { + for (vector::const_iterator im = contents.begin(); im != contents.end(); im++) { + for (vector::const_iterator iv = me_names.begin(); iv != me_names.end(); iv++) { string var = "_" + (*iv) + "_"; if ((*im).find(var) != string::npos) { - if ((var == "_charge_" || var == "_nclusters_" || var == "_size_" || - var == "_sizeX_" || var == "_sizeY_") && + if ((var == "_charge_" || var == "_nclusters_" || var == "_size_" || var == "_sizeX_" || var == "_sizeY_") && (*im).find("Track_") != string::npos) continue; string full_path = (*it) + "/" + (*im); @@ -1648,61 +1470,39 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( if (!me) continue; if (source_type_ == 5 || source_type_ == 6) { - if ((*iv) == "errorType" || (*iv) == "NErrors" || - (*iv) == "fullType" || (*iv) == "chanNmbr" || - (*iv) == "TBMType" || (*iv) == "EvtNbr" || (*iv) == "evtSize" || - (*iv) == "linkId" || (*iv) == "ROCId" || (*iv) == "DCOLId" || - (*iv) == "PXId" || (*iv) == "ROCNmbr" || + if ((*iv) == "errorType" || (*iv) == "NErrors" || (*iv) == "fullType" || (*iv) == "chanNmbr" || + (*iv) == "TBMType" || (*iv) == "EvtNbr" || (*iv) == "evtSize" || (*iv) == "linkId" || + (*iv) == "ROCId" || (*iv) == "DCOLId" || (*iv) == "PXId" || (*iv) == "ROCNmbr" || (*iv) == "TBMMessage" || (*iv) == "Type36Hitmap") prefix = "SUMRAW"; - else if ((*iv) == "ndigis" || (*iv) == "adc" || - (*iv) == "ndigisFREQ" || (*iv) == "adcCOMB") + else if ((*iv) == "ndigis" || (*iv) == "adc" || (*iv) == "ndigisFREQ" || (*iv) == "adcCOMB") prefix = "SUMDIG"; - else if ((*iv) == "nclusters" || (*iv) == "x" || (*iv) == "y" || - (*iv) == "charge" || (*iv) == "chargeCOMB" || - (*iv) == "size" || (*iv) == "sizeX" || (*iv) == "sizeY" || - (*iv) == "minrow" || (*iv) == "maxrow" || - (*iv) == "mincol" || (*iv) == "maxcol") + else if ((*iv) == "nclusters" || (*iv) == "x" || (*iv) == "y" || (*iv) == "charge" || + (*iv) == "chargeCOMB" || (*iv) == "size" || (*iv) == "sizeX" || (*iv) == "sizeY" || + (*iv) == "minrow" || (*iv) == "maxrow" || (*iv) == "mincol" || (*iv) == "maxcol") prefix = "SUMCLU"; if (currDir.find("Track") != string::npos) prefix = "SUMTRK"; - else if ((*iv) == "residualX_mean" || (*iv) == "residualY_mean" || - (*iv) == "residualX_RMS" || (*iv) == "residualY_RMS") + else if ((*iv) == "residualX_mean" || (*iv) == "residualY_mean" || (*iv) == "residualX_RMS" || + (*iv) == "residualY_RMS") prefix = "SUMTRK"; - else if ((*iv) == "ClustX" || (*iv) == "ClustY" || - (*iv) == "nRecHits" || (*iv) == "ErrorX" || + else if ((*iv) == "ClustX" || (*iv) == "ClustY" || (*iv) == "nRecHits" || (*iv) == "ErrorX" || (*iv) == "ErrorY") prefix = "SUMHIT"; - else if ((*iv) == "Gain1d_mean" || (*iv) == "GainChi2NDF1d_mean" || - (*iv) == "GainChi2Prob1d_mean" || - (*iv) == "Pedestal1d_mean" || - (*iv) == "ScurveChi2ProbSummary_mean" || - (*iv) == "ScurveFitResultSummary_mean" || - (*iv) == "ScurveSigmasSummary_mean" || - (*iv) == "ScurveThresholdSummary_mean" || - (*iv) == "Gain1d_RMS" || (*iv) == "GainChi2NDF1d_RMS" || - (*iv) == "GainChi2Prob1d_RMS" || - (*iv) == "Pedestal1d_RMS" || - (*iv) == "GainNPoints1d_mean" || - (*iv) == "GainNPoints1d_RMS" || - (*iv) == "GainHighPoint1d_mean" || - (*iv) == "GainHighPoint1d_RMS" || - (*iv) == "GainLowPoint1d_mean" || - (*iv) == "GainLowPoint1d_RMS" || - (*iv) == "GainEndPoint1d_mean" || - (*iv) == "GainEndPoint1d_RMS" || - (*iv) == "GainFitResult2d_mean" || - (*iv) == "GainFitResult2d_RMS" || - (*iv) == "GainDynamicRange2d_mean" || - (*iv) == "GainDynamicRange2d_RMS" || - (*iv) == "GainSaturate2d_mean" || - (*iv) == "GainSaturate2d_RMS" || - (*iv) == "ScurveChi2ProbSummary_RMS" || - (*iv) == "ScurveFitResultSummary_RMS" || - (*iv) == "ScurveSigmasSummary_RMS" || - (*iv) == "ScurveThresholdSummary_RMS" || - (*iv) == "pixelAliveSummary_mean" || - (*iv) == "pixelAliveSummary_FracOfPerfectPix" || + else if ((*iv) == "Gain1d_mean" || (*iv) == "GainChi2NDF1d_mean" || (*iv) == "GainChi2Prob1d_mean" || + (*iv) == "Pedestal1d_mean" || (*iv) == "ScurveChi2ProbSummary_mean" || + (*iv) == "ScurveFitResultSummary_mean" || (*iv) == "ScurveSigmasSummary_mean" || + (*iv) == "ScurveThresholdSummary_mean" || (*iv) == "Gain1d_RMS" || (*iv) == "GainChi2NDF1d_RMS" || + (*iv) == "GainChi2Prob1d_RMS" || (*iv) == "Pedestal1d_RMS" || (*iv) == "GainNPoints1d_mean" || + (*iv) == "GainNPoints1d_RMS" || (*iv) == "GainHighPoint1d_mean" || + (*iv) == "GainHighPoint1d_RMS" || (*iv) == "GainLowPoint1d_mean" || + (*iv) == "GainLowPoint1d_RMS" || (*iv) == "GainEndPoint1d_mean" || (*iv) == "GainEndPoint1d_RMS" || + (*iv) == "GainFitResult2d_mean" || (*iv) == "GainFitResult2d_RMS" || + (*iv) == "GainDynamicRange2d_mean" || (*iv) == "GainDynamicRange2d_RMS" || + (*iv) == "GainSaturate2d_mean" || (*iv) == "GainSaturate2d_RMS" || + (*iv) == "ScurveChi2ProbSummary_RMS" || (*iv) == "ScurveFitResultSummary_RMS" || + (*iv) == "ScurveSigmasSummary_RMS" || (*iv) == "ScurveThresholdSummary_RMS" || + (*iv) == "pixelAliveSummary_mean" || (*iv) == "pixelAliveSummary_FracOfPerfectPix" || (*iv) == "SiPixelErrorsCalibDigis_NCalibErrors") prefix = "SUMCAL"; } @@ -1716,13 +1516,11 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( nbin = 96; else if (dir_name == "Endcap") nbin = 672; - else if (prefix == "SUMOFF" && - dir_name.find("HalfCylinder") != string::npos) + else if (prefix == "SUMOFF" && dir_name.find("HalfCylinder") != string::npos) nbin = 24; else if (dir_name.find("HalfCylinder") != string::npos) nbin = 168; - else if (prefix == "SUMOFF" && - dir_name.find("Disk") != string::npos) + else if (prefix == "SUMOFF" && dir_name.find("Disk") != string::npos) nbin = 12; else if (dir_name.find("Disk") != string::npos) nbin = 84; @@ -1738,13 +1536,11 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( nbin = 336; else if (dir_name == "Endcap") nbin = 672; - else if (prefix == "SUMOFF" && - dir_name.find("HalfCylinder") != string::npos) + else if (prefix == "SUMOFF" && dir_name.find("HalfCylinder") != string::npos) nbin = 84; else if (dir_name.find("HalfCylinder") != string::npos) nbin = 168; - else if (prefix == "SUMOFF" && - dir_name.find("Disk") != string::npos) + else if (prefix == "SUMOFF" && dir_name.find("Disk") != string::npos) nbin = 28; else if (dir_name.find("Disk") != string::npos) nbin = 56; @@ -1753,8 +1549,7 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( getGrandSummaryME(iBooker, iGetter, nbin, me_name, gsum_mes); } - for (vector::const_iterator igm = gsum_mes.begin(); - igm != gsum_mes.end(); igm++) { + for (vector::const_iterator igm = gsum_mes.begin(); igm != gsum_mes.end(); igm++) { if ((*igm)->getName().find(var) != string::npos) { if (prefix == "SUMOFF") (*igm)->setAxisTitle("Blades", 1); @@ -1765,11 +1560,9 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( else (*igm)->setAxisTitle("Modules", 1); string title = ""; - if ((*igm)->getName().find("NErrors_") != string::npos && - prefix == "SUMOFF") + if ((*igm)->getName().find("NErrors_") != string::npos && prefix == "SUMOFF") title = "Total number of errors per Blade"; - else if ((*igm)->getName().find("NErrors_") != string::npos && - prefix == "SUMRAW") + else if ((*igm)->getName().find("NErrors_") != string::npos && prefix == "SUMRAW") title = "Total number of errors per Module"; else if (prefix == "SUMOFF") title = "mean " + (*iv) + " per Blade"; @@ -1784,11 +1577,9 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( (*igm)->setAxisTitle(title, 2); nbin_i = 0; if (!isUpgrade) { - if ((*igm)->getName().find("ALLMODS_adcCOMB_") != - string::npos) { + if ((*igm)->getName().find("ALLMODS_adcCOMB_") != string::npos) { nbin_subdir = 128; - } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != - string::npos) { + } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != string::npos) { nbin_subdir = 100; } else if ((*igm)->getName().find("Panel_") != string::npos) { nbin_subdir = 7; @@ -1802,8 +1593,7 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( } else if ((*igm)->getName().find("Disk") != string::npos) { nbin_i = ((cnt - 1) % 12) * 7; nbin_subdir = 7; - } else if ((*igm)->getName().find("HalfCylinder") != - string::npos) { + } else if ((*igm)->getName().find("HalfCylinder") != string::npos) { if (prefix != "SUMOFF") { nbin_subdir = 84; if ((*im).find("_2") != string::npos) @@ -1833,11 +1623,9 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( } } } else if (isUpgrade) { - if ((*igm)->getName().find("ALLMODS_adcCOMB_") != - string::npos) { + if ((*igm)->getName().find("ALLMODS_adcCOMB_") != string::npos) { nbin_subdir = 128; - } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != - string::npos) { + } else if ((*igm)->getName().find("ALLMODS_chargeCOMB_") != string::npos) { nbin_subdir = 100; } else if ((*igm)->getName().find("Panel_") != string::npos) { nbin_subdir = 2; @@ -1851,8 +1639,7 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( } else if ((*igm)->getName().find("Disk") != string::npos) { nbin_i = ((cnt - 1) % 28) * 2; nbin_subdir = 2; - } else if ((*igm)->getName().find("HalfCylinder") != - string::npos) { + } else if ((*igm)->getName().find("HalfCylinder") != string::npos) { if (prefix != "SUMOFF") { nbin_subdir = 56; if ((*im).find("_2") != string::npos) @@ -1897,8 +1684,7 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( (*igm)->getName().find("Track_") == string::npos && me->getName().find("charge_") != string::npos && me->getName().find("Track_") == string::npos) || - ((*igm)->getName().find("nclusters_") != - string::npos && + ((*igm)->getName().find("nclusters_") != string::npos && (*igm)->getName().find("Track_") == string::npos && me->getName().find("nclusters_") != string::npos && me->getName().find("Track_") == string::npos) || @@ -1906,33 +1692,20 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( (*igm)->getName().find("Track_") == string::npos && me->getName().find("size_") != string::npos && me->getName().find("Track_") == string::npos) || - ((*igm)->getName().find("charge_OffTrack_") != - string::npos && - me->getName().find("charge_OffTrack_") != - string::npos) || - ((*igm)->getName().find("nclusters_OffTrack_") != - string::npos && - me->getName().find("nclusters_OffTrack_") != - string::npos) || - ((*igm)->getName().find("size_OffTrack_") != - string::npos && - me->getName().find("size_OffTrack_") != - string::npos) || - ((*igm)->getName().find("charge_OnTrack_") != - string::npos && - me->getName().find("charge_OnTrack_") != - string::npos) || - ((*igm)->getName().find("nclusters_OnTrack_") != - string::npos && - me->getName().find("nclusters_OnTrack_") != - string::npos) || - ((*igm)->getName().find("size_OnTrack_") != - string::npos && - me->getName().find("size_OnTrack_") != - string::npos) || + ((*igm)->getName().find("charge_OffTrack_") != string::npos && + me->getName().find("charge_OffTrack_") != string::npos) || + ((*igm)->getName().find("nclusters_OffTrack_") != string::npos && + me->getName().find("nclusters_OffTrack_") != string::npos) || + ((*igm)->getName().find("size_OffTrack_") != string::npos && + me->getName().find("size_OffTrack_") != string::npos) || + ((*igm)->getName().find("charge_OnTrack_") != string::npos && + me->getName().find("charge_OnTrack_") != string::npos) || + ((*igm)->getName().find("nclusters_OnTrack_") != string::npos && + me->getName().find("nclusters_OnTrack_") != string::npos) || + ((*igm)->getName().find("size_OnTrack_") != string::npos && + me->getName().find("size_OnTrack_") != string::npos) || ((*igm)->getName().find("charge_") == string::npos && - (*igm)->getName().find("nclusters_") == - string::npos && + (*igm)->getName().find("nclusters_") == string::npos && (*igm)->getName().find("size_") == string::npos)) { for (int k = 1; k < nbin_subdir + 1; k++) if (me->getBinContent(k) > 0) @@ -1951,26 +1724,23 @@ void SiPixelActionExecutor::fillGrandEndcapSummaryHistos( } iDir++; - first_subdir = false; // We are done processing the first directory, we - // don't add any new MEs in the future passes. - } // end for it (subdirs) + first_subdir = false; // We are done processing the first directory, we + // don't add any new MEs in the future passes. + } // end for it (subdirs) } //============================================================================================================= // // -- Get Summary ME // -void SiPixelActionExecutor::getGrandSummaryME(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, - int nbin, string &me_name, - vector &mes) { +void SiPixelActionExecutor::getGrandSummaryME( + DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int nbin, string &me_name, vector &mes) { // printing cout<<"Entering SiPixelActionExecutor::getGrandSummaryME for: // "< contents = iGetter.getMEs(); - for (vector::const_iterator it = contents.begin(); - it != contents.end(); it++) { + for (vector::const_iterator it = contents.begin(); it != contents.end(); it++) { // printing cout<<"in grand summary me: "< contents = iGetter.getMEs(); - for (vector::const_iterator it = contents.begin(); - it != contents.end(); it++) { + for (vector::const_iterator it = contents.begin(); it != contents.end(); it++) { if ((*it).find(me_name) == 0) { string fullpathname = iBooker.pwd() + "/" + (*it); me = iGetter.get(fullpathname); @@ -2040,7 +1808,7 @@ MonitorElement *SiPixelActionExecutor::getSummaryME(DQMStore::IBooker &iBooker, } else if (me_name.find("Disk_") != string::npos) { me = iBooker.book1D(me_name.c_str(), me_name.c_str(), 12, 1., 13.); } - } // endifNOTUpgrade + } // endifNOTUpgrade else if (isUpgrade) { if (me_name.find("SUMOFF") == string::npos) { if (me_name.find("Blade_") != string::npos) @@ -2058,22 +1826,22 @@ MonitorElement *SiPixelActionExecutor::getSummaryME(DQMStore::IBooker &iBooker, } else if (me_name.find("Disk_") != string::npos) { me = iBooker.book1D(me_name.c_str(), me_name.c_str(), 28, 1., 29.); } - } // endifUpgrade + } // endifUpgrade return me; } //============================================================================================================= -MonitorElement *SiPixelActionExecutor::getFEDSummaryME( - DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, string me_name) { +MonitorElement *SiPixelActionExecutor::getFEDSummaryME(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + string me_name) { // printing cout<<"Entering SiPixelActionExecutor::getFEDSummaryME..."< contents = iGetter.getMEs(); - for (vector::const_iterator it = contents.begin(); - it != contents.end(); it++) { + for (vector::const_iterator it = contents.begin(); it != contents.end(); it++) { if ((*it).find(me_name) == 0) { string fullpathname = iBooker.pwd() + "/" + (*it); @@ -2095,13 +1863,12 @@ MonitorElement *SiPixelActionExecutor::getFEDSummaryME( void SiPixelActionExecutor::bookOccupancyPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool hiRes, - bool isbarrel) // Polymorphism + bool isbarrel) // Polymorphism { if (Tier0Flag_) return; vector subdirs = iGetter.getSubdirs(); - for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); - it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { if (isbarrel && (*it).find("Barrel") == string::npos) continue; if (!isbarrel && (*it).find("Endcap") == string::npos) @@ -2124,16 +1891,24 @@ void SiPixelActionExecutor::bookOccupancyPlots(DQMStore::IBooker &iBooker, bookOccupancyPlots(iBooker, iGetter, hiRes, isbarrel); if (!hiRes) { // occupancyprinting cout<<"booking low res barrel occ plot now!"<setAxisTitle("Columns", 1); OccupancyMap->setAxisTitle("Rows", 2); @@ -2143,10 +1918,7 @@ void SiPixelActionExecutor::bookOccupancyPlots(DQMStore::IBooker &iBooker, } } //============================================================================================================= -void SiPixelActionExecutor::bookOccupancyPlots(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, - bool hiRes) { - +void SiPixelActionExecutor::bookOccupancyPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool hiRes) { if (Tier0Flag_) return; // Barrel @@ -2164,8 +1936,7 @@ void SiPixelActionExecutor::bookOccupancyPlots(DQMStore::IBooker &iBooker, this->bookOccupancyPlots(iBooker, iGetter, hiRes, false); } -void SiPixelActionExecutor::createOccupancy(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter) { +void SiPixelActionExecutor::createOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) { // std::cout<<"entering SiPixelActionExecutor::createOccupancy..."< meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); it != meVec.end(); - it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); - if (full_path.find("hitmap_siPixelDigis") != - string::npos) { // If we have the hitmap ME + if (full_path.find("hitmap_siPixelDigis") != string::npos) { // If we have the hitmap ME MonitorElement *me = iGetter.get(full_path); if (!me) continue; string path = full_path; - while (path.find_last_of("/") != 5) // Stop before Pixel/ + while (path.find_last_of("/") != 5) // Stop before Pixel/ { path = path.substr(0, path.find_last_of("/")); // cout << "\t" << // path //<< endl; - OccupancyMap = iGetter.get( - path + "/" + (isbarrel ? "barrel" : "endcap") + "OccupancyMap"); + OccupancyMap = iGetter.get(path + "/" + (isbarrel ? "barrel" : "endcap") + "OccupancyMap"); if (OccupancyMap) { for (int i = 1; i != me->getNbinsX() + 1; i++) for (int j = 1; j != me->getNbinsY() + 1; j++) { float previous = OccupancyMap->getBinContent(i, j); - OccupancyMap->setBinContent(i, j, - previous + me->getBinContent(i, j)); + OccupancyMap->setBinContent(i, j, previous + me->getBinContent(i, j)); } - OccupancyMap->getTH2F()->SetEntries( - OccupancyMap->getTH2F()->Integral()); + OccupancyMap->getTH2F()->SetEntries(OccupancyMap->getTH2F()->Integral()); } } } } } else { vector subdirs = iGetter.getSubdirs(); - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { iGetter.cd(*it); iBooker.cd(*it); if (*it != "Pixel" && - ((isbarrel && (*it).find("Barrel") == string::npos) || - (!isbarrel && (*it).find("Endcap") == string::npos))) + ((isbarrel && (*it).find("Barrel") == string::npos) || (!isbarrel && (*it).find("Endcap") == string::npos))) continue; fillOccupancy(iBooker, iGetter, isbarrel); iBooker.goUp(); @@ -2249,8 +2010,7 @@ void SiPixelActionExecutor::fillOccupancy(DQMStore::IBooker &iBooker, //============================================================================================================= -void SiPixelActionExecutor::normaliseAvDigiOcc(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter) { +void SiPixelActionExecutor::normaliseAvDigiOcc(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) { // occupancyprinting cout<<"entering // SiPixelActionExecutor::normaliseAvDigiOcc..."<setBinContent(i, roccupancyPlot->getBinContent(i) / - averageBPIXOcc); + roccupancyPlot->setBinContent(i, roccupancyPlot->getBinContent(i) / averageBPIXOcc); else - roccupancyPlot->setBinContent(i, roccupancyPlot->getBinContent(i) / - averageFPIXOcc); + roccupancyPlot->setBinContent(i, roccupancyPlot->getBinContent(i) / averageFPIXOcc); } iGetter.setCurrentFolder(iBooker.pwd()); @@ -2285,11 +2043,9 @@ void SiPixelActionExecutor::normaliseAvDigiOcc(DQMStore::IBooker &iBooker, void SiPixelActionExecutor::normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumisec) { - iGetter.cd(); - MonitorElement *avgfedDigiOccvsLumi = - iGetter.get("Pixel/avgfedDigiOccvsLumi"); + MonitorElement *avgfedDigiOccvsLumi = iGetter.get("Pixel/avgfedDigiOccvsLumi"); float totalDigisBPIX = 0.; float totalDigisFPIX = 0.; @@ -2303,13 +2059,9 @@ void SiPixelActionExecutor::normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, float averageFPIXOcc = totalDigisFPIX / 8.; for (int i = 1; i != 41; i++) { if (i < 33) - avgfedDigiOccvsLumi->setBinContent( - lumisec, i, - avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageBPIXOcc); + avgfedDigiOccvsLumi->setBinContent(lumisec, i, avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageBPIXOcc); else - avgfedDigiOccvsLumi->setBinContent( - lumisec, i, - avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageFPIXOcc); + avgfedDigiOccvsLumi->setBinContent(lumisec, i, avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageFPIXOcc); } iGetter.setCurrentFolder(iBooker.pwd()); @@ -2317,151 +2069,104 @@ void SiPixelActionExecutor::normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, //============================================================================================================= -void SiPixelActionExecutor::bookEfficiency(DQMStore::IBooker &iBooker, - bool isUpgrade) { +void SiPixelActionExecutor::bookEfficiency(DQMStore::IBooker &iBooker, bool isUpgrade) { // Barrel iBooker.cd(); iBooker.setCurrentFolder("Pixel/Barrel"); if (!isUpgrade) { if (Tier0Flag_) { HitEfficiency_L1 = iBooker.book2D( - "HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;Module;Ladder", - 9, -4.5, 4.5, 21, -10.5, 10.5); + "HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;Module;Ladder", 9, -4.5, 4.5, 21, -10.5, 10.5); HitEfficiency_L2 = iBooker.book2D( - "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;Module;Ladder", - 9, -4.5, 4.5, 33, -16.5, 16.5); + "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;Module;Ladder", 9, -4.5, 4.5, 33, -16.5, 16.5); HitEfficiency_L3 = iBooker.book2D( - "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;Module;Ladder", - 9, -4.5, 4.5, 45, -22.5, 22.5); + "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;Module;Ladder", 9, -4.5, 4.5, 45, -22.5, 22.5); } else { HitEfficiency_L1 = iBooker.book2D( - "HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;Module;Ladder", - 9, -4.5, 4.5, 21, -10.5, 10.5); + "HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;Module;Ladder", 9, -4.5, 4.5, 21, -10.5, 10.5); HitEfficiency_L2 = iBooker.book2D( - "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;Module;Ladder", - 9, -4.5, 4.5, 33, -16.5, 16.5); + "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;Module;Ladder", 9, -4.5, 4.5, 33, -16.5, 16.5); HitEfficiency_L3 = iBooker.book2D( - "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;Module;Ladder", - 9, -4.5, 4.5, 45, -22.5, 22.5); + "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;Module;Ladder", 9, -4.5, 4.5, 45, -22.5, 22.5); } - } // endifNOTUpgrade + } // endifNOTUpgrade else if (isUpgrade) { if (Tier0Flag_) { - HitEfficiency_L1 = iBooker.book2D( - "HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;z-side;Ladder", - 2, -1., 1., 12, -6., 6.); + HitEfficiency_L1 = + iBooker.book2D("HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;z-side;Ladder", 2, -1., 1., 12, -6., 6.); HitEfficiency_L2 = iBooker.book2D( - "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;z-side;Ladder", - 2, -1., 1., 28, -14., 14.); + "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;z-side;Ladder", 2, -1., 1., 28, -14., 14.); HitEfficiency_L3 = iBooker.book2D( - "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;z-side;Ladder", - 2, -1., 1., 44, -22., 22.); + "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;z-side;Ladder", 2, -1., 1., 44, -22., 22.); HitEfficiency_L4 = iBooker.book2D( - "HitEfficiency_L4", "Hit Efficiency in Barrel_Layer4;z-side;Ladder", - 2, -1., 1., 64, -32., 32.); + "HitEfficiency_L4", "Hit Efficiency in Barrel_Layer4;z-side;Ladder", 2, -1., 1., 64, -32., 32.); } else { - HitEfficiency_L1 = iBooker.book2D( - "HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;Module;Ladder", - 8, -4., 4., 12, -6., 6.); + HitEfficiency_L1 = + iBooker.book2D("HitEfficiency_L1", "Hit Efficiency in Barrel_Layer1;Module;Ladder", 8, -4., 4., 12, -6., 6.); HitEfficiency_L2 = iBooker.book2D( - "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;Module;Ladder", - 8, -4., 4., 28, -14., 14.); + "HitEfficiency_L2", "Hit Efficiency in Barrel_Layer2;Module;Ladder", 8, -4., 4., 28, -14., 14.); HitEfficiency_L3 = iBooker.book2D( - "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;Module;Ladder", - 8, -4., 4., 44, -22., 22.); + "HitEfficiency_L3", "Hit Efficiency in Barrel_Layer3;Module;Ladder", 8, -4., 4., 44, -22., 22.); HitEfficiency_L4 = iBooker.book2D( - "HitEfficiency_L4", "Hit Efficiency in Barrel_Layer4;Module;Ladder", - 8, -4., 4., 64, -32., 32.); + "HitEfficiency_L4", "Hit Efficiency in Barrel_Layer4;Module;Ladder", 8, -4., 4., 64, -32., 32.); } - } // endifUpgrade + } // endifUpgrade // Endcap iBooker.cd(); iBooker.setCurrentFolder("Pixel/Endcap"); if (!isUpgrade) { if (Tier0Flag_) { HitEfficiency_Dp1 = iBooker.book2D( - "HitEfficiency_Dp1", "Hit Efficiency in Endcap_Disk_p1;Blade;Panel", - 26, -13., 13., 2, 0.5, 2.5); + "HitEfficiency_Dp1", "Hit Efficiency in Endcap_Disk_p1;Blade;Panel", 26, -13., 13., 2, 0.5, 2.5); HitEfficiency_Dp2 = iBooker.book2D( - "HitEfficiency_Dp2", "Hit Efficiency in Endcap_Disk_p2;Blade;Panel", - 26, -13., 13., 2, 0.5, 2.5); + "HitEfficiency_Dp2", "Hit Efficiency in Endcap_Disk_p2;Blade;Panel", 26, -13., 13., 2, 0.5, 2.5); HitEfficiency_Dm1 = iBooker.book2D( - "HitEfficiency_Dm1", "Hit Efficiency in Endcap_Disk_m1;Blade;Panel", - 26, -13., 13., 2, 0.5, 2.5); + "HitEfficiency_Dm1", "Hit Efficiency in Endcap_Disk_m1;Blade;Panel", 26, -13., 13., 2, 0.5, 2.5); HitEfficiency_Dm2 = iBooker.book2D( - "HitEfficiency_Dm2", "Hit Efficiency in Endcap_Disk_m2;;Blade;Panel", - 26, -13., 13., 2, 0.5, 2.5); + "HitEfficiency_Dm2", "Hit Efficiency in Endcap_Disk_m2;;Blade;Panel", 26, -13., 13., 2, 0.5, 2.5); } else { - HitEfficiency_Dp1 = - iBooker.book2D("HitEfficiency_Dp1", - "Hit Efficiency in Endcap_Disk_p1;Blades;Modules", 24, - -12., 12., 7, 1., 8.); - HitEfficiency_Dp2 = - iBooker.book2D("HitEfficiency_Dp2", - "Hit Efficiency in Endcap_Disk_p2;Blades;Modules", 24, - -12., 12., 7, 1., 8.); - HitEfficiency_Dm1 = - iBooker.book2D("HitEfficiency_Dm1", - "Hit Efficiency in Endcap_Disk_m1;Blades;Modules", 24, - -12., 12., 7, 1., 8.); - HitEfficiency_Dm2 = - iBooker.book2D("HitEfficiency_Dm2", - "Hit Efficiency in Endcap_Disk_m2;Blades;Modules", 24, - -12., 12., 7, 1., 8.); - } - } else if (isUpgrade) { - if (Tier0Flag_) { HitEfficiency_Dp1 = iBooker.book2D( - "HitEfficiency_Dp1", "Hit Efficiency in Endcap_Disk_p1;Blades;", 28, - -17., 11., 1, 0., 1.); + "HitEfficiency_Dp1", "Hit Efficiency in Endcap_Disk_p1;Blades;Modules", 24, -12., 12., 7, 1., 8.); HitEfficiency_Dp2 = iBooker.book2D( - "HitEfficiency_Dp2", "Hit Efficiency in Endcap_Disk_p2;Blades;", 28, - -17., 11., 1, 0., 1.); - HitEfficiency_Dp3 = iBooker.book2D( - "HitEfficiency_Dp3", "Hit Efficiency in Endcap_Disk_p3;Blades;", 28, - -17., 11., 1, 0., 1.); + "HitEfficiency_Dp2", "Hit Efficiency in Endcap_Disk_p2;Blades;Modules", 24, -12., 12., 7, 1., 8.); HitEfficiency_Dm1 = iBooker.book2D( - "HitEfficiency_Dm1", "Hit Efficiency in Endcap_Disk_m1;Blades;", 28, - -17., 11., 1, 0., 1.); + "HitEfficiency_Dm1", "Hit Efficiency in Endcap_Disk_m1;Blades;Modules", 24, -12., 12., 7, 1., 8.); HitEfficiency_Dm2 = iBooker.book2D( - "HitEfficiency_Dm2", "Hit Efficiency in Endcap_Disk_m2;Blades;", 28, - -17., 11., 1, 0., 1.); - HitEfficiency_Dm3 = iBooker.book2D( - "HitEfficiency_Dm3", "Hit Efficiency in Endcap_Disk_m3;Blades;", 28, - -17., 11., 1, 0., 1.); - } else { + "HitEfficiency_Dm2", "Hit Efficiency in Endcap_Disk_m2;Blades;Modules", 24, -12., 12., 7, 1., 8.); + } + } else if (isUpgrade) { + if (Tier0Flag_) { HitEfficiency_Dp1 = - iBooker.book2D("HitEfficiency_Dp1", - "Hit Efficiency in Endcap_Disk_p1;Blades;Modules", 28, - -17., 11., 2, 1., 3.); + iBooker.book2D("HitEfficiency_Dp1", "Hit Efficiency in Endcap_Disk_p1;Blades;", 28, -17., 11., 1, 0., 1.); HitEfficiency_Dp2 = - iBooker.book2D("HitEfficiency_Dp2", - "Hit Efficiency in Endcap_Disk_p2;Blades;Modules", 28, - -17., 11., 2, 1., 3.); + iBooker.book2D("HitEfficiency_Dp2", "Hit Efficiency in Endcap_Disk_p2;Blades;", 28, -17., 11., 1, 0., 1.); HitEfficiency_Dp3 = - iBooker.book2D("HitEfficiency_Dp3", - "Hit Efficiency in Endcap_Disk_p3;Blades;Modules", 28, - -17., 11., 2, 1., 3.); + iBooker.book2D("HitEfficiency_Dp3", "Hit Efficiency in Endcap_Disk_p3;Blades;", 28, -17., 11., 1, 0., 1.); HitEfficiency_Dm1 = - iBooker.book2D("HitEfficiency_Dm1", - "Hit Efficiency in Endcap_Disk_m1;Blades;Modules", 28, - -17., 11., 2, 1., 3.); + iBooker.book2D("HitEfficiency_Dm1", "Hit Efficiency in Endcap_Disk_m1;Blades;", 28, -17., 11., 1, 0., 1.); HitEfficiency_Dm2 = - iBooker.book2D("HitEfficiency_Dm2", - "Hit Efficiency in Endcap_Disk_m2;Blades;Modules", 28, - -17., 11., 2, 1., 3.); + iBooker.book2D("HitEfficiency_Dm2", "Hit Efficiency in Endcap_Disk_m2;Blades;", 28, -17., 11., 1, 0., 1.); HitEfficiency_Dm3 = - iBooker.book2D("HitEfficiency_Dm3", - "Hit Efficiency in Endcap_Disk_m3;Blades;Modules", 28, - -17., 11., 2, 1., 3.); + iBooker.book2D("HitEfficiency_Dm3", "Hit Efficiency in Endcap_Disk_m3;Blades;", 28, -17., 11., 1, 0., 1.); + } else { + HitEfficiency_Dp1 = iBooker.book2D( + "HitEfficiency_Dp1", "Hit Efficiency in Endcap_Disk_p1;Blades;Modules", 28, -17., 11., 2, 1., 3.); + HitEfficiency_Dp2 = iBooker.book2D( + "HitEfficiency_Dp2", "Hit Efficiency in Endcap_Disk_p2;Blades;Modules", 28, -17., 11., 2, 1., 3.); + HitEfficiency_Dp3 = iBooker.book2D( + "HitEfficiency_Dp3", "Hit Efficiency in Endcap_Disk_p3;Blades;Modules", 28, -17., 11., 2, 1., 3.); + HitEfficiency_Dm1 = iBooker.book2D( + "HitEfficiency_Dm1", "Hit Efficiency in Endcap_Disk_m1;Blades;Modules", 28, -17., 11., 2, 1., 3.); + HitEfficiency_Dm2 = iBooker.book2D( + "HitEfficiency_Dm2", "Hit Efficiency in Endcap_Disk_m2;Blades;Modules", 28, -17., 11., 2, 1., 3.); + HitEfficiency_Dm3 = iBooker.book2D( + "HitEfficiency_Dm3", "Hit Efficiency in Endcap_Disk_m3;Blades;Modules", 28, -17., 11., 2, 1., 3.); } - } // endif(isUpgrade) + } // endif(isUpgrade) iBooker.cd(); iBooker.cd("Pixel/"); - string bins[] = {"Layer1", "Layer2", "Layer3", "Disk1+", - "Disk2+", "Disk1-", "Disk2-"}; - HitEfficiencySummary = iBooker.book1D( - "HitEfficiencySummary", "Hit efficiency per sub detector", 7, 0, 7); + string bins[] = {"Layer1", "Layer2", "Layer3", "Disk1+", "Disk2+", "Disk1-", "Disk2-"}; + HitEfficiencySummary = iBooker.book1D("HitEfficiencySummary", "Hit efficiency per sub detector", 7, 0, 7); HitEfficiencySummary->setAxisTitle("Sub Detector", 1); HitEfficiencySummary->setAxisTitle("Efficiency (%)", 2); for (int i = 1; i < 8; i++) { @@ -2471,17 +2176,15 @@ void SiPixelActionExecutor::bookEfficiency(DQMStore::IBooker &iBooker, //============================================================================================================= -void SiPixelActionExecutor::createEfficiency(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, - bool isUpgrade) { +void SiPixelActionExecutor::createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade) { // std::cout<<"entering // SiPixelActionExecutor::createEfficiency..."< meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); - it != meVec.end(); it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); - if (full_path.find("missingMod_") != - string::npos) { // If we have missing hits ME + if (full_path.find("missingMod_") != string::npos) { // If we have missing hits ME // Get the MEs that contain missing and valid hits MonitorElement *missing = iGetter.get(full_path); if (!missing) continue; - string new_path = - full_path.replace(full_path.find("missing"), 7, "valid"); + string new_path = full_path.replace(full_path.find("missing"), 7, "valid"); MonitorElement *valid = iGetter.get(new_path); if (!valid) continue; int binx = 0; int biny = 0; // get the ladder number - biny = getLadder(dname); // Current - if (currDir.find("Shell_mO") != string::npos || - currDir.find("Shell_pO") != string::npos) { + biny = getLadder(dname); // Current + if (currDir.find("Shell_mO") != string::npos || currDir.find("Shell_pO") != string::npos) { biny = -biny; } const int nMod = 4; @@ -2552,7 +2252,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, float hitEfficiency = -1.0; float missingHits = 0; float validHits = 0; - binx = i; // Module + binx = i; // Module if (currDir.find("Shell_m") != string::npos) binx = -binx; @@ -2564,39 +2264,33 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, if (currDir.find("Layer_1") != string::npos) { HitEfficiency_L1 = iGetter.get("Pixel/Barrel/HitEfficiency_L1"); if (HitEfficiency_L1) - HitEfficiency_L1->setBinContent( - HitEfficiency_L1->getTH2F()->FindBin(binx, biny), - (float)hitEfficiency); + HitEfficiency_L1->setBinContent(HitEfficiency_L1->getTH2F()->FindBin(binx, biny), + (float)hitEfficiency); } else if (currDir.find("Layer_2") != string::npos) { HitEfficiency_L2 = iGetter.get("Pixel/Barrel/HitEfficiency_L2"); if (HitEfficiency_L2) - HitEfficiency_L2->setBinContent( - HitEfficiency_L2->getTH2F()->FindBin(binx, biny), - (float)hitEfficiency); + HitEfficiency_L2->setBinContent(HitEfficiency_L2->getTH2F()->FindBin(binx, biny), + (float)hitEfficiency); } else if (currDir.find("Layer_3") != string::npos) { HitEfficiency_L3 = iGetter.get("Pixel/Barrel/HitEfficiency_L3"); if (HitEfficiency_L3) - HitEfficiency_L3->setBinContent( - HitEfficiency_L3->getTH2F()->FindBin(binx, biny), - (float)hitEfficiency); + HitEfficiency_L3->setBinContent(HitEfficiency_L3->getTH2F()->FindBin(binx, biny), + (float)hitEfficiency); } } } } - } // endifNOTUpgradeInBPix + } // endifNOTUpgradeInBPix else if (isUpgrade) { vector meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); - it != meVec.end(); it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); - if (full_path.find("missing_") != - string::npos) { // If we have missing hits ME + if (full_path.find("missing_") != string::npos) { // If we have missing hits ME MonitorElement *me = iGetter.get(full_path); if (!me) continue; float missingHits = me->getEntries(); - string new_path = - full_path.replace(full_path.find("missing"), 7, "valid"); + string new_path = full_path.replace(full_path.find("missing"), 7, "valid"); me = iGetter.get(new_path); if (!me) continue; @@ -2607,53 +2301,44 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, int binx = 0; int biny = 0; biny = getLadder(dname); - if (currDir.find("Shell_mO") != string::npos || - currDir.find("Shell_pO") != string::npos) { + if (currDir.find("Shell_mO") != string::npos || currDir.find("Shell_pO") != string::npos) { biny = -biny; } if (currDir.find("Shell_m") != string::npos) { binx = 1; } else { binx = 2; - } // x-axis: z-side + } // x-axis: z-side if (currDir.find("Layer_1") != string::npos) { HitEfficiency_L1 = iGetter.get("Pixel/Barrel/HitEfficiency_L1"); if (HitEfficiency_L1) - HitEfficiency_L1->setBinContent(binx, biny, - (float)hitEfficiency); + HitEfficiency_L1->setBinContent(binx, biny, (float)hitEfficiency); } else if (currDir.find("Layer_2") != string::npos) { HitEfficiency_L2 = iGetter.get("Pixel/Barrel/HitEfficiency_L2"); if (HitEfficiency_L2) - HitEfficiency_L2->setBinContent(binx, biny, - (float)hitEfficiency); + HitEfficiency_L2->setBinContent(binx, biny, (float)hitEfficiency); } else if (currDir.find("Layer_3") != string::npos) { HitEfficiency_L3 = iGetter.get("Pixel/Barrel/HitEfficiency_L3"); if (HitEfficiency_L3) - HitEfficiency_L3->setBinContent(binx, biny, - (float)hitEfficiency); + HitEfficiency_L3->setBinContent(binx, biny, (float)hitEfficiency); } else if (currDir.find("Layer_4") != string::npos) { HitEfficiency_L4 = iGetter.get("Pixel/Barrel/HitEfficiency_L4"); if (HitEfficiency_L4) - HitEfficiency_L4->setBinContent(binx, biny, - (float)hitEfficiency); + HitEfficiency_L4->setBinContent(binx, biny, (float)hitEfficiency); } } } - } // endifUpgradeInBPix - } else if (!isbarrel && dname.find("Blade_") != string::npos && - !isUpgrade) { + } // endifUpgradeInBPix + } else if (!isbarrel && dname.find("Blade_") != string::npos && !isUpgrade) { vector meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); it != meVec.end(); - it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); - if (full_path.find("missing_") != - string::npos) { // If we have missing hits ME + if (full_path.find("missing_") != string::npos) { // If we have missing hits ME MonitorElement *missing = iGetter.get(full_path); if (!missing) continue; // float missingHits = missing->getEntries(); - string new_path = - full_path.replace(full_path.find("missing"), 7, "valid"); + string new_path = full_path.replace(full_path.find("missing"), 7, "valid"); MonitorElement *valid = iGetter.get(new_path); if (!valid) continue; @@ -2661,8 +2346,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, int binx = 0; int biny = 0; binx = getBlade(dname); - if (currDir.find("HalfCylinder_mI") != string::npos || - currDir.find("HalfCylinder_pI") != string::npos) { + if (currDir.find("HalfCylinder_mI") != string::npos || currDir.find("HalfCylinder_pI") != string::npos) { binx = binx + 14; } else { binx = 13 - binx; @@ -2677,47 +2361,36 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, validHits = valid->getBinContent(i); if (validHits + missingHits > 0.) hitEfficiency = validHits / (validHits + missingHits); - if (currDir.find("Disk_1") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + if (currDir.find("Disk_1") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm1 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm1"); if (HitEfficiency_Dm1) - HitEfficiency_Dm1->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_2") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + HitEfficiency_Dm1->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_2") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm2 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm2"); if (HitEfficiency_Dm2) - HitEfficiency_Dm2->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_1") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dm2->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_1") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp1 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp1"); if (HitEfficiency_Dp1) - HitEfficiency_Dp1->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_2") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dp1->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_2") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp2 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp2"); if (HitEfficiency_Dp2) - HitEfficiency_Dp2->setBinContent(binx, biny, - (float)hitEfficiency); + HitEfficiency_Dp2->setBinContent(binx, biny, (float)hitEfficiency); } - } // EndOfFor + } // EndOfFor } } } else if (!isbarrel && dname.find("Blade_") != string::npos && isUpgrade) { vector meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); it != meVec.end(); - it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); - if (full_path.find("missing_") != - string::npos) { // If we have missing hits ME + if (full_path.find("missing_") != string::npos) { // If we have missing hits ME MonitorElement *me = iGetter.get(full_path); if (!me) continue; float missingHits = me->getEntries(); - string new_path = - full_path.replace(full_path.find("missing"), 7, "valid"); + string new_path = full_path.replace(full_path.find("missing"), 7, "valid"); me = iGetter.get(new_path); if (!me) continue; @@ -2728,8 +2401,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, int binx = 0; int biny = 1; binx = getBlade(dname); - if (currDir.find("HalfCylinder_mI") != string::npos || - currDir.find("HalfCylinder_pI") != string::npos) { + if (currDir.find("HalfCylinder_mI") != string::npos || currDir.find("HalfCylinder_pI") != string::npos) { binx = binx + 12; } else { if (binx == 1) @@ -2767,42 +2439,30 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, else if (binx == 17) binx = 1; } - if (currDir.find("Disk_1") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + if (currDir.find("Disk_1") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm1 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm1"); if (HitEfficiency_Dm1) - HitEfficiency_Dm1->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_2") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + HitEfficiency_Dm1->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_2") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm2 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm2"); if (HitEfficiency_Dm2) - HitEfficiency_Dm2->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_3") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + HitEfficiency_Dm2->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_3") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm3 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm3"); if (HitEfficiency_Dm3) - HitEfficiency_Dm3->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_1") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dm3->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_1") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp1 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp1"); if (HitEfficiency_Dp1) - HitEfficiency_Dp1->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_2") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dp1->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_2") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp2 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp2"); if (HitEfficiency_Dp2) - HitEfficiency_Dp2->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_3") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dp2->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_3") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp3 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp3"); if (HitEfficiency_Dp3) - HitEfficiency_Dp3->setBinContent(binx, biny, - (float)hitEfficiency); + HitEfficiency_Dp3->setBinContent(binx, biny, (float)hitEfficiency); } // std::cout<<"EFFI: "< subdirs = iGetter.getSubdirs(); - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { iBooker.cd(*it); iGetter.cd(*it); if (*it != "Pixel" && - ((isbarrel && (*it).find("Barrel") == string::npos) || - (!isbarrel && (*it).find("Endcap") == string::npos))) + ((isbarrel && (*it).find("Barrel") == string::npos) || (!isbarrel && (*it).find("Endcap") == string::npos))) continue; fillEfficiency(iBooker, iGetter, isbarrel, isUpgrade); iBooker.goUp(); iGetter.setCurrentFolder(iBooker.pwd()); } } - } else { // Online + } else { // Online if (dname.find("Module_") != string::npos) { vector meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); it != meVec.end(); - it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); - if (full_path.find("missing_") != - string::npos) { // If we have missing hits ME + if (full_path.find("missing_") != string::npos) { // If we have missing hits ME MonitorElement *me = iGetter.get(full_path); if (!me) continue; float missingHits = me->getEntries(); - string new_path = - full_path.replace(full_path.find("missing"), 7, "valid"); + string new_path = full_path.replace(full_path.find("missing"), 7, "valid"); me = iGetter.get(new_path); if (!me) continue; @@ -2916,8 +2571,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, } else if (currDir.find("22") != string::npos) { biny = 22; } - if (currDir.find("Shell_mO") != string::npos || - currDir.find("Shell_pO") != string::npos) { + if (currDir.find("Shell_mO") != string::npos || currDir.find("Shell_pO") != string::npos) { if (currDir.find("Layer_1") != string::npos) { biny = biny + 10; } else if (currDir.find("Layer_2") != string::npos) { @@ -2994,8 +2648,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, } else if (currDir.find("32") != string::npos) { biny = 32; } - if (currDir.find("Shell_mO") != string::npos || - currDir.find("Shell_pO") != string::npos) { + if (currDir.find("Shell_mO") != string::npos || currDir.find("Shell_pO") != string::npos) { if (currDir.find("Layer_1") != string::npos) { biny = biny + 6; } else if (currDir.find("Layer_2") != string::npos) { @@ -3007,7 +2660,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, } } } - } else { // endcap + } else { // endcap if (!isUpgrade) { if (currDir.find("01") != string::npos) { binx = 1; @@ -3034,8 +2687,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, } else if (currDir.find("12") != string::npos) { binx = 12; } - if (currDir.find("HalfCylinder_mO") != string::npos || - currDir.find("HalfCylinder_pO") != string::npos) { + if (currDir.find("HalfCylinder_mO") != string::npos || currDir.find("HalfCylinder_pO") != string::npos) { binx = binx + 12; } if (currDir.find("Panel_1/Module_1") != string::npos) { @@ -3089,8 +2741,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, } else if (currDir.find("17") != string::npos) { binx = 17; } - if (currDir.find("HalfCylinder_mO") != string::npos || - currDir.find("HalfCylinder_pO") != string::npos) { + if (currDir.find("HalfCylinder_mO") != string::npos || currDir.find("HalfCylinder_pO") != string::npos) { binx = binx + 17; } if (currDir.find("Panel_1/Module_1") != string::npos) { @@ -3098,7 +2749,7 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, } else if (currDir.find("Panel_2/Module_1") != string::npos) { biny = 2; } - } // endif(isUpgrade) + } // endif(isUpgrade) } if (currDir.find("Layer_1") != string::npos) { @@ -3117,69 +2768,54 @@ void SiPixelActionExecutor::fillEfficiency(DQMStore::IBooker &iBooker, HitEfficiency_L4 = iGetter.get("Pixel/Barrel/HitEfficiency_L4"); if (HitEfficiency_L4) HitEfficiency_L4->setBinContent(binx, biny, (float)hitEfficiency); - } else if (currDir.find("Disk_1") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + } else if (currDir.find("Disk_1") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm1 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm1"); if (HitEfficiency_Dm1) - HitEfficiency_Dm1->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_2") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + HitEfficiency_Dm1->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_2") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm2 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm2"); if (HitEfficiency_Dm2) - HitEfficiency_Dm2->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_3") != string::npos && - currDir.find("HalfCylinder_m") != string::npos) { + HitEfficiency_Dm2->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_3") != string::npos && currDir.find("HalfCylinder_m") != string::npos) { HitEfficiency_Dm3 = iGetter.get("Pixel/Endcap/HitEfficiency_Dm3"); if (HitEfficiency_Dm3) - HitEfficiency_Dm3->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_1") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dm3->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_1") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp1 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp1"); if (HitEfficiency_Dp1) - HitEfficiency_Dp1->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_2") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dp1->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_2") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp2 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp2"); if (HitEfficiency_Dp2) - HitEfficiency_Dp2->setBinContent(binx, biny, - (float)hitEfficiency); - } else if (currDir.find("Disk_3") != string::npos && - currDir.find("HalfCylinder_p") != string::npos) { + HitEfficiency_Dp2->setBinContent(binx, biny, (float)hitEfficiency); + } else if (currDir.find("Disk_3") != string::npos && currDir.find("HalfCylinder_p") != string::npos) { HitEfficiency_Dp3 = iGetter.get("Pixel/Endcap/HitEfficiency_Dp3"); if (HitEfficiency_Dp3) - HitEfficiency_Dp3->setBinContent(binx, biny, - (float)hitEfficiency); + HitEfficiency_Dp3->setBinContent(binx, biny, (float)hitEfficiency); } } } } else { // cout<<"finding subdirs now"< subdirs = iGetter.getSubdirs(); - for (vector::const_iterator it = subdirs.begin(); - it != subdirs.end(); it++) { + for (vector::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) { iBooker.cd(*it); iGetter.cd(*it); if (*it != "Pixel" && - ((isbarrel && (*it).find("Barrel") == string::npos) || - (!isbarrel && (*it).find("Endcap") == string::npos))) + ((isbarrel && (*it).find("Barrel") == string::npos) || (!isbarrel && (*it).find("Endcap") == string::npos))) continue; fillEfficiency(iBooker, iGetter, isbarrel, isUpgrade); iBooker.goUp(); iGetter.setCurrentFolder(iBooker.pwd()); } } - } // end online/offline + } // end online/offline // cout<<"leaving SiPixelActionExecutor::fillEfficiency..."<> ignoreXBins = { - {-4, 2}, {4, 4, -1, -3, 3, -4, -3, -2, -1, -4, -3, -2, -1, 1, -4}, - {1, -4, 1}, {}, - {}, {}, - {}}; + {-4, 2}, {4, 4, -1, -3, 3, -4, -3, -2, -1, -4, -3, -2, -1, 1, -4}, {1, -4, 1}, {}, {}, {}, {}}; std::vector> ignoreYBins = { - {-9, -3}, {1, 16, 1, -13, -13, -5, -5, -5, -5, -6, -6, -6, -6, -8, -8}, - {3, 14, 6}, {}, - {}, {}, - {}}; + {-9, -3}, {1, 16, 1, -13, -13, -5, -5, -5, -5, -6, -6, -6, -6, -8, -8}, {3, 14, 6}, {}, {}, {}, {}}; for (int i = 0; i < 7; i++) { string subdetName = "Endcap/"; if (i < 3) subdetName = "Barrel/"; char meName[50]; - sprintf(meName, "Pixel/%sHitEfficiency_%s", subdetName.c_str(), - hitEfficiencyPostfix[i].c_str()); + sprintf(meName, "Pixel/%sHitEfficiency_%s", subdetName.c_str(), hitEfficiencyPostfix[i].c_str()); MonitorElement *tempHitEffMap = iGetter.get(meName); float totalEff = 0.; int totalBins = 0; diff --git a/DQM/SiPixelMonitorClient/src/SiPixelCertification.cc b/DQM/SiPixelMonitorClient/src/SiPixelCertification.cc index a1c00640a4109..429ba7b2dcd12 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelCertification.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelCertification.cc @@ -21,19 +21,18 @@ using namespace std; using namespace edm; SiPixelCertification::SiPixelCertification(const edm::ParameterSet &ps) { - edm::LogInfo("SiPixelCertification") - << "SiPixelCertification::Creating SiPixelCertification "; + edm::LogInfo("SiPixelCertification") << "SiPixelCertification::Creating SiPixelCertification "; firstLumi = true; } SiPixelCertification::~SiPixelCertification() { - edm::LogInfo("SiPixelCertification") - << "SiPixelCertification::Deleting SiPixelCertification "; + edm::LogInfo("SiPixelCertification") << "SiPixelCertification::Deleting SiPixelCertification "; } -void SiPixelCertification::dqmEndLuminosityBlock( - DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) { +void SiPixelCertification::dqmEndLuminosityBlock(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + const edm::LuminosityBlock &lumiBlock, + const edm::EventSetup &iSetup) { // cout<<"Entering SiPixelCertification::endLuminosityBlock: "<getFloatValue(); - float daqFrac = - (iGetter.getElement("Pixel/EventInfo/DAQSummary"))->getFloatValue(); - float dqmFrac = - (iGetter.getElement("Pixel/EventInfo/reportSummary"))->getFloatValue(); + float dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSSummary"))->getFloatValue(); + float daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQSummary"))->getFloatValue(); + float dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummary"))->getFloatValue(); float pixel_all = std::min(dcsFrac, daqFrac); pixel_all = std::min(pixel_all, dqmFrac); // std::cout<<"Pixel numbers: "<Fill(pixel_all); - dcsFrac = - (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelBarrelFraction")) - ->getFloatValue(); - daqFrac = - (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelBarrelFraction")) - ->getFloatValue(); - dqmFrac = (iGetter.getElement( - "Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction")) - ->getFloatValue(); + dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelBarrelFraction"))->getFloatValue(); + daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelBarrelFraction"))->getFloatValue(); + dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"))->getFloatValue(); float pixel_barrel = std::min(dcsFrac, daqFrac); pixel_barrel = std::min(pixel_barrel, dqmFrac); // std::cout<<"Barrel numbers: "<Fill(pixel_barrel); - dcsFrac = - (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelEndcapFraction")) - ->getFloatValue(); - daqFrac = - (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelEndcapFraction")) - ->getFloatValue(); - dqmFrac = (iGetter.getElement( - "Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction")) - ->getFloatValue(); + dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelEndcapFraction"))->getFloatValue(); + daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelEndcapFraction"))->getFloatValue(); + dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"))->getFloatValue(); float pixel_endcap = std::min(dcsFrac, daqFrac); pixel_endcap = std::min(pixel_endcap, dqmFrac); // std::cout<<"Endcap numbers: "<Fill(pixel_endcap); } -void SiPixelCertification::dqmEndJob(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter) { +void SiPixelCertification::dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) { // cout<<"Entering SiPixelCertification::endRun: "<getFloatValue(); - float daqFrac = - (iGetter.getElement("Pixel/EventInfo/DAQSummary"))->getFloatValue(); - float dqmFrac = - (iGetter.getElement("Pixel/EventInfo/reportSummary"))->getFloatValue(); + float dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSSummary"))->getFloatValue(); + float daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQSummary"))->getFloatValue(); + float dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummary"))->getFloatValue(); float pixel_all = std::min(dcsFrac, daqFrac); pixel_all = std::min(pixel_all, dqmFrac); // std::cout<<"Pixel numbers: "<Fill(pixel_all); - dcsFrac = - (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelBarrelFraction")) - ->getFloatValue(); - daqFrac = - (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelBarrelFraction")) - ->getFloatValue(); - dqmFrac = (iGetter.getElement( - "Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction")) - ->getFloatValue(); + dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelBarrelFraction"))->getFloatValue(); + daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelBarrelFraction"))->getFloatValue(); + dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"))->getFloatValue(); float pixel_barrel = std::min(dcsFrac, daqFrac); pixel_barrel = std::min(pixel_barrel, dqmFrac); // std::cout<<"Barrel numbers: "<Fill(pixel_barrel); - dcsFrac = - (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelEndcapFraction")) - ->getFloatValue(); - daqFrac = - (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelEndcapFraction")) - ->getFloatValue(); - dqmFrac = (iGetter.getElement( - "Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction")) - ->getFloatValue(); + dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelEndcapFraction"))->getFloatValue(); + daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelEndcapFraction"))->getFloatValue(); + dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"))->getFloatValue(); float pixel_endcap = std::min(dcsFrac, daqFrac); pixel_endcap = std::min(pixel_endcap, dqmFrac); // std::cout<<"Endcap numbers: "< &me_names) { +bool SiPixelConfigParser::getMENamesForTrackerMap(string &tkmap_name, vector &me_names) { if (!doc()) { cout << " SiPixelConfigParser::Configuration File is not set!!! " << endl; return false; } me_names.clear(); - unsigned int tkMapNodes = - doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->getLength(); + unsigned int tkMapNodes = doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->getLength(); if (tkMapNodes != 1) { - cout << ACYellow << ACBold - << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed - << ACBold << "No TkMap tag found in configuration file" << ACPlain - << endl; + cout << ACYellow << ACBold << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed << ACBold + << "No TkMap tag found in configuration file" << ACPlain << endl; return false; } /// Get Node - DOMNode *tkMapNode = - doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->item(0); + DOMNode *tkMapNode = doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->item(0); // Get QTEST name if (!tkMapNode) { - cout << ACYellow << ACBold - << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed - << ACBold << " No TkMap tag elements found in configuration file" - << ACPlain << endl; + cout << ACYellow << ACBold << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed << ACBold + << " No TkMap tag elements found in configuration file" << ACPlain << endl; return false; } DOMElement *tkMapElement = static_cast(tkMapNode); if (!tkMapElement) { - cout << ACYellow << ACBold - << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed - << ACBold << " No TkMap tag dom elements found in configuration file" - << ACPlain << endl; + cout << ACYellow << ACBold << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed << ACBold + << " No TkMap tag dom elements found in configuration file" << ACPlain << endl; return false; } - tkmap_name = - qtxml::_toString(tkMapElement->getAttribute(qtxml::_toDOMS("name"))); + tkmap_name = qtxml::_toString(tkMapElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - tkMapElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); + DOMNodeList *meList = tkMapElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); if (meList->getLength() == 0) { - cout << ACYellow << ACBold - << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed - << ACBold << " No MonElement found in configuration file" << ACPlain - << endl; + cout << ACYellow << ACBold << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed << ACBold + << " No MonElement found in configuration file" << ACPlain << endl; } for (unsigned int k = 0; k < meList->getLength(); k++) { DOMNode *meNode = meList->item(k); if (!meNode) { - cout << ACYellow << ACBold - << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed - << ACBold << " No MonElement item found in configuration file" - << ACPlain << endl; + cout << ACYellow << ACBold << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed << ACBold + << " No MonElement item found in configuration file" << ACPlain << endl; return false; } DOMElement *meElement = static_cast(meNode); if (!meElement) { - cout << ACYellow << ACBold - << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed - << ACBold - << " No MonElement sub-elements found in configuration file" - << ACPlain << endl; + cout << ACYellow << ACBold << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed << ACBold + << " No MonElement sub-elements found in configuration file" << ACPlain << endl; return false; } - string me_name = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string me_name = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(me_name); } if (me_names.empty()) { - cout << ACYellow << ACBold - << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed - << ACBold - << " No MonElement sub-element names found in configuration file" - << ACPlain << endl; + cout << ACYellow << ACBold << "[SiPixelConfigParser::getMENamesForTrackerMap()]" << ACRed << ACBold + << " No MonElement sub-element names found in configuration file" << ACPlain << endl; return false; } else { return true; @@ -113,13 +91,11 @@ bool SiPixelConfigParser::getFrequencyForTrackerMap(int &u_freq) { return false; } - unsigned int tkMapNodes = - doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->getLength(); + unsigned int tkMapNodes = doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->getLength(); if (tkMapNodes != 1) return false; /// Get Node - DOMNode *tkMapNode = - doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->item(0); + DOMNode *tkMapNode = doc()->getElementsByTagName(qtxml::_toDOMS("TkMap"))->item(0); // Get Node name if (!tkMapNode) return false; @@ -127,16 +103,13 @@ bool SiPixelConfigParser::getFrequencyForTrackerMap(int &u_freq) { if (!tkMapElement) return false; - u_freq = atoi(qtxml::_toString(tkMapElement->getAttribute( - qtxml::_toDOMS("update_frequency"))) - .c_str()); + u_freq = atoi(qtxml::_toString(tkMapElement->getAttribute(qtxml::_toDOMS("update_frequency"))).c_str()); return true; } // // -- Get List of MEs for the module tree plots: // -bool SiPixelConfigParser::getMENamesForTree(string &structure_name, - vector &me_names) { +bool SiPixelConfigParser::getMENamesForTree(string &structure_name, vector &me_names) { // cout<<"Entering SiPixelConfigParser::getMENamesForTree..."<getElementsByTagName(qtxml::_toDOMS("SubStructureLevel")) - ->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureLevel"))->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureLevel"))->item(0); // Get QTEST name if (!structureNode) return false; @@ -160,11 +129,9 @@ bool SiPixelConfigParser::getMENamesForTree(string &structure_name, if (!structureElement) return false; - structure_name = - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); + structure_name = qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); + DOMNodeList *meList = structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); for (unsigned int k = 0; k < meList->getLength(); k++) { DOMNode *meNode = meList->item(k); if (!meNode) @@ -172,8 +139,7 @@ bool SiPixelConfigParser::getMENamesForTree(string &structure_name, DOMElement *meElement = static_cast(meNode); if (!meElement) return false; - string me_name = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string me_name = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(me_name); } if (me_names.empty()) @@ -185,36 +151,27 @@ bool SiPixelConfigParser::getMENamesForTree(string &structure_name, // // -- Get List of MEs for the summary plot and the // -bool SiPixelConfigParser::getMENamesForBarrelSummary(string &structure_name, - vector &me_names) { +bool SiPixelConfigParser::getMENamesForBarrelSummary(string &structure_name, vector &me_names) { // cout<<"Entering SiPixelConfigParser::getMENamesForBarrelSummary..."<getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel")) - ->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel"))->item(0); // Get QTEST name if (!structureNode) return false; DOMElement *structureElement = static_cast(structureNode); if (!structureElement) return false; - structure_name = - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); + structure_name = qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); + DOMNodeList *meList = structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); for (unsigned int k = 0; k < meList->getLength(); k++) { DOMNode *meNode = meList->item(k); if (!meNode) @@ -222,8 +179,7 @@ bool SiPixelConfigParser::getMENamesForBarrelSummary(string &structure_name, DOMElement *meElement = static_cast(meNode); if (!meElement) return false; - string me_name = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string me_name = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(me_name); } // cout<<"...leaving SiPixelConfigParser::getMENamesForBarrelSummary!"< &me_names) { +bool SiPixelConfigParser::getMENamesForEndcapSummary(string &structure_name, vector &me_names) { // cout<<"Entering SiPixelConfigParser::getMENamesForEndcapSummary..."<getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel")) - ->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel"))->item(0); // Get QTEST name if (!structureNode) return false; @@ -259,11 +208,9 @@ bool SiPixelConfigParser::getMENamesForEndcapSummary(string &structure_name, if (!structureElement) return false; - structure_name = - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); + structure_name = qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); + DOMNodeList *meList = structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); for (unsigned int k = 0; k < meList->getLength(); k++) { DOMNode *meNode = meList->item(k); if (!meNode) @@ -271,8 +218,7 @@ bool SiPixelConfigParser::getMENamesForEndcapSummary(string &structure_name, DOMElement *meElement = static_cast(meNode); if (!meElement) return false; - string me_name = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string me_name = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(me_name); } if (me_names.empty()) @@ -282,8 +228,7 @@ bool SiPixelConfigParser::getMENamesForEndcapSummary(string &structure_name, // cout<<"...leaving SiPixelConfigParser::getMENamesForEndcapSummary!"< &me_names) { +bool SiPixelConfigParser::getMENamesForFEDErrorSummary(string &structure_name, vector &me_names) { // cout<<"Entering // SiPixelConfigParser::getMENamesForFEDErrorSummary..."<getElementsByTagName(qtxml::_toDOMS("SubStructureNonDetId")) - ->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureNonDetId"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureNonDetId")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureNonDetId"))->item(0); // Get QTEST name if (!structureNode) return false; @@ -310,11 +249,9 @@ bool SiPixelConfigParser::getMENamesForFEDErrorSummary( if (!structureElement) return false; - structure_name = - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); + structure_name = qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); + DOMNodeList *meList = structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); for (unsigned int k = 0; k < meList->getLength(); k++) { DOMNode *meNode = meList->item(k); if (!meNode) @@ -322,8 +259,7 @@ bool SiPixelConfigParser::getMENamesForFEDErrorSummary( DOMElement *meElement = static_cast(meNode); if (!meElement) return false; - string me_name = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string me_name = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(me_name); } if (me_names.empty()) @@ -342,17 +278,11 @@ bool SiPixelConfigParser::getFrequencyForBarrelSummary(int &u_freq) { return false; } - unsigned int structureNodes = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel")) - ->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureBarrelLevel"))->item(0); // Get Node name if (!structureNode) return false; @@ -360,9 +290,7 @@ bool SiPixelConfigParser::getFrequencyForBarrelSummary(int &u_freq) { if (!structureElement) return false; - u_freq = atoi(qtxml::_toString(structureElement->getAttribute( - qtxml::_toDOMS("update_frequency"))) - .c_str()); + u_freq = atoi(qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("update_frequency"))).c_str()); return true; } @@ -372,17 +300,11 @@ bool SiPixelConfigParser::getFrequencyForEndcapSummary(int &u_freq) { return false; } - unsigned int structureNodes = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel")) - ->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureEndcapLevel"))->item(0); // Get Node name if (!structureNode) return false; @@ -390,14 +312,11 @@ bool SiPixelConfigParser::getFrequencyForEndcapSummary(int &u_freq) { if (!structureElement) return false; - u_freq = atoi(qtxml::_toString(structureElement->getAttribute( - qtxml::_toDOMS("update_frequency"))) - .c_str()); + u_freq = atoi(qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("update_frequency"))).c_str()); return true; } -bool SiPixelConfigParser::getMENamesForGrandBarrelSummary( - string &structure_name, vector &me_names) { +bool SiPixelConfigParser::getMENamesForGrandBarrelSummary(string &structure_name, vector &me_names) { // cout<<"Entering // SiPixelConfigParser::getMENamesForGrandBarrelSummary..."<getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel")) - ->getLength(); + doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel"))->item(0); // Get QTEST name if (!structureNode) return false; @@ -424,11 +338,9 @@ bool SiPixelConfigParser::getMENamesForGrandBarrelSummary( if (!structureElement) return false; - structure_name = - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); + structure_name = qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); + DOMNodeList *meList = structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); for (unsigned int k = 0; k < meList->getLength(); k++) { DOMNode *meNode = meList->item(k); if (!meNode) @@ -436,8 +348,7 @@ bool SiPixelConfigParser::getMENamesForGrandBarrelSummary( DOMElement *meElement = static_cast(meNode); if (!meElement) return false; - string me_name = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string me_name = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(me_name); } if (me_names.empty()) @@ -448,8 +359,7 @@ bool SiPixelConfigParser::getMENamesForGrandBarrelSummary( // SiPixelConfigParser::getMENamesForGrandBarrelSummary!"< &me_names) { +bool SiPixelConfigParser::getMENamesForGrandEndcapSummary(string &structure_name, vector &me_names) { // cout<<"Entering // SiPixelConfigParser::getMENamesForGrandEndcapSummary..."<getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel")) - ->getLength(); + doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel"))->item(0); // Get QTEST name if (!structureNode) return false; @@ -476,11 +381,9 @@ bool SiPixelConfigParser::getMENamesForGrandEndcapSummary( if (!structureElement) return false; - structure_name = - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); + structure_name = qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); + DOMNodeList *meList = structureElement->getElementsByTagName(qtxml::_toDOMS("MonElement")); for (unsigned int k = 0; k < meList->getLength(); k++) { DOMNode *meNode = meList->item(k); if (!meNode) @@ -488,8 +391,7 @@ bool SiPixelConfigParser::getMENamesForGrandEndcapSummary( DOMElement *meElement = static_cast(meNode); if (!meElement) return false; - string me_name = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string me_name = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(me_name); } if (me_names.empty()) @@ -507,16 +409,11 @@ bool SiPixelConfigParser::getFrequencyForGrandBarrelSummary(int &u_freq) { } unsigned int structureNodes = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel")) - ->getLength(); + doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandBarrelLevel"))->item(0); // Get Node name if (!structureNode) return false; @@ -524,9 +421,7 @@ bool SiPixelConfigParser::getFrequencyForGrandBarrelSummary(int &u_freq) { if (!structureElement) return false; - u_freq = atoi(qtxml::_toString(structureElement->getAttribute( - qtxml::_toDOMS("update_frequency"))) - .c_str()); + u_freq = atoi(qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("update_frequency"))).c_str()); return true; } @@ -537,16 +432,11 @@ bool SiPixelConfigParser::getFrequencyForGrandEndcapSummary(int &u_freq) { } unsigned int structureNodes = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel")) - ->getLength(); + doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc() - ->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel")) - ->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SubStructureGrandEndcapLevel"))->item(0); // Get Node name if (!structureNode) return false; @@ -554,9 +444,7 @@ bool SiPixelConfigParser::getFrequencyForGrandEndcapSummary(int &u_freq) { if (!structureElement) return false; - u_freq = atoi(qtxml::_toString(structureElement->getAttribute( - qtxml::_toDOMS("update_frequency"))) - .c_str()); + u_freq = atoi(qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("update_frequency"))).c_str()); return true; } @@ -565,15 +453,11 @@ bool SiPixelConfigParser::getMessageLimitForQTests(int &u_freq) { cout << " SiPixelConfigParser::Configuration File is not set!!! " << endl; return false; } - unsigned int structureNodes = - doc() - ->getElementsByTagName(qtxml::_toDOMS("QTestMessageLimit")) - ->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("QTestMessageLimit"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc()->getElementsByTagName(qtxml::_toDOMS("QTestMessageLimit"))->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("QTestMessageLimit"))->item(0); // Get Node name if (!structureNode) return false; @@ -581,9 +465,7 @@ bool SiPixelConfigParser::getMessageLimitForQTests(int &u_freq) { if (!structureElement) return false; - u_freq = atoi( - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("value"))) - .c_str()); + u_freq = atoi(qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("value"))).c_str()); return true; } @@ -592,13 +474,11 @@ bool SiPixelConfigParser::getSourceType(int &u_freq) { cout << " SiPixelConfigParser::Configuration File is not set!!! " << endl; return false; } - unsigned int structureNodes = - doc()->getElementsByTagName(qtxml::_toDOMS("SourceType"))->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SourceType"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc()->getElementsByTagName(qtxml::_toDOMS("SourceType"))->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("SourceType"))->item(0); // Get Node name if (!structureNode) return false; @@ -606,9 +486,7 @@ bool SiPixelConfigParser::getSourceType(int &u_freq) { if (!structureElement) return false; - u_freq = atoi( - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("code"))) - .c_str()); + u_freq = atoi(qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("code"))).c_str()); return true; } @@ -617,13 +495,11 @@ bool SiPixelConfigParser::getCalibType(int &u_freq) { cout << " SiPixelConfigParser::Configuration File is not set!!! " << endl; return false; } - unsigned int structureNodes = - doc()->getElementsByTagName(qtxml::_toDOMS("CalibType"))->getLength(); + unsigned int structureNodes = doc()->getElementsByTagName(qtxml::_toDOMS("CalibType"))->getLength(); if (structureNodes == 0) return false; /// Get Node - DOMNode *structureNode = - doc()->getElementsByTagName(qtxml::_toDOMS("CalibType"))->item(0); + DOMNode *structureNode = doc()->getElementsByTagName(qtxml::_toDOMS("CalibType"))->item(0); // Get Node name if (!structureNode) return false; @@ -631,8 +507,6 @@ bool SiPixelConfigParser::getCalibType(int &u_freq) { if (!structureElement) return false; - u_freq = atoi( - qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("value"))) - .c_str()); + u_freq = atoi(qtxml::_toString(structureElement->getAttribute(qtxml::_toDOMS("value"))).c_str()); return true; } diff --git a/DQM/SiPixelMonitorClient/src/SiPixelConfigWriter.cc b/DQM/SiPixelMonitorClient/src/SiPixelConfigWriter.cc index 29c2c0f804976..4a9adfea94228 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelConfigWriter.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelConfigWriter.cc @@ -23,17 +23,14 @@ bool SiPixelConfigWriter::init() { cout << "Problem to initialise XML !!! " << endl; return false; } - unique_ptr domImpl( - DOMImplementationRegistry::getDOMImplementation(qtxml::_toDOMS("Range"))); + unique_ptr domImpl(DOMImplementationRegistry::getDOMImplementation(qtxml::_toDOMS("Range"))); if (domImpl == nullptr) return false; theDomWriter = domImpl->createLSSerializer(); if (theDomWriter == nullptr) return false; - if (theDomWriter->getDomConfig()->canSetParameter( - XMLUni::fgDOMWRTFormatPrettyPrint, true)) - theDomWriter->getDomConfig()->setParameter( - XMLUni::fgDOMWRTFormatPrettyPrint, true); + if (theDomWriter->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true)) + theDomWriter->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); theDoc = domImpl->createDocument(nullptr, qtxml::_toDOMS("Layouts"), nullptr); if (theDoc == nullptr) return false; @@ -66,7 +63,6 @@ void SiPixelConfigWriter::createRow() { // -- Add an Element with Children // void SiPixelConfigWriter::createColumn(string &element, string &name) { - theLastRow->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n"))); DOMElement *e1 = theDoc->createElement(qtxml::_toDOMS("column")); theLastRow->appendChild(e1); diff --git a/DQM/SiPixelMonitorClient/src/SiPixelDaqInfo.cc b/DQM/SiPixelMonitorClient/src/SiPixelDaqInfo.cc index cb0b802fbf497..b19c14e8cf607 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelDaqInfo.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelDaqInfo.cc @@ -9,11 +9,8 @@ using namespace std; using namespace edm; SiPixelDaqInfo::SiPixelDaqInfo(const edm::ParameterSet &ps) { - - FEDRange_.first = - ps.getUntrackedParameter("MinimumPixelFEDId", 0); - FEDRange_.second = - ps.getUntrackedParameter("MaximumPixelFEDId", 39); + FEDRange_.first = ps.getUntrackedParameter("MinimumPixelFEDId", 0); + FEDRange_.second = ps.getUntrackedParameter("MaximumPixelFEDId", 39); daqSource_ = ps.getUntrackedParameter("daqSource", "source"); NumberOfFeds_ = FEDRange_.second - FEDRange_.first + 1; @@ -25,16 +22,15 @@ SiPixelDaqInfo::SiPixelDaqInfo(const edm::ParameterSet &ps) { firstLumi = true; // set Token(-s) - daqSourceToken_ = consumes( - ps.getUntrackedParameter("daqSource", "source")); + daqSourceToken_ = consumes(ps.getUntrackedParameter("daqSource", "source")); } SiPixelDaqInfo::~SiPixelDaqInfo() {} -void SiPixelDaqInfo::dqmEndLuminosityBlock( - DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) { - +void SiPixelDaqInfo::dqmEndLuminosityBlock(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + const edm::LuminosityBlock &lumiBlock, + const edm::EventSetup &iSetup) { // Book somethings first time around if (firstLumi) { iBooker.setCurrentFolder("Pixel/EventInfo"); @@ -70,8 +66,7 @@ void SiPixelDaqInfo::dqmEndLuminosityBlock( } // Fill active fed fraction ME if (FedCountBarrel <= 32) { - MonitorElement *mefed = - iGetter.get("Pixel/EventInfo/DAQContents/fedcounter"); + MonitorElement *mefed = iGetter.get("Pixel/EventInfo/DAQContents/fedcounter"); FedCountBarrel = 0; FedCountEndcap = 0; FedCount = 0; @@ -107,5 +102,4 @@ void SiPixelDaqInfo::dqmEndLuminosityBlock( } } -void SiPixelDaqInfo::dqmEndJob(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter) {} +void SiPixelDaqInfo::dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) {} diff --git a/DQM/SiPixelMonitorClient/src/SiPixelDataQuality.cc b/DQM/SiPixelMonitorClient/src/SiPixelDataQuality.cc index 080a5cfb83514..494a896704800 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelDataQuality.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelDataQuality.cc @@ -54,7 +54,7 @@ #include #include -#include // for free() - Root can allocate with malloc() - sigh... +#include // for free() - Root can allocate with malloc() - sigh... #include using namespace std; @@ -64,8 +64,7 @@ using namespace edm; /*! \brief Constructor of the SiPixelInformationExtractor class. * */ -SiPixelDataQuality::SiPixelDataQuality(bool offlineXMLfile) - : offlineXMLfile_(offlineXMLfile) { +SiPixelDataQuality::SiPixelDataQuality(bool offlineXMLfile) : offlineXMLfile_(offlineXMLfile) { edm::LogInfo("SiPixelDataQuality") << " Creating SiPixelDataQuality " << "\n"; @@ -130,40 +129,32 @@ int SiPixelDataQuality::getDetId(MonitorElement *mE) { ///////////////////////////////////////////////////////////////////////////////////////////////////// -void SiPixelDataQuality::bookGlobalQualityFlag(DQMStore::IBooker &iBooker, - bool Tier0Flag, int nFEDs) { +void SiPixelDataQuality::bookGlobalQualityFlag(DQMStore::IBooker &iBooker, bool Tier0Flag, int nFEDs) { // std::cout<<"BOOK GLOBAL QUALITY FLAG MEs!"<setAxisTitle("Lumi Section", 1); SummaryReportMap->setAxisTitle("Pixel FED #", 2); allmodsVec = new TH1D("allmodsVec", "allmodsVec", 40, 0., 40.); errmodsVec = new TH1D("errmodsVec", "errmodsVec", 40, 0., 40.); goodmodsVec = new TH1D("goodmodsVec", "goodmodsVec", 40, 0., 40.); } else { - SummaryReportMap = iBooker.book2D("reportSummaryMap", "Pixel Summary Map", - 2, 0., 2., 7, 0., 7.); + SummaryReportMap = iBooker.book2D("reportSummaryMap", "Pixel Summary Map", 2, 0., 2., 7, 0., 7.); SummaryReportMap->setBinLabel(1, "Barrel", 1); SummaryReportMap->setBinLabel(2, "Endcaps", 1); SummaryReportMap->setBinLabel(1, "Errors", 2); @@ -287,10 +278,8 @@ void SiPixelDataQuality::bookGlobalQualityFlag(DQMStore::IBooker &iBooker, //********************************************************************************************** -void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter, - bool init, int nFEDs, - bool Tier0Flag) { +void SiPixelDataQuality::computeGlobalQualityFlag( + DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag) { if (init) { allMods_ = 0; errorMods_ = 0; @@ -307,11 +296,9 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, endcap_error_flag_ = 0.; n_errors_pixel_ = 0; pixel_error_flag_ = 0.; - digiStatsBarrel = false, clusterStatsBarrel = false, - trackStatsBarrel = false; + digiStatsBarrel = false, clusterStatsBarrel = false, trackStatsBarrel = false; digiCounterBarrel = 0, clusterCounterBarrel = 0, trackCounterBarrel = 0; - digiStatsEndcap = false, clusterStatsEndcap = false, - trackStatsEndcap = false; + digiStatsEndcap = false, clusterStatsEndcap = false, trackStatsEndcap = false; digiCounterEndcap = 0, clusterCounterEndcap = 0, trackCounterEndcap = 0; init = false; } @@ -322,9 +309,7 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, string dname = currDir.substr(currDir.find_last_of("/") + 1); if ((!Tier0Flag && dname.find("Module_") != string::npos) || - (Tier0Flag && (dname.find("Ladder_") != string::npos || - dname.find("Blade_") != string::npos))) { - + (Tier0Flag && (dname.find("Ladder_") != string::npos || dname.find("Blade_") != string::npos))) { objectCount_++; if (currDir.find("Pixel") != string::npos) @@ -334,8 +319,7 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, if (currDir.find("Endcap") != string::npos) endcapMods_++; vector meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); it != meVec.end(); - it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); if (full_path.find("ndigis_") != string::npos) { MonitorElement *me = iGetter.get(full_path); @@ -347,8 +331,7 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, if (full_path.find("Endcap") != string::npos) digiCounterEndcap++; } - } else if (Tier0Flag && - full_path.find("nclusters_OnTrack_") != string::npos) { + } else if (Tier0Flag && full_path.find("nclusters_OnTrack_") != string::npos) { MonitorElement *me = iGetter.get(full_path); if (!me) continue; @@ -372,8 +355,7 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, } } vector subDirVec = iGetter.getSubdirs(); - for (vector::const_iterator ic = subDirVec.begin(); - ic != subDirVec.end(); ic++) { + for (vector::const_iterator ic = subDirVec.begin(); ic != subDirVec.end(); ic++) { iGetter.cd(*ic); iBooker.cd(*ic); init = false; @@ -383,42 +365,33 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, } // Make sure I have finished looping over all Modules/Ladders/Blades: - if (!Tier0Flag) { // online case + if (!Tier0Flag) { // online case if (objectCount_ == 1440) DONE_ = true; - } else { // offline case + } else { // offline case if (objectCount_ == 288) DONE_ = true; } if (DONE_ && currDir == "Pixel/EventInfo/reportSummaryContents") { - // Evaluate error flag now, only stored in AdditionalPixelErrors: - MonitorElement *me_err = - iGetter.get("Pixel/AdditionalPixelErrors/FedETypeNErr"); + MonitorElement *me_err = iGetter.get("Pixel/AdditionalPixelErrors/FedETypeNErr"); MonitorElement *me_evt = iGetter.get("Pixel/EventInfo/processedEvents"); if (me_err && me_evt) { for (int i = 1; i != 41; i++) for (int j = 1; j != 22; j++) if (me_err->getBinContent(i, j) > 0) { - n_errors_pixel_ = - n_errors_pixel_ + int(me_err->getBinContent(i, j)); + n_errors_pixel_ = n_errors_pixel_ + int(me_err->getBinContent(i, j)); if (i < 33) - n_errors_barrel_ = - n_errors_barrel_ + int(me_err->getBinContent(i, j)); + n_errors_barrel_ = n_errors_barrel_ + int(me_err->getBinContent(i, j)); if (i > 32) - n_errors_endcap_ = - n_errors_endcap_ + int(me_err->getBinContent(i, j)); + n_errors_endcap_ = n_errors_endcap_ + int(me_err->getBinContent(i, j)); } int NProcEvts = me_evt->getIntValue(); if (NProcEvts > 0) { - barrel_error_flag_ = - (float(NProcEvts) - float(n_errors_barrel_)) / float(NProcEvts); - endcap_error_flag_ = - (float(NProcEvts) - float(n_errors_endcap_)) / float(NProcEvts); - pixel_error_flag_ = (float(NProcEvts) - float(n_errors_barrel_) - - float(n_errors_endcap_)) / - float(NProcEvts); + barrel_error_flag_ = (float(NProcEvts) - float(n_errors_barrel_)) / float(NProcEvts); + endcap_error_flag_ = (float(NProcEvts) - float(n_errors_endcap_)) / float(NProcEvts); + pixel_error_flag_ = (float(NProcEvts) - float(n_errors_barrel_) - float(n_errors_endcap_)) / float(NProcEvts); } } NErrorsBarrel = iGetter.get("Pixel/Barrel/BarrelNErrorsCut"); @@ -712,12 +685,10 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, SummaryPixel = iGetter.get("Pixel/EventInfo/reportSummary"); if (SummaryPixel) SummaryPixel->Fill(pixelFlag); - SummaryBarrel = iGetter.get( - "Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"); + SummaryBarrel = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"); if (SummaryBarrel) SummaryBarrel->Fill(barrelFlag); - SummaryEndcap = iGetter.get( - "Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"); + SummaryEndcap = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"); if (SummaryEndcap) SummaryEndcap->Fill(endcapFlag); } @@ -725,9 +696,13 @@ void SiPixelDataQuality::computeGlobalQualityFlag(DQMStore::IBooker &iBooker, //********************************************************************************************** -void SiPixelDataQuality::computeGlobalQualityFlagByLumi( - DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag, - int nEvents_lastLS_, int nErrorsBarrel_lastLS_, int nErrorsEndcap_lastLS_) { +void SiPixelDataQuality::computeGlobalQualityFlagByLumi(DQMStore::IGetter &iGetter, + bool init, + int nFEDs, + bool Tier0Flag, + int nEvents_lastLS_, + int nErrorsBarrel_lastLS_, + int nErrorsEndcap_lastLS_) { if (nFEDs == 0) return; @@ -752,16 +727,13 @@ void SiPixelDataQuality::computeGlobalQualityFlagByLumi( float BarrelClusterCharge = 1.; float EndcapClusterCharge = 1.; float PixelClusterCharge = 1.; - MonitorElement *me1 = - iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters_Barrel"); + MonitorElement *me1 = iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters_Barrel"); if (me1 && me1->getMean() < 12.) BarrelClusterCharge = 0.; - MonitorElement *me2 = - iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters_Endcap"); + MonitorElement *me2 = iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters_Endcap"); if (me2 && me2->getMean() < 12.) EndcapClusterCharge = 0.; - MonitorElement *me3 = - iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters"); + MonitorElement *me3 = iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters"); if (me3 && me3->getMean() < 12.) PixelClusterCharge = 0.; @@ -793,11 +765,9 @@ void SiPixelDataQuality::computeGlobalQualityFlagByLumi( } meanBarrelOcc = meanBarrelOcc / 32.; meanEndcapOcc = meanEndcapOcc / 8.; - if (minBarrelOcc < 0.1 * meanBarrelOcc || - maxBarrelOcc > 2.5 * meanBarrelOcc) + if (minBarrelOcc < 0.1 * meanBarrelOcc || maxBarrelOcc > 2.5 * meanBarrelOcc) BarrelOccupancy = 0.; - if (minEndcapOcc < 0.2 * meanEndcapOcc || - maxEndcapOcc > 1.8 * meanEndcapOcc) + if (minEndcapOcc < 0.2 * meanEndcapOcc || maxEndcapOcc > 1.8 * meanEndcapOcc) EndcapOccupancy = 0.; PixelOccupancy = BarrelOccupancy * EndcapOccupancy; } @@ -808,22 +778,23 @@ void SiPixelDataQuality::computeGlobalQualityFlagByLumi( SummaryPixel = iGetter.get("Pixel/EventInfo/reportSummary"); if (SummaryPixel) SummaryPixel->Fill(pixelFlag); - SummaryBarrel = - iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"); + SummaryBarrel = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"); if (SummaryBarrel) SummaryBarrel->Fill(barrelFlag); - SummaryEndcap = - iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"); + SummaryEndcap = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"); if (SummaryEndcap) SummaryEndcap->Fill(endcapFlag); } //********************************************************************************************** -void SiPixelDataQuality::fillGlobalQualityPlot( - DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, - edm::ESHandle theCablingMap, int nFEDs, - bool Tier0Flag, int lumisec) { +void SiPixelDataQuality::fillGlobalQualityPlot(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + bool init, + edm::ESHandle theCablingMap, + int nFEDs, + bool Tier0Flag, + int lumisec) { // std::cout<<"Entering SiPixelDataQuality::fillGlobalQualityPlot: // "<setBinContent(bin, content); } for (int j = 0; j < 4; ++j) { - static const char buf[] = - "Pixel/Barrel/NClustertoChargeRatio_NormMod%i"; + static const char buf[] = "Pixel/Barrel/NClustertoChargeRatio_NormMod%i"; char modplot[sizeof(buf) + 2]; sprintf(modplot, buf, j + 1); MonitorElement *meFinal = iGetter.get(modplot); @@ -927,23 +895,20 @@ void SiPixelDataQuality::fillGlobalQualityPlot( } string currDir = iBooker.pwd(); - if (currDir.find("Reference") != string::npos || - currDir.find("Additional") != string::npos) + if (currDir.find("Reference") != string::npos || currDir.find("Additional") != string::npos) return; string dname = currDir.substr(currDir.find_last_of("/") + 1); - if (dname.find("Module_") != string::npos && - currDir.find("Reference") == string::npos) { + if (dname.find("Module_") != string::npos && currDir.find("Reference") == string::npos) { vector meVec = iGetter.getMEs(); int detId = -1; int fedId = -1; for (vector::const_iterator it = meVec.begin(); it != meVec.end(); - it++) { // loop over all modules and fill ndigis into allmodsMap + it++) { // loop over all modules and fill ndigis into allmodsMap // checking for any digis or FED errors to decide if this module is in // DAQ: string full_path = currDir + "/" + (*it); if (detId == -1 && full_path.find("SUMOFF") == string::npos && - (full_path.find("ndigis") != string::npos && - full_path.find("SUMDIG") == string::npos) && + (full_path.find("ndigis") != string::npos && full_path.find("SUMDIG") == string::npos) && (getDetId(iGetter.get(full_path)) > 100)) { MonitorElement *me = iGetter.get(full_path); if (!me) @@ -966,16 +931,14 @@ void SiPixelDataQuality::fillGlobalQualityPlot( allmodsVec->SetBinContent(fedId + 1, weight); } } - } // end loop over MEs - } // end of module dir's + } // end loop over MEs + } // end of module dir's vector subDirVec = iGetter.getSubdirs(); - for (vector::const_iterator ic = subDirVec.begin(); - ic != subDirVec.end(); ic++) { + for (vector::const_iterator ic = subDirVec.begin(); ic != subDirVec.end(); ic++) { iBooker.cd(*ic); iGetter.cd(*ic); init = false; - fillGlobalQualityPlot(iBooker, iGetter, init, theCablingMap, nFEDs, - Tier0Flag, lumisec); + fillGlobalQualityPlot(iBooker, iGetter, init, theCablingMap, nFEDs, Tier0Flag, lumisec); iBooker.goUp(); iGetter.setCurrentFolder(iBooker.pwd()); } @@ -983,12 +946,11 @@ void SiPixelDataQuality::fillGlobalQualityPlot( iBooker.cd("Pixel/EventInfo/reportSummaryContents"); iGetter.cd("Pixel/EventInfo/reportSummaryContents"); if (iBooker.pwd() == "Pixel/EventInfo/reportSummaryContents") { - for (int i = 0; i != 40; i++) { // loop over FEDs to fetch the errors - static const char buf[] = - "Pixel/AdditionalPixelErrors/FED_%d/FedChNErr"; + for (int i = 0; i != 40; i++) { // loop over FEDs to fetch the errors + static const char buf[] = "Pixel/AdditionalPixelErrors/FED_%d/FedChNErr"; char fedplot[sizeof(buf) + 4]; int NErrors = 0; - for (int j = 0; j != 37; j++) { // loop over FED channels within a FED + for (int j = 0; j != 37; j++) { // loop over FED channels within a FED sprintf(fedplot, buf, i); MonitorElement *me = iGetter.get(fedplot); if (me) @@ -1016,11 +978,11 @@ void SiPixelDataQuality::fillGlobalQualityPlot( contents = -0.5; } SummaryReportMap->setBinContent(lumisec + 1, i, contents); - } // end for loop over summaryReportMap bins - } // end if reportSummaryMap ME exists - } // end if in summary directory - } // end if modCounter_ - } else { // Offline + } // end for loop over summaryReportMap bins + } // end if reportSummaryMap ME exists + } // end if in summary directory + } // end if modCounter_ + } else { // Offline float barrel_errors_temp[1] = {-1.}; int barrel_cuts_temp[6] = {6 * -1}; float endcap_errors_temp[1] = {-1.}; @@ -1075,7 +1037,7 @@ void SiPixelDataQuality::fillGlobalQualityPlot( pixel_cuts_temp[0] = me->getIntValue(); SummaryReportMap->setBinContent(1, 7, pixel_cuts_temp[0]); SummaryReportMap->setBinContent(2, 7, pixel_cuts_temp[0]); - } // end of offline map + } // end of offline map if (allmodsMap) allmodsMap->Clear(); if (goodmodsMap) diff --git a/DQM/SiPixelMonitorClient/src/SiPixelDcsInfo.cc b/DQM/SiPixelMonitorClient/src/SiPixelDcsInfo.cc index cfb5beee49e19..be2c5ddcd74f5 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelDcsInfo.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelDcsInfo.cc @@ -10,10 +10,10 @@ SiPixelDcsInfo::SiPixelDcsInfo(const edm::ParameterSet &ps) { firstRun = true; } SiPixelDcsInfo::~SiPixelDcsInfo() {} -void SiPixelDcsInfo::dqmEndLuminosityBlock( - DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, - const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) { - +void SiPixelDcsInfo::dqmEndLuminosityBlock(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + const edm::LuminosityBlock &lumiBlock, + const edm::EventSetup &iSetup) { if (firstRun) { iBooker.setCurrentFolder("Pixel/EventInfo"); Fraction_ = iBooker.bookFloat("DCSSummary"); @@ -33,7 +33,6 @@ void SiPixelDcsInfo::dqmEndLuminosityBlock( } } -void SiPixelDcsInfo::dqmEndJob(DQMStore::IBooker &iBooker, - DQMStore::IGetter &iGetter) { +void SiPixelDcsInfo::dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) { // Nothing actually happened in the old endJob/endRun, so this is left empty. } diff --git a/DQM/SiPixelMonitorClient/src/SiPixelEDAClient.cc b/DQM/SiPixelMonitorClient/src/SiPixelEDAClient.cc index 5e84a4bd27541..5801b3a6e5855 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelEDAClient.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelEDAClient.cc @@ -56,30 +56,21 @@ SiPixelEDAClient::SiPixelEDAClient(const edm::ParameterSet &ps) { edm::LogInfo("SiPixelEDAClient") << " Creating SiPixelEDAClient " << "\n"; - summaryFrequency_ = - ps.getUntrackedParameter("SummaryCreationFrequency", 20); + summaryFrequency_ = ps.getUntrackedParameter("SummaryCreationFrequency", 20); tkMapFrequency_ = ps.getUntrackedParameter("TkMapCreationFrequency", 50); - staticUpdateFrequency_ = - ps.getUntrackedParameter("StaticUpdateFrequency", 10); - actionOnLumiSec_ = - ps.getUntrackedParameter("ActionOnLumiSection", false); // client - actionOnRunEnd_ = - ps.getUntrackedParameter("ActionOnRunEnd", true); // client - evtOffsetForInit_ = - ps.getUntrackedParameter("EventOffsetForInit", 10); // client - offlineXMLfile_ = - ps.getUntrackedParameter("UseOfflineXMLFile", false); // client + staticUpdateFrequency_ = ps.getUntrackedParameter("StaticUpdateFrequency", 10); + actionOnLumiSec_ = ps.getUntrackedParameter("ActionOnLumiSection", false); // client + actionOnRunEnd_ = ps.getUntrackedParameter("ActionOnRunEnd", true); // client + evtOffsetForInit_ = ps.getUntrackedParameter("EventOffsetForInit", 10); // client + offlineXMLfile_ = ps.getUntrackedParameter("UseOfflineXMLFile", false); // client hiRes_ = ps.getUntrackedParameter("HighResolutionOccupancy", - false); // client - noiseRate_ = - ps.getUntrackedParameter("NoiseRateCutValue", 0.001); // client - noiseRateDenominator_ = ps.getUntrackedParameter( - "NEventsForNoiseCalculation", 100000); // client - Tier0Flag_ = ps.getUntrackedParameter("Tier0Flag", false); // client - doHitEfficiency_ = - ps.getUntrackedParameter("DoHitEfficiency", true); // client + false); // client + noiseRate_ = ps.getUntrackedParameter("NoiseRateCutValue", 0.001); // client + noiseRateDenominator_ = ps.getUntrackedParameter("NEventsForNoiseCalculation", 100000); // client + Tier0Flag_ = ps.getUntrackedParameter("Tier0Flag", false); // client + doHitEfficiency_ = ps.getUntrackedParameter("DoHitEfficiency", true); // client inputSource_ = ps.getUntrackedParameter("inputSource", "source"); - isUpgrade_ = ps.getUntrackedParameter("isUpgrade", false); // client + isUpgrade_ = ps.getUntrackedParameter("isUpgrade", false); // client if (!Tier0Flag_) { string localPath = string("DQM/SiPixelMonitorClient/test/loader.html"); @@ -92,7 +83,7 @@ SiPixelEDAClient::SiPixelEDAClient(const edm::ParameterSet &ps) { return; } - while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character + while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character html_out_ << buf; } fin.close(); @@ -101,14 +92,11 @@ SiPixelEDAClient::SiPixelEDAClient(const edm::ParameterSet &ps) { firstLumi = true; // instantiate the three work horses of the client: - sipixelInformationExtractor_ = - new SiPixelInformationExtractor(offlineXMLfile_); - sipixelActionExecutor_ = - new SiPixelActionExecutor(offlineXMLfile_, Tier0Flag_); + sipixelInformationExtractor_ = new SiPixelInformationExtractor(offlineXMLfile_); + sipixelActionExecutor_ = new SiPixelActionExecutor(offlineXMLfile_, Tier0Flag_); sipixelDataQuality_ = new SiPixelDataQuality(offlineXMLfile_); - inputSourceToken_ = consumes( - ps.getUntrackedParameter("inputSource", "source")); + inputSourceToken_ = consumes(ps.getUntrackedParameter("inputSource", "source")); // cout<<"...leaving SiPixelEDAClient::SiPixelEDAClient. "<bookOccupancyPlots(iBooker, iGetter, hiRes_); // Booking noisy pixel ME's: if (noiseRate_ > 0.) - sipixelInformationExtractor_->bookNoisyPixels(iBooker, noiseRate_, - Tier0Flag_); + sipixelInformationExtractor_->bookNoisyPixels(iBooker, noiseRate_, Tier0Flag_); // Booking summary report ME's: sipixelDataQuality_->bookGlobalQualityFlag(iBooker, Tier0Flag_, nFEDs_); if (!Tier0Flag_) { - MonitorElement *mefed = - iGetter.get("Pixel/EventInfo/DAQContents/fedcounter"); + MonitorElement *mefed = iGetter.get("Pixel/EventInfo/DAQContents/fedcounter"); if (mefed) { for (int i = 0; i < mefed->getNbinsX(); ++i) nFEDs_ += mefed->getBinContent(i + 1); @@ -223,46 +208,38 @@ void SiPixelEDAClient::dqmEndLuminosityBlock( firstLumi = false; } - edm::LogInfo("SiPixelEDAClient") - << "[SiPixelEDAClient]: End of LS transition, performing the DQM client " - "operation"; + edm::LogInfo("SiPixelEDAClient") << "[SiPixelEDAClient]: End of LS transition, performing the DQM client " + "operation"; // nLumiSecs_ = lumiSeg.id().luminosityBlock(); /// std::cout << "NEW LUMISECTION n " << nLumiSecs_ << std::endl; // nLumiSecs_++; - edm::LogInfo("SiPixelEDAClient") - << "====================================================== " << endl - << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() - << endl - << "====================================================== " << endl; + edm::LogInfo("SiPixelEDAClient") << "====================================================== " << endl + << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << endl + << "====================================================== " << endl; if (Tier0Flag_) - sipixelActionExecutor_->normaliseAvDigiOccVsLumi(iBooker, iGetter, - nLumiSecs_); + sipixelActionExecutor_->normaliseAvDigiOccVsLumi(iBooker, iGetter, nLumiSecs_); bool init = true; if (actionOnLumiSec_ && nLumiSecs_ % 1 == 0) { - if (doHitEfficiency_) sipixelActionExecutor_->createEfficiency(iBooker, iGetter, isUpgrade_); sipixelActionExecutor_->createOccupancy(iBooker, iGetter); iBooker.cd(); iGetter.cd(); sipixelDataQuality_->computeGlobalQualityFlagByLumi( - iGetter, init, nFEDs_, Tier0Flag_, nEvents_lastLS_, - nErrorsBarrel_lastLS_, nErrorsEndcap_lastLS_); + iGetter, init, nFEDs_, Tier0Flag_, nEvents_lastLS_, nErrorsBarrel_lastLS_, nErrorsEndcap_lastLS_); init = true; iBooker.cd(); iGetter.cd(); - sipixelDataQuality_->fillGlobalQualityPlot( - iBooker, iGetter, init, theCablingMap, nFEDs_, Tier0Flag_, nLumiSecs_); + sipixelDataQuality_->fillGlobalQualityPlot(iBooker, iGetter, init, theCablingMap, nFEDs_, Tier0Flag_, nLumiSecs_); init = true; if (noiseRate_ >= 0.) sipixelInformationExtractor_->findNoisyPixels( - iBooker, iGetter, init, noiseRate_, noiseRateDenominator_, - theCablingMap); + iBooker, iGetter, init, noiseRate_, noiseRateDenominator_, theCablingMap); } // cout<<"...leaving SiPixelEDAClient::endLuminosityBlock. "<createSummary(iBooker, iGetter, isUpgrade_); if (actionOnRunEnd_) { - // sipixelActionExecutor_->createSummary(iBooker, iGetter, isUpgrade_); if (doHitEfficiency_) { @@ -294,18 +269,15 @@ void SiPixelEDAClient::dqmEndJob(DQMStore::IBooker &iBooker, iBooker.cd(); iGetter.cd(); bool init = true; - sipixelDataQuality_->computeGlobalQualityFlag(iBooker, iGetter, init, - nFEDs_, Tier0Flag_); + sipixelDataQuality_->computeGlobalQualityFlag(iBooker, iGetter, init, nFEDs_, Tier0Flag_); init = true; iBooker.cd(); iGetter.cd(); - sipixelDataQuality_->fillGlobalQualityPlot( - iBooker, iGetter, init, theCablingMap, nFEDs_, Tier0Flag_, nLumiSecs_); + sipixelDataQuality_->fillGlobalQualityPlot(iBooker, iGetter, init, theCablingMap, nFEDs_, Tier0Flag_, nLumiSecs_); init = true; if (noiseRate_ >= 0.) sipixelInformationExtractor_->findNoisyPixels( - iBooker, iGetter, init, noiseRate_, noiseRateDenominator_, - theCablingMap); + iBooker, iGetter, init, noiseRate_, noiseRateDenominator_, theCablingMap); } } diff --git a/DQM/SiPixelMonitorClient/src/SiPixelInformationExtractor.cc b/DQM/SiPixelMonitorClient/src/SiPixelInformationExtractor.cc index bb96fce5a2cdc..44680fd749bac 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelInformationExtractor.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelInformationExtractor.cc @@ -56,7 +56,7 @@ #include #include -#include // for free() - Root can allocate with malloc() - sigh... +#include // for free() - Root can allocate with malloc() - sigh... using namespace std; using namespace edm; @@ -65,11 +65,9 @@ using namespace edm; /*! \brief Constructor of the SiPixelInformationExtractor class. * */ -SiPixelInformationExtractor::SiPixelInformationExtractor(bool offlineXMLfile) - : offlineXMLfile_(offlineXMLfile) { - edm::LogInfo("SiPixelInformationExtractor") - << " Creating SiPixelInformationExtractor " - << "\n"; +SiPixelInformationExtractor::SiPixelInformationExtractor(bool offlineXMLfile) : offlineXMLfile_(offlineXMLfile) { + edm::LogInfo("SiPixelInformationExtractor") << " Creating SiPixelInformationExtractor " + << "\n"; readReference_ = false; } @@ -79,9 +77,8 @@ SiPixelInformationExtractor::SiPixelInformationExtractor(bool offlineXMLfile) * */ SiPixelInformationExtractor::~SiPixelInformationExtractor() { - edm::LogInfo("SiPixelInformationExtractor") - << " Deleting SiPixelInformationExtractor " - << "\n"; + edm::LogInfo("SiPixelInformationExtractor") << " Deleting SiPixelInformationExtractor " + << "\n"; } //------------------------------------------------------------------------------ @@ -110,12 +107,11 @@ std::string SiPixelInformationExtractor::getMEType(MonitorElement *theMe) { * * This method */ -void SiPixelInformationExtractor::getItemList( - const multimap &req_map, string item_name, - vector &items) { +void SiPixelInformationExtractor::getItemList(const multimap &req_map, + string item_name, + vector &items) { items.clear(); - for (multimap::const_iterator it = req_map.begin(); - it != req_map.end(); it++) { + for (multimap::const_iterator it = req_map.begin(); it != req_map.end(); it++) { if (it->first == item_name) { items.push_back(it->second); } @@ -127,8 +123,7 @@ void SiPixelInformationExtractor::getItemList( * * This method */ -bool SiPixelInformationExtractor::hasItem(multimap &req_map, - string item_name) { +bool SiPixelInformationExtractor::hasItem(multimap &req_map, string item_name) { multimap::iterator pos = req_map.find(item_name); if (pos != req_map.end()) return true; @@ -140,21 +135,18 @@ bool SiPixelInformationExtractor::hasItem(multimap &req_map, * * This method */ -std::string SiPixelInformationExtractor::getItemValue( - const std::multimap &req_map, - std::string item_name) { - std::multimap::const_iterator pos = - req_map.find(item_name); +std::string SiPixelInformationExtractor::getItemValue(const std::multimap &req_map, + std::string item_name) { + std::multimap::const_iterator pos = req_map.find(item_name); std::string value = " "; if (pos != req_map.end()) { value = pos->second; } return value; } -std::string SiPixelInformationExtractor::getItemValue( - std::multimap &req_map, std::string item_name) { - std::multimap::iterator pos = - req_map.find(item_name); +std::string SiPixelInformationExtractor::getItemValue(std::multimap &req_map, + std::string item_name) { + std::multimap::iterator pos = req_map.find(item_name); std::string value = " "; if (pos != req_map.end()) { value = pos->second; @@ -180,12 +172,10 @@ void SiPixelInformationExtractor::selectColor(string &col, int status) { // // -- Get Image name from ME // -void SiPixelInformationExtractor::selectColor(string &col, - vector &reports) { +void SiPixelInformationExtractor::selectColor(string &col, vector &reports) { int istat = 999; int status = 0; - for (vector::const_iterator it = reports.begin(); - it != reports.end(); it++) { + for (vector::const_iterator it = reports.begin(); it != reports.end(); it++) { status = (*it)->getStatus(); if (status > istat) istat = status; @@ -210,12 +200,10 @@ void SiPixelInformationExtractor::selectImage(string &name, int status) { // // -- Get Image name from ME // -void SiPixelInformationExtractor::selectImage(string &name, - vector &reports) { +void SiPixelInformationExtractor::selectImage(string &name, vector &reports) { int istat = 999; int status = 0; - for (vector::const_iterator it = reports.begin(); - it != reports.end(); it++) { + for (vector::const_iterator it = reports.begin(); it != reports.end(); it++) { status = (*it)->getStatus(); if (status > istat) istat = status; @@ -227,9 +215,7 @@ void SiPixelInformationExtractor::selectImage(string &name, /*! \brief (Documentation under construction). * */ -void SiPixelInformationExtractor::computeStatus(MonitorElement *theME, - double &colorValue, - pair &norm) { +void SiPixelInformationExtractor::computeStatus(MonitorElement *theME, double &colorValue, pair &norm) { double normalizationX = 1; double normalizationY = 1; double meanX = 0; @@ -302,9 +288,10 @@ void SiPixelInformationExtractor::getNormalization(MonitorElement *theME, /*! \brief (Documentation under construction). * */ -void SiPixelInformationExtractor::getNormalization2D( - MonitorElement *theME, pair &normX, - pair &normY, std::string theMEType) { +void SiPixelInformationExtractor::getNormalization2D(MonitorElement *theME, + pair &normX, + pair &normY, + std::string theMEType) { double normLow = 0; double normHigh = 0; @@ -339,23 +326,17 @@ int SiPixelInformationExtractor::getDetId(MonitorElement *mE) { ///////////////////////////////////////////////////////////////////////////////////////////////////// -void SiPixelInformationExtractor::bookNoisyPixels(DQMStore::IBooker &iBooker, - float noiseRate_, - bool Tier0Flag) { +void SiPixelInformationExtractor::bookNoisyPixels(DQMStore::IBooker &iBooker, float noiseRate_, bool Tier0Flag) { // std::cout<<"BOOK NOISY PIXEL MEs!"<= 0.) { iBooker.setCurrentFolder("Pixel/Barrel"); - EventRateBarrelPixels = - iBooker.book1D("barrelEventRate", - "Digi event rate for all Barrel pixels", 1000, 0., 0.01); + EventRateBarrelPixels = iBooker.book1D("barrelEventRate", "Digi event rate for all Barrel pixels", 1000, 0., 0.01); EventRateBarrelPixels->setAxisTitle("Event Rate", 1); EventRateBarrelPixels->setAxisTitle("Number of Pixels", 2); iBooker.cd(); iBooker.setCurrentFolder("Pixel/Endcap"); - EventRateEndcapPixels = - iBooker.book1D("endcapEventRate", - "Digi event rate for all Endcap pixels", 1000, 0., 0.01); + EventRateEndcapPixels = iBooker.book1D("endcapEventRate", "Digi event rate for all Endcap pixels", 1000, 0., 0.01); EventRateEndcapPixels->setAxisTitle("Event Rate", 1); EventRateEndcapPixels->setAxisTitle("Number of Pixels", 2); } @@ -363,11 +344,12 @@ void SiPixelInformationExtractor::bookNoisyPixels(DQMStore::IBooker &iBooker, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void SiPixelInformationExtractor::findNoisyPixels( - DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, - float noiseRate_, int noiseRateDenominator_, - edm::ESHandle theCablingMap) { - +void SiPixelInformationExtractor::findNoisyPixels(DQMStore::IBooker &iBooker, + DQMStore::IGetter &iGetter, + bool init, + float noiseRate_, + int noiseRateDenominator_, + edm::ESHandle theCablingMap) { if (init) { endOfModules_ = false; nevents_ = noiseRateDenominator_; @@ -376,22 +358,19 @@ void SiPixelInformationExtractor::findNoisyPixels( iGetter.cd(); iBooker.setCurrentFolder("Pixel/EventInfo"); iGetter.setCurrentFolder("Pixel/EventInfo"); - nevents_ = - (iGetter.get("Pixel/EventInfo/processedEvents"))->getIntValue(); + nevents_ = (iGetter.get("Pixel/EventInfo/processedEvents"))->getIntValue(); } iBooker.cd(); iGetter.cd(); myfile_.open("NoisyPixelList.txt", ios::app); - myfile_ << "Noise summary, ran over " << nevents_ - << " events, threshold was set to " << noiseRate_ << std::endl; + myfile_ << "Noise summary, ran over " << nevents_ << " events, threshold was set to " << noiseRate_ << std::endl; } string currDir = iBooker.pwd(); string dname = currDir.substr(currDir.find_last_of("/") + 1); if (dname.find("Module_") != string::npos) { vector meVec = iGetter.getMEs(); - for (vector::const_iterator it = meVec.begin(); it != meVec.end(); - it++) { + for (vector::const_iterator it = meVec.begin(); it != meVec.end(); it++) { string full_path = currDir + "/" + (*it); if (full_path.find("hitmap_siPixelDigis") != string::npos) { MonitorElement *me = iGetter.get(full_path); @@ -407,13 +386,11 @@ void SiPixelInformationExtractor::findNoisyPixels( for (int j = 1; j != hothisto->GetNbinsY() + 1; j++) { float value = (hothisto->GetBinContent(i, j)) / float(nevents_); if (me->getPathname().find("Barrel") != string::npos) { - EventRateBarrelPixels = - iGetter.get("Pixel/Barrel/barrelEventRate"); + EventRateBarrelPixels = iGetter.get("Pixel/Barrel/barrelEventRate"); if (EventRateBarrelPixels) EventRateBarrelPixels->Fill(value); } else if (me->getPathname().find("Endcap") != string::npos) { - EventRateEndcapPixels = - iGetter.get("Pixel/Endcap/endcapEventRate"); + EventRateEndcapPixels = iGetter.get("Pixel/Endcap/endcapEventRate"); if (EventRateEndcapPixels) EventRateEndcapPixels->Fill(value); } @@ -422,8 +399,7 @@ void SiPixelInformationExtractor::findNoisyPixels( pixrow = j - 1; std::pair address(pixcol, pixrow); - std::pair, float> PixelStats(address, - value); + std::pair, float> PixelStats(address, value); noisyPixelsInModule.push_back(PixelStats); } } @@ -434,15 +410,13 @@ void SiPixelInformationExtractor::findNoisyPixels( } } vector subDirVec = iGetter.getSubdirs(); - for (vector::const_iterator ic = subDirVec.begin(); - ic != subDirVec.end(); ic++) { + for (vector::const_iterator ic = subDirVec.begin(); ic != subDirVec.end(); ic++) { if ((*ic).find("AdditionalPixelErrors") != string::npos) continue; iGetter.cd(*ic); iBooker.cd(*ic); init = false; - findNoisyPixels(iBooker, iGetter, init, noiseRate_, noiseRateDenominator_, - theCablingMap); + findNoisyPixels(iBooker, iGetter, init, noiseRate_, noiseRateDenominator_, theCablingMap); iBooker.goUp(); iGetter.setCurrentFolder(iBooker.pwd()); } @@ -466,13 +440,12 @@ void SiPixelInformationExtractor::findNoisyPixels( int n_verynoisyrocs_endcap = 0; for (int fid = 0; fid < 40; fid++) { - for (std::map, float>>>:: - const_iterator it = noisyDetIds_.begin(); - it != noisyDetIds_.end(); it++) { + for (std::map, float>>>::const_iterator it = + noisyDetIds_.begin(); + it != noisyDetIds_.end(); + it++) { uint32_t detid = (*it).first; - std::vector, float>> noisyPixels = - (*it).second; + std::vector, float>> noisyPixels = (*it).second; // now convert into online conventions: for (int fedid = 0; fedid <= 40; ++fedid) { SiPixelFrameConverter converter(theCablingMap.product(), fedid); @@ -489,10 +462,10 @@ void SiPixelInformationExtractor::findNoisyPixels( uint32_t detSubId = detId.subdetId(); std::string outputname; bool HalfModule = false; - if (detSubId == 2) { // FPIX + if (detSubId == 2) { // FPIX PixelEndcapName nameworker(detid); outputname = nameworker.name(); - } else if (detSubId == 1) { // BPIX + } else if (detSubId == 1) { // BPIX PixelBarrelName nameworker(detid); outputname = nameworker.name(); HalfModule = nameworker.isHalfModule(); @@ -504,10 +477,9 @@ void SiPixelInformationExtractor::findNoisyPixels( myfedmap[detid] = realfedID; mynamemap[detid] = outputname; - for (std::vector< - std::pair, float>>::const_iterator pxl = - noisyPixels.begin(); - pxl != noisyPixels.end(); pxl++) { + for (std::vector, float>>::const_iterator pxl = noisyPixels.begin(); + pxl != noisyPixels.end(); + pxl++) { std::pair offlineaddress = (*pxl).first; float Noise_frac = (*pxl).second; int offlineColumn = offlineaddress.first; @@ -516,8 +488,7 @@ void SiPixelInformationExtractor::findNoisyPixels( sipixelobjects::ElectronicIndex cabling; SiPixelFrameConverter formatter(theCablingMap.product(), realfedID); - sipixelobjects::DetectorIndex detector = {detid, offlineRow, - offlineColumn}; + sipixelobjects::DetectorIndex detector = {detid, offlineRow, offlineColumn}; formatter.toCabling(cabling, detector); // cabling should now contain cabling.roc and cabling.dcol and // cabling.pxid however, the coordinates now need to be converted @@ -531,12 +502,10 @@ void SiPixelInformationExtractor::findNoisyPixels( assert(realfedID >= 0); assert(cabling.link >= 0); assert(cabling.roc >= 0); - sipixelobjects::CablingPathToDetUnit path = { - static_cast(realfedID), - static_cast(cabling.link), - static_cast(cabling.roc)}; - const sipixelobjects::PixelROC *theRoc = - theCablingMap->findItem(path); + sipixelobjects::CablingPathToDetUnit path = {static_cast(realfedID), + static_cast(cabling.link), + static_cast(cabling.roc)}; + const sipixelobjects::PixelROC *theRoc = theCablingMap->findItem(path); // END of FIX int onlineColumn = locpixel.rocCol(); @@ -550,25 +519,19 @@ void SiPixelInformationExtractor::findNoisyPixels( int rocnumber = -1; - if ((detSubId == 1) && - (outputname.find("mO") != string::npos || - outputname.find("mI") != string::npos) && + if ((detSubId == 1) && (outputname.find("mO") != string::npos || outputname.find("mI") != string::npos) && (HalfModule)) { rocnumber = theRoc->idInDetUnit() + 8; } else { rocnumber = theRoc->idInDetUnit(); } - myfile_ << "NAME: " << outputname << " , DETID: " << detid - << " , OFFLINE: col,row: " << offlineColumn << "," - << offlineRow << " \t , ONLINE: roc,col,row: " << rocnumber - << "," << onlineColumn << "," << onlineRow - << " \t , fed,dcol,pixid,link: " << realfedID << "," - << loc.dcol << "," << loc.pxid << "," << cabling.link - << ", Noise fraction: " << Noise_frac << std::endl; + myfile_ << "NAME: " << outputname << " , DETID: " << detid << " , OFFLINE: col,row: " << offlineColumn + << "," << offlineRow << " \t , ONLINE: roc,col,row: " << rocnumber << "," << onlineColumn << "," + << onlineRow << " \t , fed,dcol,pixid,link: " << realfedID << "," << loc.dcol << "," << loc.pxid + << "," << cabling.link << ", Noise fraction: " << Noise_frac << std::endl; } - for (std::map::const_iterator nrc = myrocmap.begin(); - nrc != myrocmap.end(); nrc++) { + for (std::map::const_iterator nrc = myrocmap.begin(); nrc != myrocmap.end(); nrc++) { if ((*nrc).second > 0) { n_noisyrocs_all++; if (detSubId == 2) { @@ -592,13 +555,12 @@ void SiPixelInformationExtractor::findNoisyPixels( myfile_ << "There are " << n_noisyrocs_all << " noisy ROCs (ROCs with at least 1 noisy pixel) in the entire " "detector. " - << n_noisyrocs_endcap << " are in the FPIX and " - << n_noisyrocs_barrel << " are in the BPIX. " << endl; + << n_noisyrocs_endcap << " are in the FPIX and " << n_noisyrocs_barrel << " are in the BPIX. " << endl; myfile_ << "There are " << n_verynoisyrocs_all << " highly noisy ROCs (ROCs with at least 10% of all pixels " "passing the noise threshold) in the entire detector. " - << n_verynoisyrocs_endcap << " are in the FPIX and " - << n_verynoisyrocs_barrel << " are in the BPIX. " << endl; + << n_verynoisyrocs_endcap << " are in the FPIX and " << n_verynoisyrocs_barrel << " are in the BPIX. " + << endl; } myfile_.close(); return; diff --git a/DQM/SiPixelMonitorClient/src/SiPixelLayoutParser.cc b/DQM/SiPixelMonitorClient/src/SiPixelLayoutParser.cc index 47eae4d2875de..3337da1d66bc6 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelLayoutParser.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelLayoutParser.cc @@ -32,8 +32,7 @@ bool SiPixelLayoutParser::getAllLayouts(map> &layouts) { layouts.clear(); - DOMNodeList *layoutList = - doc()->getElementsByTagName(qtxml::_toDOMS("layout")); + DOMNodeList *layoutList = doc()->getElementsByTagName(qtxml::_toDOMS("layout")); unsigned int nlayout = layoutList->getLength(); if (nlayout == 0) @@ -47,11 +46,9 @@ bool SiPixelLayoutParser::getAllLayouts(map> &layouts) { DOMElement *layoutElement = static_cast(layoutNode); if (!layoutElement) return false; - string layoutName = - qtxml::_toString(layoutElement->getAttribute(qtxml::_toDOMS("name"))); + string layoutName = qtxml::_toString(layoutElement->getAttribute(qtxml::_toDOMS("name"))); - DOMNodeList *meList = - layoutElement->getElementsByTagName(qtxml::_toDOMS("monitorable")); + DOMNodeList *meList = layoutElement->getElementsByTagName(qtxml::_toDOMS("monitorable")); vector me_names; for (unsigned int l = 0; l < meList->getLength(); l++) { DOMNode *meNode = meList->item(l); @@ -60,8 +57,7 @@ bool SiPixelLayoutParser::getAllLayouts(map> &layouts) { DOMElement *meElement = static_cast(meNode); if (!meElement) return false; - string meName = - qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); + string meName = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name"))); me_names.push_back(meName); } if (!me_names.empty()) diff --git a/DQM/SiPixelMonitorClient/src/SiPixelUtility.cc b/DQM/SiPixelMonitorClient/src/SiPixelUtility.cc index bbb5119888e0d..ffc654ff0069e 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelUtility.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelUtility.cc @@ -21,8 +21,7 @@ int SiPixelUtility::getMEList(string name, vector &values) { // // Get a list of MEs in a folder and the path name // -int SiPixelUtility::getMEList(string name, string &dir_path, - vector &values) { +int SiPixelUtility::getMEList(string name, string &dir_path, vector &values) { values.clear(); dir_path = name.substr(0, (name.find(":"))); dir_path += "/"; @@ -52,8 +51,7 @@ bool SiPixelUtility::checkME(string name, string me_name, string &full_path) { // -- Split a given string into a number of strings using given // delimiters and fill a vector with splitted strings // -void SiPixelUtility::split(const string &str, vector &tokens, - const string &delimiters) { +void SiPixelUtility::split(const string &str, vector &tokens, const string &delimiters) { // Skip delimiters at beginning. string::size_type lastPos = str.find_first_not_of(delimiters, 0); @@ -74,8 +72,7 @@ void SiPixelUtility::split(const string &str, vector &tokens, // // -- Get Color code from Status // -void SiPixelUtility::getStatusColor(int status, int &rval, int &gval, - int &bval) { +void SiPixelUtility::getStatusColor(int status, int &rval, int &gval, int &bval) { if (status == dqm::qstatus::STATUS_OK) { rval = 0; gval = 255; @@ -122,8 +119,7 @@ void SiPixelUtility::getStatusColor(int status, int &icol, string &tag) { // // -- Get Color code from Status // -void SiPixelUtility::getStatusColor(double status, int &rval, int &gval, - int &bval) { +void SiPixelUtility::getStatusColor(double status, int &rval, int &gval, int &bval) { rval = SiPixelContinuousPalette::r[(int)(status * 100)]; gval = SiPixelContinuousPalette::g[(int)(status * 100)]; bval = SiPixelContinuousPalette::b[(int)(status * 100)]; @@ -155,16 +151,16 @@ vector SiPixelUtility::getQTestNameList(MonitorElement *me) { int SiPixelUtility::computeErrorCode(int status) { int code = 0; switch (status) { - case dqm::qstatus::INSUF_STAT: - code = 1; - break; - case dqm::qstatus::WARNING: - code = 2; - break; - case dqm::qstatus::ERROR: - code = 3; - break; - } // end switch + case dqm::qstatus::INSUF_STAT: + code = 1; + break; + case dqm::qstatus::WARNING: + code = 2; + break; + case dqm::qstatus::ERROR: + code = 3; + break; + } // end switch return code; } @@ -174,25 +170,24 @@ int SiPixelUtility::computeErrorCode(DQMStore *bei, string &module_path) { int code = -1; switch (status) { - case dqm::qstatus::STATUS_OK: - code = 0; - break; - case dqm::qstatus::INSUF_STAT: - code = 1; - break; - case dqm::qstatus::WARNING: - code = 2; - break; - case dqm::qstatus::ERROR: - code = 3; - break; - } // end of switch + case dqm::qstatus::STATUS_OK: + code = 0; + break; + case dqm::qstatus::INSUF_STAT: + code = 1; + break; + case dqm::qstatus::WARNING: + code = 2; + break; + case dqm::qstatus::ERROR: + code = 3; + break; + } // end of switch return code; } int SiPixelUtility::computeHistoBin(string &module_path) { - int module_bin = 0; int module = 0; @@ -216,14 +211,11 @@ int SiPixelUtility::computeHistoBin(string &module_path) { vector subDirVector; SiPixelUtility::split(module_path, subDirVector, "/"); - for (vector::const_iterator it = subDirVector.begin(); - it != subDirVector.end(); it++) { + for (vector::const_iterator it = subDirVector.begin(); it != subDirVector.end(); it++) { if ((*it).find("Collector") != string::npos || //(*it).find("Collated") != string::npos || - (*it).find("FU") != string::npos || - (*it).find("Pixel") != string::npos || - (*it).find("Barrel") != string::npos || - (*it).find("Endcap") != string::npos) + (*it).find("FU") != string::npos || (*it).find("Pixel") != string::npos || + (*it).find("Barrel") != string::npos || (*it).find("Endcap") != string::npos) continue; if ((*it).find("Module") != string::npos) { @@ -280,12 +272,11 @@ int SiPixelUtility::computeHistoBin(string &module_path) { } } if (module_path.find("Barrel") != string::npos) { - module_bin = module + (ladder - 1) * nbinLadder + nbinLayer + - (shell - 1) * nbinShell; + module_bin = module + (ladder - 1) * nbinLadder + nbinLayer + (shell - 1) * nbinShell; } if (module_path.find("Endcap") != string::npos) { - module_bin = module + (panel - 1) * nbinPanel + (blade - 1) * nbinBlade + - (disk - 1) * nbinDisk + (halfcylinder - 1) * nbinHalfcylinder; + module_bin = module + (panel - 1) * nbinPanel + (blade - 1) * nbinBlade + (disk - 1) * nbinDisk + + (halfcylinder - 1) * nbinHalfcylinder; } return module_bin; @@ -293,12 +284,9 @@ int SiPixelUtility::computeHistoBin(string &module_path) { // cout << "leaving SiPixelInformationExtractor::computeHistoBin" << endl; } -void SiPixelUtility::fillPaveText( - TPaveText *pave, const map> &messages) { - +void SiPixelUtility::fillPaveText(TPaveText *pave, const map> &messages) { TText *sourceCodeOnCanvas; - for (map>::const_iterator it = messages.begin(); - it != messages.end(); it++) { + for (map>::const_iterator it = messages.begin(); it != messages.end(); it++) { string message = it->first; int color = (it->second).first; double size = (it->second).second; @@ -310,40 +298,38 @@ void SiPixelUtility::fillPaveText( } map SiPixelUtility::sourceCodeMap() { - map sourceCode; for (int iSource = 0; iSource < 5; iSource++) { string type; string code; switch (iSource) { - case 0: - type = "RAW"; - code = "1 "; - break; - case 1: - type = "DIG"; - code = "10 "; - break; - case 2: - type = "CLU"; - code = "100 "; - break; - case 3: - type = "TRK"; - code = "1000 "; - break; - case 4: - type = "REC"; - code = "10000"; - break; - } // end of switch + case 0: + type = "RAW"; + code = "1 "; + break; + case 1: + type = "DIG"; + code = "10 "; + break; + case 2: + type = "CLU"; + code = "100 "; + break; + case 3: + type = "TRK"; + code = "1000 "; + break; + case 4: + type = "REC"; + code = "10000"; + break; + } // end of switch sourceCode[type] = code; } return sourceCode; } -void SiPixelUtility::createStatusLegendMessages( - map> &messages) { +void SiPixelUtility::createStatusLegendMessages(map> &messages) { for (int iStatus = 1; iStatus < 5; iStatus++) { pair color_size; int color = 1; @@ -352,27 +338,27 @@ void SiPixelUtility::createStatusLegendMessages( string type; color_size.second = size; switch (iStatus) { - case 1: - code = "1"; - type = "INSUF_STAT"; - color = kBlue; - break; - case 2: - code = "2"; - type = "WARNING(S)"; - color = kYellow; - break; - case 3: - code = "3"; - type = "ERROR(S) "; - color = kRed; - break; - case 4: - code = "4"; - type = "ERRORS "; - color = kMagenta; - break; - } // end of switch + case 1: + code = "1"; + type = "INSUF_STAT"; + color = kBlue; + break; + case 2: + code = "2"; + type = "WARNING(S)"; + color = kYellow; + break; + case 3: + code = "3"; + type = "ERROR(S) "; + color = kRed; + break; + case 4: + code = "4"; + type = "ERRORS "; + color = kMagenta; + break; + } // end of switch string messageString = code + ": " + type; color_size.first = color; messages[messageString] = color_size; diff --git a/DQM/SiStripMonitorSummary/interface/SiStripApvGainsDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripApvGainsDQM.h index 9613618907229..46c87bc558e6e 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripApvGainsDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripApvGainsDQM.h @@ -9,9 +9,9 @@ #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h" class SiStripApvGainsDQM : public SiStripBaseCondObjDQM { - public: - SiStripApvGainsDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripApvGainsDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); @@ -19,17 +19,13 @@ class SiStripApvGainsDQM : public SiStripBaseCondObjDQM { void getActiveDetIds(const edm::EventSetup &eSetup) override; - void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; - void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; + void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; + void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override; + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override; void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override; unsigned long long getCache(const edm::EventSetup &eSetup) override { return eSetup.get().cacheIdentifier(); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripBackPlaneCorrectionDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripBackPlaneCorrectionDQM.h index ccb756c5aa6c8..332ba0a5d1e83 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripBackPlaneCorrectionDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripBackPlaneCorrectionDQM.h @@ -7,7 +7,6 @@ #include "CondFormats/SiStripObjects/interface/SiStripBackPlaneCorrection.h" class SiStripBackPlaneCorrectionDQM : public SiStripBaseCondObjDQM { - public: SiStripBackPlaneCorrectionDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, @@ -18,16 +17,12 @@ class SiStripBackPlaneCorrectionDQM : public SiStripBaseCondObjDQM { void getActiveDetIds(const edm::EventSetup &eSetup) override; - void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override{}; - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override{}; + void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override{}; + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override{}; - void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; + void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override; unsigned long long getCache(const edm::EventSetup &eSetup) override { return eSetup.get().cacheIdentifier(); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripBaseCondObjDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripBaseCondObjDQM.h index 117fcdb22fff7..fda3d2b72dbfb 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripBaseCondObjDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripBaseCondObjDQM.h @@ -25,7 +25,7 @@ #include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" #include "CommonTools/TrackerMap/interface/TrackerMap.h" -#include "DQM/SiStripCommon/interface/TkHistoMap.h" /// ADDITON OF TK_HISTO_MAP +#include "DQM/SiStripCommon/interface/TkHistoMap.h" /// ADDITON OF TK_HISTO_MAP #include "CommonTools/UtilAlgos/interface/DetIdSelector.h" @@ -36,9 +36,9 @@ class TrackerTopology; class SiStripBaseCondObjDQM { - public: - SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); @@ -48,15 +48,14 @@ class SiStripBaseCondObjDQM { void analysis(const edm::EventSetup &eSetup_); void analysisOnDemand(const edm::EventSetup &eSetup_, uint32_t detIdOnDemand); - void analysisOnDemand(const edm::EventSetup &eSetup_, - const std::vector &detIdsOnDemand); + void analysisOnDemand(const edm::EventSetup &eSetup_, const std::vector &detIdsOnDemand); void analysisOnDemand(const edm::EventSetup &eSetup_, std::string requestedSubDetector, - uint32_t requestedSide, uint32_t requestedLayer); + uint32_t requestedSide, + uint32_t requestedLayer); std::vector getCabledModules(); - void selectModules(std::vector &detIds_, - const TrackerTopology *tTopo); + void selectModules(std::vector &detIds_, const TrackerTopology *tTopo); // virtual void fillTopSummaryMEs()=0; @@ -68,8 +67,10 @@ class SiStripBaseCondObjDQM { protected: struct ModMEs { ModMEs() - : ProfileDistr(nullptr), CumulDistr(nullptr), - SummaryOfProfileDistr(nullptr), SummaryOfCumulDistr(nullptr), + : ProfileDistr(nullptr), + CumulDistr(nullptr), + SummaryOfProfileDistr(nullptr), + SummaryOfCumulDistr(nullptr), SummaryDistr(nullptr) { ; } @@ -80,27 +81,19 @@ class SiStripBaseCondObjDQM { MonitorElement *SummaryDistr; }; - void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, - const TrackerTopology *tTopo); - void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, - const TrackerTopology *tTopo); - std::pair - getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo); - std::pair - getStringNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo); - std::vector - GetSameLayerDetId(const std::vector &activeDetIds, - uint32_t selDetId, const TrackerTopology *tTopo); - - virtual void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es); - virtual void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es); - virtual void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) = 0; + void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo); + void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo); + std::pair getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo); + std::pair getStringNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo); + std::vector GetSameLayerDetId(const std::vector &activeDetIds, + uint32_t selDetId, + const TrackerTopology *tTopo); + + virtual void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es); + virtual void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es); + virtual void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) = 0; virtual void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) = 0; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) = 0; void fillTkMap(const uint32_t &detid, const float &value); @@ -137,23 +130,19 @@ class SiStripBaseCondObjDQM { TrackerMap *tkMap; private: - void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, - const uint32_t &detId_, const TrackerTopology *tTopo); - void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, - const uint32_t &detId_, const TrackerTopology *tTopo); + void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo); + void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo); void bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo); void bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo); - void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, - const uint32_t &detId_, const TrackerTopology *tTopo); + void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo); void bookTkMap(const std::string &TkMapname); - void saveTkMap(const std::string &TkMapname, double minValue, - double maxValue); + void saveTkMap(const std::string &TkMapname, double minValue, double maxValue); std::vector ModulesToBeExcluded_; std::vector ModulesToBeIncluded_; diff --git a/DQM/SiStripMonitorSummary/interface/SiStripCablingDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripCablingDQM.h index 9232cc851bf26..47264994ddffe 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripCablingDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripCablingDQM.h @@ -12,30 +12,20 @@ #include "FWCore/Framework/interface/ESHandle.h" class SiStripCablingDQM : public SiStripBaseCondObjDQM { - public: - SiStripCablingDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripCablingDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); ~SiStripCablingDQM() override; - void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override { - ; - } - void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override { - ; - } + void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override { ; } + void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override { ; } - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override { - ; - } + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override { ; } void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override { + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override { ; } diff --git a/DQM/SiStripMonitorSummary/interface/SiStripClassToMonitorCondData.h b/DQM/SiStripMonitorSummary/interface/SiStripClassToMonitorCondData.h index bb1f2f69e7014..c3469d756697e 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripClassToMonitorCondData.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripClassToMonitorCondData.h @@ -38,7 +38,6 @@ class SiStripCablingDQM; class SiStripThresholdDQM; class SiStripClassToMonitorCondData { - public: explicit SiStripClassToMonitorCondData(edm::ParameterSet const &iConfig); @@ -50,11 +49,11 @@ class SiStripClassToMonitorCondData { void endRun(edm::EventSetup const &eSetup); void endJob(); - void getModMEsOnDemand(edm::EventSetup const &eSetup, - uint32_t requestedDetId); + void getModMEsOnDemand(edm::EventSetup const &eSetup, uint32_t requestedDetId); void getLayerMEsOnDemand(edm::EventSetup const &eSetup, std::string requestedSubDetector, - uint32_t requestedSide, uint32_t requestedLayer); + uint32_t requestedSide, + uint32_t requestedLayer); private: edm::ParameterSet conf_; diff --git a/DQM/SiStripMonitorSummary/interface/SiStripLorentzAngleDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripLorentzAngleDQM.h index 73976223c4e4b..7ac7fa9402aec 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripLorentzAngleDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripLorentzAngleDQM.h @@ -7,9 +7,9 @@ #include "CondFormats/SiStripObjects/interface/SiStripLorentzAngle.h" class SiStripLorentzAngleDQM : public SiStripBaseCondObjDQM { - public: - SiStripLorentzAngleDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripLorentzAngleDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); @@ -17,16 +17,12 @@ class SiStripLorentzAngleDQM : public SiStripBaseCondObjDQM { void getActiveDetIds(const edm::EventSetup &eSetup) override; - void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override{}; - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override{}; + void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override{}; + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override{}; - void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; + void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override; unsigned long long getCache(const edm::EventSetup &eSetup) override { return eSetup.get().cacheIdentifier(); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondData.h b/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondData.h index de7f37c740b5d..87fb67d5bf97a 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondData.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondData.h @@ -39,7 +39,6 @@ class SiStripBackPlaneCorrectionDQM; class SiStripCablingDQM; class SiStripMonitorCondData : public edm::EDAnalyzer { - public: explicit SiStripMonitorCondData(const edm::ParameterSet &); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondDataOnDemandExample.h b/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondDataOnDemandExample.h index 7f3a8e4871a48..e90cdfe72b587 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondDataOnDemandExample.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripMonitorCondDataOnDemandExample.h @@ -29,7 +29,6 @@ class SiStripClassToMonitorCondData; class SiStripMonitorCondDataOnDemandExample : public edm::EDAnalyzer { - public: explicit SiStripMonitorCondDataOnDemandExample(const edm::ParameterSet &); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripNoisesDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripNoisesDQM.h index e96c2c7f0a2ae..43ad1f727caf0 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripNoisesDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripNoisesDQM.h @@ -9,9 +9,9 @@ #include "CondFormats/SiStripObjects/interface/SiStripNoises.h" class SiStripNoisesDQM : public SiStripBaseCondObjDQM { - public: - SiStripNoisesDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripNoisesDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); @@ -19,11 +19,9 @@ class SiStripNoisesDQM : public SiStripBaseCondObjDQM { void getActiveDetIds(const edm::EventSetup &eSetup) override; - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override; + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override; void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override; unsigned long long getCache(const edm::EventSetup &eSetup) override { return eSetup.get().cacheIdentifier(); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripPedestalsDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripPedestalsDQM.h index 7564927b7e2b6..23083e655be36 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripPedestalsDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripPedestalsDQM.h @@ -7,9 +7,9 @@ #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h" class SiStripPedestalsDQM : public SiStripBaseCondObjDQM { - public: - SiStripPedestalsDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripPedestalsDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); @@ -17,16 +17,12 @@ class SiStripPedestalsDQM : public SiStripBaseCondObjDQM { void getActiveDetIds(const edm::EventSetup &eSetup) override; - void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; - void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; + void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; + void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override; + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override; void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override; unsigned long long getCache(const edm::EventSetup &eSetup) override { return eSetup.get().cacheIdentifier(); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripQualityDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripQualityDQM.h index 95cabe90f5bed..173618bbd618b 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripQualityDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripQualityDQM.h @@ -22,9 +22,9 @@ #include "CalibTracker/Records/interface/SiStripQualityRcd.h" class SiStripQualityDQM : public SiStripBaseCondObjDQM { - public: - SiStripQualityDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripQualityDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); @@ -32,16 +32,12 @@ class SiStripQualityDQM : public SiStripBaseCondObjDQM { void getActiveDetIds(const edm::EventSetup &eSetup) override; - void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override; + void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override; - void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; + void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override; void fillGrandSummaryMEs(const edm::EventSetup &eSetup); unsigned long long getCache(const edm::EventSetup &eSetup) override { @@ -56,7 +52,7 @@ class SiStripQualityDQM : public SiStripBaseCondObjDQM { private: std::string qualityLabel_; edm::ESHandle qualityHandle_; - int NTkBadComponent[4]; // k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips + int NTkBadComponent[4]; // k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips int NBadComponent[4][19][4]; std::stringstream ssV[4][19]; void SetBadComponents(int i, int component, SiStripQuality::BadComponent &BC); diff --git a/DQM/SiStripMonitorSummary/interface/SiStripThresholdDQM.h b/DQM/SiStripMonitorSummary/interface/SiStripThresholdDQM.h index abc76035a322a..5c4273d669f9b 100644 --- a/DQM/SiStripMonitorSummary/interface/SiStripThresholdDQM.h +++ b/DQM/SiStripMonitorSummary/interface/SiStripThresholdDQM.h @@ -7,9 +7,9 @@ #include "CondFormats/SiStripObjects/interface/SiStripThreshold.h" class SiStripThresholdDQM : public SiStripBaseCondObjDQM { - public: - SiStripThresholdDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, + SiStripThresholdDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet); @@ -17,16 +17,12 @@ class SiStripThresholdDQM : public SiStripBaseCondObjDQM { void getActiveDetIds(const edm::EventSetup &eSetup) override; - void fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; - void fillSummaryMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) override; + void fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; + void fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) override; - void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, - const TrackerTopology *tTopo) override; + void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override; void fillMEsForLayer( - /*std::map selModMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) override; + /*std::map selModMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) override; unsigned long long getCache(const edm::EventSetup &eSetup) override { return eSetup.get().cacheIdentifier(); diff --git a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.cc b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.cc index d6762da765c56..b7f34dba85e30 100644 --- a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.cc +++ b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.cc @@ -3,18 +3,16 @@ #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" -SiStripCorrelateBadStripAndNoise::SiStripCorrelateBadStripAndNoise( - const edm::ParameterSet &iConfig) +SiStripCorrelateBadStripAndNoise::SiStripCorrelateBadStripAndNoise(const edm::ParameterSet &iConfig) : cacheID_quality(0xFFFFFFFF), cacheID_noise(0xFFFFFFFF) { // now do what ever initialization is needed if (!edm::Service().isAvailable()) { - edm::LogError("TkLayerMap") - << "\n------------------------------------------" - "\nUnAvailable Service SiStripDetInfoFileReader: please insert in " - "the configuration file an instance like" - "\n\tprocess.SiStripDetInfoFileReader = " - "cms.Service(\"SiStripDetInfoFileReader\")" - "\n------------------------------------------"; + edm::LogError("TkLayerMap") << "\n------------------------------------------" + "\nUnAvailable Service SiStripDetInfoFileReader: please insert in " + "the configuration file an instance like" + "\n\tprocess.SiStripDetInfoFileReader = " + "cms.Service(\"SiStripDetInfoFileReader\")" + "\n------------------------------------------"; } fr = edm::Service().operator->(); @@ -26,18 +24,14 @@ SiStripCorrelateBadStripAndNoise::~SiStripCorrelateBadStripAndNoise() {} // -void SiStripCorrelateBadStripAndNoise::beginRun(const edm::Run &run, - const edm::EventSetup &es) { - - if (getNoiseCache(es) == cacheID_noise && - getQualityCache(es) == cacheID_quality) +void SiStripCorrelateBadStripAndNoise::beginRun(const edm::Run &run, const edm::EventSetup &es) { + if (getNoiseCache(es) == cacheID_noise && getQualityCache(es) == cacheID_quality) return; cacheID_noise = getNoiseCache(es); cacheID_quality = getQualityCache(es); - edm::LogInfo("") - << "[SiStripCorrelateBadStripAndNoise::beginRun] cacheID_quality " - << cacheID_quality << " cacheID_noise " << cacheID_noise << std::endl; + edm::LogInfo("") << "[SiStripCorrelateBadStripAndNoise::beginRun] cacheID_quality " << cacheID_quality + << " cacheID_noise " << cacheID_noise << std::endl; es.get().get(qualityHandle_); es.get().get(noiseHandle_); @@ -46,7 +40,6 @@ void SiStripCorrelateBadStripAndNoise::beginRun(const edm::Run &run, } void SiStripCorrelateBadStripAndNoise::DoAnalysis(const edm::EventSetup &es) { - // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -63,32 +56,25 @@ void SiStripCorrelateBadStripAndNoise::DoAnalysis(const edm::EventSetup &es) { iterateOnDets(tTopo); } -void SiStripCorrelateBadStripAndNoise::iterateOnDets( - const TrackerTopology *tTopo) { - - SiStripQuality::RegistryIterator rbegin = - qualityHandle_->getRegistryVectorBegin(); - SiStripQuality::RegistryIterator rend = - qualityHandle_->getRegistryVectorEnd(); +void SiStripCorrelateBadStripAndNoise::iterateOnDets(const TrackerTopology *tTopo) { + SiStripQuality::RegistryIterator rbegin = qualityHandle_->getRegistryVectorBegin(); + SiStripQuality::RegistryIterator rend = qualityHandle_->getRegistryVectorEnd(); for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) { const uint32_t detid = rp->detid; - SiStripQuality::Range sqrange = - SiStripQuality::Range(qualityHandle_->getDataVectorBegin() + rp->ibegin, - qualityHandle_->getDataVectorBegin() + rp->iend); + SiStripQuality::Range sqrange = SiStripQuality::Range(qualityHandle_->getDataVectorBegin() + rp->ibegin, + qualityHandle_->getDataVectorBegin() + rp->iend); iterateOnBadStrips(detid, tTopo, sqrange); } } -void SiStripCorrelateBadStripAndNoise::iterateOnBadStrips( - const uint32_t &detid, const TrackerTopology *tTopo, - SiStripQuality::Range &sqrange) { - +void SiStripCorrelateBadStripAndNoise::iterateOnBadStrips(const uint32_t &detid, + const TrackerTopology *tTopo, + SiStripQuality::Range &sqrange) { float percentage = 0; for (int it = 0; it < sqrange.second - sqrange.first; it++) { - unsigned int firstStrip = - qualityHandle_->decode(*(sqrange.first + it)).firstStrip; + unsigned int firstStrip = qualityHandle_->decode(*(sqrange.first + it)).firstStrip; unsigned int range = qualityHandle_->decode(*(sqrange.first + it)).range; correlateWithNoise(detid, tTopo, firstStrip, range); @@ -99,8 +85,7 @@ void SiStripCorrelateBadStripAndNoise::iterateOnBadStrips( if (percentage != 0) percentage /= 128. * fr->getNumberOfApvsAndStripLength(detid).first; if (percentage > 1) - edm::LogError("SiStripQualityStatistics") - << "PROBLEM detid " << detid << " value " << percentage << std::endl; + edm::LogError("SiStripQualityStatistics") << "PROBLEM detid " << detid << " value " << percentage << std::endl; //------- Global Statistics on percentage of bad components along the IOVs //------// @@ -108,20 +93,18 @@ void SiStripCorrelateBadStripAndNoise::iterateOnBadStrips( edm::LogInfo("") << "percentage " << detid << " " << percentage; } -void SiStripCorrelateBadStripAndNoise::correlateWithNoise( - const uint32_t &detid, const TrackerTopology *tTopo, - const uint32_t &firstStrip, const uint32_t &range) { - +void SiStripCorrelateBadStripAndNoise::correlateWithNoise(const uint32_t &detid, + const TrackerTopology *tTopo, + const uint32_t &firstStrip, + const uint32_t &range) { std::vector histos; SiStripNoises::Range noiseRange = noiseHandle_->getRange(detid); - edm::LogInfo("Domenico") << "detid " << detid << " first " << firstStrip - << " range " << range; + edm::LogInfo("Domenico") << "detid " << detid << " first " << firstStrip << " range " << range; float meanAPVNoise = getMeanNoise(noiseRange, firstStrip / 128, 128); // float meanNoiseHotStrips=getMeanNoise(noiseRange,firstStrip,range); - for (size_t theStrip = firstStrip; theStrip < firstStrip + range; - theStrip++) { + for (size_t theStrip = firstStrip; theStrip < firstStrip + range; theStrip++) { float meanNoiseHotStrips = getMeanNoise(noiseRange, theStrip, 1); // Get the histogram for this detid @@ -138,10 +121,9 @@ void SiStripCorrelateBadStripAndNoise::correlateWithNoise( } } -float SiStripCorrelateBadStripAndNoise::getMeanNoise( - const SiStripNoises::Range &noiseRange, const uint32_t &firstStrip, - const uint32_t &range) { - +float SiStripCorrelateBadStripAndNoise::getMeanNoise(const SiStripNoises::Range &noiseRange, + const uint32_t &firstStrip, + const uint32_t &range) { float mean = 0; for (size_t istrip = firstStrip; istrip < firstStrip + range; istrip++) { mean += noiseHandle_->getNoise(istrip, noiseRange); @@ -152,7 +134,6 @@ float SiStripCorrelateBadStripAndNoise::getMeanNoise( void SiStripCorrelateBadStripAndNoise::getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector &histos) { - histos.clear(); int subdet = -999; @@ -163,15 +144,13 @@ void SiStripCorrelateBadStripAndNoise::getHistos(const uint32_t &detid, component = tTopo->tibLayer(detid); } else if (a.subdetId() == 4) { subdet = 1; - component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) - : tTopo->tidWheel(detid) + 3; + component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) : tTopo->tidWheel(detid) + 3; } else if (a.subdetId() == 5) { subdet = 2; component = tTopo->tobLayer(detid); } else if (a.subdetId() == 6) { subdet = 3; - component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) - : tTopo->tecWheel(detid) + 9; + component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) : tTopo->tecWheel(detid) + 9; } int index = 100 + subdet * 100 + component; @@ -180,8 +159,7 @@ void SiStripCorrelateBadStripAndNoise::getHistos(const uint32_t &detid, histos.push_back(getHisto(index)); } -TH2F * -SiStripCorrelateBadStripAndNoise::getHisto(const long unsigned int &index) { +TH2F *SiStripCorrelateBadStripAndNoise::getHisto(const long unsigned int &index) { if (vTH2.size() < index + 1) vTH2.resize(index + 1, nullptr); diff --git a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.h b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.h index 6681f2a802918..a39076fb84c10 100644 --- a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.h +++ b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.h @@ -56,8 +56,7 @@ class SiStripCorrelateBadStripAndNoise : public edm::EDAnalyzer { void endJob() override; void DoAnalysis(const edm::EventSetup &); - void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, - std::vector &histos); + void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector &histos); TH2F *getHisto(const long unsigned int &index); unsigned long long getNoiseCache(const edm::EventSetup &eSetup) { @@ -68,12 +67,12 @@ class SiStripCorrelateBadStripAndNoise : public edm::EDAnalyzer { } void iterateOnDets(const TrackerTopology *tTopo); - void iterateOnBadStrips(const uint32_t &detid, const TrackerTopology *tTopo, - SiStripQuality::Range &sqrange); - void correlateWithNoise(const uint32_t &detid, const TrackerTopology *tTopo, - const uint32_t &firstStrip, const uint32_t &range); - float getMeanNoise(const SiStripNoises::Range &noiseRange, - const uint32_t &first, const uint32_t &range); + void iterateOnBadStrips(const uint32_t &detid, const TrackerTopology *tTopo, SiStripQuality::Range &sqrange); + void correlateWithNoise(const uint32_t &detid, + const TrackerTopology *tTopo, + const uint32_t &firstStrip, + const uint32_t &range); + float getMeanNoise(const SiStripNoises::Range &noiseRange, const uint32_t &first, const uint32_t &range); // ----------member data --------------------------- diff --git a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.cc b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.cc index ee0b90b40c6ab..77be7189305b2 100644 --- a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.cc +++ b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.cc @@ -6,17 +6,15 @@ #include "TCanvas.h" SiStripCorrelateNoise::SiStripCorrelateNoise(const edm::ParameterSet &iConfig) - : refNoise(nullptr), oldGain(nullptr), newGain(nullptr), - cacheID_noise(0xFFFFFFFF), cacheID_gain(0xFFFFFFFF) { + : refNoise(nullptr), oldGain(nullptr), newGain(nullptr), cacheID_noise(0xFFFFFFFF), cacheID_gain(0xFFFFFFFF) { // now do what ever initialization is needed if (!edm::Service().isAvailable()) { - edm::LogError("TkLayerMap") - << "\n------------------------------------------" - "\nUnAvailable Service SiStripDetInfoFileReader: please insert in " - "the configuration file an instance like" - "\n\tprocess.SiStripDetInfoFileReader = " - "cms.Service(\"SiStripDetInfoFileReader\")" - "\n------------------------------------------"; + edm::LogError("TkLayerMap") << "\n------------------------------------------" + "\nUnAvailable Service SiStripDetInfoFileReader: please insert in " + "the configuration file an instance like" + "\n\tprocess.SiStripDetInfoFileReader = " + "cms.Service(\"SiStripDetInfoFileReader\")" + "\n------------------------------------------"; } fr = edm::Service().operator->(); @@ -30,14 +28,11 @@ SiStripCorrelateNoise::~SiStripCorrelateNoise() {} // -void SiStripCorrelateNoise::beginRun(const edm::Run &run, - const edm::EventSetup &es) { - +void SiStripCorrelateNoise::beginRun(const edm::Run &run, const edm::EventSetup &es) { if (getNoiseCache(es) == cacheID_noise) return; - edm::LogInfo("") << "[SiStripCorrelateNoise::beginRun] cacheID_noise " - << cacheID_noise << std::endl; + edm::LogInfo("") << "[SiStripCorrelateNoise::beginRun] cacheID_noise " << cacheID_noise << std::endl; es.get().get(noiseHandle_); SiStripNoises *aNoise = new SiStripNoises(*noiseHandle_.product()); @@ -77,8 +72,7 @@ void SiStripCorrelateNoise::checkGainCache(const edm::EventSetup &es) { if (cacheID_gain != 0xFFFFFFFF) equalGain = false; cacheID_gain = getGainCache(es); - edm::LogInfo("") << "[SiStripCorrelateNoise::checkGainCache] cacheID_gain " - << cacheID_gain << std::endl; + edm::LogInfo("") << "[SiStripCorrelateNoise::checkGainCache] cacheID_gain " << cacheID_gain << std::endl; } } @@ -146,8 +140,7 @@ void SiStripCorrelateNoise::DoAnalysis(const edm::EventSetup &es, if (apvNb < 6) gainRatio = getGainRatio(iter->detid, apvNb); else - edm::LogInfo("") << "[Doanalysis] detid " << iter->detid << " strip " - << strip << " apvNb " << apvNb; + edm::LogInfo("") << "[Doanalysis] detid " << iter->detid << " strip " << strip << " apvNb " << apvNb; } // edm::LogInfo("") << "[Doanalysis] detid " << iter->detid << " strip " // << strip << " value " << iter->values[strip]; @@ -159,23 +152,19 @@ void SiStripCorrelateNoise::DoAnalysis(const edm::EventSetup &es, } } -float SiStripCorrelateNoise::getGainRatio(const uint32_t &detid, - const uint16_t &apv) { - +float SiStripCorrelateNoise::getGainRatio(const uint32_t &detid, const uint16_t &apv) { SiStripApvGain::Range oldRange = oldGain->getRange(detid); SiStripApvGain::Range newRange = newGain->getRange(detid); if (oldRange.first == oldRange.second || newRange.first == newRange.second) return 1.; - return oldGain->getApvGain(apv, oldRange) / - newGain->getApvGain(apv, newRange); + return oldGain->getApvGain(apv, oldRange) / newGain->getApvGain(apv, newRange); } -float SiStripCorrelateNoise::getMeanNoise( - const SiStripNoises::Range &noiseRange, const uint32_t &firstStrip, - const uint32_t &range) { - +float SiStripCorrelateNoise::getMeanNoise(const SiStripNoises::Range &noiseRange, + const uint32_t &firstStrip, + const uint32_t &range) { float mean = 0; for (size_t istrip = firstStrip; istrip < firstStrip + range; istrip++) { mean += noiseHandle_->getNoise(istrip, noiseRange); @@ -186,7 +175,6 @@ float SiStripCorrelateNoise::getMeanNoise( void SiStripCorrelateNoise::getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector &histos) { - histos.clear(); int subdet = -999; @@ -197,15 +185,13 @@ void SiStripCorrelateNoise::getHistos(const uint32_t &detid, component = tTopo->tibLayer(detid); } else if (a.subdetId() == 4) { subdet = 1; - component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) - : tTopo->tidWheel(detid) + 3; + component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) : tTopo->tidWheel(detid) + 3; } else if (a.subdetId() == 5) { subdet = 2; component = tTopo->tobLayer(detid); } else if (a.subdetId() == 6) { subdet = 3; - component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) - : tTopo->tecWheel(detid) + 9; + component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) : tTopo->tecWheel(detid) + 9; } int index = 100 + subdet * 100 + component; diff --git a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.h b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.h index b72a2ab3e48da..4dab5eab044aa 100644 --- a/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.h +++ b/DQM/SiStripMonitorSummary/plugins/SiStripCorrelateNoise.h @@ -57,10 +57,8 @@ class SiStripCorrelateNoise : public edm::EDAnalyzer { void endJob() override; void DoPlots(); - void DoAnalysis(const edm::EventSetup &, const SiStripNoises &, - SiStripNoises &); - void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, - std::vector &histos); + void DoAnalysis(const edm::EventSetup &, const SiStripNoises &, SiStripNoises &); + void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector &histos); TH1F *getHisto(const long unsigned int &index); unsigned long long getNoiseCache(const edm::EventSetup &eSetup) { @@ -70,8 +68,7 @@ class SiStripCorrelateNoise : public edm::EDAnalyzer { return eSetup.get().cacheIdentifier(); } void checkGainCache(const edm::EventSetup &es); - float getMeanNoise(const SiStripNoises::Range &noiseRange, - const uint32_t &first, const uint32_t &range); + float getMeanNoise(const SiStripNoises::Range &noiseRange, const uint32_t &first, const uint32_t &range); float getGainRatio(const uint32_t &detid, const uint16_t &apv); diff --git a/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.cc b/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.cc index c5159d7c92532..9731845069991 100644 --- a/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.cc +++ b/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.cc @@ -3,17 +3,15 @@ #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" -SiStripPlotGain::SiStripPlotGain(const edm::ParameterSet &iConfig) - : cacheID(0xFFFFFFFF) { +SiStripPlotGain::SiStripPlotGain(const edm::ParameterSet &iConfig) : cacheID(0xFFFFFFFF) { // now do what ever initialization is needed if (!edm::Service().isAvailable()) { - edm::LogError("TkLayerMap") - << "\n------------------------------------------" - "\nUnAvailable Service SiStripDetInfoFileReader: please insert in " - "the configuration file an instance like" - "\n\tprocess.SiStripDetInfoFileReader = " - "cms.Service(\"SiStripDetInfoFileReader\")" - "\n------------------------------------------"; + edm::LogError("TkLayerMap") << "\n------------------------------------------" + "\nUnAvailable Service SiStripDetInfoFileReader: please insert in " + "the configuration file an instance like" + "\n\tprocess.SiStripDetInfoFileReader = " + "cms.Service(\"SiStripDetInfoFileReader\")" + "\n------------------------------------------"; } fr = edm::Service().operator->(); @@ -26,21 +24,17 @@ SiStripPlotGain::~SiStripPlotGain() {} // void SiStripPlotGain::beginRun(const edm::Run &run, const edm::EventSetup &es) { - if (getCache(es) == cacheID) return; cacheID = getCache(es); - edm::LogInfo("") << "[SiStripPlotGain::beginRun] cacheID " << cacheID - << std::endl; + edm::LogInfo("") << "[SiStripPlotGain::beginRun] cacheID " << cacheID << std::endl; es.get().get(Handle_); DoAnalysis(es, *Handle_.product()); } -void SiStripPlotGain::DoAnalysis(const edm::EventSetup &es, - const SiStripApvGain &gain) { - +void SiStripPlotGain::DoAnalysis(const edm::EventSetup &es, const SiStripApvGain &gain) { edm::LogInfo("") << "[Doanalysis]"; // Retrieve tracker topology from geometry @@ -60,11 +54,9 @@ void SiStripPlotGain::DoAnalysis(const edm::EventSetup &es, // Divide result by d for (; iter != iterE; ++iter) { getHistos(*iter, tTopo, histos); - SiStripApvGain::Range range = - SiStripApvGain::Range(p.getFirstElement(iter), p.getLastElement(iter)); + SiStripApvGain::Range range = SiStripApvGain::Range(p.getFirstElement(iter), p.getLastElement(iter)); - edm::LogInfo("") << "[Doanalysis] detid " << *iter << " range " - << range.second - range.first; + edm::LogInfo("") << "[Doanalysis] detid " << *iter << " range " << range.second - range.first; size_t apv = 0, apvE = (range.second - range.first); for (; apv < apvE; apv += 2) { value = gain.getApvGain(apv, range); @@ -75,10 +67,7 @@ void SiStripPlotGain::DoAnalysis(const edm::EventSetup &es, } } -void SiStripPlotGain::getHistos(const uint32_t &detid, - const TrackerTopology *tTopo, - std::vector &histos) { - +void SiStripPlotGain::getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector &histos) { histos.clear(); int subdet = -999; @@ -89,15 +78,13 @@ void SiStripPlotGain::getHistos(const uint32_t &detid, component = tTopo->tibLayer(detid); } else if (a.subdetId() == 4) { subdet = 1; - component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) - : tTopo->tidWheel(detid) + 3; + component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) : tTopo->tidWheel(detid) + 3; } else if (a.subdetId() == 5) { subdet = 2; component = tTopo->tobLayer(detid); } else if (a.subdetId() == 6) { subdet = 3; - component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) - : tTopo->tecWheel(detid) + 9; + component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) : tTopo->tecWheel(detid) + 9; } int index = 100 + subdet * 100 + component; diff --git a/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.h b/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.h index e08875827c2e2..d5eeccd376c8a 100644 --- a/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.h +++ b/DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.h @@ -56,8 +56,7 @@ class SiStripPlotGain : public edm::EDAnalyzer { void endJob() override; void DoAnalysis(const edm::EventSetup &es, const SiStripApvGain &); - void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, - std::vector &histos); + void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector &histos); TH1F *getHisto(const long unsigned int &index); unsigned long long getCache(const edm::EventSetup &eSetup) { diff --git a/DQM/SiStripMonitorSummary/src/SiStripApvGainsDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripApvGainsDQM.cc index 3860bbdba94f0..708dc1f5a7379 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripApvGainsDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripApvGainsDQM.cc @@ -10,13 +10,11 @@ SiStripApvGainsDQM::SiStripApvGainsDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet) : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) { - // Build the Histo_TkMap: if (HistoMaps_On_) { edm::ESHandle tkDetMapHandle; eSetup.get().get(tkDetMapHandle); - Tk_HM_ = std::make_unique( - tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanApvGain_TkMap", 0.); + Tk_HM_ = std::make_unique(tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanApvGain_TkMap", 0.); } } // ----- @@ -27,16 +25,13 @@ SiStripApvGainsDQM::~SiStripApvGainsDQM() {} // ----- void SiStripApvGainsDQM::getActiveDetIds(const edm::EventSetup &eSetup) { - getConditionObject(eSetup); gainHandle_->getDetIds(activeDetIds); } // ----- // ----- -void SiStripApvGainsDQM::fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) { - +void SiStripApvGainsDQM::fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -44,16 +39,14 @@ void SiStripApvGainsDQM::fillModMEs(const std::vector &selectedDetIds, ModMEs CondObj_ME; - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); ++detIter_) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + ++detIter_) { fillMEsForDet(CondObj_ME, *detIter_, tTopo); } } // ----- -void SiStripApvGainsDQM::fillMEsForDet(const ModMEs &_selModME_, - uint32_t selDetId_, - const TrackerTopology *tTopo) { +void SiStripApvGainsDQM::fillMEsForDet(const ModMEs &_selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) { ModMEs selModME_ = _selModME_; std::vector DetIds; gainHandle_->getDetIds(DetIds); @@ -65,47 +58,38 @@ void SiStripApvGainsDQM::fillMEsForDet(const ModMEs &_selModME_, getModMEs(selModME_, selDetId_, tTopo); for (int iapv = 0; iapv < nApv; ++iapv) { - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { - selModME_.ProfileDistr->Fill(iapv + 1, - gainHandle_->getApvGain(iapv, gainRange)); + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { + selModME_.ProfileDistr->Fill(iapv + 1, gainHandle_->getApvGain(iapv, gainRange)); } - if (CondObj_fillId_ == "onlyCumul" || - CondObj_fillId_ == "ProfileAndCumul") { + if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") { selModME_.CumulDistr->Fill(gainHandle_->getApvGain(iapv, gainRange)); } // Fill the TkMap - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { fillTkMap(selDetId_, gainHandle_->getApvGain(iapv, gainRange)); } } } // ----- -void SiStripApvGainsDQM::fillSummaryMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripApvGainsDQM::fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); const TrackerTopology *const tTopo = tTopoHandle.product(); - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo); } - for (std::map::iterator iter = SummaryMEsMap_.begin(); - iter != SummaryMEsMap_.end(); iter++) { - + for (std::map::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) { ModMEs selME; selME = iter->second; if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter("OutputSummaryProfileAtLayerLevelAsImage")) { - TCanvas c1("c1"); selME.SummaryOfProfileDistr->getTProfile()->Draw(); std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); @@ -114,7 +98,6 @@ void SiStripApvGainsDQM::fillSummaryMEs( } if (hPSet_.getParameter("FillSummaryAtLayerLevel") && fPSet_.getParameter("OutputSummaryAtLayerLevelAsImage")) { - TCanvas c1("c1"); selME.SummaryDistr->getTH1()->Draw(); std::string name(selME.SummaryDistr->getTH1()->GetTitle()); @@ -126,22 +109,18 @@ void SiStripApvGainsDQM::fillSummaryMEs( // ----- void SiStripApvGainsDQM::fillMEsForLayer( - /*std::map selMEsMap_, */ uint32_t selDetId_, - const TrackerTopology *tTopo) { - + /*std::map selMEsMap_, */ uint32_t selDetId_, const TrackerTopology *tTopo) { int subdetectorId_ = ((selDetId_ >> 25) & 0x7); if (subdetectorId_ < 3 || subdetectorId_ > 6) { - edm::LogError("SiStripApvGainsDQM") - << "[SiStripApvGainsDQM::fillMEsForLayer] WRONG INPUT : no such " - "subdetector type : " - << subdetectorId_ << " no folder set!" << std::endl; + edm::LogError("SiStripApvGainsDQM") << "[SiStripApvGainsDQM::fillMEsForLayer] WRONG INPUT : no such " + "subdetector type : " + << subdetectorId_ << " no folder set!" << std::endl; return; } // ---- - std::map::iterator selMEsMapIter_ = - SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); + std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); ModMEs selME_; if (selMEsMapIter_ != SummaryMEsMap_.end()) selME_ = selMEsMapIter_->second; @@ -155,30 +134,24 @@ void SiStripApvGainsDQM::fillMEsForLayer( SiStripHistoId hidmanager; if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel")) { - // --> profile summary std::string hSummaryOfProfile_description; - hSummaryOfProfile_description = - hPSet_.getParameter("SummaryOfProfile_description"); + hSummaryOfProfile_description = hPSet_.getParameter("SummaryOfProfile_description"); std::string hSummaryOfProfile_name; hSummaryOfProfile_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); for (int iapv = 0; iapv < nApv; ++iapv) { - meanApvGain = meanApvGain + gainHandle_->getApvGain(iapv, gainRange); - selME_.SummaryOfProfileDistr->Fill( - iapv + 1, gainHandle_->getApvGain(iapv, gainRange)); + selME_.SummaryOfProfileDistr->Fill(iapv + 1, gainHandle_->getApvGain(iapv, gainRange)); // Fill the TkMap - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { fillTkMap(selDetId_, gainHandle_->getApvGain(iapv, gainRange)); } - } // iapv + } // iapv meanApvGain = meanApvGain / nApv; @@ -186,19 +159,16 @@ void SiStripApvGainsDQM::fillMEsForLayer( if (HistoMaps_On_) Tk_HM_->setBinContent(selDetId_, meanApvGain); - } // if Fill ... + } // if Fill ... if (hPSet_.getParameter("FillSummaryAtLayerLevel")) { - // --> summary std::string hSummary_description; - hSummary_description = - hPSet_.getParameter("Summary_description"); + hSummary_description = hPSet_.getParameter("Summary_description"); std::string hSummary_name; - hSummary_name = hidmanager.createHistoLayer( - hSummary_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummary_name = + hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); // get detIds belonging to same layer to fill X-axis with detId-number @@ -218,12 +188,12 @@ void SiStripApvGainsDQM::fillMEsForLayer( for (int iapv = 0; iapv < nApv; ++iapv) { meanApvGain = meanApvGain + gainHandle_->getApvGain(iapv, gainRange); selME_.SummaryDistr->Fill(iBin, gainHandle_->getApvGain(iapv, gainRange)); - } // iapv + } // iapv meanApvGain = meanApvGain / nApv; // Fill the TkHistoMap with meanApvgain: // if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain); - } // if Fill ... + } // if Fill ... } // ----- diff --git a/DQM/SiStripMonitorSummary/src/SiStripBackPlaneCorrectionDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripBackPlaneCorrectionDQM.cc index 19269b984e0d4..6e5c734fefe6a 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripBackPlaneCorrectionDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripBackPlaneCorrectionDQM.cc @@ -5,17 +5,16 @@ #include "TCanvas.h" // ----- -SiStripBackPlaneCorrectionDQM::SiStripBackPlaneCorrectionDQM( - const edm::EventSetup &eSetup, edm::RunNumber_t iRun, - edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet) +SiStripBackPlaneCorrectionDQM::SiStripBackPlaneCorrectionDQM(const edm::EventSetup &eSetup, + edm::RunNumber_t iRun, + edm::ParameterSet const &hPSet, + edm::ParameterSet const &fPSet) : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) { - // Build the Histo_TkMap: if (HistoMaps_On_) { edm::ESHandle tkDetMapHandle; eSetup.get().get(tkDetMapHandle); - Tk_HM_ = std::make_unique(tkDetMapHandle.product(), - "SiStrip/Histo_Map", "BP_TkMap", 0.); + Tk_HM_ = std::make_unique(tkDetMapHandle.product(), "SiStrip/Histo_Map", "BP_TkMap", 0.); } } // ----- @@ -25,26 +24,21 @@ SiStripBackPlaneCorrectionDQM::~SiStripBackPlaneCorrectionDQM() {} // ----- // ----- -void SiStripBackPlaneCorrectionDQM::getActiveDetIds( - const edm::EventSetup &eSetup) { - +void SiStripBackPlaneCorrectionDQM::getActiveDetIds(const edm::EventSetup &eSetup) { getConditionObject(eSetup); std::map::const_iterator BPMapIter_; - std::map BPMap_ = - bpcorrectionHandle_->getBackPlaneCorrections(); + std::map BPMap_ = bpcorrectionHandle_->getBackPlaneCorrections(); for (BPMapIter_ = BPMap_.begin(); BPMapIter_ != BPMap_.end(); BPMapIter_++) { - activeDetIds.push_back((*BPMapIter_).first); } } // ----- // ----- -void SiStripBackPlaneCorrectionDQM::fillSummaryMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripBackPlaneCorrectionDQM::fillSummaryMEs(const std::vector &selectedDetIds, + const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -61,14 +55,12 @@ void SiStripBackPlaneCorrectionDQM::fillSummaryMEs( edm::LogError("SiStripBackPlaneCorrection") << "[SiStripBackPlaneCorrection::fillSummaryMEs] WRONG INPUT : no " "such subdetector type : " - << subDetId_ << " and detId " << selectedDetIds[i] - << " therefore no filling!" << std::endl; + << subDetId_ << " and detId " << selectedDetIds[i] << " therefore no filling!" << std::endl; } else if (SummaryOnLayerLevel_On_) { if (fillNext) { fillMEsForLayer(/*SummaryMEsMap_,*/ selectedDetIds[i], tTopo); } - if (getLayerNameAndId(selectedDetIds[i + 1], tTopo) == - getLayerNameAndId(selectedDetIds[i], tTopo)) { + if (getLayerNameAndId(selectedDetIds[i + 1], tTopo) == getLayerNameAndId(selectedDetIds[i], tTopo)) { fillNext = false; } else { fillNext = true; @@ -77,8 +69,7 @@ void SiStripBackPlaneCorrectionDQM::fillSummaryMEs( if (fillNext) { fillMEsForLayer(/*SummaryMEsMap_,*/ selectedDetIds[i], tTopo); } - if (getStringNameAndId(selectedDetIds[i + 1], tTopo) == - getStringNameAndId(selectedDetIds[i], tTopo)) { + if (getStringNameAndId(selectedDetIds[i + 1], tTopo) == getStringNameAndId(selectedDetIds[i], tTopo)) { fillNext = false; } else { fillNext = true; @@ -86,28 +77,20 @@ void SiStripBackPlaneCorrectionDQM::fillSummaryMEs( } } - for (std::map::iterator iter = SummaryMEsMap_.begin(); - iter != SummaryMEsMap_.end(); iter++) { - + for (std::map::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) { ModMEs selME; selME = iter->second; if (SummaryOnStringLevel_On_) { - - if (fPSet_.getParameter( - "OutputSummaryProfileAtLayerLevelAsImage")) { - + if (fPSet_.getParameter("OutputSummaryProfileAtLayerLevelAsImage")) { TCanvas c1("c1"); selME.SummaryOfProfileDistr->getTProfile()->Draw(); - std::string name( - selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); + std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); name += ".png"; c1.Print(name.c_str()); } - if (fPSet_.getParameter( - "OutputCumulativeSummaryAtLayerLevelAsImage")) { - + if (fPSet_.getParameter("OutputCumulativeSummaryAtLayerLevelAsImage")) { TCanvas c2("c2"); selME.SummaryOfCumulDistr->getTH1()->Draw(); std::string name2(selME.SummaryOfCumulDistr->getTH1()->GetTitle()); @@ -117,21 +100,16 @@ void SiStripBackPlaneCorrectionDQM::fillSummaryMEs( } else { if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel") && - fPSet_.getParameter( - "OutputSummaryProfileAtLayerLevelAsImage")) { - + fPSet_.getParameter("OutputSummaryProfileAtLayerLevelAsImage")) { TCanvas c1("c1"); selME.SummaryOfProfileDistr->getTProfile()->Draw(); - std::string name( - selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); + std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); name += ".png"; c1.Print(name.c_str()); } if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel") && - fPSet_.getParameter( - "OutputCumulativeSummaryAtLayerLevelAsImage")) { - + fPSet_.getParameter("OutputCumulativeSummaryAtLayerLevelAsImage")) { TCanvas c1("c1"); selME.SummaryOfCumulDistr->getTH1()->Draw(); std::string name(selME.SummaryOfCumulDistr->getTH1()->GetTitle()); @@ -145,14 +123,11 @@ void SiStripBackPlaneCorrectionDQM::fillSummaryMEs( // ----- void SiStripBackPlaneCorrectionDQM::fillMEsForLayer( - /*std::map selMEsMap_,*/ uint32_t selDetId_, - const TrackerTopology *tTopo) { - + /*std::map selMEsMap_,*/ uint32_t selDetId_, const TrackerTopology *tTopo) { SiStripHistoId hidmanager; std::string hSummaryOfProfile_description; - hSummaryOfProfile_description = - hPSet_.getParameter("SummaryOfProfile_description"); + hSummaryOfProfile_description = hPSet_.getParameter("SummaryOfProfile_description"); std::string hSummary_name; @@ -171,11 +146,10 @@ void SiStripBackPlaneCorrectionDQM::fillMEsForLayer( std::vector sameLayerDetIds_; sameLayerDetIds_.clear(); - if (SummaryOnStringLevel_On_) { // FILLING FOR STRING LEVEL + if (SummaryOnStringLevel_On_) { // FILLING FOR STRING LEVEL hSummary_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getStringNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getStringNameAndId(selDetId_, tTopo).first, ""); std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getStringNameAndId(selDetId_, tTopo).second); @@ -188,58 +162,43 @@ void SiStripBackPlaneCorrectionDQM::fillMEsForLayer( // ----- sameLayerDetIds_.clear(); - if (selSubDetId_ == 3) { // TIB + if (selSubDetId_ == 3) { // TIB if (tTopo->tibIsInternalString(selDetId_)) { - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tibLayer(selDetId_), - 0, 1, tTopo->tibString(selDetId_)); + SiStripSubStructure::getTIBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tibLayer(selDetId_), 0, 1, tTopo->tibString(selDetId_)); } if (tTopo->tibIsExternalString(selDetId_)) { - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tibLayer(selDetId_), - 0, 2, tTopo->tibString(selDetId_)); + SiStripSubStructure::getTIBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tibLayer(selDetId_), 0, 2, tTopo->tibString(selDetId_)); } - } else if (selSubDetId_ == 4) { // TID - SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0); - } else if (selSubDetId_ == 5) { // TOB - SiStripSubStructure::getTOBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tobLayer(selDetId_), 0, - tTopo->tobRod(selDetId_)); - } else if (selSubDetId_ == 6) { // TEC - SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0, 0, 0); + } else if (selSubDetId_ == 4) { // TID + SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0); + } else if (selSubDetId_ == 5) { // TOB + SiStripSubStructure::getTOBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tobLayer(selDetId_), 0, tTopo->tobRod(selDetId_)); + } else if (selSubDetId_ == 6) { // TEC + SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0, 0, 0); } // ----- for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfProfileDistr->Fill( - i + 1, - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + selME_.SummaryOfProfileDistr->Fill(i + 1, bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); // Fill the Histo_TkMap+TkMap with the BP: if (HistoMaps_On_) - Tk_HM_->fill( - sameLayerDetIds_[i], - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + Tk_HM_->fill(sameLayerDetIds_[i], bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); - std::cout << sameLayerDetIds_[i] << "\t" - << bpcorrectionHandle_->getBackPlaneCorrection( - sameLayerDetIds_[i]) + std::cout << sameLayerDetIds_[i] << "\t" << bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i]) << std::endl; - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { - fillTkMap( - sameLayerDetIds_[i], - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { + fillTkMap(sameLayerDetIds_[i], bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); } } std::string hSummaryOfCumul_description; - hSummaryOfCumul_description = - hPSet_.getParameter("SummaryOfCumul_description"); + hSummaryOfCumul_description = hPSet_.getParameter("SummaryOfCumul_description"); std::string hSummaryOfCumul_name; @@ -252,16 +211,14 @@ void SiStripBackPlaneCorrectionDQM::fillMEsForLayer( } hSummaryOfCumul_name = hidmanager.createHistoLayer( - hSummaryOfCumul_description, "layer", - getStringNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfCumul_description, "layer", getStringNameAndId(selDetId_, tTopo).first, ""); for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfCumulDistr->Fill( - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + selME_.SummaryOfCumulDistr->Fill(bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); } - } // FILLING FOR STRING LEVEL + } // FILLING FOR STRING LEVEL - else { // FILLING FOR LAYER LEVEL + else { // FILLING FOR LAYER LEVEL std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); @@ -273,10 +230,8 @@ void SiStripBackPlaneCorrectionDQM::fillMEsForLayer( getSummaryMEs(selME_, selDetId_, tTopo); if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel")) { - hSummary_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); // ----- sameLayerDetIds_.clear(); @@ -284,30 +239,21 @@ void SiStripBackPlaneCorrectionDQM::fillMEsForLayer( sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_, tTopo); for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfProfileDistr->Fill( - i + 1, - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + selME_.SummaryOfProfileDistr->Fill(i + 1, bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); // Fill the Histo_TkMap with BP: if (HistoMaps_On_) - Tk_HM_->fill( - sameLayerDetIds_[i], - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); - - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { - fillTkMap( - sameLayerDetIds_[i], - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + Tk_HM_->fill(sameLayerDetIds_[i], bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { + fillTkMap(sameLayerDetIds_[i], bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); } } - } // if Fill ... + } // if Fill ... if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel")) { - std::string hSummaryOfCumul_description; - hSummaryOfCumul_description = - hPSet_.getParameter("SummaryOfCumul_description"); + hSummaryOfCumul_description = hPSet_.getParameter("SummaryOfCumul_description"); std::string hSummaryOfCumul_name; @@ -320,14 +266,12 @@ void SiStripBackPlaneCorrectionDQM::fillMEsForLayer( } hSummaryOfCumul_name = hidmanager.createHistoLayer( - hSummaryOfCumul_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfCumul_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfCumulDistr->Fill( - bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); + selME_.SummaryOfCumulDistr->Fill(bpcorrectionHandle_->getBackPlaneCorrection(sameLayerDetIds_[i])); } - } // if Fill ... - } // FILLING FOR LAYER LEVEL + } // if Fill ... + } // FILLING FOR LAYER LEVEL } // ----- diff --git a/DQM/SiStripMonitorSummary/src/SiStripBaseCondObjDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripBaseCondObjDQM.cc index f8296259eb756..b1b1e8851ed5f 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripBaseCondObjDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripBaseCondObjDQM.cc @@ -10,19 +10,19 @@ SiStripBaseCondObjDQM::SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet) - : eSetup_(eSetup), hPSet_(hPSet), fPSet_(fPSet), cacheID_memory(0), - dqmStore_(edm::Service().operator->()), runNumber_(iRun) { - + : eSetup_(eSetup), + hPSet_(hPSet), + fPSet_(fPSet), + cacheID_memory(0), + dqmStore_(edm::Service().operator->()), + runNumber_(iRun) { reader = new SiStripDetInfoFileReader( - edm::FileInPath( - std::string("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")) - .fullPath()); + edm::FileInPath(std::string("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")).fullPath()); Mod_On_ = fPSet_.getParameter("Mod_On"); HistoMaps_On_ = fPSet_.getParameter("HistoMaps_On"); SummaryOnLayerLevel_On_ = fPSet_.getParameter("SummaryOnLayerLevel_On"); - SummaryOnStringLevel_On_ = - fPSet_.getParameter("SummaryOnStringLevel_On"); + SummaryOnStringLevel_On_ = fPSet_.getParameter("SummaryOnStringLevel_On"); GrandSummary_On_ = fPSet_.getParameter("GrandSummary_On"); @@ -31,17 +31,15 @@ SiStripBaseCondObjDQM::SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, // Warning message from wrong input: if (SummaryOnLayerLevel_On_ && SummaryOnStringLevel_On_) { - edm::LogWarning("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::SiStripBaseCondObjDQMs] PLEASE CHECK : " - "String and layer level options can not be activated together" - << std::endl; + edm::LogWarning("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::SiStripBaseCondObjDQMs] PLEASE CHECK : " + "String and layer level options can not be activated together" + << std::endl; } // The OR of the two conditions allow to switch on this feature for all the // components (if the FillConditions_PSet has the TkMap_On =true) or for // single MEs (if the PSet for a ME has the TkMap_On =true) - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) bookTkMap(hPSet_.getParameter("TkMapName")); minValue = hPSet_.getParameter("minValue"); @@ -52,7 +50,6 @@ SiStripBaseCondObjDQM::SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, //====================================== // ----- void SiStripBaseCondObjDQM::analysis(const edm::EventSetup &eSetup_) { - cacheID_current = getCache(eSetup_); if (cacheID_memory == cacheID_current) @@ -63,8 +60,7 @@ void SiStripBaseCondObjDQM::analysis(const edm::EventSetup &eSetup_) { // The OR of the two conditions allows to switch on this feature for all the // components (if the FillConditions_PSet has the ActiveDetIds_On =true) or // for single MEs (if the PSet for a ME has the ActiveDetIds_On =true) - if (fPSet_.getParameter("ActiveDetIds_On") || - hPSet_.getParameter("ActiveDetIds_On")) + if (fPSet_.getParameter("ActiveDetIds_On") || hPSet_.getParameter("ActiveDetIds_On")) getActiveDetIds(eSetup_); else activeDetIds = reader->getAllDetIds(); @@ -82,8 +78,7 @@ void SiStripBaseCondObjDQM::analysis(const edm::EventSetup &eSetup_) { fillSummaryMEs(activeDetIds, eSetup_); } - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { std::string filename = hPSet_.getParameter("TkMapName"); if (!filename.empty()) { constexpr unsigned int kSLen = 128; @@ -103,7 +98,6 @@ void SiStripBaseCondObjDQM::analysisOnDemand(const edm::EventSetup &eSetup_, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer) { - getConditionObject(eSetup_); getActiveDetIds(eSetup_); @@ -115,18 +109,14 @@ void SiStripBaseCondObjDQM::analysisOnDemand(const edm::EventSetup &eSetup_, const TrackerTopology *tTopo = tTopoHandle.product(); if (requestedSubDetector == "TIB") { - SiStripSubStructure::getTIBDetectors(activeDetIds, requestedDetIds_, tTopo, - requestedLayer, 0, 0, 0); + SiStripSubStructure::getTIBDetectors(activeDetIds, requestedDetIds_, tTopo, requestedLayer, 0, 0, 0); } else if (requestedSubDetector == "TID") { - SiStripSubStructure::getTIDDetectors(activeDetIds, requestedDetIds_, tTopo, - requestedSide, requestedLayer, 0, 0); + SiStripSubStructure::getTIDDetectors(activeDetIds, requestedDetIds_, tTopo, requestedSide, requestedLayer, 0, 0); } else if (requestedSubDetector == "TOB") { - SiStripSubStructure::getTOBDetectors(activeDetIds, requestedDetIds_, tTopo, - requestedLayer, 0, 0); + SiStripSubStructure::getTOBDetectors(activeDetIds, requestedDetIds_, tTopo, requestedLayer, 0, 0); } else if (requestedSubDetector == "TEC") { - SiStripSubStructure::getTECDetectors(activeDetIds, requestedDetIds_, tTopo, - requestedSide, requestedLayer, 0, 0, 0, - 0); + SiStripSubStructure::getTECDetectors( + activeDetIds, requestedDetIds_, tTopo, requestedSide, requestedLayer, 0, 0, 0, 0); } analysisOnDemand(eSetup_, requestedDetIds_); @@ -135,9 +125,7 @@ void SiStripBaseCondObjDQM::analysisOnDemand(const edm::EventSetup &eSetup_, //=========================================== // ----- -void SiStripBaseCondObjDQM::analysisOnDemand(const edm::EventSetup &eSetup_, - uint32_t detIdOnDemand) { - +void SiStripBaseCondObjDQM::analysisOnDemand(const edm::EventSetup &eSetup_, uint32_t detIdOnDemand) { unsigned long long cacheID_current = getCache(eSetup_); if (cacheID_memory == cacheID_current) @@ -146,17 +134,15 @@ void SiStripBaseCondObjDQM::analysisOnDemand(const edm::EventSetup &eSetup_, getConditionObject(eSetup_); std::vector vdetIdsOnDemand_; - vdetIdsOnDemand_.push_back(detIdOnDemand); // fillModMEs needs a vector + vdetIdsOnDemand_.push_back(detIdOnDemand); // fillModMEs needs a vector fillModMEs(vdetIdsOnDemand_, eSetup_); } // ----- //=============================================== // ----- -void SiStripBaseCondObjDQM::analysisOnDemand( - const edm::EventSetup &eSetup_, - const std::vector &detIdsOnDemand) { - +void SiStripBaseCondObjDQM::analysisOnDemand(const edm::EventSetup &eSetup_, + const std::vector &detIdsOnDemand) { unsigned long long cacheID_current = getCache(eSetup_); if (cacheID_memory == cacheID_current) @@ -170,7 +156,6 @@ void SiStripBaseCondObjDQM::analysisOnDemand( //==================================== // ----- std::vector SiStripBaseCondObjDQM::getCabledModules() { - std::vector cabledDetIds_; eSetup_.get().get(detCablingHandle_); detCablingHandle_->addActiveDetectorsRawIds(cabledDetIds_); @@ -184,31 +169,24 @@ std::vector SiStripBaseCondObjDQM::getCabledModules() { //#FIXME : very long method. please factorize it -void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, - const TrackerTopology *tTopo) { - - edm::LogInfo("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::selectModules] input detIds_: " - << detIds_.size() << std::endl; +void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, const TrackerTopology *tTopo) { + edm::LogInfo("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::selectModules] input detIds_: " << detIds_.size() + << std::endl; if (fPSet_.getParameter("restrictModules")) { - std::vector included_subdetsels; std::vector included_subdets = - fPSet_.getParameter>( - "ModulesToBeIncluded_DetIdSelector"); - for (std::vector::const_iterator wsdps = - included_subdets.begin(); - wsdps != included_subdets.end(); ++wsdps) { + fPSet_.getParameter>("ModulesToBeIncluded_DetIdSelector"); + for (std::vector::const_iterator wsdps = included_subdets.begin(); wsdps != included_subdets.end(); + ++wsdps) { included_subdetsels.push_back(DetIdSelector(*wsdps)); } std::vector modulesToBeIncluded; - for (std::vector::const_iterator detid = detIds_.begin(); - detid != detIds_.end(); ++detid) { - for (std::vector::const_iterator detidsel = - included_subdetsels.begin(); - detidsel != included_subdetsels.end(); ++detidsel) { + for (std::vector::const_iterator detid = detIds_.begin(); detid != detIds_.end(); ++detid) { + for (std::vector::const_iterator detidsel = included_subdetsels.begin(); + detidsel != included_subdetsels.end(); + ++detidsel) { if (detidsel->isSelected(*detid)) { modulesToBeIncluded.push_back(*detid); break; @@ -222,20 +200,17 @@ void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, // *** exclude modules *** std::vector excluded_subdetsels; std::vector excluded_subdets = - fPSet_.getParameter>( - "ModulesToBeExcluded_DetIdSelector"); - for (std::vector::const_iterator wsdps = - excluded_subdets.begin(); - wsdps != excluded_subdets.end(); ++wsdps) { + fPSet_.getParameter>("ModulesToBeExcluded_DetIdSelector"); + for (std::vector::const_iterator wsdps = excluded_subdets.begin(); wsdps != excluded_subdets.end(); + ++wsdps) { excluded_subdetsels.push_back(DetIdSelector(*wsdps)); } std::vector modulesToBeExcluded; - for (std::vector::const_iterator detid = detIds_.begin(); - detid != detIds_.end(); ++detid) { - for (std::vector::const_iterator detidsel = - excluded_subdetsels.begin(); - detidsel != excluded_subdetsels.end(); ++detidsel) { + for (std::vector::const_iterator detid = detIds_.begin(); detid != detIds_.end(); ++detid) { + for (std::vector::const_iterator detidsel = excluded_subdetsels.begin(); + detidsel != excluded_subdetsels.end(); + ++detidsel) { if (detidsel->isSelected(*detid)) { modulesToBeExcluded.push_back(*detid); break; @@ -243,57 +218,46 @@ void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, } } - ModulesToBeExcluded_ = - fPSet_.getParameter>("ModulesToBeExcluded"); - ModulesToBeIncluded_ = - fPSet_.getParameter>("ModulesToBeIncluded"); - SubDetectorsToBeExcluded_ = fPSet_.getParameter>( - "SubDetectorsToBeExcluded"); + ModulesToBeExcluded_ = fPSet_.getParameter>("ModulesToBeExcluded"); + ModulesToBeIncluded_ = fPSet_.getParameter>("ModulesToBeIncluded"); + SubDetectorsToBeExcluded_ = fPSet_.getParameter>("SubDetectorsToBeExcluded"); // vectors to be sorted otherwise the intersection is non computed properly std::sort(ModulesToBeExcluded_.begin(), ModulesToBeExcluded_.end()); std::sort(ModulesToBeIncluded_.begin(), ModulesToBeIncluded_.end()); - if (modulesToBeExcluded.empty() && modulesToBeIncluded.empty() && - ModulesToBeExcluded_.empty() && ModulesToBeIncluded_.empty()) - edm::LogWarning("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no modules " - "to be exclude/included in your cfg" - << std::endl; + if (modulesToBeExcluded.empty() && modulesToBeIncluded.empty() && ModulesToBeExcluded_.empty() && + ModulesToBeIncluded_.empty()) + edm::LogWarning("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no modules " + "to be exclude/included in your cfg" + << std::endl; - modulesToBeIncluded.insert(modulesToBeIncluded.end(), - ModulesToBeIncluded_.begin(), - ModulesToBeIncluded_.end()); + modulesToBeIncluded.insert(modulesToBeIncluded.end(), ModulesToBeIncluded_.begin(), ModulesToBeIncluded_.end()); edm::LogInfo("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::selectModules] modulesToBeIncluded: " - << modulesToBeIncluded.size() << std::endl; - modulesToBeExcluded.insert(modulesToBeExcluded.end(), - ModulesToBeExcluded_.begin(), - ModulesToBeExcluded_.end()); + << "[SiStripBaseCondObjDQM::selectModules] modulesToBeIncluded: " << modulesToBeIncluded.size() << std::endl; + modulesToBeExcluded.insert(modulesToBeExcluded.end(), ModulesToBeExcluded_.begin(), ModulesToBeExcluded_.end()); edm::LogInfo("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::selectModules] modulesToBeExcluded: " - << modulesToBeExcluded.size() << std::endl; + << "[SiStripBaseCondObjDQM::selectModules] modulesToBeExcluded: " << modulesToBeExcluded.size() << std::endl; // apply modules selection if (!modulesToBeIncluded.empty()) { std::vector tmp; // The intersection of two sets is formed only by the elements that are // present in both sets - set_intersection(detIds_.begin(), detIds_.end(), - modulesToBeIncluded.begin(), modulesToBeIncluded.end(), + set_intersection(detIds_.begin(), + detIds_.end(), + modulesToBeIncluded.begin(), + modulesToBeIncluded.end(), inserter(tmp, tmp.begin())); swap(detIds_, tmp); } std::sort(detIds_.begin(), detIds_.end()); if (!modulesToBeExcluded.empty()) { - for (std::vector::const_iterator mod = - modulesToBeExcluded.begin(); - mod != modulesToBeExcluded.end(); mod++) { - - std::vector::iterator detid = - std::lower_bound(detIds_.begin(), detIds_.end(), *mod); + for (std::vector::const_iterator mod = modulesToBeExcluded.begin(); mod != modulesToBeExcluded.end(); + mod++) { + std::vector::iterator detid = std::lower_bound(detIds_.begin(), detIds_.end(), *mod); if (detid != detIds_.end()) detIds_.erase(detid); detid--; @@ -304,12 +268,11 @@ void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, // *** restrict to a particular subdetector *** if (*(SubDetectorsToBeExcluded_.begin()) != "none") { - std::vector tmp; - for (std::vector::const_iterator modIter_ = - SubDetectorsToBeExcluded_.begin(); - modIter_ != SubDetectorsToBeExcluded_.end(); modIter_++) { + for (std::vector::const_iterator modIter_ = SubDetectorsToBeExcluded_.begin(); + modIter_ != SubDetectorsToBeExcluded_.end(); + modIter_++) { tmp.clear(); if (*modIter_ == "TIB") { @@ -319,41 +282,33 @@ void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, } else if (*modIter_ == "TID") { SiStripSubStructure::getTIDDetectors(detIds_, tmp, tTopo, 0, 0, 0, 0); } else if (*modIter_ == "TEC") { - SiStripSubStructure::getTECDetectors(detIds_, tmp, tTopo, 0, 0, 0, 0, - 0, 0); + SiStripSubStructure::getTECDetectors(detIds_, tmp, tTopo, 0, 0, 0, 0, 0, 0); } else { - edm::LogWarning("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no " - "correct (name) subdetector to be excluded in your cfg" - << std::endl; + edm::LogWarning("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no " + "correct (name) subdetector to be excluded in your cfg" + << std::endl; } std::vector::iterator iterBegin_ = - std::lower_bound(detIds_.begin(), detIds_.end(), - *min_element(tmp.begin(), tmp.end())); + std::lower_bound(detIds_.begin(), detIds_.end(), *min_element(tmp.begin(), tmp.end())); std::vector::iterator iterEnd_ = - std::lower_bound(detIds_.begin(), detIds_.end(), - *max_element(tmp.begin(), tmp.end())); + std::lower_bound(detIds_.begin(), detIds_.end(), *max_element(tmp.begin(), tmp.end())); - for (std::vector::iterator detIter_ = iterEnd_; - detIter_ != iterBegin_ - 1; detIter_--) { + for (std::vector::iterator detIter_ = iterEnd_; detIter_ != iterBegin_ - 1; detIter_--) { detIds_.erase(detIter_); } - } // loop SubDetectorsToBeExcluded_ + } // loop SubDetectorsToBeExcluded_ } } - edm::LogInfo("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::selectModules] output detIds_: " - << detIds_.size() << std::endl; + edm::LogInfo("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::selectModules] output detIds_: " << detIds_.size() + << std::endl; // ----- // *** fill only one Module per layer *** - if (fPSet_.getParameter("ModulesToBeFilled") == - "onlyOneModulePerLayer") { - + if (fPSet_.getParameter("ModulesToBeFilled") == "onlyOneModulePerLayer") { std::vector tmp; std::vector layerDetIds; @@ -384,13 +339,11 @@ void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, } for (unsigned int i = 1; i < 10; i++) { tmp.clear(); - SiStripSubStructure::getTECDetectors(detIds_, tmp, tTopo, 1, i, 0, 0, 0, - 0); + SiStripSubStructure::getTECDetectors(detIds_, tmp, tTopo, 1, i, 0, 0, 0, 0); if (!tmp.empty()) { layerDetIds.push_back(*(tmp.begin())); } - SiStripSubStructure::getTECDetectors(detIds_, tmp, tTopo, 2, i, 0, 0, 0, - 0); + SiStripSubStructure::getTECDetectors(detIds_, tmp, tTopo, 2, i, 0, 0, 0, 0); if (!tmp.empty()) { layerDetIds.push_back(*(tmp.begin())); } @@ -401,49 +354,37 @@ void SiStripBaseCondObjDQM::selectModules(std::vector &detIds_, } // ----- -} // selectModules +} // selectModules // ----- //================================================= // ----- -void SiStripBaseCondObjDQM::getModMEs(ModMEs &CondObj_ME, - const uint32_t &detId_, - const TrackerTopology *tTopo) { - - std::map::const_iterator ModMEsMap_iter = - ModMEsMap_.find(detId_); +void SiStripBaseCondObjDQM::getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo) { + std::map::const_iterator ModMEsMap_iter = ModMEsMap_.find(detId_); if (ModMEsMap_iter != ModMEsMap_.end()) { - CondObj_ME = ModMEsMap_iter->second; - if ((CondObj_fillId_ == "ProfileAndCumul" || - CondObj_fillId_ == "onlyProfile") && - CondObj_ME.ProfileDistr) { + if ((CondObj_fillId_ == "ProfileAndCumul" || CondObj_fillId_ == "onlyProfile") && CondObj_ME.ProfileDistr) { CondObj_ME.ProfileDistr->Reset(); } - if ((CondObj_fillId_ == "ProfileAndCumul" || - CondObj_fillId_ == "onlyCumul") && - CondObj_ME.CumulDistr) { + if ((CondObj_fillId_ == "ProfileAndCumul" || CondObj_fillId_ == "onlyCumul") && CondObj_ME.CumulDistr) { CondObj_ME.CumulDistr->Reset(); } else { - edm::LogWarning("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::getModMEs] PLEASE CHECK : CondObj_fillId " - "option mispelled"; + edm::LogWarning("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::getModMEs] PLEASE CHECK : CondObj_fillId " + "option mispelled"; } return; } // --> profile defined for all CondData - if ((CondObj_fillId_ == "ProfileAndCumul" || - CondObj_fillId_ == "onlyProfile")) { + if ((CondObj_fillId_ == "ProfileAndCumul" || CondObj_fillId_ == "onlyProfile")) { bookProfileMEs(CondObj_ME, detId_, tTopo); } // --> cumul currently only defined for noise and apvgain - if ((CondObj_fillId_ == "ProfileAndCumul" || - CondObj_fillId_ == "onlyCumul") && + if ((CondObj_fillId_ == "ProfileAndCumul" || CondObj_fillId_ == "onlyCumul") && (CondObj_name_ == "noise" || CondObj_name_ == "apvgain")) bookCumulMEs(CondObj_ME, detId_, tTopo); @@ -454,21 +395,15 @@ void SiStripBaseCondObjDQM::getModMEs(ModMEs &CondObj_ME, //=============================================== // ----- //%FIXME: very long method, factorize -void SiStripBaseCondObjDQM::getSummaryMEs(ModMEs &CondObj_ME, - const uint32_t &detId_, - const TrackerTopology *tTopo) { - +void SiStripBaseCondObjDQM::getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo) { std::map::const_iterator SummaryMEsMap_iter; if (CondObj_name_ == "lorentzangle" && SummaryOnStringLevel_On_) { - SummaryMEsMap_iter = - SummaryMEsMap_.find(getStringNameAndId(detId_, tTopo).second); + SummaryMEsMap_iter = SummaryMEsMap_.find(getStringNameAndId(detId_, tTopo).second); } else if (CondObj_name_ == "bpcorrection" && SummaryOnStringLevel_On_) { - SummaryMEsMap_iter = - SummaryMEsMap_.find(getStringNameAndId(detId_, tTopo).second); + SummaryMEsMap_iter = SummaryMEsMap_.find(getStringNameAndId(detId_, tTopo).second); } else { - SummaryMEsMap_iter = - SummaryMEsMap_.find(getLayerNameAndId(detId_, tTopo).second); + SummaryMEsMap_iter = SummaryMEsMap_.find(getLayerNameAndId(detId_, tTopo).second); } if (SummaryMEsMap_iter != SummaryMEsMap_.end()) { @@ -481,11 +416,9 @@ void SiStripBaseCondObjDQM::getSummaryMEs(ModMEs &CondObj_ME, // derived classes // --> currently only profile summary defined for all condition objects except // quality - if ((CondObj_fillId_ == "ProfileAndCumul" || - CondObj_fillId_ == "onlyProfile") && - (CondObj_name_ == "pedestal" || CondObj_name_ == "noise" || - CondObj_name_ == "lowthreshold" || CondObj_name_ == "highthreshold" || - CondObj_name_ == "apvgain" || CondObj_name_ == "bpcorrection" || + if ((CondObj_fillId_ == "ProfileAndCumul" || CondObj_fillId_ == "onlyProfile") && + (CondObj_name_ == "pedestal" || CondObj_name_ == "noise" || CondObj_name_ == "lowthreshold" || + CondObj_name_ == "highthreshold" || CondObj_name_ == "apvgain" || CondObj_name_ == "bpcorrection" || CondObj_name_ == "lorentzangle")) { if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel")) if (!CondObj_ME.SummaryOfProfileDistr) { @@ -494,10 +427,8 @@ void SiStripBaseCondObjDQM::getSummaryMEs(ModMEs &CondObj_ME, } // --> currently only genuine cumul LA - if ((CondObj_fillId_ == "ProfileAndCumul" || - CondObj_fillId_ == "onlyCumul") && - (CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection" || - CondObj_name_ == "noise")) { + if ((CondObj_fillId_ == "ProfileAndCumul" || CondObj_fillId_ == "onlyCumul") && + (CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection" || CondObj_name_ == "noise")) { if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel")) if (!CondObj_ME.SummaryOfCumulDistr) { bookSummaryCumulMEs(CondObj_ME, detId_, tTopo); @@ -506,9 +437,8 @@ void SiStripBaseCondObjDQM::getSummaryMEs(ModMEs &CondObj_ME, // --> currently only summary as a function of detId for noise, pedestal and // apvgain - if (CondObj_name_ == "noise" || CondObj_name_ == "lowthreshold" || - CondObj_name_ == "highthreshold" || CondObj_name_ == "apvgain" || - CondObj_name_ == "pedestal" || CondObj_name_ == "quality") { + if (CondObj_name_ == "noise" || CondObj_name_ == "lowthreshold" || CondObj_name_ == "highthreshold" || + CondObj_name_ == "apvgain" || CondObj_name_ == "pedestal" || CondObj_name_ == "quality") { if (hPSet_.getParameter("FillSummaryAtLayerLevel")) if (!CondObj_ME.SummaryDistr) { bookSummaryMEs(CondObj_ME, detId_, tTopo); @@ -518,47 +448,40 @@ void SiStripBaseCondObjDQM::getSummaryMEs(ModMEs &CondObj_ME, if (CondObj_name_ == "lorentzangle" && SummaryOnStringLevel_On_) { // FIXME getStringNameandId takes time. not need to call it every timne. put // the call at the beginning of the method and caache the string - SummaryMEsMap_.insert( - std::make_pair(getStringNameAndId(detId_, tTopo).second, CondObj_ME)); + SummaryMEsMap_.insert(std::make_pair(getStringNameAndId(detId_, tTopo).second, CondObj_ME)); } else if (CondObj_name_ == "bpcorrection" && SummaryOnStringLevel_On_) { // FIXME getStringNameandId takes time. not need to call it every timne. put // the call at the beginning of the method and caache the string - SummaryMEsMap_.insert( - std::make_pair(getStringNameAndId(detId_, tTopo).second, CondObj_ME)); + SummaryMEsMap_.insert(std::make_pair(getStringNameAndId(detId_, tTopo).second, CondObj_ME)); } else { - SummaryMEsMap_.insert( - std::make_pair(getLayerNameAndId(detId_, tTopo).second, CondObj_ME)); + SummaryMEsMap_.insert(std::make_pair(getLayerNameAndId(detId_, tTopo).second, CondObj_ME)); } } // ---- //==================================================== // ----- -void SiStripBaseCondObjDQM::bookProfileMEs( - SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, - const TrackerTopology *tTopo) { - +void SiStripBaseCondObjDQM::bookProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, + const uint32_t &detId_, + const TrackerTopology *tTopo) { int hProfile_NchX = 0; double hProfile_LowX = 0; double hProfile_HighX = 0; std::string hProfile_description; - hProfile_description = - hPSet_.getParameter("Profile_description"); + hProfile_description = hPSet_.getParameter("Profile_description"); std::string hProfile_xTitle, hProfile_yTitle; hProfile_xTitle = hPSet_.getParameter("Profile_xTitle"); hProfile_yTitle = hPSet_.getParameter("Profile_yTitle"); if (CondObj_name_ != "apvgain") { - int nStrip = reader->getNumberOfApvsAndStripLength(detId_).first * 128; hProfile_NchX = nStrip; hProfile_LowX = 0.5; hProfile_HighX = nStrip + 0.5; } else { - int nApv = reader->getNumberOfApvsAndStripLength(detId_).first; hProfile_NchX = nApv; @@ -574,8 +497,7 @@ void SiStripBaseCondObjDQM::bookProfileMEs( std::string hProfile; hProfile = hProfile_Name; - CondObj_ME.ProfileDistr = dqmStore_->book1D( - hProfile_Name, hProfile, hProfile_NchX, hProfile_LowX, hProfile_HighX); + CondObj_ME.ProfileDistr = dqmStore_->book1D(hProfile_Name, hProfile, hProfile_NchX, hProfile_LowX, hProfile_HighX); CondObj_ME.ProfileDistr->setAxisTitle(hProfile_xTitle, 1); CondObj_ME.ProfileDistr->setAxisTitle(hProfile_yTitle, 2); dqmStore_->tag(CondObj_ME.ProfileDistr, detId_); @@ -584,10 +506,9 @@ void SiStripBaseCondObjDQM::bookProfileMEs( //============================================= // ----- -void SiStripBaseCondObjDQM::bookCumulMEs( - SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, - const TrackerTopology *tTopo) { - +void SiStripBaseCondObjDQM::bookCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, + const uint32_t &detId_, + const TrackerTopology *tTopo) { int hCumul_NchX = 0; double hCumul_LowX = 0; double hCumul_HighX = 0; @@ -612,8 +533,7 @@ void SiStripBaseCondObjDQM::bookCumulMEs( std::string hCumul_title; hCumul_title = hCumul_name; - CondObj_ME.CumulDistr = dqmStore_->book1D( - hCumul_name, hCumul_title, hCumul_NchX, hCumul_LowX, hCumul_HighX); + CondObj_ME.CumulDistr = dqmStore_->book1D(hCumul_name, hCumul_title, hCumul_NchX, hCumul_LowX, hCumul_HighX); CondObj_ME.CumulDistr->setAxisTitle(hCumul_xTitle, 1); CondObj_ME.CumulDistr->setAxisTitle(hCumul_yTitle, 2); dqmStore_->tag(CondObj_ME.CumulDistr, detId_); @@ -623,10 +543,9 @@ void SiStripBaseCondObjDQM::bookCumulMEs( //=========================================== // ----- //#FIXME: same comments: factorize, and remove any reference to derived classes -void SiStripBaseCondObjDQM::bookSummaryProfileMEs( - SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, - const TrackerTopology *tTopo) { - +void SiStripBaseCondObjDQM::bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, + const uint32_t &detId_, + const TrackerTopology *tTopo) { std::vector sameLayerDetIds_; int hSummaryOfProfile_NchX = 0; @@ -634,21 +553,17 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( double hSummaryOfProfile_HighX = 0; std::string hSummaryOfProfile_description; - hSummaryOfProfile_description = - hPSet_.getParameter("SummaryOfProfile_description"); + hSummaryOfProfile_description = hPSet_.getParameter("SummaryOfProfile_description"); std::string hSummaryOfProfile_xTitle, hSummaryOfProfile_yTitle; - hSummaryOfProfile_xTitle = - hPSet_.getParameter("SummaryOfProfile_xTitle"); - hSummaryOfProfile_yTitle = - hPSet_.getParameter("SummaryOfProfile_yTitle"); + hSummaryOfProfile_xTitle = hPSet_.getParameter("SummaryOfProfile_xTitle"); + hSummaryOfProfile_yTitle = hPSet_.getParameter("SummaryOfProfile_yTitle"); int hSummaryOfProfile_NchY; double hSummaryOfProfile_LowY, hSummaryOfProfile_HighY; hSummaryOfProfile_NchY = hPSet_.getParameter("SummaryOfProfile_NchY"); hSummaryOfProfile_LowY = hPSet_.getParameter("SummaryOfProfile_LowY"); - hSummaryOfProfile_HighY = - hPSet_.getParameter("SummaryOfProfile_HighY"); + hSummaryOfProfile_HighY = hPSet_.getParameter("SummaryOfProfile_HighY"); int nStrip, nApv, layerId_; @@ -660,14 +575,11 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( layerId_ = getLayerNameAndId(detId_, tTopo).second; } - if (CondObj_name_ == "pedestal" || CondObj_name_ == "noise" || - CondObj_name_ == "lowthreshold" || - CondObj_name_ == "highthreshold") { // plot in strip number + if (CondObj_name_ == "pedestal" || CondObj_name_ == "noise" || CondObj_name_ == "lowthreshold" || + CondObj_name_ == "highthreshold") { // plot in strip number - if ((layerId_ > 610 && - layerId_ < 620) || // TID & TEC have 768 strips at maximum - (layerId_ > 620 && layerId_ < 630) || - (layerId_ > 410 && layerId_ < 414) || + if ((layerId_ > 610 && layerId_ < 620) || // TID & TEC have 768 strips at maximum + (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) || (layerId_ > 420 && layerId_ < 424)) { nStrip = 768; } else { @@ -678,10 +590,8 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( hSummaryOfProfile_LowX = 0.5; hSummaryOfProfile_HighX = nStrip + 0.5; - } else if (((CondObj_name_ == "lorentzangle" || - CondObj_name_ == "bpcorrection") && - SummaryOnLayerLevel_On_) || - CondObj_name_ == "quality") { // plot in detId-number + } else if (((CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection") && SummaryOnLayerLevel_On_) || + CondObj_name_ == "quality") { // plot in detId-number // ----- // get detIds belonging to same layer to fill X-axis with detId-number @@ -689,32 +599,27 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( sameLayerDetIds_.clear(); switch (DetId(detId_).subdetId()) { - case StripSubdetector::TIB: - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tibLayer(detId_), 0, 0, - tTopo->tibString(detId_)); - break; - case StripSubdetector::TID: - SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0); - break; - case StripSubdetector::TOB: - SiStripSubStructure::getTOBDetectors( - activeDetIds, sameLayerDetIds_, tTopo, tTopo->tobLayer(detId_), 0, 0); - break; - case StripSubdetector::TEC: - SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0, 0, 0); - break; + case StripSubdetector::TIB: + SiStripSubStructure::getTIBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tibLayer(detId_), 0, 0, tTopo->tibString(detId_)); + break; + case StripSubdetector::TID: + SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0); + break; + case StripSubdetector::TOB: + SiStripSubStructure::getTOBDetectors(activeDetIds, sameLayerDetIds_, tTopo, tTopo->tobLayer(detId_), 0, 0); + break; + case StripSubdetector::TEC: + SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0, 0, 0); + break; } hSummaryOfProfile_NchX = sameLayerDetIds_.size(); hSummaryOfProfile_LowX = 0.5; hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5; - } else if ((CondObj_name_ == "lorentzangle" || - CondObj_name_ == "bpcorrection") && - SummaryOnStringLevel_On_) { // plot in detId-number + } else if ((CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection") && + SummaryOnStringLevel_On_) { // plot in detId-number // ----- // get detIds belonging to same string to fill X-axis with detId-number @@ -722,30 +627,25 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( sameLayerDetIds_.clear(); switch (DetId(detId_).subdetId()) { - case StripSubdetector::TIB: - if (tTopo->tibIsInternalString(detId_)) { - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tibLayer(detId_), 0, - 1, tTopo->tibString(detId_)); - } else if (tTopo->tibIsExternalString(detId_)) { - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tibLayer(detId_), 0, - 2, tTopo->tibString(detId_)); - } - break; - case StripSubdetector::TID: - SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0); - break; - case StripSubdetector::TOB: - SiStripSubStructure::getTOBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tobLayer(detId_), 0, - tTopo->tobRod(detId_)); - break; - case StripSubdetector::TEC: - SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0, 0, 0); - break; + case StripSubdetector::TIB: + if (tTopo->tibIsInternalString(detId_)) { + SiStripSubStructure::getTIBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tibLayer(detId_), 0, 1, tTopo->tibString(detId_)); + } else if (tTopo->tibIsExternalString(detId_)) { + SiStripSubStructure::getTIBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tibLayer(detId_), 0, 2, tTopo->tibString(detId_)); + } + break; + case StripSubdetector::TID: + SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0); + break; + case StripSubdetector::TOB: + SiStripSubStructure::getTOBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tobLayer(detId_), 0, tTopo->tobRod(detId_)); + break; + case StripSubdetector::TEC: + SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0, 0, 0); + break; } hSummaryOfProfile_NchX = sameLayerDetIds_.size(); @@ -753,11 +653,8 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5; } else if (CondObj_name_ == "apvgain") { - - if ((layerId_ > 610 && - layerId_ < 620) || // TID & TEC have 6 apvs at maximum - (layerId_ > 620 && layerId_ < 630) || - (layerId_ > 410 && layerId_ < 414) || + if ((layerId_ > 610 && layerId_ < 620) || // TID & TEC have 6 apvs at maximum + (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) || (layerId_ > 420 && layerId_ < 424)) { nApv = 6; } else { @@ -769,10 +666,9 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( hSummaryOfProfile_HighX = nApv + 0.5; } else { - edm::LogWarning("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::bookSummaryProfileMEs] PLEASE CHECK : " - "x-axis label in your cfg" - << std::endl; + edm::LogWarning("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::bookSummaryProfileMEs] PLEASE CHECK : " + "x-axis label in your cfg" + << std::endl; } uint32_t layer_ = 0; @@ -787,48 +683,45 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( int subdetectorId_ = ((detId_ >> 25) & 0x7); if (subdetectorId_ < 3 || subdetectorId_ > 6) { - edm::LogError("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::bookSummaryProfileMEs] WRONG INPUT : no " - "such subdetector type : " - << subdetectorId_ << " no folder set!" << std::endl; + edm::LogError("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::bookSummaryProfileMEs] WRONG INPUT : no " + "such subdetector type : " + << subdetectorId_ << " no folder set!" << std::endl; return; } // --- - if ((CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection") && - SummaryOnStringLevel_On_) { + if ((CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection") && SummaryOnStringLevel_On_) { hSummaryOfProfile_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getStringNameAndId(detId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getStringNameAndId(detId_, tTopo).first, ""); } else { hSummaryOfProfile_name = - hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", - getLayerNameAndId(detId_, tTopo).first, ""); + hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getLayerNameAndId(detId_, tTopo).first, ""); } std::string hSummaryOfProfile_title; hSummaryOfProfile_title = hSummaryOfProfile_name; - CondObj_ME.SummaryOfProfileDistr = dqmStore_->bookProfile( - hSummaryOfProfile_name, hSummaryOfProfile_title, hSummaryOfProfile_NchX, - hSummaryOfProfile_LowX, hSummaryOfProfile_HighX, hSummaryOfProfile_NchY, - 0., 0.); + CondObj_ME.SummaryOfProfileDistr = dqmStore_->bookProfile(hSummaryOfProfile_name, + hSummaryOfProfile_title, + hSummaryOfProfile_NchX, + hSummaryOfProfile_LowX, + hSummaryOfProfile_HighX, + hSummaryOfProfile_NchY, + 0., + 0.); // hSummaryOfProfile_LowY, // hSummaryOfProfile_HighY); CondObj_ME.SummaryOfProfileDistr->setAxisTitle(hSummaryOfProfile_xTitle, 1); CondObj_ME.SummaryOfProfileDistr->setAxisTitle(hSummaryOfProfile_yTitle, 2); - CondObj_ME.SummaryOfProfileDistr->setAxisRange(hSummaryOfProfile_LowY, - hSummaryOfProfile_HighY, 2); + CondObj_ME.SummaryOfProfileDistr->setAxisRange(hSummaryOfProfile_LowY, hSummaryOfProfile_HighY, 2); // ----- // in order to get the right detId-number labelled in right bin of x-axis if (CondObj_name_ == "quality") { - unsigned int iBin = 0; for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - iBin++; char sameLayerDetIds_Name[1024]; sprintf(sameLayerDetIds_Name, "%u", sameLayerDetIds_[i]); @@ -836,10 +729,8 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( } } if (CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection") { - // Put the detIds for the -z side as following the geometrical order: - reverse(sameLayerDetIds_.begin(), - sameLayerDetIds_.begin() + sameLayerDetIds_.size() / 2); + reverse(sameLayerDetIds_.begin(), sameLayerDetIds_.begin() + sameLayerDetIds_.size() / 2); unsigned int iBin = 0; for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { @@ -852,26 +743,20 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( if (SummaryOnStringLevel_On_) { // Label with module position instead of detIds: char sameLayerDetIds_Name[1024]; - if (subdetectorId_ == 3) { // re-abelling for TIB + if (subdetectorId_ == 3) { // re-abelling for TIB if (tTopo->tibIsZPlusSide(sameLayerDetIds_[i])) { - sprintf(sameLayerDetIds_Name, "%i", - tTopo->tibModule(sameLayerDetIds_[i])); + sprintf(sameLayerDetIds_Name, "%i", tTopo->tibModule(sameLayerDetIds_[i])); } else if (tTopo->tibIsZMinusSide(sameLayerDetIds_[i])) { - sprintf(sameLayerDetIds_Name, "%i", - -tTopo->tibModule(sameLayerDetIds_[i])); + sprintf(sameLayerDetIds_Name, "%i", -tTopo->tibModule(sameLayerDetIds_[i])); } - CondObj_ME.SummaryOfProfileDistr->setBinLabel(iBin, - sameLayerDetIds_Name); - } else if (subdetectorId_ == 5) { // re-abelling for TOB + CondObj_ME.SummaryOfProfileDistr->setBinLabel(iBin, sameLayerDetIds_Name); + } else if (subdetectorId_ == 5) { // re-abelling for TOB if (tTopo->tobIsZPlusSide(sameLayerDetIds_[i])) { - sprintf(sameLayerDetIds_Name, "%i", - tTopo->tobModule(sameLayerDetIds_[i])); + sprintf(sameLayerDetIds_Name, "%i", tTopo->tobModule(sameLayerDetIds_[i])); } else if (tTopo->tobIsZMinusSide(sameLayerDetIds_[i])) { - sprintf(sameLayerDetIds_Name, "%i", - -tTopo->tobModule(sameLayerDetIds_[i])); + sprintf(sameLayerDetIds_Name, "%i", -tTopo->tobModule(sameLayerDetIds_[i])); } - CondObj_ME.SummaryOfProfileDistr->setBinLabel(iBin, - sameLayerDetIds_Name); + CondObj_ME.SummaryOfProfileDistr->setBinLabel(iBin, sameLayerDetIds_Name); } } } @@ -880,29 +765,25 @@ void SiStripBaseCondObjDQM::bookSummaryProfileMEs( dqmStore_->tag(CondObj_ME.SummaryOfProfileDistr, layer_); - } // if "lorentzangle" + } // if "lorentzangle" } // ---- //============================================================= // ----- -void SiStripBaseCondObjDQM::bookSummaryCumulMEs( - SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, - const TrackerTopology *tTopo) { - +void SiStripBaseCondObjDQM::bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, + const uint32_t &detId_, + const TrackerTopology *tTopo) { int hSummaryOfCumul_NchX = 0; double hSummaryOfCumul_LowX = 0; double hSummaryOfCumul_HighX = 0; std::string hSummaryOfCumul_description; - hSummaryOfCumul_description = - hPSet_.getParameter("SummaryOfCumul_description"); + hSummaryOfCumul_description = hPSet_.getParameter("SummaryOfCumul_description"); std::string hSummaryOfCumul_xTitle, hSummaryOfCumul_yTitle; - hSummaryOfCumul_xTitle = - hPSet_.getParameter("SummaryOfCumul_xTitle"); - hSummaryOfCumul_yTitle = - hPSet_.getParameter("SummaryOfCumul_yTitle"); + hSummaryOfCumul_xTitle = hPSet_.getParameter("SummaryOfCumul_xTitle"); + hSummaryOfCumul_yTitle = hPSet_.getParameter("SummaryOfCumul_yTitle"); hSummaryOfCumul_NchX = hPSet_.getParameter("SummaryOfCumul_NchX"); hSummaryOfCumul_LowX = hPSet_.getParameter("SummaryOfCumul_LowX"); @@ -920,32 +801,27 @@ void SiStripBaseCondObjDQM::bookSummaryCumulMEs( int subdetectorId_ = ((detId_ >> 25) & 0x7); if (subdetectorId_ < 3 || subdetectorId_ > 6) { - edm::LogError("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::bookSummaryCumulMEs] WRONG INPUT : no such " - "subdetector type : " - << subdetectorId_ << " no folder set!" << std::endl; + edm::LogError("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::bookSummaryCumulMEs] WRONG INPUT : no such " + "subdetector type : " + << subdetectorId_ << " no folder set!" << std::endl; return; } // --- // LA and BP Histos are plotted for each string: - if ((CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection") && - SummaryOnStringLevel_On_) { - hSummaryOfCumul_name = hidmanager.createHistoLayer( - hSummaryOfCumul_description, "layer", - getStringNameAndId(detId_, tTopo).first, ""); + if ((CondObj_name_ == "lorentzangle" || CondObj_name_ == "bpcorrection") && SummaryOnStringLevel_On_) { + hSummaryOfCumul_name = + hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", getStringNameAndId(detId_, tTopo).first, ""); } else { hSummaryOfCumul_name = - hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", - getLayerNameAndId(detId_, tTopo).first, ""); + hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", getLayerNameAndId(detId_, tTopo).first, ""); } std::string hSummaryOfCumul_title; hSummaryOfCumul_title = hSummaryOfCumul_name; CondObj_ME.SummaryOfCumulDistr = dqmStore_->book1D( - hSummaryOfCumul_name, hSummaryOfCumul_title, hSummaryOfCumul_NchX, - hSummaryOfCumul_LowX, hSummaryOfCumul_HighX); + hSummaryOfCumul_name, hSummaryOfCumul_title, hSummaryOfCumul_NchX, hSummaryOfCumul_LowX, hSummaryOfCumul_HighX); CondObj_ME.SummaryOfCumulDistr->setAxisTitle(hSummaryOfCumul_xTitle, 1); CondObj_ME.SummaryOfCumulDistr->setAxisTitle(hSummaryOfCumul_yTitle, 2); @@ -957,10 +833,9 @@ void SiStripBaseCondObjDQM::bookSummaryCumulMEs( //================================================ // ----- // FIXME same as before: factorize -void SiStripBaseCondObjDQM::bookSummaryMEs( - SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_, - const TrackerTopology *tTopo) { - +void SiStripBaseCondObjDQM::bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, + const uint32_t &detId_, + const TrackerTopology *tTopo) { std::vector sameLayerDetIds_; int hSummary_NchX = 0; @@ -968,8 +843,7 @@ void SiStripBaseCondObjDQM::bookSummaryMEs( double hSummary_HighX = 0; std::string hSummary_description; - hSummary_description = - hPSet_.getParameter("Summary_description"); + hSummary_description = hPSet_.getParameter("Summary_description"); std::string hSummary_xTitle, hSummary_yTitle; hSummary_xTitle = hPSet_.getParameter("Summary_xTitle"); @@ -1004,24 +878,21 @@ void SiStripBaseCondObjDQM::bookSummaryMEs( int subdetectorId_ = ((detId_ >> 25) & 0x7); if (subdetectorId_ < 3 || subdetectorId_ > 6) { - edm::LogError("SiStripBaseCondObjDQM") - << "[SiStripBaseCondObjDQM::bookSummaryMEs] WRONG INPUT : no such " - "subdetector type : " - << subdetectorId_ << " no folder set!" << std::endl; + edm::LogError("SiStripBaseCondObjDQM") << "[SiStripBaseCondObjDQM::bookSummaryMEs] WRONG INPUT : no such " + "subdetector type : " + << subdetectorId_ << " no folder set!" << std::endl; return; } // --- hSummary_name = - hidmanager.createHistoLayer(hSummary_description, "layer", - getLayerNameAndId(detId_, tTopo).first, ""); + hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(detId_, tTopo).first, ""); std::string hSummary_title; hSummary_title = hSummary_name; CondObj_ME.SummaryDistr = dqmStore_->bookProfile( - hSummary_name, hSummary_title, hSummary_NchX, hSummary_LowX, - hSummary_HighX, hSummary_NchY, 0., 0.); + hSummary_name, hSummary_title, hSummary_NchX, hSummary_LowX, hSummary_HighX, hSummary_NchY, 0., 0.); // hSummary_LowY, // hSummary_HighY); CondObj_ME.SummaryDistr->setAxisTitle(hSummary_xTitle, 1); @@ -1033,7 +904,6 @@ void SiStripBaseCondObjDQM::bookSummaryMEs( unsigned int iBin = 0; for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - iBin++; char sameLayerDetIds_Name[1024]; sprintf(sameLayerDetIds_Name, "%u", sameLayerDetIds_[i]); @@ -1047,16 +917,14 @@ void SiStripBaseCondObjDQM::bookSummaryMEs( //========================================================== // ----- -std::pair -SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, - const TrackerTopology *tTopo) { - +std::pair SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, + const TrackerTopology *tTopo) { int subdetectorId_ = ((detId_ >> 25) & 0x7); int layerId_ = 0; std::stringstream layerName; - if (subdetectorId_ == 3) { // TIB + if (subdetectorId_ == 3) { // TIB for (unsigned int i = 1; i < 5; i++) { if (tTopo->tibLayer(detId_) == i) { @@ -1067,9 +935,9 @@ SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, } - else if (subdetectorId_ == 4) { // TIDD + else if (subdetectorId_ == 4) { // TIDD - if (tTopo->tidSide(detId_) == 1) { // TIDD side 1 + if (tTopo->tidSide(detId_) == 1) { // TIDD side 1 for (unsigned int i = 1; i < 4; i++) { if (tTopo->tidWheel(detId_) == i) { @@ -1080,7 +948,7 @@ SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, } - else if (tTopo->tidSide(detId_) == 2) { // TIDD side 2 + else if (tTopo->tidSide(detId_) == 2) { // TIDD side 2 for (unsigned int i = 1; i < 4; i++) { if (tTopo->tidWheel(detId_) == i) { @@ -1092,7 +960,7 @@ SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, } - else if (subdetectorId_ == 5) { // TOB + else if (subdetectorId_ == 5) { // TOB for (unsigned int i = 1; i < 7; i++) { if (tTopo->tobLayer(detId_) == i) { @@ -1103,9 +971,9 @@ SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, } - else if (subdetectorId_ == 6) { // TEC + else if (subdetectorId_ == 6) { // TEC - if (tTopo->tecSide(detId_) == 1) { // TEC side 1 + if (tTopo->tecSide(detId_) == 1) { // TEC side 1 for (unsigned int i = 1; i < 10; i++) { if (tTopo->tecWheel(detId_) == i) { @@ -1116,7 +984,7 @@ SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, } - else if (tTopo->tecSide(detId_) == 2) { // TEC side 2 + else if (tTopo->tecSide(detId_) == 2) { // TEC side 2 for (unsigned int i = 1; i < 10; i++) { if (tTopo->tecWheel(detId_) == i) { @@ -1133,74 +1001,64 @@ SiStripBaseCondObjDQM::getLayerNameAndId(const uint32_t &detId_, //================================================= //--------------- -std::pair -SiStripBaseCondObjDQM::getStringNameAndId(const uint32_t &detId_, - const TrackerTopology *tTopo) { - +std::pair SiStripBaseCondObjDQM::getStringNameAndId(const uint32_t &detId_, + const TrackerTopology *tTopo) { int subdetectorId_ = ((detId_ >> 25) & 0x7); int layerStringId_ = 0; std::stringstream layerStringName; - if (subdetectorId_ == 3) { // TIB - if (tTopo->tibLayer(detId_) == 1 && - tTopo->tibIsInternalString(detId_)) { // 1st layer int + if (subdetectorId_ == 3) { // TIB + if (tTopo->tibLayer(detId_) == 1 && tTopo->tibIsInternalString(detId_)) { // 1st layer int for (unsigned int i = 1; i < 27; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L1_Int_Str_" << i; layerStringId_ = 30110 + i; } } - } else if (tTopo->tibLayer(detId_) == 1 && - tTopo->tibIsExternalString(detId_)) { // 1st layer ext + } else if (tTopo->tibLayer(detId_) == 1 && tTopo->tibIsExternalString(detId_)) { // 1st layer ext for (unsigned int i = 1; i < 31; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L1_Ext_Str_" << i; layerStringId_ = 301200 + i; } } - } else if (tTopo->tibLayer(detId_) == 2 && - tTopo->tibIsInternalString(detId_)) { // 2nd layer int + } else if (tTopo->tibLayer(detId_) == 2 && tTopo->tibIsInternalString(detId_)) { // 2nd layer int for (unsigned int i = 1; i < 35; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L2_Int_Str_" << i; layerStringId_ = 302100 + i; } } - } else if (tTopo->tibLayer(detId_) == 2 && - tTopo->tibIsExternalString(detId_)) { // 2nd layer ext + } else if (tTopo->tibLayer(detId_) == 2 && tTopo->tibIsExternalString(detId_)) { // 2nd layer ext for (unsigned int i = 1; i < 39; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L2_Ext_Str_" << i; layerStringId_ = 302200 + i; } } - } else if (tTopo->tibLayer(detId_) == 3 && - tTopo->tibIsInternalString(detId_)) { // 3rd layer int + } else if (tTopo->tibLayer(detId_) == 3 && tTopo->tibIsInternalString(detId_)) { // 3rd layer int for (unsigned int i = 1; i < 45; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L3_Int_Str_" << i; layerStringId_ = 303100 + i; } } - } else if (tTopo->tibLayer(detId_) == 3 && - tTopo->tibIsExternalString(detId_)) { // 3rd layer ext + } else if (tTopo->tibLayer(detId_) == 3 && tTopo->tibIsExternalString(detId_)) { // 3rd layer ext for (unsigned int i = 1; i < 47; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L3_Ext_Str_" << i; layerStringId_ = 303200 + i; } } - } else if (tTopo->tibLayer(detId_) == 4 && - tTopo->tibIsInternalString(detId_)) { // 4th layer int + } else if (tTopo->tibLayer(detId_) == 4 && tTopo->tibIsInternalString(detId_)) { // 4th layer int for (unsigned int i = 1; i < 53; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L4_Int_Str_" << i; layerStringId_ = 304100 + i; } } - } else if (tTopo->tibLayer(detId_) == 4 && - tTopo->tibIsExternalString(detId_)) { // 4th layer ext + } else if (tTopo->tibLayer(detId_) == 4 && tTopo->tibIsExternalString(detId_)) { // 4th layer ext for (unsigned int i = 1; i < 57; i++) { if (tTopo->tibString(detId_) == i) { layerStringName << "TIB_L4_Ext_Str_" << i; @@ -1208,45 +1066,45 @@ SiStripBaseCondObjDQM::getStringNameAndId(const uint32_t &detId_, } } } - } // TIB + } // TIB - else if (subdetectorId_ == 5) { // TOB - if (tTopo->tobLayer(detId_) == 1) { // 1st layer + else if (subdetectorId_ == 5) { // TOB + if (tTopo->tobLayer(detId_) == 1) { // 1st layer for (unsigned int i = 1; i < 43; i++) { if (tTopo->tobRod(detId_) == i) { layerStringName << "TOB_L1_Rod_" << i; layerStringId_ = 50100 + i; } } - } else if (tTopo->tobLayer(detId_) == 2) { // 2nd layer + } else if (tTopo->tobLayer(detId_) == 2) { // 2nd layer for (unsigned int i = 1; i < 49; i++) { if (tTopo->tobRod(detId_) == i) { layerStringName << "TOB_L2_Rod_" << i; layerStringId_ = 50200 + i; } } - } else if (tTopo->tobLayer(detId_) == 3) { // 3rd layer + } else if (tTopo->tobLayer(detId_) == 3) { // 3rd layer for (unsigned int i = 1; i < 55; i++) { if (tTopo->tobRod(detId_) == i) { layerStringName << "TOB_L3_Rod_" << i; layerStringId_ = 50300 + i; } } - } else if (tTopo->tobLayer(detId_) == 4) { // 4th layer + } else if (tTopo->tobLayer(detId_) == 4) { // 4th layer for (unsigned int i = 1; i < 61; i++) { if (tTopo->tobRod(detId_) == i) { layerStringName << "TOB_L4_Rod_" << i; layerStringId_ = 50400 + i; } } - } else if (tTopo->tobLayer(detId_) == 5) { // 5th layer + } else if (tTopo->tobLayer(detId_) == 5) { // 5th layer for (unsigned int i = 1; i < 67; i++) { if (tTopo->tobRod(detId_) == i) { layerStringName << "TOB_L5_Rod_" << i; layerStringId_ = 50500 + i; } } - } else if (tTopo->tobLayer(detId_) == 6) { // 6st layer + } else if (tTopo->tobLayer(detId_) == 6) { // 6st layer for (unsigned int i = 1; i < 75; i++) { if (tTopo->tobRod(detId_) == i) { layerStringName << "TOB_L6_Rod_" << i; @@ -1254,58 +1112,46 @@ SiStripBaseCondObjDQM::getStringNameAndId(const uint32_t &detId_, } } } - } // TOB + } // TOB return std::make_pair(layerStringName.str(), layerStringId_); } //======================== -std::vector SiStripBaseCondObjDQM::GetSameLayerDetId( - const std::vector &activeDetIds, uint32_t selDetId, - const TrackerTopology *tTopo) { - +std::vector SiStripBaseCondObjDQM::GetSameLayerDetId(const std::vector &activeDetIds, + uint32_t selDetId, + const TrackerTopology *tTopo) { std::vector sameLayerDetIds; sameLayerDetIds.clear(); switch (DetId(selDetId).subdetId()) { - case StripSubdetector::TIB: - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds, tTopo, - tTopo->tibLayer(selDetId), 0, 0, 0); - break; - case StripSubdetector::TID: - SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds, tTopo, - tTopo->tidSide(selDetId), - tTopo->tidWheel(selDetId), 0, 0); - break; - case StripSubdetector::TOB: - SiStripSubStructure::getTOBDetectors(activeDetIds, sameLayerDetIds, tTopo, - tTopo->tobLayer(selDetId), 0, 0); - break; - case StripSubdetector::TEC: - SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds, tTopo, - tTopo->tecSide(selDetId), - tTopo->tecWheel(selDetId), 0, 0, 0, 0); - break; + case StripSubdetector::TIB: + SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds, tTopo, tTopo->tibLayer(selDetId), 0, 0, 0); + break; + case StripSubdetector::TID: + SiStripSubStructure::getTIDDetectors( + activeDetIds, sameLayerDetIds, tTopo, tTopo->tidSide(selDetId), tTopo->tidWheel(selDetId), 0, 0); + break; + case StripSubdetector::TOB: + SiStripSubStructure::getTOBDetectors(activeDetIds, sameLayerDetIds, tTopo, tTopo->tobLayer(selDetId), 0, 0); + break; + case StripSubdetector::TEC: + SiStripSubStructure::getTECDetectors( + activeDetIds, sameLayerDetIds, tTopo, tTopo->tecSide(selDetId), tTopo->tecWheel(selDetId), 0, 0, 0, 0); + break; } return sameLayerDetIds; } //========================== -void SiStripBaseCondObjDQM::bookTkMap(const std::string &TkMapname) { - tkMap = new TrackerMap(TkMapname); -} +void SiStripBaseCondObjDQM::bookTkMap(const std::string &TkMapname) { tkMap = new TrackerMap(TkMapname); } //========================== -void SiStripBaseCondObjDQM::fillTkMap(const uint32_t &detid, - const float &value) { - tkMap->fill(detid, value); -} +void SiStripBaseCondObjDQM::fillTkMap(const uint32_t &detid, const float &value) { tkMap->fill(detid, value); } //========================== -void SiStripBaseCondObjDQM::saveTkMap(const std::string &TkMapname, - double minValue, double maxValue) { - +void SiStripBaseCondObjDQM::saveTkMap(const std::string &TkMapname, double minValue, double maxValue) { if (!tkMapScaler.empty()) { // check that saturation is below x% below minValue and above minValue, and // in case re-arrange. @@ -1335,14 +1181,12 @@ void SiStripBaseCondObjDQM::saveTkMap(const std::string &TkMapname, // reset maxValue; if (maxValue < imax) { - edm::LogInfo("SiStripBaseCondObjDQM") - << "Resetting TkMap maxValue from " << maxValue << " to " << imax; + edm::LogInfo("SiStripBaseCondObjDQM") << "Resetting TkMap maxValue from " << maxValue << " to " << imax; maxValue = imax; } // reset minValue; if (minValue > imin) { - edm::LogInfo("SiStripBaseCondObjDQM") - << "Resetting TkMap minValue from " << minValue << " to " << imin; + edm::LogInfo("SiStripBaseCondObjDQM") << "Resetting TkMap minValue from " << minValue << " to " << imin; minValue = imin; } } @@ -1354,14 +1198,11 @@ void SiStripBaseCondObjDQM::saveTkMap(const std::string &TkMapname, //========================== void SiStripBaseCondObjDQM::end() { - edm::LogInfo("SiStripBaseCondObjDQM") - << "SiStripBaseCondObjDQM::end" << std::endl; + edm::LogInfo("SiStripBaseCondObjDQM") << "SiStripBaseCondObjDQM::end" << std::endl; } //========================== -void SiStripBaseCondObjDQM::fillModMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripBaseCondObjDQM::fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -1369,49 +1210,40 @@ void SiStripBaseCondObjDQM::fillModMEs( ModMEs CondObj_ME; - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); ++detIter_) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + ++detIter_) { fillMEsForDet(CondObj_ME, *detIter_, tTopo); } } //========================== -void SiStripBaseCondObjDQM::fillSummaryMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripBaseCondObjDQM::fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); const TrackerTopology *const tTopo = tTopoHandle.product(); - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo); } - for (std::map::iterator iter = SummaryMEsMap_.begin(); - iter != SummaryMEsMap_.end(); iter++) { - + for (std::map::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) { ModMEs selME; selME = iter->second; if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter("OutputSummaryProfileAtLayerLevelAsImage")) { - - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { - + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { TCanvas c1("c1"); selME.SummaryOfProfileDistr->getTProfile()->Draw(); - std::string name( - selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); + std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); name += ".png"; c1.Print(name.c_str()); } } if (hPSet_.getParameter("FillSummaryAtLayerLevel") && fPSet_.getParameter("OutputSummaryAtLayerLevelAsImage")) { - TCanvas c1("c1"); selME.SummaryDistr->getTH1()->Draw(); std::string name(selME.SummaryDistr->getTH1()->GetTitle()); @@ -1419,12 +1251,8 @@ void SiStripBaseCondObjDQM::fillSummaryMEs( c1.Print(name.c_str()); } if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel") && - fPSet_.getParameter( - "OutputCumulativeSummaryAtLayerLevelAsImage")) { - - if (CondObj_fillId_ == "onlyCumul" || - CondObj_fillId_ == "ProfileAndCumul") { - + fPSet_.getParameter("OutputCumulativeSummaryAtLayerLevelAsImage")) { + if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") { TCanvas c1("c1"); selME.SummaryOfCumulDistr->getTH1()->Draw(); std::string name(selME.SummaryOfCumulDistr->getTH1()->GetTitle()); diff --git a/DQM/SiStripMonitorSummary/src/SiStripCablingDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripCablingDQM.cc index d537f8f4e932a..57c73ef8518f6 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripCablingDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripCablingDQM.cc @@ -10,13 +10,11 @@ SiStripCablingDQM::SiStripCablingDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet) : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) { - // Build the Histo_TkMap: if (HistoMaps_On_) { edm::ESHandle tkDetMapHandle; eSetup.get().get(tkDetMapHandle); - Tk_HM_ = std::make_unique( - tkDetMapHandle.product(), "SiStrip/Histo_Map", "Cabling_TkMap", 0.); + Tk_HM_ = std::make_unique(tkDetMapHandle.product(), "SiStrip/Histo_Map", "Cabling_TkMap", 0.); } } // ----- @@ -27,7 +25,6 @@ SiStripCablingDQM::~SiStripCablingDQM() {} // ----- void SiStripCablingDQM::getActiveDetIds(const edm::EventSetup &eSetup) { - // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; eSetup.get().get(tTopoHandle); @@ -70,73 +67,65 @@ void SiStripCablingDQM::getActiveDetIds(const edm::EventSetup &eSetup) { if (HistoMaps_On_) { Tk_HM_->fill(detId, cablingHandle_->nApvPairs(detId) * 2); } - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { - + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { int32_t n_conn = 0; - for (uint32_t connDet_i = 0; - connDet_i < cablingHandle_->getConnections(detId).size(); - connDet_i++) { + for (uint32_t connDet_i = 0; connDet_i < cablingHandle_->getConnections(detId).size(); connDet_i++) { if (cablingHandle_->getConnections(detId)[connDet_i] != nullptr && - cablingHandle_->getConnections(detId)[connDet_i]->isConnected() != - 0) + cablingHandle_->getConnections(detId)[connDet_i]->isConnected() != 0) n_conn++; } fillTkMap(detId, n_conn * 2.); } switch (subdet.subdetId()) { - case StripSubdetector::TIB: { - int i = tTopo->tibLayer(detId) - 1; - counterTIB[i]++; - break; - } - case StripSubdetector::TID: { - int j = tTopo->tidWheel(detId) - 1; - int side = tTopo->tidSide(detId); - if (side == 2) { - counterTID[0][j]++; - } else if (side == 1) { - counterTID[1][j]++; + case StripSubdetector::TIB: { + int i = tTopo->tibLayer(detId) - 1; + counterTIB[i]++; + break; } - break; - } - case StripSubdetector::TOB: { - int i = tTopo->tobLayer(detId) - 1; - counterTOB[i]++; - break; - } - case StripSubdetector::TEC: { - int j = tTopo->tecWheel(detId) - 1; - int side = tTopo->tecSide(detId); - if (side == 2) { - counterTEC[0][j]++; - } else if (side == 1) { - counterTEC[1][j]++; + case StripSubdetector::TID: { + int j = tTopo->tidWheel(detId) - 1; + int side = tTopo->tidSide(detId); + if (side == 2) { + counterTID[0][j]++; + } else if (side == 1) { + counterTID[1][j]++; + } + break; + } + case StripSubdetector::TOB: { + int i = tTopo->tobLayer(detId) - 1; + counterTOB[i]++; + break; + } + case StripSubdetector::TEC: { + int j = tTopo->tecWheel(detId) - 1; + int side = tTopo->tecSide(detId); + if (side == 2) { + counterTEC[0][j]++; + } else if (side == 1) { + counterTEC[1][j]++; + } + break; } - break; - } } - } // idet + } // idet // obtained from tracker.dat and hard-coded int TIBDetIds[4] = {672, 864, 540, 648}; int TIDDetIds[2][3] = {{136, 136, 136}, {136, 136, 136}}; int TOBDetIds[6] = {1008, 1152, 648, 720, 792, 888}; - int TECDetIds[2][9] = {{408, 408, 408, 360, 360, 360, 312, 312, 272}, - {408, 408, 408, 360, 360, 360, 312, 312, 272}}; + int TECDetIds[2][9] = {{408, 408, 408, 360, 360, 360, 312, 312, 272}, {408, 408, 408, 360, 360, 360, 312, 312, 272}}; DQMStore *dqmStore_ = edm::Service().operator->(); - std::string FolderName = fPSet_.getParameter( - "FolderName_For_QualityAndCabling_SummaryHistos"); + std::string FolderName = fPSet_.getParameter("FolderName_For_QualityAndCabling_SummaryHistos"); dqmStore_->setCurrentFolder(FolderName); // dqmStore_->cd("SiStrip/MechanicalView/"); MonitorElement *ME; - ME = dqmStore_->book2D("SummaryOfCabling", "SummaryOfCabling", 6, 0.5, 6.5, 9, - 0.5, 9.5); + ME = dqmStore_->book2D("SummaryOfCabling", "SummaryOfCabling", 6, 0.5, 6.5, 9, 0.5, 9.5); ME->setAxisTitle("Sub Det", 1); ME->setAxisTitle("Layer", 2); @@ -168,7 +157,6 @@ void SiStripCablingDQM::getActiveDetIds(const edm::EventSetup &eSetup) { } if (fPSet_.getParameter("OutputSummaryAtLayerLevelAsImage")) { - TCanvas c1("c1"); ME->getTH1()->Draw("TEXT"); ME->getTH1()->SetStats(kFALSE); diff --git a/DQM/SiStripMonitorSummary/src/SiStripClassToMonitorCondData.cc b/DQM/SiStripMonitorSummary/src/SiStripClassToMonitorCondData.cc index 74ce5b4741bb9..8ae3c86a0ee29 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripClassToMonitorCondData.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripClassToMonitorCondData.cc @@ -59,22 +59,15 @@ // // ----- Constructor // -SiStripClassToMonitorCondData::SiStripClassToMonitorCondData( - edm::ParameterSet const &iConfig) - : conf_(iConfig) { - +SiStripClassToMonitorCondData::SiStripClassToMonitorCondData(edm::ParameterSet const &iConfig) : conf_(iConfig) { monitorPedestals_ = iConfig.getParameter("MonitorSiStripPedestal"); monitorNoises_ = iConfig.getParameter("MonitorSiStripNoise"); monitorQuality_ = iConfig.getParameter("MonitorSiStripQuality"); monitorApvGains_ = iConfig.getParameter("MonitorSiStripApvGain"); - monitorLorentzAngle_ = - iConfig.getParameter("MonitorSiStripLorentzAngle"); - monitorBackPlaneCorrection_ = - iConfig.getParameter("MonitorSiStripBackPlaneCorrection"); - monitorLowThreshold_ = - iConfig.getParameter("MonitorSiStripLowThreshold"); - monitorHighThreshold_ = - iConfig.getParameter("MonitorSiStripHighThreshold"); + monitorLorentzAngle_ = iConfig.getParameter("MonitorSiStripLorentzAngle"); + monitorBackPlaneCorrection_ = iConfig.getParameter("MonitorSiStripBackPlaneCorrection"); + monitorLowThreshold_ = iConfig.getParameter("MonitorSiStripLowThreshold"); + monitorHighThreshold_ = iConfig.getParameter("MonitorSiStripHighThreshold"); monitorCabling_ = iConfig.getParameter("MonitorSiStripCabling"); } // ----- @@ -83,7 +76,6 @@ SiStripClassToMonitorCondData::SiStripClassToMonitorCondData( // ----- Destructor // SiStripClassToMonitorCondData::~SiStripClassToMonitorCondData() { - if (monitorPedestals_) { delete pedestalsDQM_; } @@ -117,86 +109,82 @@ SiStripClassToMonitorCondData::~SiStripClassToMonitorCondData() { // // ----- beginRun // -void SiStripClassToMonitorCondData::beginRun(edm::RunNumber_t iRun, - edm::EventSetup const &eSetup) { - +void SiStripClassToMonitorCondData::beginRun(edm::RunNumber_t iRun, edm::EventSetup const &eSetup) { if (monitorPedestals_) { - pedestalsDQM_ = new SiStripPedestalsDQM( - eSetup, iRun, - conf_.getParameter("SiStripPedestalsDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + pedestalsDQM_ = new SiStripPedestalsDQM(eSetup, + iRun, + conf_.getParameter("SiStripPedestalsDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorNoises_) { - noisesDQM_ = new SiStripNoisesDQM( - eSetup, iRun, - conf_.getParameter("SiStripNoisesDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + noisesDQM_ = new SiStripNoisesDQM(eSetup, + iRun, + conf_.getParameter("SiStripNoisesDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorQuality_) { - qualityDQM_ = new SiStripQualityDQM( - eSetup, iRun, - conf_.getParameter("SiStripQualityDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + qualityDQM_ = new SiStripQualityDQM(eSetup, + iRun, + conf_.getParameter("SiStripQualityDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorApvGains_) { - apvgainsDQM_ = new SiStripApvGainsDQM( - eSetup, iRun, - conf_.getParameter("SiStripApvGainsDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + apvgainsDQM_ = new SiStripApvGainsDQM(eSetup, + iRun, + conf_.getParameter("SiStripApvGainsDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorLorentzAngle_) { - lorentzangleDQM_ = new SiStripLorentzAngleDQM( - eSetup, iRun, - conf_.getParameter("SiStripLorentzAngleDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + lorentzangleDQM_ = new SiStripLorentzAngleDQM(eSetup, + iRun, + conf_.getParameter("SiStripLorentzAngleDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorBackPlaneCorrection_) { - bpcorrectionDQM_ = new SiStripBackPlaneCorrectionDQM( - eSetup, iRun, - conf_.getParameter( - "SiStripBackPlaneCorrectionDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + bpcorrectionDQM_ = + new SiStripBackPlaneCorrectionDQM(eSetup, + iRun, + conf_.getParameter("SiStripBackPlaneCorrectionDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorLowThreshold_) { - lowthresholdDQM_ = new SiStripThresholdDQM( - eSetup, iRun, - conf_.getParameter("SiStripLowThresholdDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + lowthresholdDQM_ = new SiStripThresholdDQM(eSetup, + iRun, + conf_.getParameter("SiStripLowThresholdDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorHighThreshold_) { - highthresholdDQM_ = new SiStripThresholdDQM( - eSetup, iRun, - conf_.getParameter("SiStripHighThresholdDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + highthresholdDQM_ = new SiStripThresholdDQM(eSetup, + iRun, + conf_.getParameter("SiStripHighThresholdDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorCabling_) { - cablingDQM_ = new SiStripCablingDQM( - eSetup, iRun, - conf_.getParameter("SiStripCablingDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + cablingDQM_ = new SiStripCablingDQM(eSetup, + iRun, + conf_.getParameter("SiStripCablingDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } -} // beginRun +} // beginRun // ----- // // ----- beginJob // -void SiStripClassToMonitorCondData::beginJob(void) {} // beginJob +void SiStripClassToMonitorCondData::beginJob(void) {} // beginJob // // ----- getModuleMEsOnDemand // -void SiStripClassToMonitorCondData::getModMEsOnDemand( - edm::EventSetup const &eSetup, uint32_t requestedDetId) { - +void SiStripClassToMonitorCondData::getModMEsOnDemand(edm::EventSetup const &eSetup, uint32_t requestedDetId) { if (monitorPedestals_) { pedestalsDQM_->analysisOnDemand(eSetup, requestedDetId); } @@ -206,7 +194,7 @@ void SiStripClassToMonitorCondData::getModMEsOnDemand( if (monitorQuality_) { qualityDQM_->analysisOnDemand(eSetup, requestedDetId); qualityDQM_->fillGrandSummaryMEs(eSetup); - } // fillGrand. for SiStripquality + } // fillGrand. for SiStripquality if (monitorApvGains_) { apvgainsDQM_->analysisOnDemand(eSetup, requestedDetId); } @@ -231,55 +219,44 @@ void SiStripClassToMonitorCondData::getModMEsOnDemand( // // ----- getlayerMEsOnDemand // -void SiStripClassToMonitorCondData::getLayerMEsOnDemand( - edm::EventSetup const &eSetup, std::string requestedSubDetector, - uint32_t requestedSide, uint32_t requestedLayer) { - +void SiStripClassToMonitorCondData::getLayerMEsOnDemand(edm::EventSetup const &eSetup, + std::string requestedSubDetector, + uint32_t requestedSide, + uint32_t requestedLayer) { if (monitorPedestals_) { - pedestalsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, - requestedLayer); + pedestalsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } if (monitorNoises_) { - noisesDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, - requestedLayer); + noisesDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } if (monitorQuality_) { - qualityDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, - requestedLayer); + qualityDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); qualityDQM_->fillGrandSummaryMEs(eSetup); } if (monitorApvGains_) { - apvgainsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, - requestedLayer); + apvgainsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } if (monitorLorentzAngle_) { - lorentzangleDQM_->analysisOnDemand(eSetup, requestedSubDetector, - requestedSide, requestedLayer); + lorentzangleDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } if (monitorBackPlaneCorrection_) { - bpcorrectionDQM_->analysisOnDemand(eSetup, requestedSubDetector, - requestedSide, requestedLayer); + bpcorrectionDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } if (monitorCabling_) { - cablingDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, - requestedLayer); + cablingDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } if (monitorLowThreshold_) { - lowthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, - requestedSide, requestedLayer); + lowthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } if (monitorHighThreshold_) { - highthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, - requestedSide, requestedLayer); + highthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer); } } // // ----- Analyze // -void SiStripClassToMonitorCondData::analyseCondData( - edm::EventSetup const &eSetup) { - +void SiStripClassToMonitorCondData::analyseCondData(edm::EventSetup const &eSetup) { if (monitorPedestals_) { pedestalsDQM_->analysis(eSetup); } @@ -289,7 +266,7 @@ void SiStripClassToMonitorCondData::analyseCondData( if (monitorQuality_) { qualityDQM_->analysis(eSetup); qualityDQM_->fillGrandSummaryMEs(eSetup); - } // fillGrand. for SiStripquality + } // fillGrand. for SiStripquality if (monitorApvGains_) { apvgainsDQM_->analysis(eSetup); } @@ -309,17 +286,15 @@ void SiStripClassToMonitorCondData::analyseCondData( highthresholdDQM_->analysis(eSetup); } -} // analyze +} // analyze // ----- // // ----- endRun // void SiStripClassToMonitorCondData::endRun(edm::EventSetup const &eSetup) { - bool outputMEsInRootFile = conf_.getParameter("OutputMEsInRootFile"); - std::string outputFileName = - conf_.getParameter("OutputFileName"); + std::string outputFileName = conf_.getParameter("OutputFileName"); DQMStore *dqmStore_ = edm::Service().operator->(); @@ -328,10 +303,10 @@ void SiStripClassToMonitorCondData::endRun(edm::EventSetup const &eSetup) { dqmStore_->save(outputFileName); } -} // endRun +} // endRun // ----- // // ----- endJob // -void SiStripClassToMonitorCondData::endJob(void) {} // endJob +void SiStripClassToMonitorCondData::endJob(void) {} // endJob diff --git a/DQM/SiStripMonitorSummary/src/SiStripLorentzAngleDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripLorentzAngleDQM.cc index 95a24f13501f5..ce41843adf1db 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripLorentzAngleDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripLorentzAngleDQM.cc @@ -10,13 +10,11 @@ SiStripLorentzAngleDQM::SiStripLorentzAngleDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet) : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) { - // Build the Histo_TkMap: if (HistoMaps_On_) { edm::ESHandle tkDetMapHandle; eSetup.get().get(tkDetMapHandle); - Tk_HM_ = std::make_unique(tkDetMapHandle.product(), - "SiStrip/Histo_Map", "LA_TkMap", 0.); + Tk_HM_ = std::make_unique(tkDetMapHandle.product(), "SiStrip/Histo_Map", "LA_TkMap", 0.); } } // ----- @@ -27,23 +25,19 @@ SiStripLorentzAngleDQM::~SiStripLorentzAngleDQM() {} // ----- void SiStripLorentzAngleDQM::getActiveDetIds(const edm::EventSetup &eSetup) { - getConditionObject(eSetup); std::map::const_iterator LAMapIter_; std::map LAMap_ = lorentzangleHandle_->getLorentzAngles(); for (LAMapIter_ = LAMap_.begin(); LAMapIter_ != LAMap_.end(); LAMapIter_++) { - activeDetIds.push_back((*LAMapIter_).first); } } // ----- // ----- -void SiStripLorentzAngleDQM::fillSummaryMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripLorentzAngleDQM::fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -60,14 +54,12 @@ void SiStripLorentzAngleDQM::fillSummaryMEs( edm::LogError("SiStripLorentzAngle") << "[SiStripLorentzAngle::fillSummaryMEs] WRONG INPUT : no such " "subdetector type : " - << subDetId_ << " and detId " << selectedDetIds[i] - << " therefore no filling!" << std::endl; + << subDetId_ << " and detId " << selectedDetIds[i] << " therefore no filling!" << std::endl; } else if (SummaryOnLayerLevel_On_) { if (fillNext) { fillMEsForLayer(/*SummaryMEsMap_,*/ selectedDetIds[i], tTopo); } - if (getLayerNameAndId(selectedDetIds[i + 1], tTopo) == - getLayerNameAndId(selectedDetIds[i], tTopo)) { + if (getLayerNameAndId(selectedDetIds[i + 1], tTopo) == getLayerNameAndId(selectedDetIds[i], tTopo)) { fillNext = false; } else { fillNext = true; @@ -76,8 +68,7 @@ void SiStripLorentzAngleDQM::fillSummaryMEs( if (fillNext) { fillMEsForLayer(/*SummaryMEsMap_,*/ selectedDetIds[i], tTopo); } - if (getStringNameAndId(selectedDetIds[i + 1], tTopo) == - getStringNameAndId(selectedDetIds[i], tTopo)) { + if (getStringNameAndId(selectedDetIds[i + 1], tTopo) == getStringNameAndId(selectedDetIds[i], tTopo)) { fillNext = false; } else { fillNext = true; @@ -85,28 +76,20 @@ void SiStripLorentzAngleDQM::fillSummaryMEs( } } - for (std::map::iterator iter = SummaryMEsMap_.begin(); - iter != SummaryMEsMap_.end(); iter++) { - + for (std::map::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) { ModMEs selME; selME = iter->second; if (SummaryOnStringLevel_On_) { - - if (fPSet_.getParameter( - "OutputSummaryProfileAtLayerLevelAsImage")) { - + if (fPSet_.getParameter("OutputSummaryProfileAtLayerLevelAsImage")) { TCanvas c1("c1"); selME.SummaryOfProfileDistr->getTProfile()->Draw(); - std::string name( - selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); + std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); name += ".png"; c1.Print(name.c_str()); } - if (fPSet_.getParameter( - "OutputCumulativeSummaryAtLayerLevelAsImage")) { - + if (fPSet_.getParameter("OutputCumulativeSummaryAtLayerLevelAsImage")) { TCanvas c2("c2"); selME.SummaryOfCumulDistr->getTH1()->Draw(); std::string name2(selME.SummaryOfCumulDistr->getTH1()->GetTitle()); @@ -116,21 +99,16 @@ void SiStripLorentzAngleDQM::fillSummaryMEs( } else { if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel") && - fPSet_.getParameter( - "OutputSummaryProfileAtLayerLevelAsImage")) { - + fPSet_.getParameter("OutputSummaryProfileAtLayerLevelAsImage")) { TCanvas c1("c1"); selME.SummaryOfProfileDistr->getTProfile()->Draw(); - std::string name( - selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); + std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); name += ".png"; c1.Print(name.c_str()); } if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel") && - fPSet_.getParameter( - "OutputCumulativeSummaryAtLayerLevelAsImage")) { - + fPSet_.getParameter("OutputCumulativeSummaryAtLayerLevelAsImage")) { TCanvas c1("c1"); selME.SummaryOfCumulDistr->getTH1()->Draw(); std::string name(selME.SummaryOfCumulDistr->getTH1()->GetTitle()); @@ -144,35 +122,30 @@ void SiStripLorentzAngleDQM::fillSummaryMEs( // ----- void SiStripLorentzAngleDQM::fillMEsForLayer( - /*std::map selMEsMap_,*/ uint32_t selDetId_, - const TrackerTopology *tTopo) { - + /*std::map selMEsMap_,*/ uint32_t selDetId_, const TrackerTopology *tTopo) { SiStripHistoId hidmanager; std::string hSummaryOfProfile_description; - hSummaryOfProfile_description = - hPSet_.getParameter("SummaryOfProfile_description"); + hSummaryOfProfile_description = hPSet_.getParameter("SummaryOfProfile_description"); std::string hSummary_name; int subDetId_ = DetId(selDetId_).subdetId(); if (subDetId_ < 3 || subDetId_ > 6) { - edm::LogError("SiStripLorentzAngleDQM") - << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no such " - "subdetector type : " - << subDetId_ << " no folder set!" << std::endl; + edm::LogError("SiStripLorentzAngleDQM") << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no such " + "subdetector type : " + << subDetId_ << " no folder set!" << std::endl; return; } std::vector sameLayerDetIds_; sameLayerDetIds_.clear(); - if (SummaryOnStringLevel_On_) { // FILLING FOR STRING LEVEL + if (SummaryOnStringLevel_On_) { // FILLING FOR STRING LEVEL hSummary_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getStringNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getStringNameAndId(selDetId_, tTopo).first, ""); std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getStringNameAndId(selDetId_, tTopo).second); @@ -186,80 +159,66 @@ void SiStripLorentzAngleDQM::fillMEsForLayer( sameLayerDetIds_.clear(); switch (DetId(selDetId_).subdetId()) { - case StripSubdetector::TIB: - if (tTopo->tibIsInternalString(selDetId_)) { - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tibLayer(selDetId_), - 0, 1, tTopo->tibString(selDetId_)); - } - if (tTopo->tibIsExternalString(selDetId_)) { - SiStripSubStructure::getTIBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tibLayer(selDetId_), - 0, 2, tTopo->tibString(selDetId_)); - } - break; - case StripSubdetector::TID: - SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0); - break; - case StripSubdetector::TOB: - SiStripSubStructure::getTOBDetectors(activeDetIds, sameLayerDetIds_, - tTopo, tTopo->tobLayer(selDetId_), 0, - tTopo->tobRod(selDetId_)); - break; - case StripSubdetector::TEC: - SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, - tTopo, 0, 0, 0, 0, 0, 0); - break; + case StripSubdetector::TIB: + if (tTopo->tibIsInternalString(selDetId_)) { + SiStripSubStructure::getTIBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tibLayer(selDetId_), 0, 1, tTopo->tibString(selDetId_)); + } + if (tTopo->tibIsExternalString(selDetId_)) { + SiStripSubStructure::getTIBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tibLayer(selDetId_), 0, 2, tTopo->tibString(selDetId_)); + } + break; + case StripSubdetector::TID: + SiStripSubStructure::getTIDDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0); + break; + case StripSubdetector::TOB: + SiStripSubStructure::getTOBDetectors( + activeDetIds, sameLayerDetIds_, tTopo, tTopo->tobLayer(selDetId_), 0, tTopo->tobRod(selDetId_)); + break; + case StripSubdetector::TEC: + SiStripSubStructure::getTECDetectors(activeDetIds, sameLayerDetIds_, tTopo, 0, 0, 0, 0, 0, 0); + break; } // ----- for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfProfileDistr->Fill( - i + 1, lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + selME_.SummaryOfProfileDistr->Fill(i + 1, lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); // Fill the Histo_TkMap+TkMap with the LA: if (HistoMaps_On_) - Tk_HM_->fill(sameLayerDetIds_[i], - lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + Tk_HM_->fill(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); - std::cout << sameLayerDetIds_[i] << "\t" - << lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]) + std::cout << sameLayerDetIds_[i] << "\t" << lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i]) << std::endl; - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { - fillTkMap(sameLayerDetIds_[i], - lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { + fillTkMap(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); } } std::string hSummaryOfCumul_description; - hSummaryOfCumul_description = - hPSet_.getParameter("SummaryOfCumul_description"); + hSummaryOfCumul_description = hPSet_.getParameter("SummaryOfCumul_description"); std::string hSummaryOfCumul_name; if (subDetId_ < 3 || subDetId_ > 6) { - edm::LogError("SiStripLorentzAngleDQM") - << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no such " - "subdetector type : " - << subDetId_ << " no folder set!" << std::endl; + edm::LogError("SiStripLorentzAngleDQM") << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no such " + "subdetector type : " + << subDetId_ << " no folder set!" << std::endl; return; } hSummaryOfCumul_name = hidmanager.createHistoLayer( - hSummaryOfCumul_description, "layer", - getStringNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfCumul_description, "layer", getStringNameAndId(selDetId_, tTopo).first, ""); for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfCumulDistr->Fill( - lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + selME_.SummaryOfCumulDistr->Fill(lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); } - } // FILLING FOR STRING LEVEL + } // FILLING FOR STRING LEVEL - else { // FILLING FOR LAYER LEVEL + else { // FILLING FOR LAYER LEVEL std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); @@ -271,10 +230,8 @@ void SiStripLorentzAngleDQM::fillMEsForLayer( getSummaryMEs(selME_, selDetId_, tTopo); if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel")) { - hSummary_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); // ----- sameLayerDetIds_.clear(); @@ -282,48 +239,38 @@ void SiStripLorentzAngleDQM::fillMEsForLayer( sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_, tTopo); for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfProfileDistr->Fill( - i + 1, lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + selME_.SummaryOfProfileDistr->Fill(i + 1, lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); // Fill the Histo_TkMap with LA: if (HistoMaps_On_) - Tk_HM_->fill( - sameLayerDetIds_[i], - lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); - - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { - fillTkMap(sameLayerDetIds_[i], - lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + Tk_HM_->fill(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { + fillTkMap(sameLayerDetIds_[i], lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); } } - } // if Fill ... + } // if Fill ... if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel")) { - std::string hSummaryOfCumul_description; - hSummaryOfCumul_description = - hPSet_.getParameter("SummaryOfCumul_description"); + hSummaryOfCumul_description = hPSet_.getParameter("SummaryOfCumul_description"); std::string hSummaryOfCumul_name; if (subDetId_ < 3 || subDetId_ > 6) { - edm::LogError("SiStripLorentzAngleDQM") - << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no " - "such subdetector type : " - << subDetId_ << " no folder set!" << std::endl; + edm::LogError("SiStripLorentzAngleDQM") << "[SiStripLorentzAngleDQM::fillMEsForLayer] WRONG INPUT : no " + "such subdetector type : " + << subDetId_ << " no folder set!" << std::endl; return; } hSummaryOfCumul_name = hidmanager.createHistoLayer( - hSummaryOfCumul_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfCumul_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - selME_.SummaryOfCumulDistr->Fill( - lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); + selME_.SummaryOfCumulDistr->Fill(lorentzangleHandle_->getLorentzAngle(sameLayerDetIds_[i])); } - } // if Fill ... - } // FILLING FOR LAYER LEVEL + } // if Fill ... + } // FILLING FOR LAYER LEVEL } // ----- diff --git a/DQM/SiStripMonitorSummary/src/SiStripMonitorCondData.cc b/DQM/SiStripMonitorSummary/src/SiStripMonitorCondData.cc index f0f1f33110996..7c11475cc6d5e 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripMonitorCondData.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripMonitorCondData.cc @@ -47,21 +47,15 @@ // // ----- Constructor // -SiStripMonitorCondData::SiStripMonitorCondData(edm::ParameterSet const &iConfig) - : conf_(iConfig) { - +SiStripMonitorCondData::SiStripMonitorCondData(edm::ParameterSet const &iConfig) : conf_(iConfig) { monitorPedestals_ = iConfig.getParameter("MonitorSiStripPedestal"); monitorNoises_ = iConfig.getParameter("MonitorSiStripNoise"); - monitorLowThreshold_ = - iConfig.getParameter("MonitorSiStripLowThreshold"); - monitorHighThreshold_ = - iConfig.getParameter("MonitorSiStripHighThreshold"); + monitorLowThreshold_ = iConfig.getParameter("MonitorSiStripLowThreshold"); + monitorHighThreshold_ = iConfig.getParameter("MonitorSiStripHighThreshold"); monitorQuality_ = iConfig.getParameter("MonitorSiStripQuality"); monitorApvGains_ = iConfig.getParameter("MonitorSiStripApvGain"); - monitorLorentzAngle_ = - iConfig.getParameter("MonitorSiStripLorentzAngle"); - monitorBackPlaneCorrection_ = - iConfig.getParameter("MonitorSiStripBackPlaneCorrection"); + monitorLorentzAngle_ = iConfig.getParameter("MonitorSiStripLorentzAngle"); + monitorBackPlaneCorrection_ = iConfig.getParameter("MonitorSiStripBackPlaneCorrection"); monitorCabling_ = iConfig.getParameter("MonitorSiStripCabling"); } // ----- @@ -75,86 +69,87 @@ SiStripMonitorCondData::~SiStripMonitorCondData() {} // // ----- beginRun // -void SiStripMonitorCondData::beginRun(edm::Run const &run, - edm::EventSetup const &eSetup) { - +void SiStripMonitorCondData::beginRun(edm::Run const &run, edm::EventSetup const &eSetup) { if (monitorPedestals_) { - pedestalsDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripPedestalsDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + pedestalsDQM_ = + std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripPedestalsDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorNoises_) { - noisesDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripNoisesDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + noisesDQM_ = std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripNoisesDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorLowThreshold_) { - lowthresholdDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripLowThresholdDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + lowthresholdDQM_ = + std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripLowThresholdDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorHighThreshold_) { - highthresholdDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripHighThresholdDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + highthresholdDQM_ = + std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripHighThresholdDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorQuality_) { - qualityDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripQualityDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + qualityDQM_ = std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripQualityDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorApvGains_) { - apvgainsDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripApvGainsDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + apvgainsDQM_ = + std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripApvGainsDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorLorentzAngle_) { - lorentzangleDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripLorentzAngleDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + lorentzangleDQM_ = + std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripLorentzAngleDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } if (monitorBackPlaneCorrection_) { bpcorrectionDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter( - "SiStripBackPlaneCorrectionDQM_PSet"), + eSetup, + run.run(), + conf_.getParameter("SiStripBackPlaneCorrectionDQM_PSet"), conf_.getParameter("FillConditions_PSet")); } if (monitorCabling_) { - cablingDQM_ = std::make_unique( - eSetup, run.run(), - conf_.getParameter("SiStripCablingDQM_PSet"), - conf_.getParameter("FillConditions_PSet")); + cablingDQM_ = std::make_unique(eSetup, + run.run(), + conf_.getParameter("SiStripCablingDQM_PSet"), + conf_.getParameter("FillConditions_PSet")); } -} // beginRun +} // beginRun // ----- // // ----- beginJob // -void SiStripMonitorCondData::beginJob(void) {} // beginJob +void SiStripMonitorCondData::beginJob(void) {} // beginJob // ----- // // ----- Analyze // -void SiStripMonitorCondData::analyze(edm::Event const &iEvent, - edm::EventSetup const &eSetup) { - +void SiStripMonitorCondData::analyze(edm::Event const &iEvent, edm::EventSetup const &eSetup) { if (monitorPedestals_) { pedestalsDQM_->analysis(eSetup); } @@ -179,18 +174,17 @@ void SiStripMonitorCondData::analyze(edm::Event const &iEvent, if (monitorQuality_) { qualityDQM_->analysis(eSetup); qualityDQM_->fillGrandSummaryMEs(eSetup); - } // fillGrand. for SiStripquality + } // fillGrand. for SiStripquality if (monitorCabling_) { cablingDQM_->analysis(eSetup); } -} // analyze +} // analyze // ----- // // ----- endRun // -void SiStripMonitorCondData::endRun(edm::Run const &run, - edm::EventSetup const &eSetup) { +void SiStripMonitorCondData::endRun(edm::Run const &run, edm::EventSetup const &eSetup) { if (monitorPedestals_) { pedestalsDQM_->end(); } @@ -220,8 +214,7 @@ void SiStripMonitorCondData::endRun(edm::Run const &run, } bool outputMEsInRootFile = conf_.getParameter("OutputMEsInRootFile"); - std::string outputFileName = - conf_.getParameter("OutputFileName"); + std::string outputFileName = conf_.getParameter("OutputFileName"); DQMStore *dqmStore_ = edm::Service().operator->(); @@ -230,7 +223,7 @@ void SiStripMonitorCondData::endRun(edm::Run const &run, dqmStore_->save(outputFileName); } -} // endRun +} // endRun // ----- // diff --git a/DQM/SiStripMonitorSummary/src/SiStripMonitorCondDataOnDemandExample.cc b/DQM/SiStripMonitorSummary/src/SiStripMonitorCondDataOnDemandExample.cc index be3732696eeab..7c8f001784368 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripMonitorCondDataOnDemandExample.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripMonitorCondDataOnDemandExample.cc @@ -31,40 +31,36 @@ // // ----- Constructor // -SiStripMonitorCondDataOnDemandExample::SiStripMonitorCondDataOnDemandExample( - edm::ParameterSet const &iConfig) +SiStripMonitorCondDataOnDemandExample::SiStripMonitorCondDataOnDemandExample(edm::ParameterSet const &iConfig) : conf_(iConfig) {} // ----- // // ----- Destructor // -SiStripMonitorCondDataOnDemandExample:: - ~SiStripMonitorCondDataOnDemandExample() {} +SiStripMonitorCondDataOnDemandExample::~SiStripMonitorCondDataOnDemandExample() {} // ----- // // ----- beginRun // -void SiStripMonitorCondDataOnDemandExample::beginRun( - edm::Run const &run, edm::EventSetup const &eSetup) { +void SiStripMonitorCondDataOnDemandExample::beginRun(edm::Run const &run, edm::EventSetup const &eSetup) { eventCounter_ = 0; condDataMonitoring_ = new SiStripClassToMonitorCondData(conf_); condDataMonitoring_->beginRun(run.run(), eSetup); -} // beginRun +} // beginRun // ----- // // ----- beginJob // -void SiStripMonitorCondDataOnDemandExample::beginJob(void) {} // beginJob +void SiStripMonitorCondDataOnDemandExample::beginJob(void) {} // beginJob // // ----- Analyze // -void SiStripMonitorCondDataOnDemandExample::analyze( - edm::Event const &iEvent, edm::EventSetup const &eSetup) { +void SiStripMonitorCondDataOnDemandExample::analyze(edm::Event const &iEvent, edm::EventSetup const &eSetup) { // eventCounter_++; // on demand type I : eventSetup and detId to be passed @@ -82,24 +78,22 @@ void SiStripMonitorCondDataOnDemandExample::analyze( // getModMEsOnDemand(eSetup,369125542); condDataMonitoring_->getLayerMEsOnDemand(eSetup, "TEC", 2, 4); -} // analyze +} // analyze // ----- // // ----- endRun // -void SiStripMonitorCondDataOnDemandExample::endRun( - edm::Run const &run, edm::EventSetup const &eSetup) { - +void SiStripMonitorCondDataOnDemandExample::endRun(edm::Run const &run, edm::EventSetup const &eSetup) { condDataMonitoring_->endRun(eSetup); -} // endRun +} // endRun // ----- // // ----- endJob // -void SiStripMonitorCondDataOnDemandExample::endJob(void) {} // endJob +void SiStripMonitorCondDataOnDemandExample::endJob(void) {} // endJob #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(SiStripMonitorCondDataOnDemandExample); diff --git a/DQM/SiStripMonitorSummary/src/SiStripNoisesDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripNoisesDQM.cc index c6166258c246e..05d47c28a8c91 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripNoisesDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripNoisesDQM.cc @@ -23,8 +23,7 @@ SiStripNoisesDQM::SiStripNoisesDQM(const edm::EventSetup &eSetup, if (HistoMaps_On_) { edm::ESHandle tkDetMapHandle; eSetup.get().get(tkDetMapHandle); - Tk_HM_ = std::make_unique( - tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanNoise_TkMap", 0.); + Tk_HM_ = std::make_unique(tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanNoise_TkMap", 0.); } } // ----- @@ -35,15 +34,12 @@ SiStripNoisesDQM::~SiStripNoisesDQM() {} // ----- void SiStripNoisesDQM::getActiveDetIds(const edm::EventSetup &eSetup) { - getConditionObject(eSetup); noiseHandle_->getDetIds(activeDetIds); } // ----- -void SiStripNoisesDQM::fillMEsForDet(const ModMEs &_selModME_, - uint32_t selDetId_, - const TrackerTopology *tTopo) { +void SiStripNoisesDQM::fillMEsForDet(const ModMEs &_selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) { ModMEs selModME_ = _selModME_; std::vector DetIds; noiseHandle_->getDetIds(DetIds); @@ -64,22 +60,18 @@ void SiStripNoisesDQM::fillMEsForDet(const ModMEs &_selModME_, for (int istrip = 0; istrip < nStrip; ++istrip) { if (gainRenormalisation_ || simGainRenormalisation_) - gainFactor = gainHandle_->getStripGain(istrip, gainRange) - ? gainHandle_->getStripGain(istrip, gainRange) - : 1.; + gainFactor = gainHandle_->getStripGain(istrip, gainRange) ? gainHandle_->getStripGain(istrip, gainRange) : 1.; else gainFactor = 1; stripnoise = noiseHandle_->getNoise(istrip, noiseRange) / gainFactor; - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { selModME_.ProfileDistr->Fill(istrip + 1, stripnoise); } - if (CondObj_fillId_ == "onlyCumul" || - CondObj_fillId_ == "ProfileAndCumul") { + if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") { selModME_.CumulDistr->Fill(stripnoise); } - } // istrip + } // istrip } // ----- @@ -91,23 +83,19 @@ void SiStripNoisesDQM::fillMEsForDet(const ModMEs &_selModME_, // should be avoided... void SiStripNoisesDQM::fillMEsForLayer( - /*std::map selMEsMap_,*/ uint32_t selDetId_, - const TrackerTopology *tTopo) { - + /*std::map selMEsMap_,*/ uint32_t selDetId_, const TrackerTopology *tTopo) { // ---- int subdetectorId_ = ((selDetId_ >> 25) & 0x7); if (subdetectorId_ < 3 || subdetectorId_ > 6) { - edm::LogError("SiStripNoisesDQM") - << "[SiStripNoisesDQM::fillMEsForLayer] WRONG INPUT : no such " - "subdetector type : " - << subdetectorId_ << " no folder set!" << std::endl; + edm::LogError("SiStripNoisesDQM") << "[SiStripNoisesDQM::fillMEsForLayer] WRONG INPUT : no such " + "subdetector type : " + << subdetectorId_ << " no folder set!" << std::endl; return; } // ---- - std::map::iterator selMEsMapIter_ = - SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); + std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); ModMEs selME_; if (selMEsMapIter_ != SummaryMEsMap_.end()) selME_ = selMEsMapIter_->second; @@ -131,42 +119,33 @@ void SiStripNoisesDQM::fillMEsForLayer( if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel")) { // --> profile summary std::string hSummaryOfProfile_description; - hSummaryOfProfile_description = - hPSet_.getParameter("SummaryOfProfile_description"); + hSummaryOfProfile_description = hPSet_.getParameter("SummaryOfProfile_description"); std::string hSummaryOfProfile_name; hSummaryOfProfile_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); } if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel")) { std::string hSummaryOfCumul_description; - hSummaryOfCumul_description = - hPSet_.getParameter("Cumul_description"); + hSummaryOfCumul_description = hPSet_.getParameter("Cumul_description"); std::string hSummaryOfCumul_name; hSummaryOfCumul_name = hidmanager.createHistoLayer( - hSummaryOfCumul_description, "layer", - getStringNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfCumul_description, "layer", getStringNameAndId(selDetId_, tTopo).first, ""); } if (hPSet_.getParameter("FillSummaryAtLayerLevel")) { // --> cumul summary std::string hSummary_description; - hSummary_description = - hPSet_.getParameter("Summary_description"); + hSummary_description = hPSet_.getParameter("Summary_description"); std::string hSummary_name; - hSummary_name = hidmanager.createHistoLayer( - hSummary_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummary_name = + hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); } for (int istrip = 0; istrip < nStrip; ++istrip) { - if (gainRenormalisation_ || simGainRenormalisation_) { - gainFactor = gainHandle_->getStripGain(istrip, gainRange) - ? gainHandle_->getStripGain(istrip, gainRange) - : 1.; + gainFactor = gainHandle_->getStripGain(istrip, gainRange) ? gainHandle_->getStripGain(istrip, gainRange) : 1.; } else { gainFactor = 1.; } @@ -174,40 +153,35 @@ void SiStripNoisesDQM::fillMEsForLayer( stripnoise = noiseHandle_->getNoise(istrip, noiseRange) / gainFactor; meanNoise += stripnoise; if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel")) { - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { selME_.SummaryOfProfileDistr->Fill(istrip + 1, stripnoise); } } if (hPSet_.getParameter("FillCumulativeSummaryAtLayerLevel")) { - if (CondObj_fillId_ == "onlyCumul" || - CondObj_fillId_ == "ProfileAndCumul") { + if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") { selME_.SummaryOfCumulDistr->Fill(stripnoise); } } // Fill the TkMap - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { fillTkMap(selDetId_, stripnoise); } - } // istrip + } // istrip if (hPSet_.getParameter("FillSummaryAtLayerLevel")) { - meanNoise = meanNoise / (nStrip - Nbadstrips); // get detIds belonging to same layer to fill X-axis with detId-number std::vector sameLayerDetIds_; sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_, tTopo); - std::vector::const_iterator ibound = lower_bound( - sameLayerDetIds_.begin(), sameLayerDetIds_.end(), selDetId_); + std::vector::const_iterator ibound = + lower_bound(sameLayerDetIds_.begin(), sameLayerDetIds_.end(), selDetId_); if (ibound != sameLayerDetIds_.end() && *ibound == selDetId_) - selME_.SummaryDistr->Fill(ibound - sameLayerDetIds_.begin() + 1, - meanNoise); + selME_.SummaryDistr->Fill(ibound - sameLayerDetIds_.begin() + 1, meanNoise); // Fill the Histo_TkMap with the mean Noise: if (HistoMaps_On_) { diff --git a/DQM/SiStripMonitorSummary/src/SiStripPedestalsDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripPedestalsDQM.cc index 4188c8ded6dab..2e9e23346abeb 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripPedestalsDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripPedestalsDQM.cc @@ -9,13 +9,11 @@ SiStripPedestalsDQM::SiStripPedestalsDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet) : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) { - // Build the Histo_TkMap: if (HistoMaps_On_) { edm::ESHandle tkDetMapHandle; eSetup.get().get(tkDetMapHandle); - Tk_HM_ = std::make_unique( - tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanPed_TkMap", 0.); + Tk_HM_ = std::make_unique(tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanPed_TkMap", 0.); } } // ----- @@ -26,16 +24,13 @@ SiStripPedestalsDQM::~SiStripPedestalsDQM() {} // ----- void SiStripPedestalsDQM::getActiveDetIds(const edm::EventSetup &eSetup) { - getConditionObject(eSetup); pedestalHandle_->getDetIds(activeDetIds); } // ----- // ----- -void SiStripPedestalsDQM::fillModMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripPedestalsDQM::fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -43,18 +38,15 @@ void SiStripPedestalsDQM::fillModMEs( ModMEs CondObj_ME; - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { - + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForDet(CondObj_ME, *detIter_, tTopo); } } // ----- // ----- -void SiStripPedestalsDQM::fillMEsForDet(const ModMEs &_selModME_, - uint32_t selDetId_, - const TrackerTopology *tTopo) { +void SiStripPedestalsDQM::fillMEsForDet(const ModMEs &_selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) { ModMEs selModME_ = _selModME_; getModMEs(selModME_, selDetId_, tTopo); @@ -62,52 +54,41 @@ void SiStripPedestalsDQM::fillMEsForDet(const ModMEs &_selModME_, int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first * 128; for (int istrip = 0; istrip < nStrip; ++istrip) { - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { - selModME_.ProfileDistr->Fill(istrip + 1, - pedestalHandle_->getPed(istrip, pedRange)); + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { + selModME_.ProfileDistr->Fill(istrip + 1, pedestalHandle_->getPed(istrip, pedRange)); } - } // istrip + } // istrip } // ----- // ----- -void SiStripPedestalsDQM::fillSummaryMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripPedestalsDQM::fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); const TrackerTopology *const tTopo = tTopoHandle.product(); - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo); } - for (std::map::iterator iter = SummaryMEsMap_.begin(); - iter != SummaryMEsMap_.end(); iter++) { - + for (std::map::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) { ModMEs selME; selME = iter->second; if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter("OutputSummaryProfileAtLayerLevelAsImage")) { - - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { - + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { TCanvas c1("c1"); selME.SummaryOfProfileDistr->getTProfile()->Draw(); - std::string name( - selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); + std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle()); name += ".png"; c1.Print(name.c_str()); } } if (hPSet_.getParameter("FillSummaryAtLayerLevel") && fPSet_.getParameter("OutputSummaryAtLayerLevelAsImage")) { - TCanvas c1("c1"); selME.SummaryDistr->getTH1()->Draw(); std::string name(selME.SummaryDistr->getTH1()->GetTitle()); @@ -121,17 +102,14 @@ void SiStripPedestalsDQM::fillSummaryMEs( // ----- void SiStripPedestalsDQM::fillMEsForLayer( - /*std::map selMEsMap_,*/ uint32_t selDetId_, - const TrackerTopology *tTopo) { - + /*std::map selMEsMap_,*/ uint32_t selDetId_, const TrackerTopology *tTopo) { // ---- int subdetectorId_ = ((selDetId_ >> 25) & 0x7); if (subdetectorId_ < 3 || subdetectorId_ > 6) { - edm::LogError("SiStripPedestalsDQM") - << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such " - "subdetector type : " - << subdetectorId_ << " no folder set!" << std::endl; + edm::LogError("SiStripPedestalsDQM") << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such " + "subdetector type : " + << subdetectorId_ << " no folder set!" << std::endl; return; } // ---- @@ -139,8 +117,7 @@ void SiStripPedestalsDQM::fillMEsForLayer( // // Cumulative distribution with average Ped value on a layer (not // needed): - std::map::iterator selMEsMapIter_ = - SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); + std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); ModMEs selME_; if (selMEsMapIter_ != SummaryMEsMap_.end()) selME_ = selMEsMapIter_->second; @@ -153,55 +130,44 @@ void SiStripPedestalsDQM::fillMEsForLayer( SiStripHistoId hidmanager; if (hPSet_.getParameter("FillSummaryProfileAtLayerLevel")) { - // --> profile summary std::string hSummaryOfProfile_description; - hSummaryOfProfile_description = - hPSet_.getParameter("SummaryOfProfile_description"); + hSummaryOfProfile_description = hPSet_.getParameter("SummaryOfProfile_description"); std::string hSummaryOfProfile_name; hSummaryOfProfile_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); for (int istrip = 0; istrip < nStrip; ++istrip) { - - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { - selME_.SummaryOfProfileDistr->Fill( - istrip + 1, pedestalHandle_->getPed(istrip, pedRange)); + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { + selME_.SummaryOfProfileDistr->Fill(istrip + 1, pedestalHandle_->getPed(istrip, pedRange)); } // fill the TkMap - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { fillTkMap(selDetId_, pedestalHandle_->getPed(istrip, pedRange)); } - } // istrip - } // if Fill ... + } // istrip + } // if Fill ... if (hPSet_.getParameter("FillSummaryAtLayerLevel")) { - // --> summary std::string hSummary_description; - hSummary_description = - hPSet_.getParameter("Summary_description"); + hSummary_description = hPSet_.getParameter("Summary_description"); std::string hSummary_name; - hSummary_name = hidmanager.createHistoLayer( - hSummary_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummary_name = + hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); float meanPedestal = 0; for (int istrip = 0; istrip < nStrip; ++istrip) { - meanPedestal = meanPedestal + pedestalHandle_->getPed(istrip, pedRange); - } // istrip + } // istrip meanPedestal = meanPedestal / nStrip; @@ -227,6 +193,6 @@ void SiStripPedestalsDQM::fillMEsForLayer( if (HistoMaps_On_) Tk_HM_->fill(selDetId_, meanPedestal); - } // if Fill ... + } // if Fill ... } // ----- diff --git a/DQM/SiStripMonitorSummary/src/SiStripQualityDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripQualityDQM.cc index 026ee9ec83825..d61d85acd9db2 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripQualityDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripQualityDQM.cc @@ -15,8 +15,7 @@ SiStripQualityDQM::SiStripQualityDQM(const edm::EventSetup &eSetup, if (HistoMaps_On_) { edm::ESHandle tkDetMapHandle; eSetup.get().get(tkDetMapHandle); - Tk_HM_ = std::make_unique( - tkDetMapHandle.product(), "SiStrip/Histo_Map", "Quality_TkMap", 0.); + Tk_HM_ = std::make_unique(tkDetMapHandle.product(), "SiStrip/Histo_Map", "Quality_TkMap", 0.); } } // ----- @@ -34,9 +33,7 @@ void SiStripQualityDQM::getActiveDetIds(const edm::EventSetup &eSetup) { //================================================ // ----- -void SiStripQualityDQM::fillModMEs(const std::vector &selectedDetIds, - const edm::EventSetup &es) { - +void SiStripQualityDQM::fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -44,8 +41,8 @@ void SiStripQualityDQM::fillModMEs(const std::vector &selectedDetIds, ModMEs CondObj_ME; - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForDet(CondObj_ME, *detIter_, tTopo); } } @@ -53,9 +50,7 @@ void SiStripQualityDQM::fillModMEs(const std::vector &selectedDetIds, //=================================================== // ----- -void SiStripQualityDQM::fillMEsForDet(const ModMEs &_selModME_, - uint32_t selDetId_, - const TrackerTopology *tTopo) { +void SiStripQualityDQM::fillMEsForDet(const ModMEs &_selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) { ModMEs selModME_ = _selModME_; getModMEs(selModME_, selDetId_, tTopo); @@ -63,37 +58,31 @@ void SiStripQualityDQM::fillMEsForDet(const ModMEs &_selModME_, int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first * 128; for (int istrip = 0; istrip < nStrip; ++istrip) { - selModME_.ProfileDistr->Fill( - istrip + 1, qualityHandle_->IsStripBad(qualityRange, istrip) ? 0. : 1.); + selModME_.ProfileDistr->Fill(istrip + 1, qualityHandle_->IsStripBad(qualityRange, istrip) ? 0. : 1.); - } // istrip + } // istrip } // ----- //==================================================== // ----- -void SiStripQualityDQM::fillSummaryMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripQualityDQM::fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); const TrackerTopology *const tTopo = tTopoHandle.product(); - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo); } - for (std::map::iterator iter = SummaryMEsMap_.begin(); - iter != SummaryMEsMap_.end(); iter++) { - + for (std::map::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) { ModMEs selME; selME = iter->second; if (hPSet_.getParameter("FillSummaryAtLayerLevel") && fPSet_.getParameter("OutputSummaryAtLayerLevelAsImage")) { - TCanvas c1("c1"); selME.SummaryDistr->getTH1()->Draw(); std::string name(selME.SummaryDistr->getTH1()->GetTitle()); @@ -107,18 +96,14 @@ void SiStripQualityDQM::fillSummaryMEs( //================================================= // ----- void SiStripQualityDQM::fillMEsForLayer( - /* std::map selMEsMap_,*/ uint32_t selDetId_, - const TrackerTopology *tTopo) { - + /* std::map selMEsMap_,*/ uint32_t selDetId_, const TrackerTopology *tTopo) { float numberOfBadStrips = 0; SiStripHistoId hidmanager; if (hPSet_.getParameter("FillSummaryAtLayerLevel")) { - std::string hSummary_description; - hSummary_description = - hPSet_.getParameter("Summary_description"); + hSummary_description = hPSet_.getParameter("Summary_description"); std::string hSummary_name; @@ -126,17 +111,15 @@ void SiStripQualityDQM::fillMEsForLayer( int subDetId_ = ((selDetId_ >> 25) & 0x7); if (subDetId_ < 3 || subDetId_ > 6) { - edm::LogError("SiStripQualityDQM") - << "[SiStripQualityDQM::fillMEsForLayer] WRONG INPUT : no such " - "subdetector type : " - << subDetId_ << " no folder set!" << std::endl; + edm::LogError("SiStripQualityDQM") << "[SiStripQualityDQM::fillMEsForLayer] WRONG INPUT : no such " + "subdetector type : " + << subDetId_ << " no folder set!" << std::endl; return; } // ---- - hSummary_name = hidmanager.createHistoLayer( - hSummary_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummary_name = + hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); @@ -156,20 +139,15 @@ void SiStripQualityDQM::fillMEsForLayer( //%%%%%%%%%%%%%%%%%%% //%%% FIXME: patch to fix the bug causing double counting on each layer //%%%%%%%%%%%%%%%%%%%%%%% - if (std::binary_search(alreadyFilledLayers.begin(), - alreadyFilledLayers.end(), sameLayerDetIds_[0])) + if (std::binary_search(alreadyFilledLayers.begin(), alreadyFilledLayers.end(), sameLayerDetIds_[0])) return; alreadyFilledLayers.push_back(sameLayerDetIds_[0]); sort(alreadyFilledLayers.begin(), alreadyFilledLayers.end()); //%%%%%%%%%%%%%%%%%%%%%%% END %%%%%%%%%% for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { - - SiStripQuality::Range qualityRange = - qualityHandle_->getRange(sameLayerDetIds_[i]); - int nStrip = - reader->getNumberOfApvsAndStripLength(sameLayerDetIds_[i]).first * - 128; + SiStripQuality::Range qualityRange = qualityHandle_->getRange(sameLayerDetIds_[i]); + int nStrip = reader->getNumberOfApvsAndStripLength(sameLayerDetIds_[i]).first * 128; numberOfBadStrips = 0; @@ -192,45 +170,34 @@ void SiStripQualityDQM::fillMEsForLayer( Tk_HM_->setBinContent(sameLayerDetIds_[i], fr); // Fill the TkMap - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) { + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) { fillTkMap(sameLayerDetIds_[i], fr); } } - } // if Fill ... + } // if Fill ... } // ----- //============================= void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { - // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; eSetup.get().get(tTopoHandle); const TrackerTopology *const tTopo = tTopoHandle.product(); - std::string hSummary_BadObjects_xTitle = - hPSet_.getParameter("Summary_BadObjects_histo_xTitle"); + std::string hSummary_BadObjects_xTitle = hPSet_.getParameter("Summary_BadObjects_histo_xTitle"); - std::string hSummary_BadModules_name = - hPSet_.getParameter("Summary_BadModules_histo_name"); - std::string hSummary_BadModules_yTitle = - hPSet_.getParameter("Summary_BadModules_histo_yTitle"); + std::string hSummary_BadModules_name = hPSet_.getParameter("Summary_BadModules_histo_name"); + std::string hSummary_BadModules_yTitle = hPSet_.getParameter("Summary_BadModules_histo_yTitle"); - std::string hSummary_BadFibers_name = - hPSet_.getParameter("Summary_BadFibers_histo_name"); - std::string hSummary_BadFibers_yTitle = - hPSet_.getParameter("Summary_BadFibers_histo_yTitle"); + std::string hSummary_BadFibers_name = hPSet_.getParameter("Summary_BadFibers_histo_name"); + std::string hSummary_BadFibers_yTitle = hPSet_.getParameter("Summary_BadFibers_histo_yTitle"); - std::string hSummary_BadApvs_name = - hPSet_.getParameter("Summary_BadApvs_histo_name"); - std::string hSummary_BadApvs_yTitle = - hPSet_.getParameter("Summary_BadApvs_histo_yTitle"); + std::string hSummary_BadApvs_name = hPSet_.getParameter("Summary_BadApvs_histo_name"); + std::string hSummary_BadApvs_yTitle = hPSet_.getParameter("Summary_BadApvs_histo_yTitle"); - std::string hSummary_BadStrips_name = - hPSet_.getParameter("Summary_BadStrips_histo_name"); - std::string hSummary_BadStrips_yTitle = - hPSet_.getParameter("Summary_BadStrips_histo_yTitle"); + std::string hSummary_BadStrips_name = hPSet_.getParameter("Summary_BadStrips_histo_name"); + std::string hSummary_BadStrips_yTitle = hPSet_.getParameter("Summary_BadStrips_histo_yTitle"); int NchX = 34; double LowX = 0.5; @@ -240,28 +207,23 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { DQMStore *dqmStore_ = edm::Service().operator->(); - std::string FolderName = fPSet_.getParameter( - "FolderName_For_QualityAndCabling_SummaryHistos"); + std::string FolderName = fPSet_.getParameter("FolderName_For_QualityAndCabling_SummaryHistos"); dqmStore_->setCurrentFolder(FolderName); - ME[0] = dqmStore_->book1D(hSummary_BadModules_name, hSummary_BadModules_name, - NchX, LowX, HighX); + ME[0] = dqmStore_->book1D(hSummary_BadModules_name, hSummary_BadModules_name, NchX, LowX, HighX); ME[0]->setAxisTitle(hSummary_BadObjects_xTitle, 1); ME[0]->setAxisTitle(hSummary_BadModules_yTitle, 2); - ME[1] = dqmStore_->book1D(hSummary_BadFibers_name, hSummary_BadFibers_name, - NchX, LowX, HighX); + ME[1] = dqmStore_->book1D(hSummary_BadFibers_name, hSummary_BadFibers_name, NchX, LowX, HighX); ME[1]->setAxisTitle(hSummary_BadObjects_xTitle, 1); ME[1]->setAxisTitle(hSummary_BadFibers_yTitle, 2); - ME[2] = dqmStore_->book1D(hSummary_BadApvs_name, hSummary_BadApvs_name, NchX, - LowX, HighX); + ME[2] = dqmStore_->book1D(hSummary_BadApvs_name, hSummary_BadApvs_name, NchX, LowX, HighX); ME[2]->setAxisTitle(hSummary_BadObjects_xTitle, 1); ME[2]->setAxisTitle(hSummary_BadApvs_yTitle, 2); - ME[3] = dqmStore_->book1D(hSummary_BadStrips_name, hSummary_BadStrips_name, - NchX, LowX, HighX); + ME[3] = dqmStore_->book1D(hSummary_BadStrips_name, hSummary_BadStrips_name, NchX, LowX, HighX); ME[3]->setAxisTitle(hSummary_BadObjects_xTitle, 1); ME[3]->setAxisTitle(hSummary_BadStrips_yTitle, 2); @@ -281,16 +243,13 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { std::vector detids = reader->getAllDetIds(); std::vector::const_iterator idet = detids.begin(); for (; idet != detids.end(); ++idet) { - ss << "detid " << (*idet) << " IsModuleUsable " - << qualityHandle_->IsModuleUsable((*idet)) << "\n"; + ss << "detid " << (*idet) << " IsModuleUsable " << qualityHandle_->IsModuleUsable((*idet)) << "\n"; } LogDebug("SiStripQualityDQM") << ss.str() << std::endl; - std::vector BC = - qualityHandle_->getBadComponentList(); + std::vector BC = qualityHandle_->getBadComponentList(); for (size_t i = 0; i < BC.size(); ++i) { - //&&&&&&&&&&&&& // Full Tk //&&&&&&&&&&&&& @@ -298,14 +257,10 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { if (BC[i].BadModule) NTkBadComponent[0]++; if (BC[i].BadFibers) - NTkBadComponent[1] += ((BC[i].BadFibers >> 2) & 0x1) + - ((BC[i].BadFibers >> 1) & 0x1) + - ((BC[i].BadFibers) & 0x1); + NTkBadComponent[1] += ((BC[i].BadFibers >> 2) & 0x1) + ((BC[i].BadFibers >> 1) & 0x1) + ((BC[i].BadFibers) & 0x1); if (BC[i].BadApvs) - NTkBadComponent[2] += - ((BC[i].BadApvs >> 5) & 0x1) + ((BC[i].BadApvs >> 4) & 0x1) + - ((BC[i].BadApvs >> 3) & 0x1) + ((BC[i].BadApvs >> 2) & 0x1) + - ((BC[i].BadApvs >> 1) & 0x1) + ((BC[i].BadApvs) & 0x1); + NTkBadComponent[2] += ((BC[i].BadApvs >> 5) & 0x1) + ((BC[i].BadApvs >> 4) & 0x1) + ((BC[i].BadApvs >> 3) & 0x1) + + ((BC[i].BadApvs >> 2) & 0x1) + ((BC[i].BadApvs >> 1) & 0x1) + ((BC[i].BadApvs) & 0x1); //&&&&&&&&&&&&&&&&& // Single SubSyste @@ -326,9 +281,7 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { // TID //&&&&&&&&&&&&&&&&& - component = tTopo->tidSide(BC[i].detid) == 2 - ? tTopo->tidWheel(BC[i].detid) - : tTopo->tidWheel(BC[i].detid) + 3; + component = tTopo->tidSide(BC[i].detid) == 2 ? tTopo->tidWheel(BC[i].detid) : tTopo->tidWheel(BC[i].detid) + 3; SetBadComponents(1, component, BC[i]); } else if (a.subdetId() == SiStripDetId::TOB) { @@ -344,9 +297,7 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { // TEC //&&&&&&&&&&&&&&&&& - component = tTopo->tecSide(BC[i].detid) == 2 - ? tTopo->tecWheel(BC[i].detid) - : tTopo->tecWheel(BC[i].detid) + 9; + component = tTopo->tecSide(BC[i].detid) == 2 ? tTopo->tecWheel(BC[i].detid) : tTopo->tecWheel(BC[i].detid) + 9; SetBadComponents(3, component, BC[i]); } } @@ -355,10 +306,8 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { // Single Strip Info //&&&&&&&&&&&&&&&&&& - SiStripQuality::RegistryIterator rbegin = - qualityHandle_->getRegistryVectorBegin(); - SiStripQuality::RegistryIterator rend = - qualityHandle_->getRegistryVectorEnd(); + SiStripQuality::RegistryIterator rbegin = qualityHandle_->getRegistryVectorBegin(); + SiStripQuality::RegistryIterator rend = qualityHandle_->getRegistryVectorEnd(); for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) { uint32_t detid = rp->detid; @@ -371,20 +320,17 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { component = tTopo->tibLayer(detid); } else if (a.subdetId() == 4) { subdet = 1; - component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) - : tTopo->tidWheel(detid) + 3; + component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) : tTopo->tidWheel(detid) + 3; } else if (a.subdetId() == 5) { subdet = 2; component = tTopo->tobLayer(detid); } else if (a.subdetId() == 6) { subdet = 3; - component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) - : tTopo->tecWheel(detid) + 9; + component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) : tTopo->tecWheel(detid) + 9; } - SiStripQuality::Range sqrange = - SiStripQuality::Range(qualityHandle_->getDataVectorBegin() + rp->ibegin, - qualityHandle_->getDataVectorBegin() + rp->iend); + SiStripQuality::Range sqrange = SiStripQuality::Range(qualityHandle_->getDataVectorBegin() + rp->ibegin, + qualityHandle_->getDataVectorBegin() + rp->iend); for (int it = 0; it < sqrange.second - sqrange.first; it++) { unsigned int range = qualityHandle_->decode(*(sqrange.first + it)).range; @@ -403,27 +349,22 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { ss << "\nBadComponent \t Modules \tFibers " "\tApvs\tStrips\n------------------------------------------------------" "----------"; - ss << "\nTracker:\t\t" << NTkBadComponent[0] << "\t" << NTkBadComponent[1] - << "\t" << NTkBadComponent[2] << "\t" << NTkBadComponent[3]; + ss << "\nTracker:\t\t" << NTkBadComponent[0] << "\t" << NTkBadComponent[1] << "\t" << NTkBadComponent[2] << "\t" + << NTkBadComponent[3]; ss << "\n"; - ss << "\nTIB:\t\t\t" << NBadComponent[0][0][0] << "\t" - << NBadComponent[0][0][1] << "\t" << NBadComponent[0][0][2] << "\t" - << NBadComponent[0][0][3]; - ss << "\nTID:\t\t\t" << NBadComponent[1][0][0] << "\t" - << NBadComponent[1][0][1] << "\t" << NBadComponent[1][0][2] << "\t" - << NBadComponent[1][0][3]; - ss << "\nTOB:\t\t\t" << NBadComponent[2][0][0] << "\t" - << NBadComponent[2][0][1] << "\t" << NBadComponent[2][0][2] << "\t" - << NBadComponent[2][0][3]; - ss << "\nTEC:\t\t\t" << NBadComponent[3][0][0] << "\t" - << NBadComponent[3][0][1] << "\t" << NBadComponent[3][0][2] << "\t" - << NBadComponent[3][0][3]; + ss << "\nTIB:\t\t\t" << NBadComponent[0][0][0] << "\t" << NBadComponent[0][0][1] << "\t" << NBadComponent[0][0][2] + << "\t" << NBadComponent[0][0][3]; + ss << "\nTID:\t\t\t" << NBadComponent[1][0][0] << "\t" << NBadComponent[1][0][1] << "\t" << NBadComponent[1][0][2] + << "\t" << NBadComponent[1][0][3]; + ss << "\nTOB:\t\t\t" << NBadComponent[2][0][0] << "\t" << NBadComponent[2][0][1] << "\t" << NBadComponent[2][0][2] + << "\t" << NBadComponent[2][0][3]; + ss << "\nTEC:\t\t\t" << NBadComponent[3][0][0] << "\t" << NBadComponent[3][0][1] << "\t" << NBadComponent[3][0][2] + << "\t" << NBadComponent[3][0][3]; ss << "\n"; for (int i = 1; i < 5; ++i) { - ss << "\nTIB Layer " << i << " :\t\t" << NBadComponent[0][i][0] << "\t" - << NBadComponent[0][i][1] << "\t" << NBadComponent[0][i][2] << "\t" - << NBadComponent[0][i][3]; + ss << "\nTIB Layer " << i << " :\t\t" << NBadComponent[0][i][0] << "\t" << NBadComponent[0][i][1] << "\t" + << NBadComponent[0][i][2] << "\t" << NBadComponent[0][i][3]; std::stringstream binlabel; binlabel << "TIB L " << i; @@ -434,9 +375,8 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { } ss << "\n"; for (int i = 1; i < 4; ++i) { - ss << "\nTID+ Disk " << i << " :\t\t" << NBadComponent[1][i][0] << "\t" - << NBadComponent[1][i][1] << "\t" << NBadComponent[1][i][2] << "\t" - << NBadComponent[1][i][3]; + ss << "\nTID+ Disk " << i << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t" + << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3]; std::stringstream binlabel; binlabel << "TID+ D " << i; @@ -446,9 +386,8 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { } } for (int i = 4; i < 7; ++i) { - ss << "\nTID- Disk " << i - 3 << " :\t\t" << NBadComponent[1][i][0] << "\t" - << NBadComponent[1][i][1] << "\t" << NBadComponent[1][i][2] << "\t" - << NBadComponent[1][i][3]; + ss << "\nTID- Disk " << i - 3 << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t" + << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3]; std::stringstream binlabel; binlabel << "TID- D " << i - 3; @@ -459,9 +398,8 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { } ss << "\n"; for (int i = 1; i < 7; ++i) { - ss << "\nTOB Layer " << i << " :\t\t" << NBadComponent[2][i][0] << "\t" - << NBadComponent[2][i][1] << "\t" << NBadComponent[2][i][2] << "\t" - << NBadComponent[2][i][3]; + ss << "\nTOB Layer " << i << " :\t\t" << NBadComponent[2][i][0] << "\t" << NBadComponent[2][i][1] << "\t" + << NBadComponent[2][i][2] << "\t" << NBadComponent[2][i][3]; std::stringstream binlabel; binlabel << "TOB L " << i; @@ -472,9 +410,8 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { } ss << "\n"; for (int i = 1; i < 10; ++i) { - ss << "\nTEC+ Disk " << i << " :\t\t" << NBadComponent[3][i][0] << "\t" - << NBadComponent[3][i][1] << "\t" << NBadComponent[3][i][2] << "\t" - << NBadComponent[3][i][3]; + ss << "\nTEC+ Disk " << i << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t" + << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3]; std::stringstream binlabel; binlabel << "TEC+ D " << i; @@ -484,9 +421,8 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { } } for (int i = 10; i < 19; ++i) { - ss << "\nTEC- Disk " << i - 9 << " :\t\t" << NBadComponent[3][i][0] << "\t" - << NBadComponent[3][i][1] << "\t" << NBadComponent[3][i][2] << "\t" - << NBadComponent[3][i][3]; + ss << "\nTEC- Disk " << i - 9 << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t" + << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3]; std::stringstream binlabel; binlabel << "TEC- D " << i - 9; @@ -529,48 +465,34 @@ void SiStripQualityDQM::fillGrandSummaryMEs(const edm::EventSetup &eSetup) { } //===================== -void SiStripQualityDQM::SetBadComponents(int i, int component, - SiStripQuality::BadComponent &BC) { - +void SiStripQualityDQM::SetBadComponents(int i, int component, SiStripQuality::BadComponent &BC) { int napv = reader->getNumberOfApvsAndStripLength(BC.detid).first; - ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " - << ((BC.BadFibers) & 0x1) << " "; + ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " "; if (napv == 4) ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1); if (napv == 6) - ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " - << ((BC.BadFibers >> 2) & 0x1); - ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " - << ((BC.BadApvs >> 1) & 0x1) << " "; + ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1); + ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " "; if (napv == 4) - ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " - << ((BC.BadApvs >> 3) & 0x1); + ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1); if (napv == 6) - ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " - << ((BC.BadApvs >> 3) & 0x1) << " " - << ((BC.BadApvs >> 4) & 0x1) << " " - << ((BC.BadApvs >> 5) & 0x1) << " "; + ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " " + << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " "; if (BC.BadApvs) { - NBadComponent[i][0][2] += - ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + - ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) + - ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1); - NBadComponent[i][component][2] += - ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + - ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) + - ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1); + NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) + + ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1); + NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + + ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) + + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1); // tkMap->fillc(BC.detid,0xff0000); } if (BC.BadFibers) { - NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + - ((BC.BadFibers >> 1) & 0x1) + - ((BC.BadFibers) & 0x1); - NBadComponent[i][component][1] += ((BC.BadFibers >> 2) & 0x1) + - ((BC.BadFibers >> 1) & 0x1) + - ((BC.BadFibers) & 0x1); + NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1); + NBadComponent[i][component][1] += + ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1); // tkMap->fillc(BC.detid,0x0000ff); } if (BC.BadModule) { diff --git a/DQM/SiStripMonitorSummary/src/SiStripThresholdDQM.cc b/DQM/SiStripMonitorSummary/src/SiStripThresholdDQM.cc index b596d5fc70bcc..3f08137e3cb24 100644 --- a/DQM/SiStripMonitorSummary/src/SiStripThresholdDQM.cc +++ b/DQM/SiStripMonitorSummary/src/SiStripThresholdDQM.cc @@ -18,11 +18,9 @@ SiStripThresholdDQM::SiStripThresholdDQM(const edm::EventSetup &eSetup, eSetup.get().get(tkDetMapHandle); const TkDetMap *tkDetMap = tkDetMapHandle.product(); if (WhichThreshold == "Low") - Tk_HM_L = std::make_unique(tkDetMap, "SiStrip/Histo_Map", - "LowThresh_TkMap", 0.); + Tk_HM_L = std::make_unique(tkDetMap, "SiStrip/Histo_Map", "LowThresh_TkMap", 0.); if (WhichThreshold == "High") - Tk_HM_H = std::make_unique(tkDetMap, "SiStrip/Histo_Map", - "HighThresh_TkMap", 0.); + Tk_HM_H = std::make_unique(tkDetMap, "SiStrip/Histo_Map", "HighThresh_TkMap", 0.); } } @@ -34,7 +32,6 @@ SiStripThresholdDQM::~SiStripThresholdDQM() {} // ----- void SiStripThresholdDQM::getActiveDetIds(const edm::EventSetup &eSetup) { - getConditionObject(eSetup); thresholdHandle_->getDetIds(activeDetIds); } @@ -43,9 +40,7 @@ void SiStripThresholdDQM::getActiveDetIds(const edm::EventSetup &eSetup) { //===================================================================================== // ----- -void SiStripThresholdDQM::fillModMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripThresholdDQM::fillModMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); @@ -53,9 +48,8 @@ void SiStripThresholdDQM::fillModMEs( ModMEs CondObj_ME; - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { - + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForDet(CondObj_ME, *detIter_, tTopo); } } @@ -64,48 +58,38 @@ void SiStripThresholdDQM::fillModMEs( //====================================================================================== // ----- -void SiStripThresholdDQM::fillMEsForDet(const ModMEs &_selModME_, - uint32_t selDetId_, - const TrackerTopology *tTopo) { +void SiStripThresholdDQM::fillMEsForDet(const ModMEs &_selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) { ModMEs selModME_ = _selModME_; std::vector DetIds; thresholdHandle_->getDetIds(DetIds); - SiStripThreshold::Range ThresholdRange = - thresholdHandle_->getRange(selDetId_); + SiStripThreshold::Range ThresholdRange = thresholdHandle_->getRange(selDetId_); int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first * 128; getModMEs(selModME_, selDetId_, tTopo); for (int istrip = 0; istrip < nStrip; ++istrip) { - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { if (WhichThreshold == "Low") - selModME_.ProfileDistr->Fill( - istrip + 1, - thresholdHandle_->getData(istrip, ThresholdRange).getLth()); + selModME_.ProfileDistr->Fill(istrip + 1, thresholdHandle_->getData(istrip, ThresholdRange).getLth()); if (WhichThreshold == "High") - selModME_.ProfileDistr->Fill( - istrip + 1, - thresholdHandle_->getData(istrip, ThresholdRange).getHth()); + selModME_.ProfileDistr->Fill(istrip + 1, thresholdHandle_->getData(istrip, ThresholdRange).getHth()); } - } // istrip + } // istrip } // ----- //======================================================================================= // ----- -void SiStripThresholdDQM::fillSummaryMEs( - const std::vector &selectedDetIds, const edm::EventSetup &es) { - +void SiStripThresholdDQM::fillSummaryMEs(const std::vector &selectedDetIds, const edm::EventSetup &es) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); const TrackerTopology *const tTopo = tTopoHandle.product(); - for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); - detIter_ != selectedDetIds.end(); detIter_++) { + for (std::vector::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end(); + detIter_++) { fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo); } } @@ -114,31 +98,26 @@ void SiStripThresholdDQM::fillSummaryMEs( //======================================================================================= // ----- void SiStripThresholdDQM::fillMEsForLayer( - /*std::map selMEsMap_,*/ uint32_t selDetId_, - const TrackerTopology *tTopo) { - + /*std::map selMEsMap_,*/ uint32_t selDetId_, const TrackerTopology *tTopo) { // ---- int subdetectorId_ = ((selDetId_ >> 25) & 0x7); if (subdetectorId_ < 3 || subdetectorId_ > 6) { - edm::LogError("SiStripThresholdDQM") - << "[SiStripThresholdDQM::fillMEsForLayer] WRONG INPUT : no such " - "subdetector type : " - << subdetectorId_ << " no folder set!" << std::endl; + edm::LogError("SiStripThresholdDQM") << "[SiStripThresholdDQM::fillMEsForLayer] WRONG INPUT : no such " + "subdetector type : " + << subdetectorId_ << " no folder set!" << std::endl; return; } // ---- - std::map::iterator selMEsMapIter_ = - SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); + std::map::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second); ModMEs selME_; if (selMEsMapIter_ != SummaryMEsMap_.end()) selME_ = selMEsMapIter_->second; getSummaryMEs(selME_, selDetId_, tTopo); - SiStripThreshold::Range ThresholdRange = - thresholdHandle_->getRange(selDetId_); + SiStripThreshold::Range ThresholdRange = thresholdHandle_->getRange(selDetId_); int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first * 128; @@ -148,69 +127,47 @@ void SiStripThresholdDQM::fillMEsForLayer( // --> profile summary std::string hSummaryOfProfile_description; - hSummaryOfProfile_description = - hPSet_.getParameter("SummaryOfProfile_description"); + hSummaryOfProfile_description = hPSet_.getParameter("SummaryOfProfile_description"); std::string hSummaryOfProfile_name; hSummaryOfProfile_name = hidmanager.createHistoLayer( - hSummaryOfProfile_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); for (int istrip = 0; istrip < nStrip; ++istrip) { - - if (CondObj_fillId_ == "onlyProfile" || - CondObj_fillId_ == "ProfileAndCumul") { + if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") { if (WhichThreshold == "Low") { - selME_.SummaryOfProfileDistr->Fill( - istrip + 1, - thresholdHandle_->getData(istrip, ThresholdRange).getLth()); - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) - fillTkMap( - selDetId_, - thresholdHandle_->getData(istrip, ThresholdRange).getLth()); + selME_.SummaryOfProfileDistr->Fill(istrip + 1, thresholdHandle_->getData(istrip, ThresholdRange).getLth()); + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) + fillTkMap(selDetId_, thresholdHandle_->getData(istrip, ThresholdRange).getLth()); } if (WhichThreshold == "High") { - selME_.SummaryOfProfileDistr->Fill( - istrip + 1, - thresholdHandle_->getData(istrip, ThresholdRange).getHth()); - if (fPSet_.getParameter("TkMap_On") || - hPSet_.getParameter("TkMap_On")) - fillTkMap( - selDetId_, - thresholdHandle_->getData(istrip, ThresholdRange).getHth()); + selME_.SummaryOfProfileDistr->Fill(istrip + 1, thresholdHandle_->getData(istrip, ThresholdRange).getHth()); + if (fPSet_.getParameter("TkMap_On") || hPSet_.getParameter("TkMap_On")) + fillTkMap(selDetId_, thresholdHandle_->getData(istrip, ThresholdRange).getHth()); } } - } // istrip + } // istrip - } // if Fill + } // if Fill if (hPSet_.getParameter("FillSummaryAtLayerLevel")) { - // --> summary std::string hSummary_description; - hSummary_description = - hPSet_.getParameter("Summary_description"); + hSummary_description = hPSet_.getParameter("Summary_description"); std::string hSummary_name; - hSummary_name = hidmanager.createHistoLayer( - hSummary_description, "layer", - getLayerNameAndId(selDetId_, tTopo).first, ""); + hSummary_name = + hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, ""); float meanLowThreshold = 0; float meanHighThreshold = 0; for (int istrip = 0; istrip < nStrip; ++istrip) { - - meanLowThreshold = - meanLowThreshold + - thresholdHandle_->getData(istrip, ThresholdRange).getLth(); - meanHighThreshold = - meanHighThreshold + - thresholdHandle_->getData(istrip, ThresholdRange).getHth(); - } // istrip + meanLowThreshold = meanLowThreshold + thresholdHandle_->getData(istrip, ThresholdRange).getLth(); + meanHighThreshold = meanHighThreshold + thresholdHandle_->getData(istrip, ThresholdRange).getHth(); + } // istrip meanLowThreshold = meanLowThreshold / nStrip; meanHighThreshold = meanHighThreshold / nStrip; @@ -218,8 +175,7 @@ void SiStripThresholdDQM::fillMEsForLayer( // ----- // get detIds belonging to same layer to fill X-axis with detId-number - std::vector sameLayerDetIds_ = - GetSameLayerDetId(activeDetIds, selDetId_, tTopo); + std::vector sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_, tTopo); unsigned int iBin = 0; for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) { @@ -239,6 +195,6 @@ void SiStripThresholdDQM::fillMEsForLayer( Tk_HM_H->fill(selDetId_, meanHighThreshold); } - } // if Fill ... + } // if Fill ... } // ----- diff --git a/DQMOffline/Ecal/interface/ESRecoSummary.h b/DQMOffline/Ecal/interface/ESRecoSummary.h index f9a048671abcb..bde2ef810bc9e 100644 --- a/DQMOffline/Ecal/interface/ESRecoSummary.h +++ b/DQMOffline/Ecal/interface/ESRecoSummary.h @@ -18,8 +18,7 @@ class ESRecoSummary : public DQMEDAnalyzer { ~ESRecoSummary() override {} private: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(const edm::Event &, const edm::EventSetup &) override; std::string prefixME_; diff --git a/DQMOffline/Ecal/interface/EcalPileUpDepMonitor.h b/DQMOffline/Ecal/interface/EcalPileUpDepMonitor.h index 44036ee9385dc..5bd4aea537535 100644 --- a/DQMOffline/Ecal/interface/EcalPileUpDepMonitor.h +++ b/DQMOffline/Ecal/interface/EcalPileUpDepMonitor.h @@ -24,7 +24,6 @@ #include "DataFormats/VertexReco/interface/VertexFwd.h" class EcalPileUpDepMonitor : public DQMEDAnalyzer { - public: /// Constructor EcalPileUpDepMonitor(const edm::ParameterSet &ps); @@ -35,22 +34,19 @@ class EcalPileUpDepMonitor : public DQMEDAnalyzer { protected: /// Analyze void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // profiles - MonitorElement - *bcEB_PV; // basic clusters Ecal-Barrel vs Number of Primary Vertices + MonitorElement *bcEB_PV; // basic clusters Ecal-Barrel vs Number of Primary Vertices MonitorElement *bcEE_PV; MonitorElement *scEB_PV; MonitorElement *scEE_PV; - MonitorElement *scEtEB_PV; // super cluster Et profiles vs Number of vertices + MonitorElement *scEtEB_PV; // super cluster Et profiles vs Number of vertices MonitorElement *scEtEE_PV; - MonitorElement - *recHitEtEB_PV; // reconstructed hit Et profiles vs number of vertices + MonitorElement *recHitEtEB_PV; // reconstructed hit Et profiles vs number of vertices MonitorElement *recHitEtEE_PV; MonitorElement *emIso_PV; @@ -92,16 +88,12 @@ class EcalPileUpDepMonitor : public DQMEDAnalyzer { edm::ESHandle geomH; edm::ESHandle caloTop; - edm::EDGetTokenT - VertexCollection_; // vertex collection + edm::EDGetTokenT VertexCollection_; // vertex collection - edm::EDGetTokenT> - basicClusterCollection_EB_; // Ecal Barrel Basic Clusters - edm::EDGetTokenT> - basicClusterCollection_EE_; // Ecal Endcap Basic Clusters - edm::EDGetTokenT> - basicClusterCollection_; // Ecal Barrel & Endcap Basic Clusters (for >= - // 70X, BC collection is merged) + edm::EDGetTokenT> basicClusterCollection_EB_; // Ecal Barrel Basic Clusters + edm::EDGetTokenT> basicClusterCollection_EE_; // Ecal Endcap Basic Clusters + edm::EDGetTokenT> basicClusterCollection_; // Ecal Barrel & Endcap Basic Clusters (for >= + // 70X, BC collection is merged) edm::EDGetTokenT superClusterCollection_EB_; edm::EDGetTokenT superClusterCollection_EE_; diff --git a/DQMOffline/Ecal/plugins/ECALMultifitAnalyzer_HI.cc b/DQMOffline/Ecal/plugins/ECALMultifitAnalyzer_HI.cc index 30cda2bf5d0d6..8828196c0299d 100644 --- a/DQMOffline/Ecal/plugins/ECALMultifitAnalyzer_HI.cc +++ b/DQMOffline/Ecal/plugins/ECALMultifitAnalyzer_HI.cc @@ -60,8 +60,7 @@ class ECALMultifitAnalyzer_HI : public DQMEDAnalyzer { ~ECALMultifitAnalyzer_HI() override {} private: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(const edm::Event &, const edm::EventSetup &) override; edm::EDGetTokenT> recoPhotonsCollection_; @@ -105,25 +104,17 @@ class ECALMultifitAnalyzer_HI : public DQMEDAnalyzer { // // constructors and destructor // -ECALMultifitAnalyzer_HI::ECALMultifitAnalyzer_HI( - const edm::ParameterSet &iConfig) +ECALMultifitAnalyzer_HI::ECALMultifitAnalyzer_HI(const edm::ParameterSet &iConfig) : - recoPhotonsCollection_(consumes>( - iConfig.getParameter("recoPhotonSrc"))), - caloJetToken_(consumes( - iConfig.getParameter("recoJetSrc"))), - RecHitCollection_EB_(consumes( - iConfig.getParameter("RecHitCollection_EB"))), - RecHitCollection_EE_(consumes( - iConfig.getParameter("RecHitCollection_EE"))), - mRechitEnergyThreshold( - iConfig.getParameter("rechitEnergyThreshold")), - mRecoPhotonPtThreshold( - iConfig.getParameter("recoPhotonPtThreshold")), + recoPhotonsCollection_(consumes>(iConfig.getParameter("recoPhotonSrc"))), + caloJetToken_(consumes(iConfig.getParameter("recoJetSrc"))), + RecHitCollection_EB_(consumes(iConfig.getParameter("RecHitCollection_EB"))), + RecHitCollection_EE_(consumes(iConfig.getParameter("RecHitCollection_EE"))), + mRechitEnergyThreshold(iConfig.getParameter("rechitEnergyThreshold")), + mRecoPhotonPtThreshold(iConfig.getParameter("recoPhotonPtThreshold")), mRecoJetPtThreshold(iConfig.getParameter("recoJetPtThreshold")), - mDeltaRPhotonThreshold( - iConfig.getParameter("deltaRPhotonThreshold")), + mDeltaRPhotonThreshold(iConfig.getParameter("deltaRPhotonThreshold")), mDeltaRJetThreshold(iConfig.getParameter("deltaRJetThreshold")) {} // @@ -131,9 +122,7 @@ ECALMultifitAnalyzer_HI::ECALMultifitAnalyzer_HI( // // ------------ method called for each event ------------ -void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { - +void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { using namespace edm; edm::ESHandle geomH; @@ -152,8 +141,7 @@ void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, Handle eeHandle; iEvent.getByToken(RecHitCollection_EE_, eeHandle); - for (EcalRecHitCollection::const_iterator hit = ebHandle->begin(); - hit != ebHandle->end(); ++hit) { + for (EcalRecHitCollection::const_iterator hit = ebHandle->begin(); hit != ebHandle->end(); ++hit) { eb_chi2->Fill(hit->chi2()); eb_errors->Fill(hit->energyError()); double eta = geom->getGeometry(hit->detid())->getPosition().eta(); @@ -167,9 +155,8 @@ void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, eb_errors_e5_eta->Fill(eta, hit->energyError()); } - for (std::vector::const_iterator pho = - recoPhotonsHandle->begin(); - pho != recoPhotonsHandle->end(); ++pho) { + for (std::vector::const_iterator pho = recoPhotonsHandle->begin(); pho != recoPhotonsHandle->end(); + ++pho) { if (pho->et() < mRecoPhotonPtThreshold) continue; double dr = reco::deltaR(eta, phi, pho->eta(), pho->phi()); @@ -178,9 +165,7 @@ void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, eb_errors_photon15->Fill(hit->energyError()); } } - for (std::vector::const_iterator jet = - recoJetHandle->begin(); - jet != recoJetHandle->end(); ++jet) { + for (std::vector::const_iterator jet = recoJetHandle->begin(); jet != recoJetHandle->end(); ++jet) { if (jet->pt() < mRecoJetPtThreshold) continue; double dr = reco::deltaR(eta, phi, jet->eta(), jet->phi()); @@ -191,8 +176,7 @@ void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, } } - for (EcalRecHitCollection::const_iterator hit = eeHandle->begin(); - hit != eeHandle->end(); ++hit) { + for (EcalRecHitCollection::const_iterator hit = eeHandle->begin(); hit != eeHandle->end(); ++hit) { ee_chi2->Fill(hit->chi2()); ee_errors->Fill(hit->energyError()); double eta = geom->getGeometry(hit->detid())->getPosition().eta(); @@ -206,9 +190,8 @@ void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, ee_errors_e5_eta->Fill(eta, hit->energyError()); } - for (std::vector::const_iterator pho = - recoPhotonsHandle->begin(); - pho != recoPhotonsHandle->end(); ++pho) { + for (std::vector::const_iterator pho = recoPhotonsHandle->begin(); pho != recoPhotonsHandle->end(); + ++pho) { if (pho->et() < mRecoPhotonPtThreshold) continue; double dr = reco::deltaR(eta, phi, pho->eta(), pho->phi()); @@ -217,9 +200,7 @@ void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, ee_errors_photon15->Fill(hit->energyError()); } } - for (std::vector::const_iterator jet = - recoJetHandle->begin(); - jet != recoJetHandle->end(); ++jet) { + for (std::vector::const_iterator jet = recoJetHandle->begin(); jet != recoJetHandle->end(); ++jet) { if (jet->pt() < mRecoJetPtThreshold) continue; double dr = reco::deltaR(eta, phi, jet->eta(), jet->phi()); @@ -233,10 +214,7 @@ void ECALMultifitAnalyzer_HI::analyze(const edm::Event &iEvent, // ------------ method called once each job just before starting event loop // ------------ -void ECALMultifitAnalyzer_HI::bookHistograms(DQMStore::IBooker &iBooker, - edm::Run const &, - edm::EventSetup const &) { - +void ECALMultifitAnalyzer_HI::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &) { iBooker.setCurrentFolder("EcalCalibration/HIN_MultiFitAnalyzer"); eb_chi2 = nullptr; @@ -269,74 +247,82 @@ void ECALMultifitAnalyzer_HI::bookHistograms(DQMStore::IBooker &iBooker, const float maxChi2 = 70; const float maxError = 0.5; - TH2F *hProfile_Chi2 = - new TH2F("hProfile_Chi2", "", nBins, -5, 5, nBins, 0, maxChi2); - TH2F *hProfile_Err = - new TH2F("hProfile_Err", "", nBins, -5, 5, nBins, 0, maxError); + TH2F *hProfile_Chi2 = new TH2F("hProfile_Chi2", "", nBins, -5, 5, nBins, 0, maxChi2); + TH2F *hProfile_Err = new TH2F("hProfile_Err", "", nBins, -5, 5, nBins, 0, maxError); - eb_chi2 = iBooker.book1D("rechit_eb_chi2", "Rechit eb_chi2;chi2 fit value;", - nBins, 0, maxChi2); + eb_chi2 = iBooker.book1D("rechit_eb_chi2", "Rechit eb_chi2;chi2 fit value;", nBins, 0, maxChi2); eb_chi2_eta = iBooker.book2D("rechit_eb_eta_Vs_mean_Chi2", hProfile_Chi2); - eb_chi2_e5 = - iBooker.book1D(Form("rechit_eb_chi2_e%2.0f", mRechitEnergyThreshold), - Form("Rechit eb_chi2, e>%2.0fGeV;chi2 fit value;", - mRechitEnergyThreshold), - nBins, 0, maxChi2); - eb_chi2_e5_eta = iBooker.book2D( - Form("rechit_eb_chi2_e%2.0f_eta", mRechitEnergyThreshold), hProfile_Chi2); - eb_errors = iBooker.book1D("rechit_eb_errors", - "Rechit eb_errors;error on the energy;", nBins, 0, - maxError); + eb_chi2_e5 = iBooker.book1D(Form("rechit_eb_chi2_e%2.0f", mRechitEnergyThreshold), + Form("Rechit eb_chi2, e>%2.0fGeV;chi2 fit value;", mRechitEnergyThreshold), + nBins, + 0, + maxChi2); + eb_chi2_e5_eta = iBooker.book2D(Form("rechit_eb_chi2_e%2.0f_eta", mRechitEnergyThreshold), hProfile_Chi2); + eb_errors = iBooker.book1D("rechit_eb_errors", "Rechit eb_errors;error on the energy;", nBins, 0, maxError); eb_errors_eta = iBooker.book2D("rechit_eb_errors_eta", hProfile_Err); - eb_errors_e5 = iBooker.book1D( - Form("rechit_eb_errors_e%2.0f", mRechitEnergyThreshold), - "Rechit eb_errors, e>5GeV;error on the energy;", nBins, 0, maxError); - eb_errors_e5_eta = iBooker.book2D( - Form("rechit_eb_errors_e%2.0f_eta", mRechitEnergyThreshold), - hProfile_Err); - eb_chi2_photon15 = iBooker.book1D( - Form("rechit_eb_chi2_photon%2.0f", mRecoPhotonPtThreshold), - "Rechit eb_chi2 near photons;chi2 fit value;", nBins, 0, maxChi2); - eb_errors_photon15 = iBooker.book1D( - Form("rechit_eb_errors_photon%2.0f", mRecoPhotonPtThreshold), - "Rechit eb_errors near photons;error on the energy;", nBins, 0, maxError); - eb_chi2_jet30 = iBooker.book1D( - Form("rechit_eb_chi2_jet%2.0f", mRecoJetPtThreshold), - "Rechit eb_chi2 near jets;chi2 fit value;", nBins, 0, maxChi2); - eb_errors_jet30 = iBooker.book1D( - Form("rechit_eb_errors_jet%2.0f", mRecoJetPtThreshold), - "Rechit eb_errors near jets;error on the energy;", nBins, 0, maxError); - - ee_chi2 = iBooker.book1D("rechit_ee_chi2", "Rechit ee_chi2;chi2 fit value;", - nBins, 0, maxChi2); + eb_errors_e5 = iBooker.book1D(Form("rechit_eb_errors_e%2.0f", mRechitEnergyThreshold), + "Rechit eb_errors, e>5GeV;error on the energy;", + nBins, + 0, + maxError); + eb_errors_e5_eta = iBooker.book2D(Form("rechit_eb_errors_e%2.0f_eta", mRechitEnergyThreshold), hProfile_Err); + eb_chi2_photon15 = iBooker.book1D(Form("rechit_eb_chi2_photon%2.0f", mRecoPhotonPtThreshold), + "Rechit eb_chi2 near photons;chi2 fit value;", + nBins, + 0, + maxChi2); + eb_errors_photon15 = iBooker.book1D(Form("rechit_eb_errors_photon%2.0f", mRecoPhotonPtThreshold), + "Rechit eb_errors near photons;error on the energy;", + nBins, + 0, + maxError); + eb_chi2_jet30 = iBooker.book1D(Form("rechit_eb_chi2_jet%2.0f", mRecoJetPtThreshold), + "Rechit eb_chi2 near jets;chi2 fit value;", + nBins, + 0, + maxChi2); + eb_errors_jet30 = iBooker.book1D(Form("rechit_eb_errors_jet%2.0f", mRecoJetPtThreshold), + "Rechit eb_errors near jets;error on the energy;", + nBins, + 0, + maxError); + + ee_chi2 = iBooker.book1D("rechit_ee_chi2", "Rechit ee_chi2;chi2 fit value;", nBins, 0, maxChi2); ee_chi2_eta = iBooker.book2D("rechit_ee_chi2_eta", hProfile_Chi2); - ee_chi2_e5 = iBooker.book1D( - Form("rechit_ee_chi2_e%2.0f", mRechitEnergyThreshold), - "Rechit ee_chi2, e>5GeV;chi2 fit value;", nBins, 0, maxChi2); - ee_chi2_e5_eta = iBooker.book2D( - Form("rechit_ee_chi2_e%2.0f_eta", mRechitEnergyThreshold), hProfile_Chi2); - ee_errors = iBooker.book1D("rechit_ee_errors", - "Rechit ee_errors;error on the energy;", nBins, 0, - maxError); + ee_chi2_e5 = iBooker.book1D(Form("rechit_ee_chi2_e%2.0f", mRechitEnergyThreshold), + "Rechit ee_chi2, e>5GeV;chi2 fit value;", + nBins, + 0, + maxChi2); + ee_chi2_e5_eta = iBooker.book2D(Form("rechit_ee_chi2_e%2.0f_eta", mRechitEnergyThreshold), hProfile_Chi2); + ee_errors = iBooker.book1D("rechit_ee_errors", "Rechit ee_errors;error on the energy;", nBins, 0, maxError); ee_errors_eta = iBooker.book2D("rechit_ee_errors_eta", hProfile_Err); - ee_errors_e5 = iBooker.book1D( - Form("rechit_ee_errors_e%2.0f", mRechitEnergyThreshold), - "Rechit ee_errors, e>5GeV;error on the energy;", nBins, 0, maxError); - ee_errors_e5_eta = iBooker.book2D( - Form("rechit_ee_errors_e%2.0f_eta", mRechitEnergyThreshold), - hProfile_Err); - ee_chi2_photon15 = iBooker.book1D( - Form("rechit_ee_chi2_photon%2.0f", mRecoPhotonPtThreshold), - "Rechit ee_chi2 near photons;chi2 fit value;", nBins, 0, maxChi2); - ee_errors_photon15 = iBooker.book1D( - Form("rechit_ee_errors_photon%2.0f", mRecoPhotonPtThreshold), - "Rechit ee_errors near photons;error on the energy;", nBins, 0, maxError); - ee_chi2_jet30 = iBooker.book1D( - Form("rechit_ee_chi2_jet%2.0f", mRecoJetPtThreshold), - "Rechit ee_chi2 near jets;chi2 fit value;", nBins, 0, maxChi2); - ee_errors_jet30 = iBooker.book1D( - Form("rechit_ee_errors_jet%2.0f", mRecoJetPtThreshold), - "Rechit ee_errors near jets;error on the energy;", nBins, 0, maxError); + ee_errors_e5 = iBooker.book1D(Form("rechit_ee_errors_e%2.0f", mRechitEnergyThreshold), + "Rechit ee_errors, e>5GeV;error on the energy;", + nBins, + 0, + maxError); + ee_errors_e5_eta = iBooker.book2D(Form("rechit_ee_errors_e%2.0f_eta", mRechitEnergyThreshold), hProfile_Err); + ee_chi2_photon15 = iBooker.book1D(Form("rechit_ee_chi2_photon%2.0f", mRecoPhotonPtThreshold), + "Rechit ee_chi2 near photons;chi2 fit value;", + nBins, + 0, + maxChi2); + ee_errors_photon15 = iBooker.book1D(Form("rechit_ee_errors_photon%2.0f", mRecoPhotonPtThreshold), + "Rechit ee_errors near photons;error on the energy;", + nBins, + 0, + maxError); + ee_chi2_jet30 = iBooker.book1D(Form("rechit_ee_chi2_jet%2.0f", mRecoJetPtThreshold), + "Rechit ee_chi2 near jets;chi2 fit value;", + nBins, + 0, + maxChi2); + ee_errors_jet30 = iBooker.book1D(Form("rechit_ee_errors_jet%2.0f", mRecoJetPtThreshold), + "Rechit ee_errors near jets;error on the energy;", + nBins, + 0, + maxError); delete hProfile_Chi2; delete hProfile_Err; diff --git a/DQMOffline/Ecal/plugins/ESRecoSummary.cc b/DQMOffline/Ecal/plugins/ESRecoSummary.cc index cffe91bf2e81f..acc93a66b3f35 100644 --- a/DQMOffline/Ecal/plugins/ESRecoSummary.cc +++ b/DQMOffline/Ecal/plugins/ESRecoSummary.cc @@ -43,35 +43,27 @@ ESRecoSummary::ESRecoSummary(const edm::ParameterSet &ps) { prefixME_ = ps.getUntrackedParameter("prefixME", ""); // now do what ever initialization is needed - esRecHitCollection_ = consumes( - ps.getParameter("recHitCollection_ES")); - esClusterCollectionX_ = consumes( - ps.getParameter("ClusterCollectionX_ES")); - esClusterCollectionY_ = consumes( - ps.getParameter("ClusterCollectionY_ES")); - - superClusterCollection_EE_ = consumes( - ps.getParameter("superClusterCollection_EE")); + esRecHitCollection_ = consumes(ps.getParameter("recHitCollection_ES")); + esClusterCollectionX_ = + consumes(ps.getParameter("ClusterCollectionX_ES")); + esClusterCollectionY_ = + consumes(ps.getParameter("ClusterCollectionY_ES")); + + superClusterCollection_EE_ = + consumes(ps.getParameter("superClusterCollection_EE")); } -void ESRecoSummary::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, - edm::EventSetup const &) { +void ESRecoSummary::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &) { // Monitor Elements (ex THXD) - iBooker.setCurrentFolder( - prefixME_ + "/ESRecoSummary"); // to organise the histos in folders + iBooker.setCurrentFolder(prefixME_ + "/ESRecoSummary"); // to organise the histos in folders // Preshower ---------------------------------------------- - h_recHits_ES_energyMax = iBooker.book1D( - "recHits_ES_energyMax", "recHits_ES_energyMax", 200, 0., 0.01); - h_recHits_ES_time = - iBooker.book1D("recHits_ES_time", "recHits_ES_time", 200, -100., 100.); - - h_esClusters_energy_plane1 = iBooker.book1D( - "esClusters_energy_plane1", "esClusters_energy_plane1", 200, 0., 0.01); - h_esClusters_energy_plane2 = iBooker.book1D( - "esClusters_energy_plane2", "esClusters_energy_plane2", 200, 0., 0.01); - h_esClusters_energy_ratio = iBooker.book1D( - "esClusters_energy_ratio", "esClusters_energy_ratio", 200, 0., 20.); + h_recHits_ES_energyMax = iBooker.book1D("recHits_ES_energyMax", "recHits_ES_energyMax", 200, 0., 0.01); + h_recHits_ES_time = iBooker.book1D("recHits_ES_time", "recHits_ES_time", 200, -100., 100.); + + h_esClusters_energy_plane1 = iBooker.book1D("esClusters_energy_plane1", "esClusters_energy_plane1", 200, 0., 0.01); + h_esClusters_energy_plane2 = iBooker.book1D("esClusters_energy_plane2", "esClusters_energy_plane2", 200, 0., 0.01); + h_esClusters_energy_ratio = iBooker.book1D("esClusters_energy_ratio", "esClusters_energy_ratio", 200, 0., 20.); } // @@ -91,14 +83,13 @@ void ESRecoSummary::analyze(const edm::Event &ev, const edm::EventSetup &) { float maxRecHitEnergyES = -999.; - for (ESRecHitCollection::const_iterator esItr = thePreShowerRecHits->begin(); - esItr != thePreShowerRecHits->end(); ++esItr) { - + for (ESRecHitCollection::const_iterator esItr = thePreShowerRecHits->begin(); esItr != thePreShowerRecHits->end(); + ++esItr) { h_recHits_ES_time->Fill(esItr->time()); if (esItr->energy() > maxRecHitEnergyES) maxRecHitEnergyES = esItr->energy(); - } // end loop over ES rec Hits + } // end loop over ES rec Hits h_recHits_ES_energyMax->Fill(maxRecHitEnergyES); @@ -115,18 +106,15 @@ void ESRecoSummary::analyze(const edm::Event &ev, const edm::EventSetup &) { // ... endcap edm::Handle superClusters_EE_h; ev.getByToken(superClusterCollection_EE_, superClusters_EE_h); - const reco::SuperClusterCollection *theEndcapSuperClusters = - superClusters_EE_h.product(); + const reco::SuperClusterCollection *theEndcapSuperClusters = superClusters_EE_h.product(); if (!superClusters_EE_h.isValid()) { - std::cerr << "EcalRecHitSummary::analyze --> superClusters_EE_h not found" - << std::endl; + std::cerr << "EcalRecHitSummary::analyze --> superClusters_EE_h not found" << std::endl; } // loop over all super clusters - for (reco::SuperClusterCollection::const_iterator itSC = - theEndcapSuperClusters->begin(); - itSC != theEndcapSuperClusters->end(); ++itSC) { - + for (reco::SuperClusterCollection::const_iterator itSC = theEndcapSuperClusters->begin(); + itSC != theEndcapSuperClusters->end(); + ++itSC) { if (fabs(itSC->eta()) < 1.65 || fabs(itSC->eta()) > 2.6) continue; @@ -134,30 +122,30 @@ void ESRecoSummary::analyze(const edm::Event &ev, const edm::EventSetup &) { float ESenergyPlane2 = 0.; // Loop over all ECAL Basic clusters in the supercluster - for (reco::CaloCluster_iterator ecalBasicCluster = itSC->clustersBegin(); - ecalBasicCluster != itSC->clustersEnd(); ecalBasicCluster++) { + for (reco::CaloCluster_iterator ecalBasicCluster = itSC->clustersBegin(); ecalBasicCluster != itSC->clustersEnd(); + ecalBasicCluster++) { const reco::CaloClusterPtr ecalBasicClusterPtr = *(ecalBasicCluster); - for (reco::PreshowerClusterCollection::const_iterator iESClus = - ESclustersX->begin(); - iESClus != ESclustersX->end(); ++iESClus) { + for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersX->begin(); + iESClus != ESclustersX->end(); + ++iESClus) { const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster(); const reco::PreshowerCluster *esCluster = &*iESClus; if (preshBasicCluster == ecalBasicClusterPtr) { ESenergyPlane1 += esCluster->energy(); } - } // end of x loop + } // end of x loop - for (reco::PreshowerClusterCollection::const_iterator iESClus = - ESclustersY->begin(); - iESClus != ESclustersY->end(); ++iESClus) { + for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersY->begin(); + iESClus != ESclustersY->end(); + ++iESClus) { const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster(); const reco::PreshowerCluster *esCluster = &*iESClus; if (preshBasicCluster == ecalBasicClusterPtr) { ESenergyPlane2 += esCluster->energy(); } - } // end of y loop - } // end loop over all basic clusters in the supercluster + } // end of y loop + } // end loop over all basic clusters in the supercluster // cout<<"DQM : "<Fill(ESenergyPlane1); @@ -165,7 +153,7 @@ void ESRecoSummary::analyze(const edm::Event &ev, const edm::EventSetup &) { if (ESenergyPlane1 > 0 && ESenergyPlane2 > 0) h_esClusters_energy_ratio->Fill(ESenergyPlane1 / ESenergyPlane2); - } // end loop over superclusters + } // end loop over superclusters } // define this as a plug-in diff --git a/DQMOffline/Ecal/plugins/EcalPileUpDepMonitor.cc b/DQMOffline/Ecal/plugins/EcalPileUpDepMonitor.cc index a59e7306eae75..8795f9744972d 100644 --- a/DQMOffline/Ecal/plugins/EcalPileUpDepMonitor.cc +++ b/DQMOffline/Ecal/plugins/EcalPileUpDepMonitor.cc @@ -31,30 +31,26 @@ // Framework EcalPileUpDepMonitor::EcalPileUpDepMonitor(const edm::ParameterSet &ps) { - VertexCollection_ = consumes( - ps.getParameter("VertexCollection")); + VertexCollection_ = consumes(ps.getParameter("VertexCollection")); if (ps.existsAs("basicClusterCollection") && !ps.getParameter("basicClusterCollection").label().empty()) - basicClusterCollection_ = consumes>( - ps.getParameter("basicClusterCollection")); + basicClusterCollection_ = + consumes>(ps.getParameter("basicClusterCollection")); else { - basicClusterCollection_EE_ = consumes>( - ps.getParameter("basicClusterCollection_EE")); - basicClusterCollection_EB_ = consumes>( - ps.getParameter("basicClusterCollection_EB")); + basicClusterCollection_EE_ = + consumes>(ps.getParameter("basicClusterCollection_EE")); + basicClusterCollection_EB_ = + consumes>(ps.getParameter("basicClusterCollection_EB")); } - superClusterCollection_EB_ = consumes( - ps.getParameter("superClusterCollection_EB")); - superClusterCollection_EE_ = consumes( - ps.getParameter("superClusterCollection_EE")); - - RecHitCollection_EB_ = consumes( - ps.getParameter("RecHitCollection_EB")); - RecHitCollection_EE_ = consumes( - ps.getParameter("RecHitCollection_EE")); - EleTag_ = consumes( - ps.getParameter("EleTag")); + superClusterCollection_EB_ = + consumes(ps.getParameter("superClusterCollection_EB")); + superClusterCollection_EE_ = + consumes(ps.getParameter("superClusterCollection_EE")); + + RecHitCollection_EB_ = consumes(ps.getParameter("RecHitCollection_EB")); + RecHitCollection_EE_ = consumes(ps.getParameter("RecHitCollection_EE")); + EleTag_ = consumes(ps.getParameter("EleTag")); } EcalPileUpDepMonitor::~EcalPileUpDepMonitor() {} @@ -106,15 +102,13 @@ void EcalPileUpDepMonitor::bookHistograms(DQMStore::IBooker &ibooker, prof_name = "recHitEtEB_PV"; title = "Reconstructed Hit Et EB vs. PV"; - recHitEtEB_PV = - ibooker.bookProfile(prof_name, title, 50, 0., 50., 50, 0., 350.); + recHitEtEB_PV = ibooker.bookProfile(prof_name, title, 50, 0., 50., 50, 0., 350.); recHitEtEB_PV->setAxisTitle("N_{pv}", 1); recHitEtEB_PV->setAxisTitle("Reconstructed hit E_{T} [GeV]", 2); prof_name = "recHitEtEE_PV"; title = "Reconstructed Hit Et EE vs. PV"; - recHitEtEE_PV = - ibooker.bookProfile(prof_name, title, 50, 0., 50., 50, 0., 350.); + recHitEtEE_PV = ibooker.bookProfile(prof_name, title, 50, 0., 50., 50, 0., 350.); recHitEtEE_PV->setAxisTitle("N_{pv}", 1); recHitEtEE_PV->setAxisTitle("Reconstructed hit E_{T} [GeV]", 2); @@ -235,9 +229,7 @@ void EcalPileUpDepMonitor::bookHistograms(DQMStore::IBooker &ibooker, recHitEtEE->setAxisTitle("Events", 2); } -void EcalPileUpDepMonitor::analyze(const edm::Event &e, - const edm::EventSetup &) { - +void EcalPileUpDepMonitor::analyze(const edm::Event &e, const edm::EventSetup &) { const CaloGeometry *geom = geomH.product(); // Vertex collection: //----------------------------------------- @@ -282,9 +274,8 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, int nBarrel(0); int nEndcap(0); - for (edm::View::const_iterator bcItr( - basicClusters_h->begin()); - bcItr != basicClusters_h->end(); ++bcItr) { + for (edm::View::const_iterator bcItr(basicClusters_h->begin()); bcItr != basicClusters_h->end(); + ++bcItr) { if (bcItr->caloID().detector(reco::CaloID::DET_ECAL_BARREL)) ++nBarrel; if (bcItr->caloID().detector(reco::CaloID::DET_ECAL_ENDCAP)) @@ -321,11 +312,10 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, //--------- Fill Isolation ----------------- if (electronCollection_h.isValid()) { - for (reco::GsfElectronCollection::const_iterator recoElectron = - electronCollection_h->begin(); - recoElectron != electronCollection_h->end(); recoElectron++) { - double IsoEcal = - recoElectron->dr03EcalRecHitSumEt(); /// recoElectron->et() + for (reco::GsfElectronCollection::const_iterator recoElectron = electronCollection_h->begin(); + recoElectron != electronCollection_h->end(); + recoElectron++) { + double IsoEcal = recoElectron->dr03EcalRecHitSumEt(); /// recoElectron->et() emIso_PV->Fill(PVCollection_h->size(), IsoEcal); emIso->Fill(IsoEcal); } @@ -334,11 +324,10 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, // fill super clusters EE scEE_PV->Fill(PVCollection_h->size(), superClusters_EE_h->size()); - for (reco::SuperClusterCollection::const_iterator itSC = - superClusters_EE_h->begin(); - itSC != superClusters_EE_h->end(); ++itSC) { - double scEE_Et = - itSC->energy() * sin(2. * atan(exp(-itSC->position().eta()))); + for (reco::SuperClusterCollection::const_iterator itSC = superClusters_EE_h->begin(); + itSC != superClusters_EE_h->end(); + ++itSC) { + double scEE_Et = itSC->energy() * sin(2. * atan(exp(-itSC->position().eta()))); // double scEE_E=itSC->energy(); // fill super cluster endcap eta/phi @@ -347,12 +336,11 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, // get sigma eta_eta etc - CaloTopology const *p_topology = caloTop.product(); // get calo topology + CaloTopology const *p_topology = caloTop.product(); // get calo topology const EcalRecHitCollection *eeRecHits = RecHitsEE.product(); reco::BasicCluster const &seedCluster(*itSC->seed()); - std::vector cov = - EcalClusterTools::localCovariances(seedCluster, eeRecHits, p_topology); + std::vector cov = EcalClusterTools::localCovariances(seedCluster, eeRecHits, p_topology); float sigmaIetaIeta = std::sqrt(cov[0]); float sigmaIetaIphi = cov[1]; @@ -365,10 +353,10 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, // std::cout << " sigmaIetaIeta: " << sigmaIetaIeta << std::endl; scEtEE_PV->Fill(PVCollection_h->size(), scEE_Et); - scHitEtEE->Fill(scEE_Et); // super cluster Et historam + scHitEtEE->Fill(scEE_Et); // super cluster Et historam // scHitE_EE->Fill(scEE_E); //super cluster energy histogram - } // sc-EE loop + } // sc-EE loop //----------------- Super Cluster Collection Ecal Barrel --------- @@ -379,14 +367,10 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, } scEB_PV->Fill(PVCollection_h->size(), superClusters_EB_h->size()); - for (reco::SuperClusterCollection::const_iterator itSC = - superClusters_EB_h->begin(); - itSC != superClusters_EB_h->end(); ++itSC) { - double scEB_Et = - itSC->energy() * - sin(2. * - atan(exp( - -itSC->position().eta()))); // super cluster transverse energy + for (reco::SuperClusterCollection::const_iterator itSC = superClusters_EB_h->begin(); + itSC != superClusters_EB_h->end(); + ++itSC) { + double scEB_Et = itSC->energy() * sin(2. * atan(exp(-itSC->position().eta()))); // super cluster transverse energy // double scEB_E= itSC->energy(); // super cluster energy // fill super cluster Barrel eta/phi @@ -395,12 +379,11 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, // sigma ietaieta etc - CaloTopology const *p_topology = caloTop.product(); // get calo topology + CaloTopology const *p_topology = caloTop.product(); // get calo topology const EcalRecHitCollection *ebRecHits = RecHitsEB.product(); reco::BasicCluster const &seedCluster(*itSC->seed()); - std::vector cov = - EcalClusterTools::localCovariances(seedCluster, ebRecHits, p_topology); + std::vector cov = EcalClusterTools::localCovariances(seedCluster, ebRecHits, p_topology); float sigmaIetaIeta = std::sqrt(cov[0]); float sigmaIetaIphi = cov[1]; @@ -414,19 +397,17 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, scEtEB_PV->Fill(PVCollection_h->size(), scEB_Et); scHitEtEB->Fill(scEB_Et); // scHitE_EB->Fill(scEB_E); - } // sc-EB loop + } // sc-EB loop //-------------------Compute scalar sum of reconstructed hit Et double RecHitEt_EB = 0; - for (EcalRecHitCollection::const_iterator itr = RecHitsEB->begin(); - itr != RecHitsEB->end(); ++itr) { + for (EcalRecHitCollection::const_iterator itr = RecHitsEB->begin(); itr != RecHitsEB->end(); ++itr) { // RecHitEt_EB +=itr->energy(); - GlobalPoint const &position = - geom->getGeometry(itr->detid())->getPosition(); + GlobalPoint const &position = geom->getGeometry(itr->detid())->getPosition(); RecHitEt_EB += itr->energy() * sin(position.theta()); - } // EB Rec Hit + } // EB Rec Hit recHitEtEB->Fill(RecHitEt_EB); recHitEtEB_PV->Fill(PVCollection_h->size(), RecHitEt_EB); @@ -434,12 +415,10 @@ void EcalPileUpDepMonitor::analyze(const edm::Event &e, //-------------------Compute scalar sum of reconstructed hit Et double RecHitEt_EE = 0; - for (EcalRecHitCollection::const_iterator itr = RecHitsEE->begin(); - itr != RecHitsEE->end(); ++itr) { - GlobalPoint const &position = - geom->getGeometry(itr->detid())->getPosition(); + for (EcalRecHitCollection::const_iterator itr = RecHitsEE->begin(); itr != RecHitsEE->end(); ++itr) { + GlobalPoint const &position = geom->getGeometry(itr->detid())->getPosition(); RecHitEt_EE += itr->energy() * sin(position.theta()); - } // EB Rec Hit + } // EB Rec Hit recHitEtEE->Fill(RecHitEt_EE); recHitEtEE_PV->Fill(PVCollection_h->size(), RecHitEt_EE); diff --git a/DQMOffline/Ecal/plugins/EcalZmassClient.cc b/DQMOffline/Ecal/plugins/EcalZmassClient.cc index 2b4de998d1e32..ec4e839eddf09 100644 --- a/DQMOffline/Ecal/plugins/EcalZmassClient.cc +++ b/DQMOffline/Ecal/plugins/EcalZmassClient.cc @@ -54,8 +54,7 @@ EcalZmassClient::EcalZmassClient(const edm::ParameterSet &iConfig) EcalZmassClient::~EcalZmassClient() {} -void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, - DQMStore::IGetter &_igetter) { +void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, DQMStore::IGetter &_igetter) { MonitorElement *h_fitres1; MonitorElement *h_fitres1bis; MonitorElement *h_fitres1Chi2; @@ -67,29 +66,20 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, MonitorElement *h_fitres3Chi2; _ibooker.setCurrentFolder(prefixME_ + "/Zmass"); - h_fitres1 = _ibooker.book1D("Gaussian mean WP80 EB-EB", - "Gaussian mean WP80 EB-EB", 1, 0, 1); - h_fitres1bis = _ibooker.book1D("Gaussian sigma WP80 EB-EB", - "Gaussian sigma WP80 EB-EB", 1, 0, 1); - h_fitres1Chi2 = - _ibooker.book1D("Gaussian Chi2 result over NDF WP80 EB-EB", - "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1); - - h_fitres3 = _ibooker.book1D("Gaussian mean WP80 EB-EE", - "Gaussian mean result WP80 EB-EE", 1, 0, 1); - h_fitres3bis = _ibooker.book1D("Gaussian sigma WP80 EB-EE", - "Gaussian sigma WP80 EB-EE", 1, 0, 1); + h_fitres1 = _ibooker.book1D("Gaussian mean WP80 EB-EB", "Gaussian mean WP80 EB-EB", 1, 0, 1); + h_fitres1bis = _ibooker.book1D("Gaussian sigma WP80 EB-EB", "Gaussian sigma WP80 EB-EB", 1, 0, 1); + h_fitres1Chi2 = _ibooker.book1D( + "Gaussian Chi2 result over NDF WP80 EB-EB", "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1); + + h_fitres3 = _ibooker.book1D("Gaussian mean WP80 EB-EE", "Gaussian mean result WP80 EB-EE", 1, 0, 1); + h_fitres3bis = _ibooker.book1D("Gaussian sigma WP80 EB-EE", "Gaussian sigma WP80 EB-EE", 1, 0, 1); h_fitres3Chi2 = - _ibooker.book1D("Gaussian Chi2 result over NDF WP80 EB-EE", - "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1); + _ibooker.book1D("Gaussian Chi2 result over NDF WP80 EB-EE", "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1); - h_fitres2 = _ibooker.book1D("Gaussian mean WP80 EE-EE", - "Gaussian mean WP80 EE-EE", 1, 0, 1); - h_fitres2bis = _ibooker.book1D("Gaussian sigma WP80 EE-EE", - "Gaussian sigma WP80 EE-EE", 1, 0, 1); + h_fitres2 = _ibooker.book1D("Gaussian mean WP80 EE-EE", "Gaussian mean WP80 EE-EE", 1, 0, 1); + h_fitres2bis = _ibooker.book1D("Gaussian sigma WP80 EE-EE", "Gaussian sigma WP80 EE-EE", 1, 0, 1); h_fitres2Chi2 = - _ibooker.book1D("Gaussian Chi2 result over NDF WP80 EE-EE", - "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1); + _ibooker.book1D("Gaussian Chi2 result over NDF WP80 EE-EE", "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1); LogTrace("EwkAnalyzer") << "Parameters initialization"; @@ -122,7 +112,6 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, try { if (N != 0) { - B->Fit("mygauss", "QR"); mean = std::abs(func->GetParameter(1)); sigma = std::abs(func->GetParError(1)); @@ -135,8 +124,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; mean = 40; sigma = 0; @@ -176,7 +164,6 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, try { if (N != 0) { - Bbis->Fit("mygauss", "QR"); rms = std::abs(func->GetParameter(2)); rmsErr = std::abs(func->GetParError(2)); @@ -189,8 +176,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; rms = 40; rmsErr = 0; @@ -243,8 +229,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; mean = 40; sigma = 0; @@ -285,7 +270,6 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, try { if (N != 0) { - Ebis->Fit("mygauss", "QR"); rms = std::abs(func->GetParameter(2)); rmsErr = std::abs(func->GetParError(2)); @@ -298,8 +282,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; rms = 40; rmsErr = 0; @@ -340,7 +323,6 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, try { if (N != 0) { - M->Fit("mygauss", "QR"); mean = std::abs(func->GetParameter(1)); sigma = std::abs(func->GetParError(1)); @@ -352,8 +334,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; mean = 40; sigma = 0; @@ -394,7 +375,6 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, try { if (N != 0) { - Mbis->Fit("mygauss", "QR"); rms = std::abs(func->GetParameter(2)); rmsErr = std::abs(func->GetParError(2)); @@ -407,8 +387,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; rms = 40; rmsErr = 0; @@ -450,7 +429,6 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, try { if (N != 0) { - C1->Fit("mygauss", "QR"); if ((func->GetNDF() != 0)) { Chi2 = std::abs(func->GetChisquare()) / std::abs(func->GetNDF()); @@ -465,8 +443,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; Chi2 = 40; NDF = 0; @@ -521,8 +498,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; Chi2 = 40; NDF = 0; @@ -576,8 +552,7 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, } } catch (cms::Exception &e) { - edm::LogError("ZFitter") - << "[Zfitter]: Exception when fitting..." << e.what(); + edm::LogError("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what(); N = 1; Chi2 = 40; NDF = 0; @@ -595,12 +570,10 @@ void EcalZmassClient::dqmEndJob(DQMStore::IBooker &_ibooker, // Breit-Wigner function Double_t mybw(Double_t *x, Double_t *par) { - Double_t arg1 = 14.0 / 22.0; // 2 over pi - Double_t arg2 = par[1] * par[1] * par[2] * par[2]; // Gamma=par[2] M=par[1] - Double_t arg3 = - ((x[0] * x[0]) - (par[1] * par[1])) * ((x[0] * x[0]) - (par[1] * par[1])); - Double_t arg4 = - x[0] * x[0] * x[0] * x[0] * ((par[2] * par[2]) / (par[1] * par[1])); + Double_t arg1 = 14.0 / 22.0; // 2 over pi + Double_t arg2 = par[1] * par[1] * par[2] * par[2]; // Gamma=par[2] M=par[1] + Double_t arg3 = ((x[0] * x[0]) - (par[1] * par[1])) * ((x[0] * x[0]) - (par[1] * par[1])); + Double_t arg4 = x[0] * x[0] * x[0] * x[0] * ((par[2] * par[2]) / (par[1] * par[1])); return par[0] * arg1 * arg2 / (arg3 + arg4); } @@ -608,11 +581,10 @@ Double_t mybw(Double_t *x, Double_t *par) { Double_t mygauss(Double_t *x, Double_t *par) { Double_t arg = 0; if (par[2] < 0) - par[2] = -par[2]; // par[2]: sigma + par[2] = -par[2]; // par[2]: sigma if (par[2] != 0) - arg = (x[0] - par[1]) / par[2]; // par[1]: mean - return par[0] * TMath::Exp(-0.5 * arg * arg) / - (TMath::Sqrt(2 * TMath::Pi()) * par[2]); // par[0] is constant + arg = (x[0] - par[1]) / par[2]; // par[1]: mean + return par[0] * TMath::Exp(-0.5 * arg * arg) / (TMath::Sqrt(2 * TMath::Pi()) * par[2]); // par[0] is constant } DEFINE_FWK_MODULE(EcalZmassClient); diff --git a/DQMOffline/Ecal/plugins/EcalZmassTask.cc b/DQMOffline/Ecal/plugins/EcalZmassTask.cc index 2e2e664cae610..cbeae20ddc0bf 100644 --- a/DQMOffline/Ecal/plugins/EcalZmassTask.cc +++ b/DQMOffline/Ecal/plugins/EcalZmassTask.cc @@ -42,14 +42,12 @@ Description: [one line class summary] #include "DQMServices/Core/interface/MonitorElement.h" class EcalZmassTask : public DQMEDAnalyzer { - public: explicit EcalZmassTask(const edm::ParameterSet &); ~EcalZmassTask() override {} private: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(const edm::Event &, const edm::EventSetup &) override; const edm::EDGetTokenT electronCollectionToken_; @@ -73,16 +71,14 @@ class EcalZmassTask : public DQMEDAnalyzer { }; EcalZmassTask::EcalZmassTask(const edm::ParameterSet ¶meters) - : electronCollectionToken_(consumes( - parameters.getParameter("electronCollection"))), - trackCollectionToken_(consumes( - parameters.getParameter("trackCollection"))), - prefixME_(parameters.getUntrackedParameter("prefixME", "")) { -} + : electronCollectionToken_( + consumes(parameters.getParameter("electronCollection"))), + trackCollectionToken_( + consumes(parameters.getParameter("trackCollection"))), + prefixME_(parameters.getUntrackedParameter("prefixME", "")) {} // ------------ method called for each event ------------ -void EcalZmassTask::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void EcalZmassTask::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { using namespace edm; Handle electronCollection; iEvent.getByToken(electronCollectionToken_, electronCollection); @@ -106,10 +102,9 @@ void EcalZmassTask::analyze(const edm::Event &iEvent, std::vector LV; - for (reco::GsfElectronCollection::const_iterator recoElectron = - electronCollection->begin(); - recoElectron != electronCollection->end(); recoElectron++) { - + for (reco::GsfElectronCollection::const_iterator recoElectron = electronCollection->begin(); + recoElectron != electronCollection->end(); + recoElectron++) { if (recoElectron->et() <= 25) continue; @@ -130,8 +125,7 @@ void EcalZmassTask::analyze(const edm::Event &iEvent, float Dcot = recoElectron->convDcot(); float Dist = recoElectron->convDist(); int NumberOfExpectedInnerHits = - recoElectron->gsfTrack()->hitPattern().numberOfLostHits( - reco::HitPattern::MISSING_INNER_HITS); + recoElectron->gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS); // quality flags @@ -145,21 +139,18 @@ void EcalZmassTask::analyze(const edm::Event &iEvent, /***** Barrel WP80 Cuts *****/ if (fabs(recoElectron->eta()) <= 1.4442) { - /* Isolation */ if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10) { isIsolatedBarrel = true; } /* Identification */ - if (fabs(DeltaEtaTkClu) < 0.004 && fabs(DeltaPhiTkClu) < 0.06 && - sigmaIeIe < 0.01 && HE < 0.04) { + if (fabs(DeltaEtaTkClu) < 0.004 && fabs(DeltaPhiTkClu) < 0.06 && sigmaIeIe < 0.01 && HE < 0.04) { isIDBarrel = true; } /* Conversion Rejection */ - if ((fabs(Dist) >= 0.02 || fabs(Dcot) >= 0.02) && - NumberOfExpectedInnerHits <= 1.0) { + if ((fabs(Dist) >= 0.02 || fabs(Dcot) >= 0.02) && NumberOfExpectedInnerHits <= 1.0) { isConvertedBarrel = true; } } @@ -167,40 +158,34 @@ void EcalZmassTask::analyze(const edm::Event &iEvent, if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) { elIsAccepted++; elIsAcceptedEB++; - TLorentzVector b_e2(recoElectron->momentum().x(), - recoElectron->momentum().y(), - recoElectron->momentum().z(), recoElectron->p()); + TLorentzVector b_e2( + recoElectron->momentum().x(), recoElectron->momentum().y(), recoElectron->momentum().z(), recoElectron->p()); LV.push_back(b_e2); } /***** Endcap WP80 Cuts *****/ - if (fabs(recoElectron->eta()) >= 1.5660 && - fabs(recoElectron->eta()) <= 2.5000) { - + if (fabs(recoElectron->eta()) >= 1.5660 && fabs(recoElectron->eta()) <= 2.5000) { /* Isolation */ if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025) { isIsolatedEndcap = true; } /* Identification */ - if (fabs(DeltaEtaTkClu) < 0.007 && fabs(DeltaPhiTkClu) < 0.03 && - sigmaIeIe < 0.031 && HE < 0.15) { + if (fabs(DeltaEtaTkClu) < 0.007 && fabs(DeltaPhiTkClu) < 0.03 && sigmaIeIe < 0.031 && HE < 0.15) { isIDEndcap = true; } /* Conversion Rejection */ - if ((fabs(Dcot) > 0.02 || fabs(Dist) > 0.02) && - NumberOfExpectedInnerHits <= 1.0) { + if ((fabs(Dcot) > 0.02 || fabs(Dist) > 0.02) && NumberOfExpectedInnerHits <= 1.0) { isConvertedEndcap = true; } } if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) { elIsAccepted++; elIsAcceptedEE++; - TLorentzVector e_e2(recoElectron->momentum().x(), - recoElectron->momentum().y(), - recoElectron->momentum().z(), recoElectron->p()); + TLorentzVector e_e2( + recoElectron->momentum().x(), recoElectron->momentum().y(), recoElectron->momentum().z(), recoElectron->p()); LV.push_back(e_e2); } } @@ -228,8 +213,7 @@ void EcalZmassTask::analyze(const edm::Event &iEvent, } } -void EcalZmassTask::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, - edm::EventSetup const &) { +void EcalZmassTask::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &) { std::string logTraceName("EcalZmassTask"); h_ee_invMass_EB = nullptr; @@ -238,17 +222,11 @@ void EcalZmassTask::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, LogTrace(logTraceName) << "Parameters initialization"; - iBooker.setCurrentFolder(prefixME_ + "/Zmass"); // Use folder with name of PAG - - h_ee_invMass_EB = - iBooker.book1D("Z peak - WP80 EB-EE", "Z peak - WP80 EB-EE;InvMass (GeV)", - 60, 60.0, 120.0); - h_ee_invMass_EE = - iBooker.book1D("Z peak - WP80 EE-EE", "Z peak - WP80 EE-EE;InvMass (Gev)", - 60, 60.0, 120.0); - h_ee_invMass_BB = - iBooker.book1D("Z peak - WP80 EB-EB", "Z peak - WP80 EB-EB;InvMass (Gev)", - 60, 60.0, 120.0); + iBooker.setCurrentFolder(prefixME_ + "/Zmass"); // Use folder with name of PAG + + h_ee_invMass_EB = iBooker.book1D("Z peak - WP80 EB-EE", "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0); + h_ee_invMass_EE = iBooker.book1D("Z peak - WP80 EE-EE", "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0); + h_ee_invMass_BB = iBooker.book1D("Z peak - WP80 EB-EB", "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0); } // define this as a plug-in diff --git a/DQMOffline/PFTau/interface/Benchmark.h b/DQMOffline/PFTau/interface/Benchmark.h index cef73e8afc16e..10a239829e433 100644 --- a/DQMOffline/PFTau/interface/Benchmark.h +++ b/DQMOffline/PFTau/interface/Benchmark.h @@ -19,7 +19,6 @@ class DQMStore; /// abstract base class class Benchmark { - public: class PhaseSpace { public: @@ -33,15 +32,13 @@ class Benchmark { enum Mode { DEFAULT, DQMOFFLINE, VALIDATION }; Benchmark(Mode mode = DEFAULT) - : dir_(nullptr), mode_(mode), ptMin_(0), ptMax_(10e10), etaMin_(-10), - etaMax_(10), phiMin_(-10), phiMax_(10) {} + : dir_(nullptr), mode_(mode), ptMin_(0), ptMax_(10e10), etaMin_(-10), etaMax_(10), phiMin_(-10), phiMax_(10) {} virtual ~Benchmark() noexcept(false); void setParameters(Mode mode) { mode_ = mode; } - void setRange(float ptMin, float ptMax, float etaMin, float etaMax, - float phiMin, float phiMax) { + void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax) { ptMin_ = ptMin; ptMax_ = ptMax; etaMin_ = etaMin; @@ -51,10 +48,8 @@ class Benchmark { } bool isInRange(float pt, float eta, float phi) const { - return pt > ptMin_ && pt < ptMax_ && eta > etaMin_ && eta < etaMax_ && - phi > phiMin_ && phi < phiMax_ - ? true - : false; + return pt > ptMin_ && pt < ptMax_ && eta > etaMin_ && eta < etaMax_ && phi > phiMin_ && phi < phiMax_ ? true + : false; } virtual void setDirectory(TDirectory *dir); @@ -68,39 +63,61 @@ class Benchmark { /// been initialized in a child analyzer or not. // TH1F* book1D(const char* histname, const char* title, /// book a 1D histogram, either through IBooker or plain root - TH1F *book1D(DQMStore::IBooker &b, const char *histname, const char *title, - int nbins, float xmin, float xmax); + TH1F *book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax); /// book a 2D histogram, either with DQM or plain root depending if DQM_ has /// been initialized in a child analyzer or not. // TH2F* book2D(const char* histname, const char* title, /// book a 2D histogram, either through IBooker or plain root - TH2F *book2D(DQMStore::IBooker &b, const char *histname, const char *title, - int nbinsx, float xmin, float xmax, int nbinsy, float ymin, + TH2F *book2D(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float xmin, + float xmax, + int nbinsy, + float ymin, float ymax); /// book a 2D histogram, either with DQM or plain root depending if DQM_ has /// been initialized in a child analyzer or not. // TH2F* book2D(const char* histname, const char* title, /// book a 2D histogram, either through IBooker or plain root - TH2F *book2D(DQMStore::IBooker &b, const char *histname, const char *title, - int nbinsx, float *xbins, int nbinsy, float ymin, float ymax); + TH2F *book2D(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float *xbins, + int nbinsy, + float ymin, + float ymax); /// book a TProfile histogram, either with DQM or plain root depending if DQM_ /// has been initialized in a child analyzer or not. // TProfile* bookProfile(const char* histname, const char* title, /// book a TProfile, either through IBooker or plain root - TProfile *bookProfile(DQMStore::IBooker &b, const char *histname, - const char *title, int nbinsx, float xmin, float xmax, - float ymin, float ymax, const char *option); + TProfile *bookProfile(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float xmin, + float xmax, + float ymin, + float ymax, + const char *option); /// book a TProfile histogram, either with DQM or plain root depending if DQM_ /// has been initialized in a child analyzer or not. // TProfile* bookProfile(const char* histname, const char* title, /// book a TProfile, either through IBooker or plain root - TProfile *bookProfile(DQMStore::IBooker &b, const char *histname, - const char *title, int nbinsx, float *xbins, float ymin, - float ymax, const char *option); + TProfile *bookProfile(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float *xbins, + float ymin, + float ymax, + const char *option); TDirectory *dir_; diff --git a/DQMOffline/PFTau/interface/CandidateBenchmark.h b/DQMOffline/PFTau/interface/CandidateBenchmark.h index 50543e3f59899..9c77e9152a44b 100644 --- a/DQMOffline/PFTau/interface/CandidateBenchmark.h +++ b/DQMOffline/PFTau/interface/CandidateBenchmark.h @@ -8,7 +8,6 @@ /// To plot Candidate quantities class CandidateBenchmark : public Benchmark { - public: CandidateBenchmark(Mode mode); ~CandidateBenchmark() override; @@ -17,7 +16,8 @@ class CandidateBenchmark : public Benchmark { void setup(DQMStore::IBooker &b); void setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet); - template void fill(const C &candidates); + template + void fill(const C &candidates); /// fill histograms with a given particle void fillOne(const reco::Candidate &candidate); @@ -33,8 +33,8 @@ class CandidateBenchmark : public Benchmark { bool histogramBooked_; }; -template void CandidateBenchmark::fill(const C &candCollection) { - +template +void CandidateBenchmark::fill(const C &candCollection) { for (unsigned int i = 0; i < candCollection.size(); i++) { const reco::Candidate &cand = candCollection[i]; fillOne(cand); diff --git a/DQMOffline/PFTau/interface/METBenchmark.h b/DQMOffline/PFTau/interface/METBenchmark.h index c40aec21d5c83..a5a16c4d8dcc2 100644 --- a/DQMOffline/PFTau/interface/METBenchmark.h +++ b/DQMOffline/PFTau/interface/METBenchmark.h @@ -9,7 +9,6 @@ /// To plot MET quantities class METBenchmark : public Benchmark { - public: METBenchmark(Mode mode) : Benchmark(mode) {} ~METBenchmark() override; @@ -18,7 +17,8 @@ class METBenchmark : public Benchmark { void setup(DQMStore::IBooker &b); /// fill a collection - template void fill(const C &candidates); + template + void fill(const C &candidates); /// fill histograms with a given particle void fillOne(const reco::MET &candidate); @@ -35,8 +35,8 @@ class METBenchmark : public Benchmark { TH2F *mex_VS_sumEt_; }; -template void METBenchmark::fill(const C &candCollection) { - +template +void METBenchmark::fill(const C &candCollection) { for (unsigned int i = 0; i < candCollection.size(); ++i) { const reco::MET &cand = candCollection[i]; fillOne(cand); diff --git a/DQMOffline/PFTau/interface/MatchCandidateBenchmark.h b/DQMOffline/PFTau/interface/MatchCandidateBenchmark.h index f9fdacf35b789..11605045ff1cb 100644 --- a/DQMOffline/PFTau/interface/MatchCandidateBenchmark.h +++ b/DQMOffline/PFTau/interface/MatchCandidateBenchmark.h @@ -11,7 +11,6 @@ /// To plot Candidate quantities class MatchCandidateBenchmark : public Benchmark { - public: MatchCandidateBenchmark(Mode mode); @@ -22,8 +21,7 @@ class MatchCandidateBenchmark : public Benchmark { void setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet); /// fill histograms with a given particle - void fillOne(const reco::Candidate &candidate, - const reco::Candidate &matchedCandidate); + void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate); void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate, diff --git a/DQMOffline/PFTau/interface/MatchMETBenchmark.h b/DQMOffline/PFTau/interface/MatchMETBenchmark.h index 435542018a80a..980173ee55ea4 100644 --- a/DQMOffline/PFTau/interface/MatchMETBenchmark.h +++ b/DQMOffline/PFTau/interface/MatchMETBenchmark.h @@ -11,7 +11,6 @@ // remove the old benchmarks from these 2 packages (Validation and PFRootEvent) // (python files, C++ code, ...) class MatchMETBenchmark : public Benchmark { - public: MatchMETBenchmark(Mode mode) : Benchmark(mode) {} ~MatchMETBenchmark() override; diff --git a/DQMOffline/PFTau/interface/Matchers.h b/DQMOffline/PFTau/interface/Matchers.h index 693b392d5683e..9afcd480bb564 100644 --- a/DQMOffline/PFTau/interface/Matchers.h +++ b/DQMOffline/PFTau/interface/Matchers.h @@ -13,105 +13,97 @@ namespace PFB { -template -void match(const C &candCollection, const M &matchedCandCollection, - std::vector &matchIndices, bool matchCharge = false, - float dRMax = -1) { - - // compute distance to each candidate in the matchedCandCollection. - - float dR2Max = 0; - if (dRMax > 0) - dR2Max = dRMax * dRMax; - - matchIndices.clear(); - matchIndices.resize(candCollection.size(), -1); - - for (unsigned i = 0; i < candCollection.size(); ++i) { - - static const double bigNumber = 1e14; - double dR2min = bigNumber; - int jMin = -1; - for (unsigned jm = 0; jm < matchedCandCollection.size(); ++jm) { - - if (matchCharge && - candCollection[i].charge() != matchedCandCollection[jm].charge()) - continue; + template + void match(const C &candCollection, + const M &matchedCandCollection, + std::vector &matchIndices, + bool matchCharge = false, + float dRMax = -1) { + // compute distance to each candidate in the matchedCandCollection. + + float dR2Max = 0; + if (dRMax > 0) + dR2Max = dRMax * dRMax; + + matchIndices.clear(); + matchIndices.resize(candCollection.size(), -1); + + for (unsigned i = 0; i < candCollection.size(); ++i) { + static const double bigNumber = 1e14; + double dR2min = bigNumber; + int jMin = -1; + for (unsigned jm = 0; jm < matchedCandCollection.size(); ++jm) { + if (matchCharge && candCollection[i].charge() != matchedCandCollection[jm].charge()) + continue; - double dR2 = reco::deltaR2(candCollection[i], matchedCandCollection[jm]); - if (dR2 < dR2min) { - dR2min = dR2; - jMin = jm; + double dR2 = reco::deltaR2(candCollection[i], matchedCandCollection[jm]); + if (dR2 < dR2min) { + dR2min = dR2; + jMin = jm; + } } - } - if ((dR2Max > 0 && dR2min < dR2Max) || dRMax <= 0) { - matchIndices[i] = jMin; - /* std::cout<<"match "< 0 && dR2min < dR2Max) || dRMax <= 0) { + matchIndices[i] = jMin; + /* std::cout<<"match "< -template -void match(const C &candCollection, const M &matchedCandCollection, - std::vector &matchIndices, - const edm::ParameterSet ¶meterSet, - // const MM& muonMatchedCandCollection, - edm::View muonMatchedCandCollection, - bool matchCharge = false, float dRMax = -1) { - - // compute distance to each candidate in the matchedCandCollection. - - float dR2Max = 0; - if (dRMax > 0) - dR2Max = dRMax * dRMax; - - matchIndices.clear(); - matchIndices.resize(candCollection.size(), -1); - - for (unsigned i = 0; i < candCollection.size(); ++i) { - - static const double bigNumber = 1e14; - double dR2min = bigNumber; - int jMin = -1; - for (unsigned jm = 0; jm < matchedCandCollection.size(); ++jm) { - - if (parameterSet.getParameter("slimmedLikeSelection")) { - if (!(muonMatchedCandCollection[jm].pt() > - parameterSet.getParameter("ptBase") || - muonMatchedCandCollection[jm].isPFMuon() || - (muonMatchedCandCollection[jm].pt() > - parameterSet.getParameter("ptNotPF") && - (muonMatchedCandCollection[jm].isGlobalMuon() || - muonMatchedCandCollection[jm].isStandAloneMuon() || - muonMatchedCandCollection[jm].numberOfMatches() > 0 || - muon::isGoodMuon(muonMatchedCandCollection[jm], - muon::RPCMuLoose))))) - continue; - } - if (matchCharge && - candCollection[i].charge() != matchedCandCollection[jm].charge()) - continue; + // needed by muon matching + // template< typename C, typename M, typename MM> + template + void match(const C &candCollection, + const M &matchedCandCollection, + std::vector &matchIndices, + const edm::ParameterSet ¶meterSet, + // const MM& muonMatchedCandCollection, + edm::View muonMatchedCandCollection, + bool matchCharge = false, + float dRMax = -1) { + // compute distance to each candidate in the matchedCandCollection. + + float dR2Max = 0; + if (dRMax > 0) + dR2Max = dRMax * dRMax; + + matchIndices.clear(); + matchIndices.resize(candCollection.size(), -1); + + for (unsigned i = 0; i < candCollection.size(); ++i) { + static const double bigNumber = 1e14; + double dR2min = bigNumber; + int jMin = -1; + for (unsigned jm = 0; jm < matchedCandCollection.size(); ++jm) { + if (parameterSet.getParameter("slimmedLikeSelection")) { + if (!(muonMatchedCandCollection[jm].pt() > parameterSet.getParameter("ptBase") || + muonMatchedCandCollection[jm].isPFMuon() || + (muonMatchedCandCollection[jm].pt() > parameterSet.getParameter("ptNotPF") && + (muonMatchedCandCollection[jm].isGlobalMuon() || muonMatchedCandCollection[jm].isStandAloneMuon() || + muonMatchedCandCollection[jm].numberOfMatches() > 0 || + muon::isGoodMuon(muonMatchedCandCollection[jm], muon::RPCMuLoose))))) + continue; + } + + if (matchCharge && candCollection[i].charge() != matchedCandCollection[jm].charge()) + continue; - double dR2 = reco::deltaR2(candCollection[i], matchedCandCollection[jm]); - if (dR2 < dR2min) { - dR2min = dR2; - jMin = jm; + double dR2 = reco::deltaR2(candCollection[i], matchedCandCollection[jm]); + if (dR2 < dR2min) { + dR2min = dR2; + jMin = jm; + } } - } - if ((dR2Max > 0 && dR2min < dR2Max) || dRMax <= 0) { - matchIndices[i] = jMin; - /* std::cout<<"match "< 0 && dR2min < dR2Max) || dRMax <= 0) { + matchIndices[i] = jMin; + /* std::cout<<"match "< - void fill(const reco::PFCandidateCollection &candCollection, - const C &matchedCandCollection); + void fill(const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection); protected: CandidateBenchmark candBench_; @@ -60,12 +60,9 @@ class PFCandidateManager : public Benchmark { #include "DQMOffline/PFTau/interface/Matchers.h" template -void PFCandidateManager::fill(const reco::PFCandidateCollection &candCollection, - const C &matchCandCollection) { - +void PFCandidateManager::fill(const reco::PFCandidateCollection &candCollection, const C &matchCandCollection) { std::vector matchIndices; - PFB::match(candCollection, matchCandCollection, matchIndices, matchCharge_, - dRMax_); + PFB::match(candCollection, matchCandCollection, matchIndices, matchCharge_, dRMax_); for (unsigned int i = 0; i < candCollection.size(); i++) { const reco::PFCandidate &cand = candCollection[i]; diff --git a/DQMOffline/PFTau/interface/PFCandidateMonitor.h b/DQMOffline/PFTau/interface/PFCandidateMonitor.h index 29bee128bbc62..386c3eb585520 100644 --- a/DQMOffline/PFTau/interface/PFCandidateMonitor.h +++ b/DQMOffline/PFTau/interface/PFCandidateMonitor.h @@ -11,20 +11,25 @@ #include -#include //needed by the deltaR->Fill() call +#include //needed by the deltaR->Fill() call class PFCandidateMonitor : public Benchmark { - public: - PFCandidateMonitor(float dRMax = 0.3, bool matchCharge = true, - Benchmark::Mode mode = Benchmark::DEFAULT); + PFCandidateMonitor(float dRMax = 0.3, bool matchCharge = true, Benchmark::Mode mode = Benchmark::DEFAULT); ~PFCandidateMonitor() override; /// set the parameters locally - void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, - float ptmin, float ptmax, float etamin, float etamax, - float phimin, float phimax, bool refHistoFlag); + void setParameters(float dRMax, + bool matchCharge, + Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, + bool refHistoFlag); /// set the parameters accessing them from ParameterSet void setParameters(const edm::ParameterSet ¶meterSet); @@ -40,12 +45,17 @@ class PFCandidateMonitor : public Benchmark { template /*void fill(const T& candidateCollection, const C& matchedCandCollection, float& minVal, float& maxVal) ;*/ - void fill(const T &candidateCollection, const C &matchedCandCollection, - float &minVal, float &maxVal, + void fill(const T &candidateCollection, + const C &matchedCandCollection, + float &minVal, + float &maxVal, const edm::ParameterSet ¶meterSet); template - void fill(const T &candidateCollection, const C &matchedCandCollection, - float &minVal, float &maxVal, const edm::ParameterSet ¶meterSet, + void fill(const T &candidateCollection, + const C &matchedCandCollection, + float &minVal, + float &maxVal, + const edm::ParameterSet ¶meterSet, const M &muonMatchedCandCollection); void fillOne(const reco::Candidate &cand); @@ -75,30 +85,26 @@ class PFCandidateMonitor : public Benchmark { #include "DQMOffline/PFTau/interface/Matchers.h" template void PFCandidateMonitor::fill(const T &candCollection, - const C &matchedCandCollection, float &minVal, + const C &matchedCandCollection, + float &minVal, float &maxVal, const edm::ParameterSet ¶meterSet) { - matching_done_ = false; if (createEfficiencyHistos_) { for (unsigned i = 0; i < candCollection.size(); ++i) { - if (!isInRange(candCollection[i].pt(), candCollection[i].eta(), - candCollection[i].phi())) + if (!isInRange(candCollection[i].pt(), candCollection[i].eta(), candCollection[i].phi())) continue; - fillOne(candCollection[i]); // fill pt_gen, eta_gen and phi_gen histos for - // UNMATCHED generated candidate + fillOne(candCollection[i]); // fill pt_gen, eta_gen and phi_gen histos for + // UNMATCHED generated candidate - for (unsigned j = 0; j < matchedCandCollection.size(); - ++j) // for DeltaR spectrum + for (unsigned j = 0; j < matchedCandCollection.size(); ++j) // for DeltaR spectrum if (deltaR_) - deltaR_->Fill( - reco::deltaR(candCollection[i], matchedCandCollection[j])); + deltaR_->Fill(reco::deltaR(candCollection[i], matchedCandCollection[j])); } } std::vector matchIndices; - PFB::match(candCollection, matchedCandCollection, matchIndices, matchCharge_, - dRMax_); + PFB::match(candCollection, matchedCandCollection, matchIndices, matchCharge_, dRMax_); // PFB::match( candCollection, matchedCandCollection, matchIndices, // parameterSet, matchCharge_, dRMax_ ); // now matchIndices[i] stores the j-th closest matched jet @@ -129,27 +135,24 @@ void PFCandidateMonitor::fill(const T &candCollection, minVal = ptRes; if (!createEfficiencyHistos_) { - candBench_.fillOne( - cand); // fill pt, eta phi and charge histos for MATCHED candidate + candBench_.fillOne(cand); // fill pt, eta phi and charge histos for MATCHED candidate // matchCandBench_.fillOne(cand, matchedCand); // fill delta_x_VS_y // histos for matched couple - matchCandBench_.fillOne( - cand, matchedCand, - parameterSet); // fill delta_x_VS_y histos for matched couple + matchCandBench_.fillOne(cand, matchedCand, + parameterSet); // fill delta_x_VS_y histos for matched couple if (createReferenceHistos_) - fillOne(matchedCand); // fill pt_ref, eta_ref and phi_ref histos for - // MATCHED reference candidate + fillOne(matchedCand); // fill pt_ref, eta_ref and phi_ref histos for + // MATCHED reference candidate } else { - candBench_.fillOne(matchedCand); // fill pt, eta phi and charge histos - // for MATCHED candidate + candBench_.fillOne(matchedCand); // fill pt, eta phi and charge histos + // for MATCHED candidate // matchCandBench_.fillOne(matchedCand, cand); // fill delta_x_VS_y // histos for matched couple - matchCandBench_.fillOne( - cand, matchedCand, - parameterSet); // fill delta_x_VS_y histos for matched couple + matchCandBench_.fillOne(cand, matchedCand, + parameterSet); // fill delta_x_VS_y histos for matched couple if (createReferenceHistos_) - fillOne(cand); // fill pt_ref, eta_ref and phi_ref histos for MATCHED - // reference candidate + fillOne(cand); // fill pt_ref, eta_ref and phi_ref histos for MATCHED + // reference candidate } } } @@ -159,25 +162,22 @@ template /*void PFCandidateMonitor::fill(const T& candCollection, const C& matchedCandCollection, float& minVal, float& maxVal) {*/ void PFCandidateMonitor::fill(const T &candCollection, - const C &matchedCandCollection, float &minVal, + const C &matchedCandCollection, + float &minVal, float &maxVal, const edm::ParameterSet ¶meterSet, const M &muonMatchedCandCollection) { - matching_done_ = false; if (createEfficiencyHistos_) { for (unsigned i = 0; i < candCollection.size(); ++i) { - if (!isInRange(candCollection[i].pt(), candCollection[i].eta(), - candCollection[i].phi())) + if (!isInRange(candCollection[i].pt(), candCollection[i].eta(), candCollection[i].phi())) continue; - fillOne(candCollection[i]); // fill pt_gen, eta_gen and phi_gen histos for - // UNMATCHED generated candidate + fillOne(candCollection[i]); // fill pt_gen, eta_gen and phi_gen histos for + // UNMATCHED generated candidate - for (unsigned j = 0; j < matchedCandCollection.size(); - ++j) // for DeltaR spectrum + for (unsigned j = 0; j < matchedCandCollection.size(); ++j) // for DeltaR spectrum if (deltaR_) - deltaR_->Fill( - reco::deltaR(candCollection[i], matchedCandCollection[j])); + deltaR_->Fill(reco::deltaR(candCollection[i], matchedCandCollection[j])); } } @@ -185,8 +185,13 @@ void PFCandidateMonitor::fill(const T &candCollection, // PFB::match( candCollection, matchedCandCollection, matchIndices, // matchCharge_, dRMax_ ); PFB::match( candCollection, matchedCandCollection, // matchIndices, parameterSet, matchCharge_, dRMax_ ); - PFB::match(candCollection, matchedCandCollection, matchIndices, parameterSet, - muonMatchedCandCollection, matchCharge_, dRMax_); + PFB::match(candCollection, + matchedCandCollection, + matchIndices, + parameterSet, + muonMatchedCandCollection, + matchCharge_, + dRMax_); // now matchIndices[i] stores the j-th closest matched jet matching_done_ = true; @@ -215,23 +220,20 @@ void PFCandidateMonitor::fill(const T &candCollection, minVal = ptRes; if (!createEfficiencyHistos_) { - candBench_.fillOne( - cand); // fill pt, eta phi and charge histos for MATCHED candidate - matchCandBench_.fillOne( - cand, matchedCand, - parameterSet); // fill delta_x_VS_y histos for matched couple + candBench_.fillOne(cand); // fill pt, eta phi and charge histos for MATCHED candidate + matchCandBench_.fillOne(cand, matchedCand, + parameterSet); // fill delta_x_VS_y histos for matched couple if (createReferenceHistos_) - fillOne(matchedCand); // fill pt_ref, eta_ref and phi_ref histos for - // MATCHED reference candidate + fillOne(matchedCand); // fill pt_ref, eta_ref and phi_ref histos for + // MATCHED reference candidate } else { - candBench_.fillOne(matchedCand); // fill pt, eta phi and charge histos - // for MATCHED candidate - matchCandBench_.fillOne( - cand, matchedCand, - parameterSet); // fill delta_x_VS_y histos for matched couple + candBench_.fillOne(matchedCand); // fill pt, eta phi and charge histos + // for MATCHED candidate + matchCandBench_.fillOne(cand, matchedCand, + parameterSet); // fill delta_x_VS_y histos for matched couple if (createReferenceHistos_) - fillOne(cand); // fill pt_ref, eta_ref and phi_ref histos for MATCHED - // reference candidate + fillOne(cand); // fill pt_ref, eta_ref and phi_ref histos for MATCHED + // reference candidate } } } diff --git a/DQMOffline/PFTau/interface/PFJetMonitor.h b/DQMOffline/PFTau/interface/PFJetMonitor.h index 347a472ba5623..24cc159001c7c 100644 --- a/DQMOffline/PFTau/interface/PFJetMonitor.h +++ b/DQMOffline/PFTau/interface/PFJetMonitor.h @@ -10,24 +10,36 @@ #include -#include //needed by the deltaR->Fill() call +#include //needed by the deltaR->Fill() call class PFJetMonitor : public Benchmark { - public: - PFJetMonitor(float dRMax = 0.3, bool matchCharge = true, - Benchmark::Mode mode = Benchmark::DEFAULT); + PFJetMonitor(float dRMax = 0.3, bool matchCharge = true, Benchmark::Mode mode = Benchmark::DEFAULT); ~PFJetMonitor() override; /// set the parameters locally - void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, - float ptmin, float ptmax, float etamin, float etamax, - float phimin, float phimax, bool fracHistoFlag = true); + void setParameters(float dRMax, + bool matchCharge, + Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, + bool fracHistoFlag = true); - void setParameters(float dRMax, bool onlyTwoJets, bool matchCharge, - Benchmark::Mode mode, float ptmin, float ptmax, - float etamin, float etamax, float phimin, float phimax, + void setParameters(float dRMax, + bool onlyTwoJets, + bool matchCharge, + Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, bool fracHistoFlag = true); /// set the parameters accessing them from ParameterSet @@ -42,12 +54,14 @@ class PFJetMonitor : public Benchmark { /// fill histograms with all particle template - void fill(const T &jetCollection, const C &matchedJetCollection, - float &minVal, float &maxVal); + void fill(const T &jetCollection, const C &matchedJetCollection, float &minVal, float &maxVal); template - void fill(const T &candidateCollection, const C &matchedCandCollection, - float &minVal, float &maxVal, float &jetpT, + void fill(const T &candidateCollection, + const C &matchedCandCollection, + float &minVal, + float &maxVal, + float &jetpT, const edm::ParameterSet ¶meterSet); void fillOne(const reco::Jet &jet, const reco::Jet &matchedJet); @@ -72,12 +86,9 @@ class PFJetMonitor : public Benchmark { #include "DQMOffline/PFTau/interface/Matchers.h" template -void PFJetMonitor::fill(const T &jetCollection, const C &matchedJetCollection, - float &minVal, float &maxVal) { - +void PFJetMonitor::fill(const T &jetCollection, const C &matchedJetCollection, float &minVal, float &maxVal) { std::vector matchIndices; - PFB::match(jetCollection, matchedJetCollection, matchIndices, matchCharge_, - dRMax_); + PFB::match(jetCollection, matchedJetCollection, matchIndices, matchCharge_, dRMax_); for (unsigned int i = 0; i < (jetCollection).size(); i++) { const reco::Jet &jet = jetCollection[i]; @@ -108,13 +119,14 @@ void PFJetMonitor::fill(const T &jetCollection, const C &matchedJetCollection, } template -void PFJetMonitor::fill(const T &jetCollection, const C &matchedJetCollection, - float &minVal, float &maxVal, float &jetpT, +void PFJetMonitor::fill(const T &jetCollection, + const C &matchedJetCollection, + float &minVal, + float &maxVal, + float &jetpT, const edm::ParameterSet ¶meterSet) { - std::vector matchIndices; - PFB::match(jetCollection, matchedJetCollection, matchIndices, matchCharge_, - dRMax_); + PFB::match(jetCollection, matchedJetCollection, matchIndices, matchCharge_, dRMax_); // now matchIndices[i] stores the j-th closest matched jet for (unsigned i = 0; i < jetCollection.size(); ++i) { @@ -148,22 +160,19 @@ void PFJetMonitor::fill(const T &jetCollection, const C &matchedJetCollection, if (ptRes < minVal) minVal = ptRes; - candBench_.fillOne( - jet); // fill pt eta phi and charge histos for MATCHED candidate jet - matchCandBench_.fillOne( - jet, matchedJetCollection[iMatch], - parameterSet); // fill delta_x_VS_y histos for matched couple + candBench_.fillOne(jet); // fill pt eta phi and charge histos for MATCHED candidate jet + matchCandBench_.fillOne(jet, + matchedJetCollection[iMatch], + parameterSet); // fill delta_x_VS_y histos for matched couple if (createPFractionHistos_ && histogramBooked_) - fillOne( - jet, - matchedJetCollection[iMatch]); // book and fill delta_frac_VS_frac - // histos for matched couple + fillOne(jet, + matchedJetCollection[iMatch]); // book and fill delta_frac_VS_frac + // histos for matched couple } - for (unsigned j = 0; j < matchedJetCollection.size(); - ++j) // for DeltaR spectrum + for (unsigned j = 0; j < matchedJetCollection.size(); ++j) // for DeltaR spectrum if (deltaR_) deltaR_->Fill(reco::deltaR(jetCollection[i], matchedJetCollection[j])); - } // end loop on jetCollection + } // end loop on jetCollection } #endif diff --git a/DQMOffline/PFTau/interface/PFMETMonitor.h b/DQMOffline/PFTau/interface/PFMETMonitor.h index 7aa522738c26f..16c06818dc2df 100644 --- a/DQMOffline/PFTau/interface/PFMETMonitor.h +++ b/DQMOffline/PFTau/interface/PFMETMonitor.h @@ -9,15 +9,19 @@ #include class PFMETMonitor : public Benchmark { - public: PFMETMonitor(Benchmark::Mode mode = Benchmark::DEFAULT); ~PFMETMonitor() override; /// set the parameters locally - void setParameters(Benchmark::Mode mode, float ptmin, float ptmax, - float etamin, float etamax, float phimin, float phimax, + void setParameters(Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, bool metSpHistos); /// set the parameters accessing them from ParameterSet @@ -30,11 +34,13 @@ class PFMETMonitor : public Benchmark { void setup(DQMStore::IBooker &b); void setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet); - void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, - float &maxVal); + void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal); - void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, - float &maxVal, const edm::ParameterSet ¶meterSet); + void fillOne(const reco::MET &met, + const reco::MET &matchedMet, + float &minVal, + float &maxVal, + const edm::ParameterSet ¶meterSet); protected: TH1F *px_; diff --git a/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.cc b/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.cc index 6174fc24bf4ab..baf39b851db0b 100644 --- a/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.cc @@ -13,7 +13,6 @@ using namespace std; BenchmarkAnalyzer::BenchmarkAnalyzer(const edm::ParameterSet ¶meterSet) { - inputLabel_ = parameterSet.getParameter("InputCollection"); benchmarkLabel_ = parameterSet.getParameter("BenchmarkLabel"); diff --git a/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.h b/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.h index a9dab76ed2f6f..2449932eb0828 100644 --- a/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.h +++ b/DQMOffline/PFTau/plugins/BenchmarkAnalyzer.h @@ -20,8 +20,7 @@ class BenchmarkAnalyzer : public DQMEDAnalyzer { /// Destructor ~BenchmarkAnalyzer() override {} - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; protected: /// name of the output root file diff --git a/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.cc b/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.cc index ec7ab1ff56730..b1690c0404b45 100644 --- a/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.cc @@ -14,12 +14,8 @@ using namespace reco; using namespace edm; using namespace std; -CandidateBenchmarkAnalyzer::CandidateBenchmarkAnalyzer( - const edm::ParameterSet ¶meterSet) - : BenchmarkAnalyzer(parameterSet), - CandidateBenchmark( - (Benchmark::Mode)parameterSet.getParameter("mode")) { - +CandidateBenchmarkAnalyzer::CandidateBenchmarkAnalyzer(const edm::ParameterSet ¶meterSet) + : BenchmarkAnalyzer(parameterSet), CandidateBenchmark((Benchmark::Mode)parameterSet.getParameter("mode")) { setRange(parameterSet.getParameter("ptMin"), parameterSet.getParameter("ptMax"), parameterSet.getParameter("etaMin"), @@ -37,9 +33,7 @@ void CandidateBenchmarkAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, setup(ibooker); } -void CandidateBenchmarkAnalyzer::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { - +void CandidateBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { Handle> collection; iEvent.getByToken(myColl_, collection); diff --git a/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.h b/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.h index e4adab106a253..45f5dc2b517fc 100644 --- a/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.h +++ b/DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.h @@ -8,15 +8,13 @@ class TH1F; -class CandidateBenchmarkAnalyzer : public BenchmarkAnalyzer, - public CandidateBenchmark { +class CandidateBenchmarkAnalyzer : public BenchmarkAnalyzer, public CandidateBenchmark { public: CandidateBenchmarkAnalyzer(const edm::ParameterSet ¶meterSet); void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; edm::EDGetTokenT> myColl_; }; diff --git a/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.cc b/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.cc index 4d21d1511540f..73fcd2b8ba943 100644 --- a/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.cc @@ -14,14 +14,12 @@ using namespace reco; using namespace edm; using namespace std; -METBenchmarkAnalyzer::METBenchmarkAnalyzer( - const edm::ParameterSet ¶meterSet) - : BenchmarkAnalyzer(parameterSet), - METBenchmark((Benchmark::Mode)parameterSet.getParameter("mode")) { - +METBenchmarkAnalyzer::METBenchmarkAnalyzer(const edm::ParameterSet ¶meterSet) + : BenchmarkAnalyzer(parameterSet), METBenchmark((Benchmark::Mode)parameterSet.getParameter("mode")) { setRange(parameterSet.getParameter("ptMin"), - parameterSet.getParameter("ptMax"), -0.1, - 0.1, // range in eta for MET. + parameterSet.getParameter("ptMax"), + -0.1, + 0.1, // range in eta for MET. parameterSet.getParameter("phiMin"), parameterSet.getParameter("phiMax")); @@ -35,9 +33,7 @@ void METBenchmarkAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, setup(ibooker); } -void METBenchmarkAnalyzer::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { - +void METBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { Handle> collection; iEvent.getByToken(myColl_, collection); diff --git a/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.h b/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.h index e0d913ae32ba2..2060d2c92e2b9 100644 --- a/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.h +++ b/DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.h @@ -14,8 +14,7 @@ class METBenchmarkAnalyzer : public BenchmarkAnalyzer, public METBenchmark { void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; edm::EDGetTokenT> myColl_; }; diff --git a/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.cc b/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.cc index 1227b8a973a09..49d05ef980ea9 100644 --- a/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.cc @@ -12,13 +12,9 @@ using namespace reco; using namespace edm; using namespace std; -MatchMETBenchmarkAnalyzer::MatchMETBenchmarkAnalyzer( - const edm::ParameterSet ¶meterSet) - : BenchmarkAnalyzer(parameterSet), - MatchMETBenchmark( - (Benchmark::Mode)parameterSet.getParameter("mode")) { - matchedInputLabel_ = - parameterSet.getParameter("MatchCollection"); +MatchMETBenchmarkAnalyzer::MatchMETBenchmarkAnalyzer(const edm::ParameterSet ¶meterSet) + : BenchmarkAnalyzer(parameterSet), MatchMETBenchmark((Benchmark::Mode)parameterSet.getParameter("mode")) { + matchedInputLabel_ = parameterSet.getParameter("MatchCollection"); myColl_ = consumes>(inputLabel_); myMatchColl_ = consumes>(matchedInputLabel_); @@ -31,9 +27,7 @@ void MatchMETBenchmarkAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, setup(ibooker); } -void MatchMETBenchmarkAnalyzer::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { - +void MatchMETBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { Handle> collection; iEvent.getByToken(myColl_, collection); diff --git a/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.h b/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.h index 05ebd1e56127e..4ca20be1297f0 100644 --- a/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.h +++ b/DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.h @@ -8,14 +8,12 @@ class TH1F; -class MatchMETBenchmarkAnalyzer : public BenchmarkAnalyzer, - public MatchMETBenchmark { +class MatchMETBenchmarkAnalyzer : public BenchmarkAnalyzer, public MatchMETBenchmark { public: MatchMETBenchmarkAnalyzer(const edm::ParameterSet ¶meterSet); void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; protected: edm::EDGetTokenT> myColl_; diff --git a/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.cc b/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.cc index ed597e98866b0..23a565f20b437 100644 --- a/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.cc @@ -15,11 +15,8 @@ using namespace reco; using namespace edm; using namespace std; -PFCandidateBenchmarkAnalyzer::PFCandidateBenchmarkAnalyzer( - const edm::ParameterSet ¶meterSet) - : BenchmarkAnalyzer(parameterSet), - PFCandidateBenchmark( - (Benchmark::Mode)parameterSet.getParameter("mode")) { +PFCandidateBenchmarkAnalyzer::PFCandidateBenchmarkAnalyzer(const edm::ParameterSet ¶meterSet) + : BenchmarkAnalyzer(parameterSet), PFCandidateBenchmark((Benchmark::Mode)parameterSet.getParameter("mode")) { setRange(parameterSet.getParameter("ptMin"), parameterSet.getParameter("ptMax"), parameterSet.getParameter("etaMin"), @@ -30,16 +27,14 @@ PFCandidateBenchmarkAnalyzer::PFCandidateBenchmarkAnalyzer( myColl_ = consumes(inputLabel_); } -void PFCandidateBenchmarkAnalyzer::bookHistograms( - DQMStore::IBooker &ibooker, edm::Run const &iRun, - edm::EventSetup const &iSetup) { +void PFCandidateBenchmarkAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, + edm::Run const &iRun, + edm::EventSetup const &iSetup) { BenchmarkAnalyzer::bookHistograms(ibooker, iRun, iSetup); setup(ibooker); } -void PFCandidateBenchmarkAnalyzer::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { - +void PFCandidateBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { Handle collection; iEvent.getByToken(myColl_, collection); diff --git a/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.h b/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.h index 30d32079ce4e8..0c27a16606ac4 100644 --- a/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.h +++ b/DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.h @@ -8,15 +8,13 @@ class TH1F; -class PFCandidateBenchmarkAnalyzer : public BenchmarkAnalyzer, - public PFCandidateBenchmark { +class PFCandidateBenchmarkAnalyzer : public BenchmarkAnalyzer, public PFCandidateBenchmark { public: PFCandidateBenchmarkAnalyzer(const edm::ParameterSet ¶meterSet); void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; edm::EDGetTokenT myColl_; }; diff --git a/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.cc b/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.cc index c227d3ec1ae47..f6349720f1426 100644 --- a/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.cc @@ -17,8 +17,7 @@ // // -- Constructor // -PFCandidateDQMAnalyzer::PFCandidateDQMAnalyzer( - const edm::ParameterSet ¶meterSet) +PFCandidateDQMAnalyzer::PFCandidateDQMAnalyzer(const edm::ParameterSet ¶meterSet) { pSet_ = parameterSet; @@ -43,14 +42,13 @@ PFCandidateDQMAnalyzer::PFCandidateDQMAnalyzer( // // -- BookHistograms // -void PFCandidateDQMAnalyzer::bookHistograms( - DQMStore::IBooker &ibooker, edm::Run const & /* iRun */, - edm::EventSetup const & /* iSetup */) { +void PFCandidateDQMAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, + edm::Run const & /* iRun */, + edm::EventSetup const & /* iSetup */) { ibooker.setCurrentFolder(eventInfoFolder_); - edm::LogInfo("PFCandidateDQMAnalyzer") - << " PFCandidateDQMAnalyzer::bookHistograms " - << "Histogram Folder path set to " << eventInfoFolder_; + edm::LogInfo("PFCandidateDQMAnalyzer") << " PFCandidateDQMAnalyzer::bookHistograms " + << "Histogram Folder path set to " << eventInfoFolder_; pfCandidateMonitor_.setup(ibooker, pSet_); } @@ -58,9 +56,7 @@ void PFCandidateDQMAnalyzer::bookHistograms( // // -- Analyze // -void PFCandidateDQMAnalyzer::analyze(edm::Event const &iEvent, - edm::EventSetup const &iSetup) { - +void PFCandidateDQMAnalyzer::analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) { edm::Handle> candCollection; edm::Handle> matchedCandCollection; if (!createEfficiencyHistos_) { @@ -74,8 +70,7 @@ void PFCandidateDQMAnalyzer::analyze(edm::Event const &iEvent, float maxRes = 0.0; float minRes = 99.99; if (candCollection.isValid() && matchedCandCollection.isValid()) { - pfCandidateMonitor_.fill(*candCollection, *matchedCandCollection, minRes, - maxRes, pSet_); + pfCandidateMonitor_.fill(*candCollection, *matchedCandCollection, minRes, maxRes, pSet_); } } diff --git a/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.h b/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.h index 6b5c8127859da..ff0a59e393349 100644 --- a/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.h +++ b/DQMOffline/PFTau/plugins/PFCandidateDQMAnalyzer.h @@ -19,8 +19,7 @@ class PFCandidateDQMAnalyzer : public DQMEDAnalyzer { private: void analyze(edm::Event const &, edm::EventSetup const &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; MonitorElement *eventId_; diff --git a/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.cc b/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.cc index 4765d516767de..89f2d6f9064c2 100644 --- a/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.cc @@ -15,13 +15,11 @@ using namespace reco; using namespace edm; using namespace std; -PFCandidateManagerAnalyzer::PFCandidateManagerAnalyzer( - const edm::ParameterSet ¶meterSet) +PFCandidateManagerAnalyzer::PFCandidateManagerAnalyzer(const edm::ParameterSet ¶meterSet) : BenchmarkAnalyzer(parameterSet), - PFCandidateManager( - parameterSet.getParameter("dRMax"), - parameterSet.getParameter("matchCharge"), - (Benchmark::Mode)parameterSet.getParameter("mode")), + PFCandidateManager(parameterSet.getParameter("dRMax"), + parameterSet.getParameter("matchCharge"), + (Benchmark::Mode)parameterSet.getParameter("mode")), matchLabel_(parameterSet.getParameter("MatchCollection")) { setRange(parameterSet.getParameter("ptMin"), parameterSet.getParameter("ptMax"), @@ -41,9 +39,7 @@ void PFCandidateManagerAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, setup(ibooker); } -void PFCandidateManagerAnalyzer::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { - +void PFCandidateManagerAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { Handle collection; iEvent.getByToken(myColl_, collection); diff --git a/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.h b/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.h index 47128f8be150d..f20b7b6af2b00 100644 --- a/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.h +++ b/DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.h @@ -8,15 +8,13 @@ class TH1F; -class PFCandidateManagerAnalyzer : public BenchmarkAnalyzer, - public PFCandidateManager { +class PFCandidateManagerAnalyzer : public BenchmarkAnalyzer, public PFCandidateManager { public: PFCandidateManagerAnalyzer(const edm::ParameterSet ¶meterSet); void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: edm::EDGetTokenT myColl_; diff --git a/DQMOffline/PFTau/plugins/PFClient.cc b/DQMOffline/PFTau/plugins/PFClient.cc index a07c385c790e1..ccf5399dbdc75 100644 --- a/DQMOffline/PFTau/plugins/PFClient.cc +++ b/DQMOffline/PFTau/plugins/PFClient.cc @@ -13,26 +13,19 @@ // -- Constructor // PFClient::PFClient(const edm::ParameterSet ¶meterSet) { - folderNames_ = - parameterSet.getParameter>("FolderNames"); - histogramNames_ = - parameterSet.getParameter>("HistogramNames"); + folderNames_ = parameterSet.getParameter>("FolderNames"); + histogramNames_ = parameterSet.getParameter>("HistogramNames"); efficiencyFlag_ = parameterSet.getParameter("CreateEfficiencyPlots"); - effHistogramNames_ = parameterSet.getParameter>( - "HistogramNamesForEfficiencyPlots"); - projectionHistogramNames_ = - parameterSet.getParameter>( - "HistogramNamesForProjectionPlots"); + effHistogramNames_ = parameterSet.getParameter>("HistogramNamesForEfficiencyPlots"); + projectionHistogramNames_ = parameterSet.getParameter>("HistogramNamesForProjectionPlots"); profileFlag_ = parameterSet.getParameter("CreateProfilePlots"); - profileHistogramNames_ = parameterSet.getParameter>( - "HistogramNamesForProfilePlots"); + profileHistogramNames_ = parameterSet.getParameter>("HistogramNamesForProfilePlots"); } // // -- EndJobBegin Run // -void PFClient::dqmEndJob(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { +void PFClient::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { doSummaries(ibooker, igetter); doProjection(ibooker, igetter); if (efficiencyFlag_) @@ -44,16 +37,13 @@ void PFClient::dqmEndJob(DQMStore::IBooker &ibooker, // // -- Create Summaries // -void PFClient::doSummaries(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { - - for (std::vector::const_iterator ifolder = folderNames_.begin(); - ifolder != folderNames_.end(); ifolder++) { +void PFClient::doSummaries(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { + for (std::vector::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end(); + ifolder++) { std::string path = "ParticleFlow/" + (*ifolder); - for (std::vector::const_iterator ihist = - histogramNames_.begin(); - ihist != histogramNames_.end(); ihist++) { + for (std::vector::const_iterator ihist = histogramNames_.begin(); ihist != histogramNames_.end(); + ihist++) { std::string hname = (*ihist); createResolutionPlots(ibooker, igetter, path, hname); } @@ -63,16 +53,14 @@ void PFClient::doSummaries(DQMStore::IBooker &ibooker, // // -- Create Projection // -void PFClient::doProjection(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { - - for (std::vector::const_iterator ifolder = folderNames_.begin(); - ifolder != folderNames_.end(); ifolder++) { +void PFClient::doProjection(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { + for (std::vector::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end(); + ifolder++) { std::string path = "ParticleFlow/" + (*ifolder); - for (std::vector::const_iterator ihist = - projectionHistogramNames_.begin(); - ihist != projectionHistogramNames_.end(); ihist++) { + for (std::vector::const_iterator ihist = projectionHistogramNames_.begin(); + ihist != projectionHistogramNames_.end(); + ihist++) { std::string hname = (*ihist); createProjectionPlots(ibooker, igetter, path, hname); } @@ -82,16 +70,14 @@ void PFClient::doProjection(DQMStore::IBooker &ibooker, // // -- Create Profile // -void PFClient::doProfiles(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { - - for (std::vector::const_iterator ifolder = folderNames_.begin(); - ifolder != folderNames_.end(); ifolder++) { +void PFClient::doProfiles(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { + for (std::vector::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end(); + ifolder++) { std::string path = "ParticleFlow/" + (*ifolder); - for (std::vector::const_iterator ihist = - profileHistogramNames_.begin(); - ihist != profileHistogramNames_.end(); ihist++) { + for (std::vector::const_iterator ihist = profileHistogramNames_.begin(); + ihist != profileHistogramNames_.end(); + ihist++) { std::string hname = (*ihist); createProfilePlots(ibooker, igetter, path, hname); } @@ -101,15 +87,13 @@ void PFClient::doProfiles(DQMStore::IBooker &ibooker, // // -- Create Efficiency // -void PFClient::doEfficiency(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { - for (std::vector::const_iterator ifolder = folderNames_.begin(); - ifolder != folderNames_.end(); ifolder++) { +void PFClient::doEfficiency(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { + for (std::vector::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end(); + ifolder++) { std::string path = "ParticleFlow/" + (*ifolder); - for (std::vector::const_iterator ihist = - effHistogramNames_.begin(); - ihist != effHistogramNames_.end(); ihist++) { + for (std::vector::const_iterator ihist = effHistogramNames_.begin(); ihist != effHistogramNames_.end(); + ihist++) { std::string hname = (*ihist); createEfficiencyPlots(ibooker, igetter, path, hname); } @@ -121,7 +105,8 @@ void PFClient::doEfficiency(DQMStore::IBooker &ibooker, // void PFClient::createResolutionPlots(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - std::string &folder, std::string &name) { + std::string &folder, + std::string &name) { MonitorElement *me = igetter.get(folder + "/" + name); if (!me) @@ -132,8 +117,7 @@ void PFClient::createResolutionPlots(DQMStore::IBooker &ibooker, MonitorElement *me_mean; MonitorElement *me_sigma; - if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || - (me->kind() == MonitorElement::DQM_KIND_TH2S) || + if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || (me->kind() == MonitorElement::DQM_KIND_TH2S) || (me->kind() == MonitorElement::DQM_KIND_TH2D)) { TH2 *th = me->getTH2F(); size_t nbinx = me->getNbinsX(); @@ -151,8 +135,7 @@ void PFClient::createResolutionPlots(DQMStore::IBooker &ibooker, } std::string tit_new = ";" + xtit + ";" + ytit; ibooker.setCurrentFolder(folder); - MonitorElement *me_slice = - ibooker.book1D("PFlowSlice", "PFlowSlice", nbiny, ymin, ymax); + MonitorElement *me_slice = ibooker.book1D("PFlowSlice", "PFlowSlice", nbiny, ymin, ymax); tit_new = ";" + xtit + ";Average_" + ytit; me_average = ibooker.book1D("average_" + name, tit_new, nbinx, xbins); @@ -181,7 +164,7 @@ void PFClient::createResolutionPlots(DQMStore::IBooker &ibooker, me_sigma->setBinContent(ix, sigma); } if (me_slice) - igetter.removeElement(me_slice->getName()); //? + igetter.removeElement(me_slice->getName()); //? delete[] xbins; } } @@ -191,15 +174,15 @@ void PFClient::createResolutionPlots(DQMStore::IBooker &ibooker, // void PFClient::createProjectionPlots(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - std::string &folder, std::string &name) { + std::string &folder, + std::string &name) { MonitorElement *me = igetter.get(folder + "/" + name); if (!me) return; MonitorElement *projection = nullptr; - if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || - (me->kind() == MonitorElement::DQM_KIND_TH2S) || + if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || (me->kind() == MonitorElement::DQM_KIND_TH2S) || (me->kind() == MonitorElement::DQM_KIND_TH2D)) { TH2 *th = me->getTH2F(); size_t nbinx = me->getNbinsX(); @@ -221,18 +204,13 @@ void PFClient::createProjectionPlots(DQMStore::IBooker &ibooker, if (folder == "ParticleFlow/PFElectronValidation/CompWithGenElectron") { if (name == "delta_et_Over_et_VS_et_") - projection = ibooker.book1D("delta_et_Over_et", - "E_{T} resolution;#DeltaE_{T}/E_{T}", nbiny, - ymin, ymax); + projection = ibooker.book1D("delta_et_Over_et", "E_{T} resolution;#DeltaE_{T}/E_{T}", nbiny, ymin, ymax); if (name == "delta_et_VS_et_") - projection = ibooker.book1D("delta_et_", "#DeltaE_{T};#DeltaE_{T}", - nbiny, ymin, ymax); + projection = ibooker.book1D("delta_et_", "#DeltaE_{T};#DeltaE_{T}", nbiny, ymin, ymax); if (name == "delta_eta_VS_et_") - projection = ibooker.book1D("delta_eta_", "#Delta#eta;#Delta#eta", - nbiny, ymin, ymax); + projection = ibooker.book1D("delta_eta_", "#Delta#eta;#Delta#eta", nbiny, ymin, ymax); if (name == "delta_phi_VS_et_") - projection = ibooker.book1D("delta_phi_", "#Delta#phi;#Delta#phi", - nbiny, ymin, ymax); + projection = ibooker.book1D("delta_phi_", "#Delta#phi;#Delta#phi", nbiny, ymin, ymax); } if (projection) { @@ -251,13 +229,13 @@ void PFClient::createProjectionPlots(DQMStore::IBooker &ibooker, // void PFClient::createProfilePlots(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - std::string &folder, std::string &name) { + std::string &folder, + std::string &name) { MonitorElement *me = igetter.get(folder + "/" + name); if (!me) return; - if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || - (me->kind() == MonitorElement::DQM_KIND_TH2S) || + if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || (me->kind() == MonitorElement::DQM_KIND_TH2S) || (me->kind() == MonitorElement::DQM_KIND_TH2D)) { TH2 *th = me->getTH2F(); size_t nbinx = me->getNbinsX(); @@ -277,10 +255,8 @@ void PFClient::createProfilePlots(DQMStore::IBooker &ibooker, ibooker.setCurrentFolder(folder); // TProfiles MonitorElement *me_profile[2]; - me_profile[0] = ibooker.bookProfile("profile_" + name, tit_new, nbinx, - xbins, ymin, ymax, ""); - me_profile[1] = ibooker.bookProfile("profileRMS_" + name, tit_new, nbinx, - xbins, ymin, ymax, "s"); + me_profile[0] = ibooker.bookProfile("profile_" + name, tit_new, nbinx, xbins, ymin, ymax, ""); + me_profile[1] = ibooker.bookProfile("profileRMS_" + name, tit_new, nbinx, xbins, ymin, ymax, "s"); TProfile *profileX = th->ProfileX(); // size_t nbiny = me->getNbinsY(); // TProfile* profileX = th->ProfileX("",0,nbiny+1); add underflow and @@ -292,13 +268,11 @@ void PFClient::createProfilePlots(DQMStore::IBooker &ibooker, for (Int_t i = 0; i < 2; i++) { if (me_profile[i]) { for (size_t ix = 0; ix <= nbinx + 1; ++ix) { - me_profile[i]->setBinContent(ix, profileX->GetBinContent(ix) * - profileX->GetBinEntries(ix)); + me_profile[i]->setBinContent(ix, profileX->GetBinContent(ix) * profileX->GetBinEntries(ix)); // me_profile[i]->Fill( profileX->GetBinCenter(ix), // profileX->GetBinContent(ix)*profileX->GetBinEntries(ix) ) ; me_profile[i]->setBinEntries(ix, profileX->GetBinEntries(ix)); - me_profile[i]->getTProfile()->GetSumw2()->fArray[ix] = - profileX->GetSumw2()->fArray[ix]; + me_profile[i]->getTProfile()->GetSumw2()->fArray[ix] = profileX->GetSumw2()->fArray[ix]; // me_profile[i]->getTProfile()->GetBinSumw2()->fArray[ix] = // profileX->GetBinSumw2()->fArray[ix]; // segmentation violation } @@ -314,9 +288,8 @@ void PFClient::createProfilePlots(DQMStore::IBooker &ibooker, // // -- Get Histogram Parameters // -void PFClient::getHistogramParameters(MonitorElement *me_slice, double &average, - double &rms, double &mean, - double &sigma) { +void PFClient::getHistogramParameters( + MonitorElement *me_slice, double &average, double &rms, double &mean, double &sigma) { average = 0.0; rms = 0.0; mean = 0.0; @@ -343,7 +316,8 @@ void PFClient::getHistogramParameters(MonitorElement *me_slice, double &average, // void PFClient::createEfficiencyPlots(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - std::string &folder, std::string &name) { + std::string &folder, + std::string &name) { MonitorElement *me1 = igetter.get(folder + "/" + name + "ref_"); MonitorElement *me2 = igetter.get(folder + "/" + name + "gen_"); if (!me1 || !me2) @@ -353,8 +327,7 @@ void PFClient::createEfficiencyPlots(DQMStore::IBooker &ibooker, TH1F *me2_forEff = (TH1F *)me2->getTH1F()->Rebin(2, "me2_forEff"); MonitorElement *me_eff; - if ((me1->kind() == MonitorElement::DQM_KIND_TH1F) && - (me1->kind() == MonitorElement::DQM_KIND_TH1F)) { + if ((me1->kind() == MonitorElement::DQM_KIND_TH1F) && (me1->kind() == MonitorElement::DQM_KIND_TH1F)) { // TH1* th1 = me1->getTH1F(); // size_t nbinx = me1->getNbinsX(); size_t nbinx = me1_forEff->GetNbinsX(); diff --git a/DQMOffline/PFTau/plugins/PFClient.h b/DQMOffline/PFTau/plugins/PFClient.h index 7e154aa647a54..2873357dda7d9 100644 --- a/DQMOffline/PFTau/plugins/PFClient.h +++ b/DQMOffline/PFTau/plugins/PFClient.h @@ -21,17 +21,12 @@ class PFClient : public DQMEDHarvester { void doEfficiency(DQMStore::IBooker &, DQMStore::IGetter &); void doProjection(DQMStore::IBooker &, DQMStore::IGetter &); void doProfiles(DQMStore::IBooker &, DQMStore::IGetter &); - void createResolutionPlots(DQMStore::IBooker &, DQMStore::IGetter &, - std::string &folder, std::string &name); - void getHistogramParameters(MonitorElement *me_slice, double &avarage, - double &rms, double &mean, double &sigma); - void createEfficiencyPlots(DQMStore::IBooker &, DQMStore::IGetter &, - std::string &folder, std::string &name); - - void createProjectionPlots(DQMStore::IBooker &, DQMStore::IGetter &, - std::string &folder, std::string &name); - void createProfilePlots(DQMStore::IBooker &, DQMStore::IGetter &, - std::string &folder, std::string &name); + void createResolutionPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name); + void getHistogramParameters(MonitorElement *me_slice, double &avarage, double &rms, double &mean, double &sigma); + void createEfficiencyPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name); + + void createProjectionPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name); + void createProfilePlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name); std::vector folderNames_; std::vector histogramNames_; diff --git a/DQMOffline/PFTau/plugins/PFClient_JetRes.cc b/DQMOffline/PFTau/plugins/PFClient_JetRes.cc index 257c1573a7a40..2b4055bafee59 100644 --- a/DQMOffline/PFTau/plugins/PFClient_JetRes.cc +++ b/DQMOffline/PFTau/plugins/PFClient_JetRes.cc @@ -16,21 +16,17 @@ // -- Constructor // PFClient_JetRes::PFClient_JetRes(const edm::ParameterSet ¶meterSet) { - folderNames_ = - parameterSet.getParameter>("FolderNames"); - histogramNames_ = - parameterSet.getParameter>("HistogramNames"); + folderNames_ = parameterSet.getParameter>("FolderNames"); + histogramNames_ = parameterSet.getParameter>("HistogramNames"); efficiencyFlag_ = parameterSet.getParameter("CreateEfficiencyPlots"); - effHistogramNames_ = parameterSet.getParameter>( - "HistogramNamesForEfficiencyPlots"); + effHistogramNames_ = parameterSet.getParameter>("HistogramNamesForEfficiencyPlots"); PtBins_ = parameterSet.getParameter>("VariablePtBins"); } // // -- EndJobBegin Run // -void PFClient_JetRes::dqmEndJob(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { +void PFClient_JetRes::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { doSummaries(ibooker, igetter); if (efficiencyFlag_) doEfficiency(ibooker, igetter); @@ -39,16 +35,13 @@ void PFClient_JetRes::dqmEndJob(DQMStore::IBooker &ibooker, // // -- Create Summaries // -void PFClient_JetRes::doSummaries(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { - - for (std::vector::const_iterator ifolder = folderNames_.begin(); - ifolder != folderNames_.end(); ifolder++) { +void PFClient_JetRes::doSummaries(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { + for (std::vector::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end(); + ifolder++) { std::string path = "ParticleFlow/" + (*ifolder); - for (std::vector::const_iterator ihist = - histogramNames_.begin(); - ihist != histogramNames_.end(); ihist++) { + for (std::vector::const_iterator ihist = histogramNames_.begin(); ihist != histogramNames_.end(); + ihist++) { std::string hname = (*ihist); createResolutionPlots(ibooker, igetter, path, hname); } @@ -58,15 +51,13 @@ void PFClient_JetRes::doSummaries(DQMStore::IBooker &ibooker, // // -- Create Efficiency // -void PFClient_JetRes::doEfficiency(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { - for (std::vector::const_iterator ifolder = folderNames_.begin(); - ifolder != folderNames_.end(); ifolder++) { +void PFClient_JetRes::doEfficiency(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { + for (std::vector::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end(); + ifolder++) { std::string path = "ParticleFlow/" + (*ifolder); - for (std::vector::const_iterator ihist = - effHistogramNames_.begin(); - ihist != effHistogramNames_.end(); ihist++) { + for (std::vector::const_iterator ihist = effHistogramNames_.begin(); ihist != effHistogramNames_.end(); + ihist++) { std::string hname = (*ihist); createEfficiencyPlots(ibooker, igetter, path, hname); } @@ -97,8 +88,7 @@ void PFClient_JetRes::createResolutionPlots(DQMStore::IBooker &ibooker, MonitorElement *me_mean; MonitorElement *me_sigma; - if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || - (me->kind() == MonitorElement::DQM_KIND_TH2S) || + if ((me->kind() == MonitorElement::DQM_KIND_TH2F) || (me->kind() == MonitorElement::DQM_KIND_TH2S) || (me->kind() == MonitorElement::DQM_KIND_TH2D)) { TH2 *th = me->getTH2F(); // size_t nbinx = me->getNbinsX(); @@ -117,14 +107,11 @@ void PFClient_JetRes::createResolutionPlots(DQMStore::IBooker &ibooker, xbins[ix - 1] = PtBins_[ix - 1]; // snprintf(pTRange[ix-1].data(), 15, "Pt%d_%d", PtBins_[ix-1], // PtBins_[ix]); - pTRange[ix - 1] = - TString::Format("Pt%d_%d", PtBins_[ix - 1], PtBins_[ix]); + pTRange[ix - 1] = TString::Format("Pt%d_%d", PtBins_[ix - 1], PtBins_[ix]); if (name == "BRdelta_et_Over_et_VS_et_") - pTRange[ix - 1] = - TString::Format("BRPt%d_%d", PtBins_[ix - 1], PtBins_[ix]); + pTRange[ix - 1] = TString::Format("BRPt%d_%d", PtBins_[ix - 1], PtBins_[ix]); else if (name == "ERdelta_et_Over_et_VS_et_") - pTRange[ix - 1] = - TString::Format("ERPt%d_%d", PtBins_[ix - 1], PtBins_[ix]); + pTRange[ix - 1] = TString::Format("ERPt%d_%d", PtBins_[ix - 1], PtBins_[ix]); // pTCenter[ix-1] = (PtBins_[ix] - PtBins_[ix-1]) / 2. ; if (ix == nbinx) { @@ -156,21 +143,15 @@ void PFClient_JetRes::createResolutionPlots(DQMStore::IBooker &ibooker, // me_slice->Reset(); if (name == "delta_et_Over_et_VS_et_") pT[ix - 1] = ibooker.book1D( - pTRange[ix - 1], - TString::Format("Total %s;%s;Events", ytit.data(), ytit.data()), - nbiny, ymin, ymax); + pTRange[ix - 1], TString::Format("Total %s;%s;Events", ytit.data(), ytit.data()), nbiny, ymin, ymax); if (name == "BRdelta_et_Over_et_VS_et_") pT[ix - 1] = ibooker.book1D( - pTRange[ix - 1], - TString::Format("Barrel %s;%s;Events", ytit.data(), ytit.data()), - nbiny, ymin, ymax); + pTRange[ix - 1], TString::Format("Barrel %s;%s;Events", ytit.data(), ytit.data()), nbiny, ymin, ymax); else if (name == "ERdelta_et_Over_et_VS_et_") pT[ix - 1] = ibooker.book1D( - pTRange[ix - 1], - TString::Format("Endcap %s;%s;Events", ytit.data(), ytit.data()), - nbiny, ymin, ymax); + pTRange[ix - 1], TString::Format("Endcap %s;%s;Events", ytit.data(), ytit.data()), nbiny, ymin, ymax); - for (size_t iy = 0; iy <= nbiny + 1; ++iy) // add under and overflow + for (size_t iy = 0; iy <= nbiny + 1; ++iy) // add under and overflow if (th->GetBinContent(ix, iy)) { // me_slice->setBinContent(iy,th->GetBinContent(ix,iy)); pT[ix - 1]->setBinContent(iy, th->GetBinContent(ix, iy)); @@ -195,9 +176,8 @@ void PFClient_JetRes::createResolutionPlots(DQMStore::IBooker &ibooker, // // -- Get Histogram Parameters // -void PFClient_JetRes::getHistogramParameters(MonitorElement *me_slice, - double &average, double &rms, - double &mean, double &sigma) { +void PFClient_JetRes::getHistogramParameters( + MonitorElement *me_slice, double &average, double &rms, double &mean, double &sigma) { average = 0.0; rms = 0.0; mean = 0.0; @@ -231,8 +211,7 @@ void PFClient_JetRes::createEfficiencyPlots(DQMStore::IBooker &ibooker, if (!me1 || !me2) return; MonitorElement *me_eff; - if ((me1->kind() == MonitorElement::DQM_KIND_TH1F) && - (me1->kind() == MonitorElement::DQM_KIND_TH1F)) { + if ((me1->kind() == MonitorElement::DQM_KIND_TH1F) && (me1->kind() == MonitorElement::DQM_KIND_TH1F)) { TH1 *th1 = me1->getTH1F(); size_t nbinx = me1->getNbinsX(); diff --git a/DQMOffline/PFTau/plugins/PFClient_JetRes.h b/DQMOffline/PFTau/plugins/PFClient_JetRes.h index d6d517af9a429..e4b4765c919b4 100644 --- a/DQMOffline/PFTau/plugins/PFClient_JetRes.h +++ b/DQMOffline/PFTau/plugins/PFClient_JetRes.h @@ -19,12 +19,9 @@ class PFClient_JetRes : public DQMEDHarvester { void doSummaries(DQMStore::IBooker &, DQMStore::IGetter &); void doEfficiency(DQMStore::IBooker &, DQMStore::IGetter &); - void createResolutionPlots(DQMStore::IBooker &, DQMStore::IGetter &, - std::string &folder, std::string &name); - void getHistogramParameters(MonitorElement *me_slice, double &avarage, - double &rms, double &mean, double &sigma); - void createEfficiencyPlots(DQMStore::IBooker &, DQMStore::IGetter &, - std::string &folder, std::string &name); + void createResolutionPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name); + void getHistogramParameters(MonitorElement *me_slice, double &avarage, double &rms, double &mean, double &sigma); + void createEfficiencyPlots(DQMStore::IBooker &, DQMStore::IGetter &, std::string &folder, std::string &name); std::vector folderNames_; std::vector histogramNames_; diff --git a/DQMOffline/PFTau/plugins/PFDQMEventSelector.cc b/DQMOffline/PFTau/plugins/PFDQMEventSelector.cc index 00d56be3aed46..8148792dc0317 100644 --- a/DQMOffline/PFTau/plugins/PFDQMEventSelector.cc +++ b/DQMOffline/PFTau/plugins/PFDQMEventSelector.cc @@ -31,16 +31,13 @@ PFDQMEventSelector::~PFDQMEventSelector() {} // -- BeginJob // void PFDQMEventSelector::beginJob() { - dqmStore_ = edm::Service().operator->(); fileOpened_ = openInputFile(); } // // -- Event Filtering // -bool PFDQMEventSelector::filter(edm::Event &iEvent, - edm::EventSetup const &iSetup) { - +bool PFDQMEventSelector::filter(edm::Event &iEvent, edm::EventSetup const &iSetup) { nEvents_++; if (!fileOpened_) return false; @@ -51,17 +48,15 @@ bool PFDQMEventSelector::filter(edm::Event &iEvent, std::ostringstream eventid_str; eventid_str << runNb << "_" << evtNb << "_" << lumiNb; - for (std::vector::const_iterator ifolder = folderNames_.begin(); - ifolder != folderNames_.end(); ifolder++) { + for (std::vector::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end(); + ifolder++) { std::string path = "ParticleFlow/" + (*ifolder) + "/BadEvents"; MonitorElement *me = dqmStore_->get(path + "/" + eventid_str.str()); if (me) { nSelectedEvents_++; if (verbose_) - std::cout << " Total Events " << nEvents_ << " Selected Events " - << nSelectedEvents_ << " Run # : " << runNb - << " Event # : " << evtNb - << " Luminosity Block # : " << lumiNb << std::endl; + std::cout << " Total Events " << nEvents_ << " Selected Events " << nSelectedEvents_ << " Run # : " << runNb + << " Event # : " << evtNb << " Luminosity Block # : " << lumiNb << std::endl; return true; } } @@ -72,8 +67,7 @@ bool PFDQMEventSelector::filter(edm::Event &iEvent, // void PFDQMEventSelector::endJob() { if (verbose_) - std::cout << " Total Events " << nEvents_ << " Selected Events " - << nSelectedEvents_ << std::endl; + std::cout << " Total Events " << nEvents_ << " Selected Events " << nSelectedEvents_ << std::endl; } // // -- Open Input File @@ -81,9 +75,7 @@ void PFDQMEventSelector::endJob() { bool PFDQMEventSelector::openInputFile() { if (inputFileName_.empty()) return false; - edm::LogInfo("SiStripOfflineDQM") - << "SiStripOfflineDQM::openInputFile: Accessing root File" - << inputFileName_; + edm::LogInfo("SiStripOfflineDQM") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_; dqmStore_->open(inputFileName_, false, "", "", DQMStore::StripRunDirs); return true; } diff --git a/DQMOffline/PFTau/plugins/PFDQMEventSelector.h b/DQMOffline/PFTau/plugins/PFDQMEventSelector.h index 64d305dbf82da..bbef08315a799 100644 --- a/DQMOffline/PFTau/plugins/PFDQMEventSelector.h +++ b/DQMOffline/PFTau/plugins/PFDQMEventSelector.h @@ -6,7 +6,6 @@ class DQMStore; class PFDQMEventSelector : public edm::EDFilter { - public: PFDQMEventSelector(const edm::ParameterSet &); ~PFDQMEventSelector() override; diff --git a/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.cc b/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.cc index 8fd2b1b6db5f1..e1c2c0298ca59 100644 --- a/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.cc @@ -28,8 +28,7 @@ PFJetDQMAnalyzer::PFJetDQMAnalyzer(const edm::ParameterSet ¶meterSet) matchLabel_ = pSet_.getParameter("MatchCollection"); benchmarkLabel_ = pSet_.getParameter("BenchmarkLabel"); - pfJetMonitor_.setParameters( - parameterSet); // set parameters for booking histograms and validating jet + pfJetMonitor_.setParameters(parameterSet); // set parameters for booking histograms and validating jet myJet_ = consumes>(inputLabel_); myMatchedJet_ = consumes>(matchLabel_); @@ -50,9 +49,8 @@ void PFJetDQMAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, edm::EventSetup const & /* iSetup */) { ibooker.setCurrentFolder(eventInfoFolder_); - edm::LogInfo("PFJetDQMAnalyzer") - << " PFJetDQMAnalyzer::bookHistograms " - << "Histogram Folder path set to " << eventInfoFolder_; + edm::LogInfo("PFJetDQMAnalyzer") << " PFJetDQMAnalyzer::bookHistograms " + << "Histogram Folder path set to " << eventInfoFolder_; pfJetMonitor_.setup(ibooker, pSet_); } @@ -60,9 +58,7 @@ void PFJetDQMAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, // // -- Analyze // -void PFJetDQMAnalyzer::analyze(edm::Event const &iEvent, - edm::EventSetup const &iSetup) { - +void PFJetDQMAnalyzer::analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) { edm::Handle> jetCollection; iEvent.getByToken(myJet_, jetCollection); @@ -73,11 +69,14 @@ void PFJetDQMAnalyzer::analyze(edm::Event const &iEvent, float minRes = 99.99; float jetpT = 0.0; if (jetCollection.isValid() && matchedJetCollection.isValid()) { - pfJetMonitor_.fill( - *jetCollection, *matchedJetCollection, minRes, maxRes, jetpT, - pSet_); // match collections and fill pt eta phi and charge histos for - // candidate jet, fill delta_x_VS_y histos for matched couples, - // book and fill delta_frac_VS_frac histos for matched couples + pfJetMonitor_.fill(*jetCollection, + *matchedJetCollection, + minRes, + maxRes, + jetpT, + pSet_); // match collections and fill pt eta phi and charge histos for + // candidate jet, fill delta_x_VS_y histos for matched couples, + // book and fill delta_frac_VS_frac histos for matched couples } } diff --git a/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.h b/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.h index 7748bdb55ebec..2bf3e17444968 100644 --- a/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.h +++ b/DQMOffline/PFTau/plugins/PFJetDQMAnalyzer.h @@ -19,8 +19,7 @@ class PFJetDQMAnalyzer : public DQMEDAnalyzer { private: void analyze(edm::Event const &, edm::EventSetup const &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; edm::EDGetTokenT> myJet_; edm::EDGetTokenT> myMatchedJet_; diff --git a/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.cc b/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.cc index d1e5f154440d8..f0baeac1ac195 100644 --- a/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.cc @@ -47,9 +47,8 @@ void PFMETDQMAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, edm::EventSetup const & /* iSetup */) { ibooker.setCurrentFolder(eventInfoFolder_); - edm::LogInfo("PFMETDQMAnalyzer") - << " PFMETDQMAnalyzer::bookHistograms " - << "Histogram Folder path set to " << eventInfoFolder_; + edm::LogInfo("PFMETDQMAnalyzer") << " PFMETDQMAnalyzer::bookHistograms " + << "Histogram Folder path set to " << eventInfoFolder_; pfMETMonitor_.setup(ibooker, pSet_); } @@ -57,8 +56,7 @@ void PFMETDQMAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, // // -- Analyze // -void PFMETDQMAnalyzer::analyze(edm::Event const &iEvent, - edm::EventSetup const &iSetup) { +void PFMETDQMAnalyzer::analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) { edm::Handle> metCollection; iEvent.getByToken(myMET_, metCollection); @@ -68,8 +66,7 @@ void PFMETDQMAnalyzer::analyze(edm::Event const &iEvent, if (metCollection.isValid() && matchedMetCollection.isValid()) { float maxRes = 0.0; float minRes = 99.99; - pfMETMonitor_.fillOne((*metCollection)[0], (*matchedMetCollection)[0], - minRes, maxRes); + pfMETMonitor_.fillOne((*metCollection)[0], (*matchedMetCollection)[0], minRes, maxRes); } } diff --git a/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.h b/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.h index d192e19375272..38b5200e15d08 100644 --- a/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.h +++ b/DQMOffline/PFTau/plugins/PFMETDQMAnalyzer.h @@ -19,8 +19,7 @@ class PFMETDQMAnalyzer : public DQMEDAnalyzer { private: void analyze(edm::Event const &, edm::EventSetup const &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; edm::EDGetTokenT> myMET_; edm::EDGetTokenT> myMatchedMET_; diff --git a/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.cc b/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.cc index 09dbd7da3372b..095f70e9d3bdd 100644 --- a/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.cc +++ b/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.cc @@ -47,9 +47,8 @@ void PFMuonDQMAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, edm::EventSetup const & /* iSetup */) { ibooker.setCurrentFolder(eventInfoFolder_); - edm::LogInfo("PFMuonDQMAnalyzer") - << " PFMuonDQMAnalyzer::bookHistograms " - << "Histogram Folder path set to " << eventInfoFolder_; + edm::LogInfo("PFMuonDQMAnalyzer") << " PFMuonDQMAnalyzer::bookHistograms " + << "Histogram Folder path set to " << eventInfoFolder_; pfCandidateMonitor_.setup(ibooker, pSet_); } @@ -57,9 +56,7 @@ void PFMuonDQMAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, // // -- Analyze // -void PFMuonDQMAnalyzer::analyze(edm::Event const &iEvent, - edm::EventSetup const &iSetup) { - +void PFMuonDQMAnalyzer::analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) { edm::Handle> candCollection; edm::Handle> matchedCandCollection; if (!createEfficiencyHistos_) { @@ -73,8 +70,7 @@ void PFMuonDQMAnalyzer::analyze(edm::Event const &iEvent, float maxRes = 0.0; float minRes = 99.99; if (candCollection.isValid() && matchedCandCollection.isValid()) { - pfCandidateMonitor_.fill(*candCollection, *matchedCandCollection, minRes, - maxRes, pSet_, *matchedCandCollection); + pfCandidateMonitor_.fill(*candCollection, *matchedCandCollection, minRes, maxRes, pSet_, *matchedCandCollection); } } diff --git a/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.h b/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.h index 4bdcbc51a91f2..dd4b8e2aa9a1b 100644 --- a/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.h +++ b/DQMOffline/PFTau/plugins/PFMuonDQMAnalyzer.h @@ -19,8 +19,7 @@ class PFMuonDQMAnalyzer : public DQMEDAnalyzer { private: void analyze(edm::Event const &, edm::EventSetup const &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; edm::EDGetTokenT> myCand_; edm::EDGetTokenT> myMatchedCand_; diff --git a/DQMOffline/PFTau/src/Benchmark.cc b/DQMOffline/PFTau/src/Benchmark.cc index 5c9d69493912a..4764ae819a7ae 100644 --- a/DQMOffline/PFTau/src/Benchmark.cc +++ b/DQMOffline/PFTau/src/Benchmark.cc @@ -13,25 +13,35 @@ Benchmark::~Benchmark() noexcept(false) {} void Benchmark::setDirectory(TDirectory *dir) { dir_ = dir; } -TH1F *Benchmark::book1D(DQMStore::IBooker &b, const char *histname, - const char *title, int nbins, float xmin, float xmax) { +TH1F *Benchmark::book1D( + DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax) { edm::LogInfo("Benchmark") << " Benchmark::book1D " << "booking " << histname; return b.book1D(histname, title, nbins, xmin, xmax)->getTH1F(); } -TH2F *Benchmark::book2D(DQMStore::IBooker &b, const char *histname, - const char *title, int nbinsx, float xmin, float xmax, - int nbinsy, float ymin, float ymax) { +TH2F *Benchmark::book2D(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float xmin, + float xmax, + int nbinsy, + float ymin, + float ymax) { edm::LogInfo("Benchmark") << " Benchmark::book2D " << "booked " << histname; - return b.book2D(histname, title, nbinsx, xmin, xmax, nbinsy, ymin, ymax) - ->getTH2F(); + return b.book2D(histname, title, nbinsx, xmin, xmax, nbinsy, ymin, ymax)->getTH2F(); } -TH2F *Benchmark::book2D(DQMStore::IBooker &b, const char *histname, - const char *title, int nbinsx, float *xbins, int nbinsy, - float ymin, float ymax) { +TH2F *Benchmark::book2D(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float *xbins, + int nbinsy, + float ymin, + float ymax) { edm::LogInfo("Benchmark") << " Benchmark::book2D " << " booked " << histname; @@ -46,20 +56,28 @@ TH2F *Benchmark::book2D(DQMStore::IBooker &b, const char *histname, return b.book2D(histname, title, nbinsx, xbins, nbinsy, &ybins[0])->getTH2F(); } -TProfile *Benchmark::bookProfile(DQMStore::IBooker &b, const char *histname, - const char *title, int nbinsx, float xmin, - float xmax, float ymin, float ymax, +TProfile *Benchmark::bookProfile(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float xmin, + float xmax, + float ymin, + float ymax, const char *option) { edm::LogInfo("Benchmark") << " Benchmark::bookProfile " << "booked " << histname; - return b.bookProfile(histname, title, nbinsx, xmin, xmax, 0.0, 0.0, option) - ->getTProfile(); + return b.bookProfile(histname, title, nbinsx, xmin, xmax, 0.0, 0.0, option)->getTProfile(); } -TProfile *Benchmark::bookProfile(DQMStore::IBooker &b, const char *histname, - const char *title, int nbinsx, float *xbins, - float ymin, float ymax, const char *option) { - +TProfile *Benchmark::bookProfile(DQMStore::IBooker &b, + const char *histname, + const char *title, + int nbinsx, + float *xbins, + float ymin, + float ymax, + const char *option) { // need to convert the float bin array into a double bin array, because the // DQMStore TProfile functions take floats, while the DQMStore TH2 functions // take double. @@ -70,8 +88,7 @@ TProfile *Benchmark::bookProfile(DQMStore::IBooker &b, const char *histname, edm::LogInfo("Benchmark") << " Benchmark::bookProfile " << "booked " << histname; - return b.bookProfile(histname, title, nbinsx, &xbinsd[0], ymin, ymax, option) - ->getTProfile(); + return b.bookProfile(histname, title, nbinsx, &xbinsd[0], ymin, ymax, option)->getTProfile(); } void Benchmark::write() { diff --git a/DQMOffline/PFTau/src/CandidateBenchmark.cc b/DQMOffline/PFTau/src/CandidateBenchmark.cc index a3b6055c8a460..d43d3a3167ec7 100644 --- a/DQMOffline/PFTau/src/CandidateBenchmark.cc +++ b/DQMOffline/PFTau/src/CandidateBenchmark.cc @@ -22,18 +22,17 @@ CandidateBenchmark::CandidateBenchmark(Mode mode) : Benchmark(mode) { CandidateBenchmark::~CandidateBenchmark() {} void CandidateBenchmark::setup(DQMStore::IBooker &b) { - if (!histogramBooked_) { PhaseSpace ptPS(100, 0, 100); PhaseSpace phiPS(360, -3.1416, 3.1416); PhaseSpace etaPS(100, -5, 5); switch (mode_) { - case DQMOFFLINE: - default: - ptPS = PhaseSpace(50, 0, 100); - phiPS.n = 50; - etaPS.n = 20; - break; + case DQMOFFLINE: + default: + ptPS = PhaseSpace(50, 0, 100); + phiPS.n = 50; + etaPS.n = 20; + break; } pt_ = book1D(b, "pt_", "pt_;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M); @@ -45,44 +44,50 @@ void CandidateBenchmark::setup(DQMStore::IBooker &b) { } } -void CandidateBenchmark::setup(DQMStore::IBooker &b, - const edm::ParameterSet ¶meterSet) { +void CandidateBenchmark::setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet) { if (!histogramBooked_) { - edm::ParameterSet ptPS = - parameterSet.getParameter("PtHistoParameter"); - edm::ParameterSet etaPS = - parameterSet.getParameter("EtaHistoParameter"); - edm::ParameterSet phiPS = - parameterSet.getParameter("PhiHistoParameter"); - edm::ParameterSet chPS = - parameterSet.getParameter("ChargeHistoParameter"); + edm::ParameterSet ptPS = parameterSet.getParameter("PtHistoParameter"); + edm::ParameterSet etaPS = parameterSet.getParameter("EtaHistoParameter"); + edm::ParameterSet phiPS = parameterSet.getParameter("PhiHistoParameter"); + edm::ParameterSet chPS = parameterSet.getParameter("ChargeHistoParameter"); if (ptPS.getParameter("switchOn")) { - pt_ = book1D( - b, "pt_", "p_{T};p_{T} (GeV)", ptPS.getParameter("nBin"), - ptPS.getParameter("xMin"), ptPS.getParameter("xMax")); + pt_ = book1D(b, + "pt_", + "p_{T};p_{T} (GeV)", + ptPS.getParameter("nBin"), + ptPS.getParameter("xMin"), + ptPS.getParameter("xMax")); } if (etaPS.getParameter("switchOn")) { - eta_ = book1D(b, "eta_", "#eta;#eta", etaPS.getParameter("nBin"), + eta_ = book1D(b, + "eta_", + "#eta;#eta", + etaPS.getParameter("nBin"), etaPS.getParameter("xMin"), etaPS.getParameter("xMax")); } if (phiPS.getParameter("switchOn")) { - phi_ = book1D(b, "phi_", "#phi;#phi", phiPS.getParameter("nBin"), + phi_ = book1D(b, + "phi_", + "#phi;#phi", + phiPS.getParameter("nBin"), phiPS.getParameter("xMin"), phiPS.getParameter("xMax")); } if (chPS.getParameter("switchOn")) { - charge_ = book1D( - b, "charge_", "charge;charge", chPS.getParameter("nBin"), - chPS.getParameter("xMin"), chPS.getParameter("xMax")); + charge_ = book1D(b, + "charge_", + "charge;charge", + chPS.getParameter("nBin"), + chPS.getParameter("xMin"), + chPS.getParameter("xMax")); } histogramBooked_ = true; } } void CandidateBenchmark::fillOne(const reco::Candidate &cand) { - if (!isInRange(cand.pt(), cand.eta(), cand.phi())) return; diff --git a/DQMOffline/PFTau/src/METBenchmark.cc b/DQMOffline/PFTau/src/METBenchmark.cc index cd8275cd7cf7d..8cac9497e106d 100644 --- a/DQMOffline/PFTau/src/METBenchmark.cc +++ b/DQMOffline/PFTau/src/METBenchmark.cc @@ -15,7 +15,6 @@ using namespace std; METBenchmark::~METBenchmark() {} void METBenchmark::setup(DQMStore::IBooker &b) { - // std::cout << "FL: METBenchmark.cc: start setup()" << std::endl; PhaseSpace ptPS(100, 0, 200); @@ -28,13 +27,13 @@ void METBenchmark::setup(DQMStore::IBooker &b) { PhaseSpace etOverSumEtPS(100, 0.0, 1.0); switch (mode_) { - case DQMOFFLINE: - ptPS = PhaseSpace(200, 0, 200); - pxPS = PhaseSpace(200, -100., 100); - sumEtPS = PhaseSpace(200, 0, 200); - break; - default: - break; + case DQMOFFLINE: + ptPS = PhaseSpace(200, 0, 200); + pxPS = PhaseSpace(200, -100., 100); + sumEtPS = PhaseSpace(200, 0, 200); + break; + default: + break; } pt_ = book1D(b, "pt_", "pt_;p_{T} [GeV]", ptPS.n, ptPS.m, ptPS.M); @@ -45,20 +44,16 @@ void METBenchmark::setup(DQMStore::IBooker &b) { // might want to increase the number of bins, to match the size of the ECAL // crystals phi_ = book1D(b, "phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M); - sumEt_ = book1D(b, "sumEt_", "sumEt_;#SigmaE_{T} [GeV]", sumEtPS.n, sumEtPS.m, - sumEtPS.M); - sumEt2_ = book1D(b, "sumEt2_", "sumEt2_;#SigmaE_{T} [GeV]", sumEt2PS.n, - sumEt2PS.m, sumEt2PS.M); - etOverSumEt_ = book1D(b, "etOverSumEt_", "etOverSumEt_;p_{T}/#SigmaE_{T}", - etOverSumEtPS.n, etOverSumEtPS.m, etOverSumEtPS.M); + sumEt_ = book1D(b, "sumEt_", "sumEt_;#SigmaE_{T} [GeV]", sumEtPS.n, sumEtPS.m, sumEtPS.M); + sumEt2_ = book1D(b, "sumEt2_", "sumEt2_;#SigmaE_{T} [GeV]", sumEt2PS.n, sumEt2PS.m, sumEt2PS.M); + etOverSumEt_ = + book1D(b, "etOverSumEt_", "etOverSumEt_;p_{T}/#SigmaE_{T}", etOverSumEtPS.n, etOverSumEtPS.m, etOverSumEtPS.M); - mex_VS_sumEt_ = - book2D(b, "mex_VS_sumEt_", ";#SigmaE_{T} [GeV];p_{X} [GeV]", sumEt3PS.n, - sumEt3PS.m, sumEt3PS.M, pxPS.n, pxPS.m, pxPS.M); + mex_VS_sumEt_ = book2D( + b, "mex_VS_sumEt_", ";#SigmaE_{T} [GeV];p_{X} [GeV]", sumEt3PS.n, sumEt3PS.m, sumEt3PS.M, pxPS.n, pxPS.m, pxPS.M); } void METBenchmark::fillOne(const reco::MET &cand) { - if (!isInRange(cand.pt(), cand.eta(), cand.phi())) return; diff --git a/DQMOffline/PFTau/src/MatchCandidateBenchmark.cc b/DQMOffline/PFTau/src/MatchCandidateBenchmark.cc index 854b05f06f3d2..2420f453c4f32 100644 --- a/DQMOffline/PFTau/src/MatchCandidateBenchmark.cc +++ b/DQMOffline/PFTau/src/MatchCandidateBenchmark.cc @@ -11,7 +11,6 @@ using namespace std; MatchCandidateBenchmark::MatchCandidateBenchmark(Mode mode) : Benchmark(mode) { - delta_et_Over_et_VS_et_ = nullptr; delta_et_VS_et_ = nullptr; delta_eta_VS_et_ = nullptr; @@ -34,47 +33,59 @@ void MatchCandidateBenchmark::setup(DQMStore::IBooker &b) { PhaseSpace detaPS; PhaseSpace dphiPS; switch (mode_) { - case VALIDATION: - ptPS = PhaseSpace(100, 0, 1000); - dptOvptPS = PhaseSpace(200, -1, 1); - dphiPS = PhaseSpace(200, -1, 1); - detaPS = PhaseSpace(200, -1, 1); - dptPS = PhaseSpace(100, -100, 100); - break; - case DQMOFFLINE: - default: - ptPS = PhaseSpace(50, 0, 100); - dptOvptPS = PhaseSpace(50, -1, 1); - dphiPS = PhaseSpace(50, -1, 1); - detaPS = PhaseSpace(50, -1, 1); - dptPS = PhaseSpace(50, -50, 50); - break; + case VALIDATION: + ptPS = PhaseSpace(100, 0, 1000); + dptOvptPS = PhaseSpace(200, -1, 1); + dphiPS = PhaseSpace(200, -1, 1); + detaPS = PhaseSpace(200, -1, 1); + dptPS = PhaseSpace(100, -100, 100); + break; + case DQMOFFLINE: + default: + ptPS = PhaseSpace(50, 0, 100); + dptOvptPS = PhaseSpace(50, -1, 1); + dphiPS = PhaseSpace(50, -1, 1); + detaPS = PhaseSpace(50, -1, 1); + dptPS = PhaseSpace(50, -50, 50); + break; } float ptBins[11] = {0, 1, 2, 5, 10, 20, 50, 100, 200, 400, 1000}; int size = sizeof(ptBins) / sizeof(*ptBins); - delta_et_Over_et_VS_et_ = book2D( - b, "delta_et_Over_et_VS_et_", ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", - size, ptBins, dptOvptPS.n, dptOvptPS.m, dptOvptPS.M); - - BRdelta_et_Over_et_VS_et_ = book2D( - b, "BRdelta_et_Over_et_VS_et_", ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", - size, ptBins, dptOvptPS.n, dptOvptPS.m, dptOvptPS.M); - ERdelta_et_Over_et_VS_et_ = book2D( - b, "ERdelta_et_Over_et_VS_et_", ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", - size, ptBins, dptOvptPS.n, dptOvptPS.m, dptOvptPS.M); + delta_et_Over_et_VS_et_ = book2D(b, + "delta_et_Over_et_VS_et_", + ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", + size, + ptBins, + dptOvptPS.n, + dptOvptPS.m, + dptOvptPS.M); + + BRdelta_et_Over_et_VS_et_ = book2D(b, + "BRdelta_et_Over_et_VS_et_", + ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", + size, + ptBins, + dptOvptPS.n, + dptOvptPS.m, + dptOvptPS.M); + ERdelta_et_Over_et_VS_et_ = book2D(b, + "ERdelta_et_Over_et_VS_et_", + ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", + size, + ptBins, + dptOvptPS.n, + dptOvptPS.m, + dptOvptPS.M); delta_et_VS_et_ = - book2D(b, "delta_et_VS_et_", ";E_{T, true} (GeV);#DeltaE_{T}", size, - ptBins, dptPS.n, dptPS.m, dptPS.M); + book2D(b, "delta_et_VS_et_", ";E_{T, true} (GeV);#DeltaE_{T}", size, ptBins, dptPS.n, dptPS.m, dptPS.M); delta_eta_VS_et_ = - book2D(b, "delta_eta_VS_et_", ";#E_{T, true} (GeV);#Delta#eta", size, - ptBins, detaPS.n, detaPS.m, detaPS.M); + book2D(b, "delta_eta_VS_et_", ";#E_{T, true} (GeV);#Delta#eta", size, ptBins, detaPS.n, detaPS.m, detaPS.M); delta_phi_VS_et_ = - book2D(b, "delta_phi_VS_et_", ";E_{T, true} (GeV);#Delta#phi", size, - ptBins, dphiPS.n, dphiPS.m, dphiPS.M); + book2D(b, "delta_phi_VS_et_", ";E_{T, true} (GeV);#Delta#phi", size, ptBins, dphiPS.n, dphiPS.m, dphiPS.M); /* // TProfile profile_delta_et_Over_et_VS_et_ = @@ -116,11 +127,8 @@ void MatchCandidateBenchmark::setup(DQMStore::IBooker &b) { } } -void MatchCandidateBenchmark::setup(DQMStore::IBooker &b, - const edm::ParameterSet ¶meterSet) { - - std::vector ptBinsPS = - parameterSet.getParameter>("VariablePtBins"); +void MatchCandidateBenchmark::setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet) { + std::vector ptBinsPS = parameterSet.getParameter>("VariablePtBins"); pTRes_.resize(ptBinsPS.size() - 1); BRpTRes_.resize(ptBinsPS.size() - 1); ERpTRes_.resize(ptBinsPS.size() - 1); @@ -132,17 +140,11 @@ void MatchCandidateBenchmark::setup(DQMStore::IBooker &b, } if (!histogramBooked_) { - - edm::ParameterSet ptPS = - parameterSet.getParameter("PtHistoParameter"); - edm::ParameterSet dptPS = - parameterSet.getParameter("DeltaPtHistoParameter"); - edm::ParameterSet dptOvptPS = parameterSet.getParameter( - "DeltaPtOvPtHistoParameter"); - edm::ParameterSet detaPS = - parameterSet.getParameter("DeltaEtaHistoParameter"); - edm::ParameterSet dphiPS = - parameterSet.getParameter("DeltaPhiHistoParameter"); + edm::ParameterSet ptPS = parameterSet.getParameter("PtHistoParameter"); + edm::ParameterSet dptPS = parameterSet.getParameter("DeltaPtHistoParameter"); + edm::ParameterSet dptOvptPS = parameterSet.getParameter("DeltaPtOvPtHistoParameter"); + edm::ParameterSet detaPS = parameterSet.getParameter("DeltaEtaHistoParameter"); + edm::ParameterSet dphiPS = parameterSet.getParameter("DeltaPhiHistoParameter"); std::vector ptBins; if (ptBinsPS.size() > 1) { @@ -154,84 +156,94 @@ void MatchCandidateBenchmark::setup(DQMStore::IBooker &b, ptBins.reserve(nFixedBins + 1); for (Int_t i = 0; i <= nFixedBins; i++) ptBins.push_back(ptPS.getParameter("xMin") + - i * ((ptPS.getParameter("xMax") - - ptPS.getParameter("xMin")) / - nFixedBins)); + i * ((ptPS.getParameter("xMax") - ptPS.getParameter("xMin")) / nFixedBins)); ptBinsPS.resize(nFixedBins); } if (dptOvptPS.getParameter("switchOn")) { - delta_et_Over_et_VS_et_ = - book2D(b, "delta_et_Over_et_VS_et_", - ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", ptBinsPS.size() - 1, - &(ptBins.front()), dptOvptPS.getParameter("nBin"), - dptOvptPS.getParameter("xMin"), - dptOvptPS.getParameter("xMax")); + delta_et_Over_et_VS_et_ = book2D(b, + "delta_et_Over_et_VS_et_", + ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", + ptBinsPS.size() - 1, + &(ptBins.front()), + dptOvptPS.getParameter("nBin"), + dptOvptPS.getParameter("xMin"), + dptOvptPS.getParameter("xMax")); } if (dptOvptPS.getParameter("slicingOn")) { for (size_t i = 0; i < pTRes_.size(); i++) { - pTRes_[i] = book1D( - b, TString::Format("Pt%d_%d", (int)ptBins[i], (int)ptBins[i + 1]), - ";#Deltap_{T}/p_{T};Entries", - dptOvptPS.getParameter("nBin"), - dptOvptPS.getParameter("xMin"), - dptOvptPS.getParameter("xMax")); - BRpTRes_[i] = book1D( - b, TString::Format("BRPt%d_%d", (int)ptBins[i], (int)ptBins[i + 1]), - ";#Deltap_{T}/p_{T};Entries", - dptOvptPS.getParameter("nBin"), - dptOvptPS.getParameter("xMin"), - dptOvptPS.getParameter("xMax")); - ERpTRes_[i] = book1D( - b, TString::Format("ERPt%d_%d", (int)ptBins[i], (int)ptBins[i + 1]), - ";#Deltap_{T}/p_{T};Entries", - dptOvptPS.getParameter("nBin"), - dptOvptPS.getParameter("xMin"), - dptOvptPS.getParameter("xMax")); + pTRes_[i] = book1D(b, + TString::Format("Pt%d_%d", (int)ptBins[i], (int)ptBins[i + 1]), + ";#Deltap_{T}/p_{T};Entries", + dptOvptPS.getParameter("nBin"), + dptOvptPS.getParameter("xMin"), + dptOvptPS.getParameter("xMax")); + BRpTRes_[i] = book1D(b, + TString::Format("BRPt%d_%d", (int)ptBins[i], (int)ptBins[i + 1]), + ";#Deltap_{T}/p_{T};Entries", + dptOvptPS.getParameter("nBin"), + dptOvptPS.getParameter("xMin"), + dptOvptPS.getParameter("xMax")); + ERpTRes_[i] = book1D(b, + TString::Format("ERPt%d_%d", (int)ptBins[i], (int)ptBins[i + 1]), + ";#Deltap_{T}/p_{T};Entries", + dptOvptPS.getParameter("nBin"), + dptOvptPS.getParameter("xMin"), + dptOvptPS.getParameter("xMax")); } } if (dptOvptPS.getParameter("BROn")) { - BRdelta_et_Over_et_VS_et_ = - book2D(b, "BRdelta_et_Over_et_VS_et_", - ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", ptBinsPS.size() - 1, - &(ptBins.front()), dptOvptPS.getParameter("nBin"), - dptOvptPS.getParameter("xMin"), - dptOvptPS.getParameter("xMax")); + BRdelta_et_Over_et_VS_et_ = book2D(b, + "BRdelta_et_Over_et_VS_et_", + ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", + ptBinsPS.size() - 1, + &(ptBins.front()), + dptOvptPS.getParameter("nBin"), + dptOvptPS.getParameter("xMin"), + dptOvptPS.getParameter("xMax")); } if (dptOvptPS.getParameter("EROn")) { - ERdelta_et_Over_et_VS_et_ = - book2D(b, "ERdelta_et_Over_et_VS_et_", - ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", ptBinsPS.size() - 1, - &(ptBins.front()), dptOvptPS.getParameter("nBin"), - dptOvptPS.getParameter("xMin"), - dptOvptPS.getParameter("xMax")); + ERdelta_et_Over_et_VS_et_ = book2D(b, + "ERdelta_et_Over_et_VS_et_", + ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}", + ptBinsPS.size() - 1, + &(ptBins.front()), + dptOvptPS.getParameter("nBin"), + dptOvptPS.getParameter("xMin"), + dptOvptPS.getParameter("xMax")); } if (dptPS.getParameter("switchOn")) { - delta_et_VS_et_ = - book2D(b, "delta_et_VS_et_", ";E_{T, true} (GeV);#DeltaE_{T}", - ptBinsPS.size() - 1, &(ptBins.front()), - dptPS.getParameter("nBin"), - dptPS.getParameter("xMin"), - dptPS.getParameter("xMax")); + delta_et_VS_et_ = book2D(b, + "delta_et_VS_et_", + ";E_{T, true} (GeV);#DeltaE_{T}", + ptBinsPS.size() - 1, + &(ptBins.front()), + dptPS.getParameter("nBin"), + dptPS.getParameter("xMin"), + dptPS.getParameter("xMax")); } if (detaPS.getParameter("switchOn")) { - delta_eta_VS_et_ = - book2D(b, "delta_eta_VS_et_", ";E_{T, true} (GeV);#Delta#eta", - ptBinsPS.size() - 1, &(ptBins.front()), - detaPS.getParameter("nBin"), - detaPS.getParameter("xMin"), - detaPS.getParameter("xMax")); + delta_eta_VS_et_ = book2D(b, + "delta_eta_VS_et_", + ";E_{T, true} (GeV);#Delta#eta", + ptBinsPS.size() - 1, + &(ptBins.front()), + detaPS.getParameter("nBin"), + detaPS.getParameter("xMin"), + detaPS.getParameter("xMax")); } if (dphiPS.getParameter("switchOn")) { - delta_phi_VS_et_ = - book2D(b, "delta_phi_VS_et_", ";E_{T, true} (GeV);#Delta#phi", - ptBinsPS.size() - 1, &(ptBins.front()), - dphiPS.getParameter("nBin"), - dphiPS.getParameter("xMin"), - dphiPS.getParameter("xMax")); + delta_phi_VS_et_ = book2D(b, + "delta_phi_VS_et_", + ";E_{T, true} (GeV);#Delta#phi", + ptBinsPS.size() - 1, + &(ptBins.front()), + dphiPS.getParameter("nBin"), + dphiPS.getParameter("xMin"), + dphiPS.getParameter("xMax")); } /* // TProfile @@ -292,26 +304,19 @@ void MatchCandidateBenchmark::setup(DQMStore::IBooker &b, } } -void MatchCandidateBenchmark::fillOne(const reco::Candidate &cand, - const reco::Candidate &matchedCand) { - +void MatchCandidateBenchmark::fillOne(const reco::Candidate &cand, const reco::Candidate &matchedCand) { if (!isInRange(cand.pt(), cand.eta(), cand.phi())) return; if (histogramBooked_) { if (delta_et_Over_et_VS_et_) - delta_et_Over_et_VS_et_->Fill( - matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); + delta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); if (fabs(cand.eta()) <= 1.4) if (BRdelta_et_Over_et_VS_et_) - BRdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), - (cand.pt() - matchedCand.pt()) / - matchedCand.pt()); + BRdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); if (fabs(cand.eta()) >= 1.6 && fabs(cand.eta()) <= 2.4) if (ERdelta_et_Over_et_VS_et_) - ERdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), - (cand.pt() - matchedCand.pt()) / - matchedCand.pt()); + ERdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); if (delta_et_VS_et_) delta_et_VS_et_->Fill(matchedCand.pt(), cand.pt() - matchedCand.pt()); if (delta_eta_VS_et_) @@ -345,11 +350,8 @@ void MatchCandidateBenchmark::fillOne(const reco::Candidate &cand, return; if (histogramBooked_) { - - std::vector ptBinsPS = - parameterSet.getParameter>("VariablePtBins"); - edm::ParameterSet ptPS = - parameterSet.getParameter("PtHistoParameter"); + std::vector ptBinsPS = parameterSet.getParameter>("VariablePtBins"); + edm::ParameterSet ptPS = parameterSet.getParameter("PtHistoParameter"); std::vector ptBins; if (ptBinsPS.size() > 1) { ptBins.reserve(ptBinsPS.size()); @@ -361,40 +363,29 @@ void MatchCandidateBenchmark::fillOne(const reco::Candidate &cand, ptBins.reserve(nFixedBins + 1); for (Int_t i = 0; i <= nFixedBins; i++) { ptBins.push_back(ptPS.getParameter("xMin") + - i * ((ptPS.getParameter("xMax") - - ptPS.getParameter("xMin")) / - nFixedBins)); + i * ((ptPS.getParameter("xMax") - ptPS.getParameter("xMin")) / nFixedBins)); } ptBinsPS.resize(nFixedBins); } - edm::ParameterSet dptOvptPS = parameterSet.getParameter( - "DeltaPtOvPtHistoParameter"); - if (matchedCand.pt() > ptBins.at(0)) { // underflow problem + edm::ParameterSet dptOvptPS = parameterSet.getParameter("DeltaPtOvPtHistoParameter"); + if (matchedCand.pt() > ptBins.at(0)) { // underflow problem if (delta_et_Over_et_VS_et_) - delta_et_Over_et_VS_et_->Fill(matchedCand.pt(), - (cand.pt() - matchedCand.pt()) / - matchedCand.pt()); + delta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); if (fabs(cand.eta()) >= dptOvptPS.getParameter("BREtaMin") && fabs(cand.eta()) <= dptOvptPS.getParameter("BREtaMax")) if (BRdelta_et_Over_et_VS_et_) - BRdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), - (cand.pt() - matchedCand.pt()) / - matchedCand.pt()); + BRdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); if (fabs(cand.eta()) >= dptOvptPS.getParameter("EREtaMin") && fabs(cand.eta()) <= dptOvptPS.getParameter("EREtaMax")) if (ERdelta_et_Over_et_VS_et_) - ERdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), - (cand.pt() - matchedCand.pt()) / - matchedCand.pt()); + ERdelta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); if (delta_et_VS_et_) delta_et_VS_et_->Fill(matchedCand.pt(), cand.pt() - matchedCand.pt()); if (delta_eta_VS_et_) - delta_eta_VS_et_->Fill(matchedCand.pt(), - cand.eta() - matchedCand.eta()); + delta_eta_VS_et_->Fill(matchedCand.pt(), cand.eta() - matchedCand.eta()); if (delta_phi_VS_et_) - delta_phi_VS_et_->Fill(matchedCand.pt(), - cand.phi() - matchedCand.phi()); + delta_phi_VS_et_->Fill(matchedCand.pt(), cand.phi() - matchedCand.phi()); } /* // TProfile @@ -415,20 +406,17 @@ void MatchCandidateBenchmark::fillOne(const reco::Candidate &cand, */ for (size_t i = 0; i < pTRes_.size(); i++) { - if (matchedCand.pt() >= ptBins.at(i) && - matchedCand.pt() < ptBins.at(i + 1)) { + if (matchedCand.pt() >= ptBins.at(i) && matchedCand.pt() < ptBins.at(i + 1)) { if (pTRes_[i]) pTRes_[i]->Fill((cand.pt() - matchedCand.pt()) / matchedCand.pt()); if (fabs(cand.eta()) >= dptOvptPS.getParameter("BREtaMin") && fabs(cand.eta()) <= dptOvptPS.getParameter("BREtaMax")) if (BRpTRes_[i]) - BRpTRes_[i]->Fill((cand.pt() - matchedCand.pt()) / - matchedCand.pt()); // Fill Barrel + BRpTRes_[i]->Fill((cand.pt() - matchedCand.pt()) / matchedCand.pt()); // Fill Barrel if (fabs(cand.eta()) >= dptOvptPS.getParameter("EREtaMin") && fabs(cand.eta()) <= dptOvptPS.getParameter("EREtaMax")) if (ERpTRes_[i]) - ERpTRes_[i]->Fill((cand.pt() - matchedCand.pt()) / - matchedCand.pt()); // Fill Endcap + ERpTRes_[i]->Fill((cand.pt() - matchedCand.pt()) / matchedCand.pt()); // Fill Endcap } } } diff --git a/DQMOffline/PFTau/src/MatchMETBenchmark.cc b/DQMOffline/PFTau/src/MatchMETBenchmark.cc index 7e429489d07b4..39351732220b6 100644 --- a/DQMOffline/PFTau/src/MatchMETBenchmark.cc +++ b/DQMOffline/PFTau/src/MatchMETBenchmark.cc @@ -13,7 +13,6 @@ using namespace std; MatchMETBenchmark::~MatchMETBenchmark() {} void MatchMETBenchmark::setup(DQMStore::IBooker &b) { - // std::cout << "FL: MatchMETBenchmark.cc: start setup()" << std::endl; PhaseSpace ptPS; PhaseSpace dptOvptPS; @@ -24,75 +23,92 @@ void MatchMETBenchmark::setup(DQMStore::IBooker &b) { PhaseSpace setOvsetPS; switch (mode_) { - case VALIDATION: - ptPS = PhaseSpace(100, 0, 1000); - dptOvptPS = PhaseSpace(200, -1, 1); - dphiPS = PhaseSpace(100, -3.2, 3.2); - dptPS = PhaseSpace(200, -500, 500); - setPS = PhaseSpace(300, 0.0, 3000); - dsetPS = PhaseSpace(200, 0. - 1000, 1000); - setOvsetPS = PhaseSpace(500, 0., 2.); - break; - case DQMOFFLINE: - default: - ptPS = PhaseSpace(50, 0, 200); - dptOvptPS = PhaseSpace(50, -1, 1); - dphiPS = PhaseSpace(50, -3.2, 3.2); - dptPS = PhaseSpace(50, -500, 500); - setPS = PhaseSpace(50, 0.0, 3000); - dsetPS = PhaseSpace(50, -1000.0, 1000); - setOvsetPS = PhaseSpace(100, 0., 2.); - break; + case VALIDATION: + ptPS = PhaseSpace(100, 0, 1000); + dptOvptPS = PhaseSpace(200, -1, 1); + dphiPS = PhaseSpace(100, -3.2, 3.2); + dptPS = PhaseSpace(200, -500, 500); + setPS = PhaseSpace(300, 0.0, 3000); + dsetPS = PhaseSpace(200, 0. - 1000, 1000); + setOvsetPS = PhaseSpace(500, 0., 2.); + break; + case DQMOFFLINE: + default: + ptPS = PhaseSpace(50, 0, 200); + dptOvptPS = PhaseSpace(50, -1, 1); + dphiPS = PhaseSpace(50, -3.2, 3.2); + dptPS = PhaseSpace(50, -500, 500); + setPS = PhaseSpace(50, 0.0, 3000); + dsetPS = PhaseSpace(50, -1000.0, 1000); + setOvsetPS = PhaseSpace(100, 0., 2.); + break; } // variable bins to be done here, as they will save a lot of memory. // float ptBins[11] = {0, 1, 2, 5, 10, 20, 50, 100, 200, 400, 1000}; - delta_et_Over_et_VS_et_ = book2D( - b, "delta_et_Over_et_VS_et_", ";ME_{T, true} (GeV);#DeltaME_{T}/ME_{T}", - ptPS.n, ptPS.m, ptPS.M, dptOvptPS.n, dptOvptPS.m, dptOvptPS.M); + delta_et_Over_et_VS_et_ = book2D(b, + "delta_et_Over_et_VS_et_", + ";ME_{T, true} (GeV);#DeltaME_{T}/ME_{T}", + ptPS.n, + ptPS.m, + ptPS.M, + dptOvptPS.n, + dptOvptPS.m, + dptOvptPS.M); - delta_et_VS_et_ = - book2D(b, "delta_et_VS_et_", ";ME_{T, true} (GeV);#DeltaME_{T}", ptPS.n, - ptPS.m, ptPS.M, dptPS.n, dptPS.m, dptPS.M); + delta_et_VS_et_ = book2D( + b, "delta_et_VS_et_", ";ME_{T, true} (GeV);#DeltaME_{T}", ptPS.n, ptPS.m, ptPS.M, dptPS.n, dptPS.m, dptPS.M); - delta_phi_VS_et_ = - book2D(b, "delta_phi_VS_et_", ";ME_{T, true} (GeV);#Delta#phi", ptPS.n, - ptPS.m, ptPS.M, dphiPS.n, dphiPS.m, dphiPS.M); + delta_phi_VS_et_ = book2D( + b, "delta_phi_VS_et_", ";ME_{T, true} (GeV);#Delta#phi", ptPS.n, ptPS.m, ptPS.M, dphiPS.n, dphiPS.m, dphiPS.M); delta_ex_ = book1D(b, "delta_ex_", "#DeltaME_{X}", dptPS.n, dptPS.m, dptPS.M); - RecEt_VS_TrueEt_ = book2D(b, "RecEt_VS_TrueEt_", ";ME_{T, true} (GeV);ME_{T}", - ptPS.n, ptPS.m, ptPS.M, ptPS.n, ptPS.m, ptPS.M); - - delta_set_VS_set_ = - book2D(b, "delta_set_VS_set_", ";SE_{T, true} (GeV);#DeltaSE_{T}", - setPS.n, setPS.m, setPS.M, dsetPS.n, dsetPS.m, dsetPS.M); - - delta_set_Over_set_VS_set_ = - book2D(b, "delta_set_Over_set_VS_set_", - ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", setPS.n, setPS.m, - setPS.M, dptOvptPS.n, dptOvptPS.m, dptOvptPS.M); - - delta_ex_VS_set_ = - book2D(b, "delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", setPS.n, - setPS.m, setPS.M, ptPS.n, -ptPS.M, ptPS.M); - - RecSet_Over_TrueSet_VS_TrueSet_ = book2D( - b, "RecSet_Over_TrueSet_VS_TrueSet_", ";SE_{T, true} (GeV);SE_{T}/SE_{T}", - setPS.n, setPS.m, setPS.M, setOvsetPS.n, setOvsetPS.m, setOvsetPS.M); + RecEt_VS_TrueEt_ = + book2D(b, "RecEt_VS_TrueEt_", ";ME_{T, true} (GeV);ME_{T}", ptPS.n, ptPS.m, ptPS.M, ptPS.n, ptPS.m, ptPS.M); + + delta_set_VS_set_ = book2D(b, + "delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.n, + setPS.m, + setPS.M, + dsetPS.n, + dsetPS.m, + dsetPS.M); + + delta_set_Over_set_VS_set_ = book2D(b, + "delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.n, + setPS.m, + setPS.M, + dptOvptPS.n, + dptOvptPS.m, + dptOvptPS.M); + + delta_ex_VS_set_ = book2D( + b, "delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", setPS.n, setPS.m, setPS.M, ptPS.n, -ptPS.M, ptPS.M); + + RecSet_Over_TrueSet_VS_TrueSet_ = book2D(b, + "RecSet_Over_TrueSet_VS_TrueSet_", + ";SE_{T, true} (GeV);SE_{T}/SE_{T}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.n, + setOvsetPS.m, + setOvsetPS.M); } -void MatchMETBenchmark::fillOne(const reco::MET &cand, - const reco::MET &matchedCand) { - +void MatchMETBenchmark::fillOne(const reco::MET &cand, const reco::MET &matchedCand) { if (!isInRange(cand.pt(), cand.eta(), cand.phi())) return; if (matchedCand.pt() > 0.001) - delta_et_Over_et_VS_et_->Fill( - matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); + delta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt()); else edm::LogWarning("MatchMETBenchmark") << " matchedCand.pt()<0.001"; delta_et_VS_et_->Fill(matchedCand.pt(), cand.pt() - matchedCand.pt()); @@ -100,17 +116,13 @@ void MatchMETBenchmark::fillOne(const reco::MET &cand, delta_ex_->Fill(cand.px() - matchedCand.px()); delta_ex_->Fill(cand.py() - matchedCand.py()); RecEt_VS_TrueEt_->Fill(matchedCand.pt(), cand.pt()); - delta_set_VS_set_->Fill(matchedCand.sumEt(), - cand.sumEt() - matchedCand.sumEt()); + delta_set_VS_set_->Fill(matchedCand.sumEt(), cand.sumEt() - matchedCand.sumEt()); if (matchedCand.sumEt() > 0.001) - delta_set_Over_set_VS_set_->Fill(matchedCand.sumEt(), - (cand.sumEt() - matchedCand.sumEt()) / - matchedCand.sumEt()); + delta_set_Over_set_VS_set_->Fill(matchedCand.sumEt(), (cand.sumEt() - matchedCand.sumEt()) / matchedCand.sumEt()); else edm::LogWarning("MatchMETBenchmark") << " matchedCand.sumEt()<0.001"; delta_ex_VS_set_->Fill(matchedCand.sumEt(), cand.px() - matchedCand.px()); delta_ex_VS_set_->Fill(matchedCand.sumEt(), cand.py() - matchedCand.py()); if (matchedCand.sumEt() > 0.001) - RecSet_Over_TrueSet_VS_TrueSet_->Fill(matchedCand.sumEt(), - cand.sumEt() / matchedCand.sumEt()); + RecSet_Over_TrueSet_VS_TrueSet_->Fill(matchedCand.sumEt(), cand.sumEt() / matchedCand.sumEt()); } diff --git a/DQMOffline/PFTau/src/PFCandidateBenchmark.cc b/DQMOffline/PFTau/src/PFCandidateBenchmark.cc index 8ef0c59f4b166..689a3d1ad6501 100644 --- a/DQMOffline/PFTau/src/PFCandidateBenchmark.cc +++ b/DQMOffline/PFTau/src/PFCandidateBenchmark.cc @@ -12,44 +12,37 @@ using namespace std; PFCandidateBenchmark::~PFCandidateBenchmark() {} void PFCandidateBenchmark::setup(DQMStore::IBooker &b) { - PhaseSpace ecalEnergyPS(100, 0, 100); PhaseSpace hcalEnergyPS(100, 0, 100); PhaseSpace mva_e_piPS(100, -1, 1); switch (mode_) { - case VALIDATION: - break; - case DQMOFFLINE: - default: - ecalEnergyPS.n = 50; - hcalEnergyPS.n = 50; - mva_e_piPS.n = 50; - break; - break; + case VALIDATION: + break; + case DQMOFFLINE: + default: + ecalEnergyPS.n = 50; + hcalEnergyPS.n = 50; + mva_e_piPS.n = 50; + break; + break; } particleId_ = book1D(b, "particleId_", "particle ID", 7, 1, 8); ecalEnergy_ = - book1D(b, "ecalEnergy_", "ECAL energy, corrected;E_{ECAL} (GeV)", - ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M); + book1D(b, "ecalEnergy_", "ECAL energy, corrected;E_{ECAL} (GeV)", ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M); hcalEnergy_ = - book1D(b, "hcalEnergy_", "HCAL energy, corrected;E_{HCAL} (GeV)", - ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M); - mva_e_pi_ = book1D(b, "mva_e_pi_", "e VS #pi MVA output;MVA", mva_e_piPS.n, - mva_e_piPS.m, mva_e_piPS.M); - elementsInBlocksSize_ = - book1D(b, "elementsInBlocksSize_", "number of elements used", 10, 0, 10); + book1D(b, "hcalEnergy_", "HCAL energy, corrected;E_{HCAL} (GeV)", ecalEnergyPS.n, ecalEnergyPS.m, ecalEnergyPS.M); + mva_e_pi_ = book1D(b, "mva_e_pi_", "e VS #pi MVA output;MVA", mva_e_piPS.n, mva_e_piPS.m, mva_e_piPS.M); + elementsInBlocksSize_ = book1D(b, "elementsInBlocksSize_", "number of elements used", 10, 0, 10); } void PFCandidateBenchmark::fill(const reco::PFCandidateCollection &pfCands) { - for (unsigned i = 0; i < pfCands.size(); ++i) { fillOne(pfCands[i]); } } void PFCandidateBenchmark::fillOne(const reco::PFCandidate &pfCand) { - if (!isInRange(pfCand.pt(), pfCand.eta(), pfCand.phi())) return; diff --git a/DQMOffline/PFTau/src/PFCandidateManager.cc b/DQMOffline/PFTau/src/PFCandidateManager.cc index 276b11906eb7e..a1874fd6c0e96 100644 --- a/DQMOffline/PFTau/src/PFCandidateManager.cc +++ b/DQMOffline/PFTau/src/PFCandidateManager.cc @@ -14,7 +14,6 @@ using namespace std; PFCandidateManager::~PFCandidateManager() {} void PFCandidateManager::setDirectory(TDirectory *dir) { - Benchmark::setDirectory(dir); candBench_.setDirectory(dir); @@ -22,8 +21,7 @@ void PFCandidateManager::setDirectory(TDirectory *dir) { matchCandBench_.setDirectory(dir); } -void PFCandidateManager::setParameters(float dRMax, bool matchCharge, - Benchmark::Mode mode) { +void PFCandidateManager::setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode) { dRMax_ = dRMax; matchCharge_ = matchCharge; mode_ = mode; diff --git a/DQMOffline/PFTau/src/PFCandidateMonitor.cc b/DQMOffline/PFTau/src/PFCandidateMonitor.cc index aff7774d0809a..7d80467b446fc 100644 --- a/DQMOffline/PFTau/src/PFCandidateMonitor.cc +++ b/DQMOffline/PFTau/src/PFCandidateMonitor.cc @@ -12,11 +12,8 @@ // // -- Constructor // -PFCandidateMonitor::PFCandidateMonitor(float dRMax, bool matchCharge, - Benchmark::Mode mode) - : Benchmark(mode), candBench_(mode), matchCandBench_(mode), dRMax_(dRMax), - matchCharge_(matchCharge) { - +PFCandidateMonitor::PFCandidateMonitor(float dRMax, bool matchCharge, Benchmark::Mode mode) + : Benchmark(mode), candBench_(mode), matchCandBench_(mode), dRMax_(dRMax), matchCharge_(matchCharge) { setRange(0.0, 10e10, -10.0, 10.0, -3.14, 3.14); pt_gen_ = nullptr; @@ -42,14 +39,11 @@ PFCandidateMonitor::~PFCandidateMonitor() {} // -- Set Parameters accessing them from ParameterSet // void PFCandidateMonitor::setParameters(const edm::ParameterSet ¶meterSet) { - dRMax_ = parameterSet.getParameter("deltaRMax"); matchCharge_ = parameterSet.getParameter("matchCharge"); mode_ = (Benchmark::Mode)parameterSet.getParameter("mode"); - createReferenceHistos_ = - parameterSet.getParameter("CreateReferenceHistos"); - createEfficiencyHistos_ = - parameterSet.getParameter("CreateEfficiencyHistos"); + createReferenceHistos_ = parameterSet.getParameter("CreateReferenceHistos"); + createEfficiencyHistos_ = parameterSet.getParameter("CreateEfficiencyHistos"); setRange(parameterSet.getParameter("ptMin"), parameterSet.getParameter("ptMax"), @@ -65,10 +59,15 @@ void PFCandidateMonitor::setParameters(const edm::ParameterSet ¶meterSet) { // // -- Set Parameters // -void PFCandidateMonitor::setParameters(float dRMax, bool matchCharge, - Benchmark::Mode mode, float ptmin, - float ptmax, float etamin, float etamax, - float phimin, float phimax, +void PFCandidateMonitor::setParameters(float dRMax, + bool matchCharge, + Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, bool refHistoFlag) { dRMax_ = dRMax; matchCharge_ = matchCharge; @@ -84,29 +83,28 @@ void PFCandidateMonitor::setParameters(float dRMax, bool matchCharge, // // -- Create histograms accessing parameters from ParameterSet // -void PFCandidateMonitor::setup(DQMStore::IBooker &b, - const edm::ParameterSet ¶meterSet) { +void PFCandidateMonitor::setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet) { candBench_.setup(b, parameterSet); matchCandBench_.setup(b, parameterSet); if (createReferenceHistos_ && !histogramBooked_) { - edm::ParameterSet ptPS = - parameterSet.getParameter("PtHistoParameter"); - edm::ParameterSet etaPS = - parameterSet.getParameter("EtaHistoParameter"); - edm::ParameterSet phiPS = - parameterSet.getParameter("PhiHistoParameter"); + edm::ParameterSet ptPS = parameterSet.getParameter("PtHistoParameter"); + edm::ParameterSet etaPS = parameterSet.getParameter("EtaHistoParameter"); + edm::ParameterSet phiPS = parameterSet.getParameter("PhiHistoParameter"); - edm::ParameterSet dR = - parameterSet.getParameter("DeltaRHistoParameter"); + edm::ParameterSet dR = parameterSet.getParameter("DeltaRHistoParameter"); if (ptPS.getParameter("switchOn")) { - pt_ref_ = book1D(b, "pt_ref_", "p_{T}_ref;p_{T} (GeV)", + pt_ref_ = book1D(b, + "pt_ref_", + "p_{T}_ref;p_{T} (GeV)", ptPS.getParameter("nBin"), ptPS.getParameter("xMin"), ptPS.getParameter("xMax")); if (createEfficiencyHistos_) { - pt_gen_ = book1D(b, "pt_gen_", "p_{T}_gen;p_{T} (GeV)", + pt_gen_ = book1D(b, + "pt_gen_", + "p_{T}_gen;p_{T} (GeV)", ptPS.getParameter("nBin"), ptPS.getParameter("xMin"), ptPS.getParameter("xMax")); @@ -114,12 +112,16 @@ void PFCandidateMonitor::setup(DQMStore::IBooker &b, } if (etaPS.getParameter("switchOn")) { - eta_ref_ = book1D(b, "eta_ref_", "#eta_ref;#eta", + eta_ref_ = book1D(b, + "eta_ref_", + "#eta_ref;#eta", etaPS.getParameter("nBin"), etaPS.getParameter("xMin"), etaPS.getParameter("xMax")); if (createEfficiencyHistos_) { - eta_gen_ = book1D(b, "eta_gen_", "#eta_gen;#eta", + eta_gen_ = book1D(b, + "eta_gen_", + "#eta_gen;#eta", etaPS.getParameter("nBin"), etaPS.getParameter("xMin"), etaPS.getParameter("xMax")); @@ -127,12 +129,16 @@ void PFCandidateMonitor::setup(DQMStore::IBooker &b, } if (phiPS.getParameter("switchOn")) { - phi_ref_ = book1D(b, "phi_ref_", "#phi_ref;#phi", + phi_ref_ = book1D(b, + "phi_ref_", + "#phi_ref;#phi", phiPS.getParameter("nBin"), phiPS.getParameter("xMin"), phiPS.getParameter("xMax")); if (createEfficiencyHistos_) { - phi_gen_ = book1D(b, "phi_gen_", "#phi_gen;#phi", + phi_gen_ = book1D(b, + "phi_gen_", + "#phi_gen;#phi", phiPS.getParameter("nBin"), phiPS.getParameter("xMin"), phiPS.getParameter("xMax")); @@ -140,9 +146,12 @@ void PFCandidateMonitor::setup(DQMStore::IBooker &b, } if (createEfficiencyHistos_ && dR.getParameter("switchOn")) { - deltaR_ = book1D( - b, "deltaR_", "#DeltaR;#DeltaR", dR.getParameter("nBin"), - dR.getParameter("xMin"), dR.getParameter("xMax")); + deltaR_ = book1D(b, + "deltaR_", + "#DeltaR;#DeltaR", + dR.getParameter("nBin"), + dR.getParameter("xMin"), + dR.getParameter("xMax")); } histogramBooked_ = true; @@ -161,25 +170,19 @@ void PFCandidateMonitor::setup(DQMStore::IBooker &b) { PhaseSpace phiPS(360, -3.1416, 3.1416); PhaseSpace etaPS(100, -5, 5); - pt_ref_ = - book1D(b, "pt_ref_", "p_{T}_ref;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M); + pt_ref_ = book1D(b, "pt_ref_", "p_{T}_ref;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M); if (createEfficiencyHistos_) { - pt_gen_ = - book1D(b, "pt_gen_", "p_{T}_gen;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M); + pt_gen_ = book1D(b, "pt_gen_", "p_{T}_gen;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M); } - eta_ref_ = - book1D(b, "eta_ref_", "#eta_ref;#eta", etaPS.n, etaPS.m, etaPS.M); + eta_ref_ = book1D(b, "eta_ref_", "#eta_ref;#eta", etaPS.n, etaPS.m, etaPS.M); if (createEfficiencyHistos_) { - eta_gen_ = - book1D(b, "eta_gen_", "#eta_gen;#eta", etaPS.n, etaPS.m, etaPS.M); + eta_gen_ = book1D(b, "eta_gen_", "#eta_gen;#eta", etaPS.n, etaPS.m, etaPS.M); } - phi_ref_ = - book1D(b, "phi_ref_", "#phi_ref;#phi", phiPS.n, phiPS.m, phiPS.M); + phi_ref_ = book1D(b, "phi_ref_", "#phi_ref;#phi", phiPS.n, phiPS.m, phiPS.M); if (createEfficiencyHistos_) { - phi_gen_ = - book1D(b, "phi_gen_", "#phi_gen;#phi", phiPS.n, phiPS.m, phiPS.M); + phi_gen_ = book1D(b, "phi_gen_", "#phi_gen;#phi", phiPS.n, phiPS.m, phiPS.M); } histogramBooked_ = true; @@ -200,7 +203,6 @@ void PFCandidateMonitor::setDirectory(TDirectory *dir) { // -- fill histograms for a single collection // void PFCandidateMonitor::fillOne(const reco::Candidate &cand) { - if (matching_done_) { if (createReferenceHistos_ && histogramBooked_) { if (pt_ref_) diff --git a/DQMOffline/PFTau/src/PFJetMonitor.cc b/DQMOffline/PFTau/src/PFJetMonitor.cc index d0a9df071dda6..b94bec358cda1 100644 --- a/DQMOffline/PFTau/src/PFJetMonitor.cc +++ b/DQMOffline/PFTau/src/PFJetMonitor.cc @@ -13,9 +13,7 @@ // -- Constructor // PFJetMonitor::PFJetMonitor(float dRMax, bool matchCharge, Benchmark::Mode mode) - : Benchmark(mode), candBench_(mode), matchCandBench_(mode), dRMax_(dRMax), - matchCharge_(matchCharge) { - + : Benchmark(mode), candBench_(mode), matchCandBench_(mode), dRMax_(dRMax), matchCharge_(matchCharge) { setRange(0.0, 10e10, -10.0, 10.0, -3.14, 3.14); delta_frac_VS_frac_muon_ = nullptr; @@ -39,13 +37,11 @@ PFJetMonitor::~PFJetMonitor() {} // -- Set Parameters accessing them from ParameterSet // void PFJetMonitor::setParameters(const edm::ParameterSet ¶meterSet) { - dRMax_ = parameterSet.getParameter("deltaRMax"); onlyTwoJets_ = parameterSet.getParameter("onlyTwoJets"); matchCharge_ = parameterSet.getParameter("matchCharge"); mode_ = (Benchmark::Mode)parameterSet.getParameter("mode"); - createPFractionHistos_ = - parameterSet.getParameter("CreatePFractionHistos"); + createPFractionHistos_ = parameterSet.getParameter("CreatePFractionHistos"); setRange(parameterSet.getParameter("ptMin"), parameterSet.getParameter("ptMax"), @@ -61,10 +57,16 @@ void PFJetMonitor::setParameters(const edm::ParameterSet ¶meterSet) { // // -- Set Parameters // -void PFJetMonitor::setParameters(float dRMax, bool matchCharge, - Benchmark::Mode mode, float ptmin, float ptmax, - float etamin, float etamax, float phimin, - float phimax, bool fracHistoFlag) { +void PFJetMonitor::setParameters(float dRMax, + bool matchCharge, + Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, + bool fracHistoFlag) { dRMax_ = dRMax; matchCharge_ = matchCharge; mode_ = mode; @@ -76,10 +78,16 @@ void PFJetMonitor::setParameters(float dRMax, bool matchCharge, matchCandBench_.setParameters(mode_); } -void PFJetMonitor::setParameters(float dRMax, bool onlyTwoJets, - bool matchCharge, Benchmark::Mode mode, - float ptmin, float ptmax, float etamin, - float etamax, float phimin, float phimax, +void PFJetMonitor::setParameters(float dRMax, + bool onlyTwoJets, + bool matchCharge, + Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, bool fracHistoFlag) { dRMax_ = dRMax; onlyTwoJets_ = onlyTwoJets; @@ -96,36 +104,44 @@ void PFJetMonitor::setParameters(float dRMax, bool onlyTwoJets, // // -- Create histograms accessing parameters from ParameterSet // -void PFJetMonitor::setup(DQMStore::IBooker &b, - const edm::ParameterSet ¶meterSet) { +void PFJetMonitor::setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet) { candBench_.setup(b, parameterSet); matchCandBench_.setup(b, parameterSet); - edm::ParameterSet dR = - parameterSet.getParameter("DeltaRHistoParameter"); + edm::ParameterSet dR = parameterSet.getParameter("DeltaRHistoParameter"); if (dR.getParameter("switchOn")) { - deltaR_ = book1D( - b, "deltaR_", "#DeltaR;#DeltaR", dR.getParameter("nBin"), - dR.getParameter("xMin"), dR.getParameter("xMax")); + deltaR_ = book1D(b, + "deltaR_", + "#DeltaR;#DeltaR", + dR.getParameter("nBin"), + dR.getParameter("xMin"), + dR.getParameter("xMax")); } if (createPFractionHistos_ && !histogramBooked_) { - delta_frac_VS_frac_muon_ = book2D(b, "delta_frac_VS_frac_muon_", - "#DeltaFraction_Vs_Fraction(muon)", 100, - 0.0, 1.0, 100, -1.0, 1.0); - delta_frac_VS_frac_photon_ = book2D(b, "delta_frac_VS_frac_photon_", - "#DeltaFraction_Vs_Fraction(photon)", - 100, 0.0, 1.0, 100, -1.0, 1.0); + delta_frac_VS_frac_muon_ = + book2D(b, "delta_frac_VS_frac_muon_", "#DeltaFraction_Vs_Fraction(muon)", 100, 0.0, 1.0, 100, -1.0, 1.0); + delta_frac_VS_frac_photon_ = + book2D(b, "delta_frac_VS_frac_photon_", "#DeltaFraction_Vs_Fraction(photon)", 100, 0.0, 1.0, 100, -1.0, 1.0); delta_frac_VS_frac_electron_ = book2D( - b, "delta_frac_VS_frac_electron_", - "#DeltaFraction_Vs_Fraction(electron)", 100, 0.0, 1.0, 100, -1.0, 1.0); - delta_frac_VS_frac_charged_hadron_ = - book2D(b, "delta_frac_VS_frac_charged_hadron_", - "#DeltaFraction_Vs_Fraction(charged hadron)", 100, 0.0, 1.0, 100, - -1.0, 1.0); - delta_frac_VS_frac_neutral_hadron_ = - book2D(b, "delta_frac_VS_frac_neutral_hadron_", - "#DeltaFraction_Vs_Fraction(neutral hadron)", 100, 0.0, 1.0, 100, - -1.0, 1.0); + b, "delta_frac_VS_frac_electron_", "#DeltaFraction_Vs_Fraction(electron)", 100, 0.0, 1.0, 100, -1.0, 1.0); + delta_frac_VS_frac_charged_hadron_ = book2D(b, + "delta_frac_VS_frac_charged_hadron_", + "#DeltaFraction_Vs_Fraction(charged hadron)", + 100, + 0.0, + 1.0, + 100, + -1.0, + 1.0); + delta_frac_VS_frac_neutral_hadron_ = book2D(b, + "delta_frac_VS_frac_neutral_hadron_", + "#DeltaFraction_Vs_Fraction(neutral hadron)", + 100, + 0.0, + 1.0, + 100, + -1.0, + 1.0); histogramBooked_ = true; } @@ -139,23 +155,30 @@ void PFJetMonitor::setup(DQMStore::IBooker &b) { matchCandBench_.setup(b); if (createPFractionHistos_ && !histogramBooked_) { - delta_frac_VS_frac_muon_ = book2D(b, "delta_frac_VS_frac_muon_", - "#DeltaFraction_Vs_Fraction(muon)", 100, - 0.0, 1.0, 100, -1.0, 1.0); - delta_frac_VS_frac_photon_ = book2D(b, "delta_frac_VS_frac_photon_", - "#DeltaFraction_Vs_Fraction(photon)", - 100, 0.0, 1.0, 100, -1.0, 1.0); + delta_frac_VS_frac_muon_ = + book2D(b, "delta_frac_VS_frac_muon_", "#DeltaFraction_Vs_Fraction(muon)", 100, 0.0, 1.0, 100, -1.0, 1.0); + delta_frac_VS_frac_photon_ = + book2D(b, "delta_frac_VS_frac_photon_", "#DeltaFraction_Vs_Fraction(photon)", 100, 0.0, 1.0, 100, -1.0, 1.0); delta_frac_VS_frac_electron_ = book2D( - b, "delta_frac_VS_frac_electron_", - "#DeltaFraction_Vs_Fraction(electron)", 100, 0.0, 1.0, 100, -1.0, 1.0); - delta_frac_VS_frac_charged_hadron_ = - book2D(b, "delta_frac_VS_frac_charged_hadron_", - "#DeltaFraction_Vs_Fraction(charged hadron)", 100, 0.0, 1.0, 100, - -1.0, 1.0); - delta_frac_VS_frac_neutral_hadron_ = - book2D(b, "delta_frac_VS_frac_neutral_hadron_", - "#DeltaFraction_Vs_Fraction(neutral hadron)", 100, 0.0, 1.0, 100, - -1.0, 1.0); + b, "delta_frac_VS_frac_electron_", "#DeltaFraction_Vs_Fraction(electron)", 100, 0.0, 1.0, 100, -1.0, 1.0); + delta_frac_VS_frac_charged_hadron_ = book2D(b, + "delta_frac_VS_frac_charged_hadron_", + "#DeltaFraction_Vs_Fraction(charged hadron)", + 100, + 0.0, + 1.0, + 100, + -1.0, + 1.0); + delta_frac_VS_frac_neutral_hadron_ = book2D(b, + "delta_frac_VS_frac_neutral_hadron_", + "#DeltaFraction_Vs_Fraction(neutral hadron)", + 100, + 0.0, + 1.0, + 100, + -1.0, + 1.0); histogramBooked_ = true; } @@ -176,10 +199,8 @@ void PFJetMonitor::setDirectory(TDirectory *dir) { // -- fill histograms for a given Jet pair // void PFJetMonitor::fillOne(const reco::Jet &jet, const reco::Jet &matchedJet) { - const reco::PFJet *pfJet = dynamic_cast(&jet); - const reco::PFJet *pfMatchedJet = - dynamic_cast(&matchedJet); + const reco::PFJet *pfMatchedJet = dynamic_cast(&matchedJet); if (pfJet && pfMatchedJet && createPFractionHistos_) { float del_frac_muon = -99.9; float del_frac_elec = -99.9; @@ -196,17 +217,13 @@ void PFJetMonitor::fillOne(const reco::Jet &jet, const reco::Jet &matchedJet) { if (mult_muon > 0) del_frac_muon = (pfJet->muonMultiplicity() - mult_muon) * 1.0 / mult_muon; if (mult_elec > 0) - del_frac_elec = - (pfJet->electronMultiplicity() - mult_elec) * 1.0 / mult_elec; + del_frac_elec = (pfJet->electronMultiplicity() - mult_elec) * 1.0 / mult_elec; if (mult_phot > 0) - del_frac_phot = - (pfJet->photonMultiplicity() - mult_phot) * 1.0 / mult_phot; + del_frac_phot = (pfJet->photonMultiplicity() - mult_phot) * 1.0 / mult_phot; if (mult_ch_had > 0) - del_frac_ch_had = (pfJet->chargedHadronMultiplicity() - mult_ch_had) * - 1.0 / mult_ch_had; + del_frac_ch_had = (pfJet->chargedHadronMultiplicity() - mult_ch_had) * 1.0 / mult_ch_had; if (mult_neu_had > 0) - del_frac_neu_had = (pfJet->neutralHadronMultiplicity() - mult_neu_had) * - 1.0 / mult_neu_had; + del_frac_neu_had = (pfJet->neutralHadronMultiplicity() - mult_neu_had) * 1.0 / mult_neu_had; delta_frac_VS_frac_muon_->Fill(mult_muon, del_frac_muon); delta_frac_VS_frac_electron_->Fill(mult_elec, del_frac_elec); diff --git a/DQMOffline/PFTau/src/PFMETMonitor.cc b/DQMOffline/PFTau/src/PFMETMonitor.cc index 51dbb2074bb2e..f06ce95e66c4f 100644 --- a/DQMOffline/PFTau/src/PFMETMonitor.cc +++ b/DQMOffline/PFTau/src/PFMETMonitor.cc @@ -14,9 +14,7 @@ // // -- Constructor // -PFMETMonitor::PFMETMonitor(Benchmark::Mode mode) - : Benchmark(mode), candBench_(mode), matchCandBench_(mode) { - +PFMETMonitor::PFMETMonitor(Benchmark::Mode mode) : Benchmark(mode), candBench_(mode), matchCandBench_(mode) { setRange(0.0, 10e10, -10.0, 10.0, -3.14, 3.14); px_ = nullptr; @@ -46,10 +44,8 @@ PFMETMonitor::~PFMETMonitor() {} // -- Set Parameters accessing them from ParameterSet // void PFMETMonitor::setParameters(const edm::ParameterSet ¶meterSet) { - mode_ = (Benchmark::Mode)parameterSet.getParameter("mode"); - createMETSpecificHistos_ = - parameterSet.getParameter("CreateMETSpecificHistos"); + createMETSpecificHistos_ = parameterSet.getParameter("CreateMETSpecificHistos"); setRange(parameterSet.getParameter("ptMin"), parameterSet.getParameter("ptMax"), parameterSet.getParameter("etaMin"), @@ -64,9 +60,14 @@ void PFMETMonitor::setParameters(const edm::ParameterSet ¶meterSet) { // // -- Set Parameters // -void PFMETMonitor::setParameters(Benchmark::Mode mode, float ptmin, float ptmax, - float etamin, float etamax, float phimin, - float phimax, bool metSpHistos) { +void PFMETMonitor::setParameters(Benchmark::Mode mode, + float ptmin, + float ptmax, + float etamin, + float etamax, + float phimin, + float phimax, + bool metSpHistos) { mode_ = mode; createMETSpecificHistos_ = metSpHistos; @@ -79,126 +80,137 @@ void PFMETMonitor::setParameters(Benchmark::Mode mode, float ptmin, float ptmax, // // -- Create histograms accessing parameters from ParameterSet // -void PFMETMonitor::setup(DQMStore::IBooker &b, - const edm::ParameterSet ¶meterSet) { +void PFMETMonitor::setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet) { candBench_.setup(b, parameterSet); matchCandBench_.setup(b, parameterSet); if (createMETSpecificHistos_ && !histogramBooked_) { - - edm::ParameterSet pxPS = - parameterSet.getParameter("DeltaPxHistoParameter"); - edm::ParameterSet dpxPS = - parameterSet.getParameter("DeltaPxHistoParameter"); - edm::ParameterSet dptPS = - parameterSet.getParameter("DeltaPtHistoParameter"); - edm::ParameterSet setPS = - parameterSet.getParameter("SumEtHistoParameter"); - edm::ParameterSet dsetPS = parameterSet.getParameter( - "DeltaSumEtHistoParameter"); - edm::ParameterSet setOvsetPS = parameterSet.getParameter( - "DeltaSumEtOvSumEtHistoParameter"); + edm::ParameterSet pxPS = parameterSet.getParameter("DeltaPxHistoParameter"); + edm::ParameterSet dpxPS = parameterSet.getParameter("DeltaPxHistoParameter"); + edm::ParameterSet dptPS = parameterSet.getParameter("DeltaPtHistoParameter"); + edm::ParameterSet setPS = parameterSet.getParameter("SumEtHistoParameter"); + edm::ParameterSet dsetPS = parameterSet.getParameter("DeltaSumEtHistoParameter"); + edm::ParameterSet setOvsetPS = parameterSet.getParameter("DeltaSumEtOvSumEtHistoParameter"); if (pxPS.getParameter("switchOn")) { - px_ = book1D( - b, "px_", "px_;p_{X} (GeV)", pxPS.getParameter("nBin"), - pxPS.getParameter("xMin"), pxPS.getParameter("xMax")); + px_ = book1D(b, + "px_", + "px_;p_{X} (GeV)", + pxPS.getParameter("nBin"), + pxPS.getParameter("xMin"), + pxPS.getParameter("xMax")); } if (setPS.getParameter("switchOn")) { - sumEt_ = book1D(b, "sumEt_", "sumEt_;#sumE_{T}", + sumEt_ = book1D(b, + "sumEt_", + "sumEt_;#sumE_{T}", setPS.getParameter("nBin"), setPS.getParameter("xMin"), setPS.getParameter("xMax")); } if (dpxPS.getParameter("switchOn")) { - delta_ex_ = book1D(b, "delta_ex_", "#DeltaME_{X}", + delta_ex_ = book1D(b, + "delta_ex_", + "#DeltaME_{X}", dpxPS.getParameter("nBin"), dpxPS.getParameter("xMin"), dpxPS.getParameter("xMax")); } if (dpxPS.getParameter("switchOn")) { - delta_ex_VS_set_ = - book2D(b, "delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - dptPS.getParameter("nBin"), - dptPS.getParameter("xMin"), - dptPS.getParameter("xMax")); + delta_ex_VS_set_ = book2D(b, + "delta_ex_VS_set_", + ";SE_{T, true} (GeV);#DeltaE_{X}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + dptPS.getParameter("nBin"), + dptPS.getParameter("xMin"), + dptPS.getParameter("xMax")); } if (dsetPS.getParameter("switchOn")) { - delta_set_VS_set_ = - book2D(b, "delta_set_VS_set_", ";SE_{T, true} (GeV);#DeltaSE_{T}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - dsetPS.getParameter("nBin"), - dsetPS.getParameter("xMin"), - dsetPS.getParameter("xMax")); + delta_set_VS_set_ = book2D(b, + "delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + dsetPS.getParameter("nBin"), + dsetPS.getParameter("xMin"), + dsetPS.getParameter("xMax")); } if (setOvsetPS.getParameter("switchOn")) { - delta_set_Over_set_VS_set_ = - book2D(b, "delta_set_Over_set_VS_set_", - ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - setOvsetPS.getParameter("nBin"), - setOvsetPS.getParameter("xMin"), - setOvsetPS.getParameter("xMax")); + delta_set_Over_set_VS_set_ = book2D(b, + "delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + setOvsetPS.getParameter("nBin"), + setOvsetPS.getParameter("xMin"), + setOvsetPS.getParameter("xMax")); } // TProfile if (dpxPS.getParameter("switchOn")) { - profile_delta_ex_VS_set_ = bookProfile( - b, "profile_delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - dptPS.getParameter("xMin"), - dptPS.getParameter("xMax"), ""); - profileRMS_delta_ex_VS_set_ = bookProfile( - b, "profileRMS_delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - dptPS.getParameter("xMin"), - dptPS.getParameter("xMax"), "s"); + profile_delta_ex_VS_set_ = bookProfile(b, + "profile_delta_ex_VS_set_", + ";SE_{T, true} (GeV);#DeltaE_{X}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + dptPS.getParameter("xMin"), + dptPS.getParameter("xMax"), + ""); + profileRMS_delta_ex_VS_set_ = bookProfile(b, + "profileRMS_delta_ex_VS_set_", + ";SE_{T, true} (GeV);#DeltaE_{X}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + dptPS.getParameter("xMin"), + dptPS.getParameter("xMax"), + "s"); } if (dsetPS.getParameter("switchOn")) { - profile_delta_set_VS_set_ = bookProfile( - b, "profile_delta_set_VS_set_", ";SE_{T, true} (GeV);#DeltaSE_{T}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - dsetPS.getParameter("xMin"), - dsetPS.getParameter("xMax"), ""); - profileRMS_delta_set_VS_set_ = bookProfile( - b, "profileRMS_delta_set_VS_set_", ";SE_{T, true} (GeV);#DeltaSE_{T}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - dsetPS.getParameter("xMin"), - dsetPS.getParameter("xMax"), "s"); + profile_delta_set_VS_set_ = bookProfile(b, + "profile_delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + dsetPS.getParameter("xMin"), + dsetPS.getParameter("xMax"), + ""); + profileRMS_delta_set_VS_set_ = bookProfile(b, + "profileRMS_delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + dsetPS.getParameter("xMin"), + dsetPS.getParameter("xMax"), + "s"); } if (setOvsetPS.getParameter("switchOn")) { - profile_delta_set_Over_set_VS_set_ = - bookProfile(b, "profile_delta_set_Over_set_VS_set_", - ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - setOvsetPS.getParameter("xMin"), - setOvsetPS.getParameter("xMax"), ""); - profileRMS_delta_set_Over_set_VS_set_ = - bookProfile(b, "profileRMS_delta_set_Over_set_VS_set_", - ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", - setPS.getParameter("nBin"), - setPS.getParameter("xMin"), - setPS.getParameter("xMax"), - setOvsetPS.getParameter("xMin"), - setOvsetPS.getParameter("xMax"), "s"); + profile_delta_set_Over_set_VS_set_ = bookProfile(b, + "profile_delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + setOvsetPS.getParameter("xMin"), + setOvsetPS.getParameter("xMax"), + ""); + profileRMS_delta_set_Over_set_VS_set_ = bookProfile(b, + "profileRMS_delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.getParameter("nBin"), + setPS.getParameter("xMin"), + setPS.getParameter("xMax"), + setOvsetPS.getParameter("xMin"), + setOvsetPS.getParameter("xMax"), + "s"); } histogramBooked_ = true; } @@ -212,7 +224,6 @@ void PFMETMonitor::setup(DQMStore::IBooker &b) { matchCandBench_.setup(b); if (createMETSpecificHistos_ && !histogramBooked_) { - PhaseSpace pxPS = PhaseSpace(50, 0, 200); PhaseSpace dpxPS = PhaseSpace(50, -500, 500); PhaseSpace setPS = PhaseSpace(50, 0.0, 3000); @@ -221,47 +232,90 @@ void PFMETMonitor::setup(DQMStore::IBooker &b) { px_ = book1D(b, "px_", "px_;p_{X} (GeV)", pxPS.n, pxPS.m, pxPS.M); sumEt_ = book1D(b, "sumEt_", "sumEt_;#sumE_{T}", setPS.n, setPS.m, setPS.M); - delta_ex_ = - book1D(b, "delta_ex_", "#DeltaME_{X}", dpxPS.n, dpxPS.m, dpxPS.M); - delta_ex_VS_set_ = - book2D(b, "delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", - setPS.n, setPS.m, setPS.M, dpxPS.n, dpxPS.m, dpxPS.M); - delta_set_VS_set_ = - book2D(b, "delta_set_VS_set_", ";SE_{T, true} (GeV);#DeltaSE_{T}", - setPS.n, setPS.m, setPS.M, dsetPS.n, dsetPS.m, dsetPS.M); - - delta_set_Over_set_VS_set_ = - book2D(b, "delta_set_Over_set_VS_set_", - ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", setPS.n, setPS.m, - setPS.M, setOvsetPS.n, setOvsetPS.m, setOvsetPS.M); + delta_ex_ = book1D(b, "delta_ex_", "#DeltaME_{X}", dpxPS.n, dpxPS.m, dpxPS.M); + delta_ex_VS_set_ = book2D( + b, "delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", setPS.n, setPS.m, setPS.M, dpxPS.n, dpxPS.m, dpxPS.M); + delta_set_VS_set_ = book2D(b, + "delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.n, + setPS.m, + setPS.M, + dsetPS.n, + dsetPS.m, + dsetPS.M); + + delta_set_Over_set_VS_set_ = book2D(b, + "delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.n, + setOvsetPS.m, + setOvsetPS.M); // TProfile - profile_delta_ex_VS_set_ = bookProfile( - b, "profile_delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", - setPS.n, setPS.m, setPS.M, setOvsetPS.m, setOvsetPS.M, ""); - - profile_delta_set_VS_set_ = bookProfile( - b, "profile_delta_set_VS_set_", ";SE_{T, true} (GeV);#DeltaSE_{T}", - setPS.n, setPS.m, setPS.M, setOvsetPS.m, setOvsetPS.M, ""); - - profile_delta_set_Over_set_VS_set_ = - bookProfile(b, "profile_delta_set_Over_set_VS_set_", - ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", setPS.n, setPS.m, - setPS.M, setOvsetPS.m, setOvsetPS.M, ""); + profile_delta_ex_VS_set_ = bookProfile(b, + "profile_delta_ex_VS_set_", + ";SE_{T, true} (GeV);#DeltaE_{X}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.m, + setOvsetPS.M, + ""); + + profile_delta_set_VS_set_ = bookProfile(b, + "profile_delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.m, + setOvsetPS.M, + ""); + + profile_delta_set_Over_set_VS_set_ = bookProfile(b, + "profile_delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.m, + setOvsetPS.M, + ""); // TProfile RMS - profileRMS_delta_ex_VS_set_ = bookProfile( - b, "profileRMS_delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", - setPS.n, setPS.m, setPS.M, setOvsetPS.m, setOvsetPS.M, "s"); - - profileRMS_delta_set_VS_set_ = bookProfile( - b, "profileRMS_delta_set_VS_set_", ";SE_{T, true} (GeV);#DeltaSE_{T}", - setPS.n, setPS.m, setPS.M, setOvsetPS.m, setOvsetPS.M, "s"); - - profileRMS_delta_set_Over_set_VS_set_ = - bookProfile(b, "profileRMS_delta_set_Over_set_VS_set_", - ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", setPS.n, setPS.m, - setPS.M, setOvsetPS.m, setOvsetPS.M, "s"); + profileRMS_delta_ex_VS_set_ = bookProfile(b, + "profileRMS_delta_ex_VS_set_", + ";SE_{T, true} (GeV);#DeltaE_{X}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.m, + setOvsetPS.M, + "s"); + + profileRMS_delta_set_VS_set_ = bookProfile(b, + "profileRMS_delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.m, + setOvsetPS.M, + "s"); + + profileRMS_delta_set_Over_set_VS_set_ = bookProfile(b, + "profileRMS_delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.n, + setPS.m, + setPS.M, + setOvsetPS.m, + setOvsetPS.M, + "s"); histogramBooked_ = true; } } @@ -273,12 +327,10 @@ void PFMETMonitor::setDirectory(TDirectory *dir) { matchCandBench_.setDirectory(dir); } -void PFMETMonitor::fillOne(const reco::MET &met, const reco::MET &matchedMet, - float &minVal, float &maxVal) { - - candBench_.fillOne(met); // std::cout <<"\nfillone MET candBench" <Fill(matchedMet.sumEt(), met.px() - matchedMet.px()); delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.py() - matchedMet.py()); - profile_delta_ex_VS_set_->Fill(matchedMet.sumEt(), - met.px() - matchedMet.px()); - profile_delta_ex_VS_set_->Fill(matchedMet.sumEt(), - met.py() - matchedMet.py()); - profileRMS_delta_ex_VS_set_->Fill(matchedMet.sumEt(), - met.px() - matchedMet.px()); - profileRMS_delta_ex_VS_set_->Fill(matchedMet.sumEt(), - met.py() - matchedMet.py()); + profile_delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.px() - matchedMet.px()); + profile_delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.py() - matchedMet.py()); + profileRMS_delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.px() - matchedMet.px()); + profileRMS_delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.py() - matchedMet.py()); } if (delta_set_VS_set_) { - delta_set_VS_set_->Fill(matchedMet.sumEt(), - met.sumEt() - matchedMet.sumEt()); - profile_delta_set_VS_set_->Fill(matchedMet.sumEt(), - met.sumEt() - matchedMet.sumEt()); - profileRMS_delta_set_VS_set_->Fill(matchedMet.sumEt(), - met.sumEt() - matchedMet.sumEt()); + delta_set_VS_set_->Fill(matchedMet.sumEt(), met.sumEt() - matchedMet.sumEt()); + profile_delta_set_VS_set_->Fill(matchedMet.sumEt(), met.sumEt() - matchedMet.sumEt()); + profileRMS_delta_set_VS_set_->Fill(matchedMet.sumEt(), met.sumEt() - matchedMet.sumEt()); } if (delta_set_Over_set_VS_set_ && matchedMet.sumEt() > 0.001) { float setRes = (met.sumEt() - matchedMet.sumEt()) / matchedMet.sumEt(); diff --git a/DQMServices/Diagnostic/interface/HDQMInspectorConfigBase.h b/DQMServices/Diagnostic/interface/HDQMInspectorConfigBase.h index 5737170597caf..71bb09da18ba8 100644 --- a/DQMServices/Diagnostic/interface/HDQMInspectorConfigBase.h +++ b/DQMServices/Diagnostic/interface/HDQMInspectorConfigBase.h @@ -34,20 +34,15 @@ class HDQMInspectorConfigBase { virtual ~HDQMInspectorConfigBase(){}; /// fills a vector > associating values with the /// corresponding errors - virtual bool valueErrorMap(std::vector> - &valueErrorVector) const { - return false; - } + virtual bool valueErrorMap(std::vector> &valueErrorVector) const { return false; } /// fills the list of names of quantities for which a summation over the runs /// is required - virtual bool - computeIntegralList(const std::vector &computeIntegralVector) { + virtual bool computeIntegralList(const std::vector &computeIntegralVector) { fComputeIntegral = computeIntegralVector; return true; } bool computeIntegral(const std::string &in) const { - if (std::find(fComputeIntegral.begin(), fComputeIntegral.end(), in) != - fComputeIntegral.end()) { + if (std::find(fComputeIntegral.begin(), fComputeIntegral.end(), in) != fComputeIntegral.end()) { return true; } return false; @@ -57,9 +52,7 @@ class HDQMInspectorConfigBase { // Return the error name for a quantity name given. This is designed to be // used for the "user" input quantities - for (std::map::const_iterator It = - fErrorMap.begin(); - It != fErrorMap.end(); ++It) { + for (std::map::const_iterator It = fErrorMap.begin(); It != fErrorMap.end(); ++It) { if (QuantityName.find(It->first) != std::string::npos) { return It->second; } diff --git a/DQMServices/Diagnostic/interface/HDQMfitUtilities.h b/DQMServices/Diagnostic/interface/HDQMfitUtilities.h index 9344015a5d24b..29d2a095ed812 100644 --- a/DQMServices/Diagnostic/interface/HDQMfitUtilities.h +++ b/DQMServices/Diagnostic/interface/HDQMfitUtilities.h @@ -20,21 +20,18 @@ */ namespace HDQMUtil { -double langaufun(double *x, double *par); -int32_t langaupro(double *params, double &maxx, double &FWHM); -double Gauss(double *x, double *par); -} // namespace HDQMUtil + double langaufun(double *x, double *par); + int32_t langaupro(double *params, double &maxx, double &FWHM); + double Gauss(double *x, double *par); +} // namespace HDQMUtil class HDQMfitUtilities { - public: HDQMfitUtilities(); ~HDQMfitUtilities(); void init(); - double doLanGaussFit(MonitorElement *ME) { - return doLanGaussFit(ME->getTH1F()); - } + double doLanGaussFit(MonitorElement *ME) { return doLanGaussFit(ME->getTH1F()); } double doLanGaussFit(TH1F *); double doGaussFit(MonitorElement *ME) { return doGaussFit(ME->getTH1F()); } @@ -60,4 +57,4 @@ class HDQMfitUtilities { TF1 *gausFit; }; -#endif // DQM_SiStripHistoricInfoClient_HDQMfitUtilities_H +#endif // DQM_SiStripHistoricInfoClient_HDQMfitUtilities_H diff --git a/DQMServices/Diagnostic/src/HDQMfitUtilities.cc b/DQMServices/Diagnostic/src/HDQMfitUtilities.cc index de82901c29e52..f41a509b25994 100644 --- a/DQMServices/Diagnostic/src/HDQMfitUtilities.cc +++ b/DQMServices/Diagnostic/src/HDQMfitUtilities.cc @@ -1,178 +1,176 @@ #include "DQMServices/Diagnostic/interface/HDQMfitUtilities.h" namespace HDQMUtil { -//----------------------------------------------------------------------------------------------- -double langaufun(double *x, double *par) { - // Fit parameters: - // par[0]=Width (scale) parameter of Landau density - // par[1]=Most Probable (MP, location) parameter of Landau density - // par[2]=Total area (integral -inf to inf, normalization constant) - // par[3]=Width (sigma) of convoluted Gaussian function - // - // In the Landau distribution (represented by the CERNLIB approximation), - // the maximum is located at x=-0.22278298 with the location parameter=0. - // This shift is corrected within this function, so that the actual - // maximum is identical to the MP parameter. - - // Numeric constants - double invsq2pi = 0.3989422804014; // (2 pi)^(-1/2) - double mpshift = -0.22278298; // Landau maximum location - - // Control constants - double np = 100.0; // number of convolution steps - double sc = 5.0; // convolution extends to +-sc Gaussian sigmas - - // Variables - double xx; - double mpc; - double fland; - double sum = 0.0; - double xlow, xupp; - double step; - double i; - - // MP shift correction - mpc = par[1] - mpshift * par[0]; - - // Range of convolution integral - xlow = x[0] - sc * par[3]; - xupp = x[0] + sc * par[3]; - - step = (xupp - xlow) / np; - - // Landau Distribution Production - for (i = 1.0; i <= np / 2; i++) { - xx = xlow + (i - .5) * step; - fland = TMath::Landau(xx, mpc, par[0]) / par[0]; - sum += fland * TMath::Gaus(x[0], xx, par[3]); - - xx = xupp - (i - .5) * step; - fland = TMath::Landau(xx, mpc, par[0]) / par[0]; - sum += fland * TMath::Gaus(x[0], xx, par[3]); - } - - return (par[2] * step * sum * invsq2pi / par[3]); -} + //----------------------------------------------------------------------------------------------- + double langaufun(double *x, double *par) { + // Fit parameters: + // par[0]=Width (scale) parameter of Landau density + // par[1]=Most Probable (MP, location) parameter of Landau density + // par[2]=Total area (integral -inf to inf, normalization constant) + // par[3]=Width (sigma) of convoluted Gaussian function + // + // In the Landau distribution (represented by the CERNLIB approximation), + // the maximum is located at x=-0.22278298 with the location parameter=0. + // This shift is corrected within this function, so that the actual + // maximum is identical to the MP parameter. + + // Numeric constants + double invsq2pi = 0.3989422804014; // (2 pi)^(-1/2) + double mpshift = -0.22278298; // Landau maximum location + + // Control constants + double np = 100.0; // number of convolution steps + double sc = 5.0; // convolution extends to +-sc Gaussian sigmas + + // Variables + double xx; + double mpc; + double fland; + double sum = 0.0; + double xlow, xupp; + double step; + double i; + + // MP shift correction + mpc = par[1] - mpshift * par[0]; + + // Range of convolution integral + xlow = x[0] - sc * par[3]; + xupp = x[0] + sc * par[3]; + + step = (xupp - xlow) / np; + + // Landau Distribution Production + for (i = 1.0; i <= np / 2; i++) { + xx = xlow + (i - .5) * step; + fland = TMath::Landau(xx, mpc, par[0]) / par[0]; + sum += fland * TMath::Gaus(x[0], xx, par[3]); + + xx = xupp - (i - .5) * step; + fland = TMath::Landau(xx, mpc, par[0]) / par[0]; + sum += fland * TMath::Gaus(x[0], xx, par[3]); + } -//----------------------------------------------------------------------------------------------- -int32_t langaupro(double *params, double &maxx, double &FWHM) { - edm::LogInfo("fitUtility") << "inside langaupro " << std::endl; - // Seaches for the location (x value) at the maximum of the - // Landau and its full width at half-maximum. - // - // The search is probably not very efficient, but it's a first try. - - double p, x, fy, fxr, fxl; - double step; - double l, lold, dl; - int32_t i = 0; - const int32_t MAXCALLS = 10000; - const double dlStop = 1e-3; // relative change < .001 - - // Search for maximum - p = params[1] - 0.1 * params[0]; - step = 0.05 * params[0]; - lold = -2.0; - l = -1.0; - - dl = (l - lold) / lold; // FIXME catch divide by zero - while ((TMath::Abs(dl) > dlStop) && (i < MAXCALLS)) { - i++; - - lold = l; - x = p + step; - l = langaufun(&x, params); - dl = (l - lold) / lold; // FIXME catch divide by zero - - if (l < lold) - step = -step / 10; - - p += step; + return (par[2] * step * sum * invsq2pi / par[3]); } - if (i == MAXCALLS) - return (-1); + //----------------------------------------------------------------------------------------------- + int32_t langaupro(double *params, double &maxx, double &FWHM) { + edm::LogInfo("fitUtility") << "inside langaupro " << std::endl; + // Seaches for the location (x value) at the maximum of the + // Landau and its full width at half-maximum. + // + // The search is probably not very efficient, but it's a first try. + + double p, x, fy, fxr, fxl; + double step; + double l, lold, dl; + int32_t i = 0; + const int32_t MAXCALLS = 10000; + const double dlStop = 1e-3; // relative change < .001 + + // Search for maximum + p = params[1] - 0.1 * params[0]; + step = 0.05 * params[0]; + lold = -2.0; + l = -1.0; + + dl = (l - lold) / lold; // FIXME catch divide by zero + while ((TMath::Abs(dl) > dlStop) && (i < MAXCALLS)) { + i++; + + lold = l; + x = p + step; + l = langaufun(&x, params); + dl = (l - lold) / lold; // FIXME catch divide by zero + + if (l < lold) + step = -step / 10; + + p += step; + } - maxx = x; + if (i == MAXCALLS) + return (-1); - fy = l / 2; + maxx = x; - // Search for right x location of fy - p = maxx + params[0]; - step = params[0]; - lold = -2.0; - l = -1e300; - i = 0; + fy = l / 2; - dl = (l - lold) / lold; // FIXME catch divide by zero - while ((TMath::Abs(dl) > dlStop) && (i < MAXCALLS)) { - i++; + // Search for right x location of fy + p = maxx + params[0]; + step = params[0]; + lold = -2.0; + l = -1e300; + i = 0; - lold = l; - x = p + step; - l = TMath::Abs(langaufun(&x, params) - fy); - dl = (l - lold) / lold; // FIXME catch divide by zero + dl = (l - lold) / lold; // FIXME catch divide by zero + while ((TMath::Abs(dl) > dlStop) && (i < MAXCALLS)) { + i++; - if (l > lold) - step = -step / 10; + lold = l; + x = p + step; + l = TMath::Abs(langaufun(&x, params) - fy); + dl = (l - lold) / lold; // FIXME catch divide by zero - p += step; - } + if (l > lold) + step = -step / 10; - if (i == MAXCALLS) - return (-2); + p += step; + } - fxr = x; + if (i == MAXCALLS) + return (-2); - // Search for left x location of fy - p = maxx - 0.5 * params[0]; - step = -params[0]; - lold = -2.0; - l = -1e300; - i = 0; + fxr = x; - dl = (l - lold) / lold; // FIXME catch divide by zero - while ((TMath::Abs(dl) > dlStop) && (i < MAXCALLS)) { - i++; + // Search for left x location of fy + p = maxx - 0.5 * params[0]; + step = -params[0]; + lold = -2.0; + l = -1e300; + i = 0; - lold = l; - x = p + step; - l = TMath::Abs(langaufun(&x, params) - fy); - dl = (l - lold) / lold; // FIXME catch divide by zero + dl = (l - lold) / lold; // FIXME catch divide by zero + while ((TMath::Abs(dl) > dlStop) && (i < MAXCALLS)) { + i++; - if (l > lold) - step = -step / 10; + lold = l; + x = p + step; + l = TMath::Abs(langaufun(&x, params) - fy); + dl = (l - lold) / lold; // FIXME catch divide by zero - p += step; - } + if (l > lold) + step = -step / 10; - if (i == MAXCALLS) - return (-3); + p += step; + } - fxl = x; + if (i == MAXCALLS) + return (-3); - FWHM = fxr - fxl; - return (0); -} + fxl = x; -//----------------------------------------------------------------------------------------------- -double Gauss(double *x, double *par) { - // The noise function: a gaussian + FWHM = fxr - fxl; + return (0); + } - double arg = 0; - if (par[2]) - arg = (x[0] - par[1]) / par[2]; + //----------------------------------------------------------------------------------------------- + double Gauss(double *x, double *par) { + // The noise function: a gaussian - double noise = par[0] * TMath::Exp(-0.5 * arg * arg); - return noise; -} + double arg = 0; + if (par[2]) + arg = (x[0] - par[1]) / par[2]; -} // namespace HDQMUtil + double noise = par[0] * TMath::Exp(-0.5 * arg * arg); + return noise; + } + +} // namespace HDQMUtil //----------------------------------------------------------------------------------------------- -HDQMfitUtilities::HDQMfitUtilities() : langausFit(nullptr), gausFit(nullptr) { - init(); -} +HDQMfitUtilities::HDQMfitUtilities() : langausFit(nullptr), gausFit(nullptr) { init(); } //----------------------------------------------------------------------------------------------- void HDQMfitUtilities::init() { @@ -262,15 +260,14 @@ double HDQMfitUtilities::doLanGaussFit(TH1F *htoFit) { } try { - htoFit->Fit(langausFit, "R0"); // "R" fit in a range,"0" quiet fit + htoFit->Fit(langausFit, "R0"); // "R" fit in a range,"0" quiet fit langausFit->SetRange(fr[0], fr[1]); langausFit->GetParameters(pLanGausS); - std::memcpy((void *)epLanGausS, (void *)langausFit->GetParErrors(), - 4 * sizeof(double)); + std::memcpy((void *)epLanGausS, (void *)langausFit->GetParErrors(), 4 * sizeof(double)); - chi2GausS = langausFit->GetChisquare(); // obtain chi^2 - nDofGausS = langausFit->GetNDF(); // obtain ndf + chi2GausS = langausFit->GetChisquare(); // obtain chi^2 + nDofGausS = langausFit->GetNDF(); // obtain ndf double sPeak, sFWHM; HDQMUtil::langaupro(pLanGausS, sPeak, sFWHM); @@ -279,9 +276,8 @@ double HDQMfitUtilities::doLanGaussFit(TH1F *htoFit) { edm::LogInfo("fitUtility") << "langaupro: max " << sPeak << std::endl; edm::LogInfo("fitUtility") << "langaupro: FWHM " << sFWHM << std::endl; } catch (cms::Exception &iException) { - edm::LogError("fitUtility") - << "problem in fitting " << htoFit->GetTitle() - << " \n\tDefault values of the parameters will be used"; + edm::LogError("fitUtility") << "problem in fitting " << htoFit->GetTitle() + << " \n\tDefault values of the parameters will be used"; pLanGausS[0] = -9999; pLanGausS[1] = -9999; pLanGausS[2] = -9999; @@ -318,7 +314,6 @@ double HDQMfitUtilities::doGaussFit(TH1F *htoFit) { init(); // if (htoFit->GetEntries()!=0) { if (htoFit->Integral() != 0) { - // Setting fit range and start values double fr[2]; double sv[3], pllo[3], plhi[3]; @@ -363,15 +358,13 @@ double HDQMfitUtilities::doGaussFit(TH1F *htoFit) { gausFit->SetRange(fr[0], fr[1]); gausFit->GetParameters(pGausS); - std::memcpy((void *)epGausS, (void *)gausFit->GetParErrors(), - 3 * sizeof(double)); + std::memcpy((void *)epGausS, (void *)gausFit->GetParErrors(), 3 * sizeof(double)); - chi2GausS = langausFit->GetChisquare(); // obtain chi^2 - nDofGausS = langausFit->GetNDF(); // obtain ndf + chi2GausS = langausFit->GetChisquare(); // obtain chi^2 + nDofGausS = langausFit->GetNDF(); // obtain ndf } catch (cms::Exception &iException) { - edm::LogError("fitUtility") - << "problem in fitting " << htoFit->GetTitle() - << " \n\tDefault values of the parameters will be used"; + edm::LogError("fitUtility") << "problem in fitting " << htoFit->GetTitle() + << " \n\tDefault values of the parameters will be used"; pGausS[0] = -9999; pGausS[1] = -9999; pGausS[2] = -9999; diff --git a/HLTriggerOffline/Common/interface/HltComparator.h b/HLTriggerOffline/Common/interface/HltComparator.h index 842ca1012c480..ac097eae3d4a7 100644 --- a/HLTriggerOffline/Common/interface/HltComparator.h +++ b/HLTriggerOffline/Common/interface/HltComparator.h @@ -26,8 +26,7 @@ class HltComparator : public edm::EDFilter { std::vector onlineToOfflineBitMappings_; std::vector comparisonHists_; - std::map> - triggerComparisonErrors_; + std::map> triggerComparisonErrors_; bool init_; bool verbose_; @@ -41,9 +40,8 @@ class HltComparator : public edm::EDFilter { void beginJob() override; bool filter(edm::Event &, const edm::EventSetup &) override; void endJob() override; - void initialise(const edm::TriggerResults &, const edm::TriggerResults &, - edm::Event &e); + void initialise(const edm::TriggerResults &, const edm::TriggerResults &, edm::Event &e); std::string formatResult(const unsigned int); }; -#endif // HLTCOMPARATOR_HH +#endif // HLTCOMPARATOR_HH diff --git a/HLTriggerOffline/Common/src/HltComparator.cc b/HLTriggerOffline/Common/src/HltComparator.cc index d2cd8f007e4c9..41fdb178d4cf9 100644 --- a/HLTriggerOffline/Common/src/HltComparator.cc +++ b/HLTriggerOffline/Common/src/HltComparator.cc @@ -34,15 +34,12 @@ enum { // Analyser constructor HltComparator::HltComparator(const edm::ParameterSet &iConfig) - : hltOnlineResults_(consumes( - iConfig.getParameter("OnlineResults"))), - hltOfflineResults_(consumes( - iConfig.getParameter("OfflineResults"))), - init_(false), verbose_(iConfig.getUntrackedParameter("verbose")), - skipPathList_( - iConfig.getUntrackedParameter>("skipPaths")), - usePathList_( - iConfig.getUntrackedParameter>("usePaths")) { + : hltOnlineResults_(consumes(iConfig.getParameter("OnlineResults"))), + hltOfflineResults_(consumes(iConfig.getParameter("OfflineResults"))), + init_(false), + verbose_(iConfig.getUntrackedParameter("verbose")), + skipPathList_(iConfig.getUntrackedParameter>("skipPaths")), + usePathList_(iConfig.getUntrackedParameter>("usePaths")) { // std::cout << " HERE I AM " << std::endl; produces("failedTriggerDescription"); // std::cout << " HERE I GO " << std::endl; @@ -66,9 +63,8 @@ void HltComparator::initialise(const edm::TriggerResults &onlineResults, // do we need to throw? I guess the whole job is crap if this happens. // sort of assumes we're the only game in town. if (numTriggers_ != offlineActualNames_.size()) { - throw cms::Exception("IncorrectTriggers") - << "Online had " << numTriggers_ << "triggers, " - << "Offline had " << offlineActualNames_.size() << "triggers"; + throw cms::Exception("IncorrectTriggers") << "Online had " << numTriggers_ << "triggers, " + << "Offline had " << offlineActualNames_.size() << "triggers"; } // Create bit mappings @@ -78,22 +74,19 @@ void HltComparator::initialise(const edm::TriggerResults &onlineResults, } for (unsigned int i = 0; i < numTriggers_; ++i) { // Find offline position for fixed online bit - std::map::iterator it = - offlineNameBitMap.find(onlineActualNames_[i]); + std::map::iterator it = offlineNameBitMap.find(onlineActualNames_[i]); if (it != offlineNameBitMap.end()) { onlineToOfflineBitMappings_.push_back(it->second); } else { - throw cms::Exception("IncorrectTriggers") - << "Online trigger path " << onlineActualNames_[i] - << " not found in Offline " - "processing"; + throw cms::Exception("IncorrectTriggers") << "Online trigger path " << onlineActualNames_[i] + << " not found in Offline " + "processing"; } } // Create histograms edm::Service fs; - for (std::vector::iterator it = onlineActualNames_.begin(); - it != onlineActualNames_.end(); ++it) { + for (std::vector::iterator it = onlineActualNames_.begin(); it != onlineActualNames_.end(); ++it) { // Bin descriptions: OnOfPass, OnOffFail, OnPassOffFail, OnFailOffPass, // OnOffError, OnRunOffError, OnErrorOffRun, OnRunOffNot OnNotOffRun // OnNotOffNot @@ -116,36 +109,36 @@ void HltComparator::initialise(const edm::TriggerResults &onlineResults, // Format a comparison result std::string HltComparator::formatResult(const unsigned int i) { switch (i) { - case 0: - return std::string("OnPass_OffPass"); - break; - case 1: - return std::string("OnFail_OffFail"); - break; - case 2: - return std::string("OnPass_OffFail"); - break; - case 3: - return std::string("OnFail_OffPass"); - break; - case 4: - return std::string("OnError_OffError"); - break; - case 5: - return std::string("OnRun_OffError"); - break; - case 6: - return std::string("OnError_OffRun"); - break; - case 7: - return std::string("OnRun_OffNotRun"); - break; - case 8: - return std::string("OnNotRun_OffRun"); - break; - case 9: - return std::string("OnNotRun_OffNotRun"); - break; + case 0: + return std::string("OnPass_OffPass"); + break; + case 1: + return std::string("OnFail_OffFail"); + break; + case 2: + return std::string("OnPass_OffFail"); + break; + case 3: + return std::string("OnFail_OffPass"); + break; + case 4: + return std::string("OnError_OffError"); + break; + case 5: + return std::string("OnRun_OffError"); + break; + case 6: + return std::string("OnError_OffRun"); + break; + case 7: + return std::string("OnRun_OffNotRun"); + break; + case 8: + return std::string("OnNotRun_OffRun"); + break; + case 9: + return std::string("OnNotRun_OffNotRun"); + break; } return std::string("CODE NOT KNOWN"); } @@ -213,24 +206,19 @@ bool HltComparator::filter(edm::Event &event, const edm::EventSetup &iSetup) { // want to send the result to a special stream. Hence we _pass_ the filter. // If it all worked as expected the filter fails and the event doesn't go // to the output stream. - if ((result == kOnPassOffFail) || (result == kOnFailOffPass) || - (result == kOnRunOffError) || (result == kOnErrorOffRun) || - (result == kOnRunOffNot) || (result == kOnNotOffRun)) { + if ((result == kOnPassOffFail) || (result == kOnFailOffPass) || (result == kOnRunOffError) || + (result == kOnErrorOffRun) || (result == kOnRunOffNot) || (result == kOnNotOffRun)) { // is this one we should ignore? check the skip list if (verbose()) { - std::cout << "Found disagreemenet " << result << ", name is " - << onlineActualNames_[i] << std::endl; + std::cout << "Found disagreemenet " << result << ", name is " << onlineActualNames_[i] << std::endl; } std::ostringstream desc; desc << onlineActualNames_[i] << ":" << formatResult(result); resultDescription->push_back(desc.str()); - if (std::find(skipPathList_.begin(), skipPathList_.end(), - onlineActualNames_[i]) == skipPathList_.end()) { - + if (std::find(skipPathList_.begin(), skipPathList_.end(), onlineActualNames_[i]) == skipPathList_.end()) { if (!usePathList_.empty()) { // only use specified paths to debug - if (std::find(usePathList_.begin(), usePathList_.end(), - onlineActualNames_[i]) != usePathList_.end()) + if (std::find(usePathList_.begin(), usePathList_.end(), onlineActualNames_[i]) != usePathList_.end()) hasDisagreement = true; } else hasDisagreement = true; @@ -240,13 +228,11 @@ bool HltComparator::filter(edm::Event &event, const edm::EventSetup &iSetup) { // Record the trigger error code // I think this should be result > 2? (pw) if (verbose() && (result > 1)) { - std::cout << "HLT-Compare: Event " << event.id().event() << " Path " - << onlineActualNames_[i] << " " << formatResult(result) - << std::endl; + std::cout << "HLT-Compare: Event " << event.id().event() << " Path " << onlineActualNames_[i] << " " + << formatResult(result) << std::endl; #ifdef NOTDEF - triggerComparisonErrors_[event.id().event()][onlineActualNames_[i]] = - result; -#endif // NOTDEF + triggerComparisonErrors_[event.id().event()][onlineActualNames_[i]] = result; +#endif // NOTDEF } } @@ -265,21 +251,16 @@ void HltComparator::beginJob() {} // Print the trigger results void HltComparator::endJob() { #ifdef NOTDEF - std::cout << "HLT-Compare ---------- Trigger Comparison Summary ----------" - << std::endl; - std::cout << "HLT-Compare The following events had trigger mismatches:" - << std::endl; + std::cout << "HLT-Compare ---------- Trigger Comparison Summary ----------" << std::endl; + std::cout << "HLT-Compare The following events had trigger mismatches:" << std::endl; std::map>::iterator it; - for (it = triggerComparisonErrors_.begin(); - it != triggerComparisonErrors_.end(); ++it) { + for (it = triggerComparisonErrors_.begin(); it != triggerComparisonErrors_.end(); ++it) { std::cout << "HLT-Compare Event: " << it->first << std::endl; std::map::iterator jt; for (jt = it->second.begin(); jt != it->second.end(); ++jt) { - std::cout << "HLT-Compare Path: " << jt->first << " : " - << formatResult(jt->second) << std::endl; + std::cout << "HLT-Compare Path: " << jt->first << " : " << formatResult(jt->second) << std::endl; } } - std::cout << "HLT-Compare ------------ End Trigger Comparison ------------" - << std::endl; -#endif // NOTDEF + std::cout << "HLT-Compare ------------ End Trigger Comparison ------------" << std::endl; +#endif // NOTDEF } diff --git a/HLTriggerOffline/Egamma/interface/EmDQM.h b/HLTriggerOffline/Egamma/interface/EmDQM.h index e1d45a234d387..058b43d02438d 100644 --- a/HLTriggerOffline/Egamma/interface/EmDQM.h +++ b/HLTriggerOffline/Egamma/interface/EmDQM.h @@ -45,14 +45,18 @@ class EmDQM; -template class HistoFiller { +template +class HistoFiller { public: HistoFiller(EmDQM *d) : dqm(d){}; ~HistoFiller(){}; void fillHistos(edm::Handle &, - const edm::Event &, unsigned int, unsigned int, - std::vector &, bool &); + const edm::Event &, + unsigned int, + unsigned int, + std::vector &, + bool &); // std::vector>>> isoNameTokens_; @@ -77,8 +81,7 @@ class EmDQM : public DQMEDAnalyzer { void analyze(const edm::Event &event, const edm::EventSetup &) override; void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void endRun(edm::Run const &, edm::EventSetup const &) override; private: @@ -138,17 +141,14 @@ class EmDQM : public DQMEDAnalyzer { std::vector getFilterModules(const std::string &); double getPrimaryEtCut(const std::string &); edm::ParameterSet makePSetForL1SeedFilter(const std::string &); - edm::ParameterSet - makePSetForL1SeedToSuperClusterMatchFilter(const std::string &); + edm::ParameterSet makePSetForL1SeedToSuperClusterMatchFilter(const std::string &); edm::ParameterSet makePSetForEtFilter(const std::string &); edm::ParameterSet makePSetForOneOEMinusOneOPFilter(const std::string &); edm::ParameterSet makePSetForPixelMatchFilter(const std::string &); edm::ParameterSet makePSetForEgammaGenericFilter(const std::string &); - edm::ParameterSet - makePSetForEgammaGenericQuadraticFilter(const std::string &); + edm::ParameterSet makePSetForEgammaGenericQuadraticFilter(const std::string &); edm::ParameterSet makePSetForElectronGenericFilter(const std::string &); - edm::ParameterSet - makePSetForEgammaDoubleEtDeltaPhiFilter(const std::string &); + edm::ParameterSet makePSetForEgammaDoubleEtDeltaPhiFilter(const std::string &); // set validation configuration parameters for a trigger path void SetVarsFromPSet(std::vector::iterator); @@ -158,14 +158,12 @@ class EmDQM : public DQMEDAnalyzer { // input from generated parameter set unsigned int pathIndex; std::vector theHLTCollectionLabels; - unsigned int numOfHLTCollectionLabels; // Will be size of above vector - std::vector - theHLTCollectionHumanNames; // Human-readable names for the collections + unsigned int numOfHLTCollectionLabels; // Will be size of above vector + std::vector theHLTCollectionHumanNames; // Human-readable names for the collections edm::InputTag theL1Seed; std::vector theHLTOutputTypes; std::vector plotiso; - std::vector> - isoNames; // there has to be a better solution + std::vector> isoNames; // there has to be a better solution std::vector> plotBounds; std::vector nCandCuts; // paramters for generator study diff --git a/HLTriggerOffline/Egamma/interface/EmDQMPostProcessor.h b/HLTriggerOffline/Egamma/interface/EmDQMPostProcessor.h index db026e28bc79d..29b92f168d405 100644 --- a/HLTriggerOffline/Egamma/interface/EmDQMPostProcessor.h +++ b/HLTriggerOffline/Egamma/interface/EmDQMPostProcessor.h @@ -11,22 +11,27 @@ class EmDQMPostProcessor : public DQMEDHarvester { void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; - TProfile *dividehistos(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - const std::string &num, const std::string &denom, - const std::string &out, const std::string &label, + TProfile *dividehistos(DQMStore::IBooker &ibooker, + DQMStore::IGetter &igetter, + const std::string &num, + const std::string &denom, + const std::string &out, + const std::string &label, const std::string &titel = ""); - TH2F *dividehistos2D(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - const std::string &num, const std::string &denom, - const std::string &out, const std::string &label, + TH2F *dividehistos2D(DQMStore::IBooker &ibooker, + DQMStore::IGetter &igetter, + const std::string &num, + const std::string &denom, + const std::string &out, + const std::string &label, const std::string &titel = ""); private: /** a replacement for the function TGraphAsymmErrors::Efficiency(..) used with earlier versions of ROOT (this functionality has been moved to a separate class TEfficiency) */ - static void Efficiency(int passing, int total, double level, double &mode, - double &lowerBound, double &upperBound); + static void Efficiency(int passing, int total, double level, double &mode, double &lowerBound, double &upperBound); /** read from the configuration: if set to true, efficiencies are calculated with respect to reconstructed objects (instead @@ -39,10 +44,8 @@ class EmDQMPostProcessor : public DQMEDHarvester { /** convenience method to get a histogram but checks first whether the corresponding MonitorElement is non-null. @return null if the MonitorElement is null */ - TH1F *getHistogram(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - const std::string &histoPath); - TH2F *get2DHistogram(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, - const std::string &histoPath); + TH1F *getHistogram(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &histoPath); + TH2F *get2DHistogram(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &histoPath); std::string subDir_; /** dataset with which these histograms were produced. diff --git a/HLTriggerOffline/Egamma/interface/EmDQMReco.h b/HLTriggerOffline/Egamma/interface/EmDQMReco.h index 1d2e5389ba027..d7aee589010cf 100644 --- a/HLTriggerOffline/Egamma/interface/EmDQMReco.h +++ b/HLTriggerOffline/Egamma/interface/EmDQMReco.h @@ -27,31 +27,31 @@ class EmDQMReco; -template class HistoFillerReco { +template +class HistoFillerReco { public: HistoFillerReco(EmDQMReco *d) : dqm(d){}; ~HistoFillerReco(){}; void fillHistos(edm::Handle &triggerObj, - const edm::Event &iEvent, unsigned int n, - std::vector &sortedReco, bool plotReco, + const edm::Event &iEvent, + unsigned int n, + std::vector &sortedReco, + bool plotReco, bool plotMonpath); - std::vector>>> - isoNameTokens_; + std::vector>>> isoNameTokens_; private: EmDQMReco *dqm; }; class EmDQMReco : public DQMEDAnalyzer { - //---------------------------------------- /** a class managing a set of MonitorElements for quantities of a fourvector * we want to histogram. */ class FourVectorMonitorElements { - public: /** @param histogramNameTemplate should be a format string (like used in * printf(..) or boost::format(..) for the histogram NAME where the first %s @@ -61,7 +61,8 @@ class EmDQMReco : public DQMEDAnalyzer { * histogramNameTemplate) for the histogram TITLE where the first %s is * replaced with et,eta or phi. */ - FourVectorMonitorElements(EmDQMReco *_parent, DQMStore::IBooker &iBooker, + FourVectorMonitorElements(EmDQMReco *_parent, + DQMStore::IBooker &iBooker, const std::string &histogramNameTemplate, const std::string &histogramTitleTemplate); @@ -92,8 +93,7 @@ class EmDQMReco : public DQMEDAnalyzer { // Operations void analyze(const edm::Event &event, const edm::EventSetup &) override; void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // Input from cfg file @@ -101,16 +101,14 @@ class EmDQMReco : public DQMEDAnalyzer { /** the HLT collections to be looked at */ std::vector theHLTCollectionLabels; - unsigned int numOfHLTCollectionLabels; // Will be size of above vector + unsigned int numOfHLTCollectionLabels; // Will be size of above vector bool useHumanReadableHistTitles; - std::vector - theHLTCollectionHumanNames; // Human-readable names for the collections + std::vector theHLTCollectionHumanNames; // Human-readable names for the collections // edm::InputTag theL1Seed; std::vector theHLTOutputTypes; std::vector plotiso; - std::vector> - isoNames; // there has to be a better solution + std::vector> isoNames; // there has to be a better solution std::vector> plotBounds; std::string theHltName; HLTConfigProvider hltConfig_; diff --git a/HLTriggerOffline/Egamma/src/EmDQM.cc b/HLTriggerOffline/Egamma/src/EmDQM.cc index b66184d2c31b5..95e6ff5459e5c 100644 --- a/HLTriggerOffline/Egamma/src/EmDQM.cc +++ b/HLTriggerOffline/Egamma/src/EmDQM.cc @@ -26,14 +26,11 @@ EmDQM::EmDQM(const edm::ParameterSet &pset_) : pset(pset_) { eta2DMax_ = pset.getUntrackedParameter("Eta2DMax", 2.8); phi2DMax_ = pset.getUntrackedParameter("Phi2DMax", 3.2); nbins2D_ = pset.getUntrackedParameter("Nbins2D", 16); - minEtForEtaEffPlot_ = - pset.getUntrackedParameter("minEtForEtaEffPlot", 15); - useHumanReadableHistTitles_ = - pset.getUntrackedParameter("useHumanReadableHistTitles", false); + minEtForEtaEffPlot_ = pset.getUntrackedParameter("minEtForEtaEffPlot", 15); + useHumanReadableHistTitles_ = pset.getUntrackedParameter("useHumanReadableHistTitles", false); mcMatchedOnly_ = pset.getUntrackedParameter("mcMatchedOnly", true); noPhiPlots_ = pset.getUntrackedParameter("noPhiPlots", true); - noIsolationPlots_ = - pset.getUntrackedParameter("noIsolationPlots", true); + noIsolationPlots_ = pset.getUntrackedParameter("noIsolationPlots", true); if (!autoConfMode_) { paramSets.push_back(pset); @@ -49,32 +46,24 @@ EmDQM::EmDQM(const edm::ParameterSet &pset_) : pset(pset_) { histoFillerL1NonIso = new HistoFiller(this); // consumes - genParticles_token = - consumes>(edm::InputTag("genParticles")); + genParticles_token = consumes>(edm::InputTag("genParticles")); triggerObject_token = consumes(triggerObject_); - hltResults_token = consumes( - edm::InputTag("TriggerResults", "", triggerObject_.process())); + hltResults_token = consumes(edm::InputTag("TriggerResults", "", triggerObject_.process())); if (autoConfMode_) { - gencutColl_fidWenu_token = - mayConsume>(edm::InputTag("fiducialWenu")); - gencutColl_fidZee_token = - mayConsume>(edm::InputTag("fiducialZee")); - gencutColl_fidTripleEle_token = mayConsume>( - edm::InputTag("fiducialTripleEle")); - gencutColl_fidGammaJet_token = mayConsume>( - edm::InputTag("fiducialGammaJet")); - gencutColl_fidDiGamma_token = mayConsume>( - edm::InputTag("fiducialDiGamma")); + gencutColl_fidWenu_token = mayConsume>(edm::InputTag("fiducialWenu")); + gencutColl_fidZee_token = mayConsume>(edm::InputTag("fiducialZee")); + gencutColl_fidTripleEle_token = mayConsume>(edm::InputTag("fiducialTripleEle")); + gencutColl_fidGammaJet_token = mayConsume>(edm::InputTag("fiducialGammaJet")); + gencutColl_fidDiGamma_token = mayConsume>(edm::InputTag("fiducialDiGamma")); } else { - gencutColl_manualConf_token = consumes>( - pset.getParameter("cutcollection")); + gencutColl_manualConf_token = + consumes>(pset.getParameter("cutcollection")); } } void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { bool changed(true); if (hltConfig_.init(iRun, iSetup, triggerObject_.process(), changed)) { - // if init returns TRUE, initialisation has succeeded! if (autoConfMode_) { @@ -85,40 +74,39 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { edm::LogPrint("EmDQM") << "processName=" << hltConfig_.processName(); edm::LogPrint("EmDQM") << "tableName=" << hltConfig_.tableName(); edm::LogPrint("EmDQM") << "size=" << hltConfig_.size(); - edm::LogInfo("EmDQM") - << "The following filter types are not analyzed: \n" - << "\tHLTGlobalSumsMET\n" - << "\tHLTHtMhtFilter\n" - << "\tHLTMhtFilter\n" - << "\tHLTJetTag\n" - << "\tHLT1CaloJet\n" - << "\tHLT1CaloMET\n" - << "\tHLT1CaloBJet\n" - << "\tHLT1Tau\n" - << "\tHLT1PFTau\n" - << "\tPFTauSelector\n" - << "\tHLT1PFJet\n" - << "\tHLTPFJetCollectionsFilter\n" - << "\tHLTPFJetCollectionsVBFFilter\n" - << "\tHLTPFJetTag\n" - << "\tEtMinCaloJetSelector\n" - << "\tEtMinPFJetSelector\n" - << "\tLargestEtCaloJetSelector\n" - << "\tLargestEtPFJetSelector\n" - << "\tHLTEgammaTriggerFilterObjectWrapper\n" - << "\tHLTEgammaDoubleLegCombFilter\n" - << "\tHLT2ElectronTau\n" - << "\tHLT2ElectronMET\n" - << "\tHLT2ElectronPFTau\n" - << "\tHLTPMMassFilter\n" - << "\tHLTHcalTowerFilter\n" - << "\tHLT1Photon\n" - << "\tHLTRFilter\n" - << "\tHLTRHemisphere\n" - << "\tHLTElectronPFMTFilter\n" - << "\tPrimaryVertexObjectFilter\n" - << "\tHLTEgammaAllCombMassFilter\n" - << "\tHLTMuon*\n"; + edm::LogInfo("EmDQM") << "The following filter types are not analyzed: \n" + << "\tHLTGlobalSumsMET\n" + << "\tHLTHtMhtFilter\n" + << "\tHLTMhtFilter\n" + << "\tHLTJetTag\n" + << "\tHLT1CaloJet\n" + << "\tHLT1CaloMET\n" + << "\tHLT1CaloBJet\n" + << "\tHLT1Tau\n" + << "\tHLT1PFTau\n" + << "\tPFTauSelector\n" + << "\tHLT1PFJet\n" + << "\tHLTPFJetCollectionsFilter\n" + << "\tHLTPFJetCollectionsVBFFilter\n" + << "\tHLTPFJetTag\n" + << "\tEtMinCaloJetSelector\n" + << "\tEtMinPFJetSelector\n" + << "\tLargestEtCaloJetSelector\n" + << "\tLargestEtPFJetSelector\n" + << "\tHLTEgammaTriggerFilterObjectWrapper\n" + << "\tHLTEgammaDoubleLegCombFilter\n" + << "\tHLT2ElectronTau\n" + << "\tHLT2ElectronMET\n" + << "\tHLT2ElectronPFTau\n" + << "\tHLTPMMassFilter\n" + << "\tHLTHcalTowerFilter\n" + << "\tHLT1Photon\n" + << "\tHLTRFilter\n" + << "\tHLTRHemisphere\n" + << "\tHLTElectronPFMTFilter\n" + << "\tPrimaryVertexObjectFilter\n" + << "\tHLTEgammaAllCombMassFilter\n" + << "\tHLTMuon*\n"; } // All electron and photon paths @@ -138,26 +126,26 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { for (unsigned int j = 0; j < egammaPaths.size(); j++) { if (verbosity_ >= OUTPUT_ALL) { switch (j) { - case TYPE_SINGLE_ELE: - edm::LogPrint("EmDQM") << "////////////////////////////////////////" - "/\nSingle electron paths: "; - break; - case TYPE_DOUBLE_ELE: - edm::LogPrint("EmDQM") << "////////////////////////////////////////" - "/\nDouble electron paths: "; - break; - case TYPE_TRIPLE_ELE: - edm::LogPrint("EmDQM") << "////////////////////////////////////////" - "/\nTriple electron paths: "; - break; - case TYPE_SINGLE_PHOTON: - edm::LogPrint("EmDQM") << "////////////////////////////////////////" - "/\nSingle photon paths: "; - break; - case TYPE_DOUBLE_PHOTON: - edm::LogPrint("EmDQM") << "////////////////////////////////////////" - "/\nDouble photon paths: "; - break; + case TYPE_SINGLE_ELE: + edm::LogPrint("EmDQM") << "////////////////////////////////////////" + "/\nSingle electron paths: "; + break; + case TYPE_DOUBLE_ELE: + edm::LogPrint("EmDQM") << "////////////////////////////////////////" + "/\nDouble electron paths: "; + break; + case TYPE_TRIPLE_ELE: + edm::LogPrint("EmDQM") << "////////////////////////////////////////" + "/\nTriple electron paths: "; + break; + case TYPE_SINGLE_PHOTON: + edm::LogPrint("EmDQM") << "////////////////////////////////////////" + "/\nSingle photon paths: "; + break; + case TYPE_DOUBLE_PHOTON: + edm::LogPrint("EmDQM") << "////////////////////////////////////////" + "/\nDouble photon paths: "; + break; } } @@ -173,10 +161,8 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { //-------------------- edm::ParameterSet paramSet; - paramSet.addUntrackedParameter("pathIndex", - hltConfig_.triggerIndex(pathName)); - paramSet.addParameter("@module_label", - hltConfig_.removeVersion(pathName) + "_DQM"); + paramSet.addUntrackedParameter("pathIndex", hltConfig_.triggerIndex(pathName)); + paramSet.addParameter("@module_label", hltConfig_.removeVersion(pathName) + "_DQM"); // paramSet.addParameter("@module_label", pathName + "_DQM"); // plotting parameters (untracked because they don't affect the @@ -186,10 +172,9 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { paramSet.addUntrackedParameter("genEtMin", genEtMin); } else { if (verbosity_ >= OUTPUT_WARNINGS) - edm::LogWarning("EmDQM") - << "Pathname: '" << pathName - << "': Unable to determine a minimum Et. Will not include " - "this path in the validation."; + edm::LogWarning("EmDQM") << "Pathname: '" << pathName + << "': Unable to determine a minimum Et. Will not include " + "this path in the validation."; continue; } @@ -198,10 +183,8 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { double ptMax = ptMax_; double ptMin = ptMin_; if (ptMax < (1.2 * genEtMin)) { - paramSet.addUntrackedParameter( - "PtMax", (10 * ceil(0.12 * genEtMin))); - paramSet.addUntrackedParameter( - "PtMin", (10 * ceil(0.12 * genEtMin) - ptMax + ptMin)); + paramSet.addUntrackedParameter("PtMax", (10 * ceil(0.12 * genEtMin))); + paramSet.addUntrackedParameter("PtMin", (10 * ceil(0.12 * genEtMin) - ptMax + ptMin)); } else { paramSet.addUntrackedParameter("PtMax", ptMax); paramSet.addUntrackedParameter("PtMin", ptMin); @@ -209,80 +192,65 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { // preselction cuts switch (j) { - case TYPE_SINGLE_ELE: - paramSet.addParameter("reqNum", 1); - paramSet.addParameter("pdgGen", 11); - paramSet.addParameter("cutcollection", - edm::InputTag("fiducialWenu")); - paramSet.addParameter("cutnum", 1); - break; - case TYPE_DOUBLE_ELE: - paramSet.addParameter("reqNum", 2); - paramSet.addParameter("pdgGen", 11); - paramSet.addParameter("cutcollection", - edm::InputTag("fiducialZee")); - paramSet.addParameter("cutnum", 2); - break; - case TYPE_TRIPLE_ELE: - paramSet.addParameter("reqNum", 3); - paramSet.addParameter("pdgGen", 11); - paramSet.addParameter( - "cutcollection", edm::InputTag("fiducialTripleEle")); - paramSet.addParameter("cutnum", 3); - break; - case TYPE_SINGLE_PHOTON: - paramSet.addParameter("reqNum", 1); - paramSet.addParameter("pdgGen", 22); - paramSet.addParameter( - "cutcollection", edm::InputTag("fiducialGammaJet")); - paramSet.addParameter("cutnum", 1); - break; - case TYPE_DOUBLE_PHOTON: - paramSet.addParameter("reqNum", 2); - paramSet.addParameter("pdgGen", 22); - paramSet.addParameter( - "cutcollection", edm::InputTag("fiducialDiGamma")); - paramSet.addParameter("cutnum", 2); + case TYPE_SINGLE_ELE: + paramSet.addParameter("reqNum", 1); + paramSet.addParameter("pdgGen", 11); + paramSet.addParameter("cutcollection", edm::InputTag("fiducialWenu")); + paramSet.addParameter("cutnum", 1); + break; + case TYPE_DOUBLE_ELE: + paramSet.addParameter("reqNum", 2); + paramSet.addParameter("pdgGen", 11); + paramSet.addParameter("cutcollection", edm::InputTag("fiducialZee")); + paramSet.addParameter("cutnum", 2); + break; + case TYPE_TRIPLE_ELE: + paramSet.addParameter("reqNum", 3); + paramSet.addParameter("pdgGen", 11); + paramSet.addParameter("cutcollection", edm::InputTag("fiducialTripleEle")); + paramSet.addParameter("cutnum", 3); + break; + case TYPE_SINGLE_PHOTON: + paramSet.addParameter("reqNum", 1); + paramSet.addParameter("pdgGen", 22); + paramSet.addParameter("cutcollection", edm::InputTag("fiducialGammaJet")); + paramSet.addParameter("cutnum", 1); + break; + case TYPE_DOUBLE_PHOTON: + paramSet.addParameter("reqNum", 2); + paramSet.addParameter("pdgGen", 22); + paramSet.addParameter("cutcollection", edm::InputTag("fiducialDiGamma")); + paramSet.addParameter("cutnum", 2); } //-------------------- // TODO: extend this if (isData_) - paramSet.addParameter("cutcollection", - edm::InputTag("gsfElectrons")); + paramSet.addParameter("cutcollection", edm::InputTag("gsfElectrons")); std::vector filterVPSet; edm::ParameterSet filterPSet; std::string moduleLabel; // loop over filtermodules of current trigger path - for (std::vector::iterator filter = - filterModules.begin(); - filter != filterModules.end(); ++filter) { - std::string moduleType = - hltConfig_.modulePSet(*filter).getParameter( - "@module_type"); - moduleLabel = - hltConfig_.modulePSet(*filter).getParameter( - "@module_label"); + for (std::vector::iterator filter = filterModules.begin(); filter != filterModules.end(); + ++filter) { + std::string moduleType = hltConfig_.modulePSet(*filter).getParameter("@module_type"); + moduleLabel = hltConfig_.modulePSet(*filter).getParameter("@module_label"); // first check if it is a filter we are not interrested in - if (moduleType == "Pythia6GeneratorFilter" || - moduleType == "HLTTriggerTypeFilter" || - moduleType == "HLTLevel1Activity" || - moduleType == "HLTPrescaler" || moduleType == "HLTBool") + if (moduleType == "Pythia6GeneratorFilter" || moduleType == "HLTTriggerTypeFilter" || + moduleType == "HLTLevel1Activity" || moduleType == "HLTPrescaler" || moduleType == "HLTBool") continue; // now check for the known filter types if (moduleType == "HLTLevel1GTSeed") { filterPSet = makePSetForL1SeedFilter(moduleLabel); } else if (moduleType == "HLTEgammaL1MatchFilterRegional") { - filterPSet = - makePSetForL1SeedToSuperClusterMatchFilter(moduleLabel); + filterPSet = makePSetForL1SeedToSuperClusterMatchFilter(moduleLabel); } else if (moduleType == "HLTEgammaEtFilter") { filterPSet = makePSetForEtFilter(moduleLabel); - } else if (moduleType == - "HLTElectronOneOEMinusOneOPFilterRegional") { + } else if (moduleType == "HLTElectronOneOEMinusOneOPFilterRegional") { filterPSet = makePSetForOneOEMinusOneOPFilter(moduleLabel); } else if (moduleType == "HLTElectronPixelMatchFilter") { filterPSet = makePSetForPixelMatchFilter(moduleLabel); @@ -294,45 +262,29 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { filterPSet = makePSetForElectronGenericFilter(moduleLabel); } else if (moduleType == "HLTEgammaDoubleEtDeltaPhiFilter") { filterPSet = makePSetForEgammaDoubleEtDeltaPhiFilter(moduleLabel); - } else if ( - moduleType == "HLTGlobalSumsMET" || - moduleType == "HLTHtMhtFilter" || - moduleType == "HLTMhtFilter" || moduleType == "HLTJetTag" || - moduleType == "HLT1CaloJet" || moduleType == "HLT1CaloMET" || - moduleType == "HLT1CaloBJet" || moduleType == "HLT1Tau" || - moduleType == "HLT1PFTau" || moduleType == "PFTauSelector" || - moduleType == "HLT1PFJet" || - moduleType == "HLTPFJetCollectionsFilter" || - moduleType == "HLTPFJetCollectionsVBFFilter" || - moduleType == "HLTPFJetTag" || - moduleType == "EtMinCaloJetSelector" || - moduleType == "EtMinPFJetSelector" || - moduleType == "LargestEtCaloJetSelector" || - moduleType == "LargestEtPFJetSelector" || - moduleType == - "HLTEgammaTriggerFilterObjectWrapper" // 'fake' filter - || moduleType == - "HLTEgammaDoubleLegCombFilter" // filter does not put - // anything in - // TriggerEventWithRefs - || moduleType == "HLT2ElectronMET" || - moduleType == "HLT2ElectronTau" || - moduleType == "HLT2ElectronPFTau" || - moduleType == "HLTPMMassFilter" || - moduleType == "HLTHcalTowerFilter" || - moduleType == "HLT1Photon" || moduleType == "HLTRFilter" || - moduleType == "HLTRHemisphere" || - moduleType == "HLTElectronPFMTFilter" || - moduleType == "PrimaryVertexObjectFilter" || - moduleType == "HLTEgammaAllCombMassFilter" || - moduleType.find("HLTMuon") != std::string::npos) + } else if (moduleType == "HLTGlobalSumsMET" || moduleType == "HLTHtMhtFilter" || + moduleType == "HLTMhtFilter" || moduleType == "HLTJetTag" || moduleType == "HLT1CaloJet" || + moduleType == "HLT1CaloMET" || moduleType == "HLT1CaloBJet" || moduleType == "HLT1Tau" || + moduleType == "HLT1PFTau" || moduleType == "PFTauSelector" || moduleType == "HLT1PFJet" || + moduleType == "HLTPFJetCollectionsFilter" || moduleType == "HLTPFJetCollectionsVBFFilter" || + moduleType == "HLTPFJetTag" || moduleType == "EtMinCaloJetSelector" || + moduleType == "EtMinPFJetSelector" || moduleType == "LargestEtCaloJetSelector" || + moduleType == "LargestEtPFJetSelector" || + moduleType == "HLTEgammaTriggerFilterObjectWrapper" // 'fake' filter + || moduleType == "HLTEgammaDoubleLegCombFilter" // filter does not put + // anything in + // TriggerEventWithRefs + || moduleType == "HLT2ElectronMET" || moduleType == "HLT2ElectronTau" || + moduleType == "HLT2ElectronPFTau" || moduleType == "HLTPMMassFilter" || + moduleType == "HLTHcalTowerFilter" || moduleType == "HLT1Photon" || moduleType == "HLTRFilter" || + moduleType == "HLTRHemisphere" || moduleType == "HLTElectronPFMTFilter" || + moduleType == "PrimaryVertexObjectFilter" || moduleType == "HLTEgammaAllCombMassFilter" || + moduleType.find("HLTMuon") != std::string::npos) continue; else { if (verbosity_ >= OUTPUT_WARNINGS) - edm::LogWarning("EmDQM") - << "No parameter set for filter '" << moduleLabel - << "' with filter type '" << moduleType - << "' added. Module will not be analyzed."; + edm::LogWarning("EmDQM") << "No parameter set for filter '" << moduleLabel << "' with filter type '" + << moduleType << "' added. Module will not be analyzed."; continue; } @@ -344,62 +296,46 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { // coupled to the parameter 'saveTag = true' if (moduleLabel.find("Unseeded") != std::string::npos && (j == TYPE_DOUBLE_PHOTON || j == TYPE_SINGLE_PHOTON)) { - filterVPSet.back().addParameter("theHLTOutputTypes", - trigger::TriggerPhoton); + filterVPSet.back().addParameter("theHLTOutputTypes", trigger::TriggerPhoton); } } // if ncandcut is -1 (when parsing for the number of particles in // the name of the L1seed filter fails), fall back to setting // ncandcut to the number of particles needed for the given path. if (filterPSet.getParameter("ncandcut") < 0) { - edm::LogPrint("EmDQM") - << "No number of candidates for filter " << moduleLabel - << " found. Set to " << paramSet.getParameter("cutnum") - << ", determined from path name."; - filterPSet.addParameter( - "ncandcut", paramSet.getParameter("cutnum")); - } else if (filterPSet.getParameter("ncandcut") > - paramSet.getParameter("cutnum")) { - edm::LogInfo("EmDQM") - << "Changed required number of candidates from " - << paramSet.getParameter("cutnum") << " to " - << filterPSet.getParameter("ncandcut") - << " for filter " << moduleLabel; - paramSet.addParameter( - "cutnum", filterPSet.getParameter("ncandcut")); - paramSet.addParameter( - "reqNum", - (unsigned)filterPSet.getParameter("ncandcut")); + edm::LogPrint("EmDQM") << "No number of candidates for filter " << moduleLabel << " found. Set to " + << paramSet.getParameter("cutnum") << ", determined from path name."; + filterPSet.addParameter("ncandcut", paramSet.getParameter("cutnum")); + } else if (filterPSet.getParameter("ncandcut") > paramSet.getParameter("cutnum")) { + edm::LogInfo("EmDQM") << "Changed required number of candidates from " + << paramSet.getParameter("cutnum") << " to " + << filterPSet.getParameter("ncandcut") << " for filter " << moduleLabel; + paramSet.addParameter("cutnum", filterPSet.getParameter("ncandcut")); + paramSet.addParameter("reqNum", (unsigned)filterPSet.getParameter("ncandcut")); } filterVPSet.push_back(filterPSet); } else break; - } // end loop over filter modules of current trigger path + } // end loop over filter modules of current trigger path // do not include this path when an empty filterPSet is detected. if (!filterPSet.empty()) { - std::string lastModuleName = - filterPSet.getParameter("HLTCollectionLabels") - .label(); + std::string lastModuleName = filterPSet.getParameter("HLTCollectionLabels").label(); if (!hltConfig_.modulePSet(lastModuleName).exists("saveTags")) { // make sure that 'theHLTOutputTypes' of the last filter of a // photon path is set to trigger::TriggerPhoton this is coupled to // the parameter 'saveTag = true' - if ((j == TYPE_SINGLE_PHOTON || j == TYPE_DOUBLE_PHOTON) && - pathName.rfind("Ele") == std::string::npos) { - filterVPSet.back().addParameter("theHLTOutputTypes", - trigger::TriggerPhoton); + if ((j == TYPE_SINGLE_PHOTON || j == TYPE_DOUBLE_PHOTON) && pathName.rfind("Ele") == std::string::npos) { + filterVPSet.back().addParameter("theHLTOutputTypes", trigger::TriggerPhoton); } } - paramSet.addParameter>("filters", - filterVPSet); + paramSet.addParameter>("filters", filterVPSet); } else { if (verbosity_ >= OUTPUT_ALL) - edm::LogPrint("EmDQM") - << "Will not include this path in the validation due to " - "errors while generating the parameter set."; + edm::LogPrint("EmDQM") << "Will not include this path in the validation due to " + "errors while generating the parameter set."; continue; } @@ -407,9 +343,9 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { // std::cout << paramSet.dump() << std::endl; paramSets.push_back(paramSet); - } // loop over all paths of this analysis type + } // loop over all paths of this analysis type - } // loop over analysis types (single ele etc.) + } // loop over analysis types (single ele etc.) } hltCollectionLabelsFoundPerPath.reserve(paramSets.size()); @@ -418,8 +354,7 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { //////////////////////////////////////////////////////////// // loop over all the trigger path parameter sets //////////////////////////////////////////////////////////// - for (std::vector::iterator psetIt = paramSets.begin(); - psetIt != paramSets.end(); ++psetIt) { + for (std::vector::iterator psetIt = paramSets.begin(); psetIt != paramSets.end(); ++psetIt) { hltCollectionLabelsFoundPerPath.push_back(hltCollectionLabelsFound); hltCollectionLabelsMissedPerPath.push_back(hltCollectionLabelsMissed); } @@ -432,20 +367,17 @@ void EmDQM::dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { // if init returns FALSE, initialisation has NOT succeeded, which indicates // a problem with the file and/or code and needs to be investigated! if (verbosity_ >= OUTPUT_ERRORS) - edm::LogError("EmDQM") - << " HLT config extraction failure with process name '" - << triggerObject_.process() << "'."; + edm::LogError("EmDQM") << " HLT config extraction failure with process name '" << triggerObject_.process() + << "'."; // In this case, all access methods will return empty values! } } -void EmDQM::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, - edm::EventSetup const &iSetup) { +void EmDQM::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, edm::EventSetup const &iSetup) { //////////////////////////////////////////////////////////// // loop over all the trigger path parameter sets //////////////////////////////////////////////////////////// - for (std::vector::iterator psetIt = paramSets.begin(); - psetIt != paramSets.end(); ++psetIt) { + for (std::vector::iterator psetIt = paramSets.begin(); psetIt != paramSets.end(); ++psetIt) { SetVarsFromPSet(psetIt); iBooker.setCurrentFolder(dirname_); @@ -482,9 +414,8 @@ void EmDQM::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, if (!mcMatchedOnly_) { // This plot will have bins equal to 2+(number of // HLTCollectionLabels in the config file) - total = iBooker.book1D(histName.c_str(), histTitle.c_str(), - numOfHLTCollectionLabels + 2, 0, - numOfHLTCollectionLabels + 2); + total = iBooker.book1D( + histName.c_str(), histTitle.c_str(), numOfHLTCollectionLabels + 2, 0, numOfHLTCollectionLabels + 2); total->setBinLabel(numOfHLTCollectionLabels + 1, "Total"); total->setBinLabel(numOfHLTCollectionLabels + 2, "Gen"); for (unsigned int u = 0; u < numOfHLTCollectionLabels; u++) { @@ -494,9 +425,8 @@ void EmDQM::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, histName = "total_eff_MC_matched"; histTitle = "total events passing (mc matched)"; - totalmatch = iBooker.book1D(histName.c_str(), histTitle.c_str(), - numOfHLTCollectionLabels + 2, 0, - numOfHLTCollectionLabels + 2); + totalmatch = iBooker.book1D( + histName.c_str(), histTitle.c_str(), numOfHLTCollectionLabels + 2, 0, numOfHLTCollectionLabels + 2); totalmatch->setBinLabel(numOfHLTCollectionLabels + 1, "Total"); totalmatch->setBinLabel(numOfHLTCollectionLabels + 2, "Gen"); for (unsigned int u = 0; u < numOfHLTCollectionLabels; u++) { @@ -511,41 +441,36 @@ void EmDQM::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, //////////////////////////////////////////////////////////// std::string pdgIdString; switch (pdgGen) { - case 11: - pdgIdString = "Electron"; - break; - case 22: - pdgIdString = "Photon"; - break; - default: - pdgIdString = "Particle"; + case 11: + pdgIdString = "Electron"; + break; + case 22: + pdgIdString = "Photon"; + break; + default: + pdgIdString = "Particle"; } histName = "gen_et"; histTitle = "E_{T} of " + pdgIdString + "s"; - etgen = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - plotPtMin, plotPtMax); + etgen = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, plotPtMin, plotPtMax); histName = "gen_eta"; histTitle = "#eta of " + pdgIdString + "s "; - etagen = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -etaMax_, etaMax_); + etagen = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -etaMax_, etaMax_); histName = "gen_phi"; histTitle = "#phi of " + pdgIdString + "s "; if (!noPhiPlots_) - phigen = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -phiMax_, phiMax_); + phigen = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -phiMax_, phiMax_); histName = "gen_etaphi"; histTitle = "#eta-#phi of " + pdgIdString + "s "; - etaphigen = - iBooker.book2D(histName.c_str(), histTitle.c_str(), nbins2D_ - 2, - -eta2DMax_, eta2DMax_, nbins2D_, -phi2DMax_, phi2DMax_); + etaphigen = iBooker.book2D( + histName.c_str(), histTitle.c_str(), nbins2D_ - 2, -eta2DMax_, eta2DMax_, nbins2D_, -phi2DMax_, phi2DMax_); //////////////////////////////////////////////////////////// // Set up histograms of HLT objects // //////////////////////////////////////////////////////////// // Determine what strings to use for histogram titles std::vector HltHistTitle; - if (theHLTCollectionHumanNames.size() == numOfHLTCollectionLabels && - useHumanReadableHistTitles_) { + if (theHLTCollectionHumanNames.size() == numOfHLTCollectionLabels && useHumanReadableHistTitles_) { HltHistTitle = theHLTCollectionHumanNames; } else { for (unsigned int i = 0; i < numOfHLTCollectionLabels; i++) { @@ -558,47 +483,41 @@ void EmDQM::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // Et distribution of HLT objects passing filter i histName = theHLTCollectionLabels[i].label() + "et_all"; histTitle = HltHistTitle[i] + " Et (ALL)"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - plotPtMin, plotPtMax); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, plotPtMin, plotPtMax); ethist.push_back(tmphisto); // Eta distribution of HLT objects passing filter i histName = theHLTCollectionLabels[i].label() + "eta_all"; histTitle = HltHistTitle[i] + " #eta (ALL)"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -etaMax_, etaMax_); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -etaMax_, etaMax_); etahist.push_back(tmphisto); if (!noPhiPlots_) { // Phi distribution of HLT objects passing filter i histName = theHLTCollectionLabels[i].label() + "phi_all"; histTitle = HltHistTitle[i] + " #phi (ALL)"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -phiMax_, phiMax_); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -phiMax_, phiMax_); phihist.push_back(tmphisto); } histName = theHLTCollectionLabels[i].label() + "etaphi_all"; histTitle = HltHistTitle[i] + " #eta-#phi (ALL)"; - tmphisto = iBooker.book2D(histName.c_str(), histTitle.c_str(), - nbins2D_ - 2, -eta2DMax_, eta2DMax_, nbins2D_, - -phi2DMax_, phi2DMax_); + tmphisto = iBooker.book2D( + histName.c_str(), histTitle.c_str(), nbins2D_ - 2, -eta2DMax_, eta2DMax_, nbins2D_, -phi2DMax_, phi2DMax_); etaphihist.push_back(tmphisto); // Et distribution of HLT object that is closest delta-R match to sorted // gen particle(s) histName = theHLTCollectionLabels[i].label() + "et"; histTitle = HltHistTitle[i] + " Et"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - plotPtMin, plotPtMax); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, plotPtMin, plotPtMax); histEtOfHltObjMatchToGen.push_back(tmphisto); // eta distribution of HLT object that is closest delta-R match to // sorted gen particle(s) histName = theHLTCollectionLabels[i].label() + "eta"; histTitle = HltHistTitle[i] + " eta"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -etaMax_, etaMax_); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -etaMax_, etaMax_); histEtaOfHltObjMatchToGen.push_back(tmphisto); if (!noPhiPlots_) { @@ -606,47 +525,41 @@ void EmDQM::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // sorted gen particle(s) histName = theHLTCollectionLabels[i].label() + "phi"; histTitle = HltHistTitle[i] + " phi"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -phiMax_, phiMax_); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -phiMax_, phiMax_); histPhiOfHltObjMatchToGen.push_back(tmphisto); } histName = theHLTCollectionLabels[i].label() + "etaphi"; histTitle = HltHistTitle[i] + " eta-phi"; - tmphisto = iBooker.book2D(histName.c_str(), histTitle.c_str(), - nbins2D_ - 2, -eta2DMax_, eta2DMax_, nbins2D_, - -phi2DMax_, phi2DMax_); + tmphisto = iBooker.book2D( + histName.c_str(), histTitle.c_str(), nbins2D_ - 2, -eta2DMax_, eta2DMax_, nbins2D_, -phi2DMax_, phi2DMax_); histEtaPhiOfHltObjMatchToGen.push_back(tmphisto); } // Et distribution of gen object matching HLT object passing filter i histName = theHLTCollectionLabels[i].label() + "et_MC_matched"; histTitle = HltHistTitle[i] + " Et (MC matched)"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - plotPtMin, plotPtMax); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, plotPtMin, plotPtMax); ethistmatch.push_back(tmphisto); // Eta distribution of gen object matching HLT object passing filter i histName = theHLTCollectionLabels[i].label() + "eta_MC_matched"; histTitle = HltHistTitle[i] + " #eta (MC matched)"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -etaMax_, etaMax_); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -etaMax_, etaMax_); etahistmatch.push_back(tmphisto); if (!noPhiPlots_) { // Phi distribution of gen object matching HLT object passing filter i histName = theHLTCollectionLabels[i].label() + "phi_MC_matched"; histTitle = HltHistTitle[i] + " #phi (MC matched)"; - tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, - -phiMax_, phiMax_); + tmphisto = iBooker.book1D(histName.c_str(), histTitle.c_str(), nbins_, -phiMax_, phiMax_); phihistmatch.push_back(tmphisto); } histName = theHLTCollectionLabels[i].label() + "etaphi_MC_matched"; histTitle = HltHistTitle[i] + " #eta-#phi (MC matched)"; - tmphisto = iBooker.book2D(histName.c_str(), histTitle.c_str(), - nbins2D_ - 2, -eta2DMax_, eta2DMax_, nbins2D_, - -phi2DMax_, phi2DMax_); + tmphisto = iBooker.book2D( + histName.c_str(), histTitle.c_str(), nbins2D_ - 2, -eta2DMax_, eta2DMax_, nbins2D_, -phi2DMax_, phi2DMax_); etaphihistmatch.push_back(tmphisto); } @@ -706,15 +619,13 @@ bool EmDQM::checkGeneratedParticlesRequirement(const edm::Event &event) { std::vector allSortedGenParticles; - for (edm::View::const_iterator currentGenParticle = - genParticles->begin(); - currentGenParticle != genParticles->end(); currentGenParticle++) { - + for (edm::View::const_iterator currentGenParticle = genParticles->begin(); + currentGenParticle != genParticles->end(); + currentGenParticle++) { // TODO: do we need to check the states here again ? // in principle, there should collections produced with the python // configuration (other than 'genParticles') which fulfill these criteria - if (!(abs((*currentGenParticle).pdgId()) == pdgGen && - (*currentGenParticle).status() == 1 && + if (!(abs((*currentGenParticle).pdgId()) == pdgGen && (*currentGenParticle).status() == 1 && (*currentGenParticle).et() > 2.0)) continue; @@ -726,8 +637,7 @@ bool EmDQM::checkGeneratedParticlesRequirement(const edm::Event &event) { allSortedGenParticles.push_back(tmpcand); } - std::sort(allSortedGenParticles.begin(), allSortedGenParticles.end(), - pTGenComparator_); + std::sort(allSortedGenParticles.begin(), allSortedGenParticles.end(), pTGenComparator_); // return false if not enough particles found if (allSortedGenParticles.size() < gencut_) @@ -741,8 +651,7 @@ bool EmDQM::checkGeneratedParticlesRequirement(const edm::Event &event) { // Loop over them to see if the top gen particles have eta within acceptance // bool keepEvent = true; for (unsigned int i = 0; i < gencut_; i++) { - bool inECALgap = fabs(allSortedGenParticles[i].eta()) > 1.4442 && - fabs(allSortedGenParticles[i].eta()) < 1.556; + bool inECALgap = fabs(allSortedGenParticles[i].eta()) > 1.4442 && fabs(allSortedGenParticles[i].eta()) < 1.556; if ((fabs(allSortedGenParticles[i].eta()) > genEtaAcc_) || inECALgap) { // edm::LogWarning("EmDQM") << "Throwing event away. Gen particle with // pdgId="<< allSortedGenParticles[i].pdgId() <<"; et="<< @@ -766,21 +675,21 @@ bool EmDQM::checkRecoParticlesRequirement(const edm::Event &event) { // get the right data according to the trigger path currently looked at if (autoConfMode_) { switch (reqNum) { - case 1: - if (pdgGen == 11) - event.getByToken(gencutColl_fidWenu_token, referenceParticles); - else - event.getByToken(gencutColl_fidGammaJet_token, referenceParticles); - break; - case 2: - if (pdgGen == 11) - event.getByToken(gencutColl_fidZee_token, referenceParticles); - else - event.getByToken(gencutColl_fidDiGamma_token, referenceParticles); - break; - case 3: - event.getByToken(gencutColl_fidTripleEle_token, referenceParticles); - break; + case 1: + if (pdgGen == 11) + event.getByToken(gencutColl_fidWenu_token, referenceParticles); + else + event.getByToken(gencutColl_fidGammaJet_token, referenceParticles); + break; + case 2: + if (pdgGen == 11) + event.getByToken(gencutColl_fidZee_token, referenceParticles); + else + event.getByToken(gencutColl_fidDiGamma_token, referenceParticles); + break; + case 3: + event.getByToken(gencutColl_fidTripleEle_token, referenceParticles); + break; } } else { event.getByToken(gencutColl_manualConf_token, referenceParticles); @@ -793,8 +702,7 @@ bool EmDQM::checkRecoParticlesRequirement(const edm::Event &event) { std::vector allSortedReferenceParticles; - for (edm::View::const_iterator currentReferenceParticle = - referenceParticles->begin(); + for (edm::View::const_iterator currentReferenceParticle = referenceParticles->begin(); currentReferenceParticle != referenceParticles->end(); currentReferenceParticle++) { if (currentReferenceParticle->et() <= 2.0) @@ -825,8 +733,8 @@ bool EmDQM::checkRecoParticlesRequirement(const edm::Event &event) { void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { // loop over all the trigger path parameter sets unsigned int vPos = 0; - for (std::vector::iterator psetIt = paramSets.begin(); - psetIt != paramSets.end(); ++psetIt, ++vPos) { + for (std::vector::iterator psetIt = paramSets.begin(); psetIt != paramSets.end(); + ++psetIt, ++vPos) { SetVarsFromPSet(psetIt); // get the set forthe current path hltCollectionLabelsFound = hltCollectionLabelsFoundPerPath.at(vPos); @@ -840,21 +748,21 @@ void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { edm::Handle> cutCounter; if (autoConfMode_) { switch (reqNum) { - case 1: - if (pdgGen == 11) - event.getByToken(gencutColl_fidWenu_token, cutCounter); - else - event.getByToken(gencutColl_fidGammaJet_token, cutCounter); - break; - case 2: - if (pdgGen == 11) - event.getByToken(gencutColl_fidZee_token, cutCounter); - else - event.getByToken(gencutColl_fidDiGamma_token, cutCounter); - break; - case 3: - event.getByToken(gencutColl_fidTripleEle_token, cutCounter); - break; + case 1: + if (pdgGen == 11) + event.getByToken(gencutColl_fidWenu_token, cutCounter); + else + event.getByToken(gencutColl_fidGammaJet_token, cutCounter); + break; + case 2: + if (pdgGen == 11) + event.getByToken(gencutColl_fidZee_token, cutCounter); + else + event.getByToken(gencutColl_fidDiGamma_token, cutCounter); + break; + case 3: + event.getByToken(gencutColl_fidTripleEle_token, cutCounter); + break; } } else { event.getByToken(gencutColl_manualConf_token, cutCounter); @@ -871,11 +779,10 @@ void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { event.getByToken(triggerObject_token, triggerObj); if (!triggerObj.isValid()) { if (verbosity_ >= OUTPUT_WARNINGS) - edm::LogWarning("EmDQM") - << "parameter triggerobject (" << triggerObject_ - << ") does not corresond to a valid TriggerEventWithRefs product. " - "Please check especially the process name (e.g. when running " - "over reprocessed datasets)"; + edm::LogWarning("EmDQM") << "parameter triggerobject (" << triggerObject_ + << ") does not corresond to a valid TriggerEventWithRefs product. " + "Please check especially the process name (e.g. when running " + "over reprocessed datasets)"; continue; } @@ -888,7 +795,7 @@ void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { // uninterpretable results... if (!checkRecoParticlesRequirement(event)) continue; - } else { // MC + } else { // MC // if no, throw event away if (!checkGeneratedParticlesRequirement(event)) continue; @@ -911,12 +818,9 @@ void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { // matches std::vector sortedGen; - for (edm::View::const_iterator genpart = - cutCounter->begin(); - genpart != cutCounter->end(); genpart++) { - reco::Particle tmpcand(genpart->charge(), genpart->p4(), - genpart->vertex(), genpart->pdgId(), - genpart->status()); + for (edm::View::const_iterator genpart = cutCounter->begin(); genpart != cutCounter->end(); + genpart++) { + reco::Particle tmpcand(genpart->charge(), genpart->p4(), genpart->vertex(), genpart->pdgId(), genpart->status()); if (tmpcand.et() >= plotEtMin) { sortedGen.push_back(tmpcand); } @@ -932,27 +836,23 @@ void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { sortedGen.erase(sortedGen.begin() + gencut_, sortedGen.end()); for (unsigned int i = 0; i < gencut_; i++) { - etgens.at(vPos)->Fill( - sortedGen[i].et()); // validity has been implicitily checked by the - // cut on gencut_ above + etgens.at(vPos)->Fill(sortedGen[i].et()); // validity has been implicitily checked by the + // cut on gencut_ above if (sortedGen[i].et() > minEtForEtaEffPlot_) { etagens.at(vPos)->Fill(sortedGen[i].eta()); if (!noPhiPlots_) phigens.at(vPos)->Fill(sortedGen[i].phi()); etaphigens.at(vPos)->Fill(sortedGen[i].eta(), sortedGen[i].phi()); } - } // END of loop over Generated particles + } // END of loop over Generated particles if (gencut_ >= reqNum && !mcMatchedOnly_) - totals.at(vPos)->Fill( - numOfHLTCollectionLabels + - 1.5); // this isn't really needed anymore keep for backward comp. + totals.at(vPos)->Fill(numOfHLTCollectionLabels + + 1.5); // this isn't really needed anymore keep for backward comp. if (gencut_ >= reqNum) - totalmatchs.at(vPos)->Fill( - numOfHLTCollectionLabels + - 1.5); // this isn't really needed anymore keep for backward comp. + totalmatchs.at(vPos)->Fill(numOfHLTCollectionLabels + + 1.5); // this isn't really needed anymore keep for backward comp. - bool accepted = - true; // flags that the event has been accepted by all filters before + bool accepted = true; // flags that the event has been accepted by all filters before edm::Handle hltResults; event.getByToken(hltResults_token, hltResults); //////////////////////////////////////////////////////////// @@ -963,48 +863,39 @@ void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { // requires for this filter if (sortedGen.size() < nCandCuts.at(n)) { if (verbosity_ >= OUTPUT_ERRORS) - edm::LogError("EmDQM") - << "There are less generated particles than the module '" - << theHLTCollectionLabels[n].label() << "' requires."; + edm::LogError("EmDQM") << "There are less generated particles than the module '" + << theHLTCollectionLabels[n].label() << "' requires."; continue; } std::vector sortedGenForFilter(sortedGen); - sortedGenForFilter.erase(sortedGenForFilter.begin() + nCandCuts.at(n), - sortedGenForFilter.end()); + sortedGenForFilter.erase(sortedGenForFilter.begin() + nCandCuts.at(n), sortedGenForFilter.end()); // Fill only if this filter was run. if (pathIndex != 0 && - hltConfig_.moduleIndex(pathIndex, theHLTCollectionLabels[n].label()) > - hltResults->index(pathIndex)) + hltConfig_.moduleIndex(pathIndex, theHLTCollectionLabels[n].label()) > hltResults->index(pathIndex)) break; // These numbers are from the Parameter Set, such as: // theHLTOutputTypes = cms.uint32(100) switch (theHLTOutputTypes[n]) { - case trigger::TriggerL1NoIsoEG: // Non-isolated Level 1 - histoFillerL1NonIso->fillHistos(triggerObj, event, vPos, n, - sortedGenForFilter, accepted); - break; - case trigger::TriggerL1IsoEG: // Isolated Level 1 - histoFillerL1Iso->fillHistos(triggerObj, event, vPos, n, - sortedGenForFilter, accepted); - break; - case trigger::TriggerPhoton: // Photon - histoFillerPho->fillHistos(triggerObj, event, vPos, n, - sortedGenForFilter, accepted); - break; - case trigger::TriggerElectron: // Electron - histoFillerEle->fillHistos(triggerObj, event, vPos, n, - sortedGenForFilter, accepted); - break; - case trigger::TriggerCluster: // TriggerCluster - histoFillerClu->fillHistos(triggerObj, event, vPos, n, - sortedGenForFilter, accepted); - break; - default: - throw(cms::Exception("Release Validation Error") - << "HLT output type not implemented: theHLTOutputTypes[n]"); + case trigger::TriggerL1NoIsoEG: // Non-isolated Level 1 + histoFillerL1NonIso->fillHistos(triggerObj, event, vPos, n, sortedGenForFilter, accepted); + break; + case trigger::TriggerL1IsoEG: // Isolated Level 1 + histoFillerL1Iso->fillHistos(triggerObj, event, vPos, n, sortedGenForFilter, accepted); + break; + case trigger::TriggerPhoton: // Photon + histoFillerPho->fillHistos(triggerObj, event, vPos, n, sortedGenForFilter, accepted); + break; + case trigger::TriggerElectron: // Electron + histoFillerEle->fillHistos(triggerObj, event, vPos, n, sortedGenForFilter, accepted); + break; + case trigger::TriggerCluster: // TriggerCluster + histoFillerClu->fillHistos(triggerObj, event, vPos, n, sortedGenForFilter, accepted); + break; + default: + throw(cms::Exception("Release Validation Error") << "HLT output type not implemented: theHLTOutputTypes[n]"); } - } // END of loop over filter modules + } // END of loop over filter modules // earse the dummy and fill with real set hltCollectionLabelsFoundPerPath.at(vPos) = hltCollectionLabelsFound; @@ -1017,15 +908,15 @@ void EmDQM::analyze(const edm::Event &event, const edm::EventSetup &setup) { // Called by analyze method. // //////////////////////////////////////////////////////////////////////////////// template -void HistoFiller::fillHistos( - edm::Handle &triggerObj, - const edm::Event &iEvent, unsigned int vPos, unsigned int n, - std::vector &sortedGen, bool &accepted) { +void HistoFiller::fillHistos(edm::Handle &triggerObj, + const edm::Event &iEvent, + unsigned int vPos, + unsigned int n, + std::vector &sortedGen, + bool &accepted) { std::vector> recoecalcands; - if ((triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]) >= - triggerObj->size())) { // only process if available - dqm->hltCollectionLabelsMissed.insert( - dqm->theHLTCollectionLabels[n].encode()); + if ((triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]) >= triggerObj->size())) { // only process if available + dqm->hltCollectionLabelsMissed.insert(dqm->theHLTCollectionLabels[n].encode()); accepted = false; return; } @@ -1036,22 +927,19 @@ void HistoFiller::fillHistos( // Retrieve saved filter objects // //////////////////////////////////////////////////////////// triggerObj->getObjects( - triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), - dqm->theHLTOutputTypes[n], recoecalcands); + triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), dqm->theHLTOutputTypes[n], recoecalcands); // Danger: special case, L1 non-isolated // needs to be merged with L1 iso if (dqm->theHLTOutputTypes[n] == trigger::TriggerL1NoIsoEG) { std::vector> isocands; - triggerObj->getObjects( - triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), - trigger::TriggerL1IsoEG, isocands); + triggerObj->getObjects(triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), trigger::TriggerL1IsoEG, isocands); if (!isocands.empty()) { for (unsigned int i = 0; i < isocands.size(); i++) recoecalcands.push_back(isocands[i]); } - } // END of if theHLTOutputTypes == 82 + } // END of if theHLTOutputTypes == 82 - if (recoecalcands.empty()) { // stop if no object passed the previous filter + if (recoecalcands.empty()) { // stop if no object passed the previous filter accepted = false; return; } @@ -1067,12 +955,11 @@ void HistoFiller::fillHistos( for (unsigned int j = 0; j < recoecalcands.size(); j++) { if (!(recoecalcands.at(j).isAvailable())) { if (dqm->verbosity_ >= dqm->OUTPUT_ERRORS) - edm::LogError("EmDQMInvalidRefs") - << "Event content inconsistent: TriggerEventWithRefs contains " - "invalid Refs. Invalid refs for: " - << dqm->theHLTCollectionLabels[n].label() - << ". The collection that this module uses may has been dropped in " - "the event."; + edm::LogError("EmDQMInvalidRefs") << "Event content inconsistent: TriggerEventWithRefs contains " + "invalid Refs. Invalid refs for: " + << dqm->theHLTCollectionLabels[n].label() + << ". The collection that this module uses may has been dropped in " + "the event."; return; } } @@ -1089,8 +976,7 @@ void HistoFiller::fillHistos( float closestDeltaR = 0.5; int closestEcalCandIndex = -1; for (unsigned int j = 0; j < recoecalcands.size(); j++) { - float deltaR = - DeltaR(recoecalcands[j]->momentum(), currentGenParticleMomentum); + float deltaR = DeltaR(recoecalcands[j]->momentum(), currentGenParticleMomentum); if (deltaR < closestDeltaR) { closestDeltaR = deltaR; @@ -1101,17 +987,13 @@ void HistoFiller::fillHistos( // If an HLT object was found within some delta-R // of this gen particle, store it in a histogram if (closestEcalCandIndex >= 0) { - dqm->histEtOfHltObjMatchToGens.at(vPos).at(n)->Fill( - recoecalcands[closestEcalCandIndex]->et()); - dqm->histEtaOfHltObjMatchToGens.at(vPos).at(n)->Fill( - recoecalcands[closestEcalCandIndex]->eta()); + dqm->histEtOfHltObjMatchToGens.at(vPos).at(n)->Fill(recoecalcands[closestEcalCandIndex]->et()); + dqm->histEtaOfHltObjMatchToGens.at(vPos).at(n)->Fill(recoecalcands[closestEcalCandIndex]->eta()); if (!dqm->noPhiPlots_) - dqm->histPhiOfHltObjMatchToGens.at(vPos).at(n)->Fill( - recoecalcands[closestEcalCandIndex]->phi()); - dqm->histEtaPhiOfHltObjMatchToGens.at(vPos).at(n)->Fill( - recoecalcands[closestEcalCandIndex]->eta(), - recoecalcands[closestEcalCandIndex]->phi()); - } // END of if closestEcalCandIndex >= 0 + dqm->histPhiOfHltObjMatchToGens.at(vPos).at(n)->Fill(recoecalcands[closestEcalCandIndex]->phi()); + dqm->histEtaPhiOfHltObjMatchToGens.at(vPos).at(n)->Fill(recoecalcands[closestEcalCandIndex]->eta(), + recoecalcands[closestEcalCandIndex]->phi()); + } // END of if closestEcalCandIndex >= 0 } //////////////////////////////////////////////////////////// @@ -1144,8 +1026,7 @@ void HistoFiller::fillHistos( dqm->etahists.at(vPos).at(n)->Fill(recoecalcands[i]->eta()); if (!dqm->noPhiPlots_) dqm->phihists.at(vPos).at(n)->Fill(recoecalcands[i]->phi()); - dqm->etaphihists.at(vPos).at(n)->Fill(recoecalcands[i]->eta(), - recoecalcands[i]->phi()); + dqm->etaphihists.at(vPos).at(n)->Fill(recoecalcands[i]->eta(), recoecalcands[i]->phi()); } } @@ -1155,7 +1036,7 @@ void HistoFiller::fillHistos( unsigned int matchedMcParts = 0; float mindist = 0.3; if (n == 0) - mindist = 0.5; // low L1-resolution => allow wider matching + mindist = 0.5; // low L1-resolution => allow wider matching for (unsigned int i = 0; i < dqm->nCandCuts.at(n); ++i) { // match generator candidate bool matchThis = false; @@ -1168,8 +1049,7 @@ void HistoFiller::fillHistos( closestDr = dr; // closest = trigOb; } - if (closestDr > - mindist) { // it's not really a "match" if it's that far away + if (closestDr > mindist) { // it's not really a "match" if it's that far away // closest = -1; } else { matchedMcParts++; @@ -1178,7 +1058,7 @@ void HistoFiller::fillHistos( } if (!matchThis) { accepted = false; - continue; // only plot matched candidates + continue; // only plot matched candidates } // fill coordinates of mc particle matching trigger object dqm->ethistmatchs.at(vPos).at(n)->Fill(sortedGen[i].et()); @@ -1186,8 +1066,7 @@ void HistoFiller::fillHistos( dqm->etahistmatchs.at(vPos).at(n)->Fill(sortedGen[i].eta()); if (!dqm->noPhiPlots_) dqm->phihistmatchs.at(vPos).at(n)->Fill(sortedGen[i].phi()); - dqm->etaphihistmatchs.at(vPos).at(n)->Fill(sortedGen[i].eta(), - sortedGen[i].phi()); + dqm->etaphihistmatchs.at(vPos).at(n)->Fill(sortedGen[i].eta(), sortedGen[i].phi()); } } // fill total mc matched efficiency @@ -1199,8 +1078,8 @@ void HistoFiller::fillHistos( void EmDQM::endRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { // loop over all the trigger path parameter sets unsigned int vPos = 0; - for (std::vector::iterator psetIt = paramSets.begin(); - psetIt != paramSets.end(); ++psetIt, ++vPos) { + for (std::vector::iterator psetIt = paramSets.begin(); psetIt != paramSets.end(); + ++psetIt, ++vPos) { SetVarsFromPSet(psetIt); // print information about hltCollectionLabels which were not found @@ -1214,7 +1093,7 @@ void EmDQM::endRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { // never found labelsNeverFound.push_back(tag.encode()); - } // loop over all tags which were missed at least once + } // loop over all tags which were missed at least once if (labelsNeverFound.empty()) continue; @@ -1225,8 +1104,7 @@ void EmDQM::endRun(edm::Run const &iRun, edm::EventSetup const &iSetup) { // (note that this could also be because the corresponding // trigger path slowly fades out to zero efficiency) if (verbosity_ >= OUTPUT_WARNINGS) - edm::LogWarning("EmDQM") - << "There were some HLTCollectionLabels which were never found:"; + edm::LogWarning("EmDQM") << "There were some HLTCollectionLabels which were never found:"; for (auto const &tag : labelsNeverFound) { if (verbosity_ >= OUTPUT_ALL) @@ -1240,8 +1118,7 @@ int EmDQM::countSubstring(const std::string &str, const std::string &sub) { if (sub.length() == 0) return 0; int count = 0; - for (size_t offset = str.find(sub); offset != std::string::npos; - offset = str.find(sub, offset + sub.length())) { + for (size_t offset = str.find(sub); offset != std::string::npos; offset = str.find(sub, offset + sub.length())) { ++count; } return count; @@ -1253,11 +1130,10 @@ std::vector> EmDQM::findEgammaPaths() { std::vector> Paths(5); // Loop over all paths in the menu for (unsigned int i = 0; i < hltConfig_.size(); i++) { - std::string path = hltConfig_.triggerName(i); // Find electron and photon paths and classify them - if (int(path.find("HLT_")) == 0) { // Path should start with 'HLT_' + if (int(path.find("HLT_")) == 0) { // Path should start with 'HLT_' int scCount = countSubstring(path, "_SC"); int eleCount = countSubstring(path, "Ele"); @@ -1265,39 +1141,37 @@ std::vector> EmDQM::findEgammaPaths() { int doubleSCCount = countSubstring(path, "DiSC"); int tripleEleCount = countSubstring(path, "TripleEle"); int photonCount = countSubstring(path, "hoton"); - int doublePhotonCount = countSubstring(path, "DoublePhoton") + - countSubstring(path, "Diphoton"); + int doublePhotonCount = countSubstring(path, "DoublePhoton") + countSubstring(path, "Diphoton"); - int totEleCount = 2 * tripleEleCount + doubleEleCount + eleCount + - scCount + 2 * doubleSCCount; + int totEleCount = 2 * tripleEleCount + doubleEleCount + eleCount + scCount + 2 * doubleSCCount; int totPhotonCount = doublePhotonCount + photonCount; if (totEleCount + totPhotonCount < 1) continue; switch (totEleCount) { - case 1: - Paths[TYPE_SINGLE_ELE].push_back(path); - // std::cout << "Electron \t" << path << std::endl; - break; - case 2: - Paths[TYPE_DOUBLE_ELE].push_back(path); - // std::cout << "DoubleElectron \t" << path << std::endl; - break; - case 3: - Paths[TYPE_TRIPLE_ELE].push_back(path); - // std::cout << "TripleElectron \t" << path << std::endl; - break; + case 1: + Paths[TYPE_SINGLE_ELE].push_back(path); + // std::cout << "Electron \t" << path << std::endl; + break; + case 2: + Paths[TYPE_DOUBLE_ELE].push_back(path); + // std::cout << "DoubleElectron \t" << path << std::endl; + break; + case 3: + Paths[TYPE_TRIPLE_ELE].push_back(path); + // std::cout << "TripleElectron \t" << path << std::endl; + break; } switch (totPhotonCount) { - case 1: - Paths[TYPE_SINGLE_PHOTON].push_back(path); - // std::cout << "Photon \t\t" << path << std::endl; - break; - case 2: - Paths[TYPE_DOUBLE_PHOTON].push_back(path); - // std::cout << "DoublePhoton \t" << path << std::endl; - break; + case 1: + Paths[TYPE_SINGLE_PHOTON].push_back(path); + // std::cout << "Photon \t\t" << path << std::endl; + break; + case 2: + Paths[TYPE_DOUBLE_PHOTON].push_back(path); + // std::cout << "DoublePhoton \t" << path << std::endl; + break; } } // std::cout << i << " triggerName: " << path << " containing " << @@ -1315,16 +1189,14 @@ std::vector EmDQM::getFilterModules(const std::string &path) { // Loop over all modules in the path for (unsigned int i = 0; i < hltConfig_.size(path); i++) { - std::string module = hltConfig_.moduleLabel(path, i); std::string moduleType = hltConfig_.moduleType(module); std::string moduleEDMType = hltConfig_.moduleEDMType(module); // Find filters if (moduleEDMType == "EDFilter" || - moduleType.find("Filter") != - std::string::npos) { // older samples may not have EDMType data - // included + moduleType.find("Filter") != std::string::npos) { // older samples may not have EDMType data + // included filters.push_back(module); // std::cout << i << " moduleLabel: " << module << " moduleType: " // << moduleType << " moduleEDMType: " << moduleEDMType << std::endl; @@ -1350,30 +1222,25 @@ double EmDQM::getPrimaryEtCut(const std::string &path) { //---------------------------------------------------------------------- -edm::ParameterSet -EmDQM::makePSetForL1SeedFilter(const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForL1SeedFilter(const std::string &moduleName) { // generates a PSet to analyze the behaviour of an L1 seed. // // moduleName is the name of the HLT module which filters // on the L1 seed. edm::ParameterSet retPSet; - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>( - "IsoCollections", std::vector(1, std::string("none"))); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", + std::vector(1, std::string("none"))); retPSet.addParameter("theHLTOutputTypes", trigger::TriggerL1NoIsoEG); // as HLTLevel1GTSeed has no parameter ncandcut we determine the value from // the name of the filter - int orCount = - countSubstring(moduleName, "OR") + countSubstring(moduleName, "Or"); + int orCount = countSubstring(moduleName, "OR") + countSubstring(moduleName, "Or"); int egCount = countSubstring(moduleName, "EG"); int dEgCount = countSubstring(moduleName, "DoubleEG"); int tEgCount = countSubstring(moduleName, "TripleEG"); @@ -1383,34 +1250,33 @@ EmDQM::makePSetForL1SeedFilter(const std::string &moduleName) { // first and if not take the lowest number. If this is not successful, let the // path name decide if (orCount > 0 && candCount > 0) { - if (egCount % (orCount + 1) == 0 && dEgCount % (orCount + 1) == 0 && - tEgCount % (orCount + 1) == 0) + if (egCount % (orCount + 1) == 0 && dEgCount % (orCount + 1) == 0 && tEgCount % (orCount + 1) == 0) candCount /= (orCount + 1); else if (egCount - dEgCount - tEgCount > 0) - candCount = 1; // at least one singleEG present + candCount = 1; // at least one singleEG present else if (dEgCount > 0) - candCount = 2; // at least one doubleEG and no singleEG present + candCount = 2; // at least one doubleEG and no singleEG present else if (tEgCount > 0) - candCount = 3; // only tripleEG present + candCount = 3; // only tripleEG present else candCount = -1; } switch (candCount) { - case 0: - retPSet.addParameter("ncandcut", 0); - break; - case 1: - retPSet.addParameter("ncandcut", 1); - break; - case 2: - retPSet.addParameter("ncandcut", 2); - break; - case 3: - retPSet.addParameter("ncandcut", 3); - break; - default: - retPSet.addParameter("ncandcut", -1); + case 0: + retPSet.addParameter("ncandcut", 0); + break; + case 1: + retPSet.addParameter("ncandcut", 1); + break; + case 2: + retPSet.addParameter("ncandcut", 2); + break; + case 3: + retPSet.addParameter("ncandcut", 3); + break; + default: + retPSet.addParameter("ncandcut", -1); } return retPSet; @@ -1418,8 +1284,7 @@ EmDQM::makePSetForL1SeedFilter(const std::string &moduleName) { //---------------------------------------------------------------------- -edm::ParameterSet EmDQM::makePSetForL1SeedToSuperClusterMatchFilter( - const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForL1SeedToSuperClusterMatchFilter(const std::string &moduleName) { // generates a PSet to analyze the behaviour of L1 to supercluster match // filter. // @@ -1428,19 +1293,14 @@ edm::ParameterSet EmDQM::makePSetForL1SeedToSuperClusterMatchFilter( // edm::ParameterSet retPSet; - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>( - "IsoCollections", std::vector(1, std::string("none"))); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", + std::vector(1, std::string("none"))); retPSet.addParameter("theHLTOutputTypes", trigger::TriggerCluster); - retPSet.addParameter( - "ncandcut", - hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); + retPSet.addParameter("ncandcut", hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); return retPSet; } @@ -1450,84 +1310,63 @@ edm::ParameterSet EmDQM::makePSetForL1SeedToSuperClusterMatchFilter( edm::ParameterSet EmDQM::makePSetForEtFilter(const std::string &moduleName) { edm::ParameterSet retPSet; - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>( - "IsoCollections", std::vector(1, std::string("none"))); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", + std::vector(1, std::string("none"))); retPSet.addParameter("theHLTOutputTypes", trigger::TriggerCluster); - retPSet.addParameter( - "ncandcut", - hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); + retPSet.addParameter("ncandcut", hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); return retPSet; } //---------------------------------------------------------------------- -edm::ParameterSet -EmDQM::makePSetForOneOEMinusOneOPFilter(const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForOneOEMinusOneOPFilter(const std::string &moduleName) { edm::ParameterSet retPSet; - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>( - "IsoCollections", std::vector(1, std::string("none"))); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", + std::vector(1, std::string("none"))); retPSet.addParameter("theHLTOutputTypes", trigger::TriggerElectron); - retPSet.addParameter( - "ncandcut", - hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); + retPSet.addParameter("ncandcut", hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); return retPSet; } //---------------------------------------------------------------------- -edm::ParameterSet -EmDQM::makePSetForPixelMatchFilter(const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForPixelMatchFilter(const std::string &moduleName) { edm::ParameterSet retPSet; - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>( - "IsoCollections", std::vector(1, std::string("none"))); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", + std::vector(1, std::string("none"))); retPSet.addParameter("theHLTOutputTypes", trigger::TriggerCluster); - retPSet.addParameter( - "ncandcut", - hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); + retPSet.addParameter("ncandcut", hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); return retPSet; } //---------------------------------------------------------------------- -edm::ParameterSet -EmDQM::makePSetForEgammaDoubleEtDeltaPhiFilter(const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForEgammaDoubleEtDeltaPhiFilter(const std::string &moduleName) { edm::ParameterSet retPSet; - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>( - "IsoCollections", std::vector(1, std::string("none"))); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", + std::vector(1, std::string("none"))); retPSet.addParameter("theHLTOutputTypes", trigger::TriggerCluster); retPSet.addParameter("ncandcut", 2); @@ -1536,8 +1375,7 @@ EmDQM::makePSetForEgammaDoubleEtDeltaPhiFilter(const std::string &moduleName) { //---------------------------------------------------------------------- -edm::ParameterSet -EmDQM::makePSetForEgammaGenericFilter(const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForEgammaGenericFilter(const std::string &moduleName) { edm::ParameterSet retPSet; // example usages of HLTEgammaGenericFilter are: @@ -1553,8 +1391,7 @@ EmDQM::makePSetForEgammaGenericFilter(const std::string &moduleName) { // infer the type of filter by the type of the producer which // generates the collection used to cut on this - edm::InputTag varTag = - hltConfig_.modulePSet(moduleName).getParameter("varTag"); + edm::InputTag varTag = hltConfig_.modulePSet(moduleName).getParameter("varTag"); // edm::InputTag nonIsoTag = // hltConfig_.modulePSet(moduleName).getParameter(""); // std::cout @@ -1596,54 +1433,39 @@ EmDQM::makePSetForEgammaGenericFilter(const std::string &moduleName) { // the following cases seem to have identical PSets ? //-------------------- - if (inputType == "EgammaHLTR9Producer" || // R9 shape - inputType == "EgammaHLTR9IDProducer" || // R9 ID - inputType == "EgammaHLTClusterShapeProducer" || // cluster shape - inputType == "EgammaHLTEcalRecIsolationProducer" || // ecal isolation - inputType == - "EgammaHLTHcalIsolationProducersRegional" || // HCAL isolation and HE - inputType == - "EgammaHLTGsfTrackVarProducer" || // GSF track deta and dphi filter - inputType == - "EgammaHLTBcHcalIsolationProducersRegional" || // HCAL isolation and - // HE - inputType == - "EgammaHLTEcalPFClusterIsolationProducer" || // ECAL PF isolation - // filter - inputType == - "EgammaHLTHcalPFClusterIsolationProducer" || // HCAL PF isolation - // filter - inputType == - "EgammaHLTElectronTrackIsolationProducers" // Track isolation filter + if (inputType == "EgammaHLTR9Producer" || // R9 shape + inputType == "EgammaHLTR9IDProducer" || // R9 ID + inputType == "EgammaHLTClusterShapeProducer" || // cluster shape + inputType == "EgammaHLTEcalRecIsolationProducer" || // ecal isolation + inputType == "EgammaHLTHcalIsolationProducersRegional" || // HCAL isolation and HE + inputType == "EgammaHLTGsfTrackVarProducer" || // GSF track deta and dphi filter + inputType == "EgammaHLTBcHcalIsolationProducersRegional" || // HCAL isolation and + // HE + inputType == "EgammaHLTEcalPFClusterIsolationProducer" || // ECAL PF isolation + // filter + inputType == "EgammaHLTHcalPFClusterIsolationProducer" || // HCAL PF isolation + // filter + inputType == "EgammaHLTElectronTrackIsolationProducers" // Track isolation filter ) { - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>("IsoCollections", - isoCollections); - retPSet.addParameter( - "ncandcut", - hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", isoCollections); + retPSet.addParameter("ncandcut", hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); return retPSet; } if (verbosity_ >= OUTPUT_ERRORS) - edm::LogError("EmDQM") - << "Can't determine what the HLTEgammaGenericFilter '" << moduleName - << "' should do: uses a collection produced by a module of C++ type '" - << inputType << "'."; + edm::LogError("EmDQM") << "Can't determine what the HLTEgammaGenericFilter '" << moduleName + << "' should do: uses a collection produced by a module of C++ type '" << inputType << "'."; return edm::ParameterSet(); } //---------------------------------------------------------------------- -edm::ParameterSet -EmDQM::makePSetForEgammaGenericQuadraticFilter(const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForEgammaGenericQuadraticFilter(const std::string &moduleName) { edm::ParameterSet retPSet; // example usages of HLTEgammaGenericFilter are: @@ -1659,8 +1481,7 @@ EmDQM::makePSetForEgammaGenericQuadraticFilter(const std::string &moduleName) { // infer the type of filter by the type of the producer which // generates the collection used to cut on this - edm::InputTag varTag = - hltConfig_.modulePSet(moduleName).getParameter("varTag"); + edm::InputTag varTag = hltConfig_.modulePSet(moduleName).getParameter("varTag"); // edm::InputTag nonIsoTag = // hltConfig_.modulePSet(moduleName).getParameter("nonIsoTag"); // std::cout << "varTag.label " << varTag.label() << " nonIsoTag.label " << @@ -1701,54 +1522,39 @@ EmDQM::makePSetForEgammaGenericQuadraticFilter(const std::string &moduleName) { // the following cases seem to have identical PSets ? //-------------------- - if (inputType == "EgammaHLTR9Producer" || // R9 shape - inputType == "EgammaHLTR9IDProducer" || // R9 ID - inputType == "EgammaHLTClusterShapeProducer" || // cluster shape - inputType == "EgammaHLTEcalRecIsolationProducer" || // ecal isolation - inputType == - "EgammaHLTHcalIsolationProducersRegional" || // HCAL isolation and HE - inputType == - "EgammaHLTBcHcalIsolationProducersRegional" || // HCAL isolation and - // HE - inputType == - "EgammaHLTEcalPFClusterIsolationProducer" || // ECAL PF isolation - // filter - inputType == - "EgammaHLTHcalPFClusterIsolationProducer" || // HCAL PF isolation - // filter - inputType == - "EgammaHLTPhotonTrackIsolationProducersRegional" // Photon track - // isolation + if (inputType == "EgammaHLTR9Producer" || // R9 shape + inputType == "EgammaHLTR9IDProducer" || // R9 ID + inputType == "EgammaHLTClusterShapeProducer" || // cluster shape + inputType == "EgammaHLTEcalRecIsolationProducer" || // ecal isolation + inputType == "EgammaHLTHcalIsolationProducersRegional" || // HCAL isolation and HE + inputType == "EgammaHLTBcHcalIsolationProducersRegional" || // HCAL isolation and + // HE + inputType == "EgammaHLTEcalPFClusterIsolationProducer" || // ECAL PF isolation + // filter + inputType == "EgammaHLTHcalPFClusterIsolationProducer" || // HCAL PF isolation + // filter + inputType == "EgammaHLTPhotonTrackIsolationProducersRegional" // Photon track + // isolation ) { - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>("IsoCollections", - isoCollections); - retPSet.addParameter( - "ncandcut", - hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", isoCollections); + retPSet.addParameter("ncandcut", hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); return retPSet; } if (verbosity_ >= OUTPUT_ERRORS) - edm::LogError("EmDQM") - << "Can't determine what the HLTEgammaGenericQuadraticFilter '" - << moduleName - << "' should do: uses a collection produced by a module of C++ type '" - << inputType << "'."; + edm::LogError("EmDQM") << "Can't determine what the HLTEgammaGenericQuadraticFilter '" << moduleName + << "' should do: uses a collection produced by a module of C++ type '" << inputType << "'."; return edm::ParameterSet(); } //---------------------------------------------------------------------- -edm::ParameterSet -EmDQM::makePSetForElectronGenericFilter(const std::string &moduleName) { +edm::ParameterSet EmDQM::makePSetForElectronGenericFilter(const std::string &moduleName) { edm::ParameterSet retPSet; // example usages of HLTElectronGenericFilter are: @@ -1761,8 +1567,7 @@ EmDQM::makePSetForElectronGenericFilter(const std::string &moduleName) { // infer the type of filter by the type of the producer which // generates the collection used to cut on this - edm::InputTag varTag = - hltConfig_.modulePSet(moduleName).getParameter("varTag"); + edm::InputTag varTag = hltConfig_.modulePSet(moduleName).getParameter("varTag"); // edm::InputTag nonIsoTag = // hltConfig_.modulePSet(moduleName).getParameter("nonIsoTag"); // std::cout << "varTag.label " << varTag.label() << " nonIsoTag.label " << @@ -1803,39 +1608,29 @@ EmDQM::makePSetForElectronGenericFilter(const std::string &moduleName) { // note that whether deta or dphi is used is determined from // the product instance (not the module label) - if (inputType == - "EgammaHLTElectronDetaDphiProducer" || // deta and dphi filter - inputType == "EgammaHLTElectronTrackIsolationProducers" // track isolation + if (inputType == "EgammaHLTElectronDetaDphiProducer" || // deta and dphi filter + inputType == "EgammaHLTElectronTrackIsolationProducers" // track isolation ) { - retPSet.addParameter>("PlotBounds", - std::vector(2, 0.0)); + retPSet.addParameter>("PlotBounds", std::vector(2, 0.0)); // retPSet.addParameter("HLTCollectionLabels", // edm::InputTag(moduleName, "", processName_)); - retPSet.addParameter( - "HLTCollectionLabels", - edm::InputTag(moduleName, "", triggerObject_.process())); - retPSet.addParameter>("IsoCollections", - isoCollections); - retPSet.addParameter( - "ncandcut", - hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); + retPSet.addParameter("HLTCollectionLabels", edm::InputTag(moduleName, "", triggerObject_.process())); + retPSet.addParameter>("IsoCollections", isoCollections); + retPSet.addParameter("ncandcut", hltConfig_.modulePSet(moduleName).getParameter("ncandcut")); return retPSet; } if (verbosity_ >= OUTPUT_ERRORS) - edm::LogError("EmDQM") - << "Can't determine what the HLTElectronGenericFilter '" << moduleName - << "' should do: uses a collection produced by a module of C++ type '" - << inputType << "'."; + edm::LogError("EmDQM") << "Can't determine what the HLTElectronGenericFilter '" << moduleName + << "' should do: uses a collection produced by a module of C++ type '" << inputType << "'."; return edm::ParameterSet(); } //---------------------------------------------------------------------- void EmDQM::SetVarsFromPSet(std::vector::iterator psetIt) { - dirname_ = "HLT/HLTEgammaValidation/" + - psetIt->getParameter("@module_label"); + dirname_ = "HLT/HLTEgammaValidation/" + psetIt->getParameter("@module_label"); pathIndex = psetIt->getUntrackedParameter("pathIndex", 0); // parameters for generator study @@ -1854,8 +1649,7 @@ void EmDQM::SetVarsFromPSet(std::vector::iterator psetIt) { // Read in the Vector of Parameter Sets. // // Information for each filter-step // //////////////////////////////////////////////////////////// - std::vector filters = - psetIt->getParameter>("filters"); + std::vector filters = psetIt->getParameter>("filters"); // empty vectors of parameters from previous paths theHLTCollectionLabels.clear(); @@ -1867,26 +1661,20 @@ void EmDQM::SetVarsFromPSet(std::vector::iterator psetIt) { nCandCuts.clear(); int i = 0; - for (std::vector::iterator filterconf = filters.begin(); - filterconf != filters.end(); filterconf++) { - - theHLTCollectionLabels.push_back( - filterconf->getParameter("HLTCollectionLabels")); - theHLTOutputTypes.push_back( - filterconf->getParameter("theHLTOutputTypes")); + for (std::vector::iterator filterconf = filters.begin(); filterconf != filters.end(); + filterconf++) { + theHLTCollectionLabels.push_back(filterconf->getParameter("HLTCollectionLabels")); + theHLTOutputTypes.push_back(filterconf->getParameter("theHLTOutputTypes")); // Grab the human-readable name, if it is not specified, use the Collection // Label theHLTCollectionHumanNames.push_back( - filterconf->getUntrackedParameter( - "HLTCollectionHumanName", theHLTCollectionLabels[i].label())); + filterconf->getUntrackedParameter("HLTCollectionHumanName", theHLTCollectionLabels[i].label())); - std::vector bounds = - filterconf->getParameter>("PlotBounds"); + std::vector bounds = filterconf->getParameter>("PlotBounds"); // If the size of plot "bounds" vector != 2, abort assert(bounds.size() == 2); plotBounds.push_back(std::pair(bounds[0], bounds[1])); - isoNames.push_back( - filterconf->getParameter>("IsoCollections")); + isoNames.push_back(filterconf->getParameter>("IsoCollections")); // for (unsigned int i=0; i::iterator psetIt) { } nCandCuts.push_back(filterconf->getParameter("ncandcut")); i++; - } // END of loop over parameter sets + } // END of loop over parameter sets // Record number of HLTCollectionLabels numOfHLTCollectionLabels = theHLTCollectionLabels.size(); diff --git a/HLTriggerOffline/Egamma/src/EmDQMPostProcessor.cc b/HLTriggerOffline/Egamma/src/EmDQMPostProcessor.cc index 30e435fee911b..ec61a48391746 100644 --- a/HLTriggerOffline/Egamma/src/EmDQMPostProcessor.cc +++ b/HLTriggerOffline/Egamma/src/EmDQMPostProcessor.cc @@ -28,14 +28,12 @@ EmDQMPostProcessor::EmDQMPostProcessor(const edm::ParameterSet &pset) { //---------------------------------------------------------------------- -void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, - DQMStore::IGetter &igetter) { +void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { // go to the directory to be processed if (igetter.dirExists(subDir_)) ibooker.cd(subDir_); else { - edm::LogWarning("EmDQMPostProcessor") - << "cannot find directory: " << subDir_ << " , skipping"; + edm::LogWarning("EmDQMPostProcessor") << "cannot find directory: " << subDir_ << " , skipping"; return; } @@ -72,8 +70,8 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, //////////////////////////////////////////////////////// std::vector postfixes; - postfixes.push_back(""); // unmatched histograms - postfixes.push_back("_RECO_matched"); // for data + postfixes.push_back(""); // unmatched histograms + postfixes.push_back("_RECO_matched"); // for data // we put this on the list even when we're running on // data (where there is no generator information). // The first test in the loop will then fail and @@ -85,18 +83,15 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, int nPhoton = 0; // find the number of electron and photon paths - for (std::vector::iterator dir = subdirectories.begin(); - dir != subdirectories.end(); ++dir) { - if (dir->find("Ele") != std::string::npos || - dir->find("_SC") != std::string::npos) + for (std::vector::iterator dir = subdirectories.begin(); dir != subdirectories.end(); ++dir) { + if (dir->find("Ele") != std::string::npos || dir->find("_SC") != std::string::npos) ++nEle; else if (dir->find("Photon") != std::string::npos) ++nPhoton; } std::vector allPhotonPaths; - for (std::vector::iterator postfix = postfixes.begin(); - postfix != postfixes.end(); postfix++) { + for (std::vector::iterator postfix = postfixes.begin(); postfix != postfixes.end(); postfix++) { bool pop = false; int elePos = 1; int photonPos = 1; @@ -109,20 +104,15 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, std::string baseName = "total_eff" + *postfix; std::string allEleHistoName = "EfficiencyByPath_Ele" + *postfix; - std::string allEleHistoLabel = - "Efficiency_for_each_validated_electron_path" + *postfix; - allElePaths.push_back(new TProfile(allEleHistoName.c_str(), - allEleHistoLabel.c_str(), nEle, 0., - (double)nEle, 0., 1.2)); + std::string allEleHistoLabel = "Efficiency_for_each_validated_electron_path" + *postfix; + allElePaths.push_back( + new TProfile(allEleHistoName.c_str(), allEleHistoLabel.c_str(), nEle, 0., (double)nEle, 0., 1.2)); std::string allPhotonHistoName = "EfficiencyByPath_Photon" + *postfix; - std::string allPhotonHistoLabel = - "Efficiency_for_each_validated_photon_path" + *postfix; - allPhotonPaths.push_back(new TProfile(allPhotonHistoName.c_str(), - allPhotonHistoLabel.c_str(), nPhoton, - 0., (double)nPhoton, 0., 1.2)); - - for (std::vector::iterator dir = subdirectories.begin(); - dir != subdirectories.end(); dir++) { + std::string allPhotonHistoLabel = "Efficiency_for_each_validated_photon_path" + *postfix; + allPhotonPaths.push_back( + new TProfile(allPhotonHistoName.c_str(), allPhotonHistoLabel.c_str(), nPhoton, 0., (double)nPhoton, 0., 1.2)); + + for (std::vector::iterator dir = subdirectories.begin(); dir != subdirectories.end(); dir++) { ibooker.cd(*dir); // get the current trigger name @@ -143,16 +133,12 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, TH1F *genHist = getHistogram(ibooker, igetter, genName); if (genHist->GetEntries() == 0) { edm::LogInfo("EmDQMPostProcessor") - << "Zero events were selected for path '" << trigName - << "'. No efficiency plots will be generated."; - if (trigName.find("Ele") != std::string::npos || - trigName.find("_SC") != std::string::npos) { - allElePaths.back()->GetXaxis()->SetBinLabel(elePos, - trigName.c_str()); + << "Zero events were selected for path '" << trigName << "'. No efficiency plots will be generated."; + if (trigName.find("Ele") != std::string::npos || trigName.find("_SC") != std::string::npos) { + allElePaths.back()->GetXaxis()->SetBinLabel(elePos, trigName.c_str()); ++elePos; } else if (trigName.find("Photon") != std::string::npos) { - allPhotonPaths.back()->GetXaxis()->SetBinLabel(photonPos, - trigName.c_str()); + allPhotonPaths.back()->GetXaxis()->SetBinLabel(photonPos, trigName.c_str()); ++photonPos; } ibooker.goUp(); @@ -160,8 +146,7 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, } } - TH1F *basehist = - getHistogram(ibooker, igetter, ibooker.pwd() + "/" + baseName); + TH1F *basehist = getHistogram(ibooker, igetter, ibooker.pwd() + "/" + baseName); if (basehist == nullptr) { // edm::LogWarning("EmDQMPostProcessor") << "histogram " << // (ibooker.pwd() + "/" + baseName) << " does not exist, skipping @@ -175,10 +160,13 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, pop = false; ibooker.goUp(); - MonitorElement *meTotal = ibooker.bookProfile( - trigName + "__" + histoName, trigName + "__" + histoName, - basehist->GetXaxis()->GetNbins(), basehist->GetXaxis()->GetXmin(), - basehist->GetXaxis()->GetXmax(), 0., 1.2); + MonitorElement *meTotal = ibooker.bookProfile(trigName + "__" + histoName, + trigName + "__" + histoName, + basehist->GetXaxis()->GetNbins(), + basehist->GetXaxis()->GetXmin(), + basehist->GetXaxis()->GetXmax(), + 0., + 1.2); meTotal->setEfficiencyFlag(); TProfile *total = meTotal->getTProfile(); ibooker.cd(*dir); @@ -199,26 +187,25 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, errorh = 0; error = 0; if (basehist->GetBinContent(bin - 1) != 0) { - Efficiency((int)basehist->GetBinContent(bin), - (int)basehist->GetBinContent(bin - 1), 0.683, value, - errorl, errorh); - error = - value - errorl > errorh - value ? value - errorl : errorh - value; + Efficiency( + (int)basehist->GetBinContent(bin), (int)basehist->GetBinContent(bin - 1), 0.683, value, errorl, errorh); + error = value - errorl > errorh - value ? value - errorl : errorh - value; } total->SetBinContent(bin, value); total->SetBinEntries(bin, 1); total->SetBinError(bin, sqrt(value * value + error * error)); - total->GetXaxis()->SetBinLabel(bin, - basehist->GetXaxis()->GetBinLabel(bin)); + total->GetXaxis()->SetBinLabel(bin, basehist->GetXaxis()->GetBinLabel(bin)); } // set first bin to L1 efficiency if (basehist->GetBinContent(basehist->GetNbinsX()) != 0) { Efficiency((int)basehist->GetBinContent(1), - (int)basehist->GetBinContent(basehist->GetNbinsX()), 0.683, - value, errorl, errorh); - error = - value - errorl > errorh - value ? value - errorl : errorh - value; + (int)basehist->GetBinContent(basehist->GetNbinsX()), + 0.683, + value, + errorl, + errorh); + error = value - errorl > errorh - value ? value - errorl : errorh - value; } else { value = 0; error = 0; @@ -230,39 +217,38 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, // total efficiency relative to gen or reco if (basehist->GetBinContent(basehist->GetNbinsX()) != 0) { Efficiency((int)basehist->GetBinContent(basehist->GetNbinsX() - 2), - (int)basehist->GetBinContent(basehist->GetNbinsX()), 0.683, - value, errorl, errorh); - error = - value - errorl > errorh - value ? value - errorl : errorh - value; + (int)basehist->GetBinContent(basehist->GetNbinsX()), + 0.683, + value, + errorl, + errorh); + error = value - errorl > errorh - value ? value - errorl : errorh - value; } else { value = 0; error = 0; } total->SetBinContent(total->GetNbinsX(), value); total->SetBinEntries(total->GetNbinsX(), 1); - total->SetBinError(total->GetNbinsX(), - sqrt(value * value + error * error)); - total->GetXaxis()->SetBinLabel( - total->GetNbinsX(), - ("total efficiency rel. " + shortReferenceName).c_str()); + total->SetBinError(total->GetNbinsX(), sqrt(value * value + error * error)); + total->GetXaxis()->SetBinLabel(total->GetNbinsX(), ("total efficiency rel. " + shortReferenceName).c_str()); // total efficiency relative to L1 if (basehist->GetBinContent(1) != 0) { Efficiency((int)basehist->GetBinContent(basehist->GetNbinsX() - 2), - (int)basehist->GetBinContent(1), 0.683, value, errorl, + (int)basehist->GetBinContent(1), + 0.683, + value, + errorl, errorh); - error = - value - errorl > errorh - value ? value - errorl : errorh - value; + error = value - errorl > errorh - value ? value - errorl : errorh - value; } else { value = 0; error = 0; } total->SetBinContent(total->GetNbinsX() - 1, value); - total->SetBinError(total->GetNbinsX() - 1, - sqrt(value * value + error * error)); + total->SetBinError(total->GetNbinsX() - 1, sqrt(value * value + error * error)); total->SetBinEntries(total->GetNbinsX() - 1, 1); - total->GetXaxis()->SetBinLabel(total->GetNbinsX() - 1, - "total efficiency rel. L1"); + total->GetXaxis()->SetBinLabel(total->GetNbinsX() - 1, "total efficiency rel. L1"); //---------------------------------------- @@ -287,9 +273,7 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, // Get the L1 over gen filter first filterName2 = total->GetXaxis()->GetBinLabel(1); // loop over variables (eta/phi/et) - for (std::vector::iterator var = varNames.begin(); - var != varNames.end(); var++) { - + for (std::vector::iterator var = varNames.begin(); var != varNames.end(); var++) { numName = ibooker.pwd() + "/" + filterName2 + *var + *postfix; if (normalizeToReco) @@ -298,18 +282,23 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, genName = ibooker.pwd() + "/gen_" + *var; if ((*var).find("etaphi") != std::string::npos) { - if (!dividehistos2D( - ibooker, igetter, numName, genName, - "efficiency_" + filterName2 + "_vs_" + *var + *postfix, *var, - "eff. of" + filterName2 + " vs " + *var + *postfix)) + if (!dividehistos2D(ibooker, + igetter, + numName, + genName, + "efficiency_" + filterName2 + "_vs_" + *var + *postfix, + *var, + "eff. of" + filterName2 + " vs " + *var + *postfix)) break; - } else if (!dividehistos( - ibooker, igetter, numName, genName, - "efficiency_" + filterName2 + "_vs_" + *var + *postfix, - *var, - "eff. of" + filterName2 + " vs " + *var + *postfix)) + } else if (!dividehistos(ibooker, + igetter, + numName, + genName, + "efficiency_" + filterName2 + "_vs_" + *var + *postfix, + *var, + "eff. of" + filterName2 + " vs " + *var + *postfix)) break; - } // loop over variables + } // loop over variables // get the filter names from the bin-labels of the master-histogram for (int filter = 1; filter < total->GetNbinsX() - 2; filter++) { @@ -317,88 +306,89 @@ void EmDQMPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, filterName2 = total->GetXaxis()->GetBinLabel(filter + 1); // loop over variables (eta/et/phi) - for (std::vector::iterator var = varNames.begin(); - var != varNames.end(); var++) { + for (std::vector::iterator var = varNames.begin(); var != varNames.end(); var++) { numName = ibooker.pwd() + "/" + filterName2 + *var + *postfix; denomName = ibooker.pwd() + "/" + filterName + *var + *postfix; // Is this the last filter? Book efficiency vs gen (or reco, for data) // level std::string temp = *postfix; - if (filter == total->GetNbinsX() - 3 && - temp.find("matched") != std::string::npos) { + if (filter == total->GetNbinsX() - 3 && temp.find("matched") != std::string::npos) { if (normalizeToReco) genName = ibooker.pwd() + "/reco_" + *var; else genName = ibooker.pwd() + "/gen_" + *var; if ((*var).find("etaphi") != std::string::npos) { - if (!dividehistos2D(ibooker, igetter, numName, genName, - "final_eff_vs_" + *var, *var, - "Efficiency Compared to " + - shortReferenceName + " vs " + *var)) + if (!dividehistos2D(ibooker, + igetter, + numName, + genName, + "final_eff_vs_" + *var, + *var, + "Efficiency Compared to " + shortReferenceName + " vs " + *var)) break; - } else if (!dividehistos(ibooker, igetter, numName, genName, - "final_eff_vs_" + *var, *var, - "Efficiency Compared to " + - shortReferenceName + " vs " + *var)) + } else if (!dividehistos(ibooker, + igetter, + numName, + genName, + "final_eff_vs_" + *var, + *var, + "Efficiency Compared to " + shortReferenceName + " vs " + *var)) break; } if ((*var).find("etaphi") != std::string::npos) { - if (!dividehistos2D( - ibooker, igetter, numName, denomName, - "efficiency_" + filterName2 + "_vs_" + *var + *postfix, - *var, - "efficiency_" + filterName2 + "_vs_" + *var + *postfix)) + if (!dividehistos2D(ibooker, + igetter, + numName, + denomName, + "efficiency_" + filterName2 + "_vs_" + *var + *postfix, + *var, + "efficiency_" + filterName2 + "_vs_" + *var + *postfix)) break; - } else if (!dividehistos(ibooker, igetter, numName, denomName, - "efficiency_" + filterName2 + "_vs_" + *var + - *postfix, + } else if (!dividehistos(ibooker, + igetter, + numName, + denomName, + "efficiency_" + filterName2 + "_vs_" + *var + *postfix, *var, - "efficiency_" + filterName2 + "_vs_" + *var + - *postfix)) + "efficiency_" + filterName2 + "_vs_" + *var + *postfix)) break; - } // loop over variables - } // loop over monitoring modules within path + } // loop over variables + } // loop over monitoring modules within path ibooker.goUp(); // fill overall efficiency histograms double totCont = total->GetBinContent(total->GetNbinsX()); double totErr = total->GetBinError(total->GetNbinsX()); - if (trigName.find("Ele") != std::string::npos || - trigName.find("_SC") != std::string::npos) { + if (trigName.find("Ele") != std::string::npos || trigName.find("_SC") != std::string::npos) { allElePaths.back()->SetBinContent(elePos, totCont); allElePaths.back()->SetBinEntries(elePos, 1); - allElePaths.back()->SetBinError( - elePos, sqrt(totCont * totCont + totErr * totErr)); + allElePaths.back()->SetBinError(elePos, sqrt(totCont * totCont + totErr * totErr)); allElePaths.back()->GetXaxis()->SetBinLabel(elePos, trigName.c_str()); ++elePos; } else if (trigName.find("Photon") != std::string::npos) { allPhotonPaths.back()->SetBinContent(photonPos, totCont); allPhotonPaths.back()->SetBinEntries(photonPos, 1); - allPhotonPaths.back()->SetBinError( - photonPos, sqrt(totCont * totCont + totErr * totErr)); - allPhotonPaths.back()->GetXaxis()->SetBinLabel(photonPos, - trigName.c_str()); + allPhotonPaths.back()->SetBinError(photonPos, sqrt(totCont * totCont + totErr * totErr)); + allPhotonPaths.back()->GetXaxis()->SetBinLabel(photonPos, trigName.c_str()); ++photonPos; } - } // loop over dirs + } // loop over dirs if (pop) { allElePaths.pop_back(); allPhotonPaths.pop_back(); } else { allElePaths.back()->GetXaxis()->SetLabelSize(0.03); allPhotonPaths.back()->GetXaxis()->SetLabelSize(0.03); - ibooker.bookProfile(allEleHistoName, allElePaths.back()) - ->setEfficiencyFlag(); - ibooker.bookProfile(allPhotonHistoName, allPhotonPaths.back()) - ->setEfficiencyFlag(); + ibooker.bookProfile(allEleHistoName, allElePaths.back())->setEfficiencyFlag(); + ibooker.bookProfile(allPhotonHistoName, allPhotonPaths.back())->setEfficiencyFlag(); } - } // loop over postfixes + } // loop over postfixes } //---------------------------------------------------------------------- @@ -418,12 +408,10 @@ TProfile *EmDQMPostProcessor::dividehistos(DQMStore::IBooker &ibooker, TH1F *denom = getHistogram(ibooker, igetter, denomName); if (num == nullptr) - edm::LogWarning("EmDQMPostProcessor") - << "numerator histogram " << numName << " does not exist"; + edm::LogWarning("EmDQMPostProcessor") << "numerator histogram " << numName << " does not exist"; if (denom == nullptr) - edm::LogWarning("EmDQMPostProcessor") - << "denominator histogram " << denomName << " does not exist"; + edm::LogWarning("EmDQMPostProcessor") << "denominator histogram " << denomName << " does not exist"; // Check if histograms actually exist @@ -431,8 +419,7 @@ TProfile *EmDQMPostProcessor::dividehistos(DQMStore::IBooker &ibooker, return nullptr; MonitorElement *meOut = ibooker.bookProfile( - outName, titel, num->GetXaxis()->GetNbins(), num->GetXaxis()->GetXmin(), - num->GetXaxis()->GetXmax(), 0., 1.2); + outName, titel, num->GetXaxis()->GetNbins(), num->GetXaxis()->GetXmin(), num->GetXaxis()->GetXmax(), 0., 1.2); meOut->setEfficiencyFlag(); TProfile *out = meOut->getTProfile(); out->GetXaxis()->SetTitle(label.c_str()); @@ -445,8 +432,7 @@ TProfile *EmDQMPostProcessor::dividehistos(DQMStore::IBooker &ibooker, out->SetStats(kFALSE); for (int i = 1; i <= num->GetNbinsX(); i++) { double e, low, high; - Efficiency((int)num->GetBinContent(i), (int)denom->GetBinContent(i), 0.683, - e, low, high); + Efficiency((int)num->GetBinContent(i), (int)denom->GetBinContent(i), 0.683, e, low, high); double err = e - low > high - e ? e - low : high - e; // here is the trick to store info in TProfile: out->SetBinContent(i, e); @@ -469,21 +455,23 @@ TH2F *EmDQMPostProcessor::dividehistos2D(DQMStore::IBooker &ibooker, // std::cout << denomName << std::endl; TH2F *denom = get2DHistogram(ibooker, igetter, denomName); if (num == nullptr) - edm::LogWarning("EmDQMPostProcessor") - << "2D numerator histogram " << numName << " does not exist"; + edm::LogWarning("EmDQMPostProcessor") << "2D numerator histogram " << numName << " does not exist"; if (denom == nullptr) - edm::LogWarning("EmDQMPostProcessor") - << "2D denominator histogram " << denomName << " does not exist"; + edm::LogWarning("EmDQMPostProcessor") << "2D denominator histogram " << denomName << " does not exist"; // Check if histograms actually exist if (num == nullptr || denom == nullptr) return nullptr; - MonitorElement *meOut = ibooker.book2D( - outName, titel, num->GetXaxis()->GetNbins(), num->GetXaxis()->GetXmin(), - num->GetXaxis()->GetXmax(), num->GetYaxis()->GetNbins(), - num->GetYaxis()->GetXmin(), num->GetYaxis()->GetXmax()); + MonitorElement *meOut = ibooker.book2D(outName, + titel, + num->GetXaxis()->GetNbins(), + num->GetXaxis()->GetXmin(), + num->GetXaxis()->GetXmax(), + num->GetYaxis()->GetNbins(), + num->GetYaxis()->GetXmin(), + num->GetYaxis()->GetXmax()); TH2F *out = meOut->getTH2F(); out->Add(num); out->Divide(denom); @@ -518,9 +506,8 @@ TH2F *EmDQMPostProcessor::get2DHistogram(DQMStore::IBooker &ibooker, //---------------------------------------------------------------------- -void EmDQMPostProcessor::Efficiency(int passing, int total, double level, - double &mode, double &lowerBound, - double &upperBound) { +void EmDQMPostProcessor::Efficiency( + int passing, int total, double level, double &mode, double &lowerBound, double &upperBound) { // protection (see also TGraphAsymmErrors::Efficiency(..), mimick the old // behaviour ) if (total == 0) { diff --git a/HLTriggerOffline/Egamma/src/EmDQMReco.cc b/HLTriggerOffline/Egamma/src/EmDQMReco.cc index 53662a657848e..874d7826fd9e5 100644 --- a/HLTriggerOffline/Egamma/src/EmDQMReco.cc +++ b/HLTriggerOffline/Egamma/src/EmDQMReco.cc @@ -45,10 +45,10 @@ using namespace ROOT::Math::VectorUtil; //---------------------------------------------------------------------- // class EmDQMReco::FourVectorMonitorElements //---------------------------------------------------------------------- -EmDQMReco::FourVectorMonitorElements::FourVectorMonitorElements( - EmDQMReco *_parent, DQMStore::IBooker &iBooker, - const std::string &histogramNameTemplate, - const std::string &histogramTitleTemplate) +EmDQMReco::FourVectorMonitorElements::FourVectorMonitorElements(EmDQMReco *_parent, + DQMStore::IBooker &iBooker, + const std::string &histogramNameTemplate, + const std::string &histogramTitleTemplate) : parent(_parent) { // introducing variables for better code readability later on std::string histName; @@ -58,28 +58,24 @@ EmDQMReco::FourVectorMonitorElements::FourVectorMonitorElements( histName = boost::str(boost::format(histogramNameTemplate) % "et"); histTitle = boost::str(boost::format(histogramTitleTemplate) % "E_{T}"); etMonitorElement = - iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, - parent->plotPtMin, parent->plotPtMax); + iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, parent->plotPtMin, parent->plotPtMax); // eta histName = boost::str(boost::format(histogramNameTemplate) % "eta"); histTitle = boost::str(boost::format(histogramTitleTemplate) % "#eta"); etaMonitorElement = - iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, - -parent->plotEtaMax, parent->plotEtaMax); + iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, -parent->plotEtaMax, parent->plotEtaMax); // phi histName = boost::str(boost::format(histogramNameTemplate) % "phi"); histTitle = boost::str(boost::format(histogramTitleTemplate) % "#phi"); phiMonitorElement = - iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, - -parent->plotPhiMax, parent->plotPhiMax); + iBooker.book1D(histName.c_str(), histTitle.c_str(), parent->plotBins, -parent->plotPhiMax, parent->plotPhiMax); } //---------------------------------------------------------------------- -void EmDQMReco::FourVectorMonitorElements::fill( - const math::XYZTLorentzVector &momentum) { +void EmDQMReco::FourVectorMonitorElements::fill(const math::XYZTLorentzVector &momentum) { etMonitorElement->Fill(momentum.Et()); etaMonitorElement->Fill(momentum.eta()); phiMonitorElement->Fill(momentum.phi()); @@ -94,8 +90,7 @@ EmDQMReco::EmDQMReco(const edm::ParameterSet &pset) { //////////////////////////////////////////////////////////// // Read from configuration file // //////////////////////////////////////////////////////////// - dirname_ = "HLT/HLTEgammaValidation/" + - pset.getParameter("@module_label"); + dirname_ = "HLT/HLTEgammaValidation/" + pset.getParameter("@module_label"); // parameters for generator study reqNum = pset.getParameter("reqNum"); @@ -108,25 +103,18 @@ EmDQMReco::EmDQMReco(const edm::ParameterSet &pset) { plotEtaMax = pset.getUntrackedParameter("EtaMax", 2.7); plotPhiMax = pset.getUntrackedParameter("PhiMax", 3.15); plotBins = pset.getUntrackedParameter("Nbins", 50); - useHumanReadableHistTitles = - pset.getUntrackedParameter("useHumanReadableHistTitles", false); + useHumanReadableHistTitles = pset.getUntrackedParameter("useHumanReadableHistTitles", false); - triggerNameRecoMonPath = pset.getUntrackedParameter( - "triggerNameRecoMonPath", "HLT_MinBias"); - processNameRecoMonPath = - pset.getUntrackedParameter("processNameRecoMonPath", "HLT"); + triggerNameRecoMonPath = pset.getUntrackedParameter("triggerNameRecoMonPath", "HLT_MinBias"); + processNameRecoMonPath = pset.getUntrackedParameter("processNameRecoMonPath", "HLT"); recoElectronsInput = consumes( - pset.getUntrackedParameter("recoElectrons", - edm::InputTag("gsfElectrons"))); - recoObjectsEBT = consumes>( - edm::InputTag("correctedHybridSuperClusters")); - recoObjectsEET = consumes>( - edm::InputTag("correctedMulti5x5SuperClustersWithPreshower")); - hltResultsT = consumes( - edm::InputTag("TriggerResults", "", processNameRecoMonPath)); - triggerObjT = consumes( - edm::InputTag("hltTriggerSummaryRAW")); + pset.getUntrackedParameter("recoElectrons", edm::InputTag("gsfElectrons"))); + recoObjectsEBT = consumes>(edm::InputTag("correctedHybridSuperClusters")); + recoObjectsEET = + consumes>(edm::InputTag("correctedMulti5x5SuperClustersWithPreshower")); + hltResultsT = consumes(edm::InputTag("TriggerResults", "", processNameRecoMonPath)); + triggerObjT = consumes(edm::InputTag("hltTriggerSummaryRAW")); // preselction cuts // recocutCollection_= pset.getParameter("cutcollection"); @@ -142,66 +130,52 @@ EmDQMReco::EmDQMReco(const edm::ParameterSet &pset) { // Read in the Vector of Parameter Sets. // // Information for each filter-step // //////////////////////////////////////////////////////////// - std::vector filters = - pset.getParameter>("filters"); + std::vector filters = pset.getParameter>("filters"); int i = 0; - for (std::vector::iterator filterconf = filters.begin(); - filterconf != filters.end(); filterconf++) { - - theHLTCollectionLabels.push_back( - filterconf->getParameter("HLTCollectionLabels")); - theHLTOutputTypes.push_back( - filterconf->getParameter("theHLTOutputTypes")); + for (std::vector::iterator filterconf = filters.begin(); filterconf != filters.end(); + filterconf++) { + theHLTCollectionLabels.push_back(filterconf->getParameter("HLTCollectionLabels")); + theHLTOutputTypes.push_back(filterconf->getParameter("theHLTOutputTypes")); // Grab the human-readable name, if it is not specified, use the Collection // Label theHLTCollectionHumanNames.push_back( - filterconf->getUntrackedParameter( - "HLTCollectionHumanName", theHLTCollectionLabels[i].label())); + filterconf->getUntrackedParameter("HLTCollectionHumanName", theHLTCollectionLabels[i].label())); - std::vector bounds = - filterconf->getParameter>("PlotBounds"); + std::vector bounds = filterconf->getParameter>("PlotBounds"); // If the size of plot "bounds" vector != 2, abort assert(bounds.size() == 2); plotBounds.push_back(std::pair(bounds[0], bounds[1])); - isoNames.push_back( - filterconf->getParameter>("IsoCollections")); + isoNames.push_back(filterconf->getParameter>("IsoCollections")); for (unsigned int i = 0; i < isoNames.back().size(); i++) { switch (theHLTOutputTypes.back()) { - case trigger::TriggerL1NoIsoEG: - histoFillerL1NonIso->isoNameTokens_.push_back( - consumes>>( - isoNames.back()[i])); - break; - case trigger::TriggerL1IsoEG: // Isolated Level 1 - histoFillerL1Iso->isoNameTokens_.push_back( - consumes>>( - isoNames.back()[i])); - break; - case trigger::TriggerPhoton: // Photon - histoFillerPho->isoNameTokens_.push_back( - consumes>>( - isoNames.back()[i])); - break; - case trigger::TriggerElectron: // Electron - histoFillerEle->isoNameTokens_.push_back( - consumes>>( - isoNames.back()[i])); - break; - case trigger::TriggerCluster: // TriggerCluster - histoFillerClu->isoNameTokens_.push_back( - consumes>>( - isoNames.back()[i])); - break; - default: - throw(cms::Exception("Release Validation Error") - << "HLT output type not implemented: theHLTOutputTypes[n]"); + case trigger::TriggerL1NoIsoEG: + histoFillerL1NonIso->isoNameTokens_.push_back( + consumes>>( + isoNames.back()[i])); + break; + case trigger::TriggerL1IsoEG: // Isolated Level 1 + histoFillerL1Iso->isoNameTokens_.push_back( + consumes>>( + isoNames.back()[i])); + break; + case trigger::TriggerPhoton: // Photon + histoFillerPho->isoNameTokens_.push_back( + consumes>>( + isoNames.back()[i])); + break; + case trigger::TriggerElectron: // Electron + histoFillerEle->isoNameTokens_.push_back( + consumes>>(isoNames.back()[i])); + break; + case trigger::TriggerCluster: // TriggerCluster + histoFillerClu->isoNameTokens_.push_back( + consumes>>( + isoNames.back()[i])); + break; + default: + throw(cms::Exception("Release Validation Error") << "HLT output type not implemented: theHLTOutputTypes[n]"); } } @@ -213,7 +187,7 @@ EmDQMReco::EmDQMReco(const edm::ParameterSet &pset) { plotiso.push_back(true); } i++; - } // END of loop over parameter sets + } // END of loop over parameter sets // Record number of HLTCollectionLabels numOfHLTCollectionLabels = theHLTCollectionLabels.size(); @@ -222,19 +196,15 @@ EmDQMReco::EmDQMReco(const edm::ParameterSet &pset) { /// /// /// -void EmDQMReco::dqmBeginRun(const edm::Run &iRun, - const edm::EventSetup &iSetup) { - - bool isHltConfigChanged = false; // change of cfg at run boundaries? - isHltConfigInitialized_ = - hltConfig_.init(iRun, iSetup, "HLT", isHltConfigChanged); +void EmDQMReco::dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) { + bool isHltConfigChanged = false; // change of cfg at run boundaries? + isHltConfigInitialized_ = hltConfig_.init(iRun, iSetup, "HLT", isHltConfigChanged); } //////////////////////////////////////////////////////////////////////////////// // book DQM histograms // //////////////////////////////////////////////////////////////////////////////// -void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, - edm::EventSetup const &iSetup) { +void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, edm::EventSetup const &iSetup) { // edm::Service fs; iBooker.setCurrentFolder(dirname_); @@ -248,9 +218,8 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, std::string histTitle = "total events passing"; // This plot will have bins equal to 2+(number of // HLTCollectionLabels in the config file) - totalreco = iBooker.book1D(histName.c_str(), histTitle.c_str(), - numOfHLTCollectionLabels + 2, 0, - numOfHLTCollectionLabels + 2); + totalreco = iBooker.book1D( + histName.c_str(), histTitle.c_str(), numOfHLTCollectionLabels + 2, 0, numOfHLTCollectionLabels + 2); totalreco->setBinLabel(numOfHLTCollectionLabels + 1, "Total"); totalreco->setBinLabel(numOfHLTCollectionLabels + 2, "Reco"); for (unsigned int u = 0; u < numOfHLTCollectionLabels; u++) { @@ -259,9 +228,8 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, histName = "total_eff_RECO_matched"; histTitle = "total events passing (Reco matched)"; - totalmatchreco = iBooker.book1D(histName.c_str(), histTitle.c_str(), - numOfHLTCollectionLabels + 2, 0, - numOfHLTCollectionLabels + 2); + totalmatchreco = iBooker.book1D( + histName.c_str(), histTitle.c_str(), numOfHLTCollectionLabels + 2, 0, numOfHLTCollectionLabels + 2); totalmatchreco->setBinLabel(numOfHLTCollectionLabels + 1, "Total"); totalmatchreco->setBinLabel(numOfHLTCollectionLabels + 2, "Reco"); for (unsigned int u = 0; u < numOfHLTCollectionLabels; u++) { @@ -276,41 +244,41 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, //////////////////////////////////////////////////////////// std::string pdgIdString; switch (pdgGen) { - case 11: - pdgIdString = "Electron"; - break; - case 22: - pdgIdString = "Photon"; - break; - default: - pdgIdString = "Particle"; + case 11: + pdgIdString = "Electron"; + break; + case 22: + pdgIdString = "Photon"; + break; + default: + pdgIdString = "Particle"; } //-------------------- // reco // (note that reset(..) must be used to set the value of the scoped_ptr...) - histReco.reset( - new FourVectorMonitorElements(this, iBooker, - "reco_%s", // pattern for histogram name - "%s of " + pdgIdString + "s")); + histReco.reset(new FourVectorMonitorElements(this, + iBooker, + "reco_%s", // pattern for histogram name + "%s of " + pdgIdString + "s")); //-------------------- // monpath - histRecoMonpath.reset(new FourVectorMonitorElements( - this, iBooker, - "reco_%s_monpath", // pattern for histogram name - "%s of " + pdgIdString + "s monpath")); + histRecoMonpath.reset(new FourVectorMonitorElements(this, + iBooker, + "reco_%s_monpath", // pattern for histogram name + "%s of " + pdgIdString + "s monpath")); //-------------------- // TODO: WHAT ARE THESE HISTOGRAMS FOR ? THEY SEEM NEVER REFERENCED ANYWHERE // IN THIS FILE... final X monpath - histMonpath.reset(new FourVectorMonitorElements( - this, iBooker, - "final_%s_monpath", // pattern for histogram name - "Final %s Monpath")); + histMonpath.reset(new FourVectorMonitorElements(this, + iBooker, + "final_%s_monpath", // pattern for histogram name + "Final %s Monpath")); //-------------------- @@ -320,8 +288,7 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // Determine what strings to use for histogram titles std::vector HltHistTitle; - if (theHLTCollectionHumanNames.size() == numOfHLTCollectionLabels && - useHumanReadableHistTitles) { + if (theHLTCollectionHumanNames.size() == numOfHLTCollectionLabels && useHumanReadableHistTitles) { HltHistTitle = theHLTCollectionHumanNames; } else { for (unsigned int i = 0; i < numOfHLTCollectionLabels; i++) { @@ -356,9 +323,10 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // phiHist.push_back(tmphisto); standardHist.push_back(new FourVectorMonitorElements( - this, iBooker, - theHLTCollectionLabels[i].label() + "%s_all", // histogram name - HltHistTitle[i] + " %s (ALL)" // histogram title + this, + iBooker, + theHLTCollectionLabels[i].label() + "%s_all", // histogram name + HltHistTitle[i] + " %s (ALL)" // histogram title )); //-------------------- @@ -386,9 +354,10 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // iBooker.book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax); // phiHistMatchReco.push_back(tmphisto); histMatchReco.push_back(new FourVectorMonitorElements( - this, iBooker, - theHLTCollectionLabels[i].label() + "%s_RECO_matched", // histogram name - HltHistTitle[i] + " %s (RECO matched)" // histogram title + this, + iBooker, + theHLTCollectionLabels[i].label() + "%s_RECO_matched", // histogram name + HltHistTitle[i] + " %s (RECO matched)" // histogram title )); //-------------------- @@ -419,10 +388,10 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // phiHistMatchRecoMonPath.push_back(tmphisto); histMatchRecoMonPath.push_back(new FourVectorMonitorElements( - this, iBooker, - theHLTCollectionLabels[i].label() + - "%s_RECO_matched_monpath", // histogram name - HltHistTitle[i] + " %s (RECO matched, monpath)" // histogram title + this, + iBooker, + theHLTCollectionLabels[i].label() + "%s_RECO_matched_monpath", // histogram name + HltHistTitle[i] + " %s (RECO matched, monpath)" // histogram title )); //-------------------- // distributions of HLT object that is closest delta-R match to sorted reco @@ -451,9 +420,10 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // histPhiOfHltObjMatchToReco.push_back(tmphisto); histHltObjMatchToReco.push_back(new FourVectorMonitorElements( - this, iBooker, - theHLTCollectionLabels[i].label() + "%s_reco", // histogram name - HltHistTitle[i] + " %s (reco)" // histogram title + this, + iBooker, + theHLTCollectionLabels[i].label() + "%s_reco", // histogram name + HltHistTitle[i] + " %s (reco)" // histogram title )); //-------------------- @@ -473,7 +443,6 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, histPhiIsoOfHltObjMatchToReco.push_back(tmpiso); } else { - //-------------------- // 2D plot: Isolation values vs X for all objects //-------------------- @@ -481,25 +450,40 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // X = eta histName = theHLTCollectionLabels[i].label() + "eta_isolation_all"; histTitle = HltHistTitle[i] + " isolation vs #eta (all)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - -plotEtaMax, plotEtaMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + -plotEtaMax, + plotEtaMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); etahistiso.push_back(tmpiso); // X = et histName = theHLTCollectionLabels[i].label() + "et_isolation_all"; histTitle = HltHistTitle[i] + " isolation vs Et (all)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - plotPtMin, plotPtMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + plotPtMin, + plotPtMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); ethistiso.push_back(tmpiso); // X = phi histName = theHLTCollectionLabels[i].label() + "phi_isolation_all"; histTitle = HltHistTitle[i] + " isolation vs #phi (all)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - -plotPhiMax, plotPhiMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + -plotPhiMax, + plotPhiMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); phiHistIso.push_back(tmpiso); //-------------------- @@ -507,30 +491,42 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, //-------------------- // X = eta - histName = - theHLTCollectionLabels[i].label() + "eta_isolation_RECO_matched"; + histName = theHLTCollectionLabels[i].label() + "eta_isolation_RECO_matched"; histTitle = HltHistTitle[i] + " isolation vs #eta (reco matched)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - -plotEtaMax, plotEtaMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + -plotEtaMax, + plotEtaMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); etahistisomatchreco.push_back(tmpiso); // X = et - histName = - theHLTCollectionLabels[i].label() + "et_isolation_RECO_matched"; + histName = theHLTCollectionLabels[i].label() + "et_isolation_RECO_matched"; histTitle = HltHistTitle[i] + " isolation vs Et (reco matched)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - plotPtMin, plotPtMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + plotPtMin, + plotPtMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); ethistisomatchreco.push_back(tmpiso); // X = eta - histName = - theHLTCollectionLabels[i].label() + "phi_isolation_RECO_matched"; + histName = theHLTCollectionLabels[i].label() + "phi_isolation_RECO_matched"; histTitle = HltHistTitle[i] + " isolation vs #phi (reco matched)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - -plotPhiMax, plotPhiMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + -plotPhiMax, + plotPhiMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); phiHistIsoMatchReco.push_back(tmpiso); //-------------------- @@ -541,29 +537,44 @@ void EmDQMReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, // X = eta histName = theHLTCollectionLabels[i].label() + "eta_isolation_reco"; histTitle = HltHistTitle[i] + " isolation vs #eta (reco)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - -plotEtaMax, plotEtaMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + -plotEtaMax, + plotEtaMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); histEtaIsoOfHltObjMatchToReco.push_back(tmpiso); // X = et histName = theHLTCollectionLabels[i].label() + "et_isolation_reco"; histTitle = HltHistTitle[i] + " isolation vs Et (reco)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - plotPtMin, plotPtMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + plotPtMin, + plotPtMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); histEtIsoOfHltObjMatchToReco.push_back(tmpiso); // X = phi histName = theHLTCollectionLabels[i].label() + "phi_isolation_reco"; histTitle = HltHistTitle[i] + " isolation vs #phi (reco)"; - tmpiso = iBooker.book2D(histName.c_str(), histTitle.c_str(), plotBins, - -plotPhiMax, plotPhiMax, plotBins, - plotBounds[i].first, plotBounds[i].second); + tmpiso = iBooker.book2D(histName.c_str(), + histTitle.c_str(), + plotBins, + -plotPhiMax, + plotPhiMax, + plotBins, + plotBounds[i].first, + plotBounds[i].second); histPhiIsoOfHltObjMatchToReco.push_back(tmpiso); //-------------------- - } // END of HLT histograms + } // END of HLT histograms } } @@ -576,7 +587,6 @@ EmDQMReco::~EmDQMReco() {} // method called to for each event // //////////////////////////////////////////////////////////////////////////////// void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { - // protect from hlt config failure if (!isHltConfigInitialized_) return; @@ -590,7 +600,6 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { edm::Handle> recoObjectsEE; if (pdgGen == 11) { - event.getByToken(recoElectronsInput, recoObjects); if (recoObjects->size() < (unsigned int)recocut_) { @@ -600,12 +609,10 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { return; } } else if (pdgGen == 22) { - event.getByToken(recoObjectsEBT, recoObjectsEB); event.getByToken(recoObjectsEET, recoObjectsEE); - if (recoObjectsEB->size() + recoObjectsEE->size() < - (unsigned int)recocut_) { + if (recoObjectsEB->size() + recoObjectsEE->size() < (unsigned int)recocut_) { // edm::LogWarning("EmDQMReco") << "Less than "<< recocut_ <<" Reco // particles with pdgId=" << pdgGen << ". Only " << cutRecoCounter.size() // << " particles."; @@ -646,8 +653,7 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { event.getByToken(triggerObjT, triggerObj); if (!triggerObj.isValid()) { - edm::LogWarning("EmDQMReco") - << "RAW-type HLT results not found, skipping event"; + edm::LogWarning("EmDQMReco") << "RAW-type HLT results not found, skipping event"; return; } @@ -674,21 +680,18 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { std::vector sortedReco; if (plotReco == true) { if (pdgGen == 11) { - for (edm::View::const_iterator recopart = - recoObjects->begin(); - recopart != recoObjects->end(); recopart++) { - reco::Particle tmpcand(recopart->charge(), recopart->p4(), - recopart->vertex(), recopart->pdgId(), - recopart->status()); + for (edm::View::const_iterator recopart = recoObjects->begin(); recopart != recoObjects->end(); + recopart++) { + reco::Particle tmpcand( + recopart->charge(), recopart->p4(), recopart->vertex(), recopart->pdgId(), recopart->status()); sortedReco.push_back(tmpcand); } } else if (pdgGen == 22) { - for (std::vector::const_iterator recopart2 = - recoObjectsEB->begin(); - recopart2 != recoObjectsEB->end(); recopart2++) { + for (std::vector::const_iterator recopart2 = recoObjectsEB->begin(); + recopart2 != recoObjectsEB->end(); + recopart2++) { float en = recopart2->energy(); - float er = sqrt(pow(recopart2->x(), 2) + pow(recopart2->y(), 2) + - pow(recopart2->z(), 2)); + float er = sqrt(pow(recopart2->x(), 2) + pow(recopart2->y(), 2) + pow(recopart2->z(), 2)); float px = recopart2->energy() * recopart2->x() / er; float py = recopart2->energy() * recopart2->y() / er; float pz = recopart2->energy() * recopart2->z() / er; @@ -696,12 +699,11 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { reco::Particle tmpcand(0, thisLV, math::XYZPoint(0., 0., 0.), 22, 1); sortedReco.push_back(tmpcand); } - for (std::vector::const_iterator recopart2 = - recoObjectsEE->begin(); - recopart2 != recoObjectsEE->end(); recopart2++) { + for (std::vector::const_iterator recopart2 = recoObjectsEE->begin(); + recopart2 != recoObjectsEE->end(); + recopart2++) { float en = recopart2->energy(); - float er = sqrt(pow(recopart2->x(), 2) + pow(recopart2->y(), 2) + - pow(recopart2->z(), 2)); + float er = sqrt(pow(recopart2->x(), 2) + pow(recopart2->y(), 2) + pow(recopart2->z(), 2)); float px = recopart2->energy() * recopart2->x() / er; float py = recopart2->energy() * recopart2->y() / er; float pz = recopart2->energy() * recopart2->z() / er; @@ -732,16 +734,12 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { plotMonpath = true; } - } // END of loop over Reconstructed particles + } // END of loop over Reconstructed particles if (recocut_ >= reqNum) - totalreco->Fill( - numOfHLTCollectionLabels + - 1.5); // this isn't really needed anymore keep for backward comp. + totalreco->Fill(numOfHLTCollectionLabels + 1.5); // this isn't really needed anymore keep for backward comp. if (recocut_ >= reqNum) - totalmatchreco->Fill( - numOfHLTCollectionLabels + - 1.5); // this isn't really needed anymore keep for backward comp. + totalmatchreco->Fill(numOfHLTCollectionLabels + 1.5); // this isn't really needed anymore keep for backward comp. } //////////////////////////////////////////////////////////// @@ -751,31 +749,25 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { // These numbers are from the Parameter Set, such as: // theHLTOutputTypes = cms.uint32(100) switch (theHLTOutputTypes[n]) { - case trigger::TriggerL1NoIsoEG: // Non-isolated Level 1 - histoFillerL1NonIso->fillHistos(triggerObj, event, n, sortedReco, - plotReco, plotMonpath); - break; - case trigger::TriggerL1IsoEG: // Isolated Level 1 - histoFillerL1Iso->fillHistos(triggerObj, event, n, sortedReco, plotReco, - plotMonpath); - break; - case trigger::TriggerPhoton: // Photon - histoFillerPho->fillHistos(triggerObj, event, n, sortedReco, plotReco, - plotMonpath); - break; - case trigger::TriggerElectron: // Electron - histoFillerEle->fillHistos(triggerObj, event, n, sortedReco, plotReco, - plotMonpath); - break; - case trigger::TriggerCluster: // TriggerCluster - histoFillerClu->fillHistos(triggerObj, event, n, sortedReco, plotReco, - plotMonpath); - break; - default: - throw(cms::Exception("Release Validation Error") - << "HLT output type not implemented: theHLTOutputTypes[n]"); + case trigger::TriggerL1NoIsoEG: // Non-isolated Level 1 + histoFillerL1NonIso->fillHistos(triggerObj, event, n, sortedReco, plotReco, plotMonpath); + break; + case trigger::TriggerL1IsoEG: // Isolated Level 1 + histoFillerL1Iso->fillHistos(triggerObj, event, n, sortedReco, plotReco, plotMonpath); + break; + case trigger::TriggerPhoton: // Photon + histoFillerPho->fillHistos(triggerObj, event, n, sortedReco, plotReco, plotMonpath); + break; + case trigger::TriggerElectron: // Electron + histoFillerEle->fillHistos(triggerObj, event, n, sortedReco, plotReco, plotMonpath); + break; + case trigger::TriggerCluster: // TriggerCluster + histoFillerClu->fillHistos(triggerObj, event, n, sortedReco, plotReco, plotMonpath); + break; + default: + throw(cms::Exception("Release Validation Error") << "HLT output type not implemented: theHLTOutputTypes[n]"); } - } // END of loop over filter modules + } // END of loop over filter modules } //////////////////////////////////////////////////////////////////////////////// @@ -783,13 +775,14 @@ void EmDQMReco::analyze(const edm::Event &event, const edm::EventSetup &setup) { // Called by analyze method. // //////////////////////////////////////////////////////////////////////////////// template -void HistoFillerReco::fillHistos( - edm::Handle &triggerObj, - const edm::Event &iEvent, unsigned int n, - std::vector &sortedReco, bool plotReco, bool plotMonpath) { +void HistoFillerReco::fillHistos(edm::Handle &triggerObj, + const edm::Event &iEvent, + unsigned int n, + std::vector &sortedReco, + bool plotReco, + bool plotMonpath) { std::vector> recoecalcands; - if ((triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]) >= - triggerObj->size())) { // only process if available + if ((triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]) >= triggerObj->size())) { // only process if available return; } @@ -797,22 +790,19 @@ void HistoFillerReco::fillHistos( // Retrieve saved filter objects // //////////////////////////////////////////////////////////// triggerObj->getObjects( - triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), - dqm->theHLTOutputTypes[n], recoecalcands); + triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), dqm->theHLTOutputTypes[n], recoecalcands); // Danger: special case, L1 non-isolated // needs to be merged with L1 iso if (dqm->theHLTOutputTypes[n] == trigger::TriggerL1NoIsoEG) { std::vector> isocands; - triggerObj->getObjects( - triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), - trigger::TriggerL1IsoEG, isocands); + triggerObj->getObjects(triggerObj->filterIndex(dqm->theHLTCollectionLabels[n]), trigger::TriggerL1IsoEG, isocands); if (!isocands.empty()) { for (unsigned int i = 0; i < isocands.size(); i++) recoecalcands.push_back(isocands[i]); } - } // END of if theHLTOutputTypes == 82 + } // END of if theHLTOutputTypes == 82 - if (recoecalcands.empty()) { // stop if no object passed the previous filter + if (recoecalcands.empty()) { // stop if no object passed the previous filter return; } @@ -825,11 +815,10 @@ void HistoFillerReco::fillHistos( /////////////////////////////////////////////////// for (unsigned int j = 0; j < recoecalcands.size(); j++) { if (!(recoecalcands.at(j).isAvailable())) { - edm::LogError("EmDQMReco") - << "Event content inconsistent: TriggerEventWithRefs contains " - "invalid Refs" - << std::endl - << "invalid refs for: " << dqm->theHLTCollectionLabels[n].label(); + edm::LogError("EmDQMReco") << "Event content inconsistent: TriggerEventWithRefs contains " + "invalid Refs" + << std::endl + << "invalid refs for: " << dqm->theHLTCollectionLabels[n].label(); return; } } @@ -841,24 +830,22 @@ void HistoFillerReco::fillHistos( // bool foundAllMatches = false; // unsigned int numOfHLTobjectsMatched = 0; for (unsigned int i = 0; i < recoecalcands.size(); i++) { - dqm->standardHist[n].fill(recoecalcands[i]->p4()); //////////////////////////////////////////////////////////// // Plot isolation variables (show the not-yet-cut // // isolation, i.e. associated to next filter) // //////////////////////////////////////////////////////////// - if (n + 1 < dqm->numOfHLTCollectionLabels) { // can't plot beyond last + if (n + 1 < dqm->numOfHLTCollectionLabels) { // can't plot beyond last if (dqm->plotiso[n + 1]) { for (unsigned int j = 0; j < isoNameTokens_.size(); j++) { edm::Handle>> depMap; iEvent.getByToken(isoNameTokens_.at(j), depMap); - if (depMap.isValid()) { // Map may not exist if only one candidate - // passes a double filter - typename edm::AssociationMap< - edm::OneToValue>::const_iterator mapi = + if (depMap.isValid()) { // Map may not exist if only one candidate + // passes a double filter + typename edm::AssociationMap>::const_iterator mapi = depMap->find(recoecalcands[i]); - if (mapi != depMap->end()) { // found candidate in isolation map! + if (mapi != depMap->end()) { // found candidate in isolation map! dqm->etahistiso[n + 1]->Fill(recoecalcands[i]->eta(), mapi->val); dqm->ethistiso[n + 1]->Fill(recoecalcands[i]->et(), mapi->val); dqm->phiHistIso[n + 1]->Fill(recoecalcands[i]->phi(), mapi->val); @@ -866,7 +853,7 @@ void HistoFillerReco::fillHistos( } } } - } // END of if n+1 < then the number of hlt collections + } // END of if n+1 < then the number of hlt collections } //////////////////////////////////////////////////////////// @@ -881,8 +868,7 @@ void HistoFillerReco::fillHistos( float closestRecoDeltaR = 1000.; int closestRecoEcalCandIndex = -1; for (unsigned int j = 0; j < recoecalcands.size(); j++) { - float deltaR = - DeltaR(recoecalcands[j]->momentum(), currentRecoParticleMomentum); + float deltaR = DeltaR(recoecalcands[j]->momentum(), currentRecoParticleMomentum); if (deltaR < closestRecoDeltaR) { closestRecoDeltaR = deltaR; @@ -900,37 +886,31 @@ void HistoFillerReco::fillHistos( // histPhiOfHltObjMatchToReco[n]->Fill( // recoecalcands[closestRecoEcalCandIndex]->phi() ); - dqm->histHltObjMatchToReco[n].fill( - recoecalcands[closestRecoEcalCandIndex]->p4()); + dqm->histHltObjMatchToReco[n].fill(recoecalcands[closestRecoEcalCandIndex]->p4()); // Also store isolation info - if (n + 1 < dqm->numOfHLTCollectionLabels) { // can't plot beyond last - if (dqm->plotiso[n + 1]) { // only plot if requested in config + if (n + 1 < dqm->numOfHLTCollectionLabels) { // can't plot beyond last + if (dqm->plotiso[n + 1]) { // only plot if requested in config for (unsigned int j = 0; j < isoNameTokens_.size(); j++) { - edm::Handle>> - depMap; + edm::Handle>> depMap; iEvent.getByToken(isoNameTokens_.at(j), depMap); - if (depMap.isValid()) { // Map may not exist if only one candidate - // passes a double filter - typename edm::AssociationMap< - edm::OneToValue>::const_iterator mapi = + if (depMap.isValid()) { // Map may not exist if only one candidate + // passes a double filter + typename edm::AssociationMap>::const_iterator mapi = depMap->find(recoecalcands[closestRecoEcalCandIndex]); - if (mapi != - depMap->end()) { // found candidate in isolation map! - dqm->histEtaIsoOfHltObjMatchToReco[n + 1]->Fill( - recoecalcands[closestRecoEcalCandIndex]->eta(), - mapi->val); - dqm->histEtIsoOfHltObjMatchToReco[n + 1]->Fill( - recoecalcands[closestRecoEcalCandIndex]->et(), mapi->val); - dqm->histPhiIsoOfHltObjMatchToReco[n + 1]->Fill( - recoecalcands[closestRecoEcalCandIndex]->phi(), - mapi->val); + if (mapi != depMap->end()) { // found candidate in isolation map! + dqm->histEtaIsoOfHltObjMatchToReco[n + 1]->Fill(recoecalcands[closestRecoEcalCandIndex]->eta(), + mapi->val); + dqm->histEtIsoOfHltObjMatchToReco[n + 1]->Fill(recoecalcands[closestRecoEcalCandIndex]->et(), + mapi->val); + dqm->histPhiIsoOfHltObjMatchToReco[n + 1]->Fill(recoecalcands[closestRecoEcalCandIndex]->phi(), + mapi->val); } } } } } - } // END of if closestEcalCandIndex >= 0 + } // END of if closestEcalCandIndex >= 0 } //////////////////////////////////////////////////////////// @@ -939,7 +919,7 @@ void HistoFillerReco::fillHistos( unsigned int mtachedRecoParts = 0; float minrecodist = 0.3; if (n == 0) - minrecodist = 0.5; // low L1-resolution => allow wider matching + minrecodist = 0.5; // low L1-resolution => allow wider matching for (unsigned int i = 0; i < dqm->recocut_; i++) { // match generator candidate bool matchThis = false; @@ -952,8 +932,7 @@ void HistoFillerReco::fillHistos( closestDr = dr; closest = trigOb; } - if (closestDr > - minrecodist) { // it's not really a "match" if it's that far away + if (closestDr > minrecodist) { // it's not really a "match" if it's that far away closest = -1; } else { mtachedRecoParts++; @@ -961,7 +940,7 @@ void HistoFillerReco::fillHistos( } } if (!matchThis) - continue; // only plot matched candidates + continue; // only plot matched candidates // fill coordinates of mc particle matching trigger object // ethistmatchreco[n] ->Fill( sortedReco[i].et() ); // etahistmatchreco[n]->Fill( sortedReco[i].eta() ); @@ -978,30 +957,24 @@ void HistoFillerReco::fillHistos( // Plot isolation variables (show the not-yet-cut // // isolation, i.e. associated to next filter) // //////////////////////////////////////////////////////////// - if (n + 1 < dqm->numOfHLTCollectionLabels) { // can't plot beyond last - if (dqm->plotiso[n + 1]) { // only plot if requested in config + if (n + 1 < dqm->numOfHLTCollectionLabels) { // can't plot beyond last + if (dqm->plotiso[n + 1]) { // only plot if requested in config for (unsigned int j = 0; j < isoNameTokens_.size(); j++) { - edm::Handle>> - depMapReco; + edm::Handle>> depMapReco; iEvent.getByToken(isoNameTokens_.at(j), depMapReco); - if (depMapReco.isValid()) { // Map may not exist if only one - // candidate passes a double filter - typename edm::AssociationMap< - edm::OneToValue>::const_iterator mapi = + if (depMapReco.isValid()) { // Map may not exist if only one + // candidate passes a double filter + typename edm::AssociationMap>::const_iterator mapi = depMapReco->find(recoecalcands[closest]); - if (mapi != - depMapReco->end()) { // found candidate in isolation map! - dqm->etahistisomatchreco[n + 1]->Fill(sortedReco[i].eta(), - mapi->val); - dqm->ethistisomatchreco[n + 1]->Fill(sortedReco[i].et(), - mapi->val); - dqm->phiHistIsoMatchReco[n + 1]->Fill(sortedReco[i].eta(), - mapi->val); + if (mapi != depMapReco->end()) { // found candidate in isolation map! + dqm->etahistisomatchreco[n + 1]->Fill(sortedReco[i].eta(), mapi->val); + dqm->ethistisomatchreco[n + 1]->Fill(sortedReco[i].et(), mapi->val); + dqm->phiHistIsoMatchReco[n + 1]->Fill(sortedReco[i].eta(), mapi->val); } } } } - } // END of if n+1 < then the number of hlt collections + } // END of if n+1 < then the number of hlt collections } // fill total reco matched efficiency if (mtachedRecoParts >= dqm->reqNum) diff --git a/Validation/EcalClusters/interface/AnglesUtil.h b/Validation/EcalClusters/interface/AnglesUtil.h index c15f39909d672..09f8f21d11722 100644 --- a/Validation/EcalClusters/interface/AnglesUtil.h +++ b/Validation/EcalClusters/interface/AnglesUtil.h @@ -16,53 +16,53 @@ #include namespace kinem { -const double PI = 2.0 * acos(0.); -const double TWOPI = 2.0 * PI; -const float ETA_LIMIT = 15.0; -const float EPSILON = 1.E-10; - -// calculate phi from x, y -inline double phi(double x, double y); -// calculate phi for a line defined by xy1 and xy2 (xy2-xy1) -inline double phi(double xy1[2], double xy2[2]); -inline double phi(float xy1[2], float xy2[2]); - -// calculate theta from x, y, z -inline double theta(double x, double y, double z); -// calculate theta for a line defined by xyz1 and xyz2 (xyz2-xyz1) -inline double theta(double xyz1[3], double xyz2[3]); -inline double theta(float xyz1[3], float xyz2[3]); -// calculate theta from eta -inline double theta(double etap); - -// calculate eta from x, y, z (return also theta) -inline double eta(double x, double y, double z); -// calculate eta for a line defined by xyz1 and xyz2 (xyz2-xyz1) -inline double eta(double xyz1[3], double xyz2[3]); -inline double eta(float xyz1[3], float xyz2[3]); -// calculate eta from theta -inline double eta(double th); - -// calculate rapidity from E, pz -inline double y(double E, double pz); - -// calculate phi1-phi2 keeping value between 0 and pi -inline double delta_phi(double ph11, double phi2); -// calculate phi1-phi2 keeping value between -pi and pi -inline double signed_delta_phi(double ph11, double phi2); -// calculate eta1 - eta2 -inline double delta_eta(double eta1, double eta2); - -// calculate deltaR -inline double delta_R(double eta1, double phi1, double eta2, double phi2); - -// calculate unit vectors given two points -inline void uvectors(double u[3], double xyz1[3], double xyz2[3]); -inline void uvectors(float u[3], float xyz1[3], float xyz2[3]); - -inline double tanl_from_theta(double theta); -inline double theta_from_tanl(double tanl); -} // namespace kinem + const double PI = 2.0 * acos(0.); + const double TWOPI = 2.0 * PI; + const float ETA_LIMIT = 15.0; + const float EPSILON = 1.E-10; + + // calculate phi from x, y + inline double phi(double x, double y); + // calculate phi for a line defined by xy1 and xy2 (xy2-xy1) + inline double phi(double xy1[2], double xy2[2]); + inline double phi(float xy1[2], float xy2[2]); + + // calculate theta from x, y, z + inline double theta(double x, double y, double z); + // calculate theta for a line defined by xyz1 and xyz2 (xyz2-xyz1) + inline double theta(double xyz1[3], double xyz2[3]); + inline double theta(float xyz1[3], float xyz2[3]); + // calculate theta from eta + inline double theta(double etap); + + // calculate eta from x, y, z (return also theta) + inline double eta(double x, double y, double z); + // calculate eta for a line defined by xyz1 and xyz2 (xyz2-xyz1) + inline double eta(double xyz1[3], double xyz2[3]); + inline double eta(float xyz1[3], float xyz2[3]); + // calculate eta from theta + inline double eta(double th); + + // calculate rapidity from E, pz + inline double y(double E, double pz); + + // calculate phi1-phi2 keeping value between 0 and pi + inline double delta_phi(double ph11, double phi2); + // calculate phi1-phi2 keeping value between -pi and pi + inline double signed_delta_phi(double ph11, double phi2); + // calculate eta1 - eta2 + inline double delta_eta(double eta1, double eta2); + + // calculate deltaR + inline double delta_R(double eta1, double phi1, double eta2, double phi2); + + // calculate unit vectors given two points + inline void uvectors(double u[3], double xyz1[3], double xyz2[3]); + inline void uvectors(float u[3], float xyz1[3], float xyz2[3]); + + inline double tanl_from_theta(double theta); + inline double theta_from_tanl(double tanl); +} // namespace kinem inline double kinem::phi(double x, double y) { double PHI = atan2(y, x); @@ -103,8 +103,7 @@ inline double kinem::signed_delta_phi(double phi1, double phi2) { return dphi; } -inline double kinem::delta_R(double eta1, double phi1, double eta2, - double phi2) { +inline double kinem::delta_R(double eta1, double phi1, double eta2, double phi2) { double deta = eta1 - eta2; double dphi = kinem::delta_phi(phi1, phi2); return sqrt(deta * deta + dphi * dphi); @@ -123,9 +122,7 @@ inline double kinem::theta(float xyz1[3], float xyz2[3]) { return theta(dxyz1, dxyz2); } -inline double kinem::theta(double x, double y, double z) { - return atan2(sqrt(x * x + y * y), z); -} +inline double kinem::theta(double x, double y, double z) { return atan2(sqrt(x * x + y * y), z); } inline double kinem::theta(double etap) { return 2.0 * atan(exp(-etap)); } @@ -143,8 +140,7 @@ inline double kinem::eta(float xyz1[3], float xyz2[3]) { } inline double kinem::eta(double x, double y, double z) { - return 0.5 * log((sqrt(x * x + y * y + z * z) + z + EPSILON) / - (sqrt(x * x + y * y + z * z) - z + EPSILON)); + return 0.5 * log((sqrt(x * x + y * y + z * z) + z + EPSILON) / (sqrt(x * x + y * y + z * z) - z + EPSILON)); } inline double kinem::eta(double th) { @@ -155,9 +151,7 @@ inline double kinem::eta(double th) { return -log(tan(th / 2.0)); } -inline double kinem::y(double E, double pz) { - return 0.5 * log((E + pz + EPSILON) / (E - pz + EPSILON)); -} +inline double kinem::y(double E, double pz) { return 0.5 * log((E + pz + EPSILON) / (E - pz + EPSILON)); } inline void kinem::uvectors(double u[3], double xyz1[3], double xyz2[3]) { double xdiff = xyz2[0] - xyz1[0]; @@ -185,12 +179,8 @@ inline void kinem::uvectors(float u[3], float xyz1[3], float xyz2[3]) { u[2] = du[2]; } -inline double kinem::tanl_from_theta(double theta) { - return tan(PI / 2.0 - theta); -} +inline double kinem::tanl_from_theta(double theta) { return tan(PI / 2.0 - theta); } -inline double kinem::theta_from_tanl(double tanl) { - return PI / 2.0 - atan(tanl); -} +inline double kinem::theta_from_tanl(double tanl) { return PI / 2.0 - atan(tanl); } -#endif // INC_ANGLESUTIL +#endif // INC_ANGLESUTIL diff --git a/Validation/EcalClusters/interface/ContainmentCorrectionAnalyzer.h b/Validation/EcalClusters/interface/ContainmentCorrectionAnalyzer.h index 8254ceb85fceb..9e15664c782df 100644 --- a/Validation/EcalClusters/interface/ContainmentCorrectionAnalyzer.h +++ b/Validation/EcalClusters/interface/ContainmentCorrectionAnalyzer.h @@ -56,11 +56,9 @@ class ContainmentCorrectionAnalyzer : public edm::EDAnalyzer { private: float ecalEta(float EtaParticle, float Zvertex, float plane_Radius); - std::vector - findMcTruth(std::vector &theSimTracks, - std::vector &theSimVertices); - void fillMcTruth(std::vector &theSimTracks, - std::vector &theSimVertices); + std::vector findMcTruth(std::vector &theSimTracks, + std::vector &theSimVertices); + void fillMcTruth(std::vector &theSimTracks, std::vector &theSimVertices); edm::EDGetTokenT SimTrackCollection_; edm::EDGetTokenT SimVertexCollection_; @@ -74,8 +72,7 @@ class ContainmentCorrectionAnalyzer : public edm::EDAnalyzer { std::vector isConverted; std::vector x_vtx, y_vtx, z_vtx; int nRECOphotons; - std::vector superClusterEnergy, superClusterEta, superClusterPhi, - superClusterEt; + std::vector superClusterEnergy, superClusterEta, superClusterPhi, superClusterEt; std::vector e1, e9, e25; std::vector seedXtal; std::vector iMC; diff --git a/Validation/EcalClusters/interface/EcalSimPhotonMCTruth.h b/Validation/EcalClusters/interface/EcalSimPhotonMCTruth.h index 75333109d7b74..2e130f06f6bb4 100644 --- a/Validation/EcalClusters/interface/EcalSimPhotonMCTruth.h +++ b/Validation/EcalClusters/interface/EcalSimPhotonMCTruth.h @@ -16,13 +16,14 @@ class EcalSimPhotonMCTruth { public: EcalSimPhotonMCTruth() - : isAConversion_(0), thePhoton_(0., 0., 0., 0.), theR_(0.), theZ_(0.), - theConvVertex_(0., 0., 0., 0.){}; + : isAConversion_(0), thePhoton_(0., 0., 0., 0.), theR_(0.), theZ_(0.), theConvVertex_(0., 0., 0., 0.){}; EcalSimPhotonMCTruth(const math::XYZTLorentzVectorD &v) : thePhoton_(v){}; - EcalSimPhotonMCTruth(int isAConversion, const math::XYZTLorentzVectorD &v, - float rconv, float zconv, + EcalSimPhotonMCTruth(int isAConversion, + const math::XYZTLorentzVectorD &v, + float rconv, + float zconv, const math::XYZTLorentzVectorD &convVertex, const math::XYZTLorentzVectorD &pV, const std::vector &tracks); diff --git a/Validation/EcalClusters/interface/EgammaBasicClusters.h b/Validation/EcalClusters/interface/EgammaBasicClusters.h index f25a90b5b7156..629cf2852fca2 100644 --- a/Validation/EcalClusters/interface/EgammaBasicClusters.h +++ b/Validation/EcalClusters/interface/EgammaBasicClusters.h @@ -27,8 +27,7 @@ class EgammaBasicClusters : public DQMEDAnalyzer { ~EgammaBasicClusters() override; void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: edm::EDGetTokenT barrelBasicClusterCollection_; diff --git a/Validation/EcalClusters/interface/EgammaSuperClusters.h b/Validation/EcalClusters/interface/EgammaSuperClusters.h index 8721a64e76f70..da4a4fdd28bba 100644 --- a/Validation/EcalClusters/interface/EgammaSuperClusters.h +++ b/Validation/EcalClusters/interface/EgammaSuperClusters.h @@ -29,26 +29,20 @@ class EgammaSuperClusters : public DQMEDAnalyzer { ~EgammaSuperClusters() override; void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // mc truth edm::EDGetTokenT MCTruthCollectionToken_; // barrel clusters - edm::EDGetTokenT - barrelRawSuperClusterCollectionToken_; - edm::EDGetTokenT - barrelCorSuperClusterCollectionToken_; + edm::EDGetTokenT barrelRawSuperClusterCollectionToken_; + edm::EDGetTokenT barrelCorSuperClusterCollectionToken_; // endcap clusters - edm::EDGetTokenT - endcapRawSuperClusterCollectionToken_; - edm::EDGetTokenT - endcapPreSuperClusterCollectionToken_; - edm::EDGetTokenT - endcapCorSuperClusterCollectionToken_; + edm::EDGetTokenT endcapRawSuperClusterCollectionToken_; + edm::EDGetTokenT endcapPreSuperClusterCollectionToken_; + edm::EDGetTokenT endcapCorSuperClusterCollectionToken_; // collections of hits edm::EDGetTokenT barrelRecHitCollectionToken_; @@ -125,8 +119,7 @@ class EgammaSuperClusters : public DQMEDAnalyzer { MonitorElement *hist_EE_CorSC_ET_vs_Phi_; MonitorElement *hist_EE_CorSC_ET_vs_R_; - void closestMCParticle(HepMC::GenEvent const *, reco::SuperCluster const &, - double &, double &) const; + void closestMCParticle(HepMC::GenEvent const *, reco::SuperCluster const &, double &, double &) const; float ecalEta(float, float, float) const; }; diff --git a/Validation/EcalClusters/interface/EnergyScaleAnalyzer.h b/Validation/EcalClusters/interface/EnergyScaleAnalyzer.h index cfb2961c7eb29..984d0b8c4e286 100644 --- a/Validation/EcalClusters/interface/EnergyScaleAnalyzer.h +++ b/Validation/EcalClusters/interface/EnergyScaleAnalyzer.h @@ -55,20 +55,15 @@ class EnergyScaleAnalyzer : public edm::EDAnalyzer { void endJob() override; private: - std::string outputFile_; // output file + std::string outputFile_; // output file edm::EDGetTokenT hepMCLabel_; edm::EDGetTokenT hybridSuperClusters_token; - edm::EDGetTokenT - dynamicHybridSuperClusters_token; - edm::EDGetTokenT - correctedHybridSuperClusters_token; - edm::EDGetTokenT - correctedDynamicHybridSuperClusters_token; - edm::EDGetTokenT - correctedFixedMatrixSuperClustersWithPreshower_token; - edm::EDGetTokenT - fixedMatrixSuperClustersWithPreshower_token; + edm::EDGetTokenT dynamicHybridSuperClusters_token; + edm::EDGetTokenT correctedHybridSuperClusters_token; + edm::EDGetTokenT correctedDynamicHybridSuperClusters_token; + edm::EDGetTokenT correctedFixedMatrixSuperClustersWithPreshower_token; + edm::EDGetTokenT fixedMatrixSuperClustersWithPreshower_token; // root file to store histograms TFile *rootFile_; @@ -155,7 +150,11 @@ class EnergyScaleAnalyzer : public edm::EDAnalyzer { // Function void fillTree(const reco::SuperClusterCollection *scColl, const reco::SuperClusterCollection *corrSCColl, - HepMC::GenParticle *mc, tree_structure_ &tree_, float xV, - float yV, float zV, int scType); + HepMC::GenParticle *mc, + tree_structure_ &tree_, + float xV, + float yV, + float zV, + int scType); }; #endif diff --git a/Validation/EcalClusters/src/ContainmentCorrectionAnalyzer.cc b/Validation/EcalClusters/src/ContainmentCorrectionAnalyzer.cc index 0e978c31740dd..23cb747c440a7 100644 --- a/Validation/EcalClusters/src/ContainmentCorrectionAnalyzer.cc +++ b/Validation/EcalClusters/src/ContainmentCorrectionAnalyzer.cc @@ -8,53 +8,39 @@ using namespace edm; using namespace std; using namespace reco; -ContainmentCorrectionAnalyzer::ContainmentCorrectionAnalyzer( - const ParameterSet &ps) { - - BarrelSuperClusterCollection_ = consumes( - ps.getParameter("BarrelSuperClusterCollection")); - EndcapSuperClusterCollection_ = consumes( - ps.getParameter("EndcapSuperClusterCollection")); - reducedBarrelRecHitCollection_ = consumes( - ps.getParameter("reducedBarrelRecHitCollection")); - reducedEndcapRecHitCollection_ = consumes( - ps.getParameter("reducedEndcapRecHitCollection")); - SimTrackCollection_ = consumes( - ps.getParameter("simTrackCollection")); - SimVertexCollection_ = consumes( - ps.getParameter("simVertexCollection")); +ContainmentCorrectionAnalyzer::ContainmentCorrectionAnalyzer(const ParameterSet &ps) { + BarrelSuperClusterCollection_ = + consumes(ps.getParameter("BarrelSuperClusterCollection")); + EndcapSuperClusterCollection_ = + consumes(ps.getParameter("EndcapSuperClusterCollection")); + reducedBarrelRecHitCollection_ = + consumes(ps.getParameter("reducedBarrelRecHitCollection")); + reducedEndcapRecHitCollection_ = + consumes(ps.getParameter("reducedEndcapRecHitCollection")); + SimTrackCollection_ = consumes(ps.getParameter("simTrackCollection")); + SimVertexCollection_ = consumes(ps.getParameter("simVertexCollection")); } ContainmentCorrectionAnalyzer::~ContainmentCorrectionAnalyzer() {} void ContainmentCorrectionAnalyzer::beginJob() { - Service fs; // Define reference histograms - h_EB_eRecoEtrueReference = fs->make( - "EB_eRecoEtrueReference", "EB_eRecoEtrueReference", 440, 0., 1.1); - h_EB_e9EtrueReference = fs->make("EB_e9EtrueReference", - "EB_e9EtrueReference", 440, 0., 1.1); - h_EB_e25EtrueReference = fs->make("EB_e25EtrueReference", - "EB_e25EtrueReference", 440, 0., 1.1); - h_EE_eRecoEtrueReference = fs->make( - "EE_eRecoEtrueReference", "EE_eRecoEtrueReference", 440, 0., 1.1); - h_EE_e9EtrueReference = fs->make("EE_e9EtrueReference", - "EE_e9EtrueReference", 440, 0., 1.1); - h_EE_e25EtrueReference = fs->make("EE_e25EtrueReference", - "EE_e25EtrueReference", 440, 0., 1.1); + h_EB_eRecoEtrueReference = fs->make("EB_eRecoEtrueReference", "EB_eRecoEtrueReference", 440, 0., 1.1); + h_EB_e9EtrueReference = fs->make("EB_e9EtrueReference", "EB_e9EtrueReference", 440, 0., 1.1); + h_EB_e25EtrueReference = fs->make("EB_e25EtrueReference", "EB_e25EtrueReference", 440, 0., 1.1); + h_EE_eRecoEtrueReference = fs->make("EE_eRecoEtrueReference", "EE_eRecoEtrueReference", 440, 0., 1.1); + h_EE_e9EtrueReference = fs->make("EE_e9EtrueReference", "EE_e9EtrueReference", 440, 0., 1.1); + h_EE_e25EtrueReference = fs->make("EE_e25EtrueReference", "EE_e25EtrueReference", 440, 0., 1.1); h_EB_eTrue = fs->make("EB_eTrue", "EB_eTrue", 41, 40., 60.); h_EE_eTrue = fs->make("EE_eTrue", "EE_eTrue", 41, 40., 60.); h_EB_converted = fs->make("EB_converted", "EB_converted", 2, 0., 2.); h_EE_converted = fs->make("EE_converted", "EE_converted", 2, 0., 2.); } -void ContainmentCorrectionAnalyzer::analyze(const Event &evt, - const EventSetup &es) { - - LogInfo("ContainmentCorrectionAnalyzer") - << "Analyzing event " << evt.id() << "\n"; +void ContainmentCorrectionAnalyzer::analyze(const Event &evt, const EventSetup &es) { + LogInfo("ContainmentCorrectionAnalyzer") << "Analyzing event " << evt.id() << "\n"; // taking the needed collections std::vector theSimTracks; @@ -66,8 +52,7 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (SimTk.isValid()) theSimTracks.insert(theSimTracks.end(), SimTk->begin(), SimTk->end()); else { - LogError("ContainmentCorrectionAnalyzer") - << "Error! can't get collection with label " << l.module; + LogError("ContainmentCorrectionAnalyzer") << "Error! can't get collection with label " << l.module; } std::vector theSimVertexes; @@ -78,8 +63,7 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (SimVtx.isValid()) theSimVertexes.insert(theSimVertexes.end(), SimVtx->begin(), SimVtx->end()); else { - LogError("ContainmentCorrectionAnalyzer") - << "Error! can't get collection with label " << l.module; + LogError("ContainmentCorrectionAnalyzer") << "Error! can't get collection with label " << l.module; } const reco::SuperClusterCollection *BarrelSuperClusters = nullptr; @@ -90,8 +74,7 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (pHybridBarrelSuperClusters.isValid()) { BarrelSuperClusters = pHybridBarrelSuperClusters.product(); } else { - LogError("ContainmentCorrectionAnalyzer") - << "Error! can't get collection with label " << l.module; + LogError("ContainmentCorrectionAnalyzer") << "Error! can't get collection with label " << l.module; } const reco::SuperClusterCollection *EndcapSuperClusters = nullptr; @@ -102,8 +85,7 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (pMulti5x5EndcapSuperClusters.isValid()) EndcapSuperClusters = pMulti5x5EndcapSuperClusters.product(); else { - LogError("ContainmentCorrectionAnalyzer") - << "Error! can't get collection with label " << l.module; + LogError("ContainmentCorrectionAnalyzer") << "Error! can't get collection with label " << l.module; } const EcalRecHitCollection *ebRecHits = nullptr; @@ -114,8 +96,7 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (pEBRecHits.isValid()) ebRecHits = pEBRecHits.product(); else { - LogError("ContainmentCorrectionAnalyzer") - << "Error! can't get collection with label " << l.module; + LogError("ContainmentCorrectionAnalyzer") << "Error! can't get collection with label " << l.module; } const EcalRecHitCollection *eeRecHits = nullptr; @@ -126,8 +107,7 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (pEERecHits.isValid()) eeRecHits = pEERecHits.product(); else { - LogError("ContainmentCorrectionAnalyzer") - << "Error! can't get collection with label " << l.module; + LogError("ContainmentCorrectionAnalyzer") << "Error! can't get collection with label " << l.module; } const CaloTopology *topology = nullptr; @@ -136,8 +116,7 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (pTopology.isValid()) topology = pTopology.product(); - std::vector photons = - findMcTruth(theSimTracks, theSimVertexes); + std::vector photons = findMcTruth(theSimTracks, theSimVertexes); nMCphotons = 0; nRECOphotons = 0; @@ -164,12 +143,10 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, // loop over MC truth photons for (unsigned int ipho = 0; ipho < photons.size(); ipho++) { - math::XYZTLorentzVectorD vtx = photons[ipho].primaryVertex(); double phiTrue = photons[ipho].fourMomentum().phi(); double vtxPerp = sqrt(vtx.x() * vtx.x() + vtx.y() * vtx.y()); - double etaTrue = - ecalEta(photons[ipho].fourMomentum().eta(), vtx.z(), vtxPerp); + double etaTrue = ecalEta(photons[ipho].fourMomentum().eta(), vtx.z(), vtxPerp); double etTrue = photons[ipho].fourMomentum().e() / cosh(etaTrue); nMCphotons++; mcEnergy[nMCphotons - 1] = photons[ipho].fourMomentum().e(); @@ -193,20 +170,19 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, // barrel if (std::fabs(etaTrue) < 1.479) { - double etaCurrent; // , etaFound = 0; // UNUSED + double etaCurrent; // , etaFound = 0; // UNUSED double phiCurrent; // double etCurrent, etFound = 0; // UNUSED const reco::SuperCluster *nearSC = nullptr; double closestParticleDistance = 999; - for (reco::SuperClusterCollection::const_iterator aClus = - BarrelSuperClusters->begin(); - aClus != BarrelSuperClusters->end(); aClus++) { + for (reco::SuperClusterCollection::const_iterator aClus = BarrelSuperClusters->begin(); + aClus != BarrelSuperClusters->end(); + aClus++) { etaCurrent = aClus->position().eta(); phiCurrent = aClus->position().phi(); // etCurrent = aClus->energy()/std::cosh(etaCurrent); // UNUSED - double deltaR = std::sqrt(std::pow(etaCurrent - etaTrue, 2) + - std::pow(phiCurrent - phiTrue, 2)); + double deltaR = std::sqrt(std::pow(etaCurrent - etaTrue, 2) + std::pow(phiCurrent - phiTrue, 2)); if (deltaR < closestParticleDistance) { // etFound = etCurrent; // UNUSED // etaFound = etaCurrent; // UNUSED @@ -221,37 +197,32 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, superClusterEnergy[nRECOphotons - 1] = nearSC->rawEnergy(); superClusterEta[nRECOphotons - 1] = nearSC->position().eta(); superClusterPhi[nRECOphotons - 1] = nearSC->position().phi(); - superClusterEt[nRECOphotons - 1] = - nearSC->rawEnergy() / std::cosh(nearSC->position().eta()); + superClusterEt[nRECOphotons - 1] = nearSC->rawEnergy() / std::cosh(nearSC->position().eta()); iMC[nRECOphotons - 1] = nMCphotons - 1; const reco::CaloClusterPtr &theSeed = nearSC->seed(); - seedXtal[nRECOphotons - 1] = - EcalClusterTools::getMaximum(*theSeed, ebRecHits).first; + seedXtal[nRECOphotons - 1] = EcalClusterTools::getMaximum(*theSeed, ebRecHits).first; e1[nRECOphotons - 1] = EcalClusterTools::eMax(*theSeed, ebRecHits); - e9[nRECOphotons - 1] = - EcalClusterTools::e3x3(*theSeed, ebRecHits, topology); - e25[nRECOphotons - 1] = - EcalClusterTools::e5x5(*theSeed, ebRecHits, topology); + e9[nRECOphotons - 1] = EcalClusterTools::e3x3(*theSeed, ebRecHits, topology); + e25[nRECOphotons - 1] = EcalClusterTools::e5x5(*theSeed, ebRecHits, topology); } } // endcap if (std::fabs(etaTrue) >= 1.6) { - double etaCurrent; // , etaFound = 0; // UNUSED + double etaCurrent; // , etaFound = 0; // UNUSED double phiCurrent; // double etCurrent, etFound = 0; // UNUSED const reco::SuperCluster *nearSC = nullptr; double closestParticleDistance = 999; - for (reco::SuperClusterCollection::const_iterator aClus = - EndcapSuperClusters->begin(); - aClus != EndcapSuperClusters->end(); aClus++) { + for (reco::SuperClusterCollection::const_iterator aClus = EndcapSuperClusters->begin(); + aClus != EndcapSuperClusters->end(); + aClus++) { etaCurrent = aClus->position().eta(); phiCurrent = aClus->position().phi(); // etCurrent = aClus->energy()/std::cosh(etaCurrent); - double deltaR = std::sqrt(std::pow(etaCurrent - etaTrue, 2) + - std::pow(phiCurrent - phiTrue, 2)); + double deltaR = std::sqrt(std::pow(etaCurrent - etaTrue, 2) + std::pow(phiCurrent - phiTrue, 2)); if (deltaR < closestParticleDistance) { // etFound = etCurrent; // UNUSED // etaFound = etaCurrent; // UNUSED @@ -267,35 +238,27 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, superClusterEnergy[nRECOphotons - 1] = nearSC->rawEnergy() + psEnergy; superClusterEta[nRECOphotons - 1] = nearSC->position().eta(); superClusterPhi[nRECOphotons - 1] = nearSC->position().phi(); - superClusterEt[nRECOphotons - 1] = (nearSC->rawEnergy() + psEnergy) / - std::cosh(nearSC->position().eta()); + superClusterEt[nRECOphotons - 1] = (nearSC->rawEnergy() + psEnergy) / std::cosh(nearSC->position().eta()); iMC[nRECOphotons - 1] = nMCphotons - 1; const reco::CaloClusterPtr &theSeed = nearSC->seed(); - seedXtal[nRECOphotons - 1] = - EcalClusterTools::getMaximum(*theSeed, eeRecHits).first; - e1[nRECOphotons - 1] = - EcalClusterTools::eMax(*theSeed, eeRecHits) + psEnergy; - e9[nRECOphotons - 1] = - EcalClusterTools::e3x3(*theSeed, eeRecHits, topology) + psEnergy; - e25[nRECOphotons - 1] = - EcalClusterTools::e5x5(*theSeed, eeRecHits, topology) + psEnergy; + seedXtal[nRECOphotons - 1] = EcalClusterTools::getMaximum(*theSeed, eeRecHits).first; + e1[nRECOphotons - 1] = EcalClusterTools::eMax(*theSeed, eeRecHits) + psEnergy; + e9[nRECOphotons - 1] = EcalClusterTools::e3x3(*theSeed, eeRecHits, topology) + psEnergy; + e25[nRECOphotons - 1] = EcalClusterTools::e5x5(*theSeed, eeRecHits, topology) + psEnergy; } } } // containment analysis for unconverted photons in the reference region only for (int i = 0; i < nRECOphotons; i++) { - // barrel if (fabs(superClusterEta[i]) < 1.479) { if (isConverted[iMC[i]] != 1) { int ietaAbs = (seedXtal[i] >> 9) & 0x7F; int iphi = seedXtal[i] & 0x1FF; - if (ietaAbs > 5 && ietaAbs < 21 && ((iphi % 20) > 5) && - ((iphi % 20) < 16)) { - h_EB_eRecoEtrueReference->Fill(superClusterEnergy[i] / - mcEnergy[iMC[i]]); + if (ietaAbs > 5 && ietaAbs < 21 && ((iphi % 20) > 5) && ((iphi % 20) < 16)) { + h_EB_eRecoEtrueReference->Fill(superClusterEnergy[i] / mcEnergy[iMC[i]]); h_EB_e9EtrueReference->Fill(e9[i] / mcEnergy[iMC[i]]); h_EB_e25EtrueReference->Fill(e25[i] / mcEnergy[iMC[i]]); } @@ -306,26 +269,21 @@ void ContainmentCorrectionAnalyzer::analyze(const Event &evt, if (fabs(superClusterEta[i]) > 1.6) { if (isConverted[iMC[i]] != 1) { if (fabs(superClusterEta[i]) > 1.7 && fabs(superClusterEta[i] < 2.3) && - ((superClusterPhi[i] > -CLHEP::pi / 2. + 0.1 && - superClusterPhi[i] < CLHEP::pi / 2. - 0.1) || - (superClusterPhi[i] > CLHEP::pi / 2. + 0.1) || - (superClusterPhi[i] < -CLHEP::pi / 2. - 0.1))) { - h_EE_eRecoEtrueReference->Fill(superClusterEnergy[i] / - mcEnergy[iMC[i]]); + ((superClusterPhi[i] > -CLHEP::pi / 2. + 0.1 && superClusterPhi[i] < CLHEP::pi / 2. - 0.1) || + (superClusterPhi[i] > CLHEP::pi / 2. + 0.1) || (superClusterPhi[i] < -CLHEP::pi / 2. - 0.1))) { + h_EE_eRecoEtrueReference->Fill(superClusterEnergy[i] / mcEnergy[iMC[i]]); h_EE_e9EtrueReference->Fill(e9[i] / mcEnergy[iMC[i]]); h_EE_e25EtrueReference->Fill(e25[i] / mcEnergy[iMC[i]]); } } } - } // loop over reco photons + } // loop over reco photons } void ContainmentCorrectionAnalyzer::endJob() {} -float ContainmentCorrectionAnalyzer::ecalEta(float EtaParticle, float Zvertex, - float plane_Radius) { - +float ContainmentCorrectionAnalyzer::ecalEta(float EtaParticle, float Zvertex, float plane_Radius) { const float R_ECAL = 136.5; const float Z_Endcap = 328.0; const float etaBarrelEndcap = 1.479; @@ -362,10 +320,8 @@ float ContainmentCorrectionAnalyzer::ecalEta(float EtaParticle, float Zvertex, } // taken from an old version of RecoEgamma/EgammaMCTools/src/PhotonMCTruthFinder -std::vector ContainmentCorrectionAnalyzer::findMcTruth( - std::vector &theSimTracks, - std::vector &theSimVertices) { - +std::vector ContainmentCorrectionAnalyzer::findMcTruth(std::vector &theSimTracks, + std::vector &theSimVertices) { std::vector result; geantToIndex_.clear(); @@ -409,8 +365,7 @@ std::vector ContainmentCorrectionAnalyzer::findMcTruth( } int npv = 0; int iPho = 0; - for (std::vector::iterator iSimTk = theSimTracks.begin(); - iSimTk != theSimTracks.end(); ++iSimTk) { + for (std::vector::iterator iSimTk = theSimTracks.begin(); iSimTk != theSimTracks.end(); ++iSimTk) { if ((*iSimTk).noVertex()) continue; // int vertexId = (*iSimTk).vertIndex(); // UNUSED @@ -425,7 +380,7 @@ std::vector ContainmentCorrectionAnalyzer::findMcTruth( } } - if (npv > 4) { // ievtype = PYTHIA; // UNUSED + if (npv > 4) { // ievtype = PYTHIA; // UNUSED } else if (npv == 1) { if (abs(partType1) == 11) { /* ievtype = SINGLE; ==UNUSED== */ ievflav = ELECTRON_FLAV; @@ -435,14 +390,11 @@ std::vector ContainmentCorrectionAnalyzer::findMcTruth( ievflav = PHOTON_FLAV; } } else if (npv == 2) { - if (abs(partType1) == 11 && - abs(partType2) == 11) { /* ievtype = DOUBLE; ==UNUSED== */ + if (abs(partType1) == 11 && abs(partType2) == 11) { /* ievtype = DOUBLE; ==UNUSED== */ ievflav = ELECTRON_FLAV; - } else if (partType1 == 111 && - partType2 == 111) { /* ievtype = DOUBLE; ==UNUSED== */ + } else if (partType1 == 111 && partType2 == 111) { /* ievtype = DOUBLE; ==UNUSED== */ ievflav = PIZERO_FLAV; - } else if (partType1 == 22 && - partType2 == 22) { /* ievtype = DOUBLE; ==UNUSED== */ + } else if (partType1 == 22 && partType2 == 22) { /* ievtype = DOUBLE; ==UNUSED== */ ievflav = PHOTON_FLAV; } } @@ -450,15 +402,12 @@ std::vector ContainmentCorrectionAnalyzer::findMcTruth( // Look into converted photons int isAconversion = 0; if (ievflav == PHOTON_FLAV) { - int nConv = 0; int iConv = 0; iPho = 0; - for (std::vector::iterator iPhoTk = photonTracks.begin(); - iPhoTk != photonTracks.end(); ++iPhoTk) { + for (std::vector::iterator iPhoTk = photonTracks.begin(); iPhoTk != photonTracks.end(); ++iPhoTk) { trkFromConversion.clear(); - for (std::vector::iterator iSimTk = theSimTracks.begin(); - iSimTk != theSimTracks.end(); ++iSimTk) { + for (std::vector::iterator iSimTk = theSimTracks.begin(); iSimTk != theSimTracks.end(); ++iSimTk) { if ((*iSimTk).noVertex()) continue; if ((*iSimTk).vertIndex() == iPV) @@ -470,8 +419,7 @@ std::vector ContainmentCorrectionAnalyzer::findMcTruth( int motherId = -1; if (vertex.parentIndex()) { unsigned motherGeantId = vertex.parentIndex(); - std::map::iterator association = - geantToIndex_.find(motherGeantId); + std::map::iterator association = geantToIndex_.find(motherGeantId); if (association != geantToIndex_.end()) motherId = association->second; // int motherType = motherId == -1 ? 0 : @@ -482,7 +430,7 @@ std::vector ContainmentCorrectionAnalyzer::findMcTruth( trkFromConversion.push_back(&(*iSimTk)); } } - } // loop over the SimTracks + } // loop over the SimTracks if (!trkFromConversion.empty()) { isAconversion = 1; @@ -503,28 +451,32 @@ std::vector ContainmentCorrectionAnalyzer::findMcTruth( } iConv++; - result.push_back( - EcalSimPhotonMCTruth(isAconversion, (*iPhoTk)->momentum(), - vtxPosition.pt(), vtxPosition.z(), vtxPosition, - primVtx.position(), trkFromConversion)); + result.push_back(EcalSimPhotonMCTruth(isAconversion, + (*iPhoTk)->momentum(), + vtxPosition.pt(), + vtxPosition.z(), + vtxPosition, + primVtx.position(), + trkFromConversion)); } else { isAconversion = 0; math::XYZTLorentzVectorD vtxPosition(0., 0., 0., 0.); - result.push_back( - EcalSimPhotonMCTruth(isAconversion, (*iPhoTk)->momentum(), - vtxPosition.pt(), vtxPosition.z(), vtxPosition, - primVtx.position(), trkFromConversion)); + result.push_back(EcalSimPhotonMCTruth(isAconversion, + (*iPhoTk)->momentum(), + vtxPosition.pt(), + vtxPosition.z(), + vtxPosition, + primVtx.position(), + trkFromConversion)); } iPho++; - } // loop over the primary photons - } // Event with one or two photons + } // loop over the primary photons + } // Event with one or two photons return result; } -void ContainmentCorrectionAnalyzer::fillMcTruth( - std::vector &simTracks, std::vector &simVertices) { - +void ContainmentCorrectionAnalyzer::fillMcTruth(std::vector &simTracks, std::vector &simVertices) { unsigned nVtx = simVertices.size(); unsigned nTks = simTracks.size(); if (nVtx == 0) diff --git a/Validation/EcalClusters/src/EcalSimPhotonMCTruth.cc b/Validation/EcalClusters/src/EcalSimPhotonMCTruth.cc index 2689e0213eb88..38c3b7dae393f 100644 --- a/Validation/EcalClusters/src/EcalSimPhotonMCTruth.cc +++ b/Validation/EcalClusters/src/EcalSimPhotonMCTruth.cc @@ -2,10 +2,17 @@ #include -EcalSimPhotonMCTruth::EcalSimPhotonMCTruth( - int isAConversion, const math::XYZTLorentzVectorD &v, float rconv, - float zconv, const math::XYZTLorentzVectorD &convVertex, - const math::XYZTLorentzVectorD &pV, - const std::vector &tracks) - : isAConversion_(isAConversion), thePhoton_(v), theR_(rconv), theZ_(zconv), - theConvVertex_(convVertex), thePrimaryVertex_(pV), tracks_(tracks) {} +EcalSimPhotonMCTruth::EcalSimPhotonMCTruth(int isAConversion, + const math::XYZTLorentzVectorD &v, + float rconv, + float zconv, + const math::XYZTLorentzVectorD &convVertex, + const math::XYZTLorentzVectorD &pV, + const std::vector &tracks) + : isAConversion_(isAConversion), + thePhoton_(v), + theR_(rconv), + theZ_(zconv), + theConvVertex_(convVertex), + thePrimaryVertex_(pV), + tracks_(tracks) {} diff --git a/Validation/EcalClusters/src/EgammaBasicClusters.cc b/Validation/EcalClusters/src/EgammaBasicClusters.cc index 394d59be0256b..1bce4fc381425 100644 --- a/Validation/EcalClusters/src/EgammaBasicClusters.cc +++ b/Validation/EcalClusters/src/EgammaBasicClusters.cc @@ -11,143 +11,161 @@ #include "FWCore/Framework/interface/MakerMacros.h" EgammaBasicClusters::EgammaBasicClusters(const edm::ParameterSet &ps) - : barrelBasicClusterCollection_(consumes( - ps.getParameter("barrelBasicClusterCollection"))), - endcapBasicClusterCollection_(consumes( - ps.getParameter("endcapBasicClusterCollection"))), - hsSize_(ps, "Size"), hsNumRecHits_(ps, "NumRecHits"), hsET_(ps, "ET"), - hsEta_(ps, "Eta"), hsPhi_(ps, "Phi"), hsR_(ps, "R"), - hist_EB_BC_Size_(nullptr), hist_EE_BC_Size_(nullptr), - hist_EB_BC_NumRecHits_(nullptr), hist_EE_BC_NumRecHits_(nullptr), - hist_EB_BC_ET_(nullptr), hist_EE_BC_ET_(nullptr), - hist_EB_BC_Eta_(nullptr), hist_EE_BC_Eta_(nullptr), - hist_EB_BC_Phi_(nullptr), hist_EE_BC_Phi_(nullptr), - hist_EB_BC_ET_vs_Eta_(nullptr), hist_EB_BC_ET_vs_Phi_(nullptr), - hist_EE_BC_ET_vs_Eta_(nullptr), hist_EE_BC_ET_vs_Phi_(nullptr), + : barrelBasicClusterCollection_( + consumes(ps.getParameter("barrelBasicClusterCollection"))), + endcapBasicClusterCollection_( + consumes(ps.getParameter("endcapBasicClusterCollection"))), + hsSize_(ps, "Size"), + hsNumRecHits_(ps, "NumRecHits"), + hsET_(ps, "ET"), + hsEta_(ps, "Eta"), + hsPhi_(ps, "Phi"), + hsR_(ps, "R"), + hist_EB_BC_Size_(nullptr), + hist_EE_BC_Size_(nullptr), + hist_EB_BC_NumRecHits_(nullptr), + hist_EE_BC_NumRecHits_(nullptr), + hist_EB_BC_ET_(nullptr), + hist_EE_BC_ET_(nullptr), + hist_EB_BC_Eta_(nullptr), + hist_EE_BC_Eta_(nullptr), + hist_EB_BC_Phi_(nullptr), + hist_EE_BC_Phi_(nullptr), + hist_EB_BC_ET_vs_Eta_(nullptr), + hist_EB_BC_ET_vs_Phi_(nullptr), + hist_EE_BC_ET_vs_Eta_(nullptr), + hist_EE_BC_ET_vs_Phi_(nullptr), hist_EE_BC_ET_vs_R_(nullptr) {} EgammaBasicClusters::~EgammaBasicClusters() {} -void EgammaBasicClusters::bookHistograms(DQMStore::IBooker &_ibooker, - edm::Run const &, - edm::EventSetup const &) { +void EgammaBasicClusters::bookHistograms(DQMStore::IBooker &_ibooker, edm::Run const &, edm::EventSetup const &) { _ibooker.setCurrentFolder("EcalClusterV/EcalBasicClusters/"); hist_EB_BC_Size_ = - _ibooker.book1D("hist_EB_BC_Size_", "# Basic Clusters in Barrel", - hsSize_.bins, hsSize_.min, hsSize_.max); + _ibooker.book1D("hist_EB_BC_Size_", "# Basic Clusters in Barrel", hsSize_.bins, hsSize_.min, hsSize_.max); hist_EE_BC_Size_ = - _ibooker.book1D("hist_EE_BC_Size_", "# Basic Clusters in Endcap", - hsSize_.bins, hsSize_.min, hsSize_.max); - - hist_EB_BC_NumRecHits_ = _ibooker.book1D( - "hist_EB_BC_NumRecHits_", "# of RecHits in Basic Clusters in Barrel", - hsNumRecHits_.bins, hsNumRecHits_.min, hsNumRecHits_.max); - hist_EE_BC_NumRecHits_ = _ibooker.book1D( - "hist_EE_BC_NumRecHits_", "# of RecHits in Basic Clusters in Endcap", - hsNumRecHits_.bins, hsNumRecHits_.min, hsNumRecHits_.max); + _ibooker.book1D("hist_EE_BC_Size_", "# Basic Clusters in Endcap", hsSize_.bins, hsSize_.min, hsSize_.max); + + hist_EB_BC_NumRecHits_ = _ibooker.book1D("hist_EB_BC_NumRecHits_", + "# of RecHits in Basic Clusters in Barrel", + hsNumRecHits_.bins, + hsNumRecHits_.min, + hsNumRecHits_.max); + hist_EE_BC_NumRecHits_ = _ibooker.book1D("hist_EE_BC_NumRecHits_", + "# of RecHits in Basic Clusters in Endcap", + hsNumRecHits_.bins, + hsNumRecHits_.min, + hsNumRecHits_.max); hist_EB_BC_ET_ = - _ibooker.book1D("hist_EB_BC_ET_", "ET of Basic Clusters in Barrel", - hsET_.bins, hsET_.min, hsET_.max); + _ibooker.book1D("hist_EB_BC_ET_", "ET of Basic Clusters in Barrel", hsET_.bins, hsET_.min, hsET_.max); hist_EE_BC_ET_ = - _ibooker.book1D("hist_EE_BC_ET_", "ET of Basic Clusters in Endcap", - hsET_.bins, hsET_.min, hsET_.max); + _ibooker.book1D("hist_EE_BC_ET_", "ET of Basic Clusters in Endcap", hsET_.bins, hsET_.min, hsET_.max); hist_EB_BC_Eta_ = - _ibooker.book1D("hist_EB_BC_Eta_", "Eta of Basic Clusters in Barrel", - hsEta_.bins, hsEta_.min, hsEta_.max); + _ibooker.book1D("hist_EB_BC_Eta_", "Eta of Basic Clusters in Barrel", hsEta_.bins, hsEta_.min, hsEta_.max); hist_EE_BC_Eta_ = - _ibooker.book1D("hist_EE_BC_Eta_", "Eta of Basic Clusters in Endcap", - hsEta_.bins, hsEta_.min, hsEta_.max); + _ibooker.book1D("hist_EE_BC_Eta_", "Eta of Basic Clusters in Endcap", hsEta_.bins, hsEta_.min, hsEta_.max); hist_EB_BC_Phi_ = - _ibooker.book1D("hist_EB_BC_Phi_", "Phi of Basic Clusters in Barrel", - hsPhi_.bins, hsPhi_.min, hsPhi_.max); + _ibooker.book1D("hist_EB_BC_Phi_", "Phi of Basic Clusters in Barrel", hsPhi_.bins, hsPhi_.min, hsPhi_.max); hist_EE_BC_Phi_ = - _ibooker.book1D("hist_EE_BC_Phi_", "Phi of Basic Clusters in Endcap", - hsPhi_.bins, hsPhi_.min, hsPhi_.max); - - hist_EB_BC_ET_vs_Eta_ = _ibooker.book2D( - "hist_EB_BC_ET_vs_Eta_", "Basic Cluster ET versus Eta in Barrel", - hsET_.bins, hsET_.min, hsET_.max, hsEta_.bins, hsEta_.min, hsEta_.max); - - hist_EB_BC_ET_vs_Phi_ = _ibooker.book2D( - "hist_EB_BC_ET_vs_Phi_", "Basic Cluster ET versus Phi in Barrel", - hsET_.bins, hsET_.min, hsET_.max, hsPhi_.bins, hsPhi_.min, hsPhi_.max); - - hist_EE_BC_ET_vs_Eta_ = _ibooker.book2D( - "hist_EE_BC_ET_vs_Eta_", "Basic Cluster ET versus Eta in Endcap", - hsET_.bins, hsET_.min, hsET_.max, hsEta_.bins, hsEta_.min, hsEta_.max); - - hist_EE_BC_ET_vs_Phi_ = _ibooker.book2D( - "hist_EE_BC_ET_vs_Phi_", "Basic Cluster ET versus Phi in Endcap", - hsET_.bins, hsET_.min, hsET_.max, hsPhi_.bins, hsPhi_.min, hsPhi_.max); - - hist_EE_BC_ET_vs_R_ = _ibooker.book2D( - "hist_EE_BC_ET_vs_R_", "Basic Cluster ET versus Radius in Endcap", - hsET_.bins, hsET_.min, hsET_.max, hsR_.bins, hsR_.min, hsR_.max); + _ibooker.book1D("hist_EE_BC_Phi_", "Phi of Basic Clusters in Endcap", hsPhi_.bins, hsPhi_.min, hsPhi_.max); + + hist_EB_BC_ET_vs_Eta_ = _ibooker.book2D("hist_EB_BC_ET_vs_Eta_", + "Basic Cluster ET versus Eta in Barrel", + hsET_.bins, + hsET_.min, + hsET_.max, + hsEta_.bins, + hsEta_.min, + hsEta_.max); + + hist_EB_BC_ET_vs_Phi_ = _ibooker.book2D("hist_EB_BC_ET_vs_Phi_", + "Basic Cluster ET versus Phi in Barrel", + hsET_.bins, + hsET_.min, + hsET_.max, + hsPhi_.bins, + hsPhi_.min, + hsPhi_.max); + + hist_EE_BC_ET_vs_Eta_ = _ibooker.book2D("hist_EE_BC_ET_vs_Eta_", + "Basic Cluster ET versus Eta in Endcap", + hsET_.bins, + hsET_.min, + hsET_.max, + hsEta_.bins, + hsEta_.min, + hsEta_.max); + + hist_EE_BC_ET_vs_Phi_ = _ibooker.book2D("hist_EE_BC_ET_vs_Phi_", + "Basic Cluster ET versus Phi in Endcap", + hsET_.bins, + hsET_.min, + hsET_.max, + hsPhi_.bins, + hsPhi_.min, + hsPhi_.max); + + hist_EE_BC_ET_vs_R_ = _ibooker.book2D("hist_EE_BC_ET_vs_R_", + "Basic Cluster ET versus Radius in Endcap", + hsET_.bins, + hsET_.min, + hsET_.max, + hsR_.bins, + hsR_.min, + hsR_.max); } -void EgammaBasicClusters::analyze(const edm::Event &evt, - const edm::EventSetup &) { +void EgammaBasicClusters::analyze(const edm::Event &evt, const edm::EventSetup &) { edm::Handle pBarrelBasicClusters; evt.getByToken(barrelBasicClusterCollection_, pBarrelBasicClusters); if (!pBarrelBasicClusters.isValid()) { - Labels l; labelsForToken(barrelBasicClusterCollection_, l); - edm::LogError("EgammaBasicClusters") - << "Error! can't get collection with label " << l.module; + edm::LogError("EgammaBasicClusters") << "Error! can't get collection with label " << l.module; } - const reco::BasicClusterCollection *barrelBasicClusters = - pBarrelBasicClusters.product(); + const reco::BasicClusterCollection *barrelBasicClusters = pBarrelBasicClusters.product(); hist_EB_BC_Size_->Fill(barrelBasicClusters->size()); - for (reco::BasicClusterCollection::const_iterator aClus = - barrelBasicClusters->begin(); - aClus != barrelBasicClusters->end(); aClus++) { + for (reco::BasicClusterCollection::const_iterator aClus = barrelBasicClusters->begin(); + aClus != barrelBasicClusters->end(); + aClus++) { hist_EB_BC_NumRecHits_->Fill(aClus->size()); hist_EB_BC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta())); hist_EB_BC_Eta_->Fill(aClus->position().eta()); hist_EB_BC_Phi_->Fill(aClus->position().phi()); - hist_EB_BC_ET_vs_Eta_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); - hist_EB_BC_ET_vs_Phi_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); + hist_EB_BC_ET_vs_Eta_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); + hist_EB_BC_ET_vs_Phi_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); } edm::Handle pEndcapBasicClusters; evt.getByToken(endcapBasicClusterCollection_, pEndcapBasicClusters); if (!pEndcapBasicClusters.isValid()) { - Labels l; labelsForToken(endcapBasicClusterCollection_, l); - edm::LogError("EgammaBasicClusters") - << "Error! can't get collection with label " << l.module; + edm::LogError("EgammaBasicClusters") << "Error! can't get collection with label " << l.module; } - const reco::BasicClusterCollection *endcapBasicClusters = - pEndcapBasicClusters.product(); + const reco::BasicClusterCollection *endcapBasicClusters = pEndcapBasicClusters.product(); hist_EE_BC_Size_->Fill(endcapBasicClusters->size()); - for (reco::BasicClusterCollection::const_iterator aClus = - endcapBasicClusters->begin(); - aClus != endcapBasicClusters->end(); aClus++) { + for (reco::BasicClusterCollection::const_iterator aClus = endcapBasicClusters->begin(); + aClus != endcapBasicClusters->end(); + aClus++) { hist_EE_BC_NumRecHits_->Fill(aClus->size()); hist_EE_BC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta())); hist_EE_BC_Eta_->Fill(aClus->position().eta()); hist_EE_BC_Phi_->Fill(aClus->position().phi()); - hist_EE_BC_ET_vs_Eta_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); - hist_EE_BC_ET_vs_Phi_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); - hist_EE_BC_ET_vs_R_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), - std::sqrt(std::pow(aClus->x(), 2) + std::pow(aClus->y(), 2))); + hist_EE_BC_ET_vs_Eta_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); + hist_EE_BC_ET_vs_Phi_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); + hist_EE_BC_ET_vs_R_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), + std::sqrt(std::pow(aClus->x(), 2) + std::pow(aClus->y(), 2))); } } diff --git a/Validation/EcalClusters/src/EgammaSuperClusters.cc b/Validation/EcalClusters/src/EgammaSuperClusters.cc index c99894032325f..62df96bbba7dc 100644 --- a/Validation/EcalClusters/src/EgammaSuperClusters.cc +++ b/Validation/EcalClusters/src/EgammaSuperClusters.cc @@ -16,298 +16,360 @@ #include "FWCore/Framework/interface/MakerMacros.h" EgammaSuperClusters::EgammaSuperClusters(const edm::ParameterSet &ps) - : MCTruthCollectionToken_(consumes( - ps.getParameter("MCTruthCollection"))), + : MCTruthCollectionToken_(consumes(ps.getParameter("MCTruthCollection"))), barrelRawSuperClusterCollectionToken_( - consumes(ps.getParameter( - "barrelRawSuperClusterCollection"))), + consumes(ps.getParameter("barrelRawSuperClusterCollection"))), barrelCorSuperClusterCollectionToken_( - consumes(ps.getParameter( - "barrelCorSuperClusterCollection"))), + consumes(ps.getParameter("barrelCorSuperClusterCollection"))), endcapRawSuperClusterCollectionToken_( - consumes(ps.getParameter( - "endcapRawSuperClusterCollection"))), + consumes(ps.getParameter("endcapRawSuperClusterCollection"))), endcapPreSuperClusterCollectionToken_( - consumes(ps.getParameter( - "endcapPreSuperClusterCollection"))), + consumes(ps.getParameter("endcapPreSuperClusterCollection"))), endcapCorSuperClusterCollectionToken_( - consumes(ps.getParameter( - "endcapCorSuperClusterCollection"))), - barrelRecHitCollectionToken_(consumes( - ps.getParameter("barrelRecHitCollection"))), - endcapRecHitCollectionToken_(consumes( - ps.getParameter("endcapRecHitCollection"))), - hsSize_(ps, "Size"), hsNumBC_(ps, "NumBC"), hsET_(ps, "ET"), - hsEta_(ps, "Eta"), hsPhi_(ps, "Phi"), hsS1toS9_(ps, "S1toS9"), - hsS25toE_(ps, "S25toE"), hsEoverTruth_(ps, "EoverTruth"), - hsdeltaR_(ps, "deltaR"), hsphiWidth_(ps, "phiWidth"), - hsetaWidth_(ps, "etaWidth"), hspreshowerE_(ps, "preshowerE"), - hsR_(ps, "R"), hist_EB_RawSC_Size_(nullptr), hist_EE_RawSC_Size_(nullptr), - hist_EB_CorSC_Size_(nullptr), hist_EE_CorSC_Size_(nullptr), - hist_EE_PreSC_Size_(nullptr), hist_EB_RawSC_NumBC_(nullptr), - hist_EE_RawSC_NumBC_(nullptr), hist_EB_CorSC_NumBC_(nullptr), - hist_EE_CorSC_NumBC_(nullptr), hist_EE_PreSC_NumBC_(nullptr), - hist_EB_RawSC_ET_(nullptr), hist_EE_RawSC_ET_(nullptr), - hist_EB_CorSC_ET_(nullptr), hist_EE_CorSC_ET_(nullptr), - hist_EE_PreSC_ET_(nullptr), hist_EB_RawSC_Eta_(nullptr), - hist_EE_RawSC_Eta_(nullptr), hist_EB_CorSC_Eta_(nullptr), - hist_EE_CorSC_Eta_(nullptr), hist_EE_PreSC_Eta_(nullptr), - hist_EB_RawSC_Phi_(nullptr), hist_EE_RawSC_Phi_(nullptr), - hist_EB_CorSC_Phi_(nullptr), hist_EE_CorSC_Phi_(nullptr), - hist_EE_PreSC_Phi_(nullptr), hist_EB_RawSC_S1toS9_(nullptr), - hist_EE_RawSC_S1toS9_(nullptr), hist_EB_CorSC_S1toS9_(nullptr), - hist_EE_CorSC_S1toS9_(nullptr), hist_EE_PreSC_S1toS9_(nullptr), - hist_EB_RawSC_S25toE_(nullptr), hist_EE_RawSC_S25toE_(nullptr), - hist_EB_CorSC_S25toE_(nullptr), hist_EE_CorSC_S25toE_(nullptr), - hist_EE_PreSC_S25toE_(nullptr), hist_EB_RawSC_EoverTruth_(nullptr), - hist_EE_RawSC_EoverTruth_(nullptr), hist_EB_CorSC_EoverTruth_(nullptr), - hist_EE_CorSC_EoverTruth_(nullptr), hist_EE_PreSC_EoverTruth_(nullptr), - hist_EB_RawSC_deltaR_(nullptr), hist_EE_RawSC_deltaR_(nullptr), - hist_EB_CorSC_deltaR_(nullptr), hist_EE_CorSC_deltaR_(nullptr), - hist_EE_PreSC_deltaR_(nullptr), hist_EE_PreSC_preshowerE_(nullptr), - hist_EE_CorSC_preshowerE_(nullptr), hist_EE_CorSC_phiWidth_(nullptr), - hist_EB_CorSC_phiWidth_(nullptr), hist_EE_CorSC_etaWidth_(nullptr), - hist_EB_CorSC_etaWidth_(nullptr), hist_EB_CorSC_ET_vs_Eta_(nullptr), - hist_EB_CorSC_ET_vs_Phi_(nullptr), hist_EE_CorSC_ET_vs_Eta_(nullptr), - hist_EE_CorSC_ET_vs_Phi_(nullptr), hist_EE_CorSC_ET_vs_R_(nullptr) {} + consumes(ps.getParameter("endcapCorSuperClusterCollection"))), + barrelRecHitCollectionToken_( + consumes(ps.getParameter("barrelRecHitCollection"))), + endcapRecHitCollectionToken_( + consumes(ps.getParameter("endcapRecHitCollection"))), + hsSize_(ps, "Size"), + hsNumBC_(ps, "NumBC"), + hsET_(ps, "ET"), + hsEta_(ps, "Eta"), + hsPhi_(ps, "Phi"), + hsS1toS9_(ps, "S1toS9"), + hsS25toE_(ps, "S25toE"), + hsEoverTruth_(ps, "EoverTruth"), + hsdeltaR_(ps, "deltaR"), + hsphiWidth_(ps, "phiWidth"), + hsetaWidth_(ps, "etaWidth"), + hspreshowerE_(ps, "preshowerE"), + hsR_(ps, "R"), + hist_EB_RawSC_Size_(nullptr), + hist_EE_RawSC_Size_(nullptr), + hist_EB_CorSC_Size_(nullptr), + hist_EE_CorSC_Size_(nullptr), + hist_EE_PreSC_Size_(nullptr), + hist_EB_RawSC_NumBC_(nullptr), + hist_EE_RawSC_NumBC_(nullptr), + hist_EB_CorSC_NumBC_(nullptr), + hist_EE_CorSC_NumBC_(nullptr), + hist_EE_PreSC_NumBC_(nullptr), + hist_EB_RawSC_ET_(nullptr), + hist_EE_RawSC_ET_(nullptr), + hist_EB_CorSC_ET_(nullptr), + hist_EE_CorSC_ET_(nullptr), + hist_EE_PreSC_ET_(nullptr), + hist_EB_RawSC_Eta_(nullptr), + hist_EE_RawSC_Eta_(nullptr), + hist_EB_CorSC_Eta_(nullptr), + hist_EE_CorSC_Eta_(nullptr), + hist_EE_PreSC_Eta_(nullptr), + hist_EB_RawSC_Phi_(nullptr), + hist_EE_RawSC_Phi_(nullptr), + hist_EB_CorSC_Phi_(nullptr), + hist_EE_CorSC_Phi_(nullptr), + hist_EE_PreSC_Phi_(nullptr), + hist_EB_RawSC_S1toS9_(nullptr), + hist_EE_RawSC_S1toS9_(nullptr), + hist_EB_CorSC_S1toS9_(nullptr), + hist_EE_CorSC_S1toS9_(nullptr), + hist_EE_PreSC_S1toS9_(nullptr), + hist_EB_RawSC_S25toE_(nullptr), + hist_EE_RawSC_S25toE_(nullptr), + hist_EB_CorSC_S25toE_(nullptr), + hist_EE_CorSC_S25toE_(nullptr), + hist_EE_PreSC_S25toE_(nullptr), + hist_EB_RawSC_EoverTruth_(nullptr), + hist_EE_RawSC_EoverTruth_(nullptr), + hist_EB_CorSC_EoverTruth_(nullptr), + hist_EE_CorSC_EoverTruth_(nullptr), + hist_EE_PreSC_EoverTruth_(nullptr), + hist_EB_RawSC_deltaR_(nullptr), + hist_EE_RawSC_deltaR_(nullptr), + hist_EB_CorSC_deltaR_(nullptr), + hist_EE_CorSC_deltaR_(nullptr), + hist_EE_PreSC_deltaR_(nullptr), + hist_EE_PreSC_preshowerE_(nullptr), + hist_EE_CorSC_preshowerE_(nullptr), + hist_EE_CorSC_phiWidth_(nullptr), + hist_EB_CorSC_phiWidth_(nullptr), + hist_EE_CorSC_etaWidth_(nullptr), + hist_EB_CorSC_etaWidth_(nullptr), + hist_EB_CorSC_ET_vs_Eta_(nullptr), + hist_EB_CorSC_ET_vs_Phi_(nullptr), + hist_EE_CorSC_ET_vs_Eta_(nullptr), + hist_EE_CorSC_ET_vs_Phi_(nullptr), + hist_EE_CorSC_ET_vs_R_(nullptr) {} EgammaSuperClusters::~EgammaSuperClusters() {} -void EgammaSuperClusters::bookHistograms(DQMStore::IBooker &_ibooker, - edm::Run const &, - edm::EventSetup const &) { +void EgammaSuperClusters::bookHistograms(DQMStore::IBooker &_ibooker, edm::Run const &, edm::EventSetup const &) { _ibooker.setCurrentFolder("EcalClusterV/EcalSuperClusters/"); // Number of SuperClusters // hist_EB_RawSC_Size_ = - _ibooker.book1D("hist_EB_RawSC_Size_", "# Raw SuperClusters in Barrel", - hsSize_.bins, hsSize_.min, hsSize_.max); + _ibooker.book1D("hist_EB_RawSC_Size_", "# Raw SuperClusters in Barrel", hsSize_.bins, hsSize_.min, hsSize_.max); hist_EE_RawSC_Size_ = - _ibooker.book1D("hist_EE_RawSC_Size_", "# Raw SuperClusters in Endcap", - hsSize_.bins, hsSize_.min, hsSize_.max); - hist_EB_CorSC_Size_ = _ibooker.book1D("hist_EB_CorSC_Size_", - "# Corrected SuperClusters in Barrel", - hsSize_.bins, hsSize_.min, hsSize_.max); - hist_EE_CorSC_Size_ = _ibooker.book1D("hist_EE_CorSC_Size_", - "# Corrected SuperClusters in Endcap", - hsSize_.bins, hsSize_.min, hsSize_.max); + _ibooker.book1D("hist_EE_RawSC_Size_", "# Raw SuperClusters in Endcap", hsSize_.bins, hsSize_.min, hsSize_.max); + hist_EB_CorSC_Size_ = _ibooker.book1D( + "hist_EB_CorSC_Size_", "# Corrected SuperClusters in Barrel", hsSize_.bins, hsSize_.min, hsSize_.max); + hist_EE_CorSC_Size_ = _ibooker.book1D( + "hist_EE_CorSC_Size_", "# Corrected SuperClusters in Endcap", hsSize_.bins, hsSize_.min, hsSize_.max); hist_EE_PreSC_Size_ = _ibooker.book1D( - "hist_EE_PreSC_Size_", "# SuperClusters with Preshower in Endcap", - hsSize_.bins, hsSize_.min, hsSize_.max); + "hist_EE_PreSC_Size_", "# SuperClusters with Preshower in Endcap", hsSize_.bins, hsSize_.min, hsSize_.max); // Number of BasicClusters in SuperCluster // - hist_EB_RawSC_NumBC_ = - _ibooker.book1D("hist_EB_RawSC_NumBC_", - "# of Basic Clusters in Raw Super Clusters in Barrel", - hsNumBC_.bins, hsNumBC_.min, hsNumBC_.max); - hist_EE_RawSC_NumBC_ = - _ibooker.book1D("hist_EE_RawSC_NumBC_", - "# of Basic Clusters in Raw Super Clusters in Endcap", - hsNumBC_.bins, hsNumBC_.min, hsNumBC_.max); - hist_EB_CorSC_NumBC_ = _ibooker.book1D( - "hist_EB_CorSC_NumBC_", - "# of Basic Clusters in Corrected SuperClusters in Barrel", hsNumBC_.bins, - hsNumBC_.min, hsNumBC_.max); - hist_EE_CorSC_NumBC_ = _ibooker.book1D( - "hist_EE_CorSC_NumBC_", - "# of Basic Clusters in Corrected SuperClusters in Endcap", hsNumBC_.bins, - hsNumBC_.min, hsNumBC_.max); - hist_EE_PreSC_NumBC_ = _ibooker.book1D( - "hist_EE_PreSC_NumBC_", - "# of Basic Clusters in SuperClusters with Preshower in Endcap", - hsNumBC_.bins, hsNumBC_.min, hsNumBC_.max); + hist_EB_RawSC_NumBC_ = _ibooker.book1D("hist_EB_RawSC_NumBC_", + "# of Basic Clusters in Raw Super Clusters in Barrel", + hsNumBC_.bins, + hsNumBC_.min, + hsNumBC_.max); + hist_EE_RawSC_NumBC_ = _ibooker.book1D("hist_EE_RawSC_NumBC_", + "# of Basic Clusters in Raw Super Clusters in Endcap", + hsNumBC_.bins, + hsNumBC_.min, + hsNumBC_.max); + hist_EB_CorSC_NumBC_ = _ibooker.book1D("hist_EB_CorSC_NumBC_", + "# of Basic Clusters in Corrected SuperClusters in Barrel", + hsNumBC_.bins, + hsNumBC_.min, + hsNumBC_.max); + hist_EE_CorSC_NumBC_ = _ibooker.book1D("hist_EE_CorSC_NumBC_", + "# of Basic Clusters in Corrected SuperClusters in Endcap", + hsNumBC_.bins, + hsNumBC_.min, + hsNumBC_.max); + hist_EE_PreSC_NumBC_ = _ibooker.book1D("hist_EE_PreSC_NumBC_", + "# of Basic Clusters in SuperClusters with Preshower in Endcap", + hsNumBC_.bins, + hsNumBC_.min, + hsNumBC_.max); // ET distribution of SuperClusters // hist_EB_RawSC_ET_ = - _ibooker.book1D("hist_EB_RawSC_ET_", "ET of Raw SuperClusters in Barrel", - hsET_.bins, hsET_.min, hsET_.max); + _ibooker.book1D("hist_EB_RawSC_ET_", "ET of Raw SuperClusters in Barrel", hsET_.bins, hsET_.min, hsET_.max); hist_EE_RawSC_ET_ = - _ibooker.book1D("hist_EE_RawSC_ET_", "ET of Raw SuperClusters in Endcap", - hsET_.bins, hsET_.min, hsET_.max); - hist_EB_CorSC_ET_ = _ibooker.book1D("hist_EB_CorSC_ET_", - "ET of Corrected SuperClusters in Barrel", - hsET_.bins, hsET_.min, hsET_.max); - hist_EE_CorSC_ET_ = _ibooker.book1D("hist_EE_CorSC_ET_", - "ET of Corrected SuperClusters in Endcap", - hsET_.bins, hsET_.min, hsET_.max); + _ibooker.book1D("hist_EE_RawSC_ET_", "ET of Raw SuperClusters in Endcap", hsET_.bins, hsET_.min, hsET_.max); + hist_EB_CorSC_ET_ = + _ibooker.book1D("hist_EB_CorSC_ET_", "ET of Corrected SuperClusters in Barrel", hsET_.bins, hsET_.min, hsET_.max); + hist_EE_CorSC_ET_ = + _ibooker.book1D("hist_EE_CorSC_ET_", "ET of Corrected SuperClusters in Endcap", hsET_.bins, hsET_.min, hsET_.max); hist_EE_PreSC_ET_ = _ibooker.book1D( - "hist_EE_PreSC_ET_", "ET of SuperClusters with Preshower in Endcap", - hsET_.bins, hsET_.min, hsET_.max); + "hist_EE_PreSC_ET_", "ET of SuperClusters with Preshower in Endcap", hsET_.bins, hsET_.min, hsET_.max); // Eta distribution of SuperClusters // - hist_EB_RawSC_Eta_ = _ibooker.book1D("hist_EB_RawSC_Eta_", - "Eta of Raw SuperClusters in Barrel", - hsEta_.bins, hsEta_.min, hsEta_.max); - hist_EE_RawSC_Eta_ = _ibooker.book1D("hist_EE_RawSC_Eta_", - "Eta of Raw SuperClusters in Endcap", - hsEta_.bins, hsEta_.min, hsEta_.max); + hist_EB_RawSC_Eta_ = + _ibooker.book1D("hist_EB_RawSC_Eta_", "Eta of Raw SuperClusters in Barrel", hsEta_.bins, hsEta_.min, hsEta_.max); + hist_EE_RawSC_Eta_ = + _ibooker.book1D("hist_EE_RawSC_Eta_", "Eta of Raw SuperClusters in Endcap", hsEta_.bins, hsEta_.min, hsEta_.max); hist_EB_CorSC_Eta_ = _ibooker.book1D( - "hist_EB_CorSC_Eta_", "Eta of Corrected SuperClusters in Barrel", - hsEta_.bins, hsEta_.min, hsEta_.max); + "hist_EB_CorSC_Eta_", "Eta of Corrected SuperClusters in Barrel", hsEta_.bins, hsEta_.min, hsEta_.max); hist_EE_CorSC_Eta_ = _ibooker.book1D( - "hist_EE_CorSC_Eta_", "Eta of Corrected SuperClusters in Endcap", - hsEta_.bins, hsEta_.min, hsEta_.max); + "hist_EE_CorSC_Eta_", "Eta of Corrected SuperClusters in Endcap", hsEta_.bins, hsEta_.min, hsEta_.max); hist_EE_PreSC_Eta_ = _ibooker.book1D( - "hist_EE_PreSC_Eta_", "Eta of SuperClusters with Preshower in Endcap", - hsEta_.bins, hsEta_.min, hsEta_.max); + "hist_EE_PreSC_Eta_", "Eta of SuperClusters with Preshower in Endcap", hsEta_.bins, hsEta_.min, hsEta_.max); // Phi distribution of SuperClusters // - hist_EB_RawSC_Phi_ = _ibooker.book1D("hist_EB_RawSC_Phi_", - "Phi of Raw SuperClusters in Barrel", - hsPhi_.bins, hsPhi_.min, hsPhi_.max); - hist_EE_RawSC_Phi_ = _ibooker.book1D("hist_EE_RawSC_Phi_", - "Phi of Raw SuperClusters in Endcap", - hsPhi_.bins, hsPhi_.min, hsPhi_.max); + hist_EB_RawSC_Phi_ = + _ibooker.book1D("hist_EB_RawSC_Phi_", "Phi of Raw SuperClusters in Barrel", hsPhi_.bins, hsPhi_.min, hsPhi_.max); + hist_EE_RawSC_Phi_ = + _ibooker.book1D("hist_EE_RawSC_Phi_", "Phi of Raw SuperClusters in Endcap", hsPhi_.bins, hsPhi_.min, hsPhi_.max); hist_EB_CorSC_Phi_ = _ibooker.book1D( - "hist_EB_CorSC_Phi_", "Phi of Corrected SuperClusters in Barrel", - hsPhi_.bins, hsPhi_.min, hsPhi_.max); + "hist_EB_CorSC_Phi_", "Phi of Corrected SuperClusters in Barrel", hsPhi_.bins, hsPhi_.min, hsPhi_.max); hist_EE_CorSC_Phi_ = _ibooker.book1D( - "hist_EE_CorSC_Phi_", "Phi of Corrected SuperClusters in Endcap", - hsPhi_.bins, hsPhi_.min, hsPhi_.max); + "hist_EE_CorSC_Phi_", "Phi of Corrected SuperClusters in Endcap", hsPhi_.bins, hsPhi_.min, hsPhi_.max); hist_EE_PreSC_Phi_ = _ibooker.book1D( - "hist_EE_PreSC_Phi_", "Phi of SuperClusters with Preshower in Endcap", - hsPhi_.bins, hsPhi_.min, hsPhi_.max); + "hist_EE_PreSC_Phi_", "Phi of SuperClusters with Preshower in Endcap", hsPhi_.bins, hsPhi_.min, hsPhi_.max); // S1/S9 distribution of SuperClusters // hist_EB_RawSC_S1toS9_ = _ibooker.book1D( - "hist_EB_RawSC_S1toS9_", "S1/S9 of Raw Super Clusters in Barrel", - hsS1toS9_.bins, hsS1toS9_.min, hsS1toS9_.max); + "hist_EB_RawSC_S1toS9_", "S1/S9 of Raw Super Clusters in Barrel", hsS1toS9_.bins, hsS1toS9_.min, hsS1toS9_.max); hist_EE_RawSC_S1toS9_ = _ibooker.book1D( - "hist_EE_RawSC_S1toS9_", "S1/S9 of Raw Super Clusters in Endcap", - hsS1toS9_.bins, hsS1toS9_.min, hsS1toS9_.max); - hist_EB_CorSC_S1toS9_ = _ibooker.book1D( - "hist_EB_CorSC_S1toS9_", "S1/S9 of Corrected SuperClusters in Barrel", - hsS1toS9_.bins, hsS1toS9_.min, hsS1toS9_.max); - hist_EE_CorSC_S1toS9_ = _ibooker.book1D( - "hist_EE_CorSC_S1toS9_", "S1/S9 of Corrected SuperClusters in Endcap", - hsS1toS9_.bins, hsS1toS9_.min, hsS1toS9_.max); - hist_EE_PreSC_S1toS9_ = - _ibooker.book1D("hist_EE_PreSC_S1toS9_", - "S1/S9 of SuperClusters with Preshower in Endcap", - hsS1toS9_.bins, hsS1toS9_.min, hsS1toS9_.max); + "hist_EE_RawSC_S1toS9_", "S1/S9 of Raw Super Clusters in Endcap", hsS1toS9_.bins, hsS1toS9_.min, hsS1toS9_.max); + hist_EB_CorSC_S1toS9_ = _ibooker.book1D("hist_EB_CorSC_S1toS9_", + "S1/S9 of Corrected SuperClusters in Barrel", + hsS1toS9_.bins, + hsS1toS9_.min, + hsS1toS9_.max); + hist_EE_CorSC_S1toS9_ = _ibooker.book1D("hist_EE_CorSC_S1toS9_", + "S1/S9 of Corrected SuperClusters in Endcap", + hsS1toS9_.bins, + hsS1toS9_.min, + hsS1toS9_.max); + hist_EE_PreSC_S1toS9_ = _ibooker.book1D("hist_EE_PreSC_S1toS9_", + "S1/S9 of SuperClusters with Preshower in Endcap", + hsS1toS9_.bins, + hsS1toS9_.min, + hsS1toS9_.max); // S25/E distribution of SuperClusters // hist_EB_RawSC_S25toE_ = _ibooker.book1D( - "hist_EB_RawSC_S25toE_", "S25/E of Raw Super Clusters in Barrel", - hsS25toE_.bins, hsS25toE_.min, hsS25toE_.max); + "hist_EB_RawSC_S25toE_", "S25/E of Raw Super Clusters in Barrel", hsS25toE_.bins, hsS25toE_.min, hsS25toE_.max); hist_EE_RawSC_S25toE_ = _ibooker.book1D( - "hist_EE_RawSC_S25toE_", "S25/E of Raw Super Clusters in Endcap", - hsS25toE_.bins, hsS25toE_.min, hsS25toE_.max); - hist_EB_CorSC_S25toE_ = _ibooker.book1D( - "hist_EB_CorSC_S25toE_", "S25/E of Corrected SuperClusters in Barrel", - hsS25toE_.bins, hsS25toE_.min, hsS25toE_.max); - hist_EE_CorSC_S25toE_ = _ibooker.book1D( - "hist_EE_CorSC_S25toE_", "S25/E of Corrected SuperClusters in Endcap", - hsS25toE_.bins, hsS25toE_.min, hsS25toE_.max); - hist_EE_PreSC_S25toE_ = - _ibooker.book1D("hist_EE_PreSC_S25toE_", - "S25/E of SuperClusters with Preshower in Endcap", - hsS25toE_.bins, hsS25toE_.min, hsS25toE_.max); + "hist_EE_RawSC_S25toE_", "S25/E of Raw Super Clusters in Endcap", hsS25toE_.bins, hsS25toE_.min, hsS25toE_.max); + hist_EB_CorSC_S25toE_ = _ibooker.book1D("hist_EB_CorSC_S25toE_", + "S25/E of Corrected SuperClusters in Barrel", + hsS25toE_.bins, + hsS25toE_.min, + hsS25toE_.max); + hist_EE_CorSC_S25toE_ = _ibooker.book1D("hist_EE_CorSC_S25toE_", + "S25/E of Corrected SuperClusters in Endcap", + hsS25toE_.bins, + hsS25toE_.min, + hsS25toE_.max); + hist_EE_PreSC_S25toE_ = _ibooker.book1D("hist_EE_PreSC_S25toE_", + "S25/E of SuperClusters with Preshower in Endcap", + hsS25toE_.bins, + hsS25toE_.min, + hsS25toE_.max); // E/E(true) distribution of SuperClusters // - hist_EB_RawSC_EoverTruth_ = _ibooker.book1D( - "hist_EB_RawSC_EoverTruth_", "E/True E of Raw SuperClusters in Barrel", - hsEoverTruth_.bins, hsEoverTruth_.min, hsEoverTruth_.max); - hist_EE_RawSC_EoverTruth_ = _ibooker.book1D( - "hist_EE_RawSC_EoverTruth_", "E/True E of Raw SuperClusters in Endcap", - hsEoverTruth_.bins, hsEoverTruth_.min, hsEoverTruth_.max); - hist_EB_CorSC_EoverTruth_ = - _ibooker.book1D("hist_EB_CorSC_EoverTruth_", - "E/True E of Corrected SuperClusters in Barrel", - hsEoverTruth_.bins, hsEoverTruth_.min, hsEoverTruth_.max); - hist_EE_CorSC_EoverTruth_ = - _ibooker.book1D("hist_EE_CorSC_EoverTruth_", - "E/True E of Corrected SuperClusters in Endcap", - hsEoverTruth_.bins, hsEoverTruth_.min, hsEoverTruth_.max); - hist_EE_PreSC_EoverTruth_ = - _ibooker.book1D("hist_EE_PreSC_EoverTruth_", - "E/True E of SuperClusters with Preshower in Endcap", - hsEoverTruth_.bins, hsEoverTruth_.min, hsEoverTruth_.max); + hist_EB_RawSC_EoverTruth_ = _ibooker.book1D("hist_EB_RawSC_EoverTruth_", + "E/True E of Raw SuperClusters in Barrel", + hsEoverTruth_.bins, + hsEoverTruth_.min, + hsEoverTruth_.max); + hist_EE_RawSC_EoverTruth_ = _ibooker.book1D("hist_EE_RawSC_EoverTruth_", + "E/True E of Raw SuperClusters in Endcap", + hsEoverTruth_.bins, + hsEoverTruth_.min, + hsEoverTruth_.max); + hist_EB_CorSC_EoverTruth_ = _ibooker.book1D("hist_EB_CorSC_EoverTruth_", + "E/True E of Corrected SuperClusters in Barrel", + hsEoverTruth_.bins, + hsEoverTruth_.min, + hsEoverTruth_.max); + hist_EE_CorSC_EoverTruth_ = _ibooker.book1D("hist_EE_CorSC_EoverTruth_", + "E/True E of Corrected SuperClusters in Endcap", + hsEoverTruth_.bins, + hsEoverTruth_.min, + hsEoverTruth_.max); + hist_EE_PreSC_EoverTruth_ = _ibooker.book1D("hist_EE_PreSC_EoverTruth_", + "E/True E of SuperClusters with Preshower in Endcap", + hsEoverTruth_.bins, + hsEoverTruth_.min, + hsEoverTruth_.max); // dR distribution of SuperClusters from truth // - hist_EB_RawSC_deltaR_ = _ibooker.book1D( - "hist_EB_RawSC_deltaR_", "dR to MC truth of Raw Super Clusters in Barrel", - hsdeltaR_.bins, hsdeltaR_.min, hsdeltaR_.max); - hist_EE_RawSC_deltaR_ = _ibooker.book1D( - "hist_EE_RawSC_deltaR_", "dR to MC truth of Raw Super Clusters in Endcap", - hsdeltaR_.bins, hsdeltaR_.min, hsdeltaR_.max); - hist_EB_CorSC_deltaR_ = - _ibooker.book1D("hist_EB_CorSC_deltaR_", - "dR to MC truth of Corrected SuperClusters in Barrel", - hsdeltaR_.bins, hsdeltaR_.min, hsdeltaR_.max); - hist_EE_CorSC_deltaR_ = - _ibooker.book1D("hist_EE_CorSC_deltaR_", - "dR to MC truth of Corrected SuperClusters in Endcap", - hsdeltaR_.bins, hsdeltaR_.min, hsdeltaR_.max); - hist_EE_PreSC_deltaR_ = _ibooker.book1D( - "hist_EE_PreSC_deltaR_", - "dR to MC truth of SuperClusters with Preshower in Endcap", - hsdeltaR_.bins, hsdeltaR_.min, hsdeltaR_.max); + hist_EB_RawSC_deltaR_ = _ibooker.book1D("hist_EB_RawSC_deltaR_", + "dR to MC truth of Raw Super Clusters in Barrel", + hsdeltaR_.bins, + hsdeltaR_.min, + hsdeltaR_.max); + hist_EE_RawSC_deltaR_ = _ibooker.book1D("hist_EE_RawSC_deltaR_", + "dR to MC truth of Raw Super Clusters in Endcap", + hsdeltaR_.bins, + hsdeltaR_.min, + hsdeltaR_.max); + hist_EB_CorSC_deltaR_ = _ibooker.book1D("hist_EB_CorSC_deltaR_", + "dR to MC truth of Corrected SuperClusters in Barrel", + hsdeltaR_.bins, + hsdeltaR_.min, + hsdeltaR_.max); + hist_EE_CorSC_deltaR_ = _ibooker.book1D("hist_EE_CorSC_deltaR_", + "dR to MC truth of Corrected SuperClusters in Endcap", + hsdeltaR_.bins, + hsdeltaR_.min, + hsdeltaR_.max); + hist_EE_PreSC_deltaR_ = _ibooker.book1D("hist_EE_PreSC_deltaR_", + "dR to MC truth of SuperClusters with Preshower in Endcap", + hsdeltaR_.bins, + hsdeltaR_.min, + hsdeltaR_.max); // phi width stored in corrected SuperClusters - hist_EB_CorSC_phiWidth_ = - _ibooker.book1D("hist_EB_CorSC_phiWidth_", - "phiWidth of Corrected Super Clusters in Barrel", - hsphiWidth_.bins, hsphiWidth_.min, hsphiWidth_.max); - hist_EE_CorSC_phiWidth_ = - _ibooker.book1D("hist_EE_CorSC_phiWidth_", - "phiWidth of Corrected Super Clusters in Endcap", - hsphiWidth_.bins, hsphiWidth_.min, hsphiWidth_.max); + hist_EB_CorSC_phiWidth_ = _ibooker.book1D("hist_EB_CorSC_phiWidth_", + "phiWidth of Corrected Super Clusters in Barrel", + hsphiWidth_.bins, + hsphiWidth_.min, + hsphiWidth_.max); + hist_EE_CorSC_phiWidth_ = _ibooker.book1D("hist_EE_CorSC_phiWidth_", + "phiWidth of Corrected Super Clusters in Endcap", + hsphiWidth_.bins, + hsphiWidth_.min, + hsphiWidth_.max); // eta width stored in corrected SuperClusters - hist_EB_CorSC_etaWidth_ = - _ibooker.book1D("hist_EB_CorSC_etaWidth_", - "etaWidth of Corrected Super Clusters in Barrel", - hsetaWidth_.bins, hsetaWidth_.min, hsetaWidth_.max); - hist_EE_CorSC_etaWidth_ = - _ibooker.book1D("hist_EE_CorSC_etaWidth_", - "etaWidth of Corrected Super Clusters in Endcap", - hsetaWidth_.bins, hsetaWidth_.min, hsetaWidth_.max); + hist_EB_CorSC_etaWidth_ = _ibooker.book1D("hist_EB_CorSC_etaWidth_", + "etaWidth of Corrected Super Clusters in Barrel", + hsetaWidth_.bins, + hsetaWidth_.min, + hsetaWidth_.max); + hist_EE_CorSC_etaWidth_ = _ibooker.book1D("hist_EE_CorSC_etaWidth_", + "etaWidth of Corrected Super Clusters in Endcap", + hsetaWidth_.bins, + hsetaWidth_.min, + hsetaWidth_.max); // preshower energy - hist_EE_PreSC_preshowerE_ = _ibooker.book1D( - "hist_EE_PreSC_preshowerE_", - "preshower energy in Super Clusters with Preshower in Endcap", - hspreshowerE_.bins, hspreshowerE_.min, hspreshowerE_.max); - hist_EE_CorSC_preshowerE_ = _ibooker.book1D( - "hist_EE_CorSC_preshowerE_", - "preshower energy in Corrected Super Clusters with Preshower in Endcap", - hspreshowerE_.bins, hspreshowerE_.min, hspreshowerE_.max); + hist_EE_PreSC_preshowerE_ = _ibooker.book1D("hist_EE_PreSC_preshowerE_", + "preshower energy in Super Clusters with Preshower in Endcap", + hspreshowerE_.bins, + hspreshowerE_.min, + hspreshowerE_.max); + hist_EE_CorSC_preshowerE_ = _ibooker.book1D("hist_EE_CorSC_preshowerE_", + "preshower energy in Corrected Super Clusters with Preshower in Endcap", + hspreshowerE_.bins, + hspreshowerE_.min, + hspreshowerE_.max); // - hist_EB_CorSC_ET_vs_Eta_ = _ibooker.book2D( - "hist_EB_CorSC_ET_vs_Eta_", "Corr Super Cluster ET versus Eta in Barrel", - hsET_.bins, hsET_.min, hsET_.max, hsEta_.bins, hsEta_.min, hsEta_.max); - - hist_EB_CorSC_ET_vs_Phi_ = _ibooker.book2D( - "hist_EB_CorSC_ET_vs_Phi_", "Corr Super Cluster ET versus Phi in Barrel", - hsET_.bins, hsET_.min, hsET_.max, hsPhi_.bins, hsPhi_.min, hsPhi_.max); - - hist_EE_CorSC_ET_vs_Eta_ = _ibooker.book2D( - "hist_EE_CorSC_ET_vs_Eta_", "Corr Super Cluster ET versus Eta in Endcap", - hsET_.bins, hsET_.min, hsET_.max, hsEta_.bins, hsEta_.min, hsEta_.max); - - hist_EE_CorSC_ET_vs_Phi_ = _ibooker.book2D( - "hist_EE_CorSC_ET_vs_Phi_", "Corr Super Cluster ET versus Phi in Endcap", - hsET_.bins, hsET_.min, hsET_.max, hsPhi_.bins, hsPhi_.min, hsPhi_.max); - - hist_EE_CorSC_ET_vs_R_ = _ibooker.book2D( - "hist_EE_CorSC_ET_vs_R_", "Corr Super Cluster ET versus Radius in Endcap", - hsET_.bins, hsET_.min, hsET_.max, hsR_.bins, hsR_.min, hsR_.max); + hist_EB_CorSC_ET_vs_Eta_ = _ibooker.book2D("hist_EB_CorSC_ET_vs_Eta_", + "Corr Super Cluster ET versus Eta in Barrel", + hsET_.bins, + hsET_.min, + hsET_.max, + hsEta_.bins, + hsEta_.min, + hsEta_.max); + + hist_EB_CorSC_ET_vs_Phi_ = _ibooker.book2D("hist_EB_CorSC_ET_vs_Phi_", + "Corr Super Cluster ET versus Phi in Barrel", + hsET_.bins, + hsET_.min, + hsET_.max, + hsPhi_.bins, + hsPhi_.min, + hsPhi_.max); + + hist_EE_CorSC_ET_vs_Eta_ = _ibooker.book2D("hist_EE_CorSC_ET_vs_Eta_", + "Corr Super Cluster ET versus Eta in Endcap", + hsET_.bins, + hsET_.min, + hsET_.max, + hsEta_.bins, + hsEta_.min, + hsEta_.max); + + hist_EE_CorSC_ET_vs_Phi_ = _ibooker.book2D("hist_EE_CorSC_ET_vs_Phi_", + "Corr Super Cluster ET versus Phi in Endcap", + hsET_.bins, + hsET_.min, + hsET_.max, + hsPhi_.bins, + hsPhi_.min, + hsPhi_.max); + + hist_EE_CorSC_ET_vs_R_ = _ibooker.book2D("hist_EE_CorSC_ET_vs_R_", + "Corr Super Cluster ET versus Radius in Endcap", + hsET_.bins, + hsET_.min, + hsET_.max, + hsR_.bins, + hsR_.min, + hsR_.max); } -void EgammaSuperClusters::analyze(const edm::Event &evt, - const edm::EventSetup &es) { - +void EgammaSuperClusters::analyze(const edm::Event &evt, const edm::EventSetup &es) { bool skipMC = false; bool skipBarrel = false; bool skipEndcap = false; @@ -330,20 +392,16 @@ void EgammaSuperClusters::analyze(const edm::Event &evt, // Get the BARREL products // edm::Handle pBarrelRawSuperClusters; - evt.getByToken(barrelRawSuperClusterCollectionToken_, - pBarrelRawSuperClusters); + evt.getByToken(barrelRawSuperClusterCollectionToken_, pBarrelRawSuperClusters); if (!pBarrelRawSuperClusters.isValid()) { - edm::LogError("EgammaSuperClusters") - << "Error! can't get collection Raw SC"; + edm::LogError("EgammaSuperClusters") << "Error! can't get collection Raw SC"; skipBarrel = true; } edm::Handle pBarrelCorSuperClusters; - evt.getByToken(barrelCorSuperClusterCollectionToken_, - pBarrelCorSuperClusters); + evt.getByToken(barrelCorSuperClusterCollectionToken_, pBarrelCorSuperClusters); if (!pBarrelCorSuperClusters.isValid()) { - edm::LogError("EgammaSuperClusters") - << "Error! can't get collection Cor SC"; + edm::LogError("EgammaSuperClusters") << "Error! can't get collection Cor SC"; skipBarrel = true; } @@ -361,27 +419,23 @@ void EgammaSuperClusters::analyze(const edm::Event &evt, if (skipBarrel || skipEndcap) return; - EcalClusterLazyTools lazyTool(evt, es, barrelRecHitCollectionToken_, - endcapRecHitCollectionToken_); + EcalClusterLazyTools lazyTool(evt, es, barrelRecHitCollectionToken_, endcapRecHitCollectionToken_); // Get the BARREL collections - const reco::SuperClusterCollection *barrelRawSuperClusters = - pBarrelRawSuperClusters.product(); - const reco::SuperClusterCollection *barrelCorSuperClusters = - pBarrelCorSuperClusters.product(); + const reco::SuperClusterCollection *barrelRawSuperClusters = pBarrelRawSuperClusters.product(); + const reco::SuperClusterCollection *barrelCorSuperClusters = pBarrelCorSuperClusters.product(); // Number of entries in collections hist_EB_RawSC_Size_->Fill(barrelRawSuperClusters->size()); hist_EB_CorSC_Size_->Fill(barrelCorSuperClusters->size()); // Do RAW BARREL SuperClusters - for (reco::SuperClusterCollection::const_iterator aClus = - barrelRawSuperClusters->begin(); - aClus != barrelRawSuperClusters->end(); aClus++) { + for (reco::SuperClusterCollection::const_iterator aClus = barrelRawSuperClusters->begin(); + aClus != barrelRawSuperClusters->end(); + aClus++) { // kinematics hist_EB_RawSC_NumBC_->Fill(aClus->clustersSize()); - hist_EB_RawSC_ET_->Fill(aClus->energy() / - std::cosh(aClus->position().eta())); + hist_EB_RawSC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta())); hist_EB_RawSC_Eta_->Fill(aClus->position().eta()); hist_EB_RawSC_Phi_->Fill(aClus->position().phi()); @@ -402,20 +456,17 @@ void EgammaSuperClusters::analyze(const edm::Event &evt, } // Do CORRECTED BARREL SuperClusters - for (reco::SuperClusterCollection::const_iterator aClus = - barrelCorSuperClusters->begin(); - aClus != barrelCorSuperClusters->end(); aClus++) { + for (reco::SuperClusterCollection::const_iterator aClus = barrelCorSuperClusters->begin(); + aClus != barrelCorSuperClusters->end(); + aClus++) { // kinematics hist_EB_CorSC_NumBC_->Fill(aClus->clustersSize()); - hist_EB_CorSC_ET_->Fill(aClus->energy() / - std::cosh(aClus->position().eta())); + hist_EB_CorSC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta())); hist_EB_CorSC_Eta_->Fill(aClus->position().eta()); hist_EB_CorSC_Phi_->Fill(aClus->position().phi()); - hist_EB_CorSC_ET_vs_Eta_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); - hist_EB_CorSC_ET_vs_Phi_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); + hist_EB_CorSC_ET_vs_Eta_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); + hist_EB_CorSC_ET_vs_Phi_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); // cluster shape const reco::CaloClusterPtr seed = aClus->seed(); @@ -441,36 +492,27 @@ void EgammaSuperClusters::analyze(const edm::Event &evt, // Get the ENDCAP products // edm::Handle pEndcapRawSuperClusters; - evt.getByToken(endcapRawSuperClusterCollectionToken_, - pEndcapRawSuperClusters); + evt.getByToken(endcapRawSuperClusterCollectionToken_, pEndcapRawSuperClusters); if (!pEndcapRawSuperClusters.isValid()) { - edm::LogError("EgammaSuperClusters") - << "Error! can't get collection Raw EE SC"; + edm::LogError("EgammaSuperClusters") << "Error! can't get collection Raw EE SC"; } edm::Handle pEndcapPreSuperClusters; - evt.getByToken(endcapPreSuperClusterCollectionToken_, - pEndcapPreSuperClusters); + evt.getByToken(endcapPreSuperClusterCollectionToken_, pEndcapPreSuperClusters); if (!pEndcapPreSuperClusters.isValid()) { - edm::LogError("EgammaSuperClusters") - << "Error! can't get collection Pre EE SC"; + edm::LogError("EgammaSuperClusters") << "Error! can't get collection Pre EE SC"; } edm::Handle pEndcapCorSuperClusters; - evt.getByToken(endcapCorSuperClusterCollectionToken_, - pEndcapCorSuperClusters); + evt.getByToken(endcapCorSuperClusterCollectionToken_, pEndcapCorSuperClusters); if (!pEndcapCorSuperClusters.isValid()) { - edm::LogError("EgammaSuperClusters") - << "Error! can't get collection Cor EE SC"; + edm::LogError("EgammaSuperClusters") << "Error! can't get collection Cor EE SC"; } // Get the ENDCAP collections - const reco::SuperClusterCollection *endcapRawSuperClusters = - pEndcapRawSuperClusters.product(); - const reco::SuperClusterCollection *endcapPreSuperClusters = - pEndcapPreSuperClusters.product(); - const reco::SuperClusterCollection *endcapCorSuperClusters = - pEndcapCorSuperClusters.product(); + const reco::SuperClusterCollection *endcapRawSuperClusters = pEndcapRawSuperClusters.product(); + const reco::SuperClusterCollection *endcapPreSuperClusters = pEndcapPreSuperClusters.product(); + const reco::SuperClusterCollection *endcapCorSuperClusters = pEndcapCorSuperClusters.product(); // Number of entries in collections hist_EE_RawSC_Size_->Fill(endcapRawSuperClusters->size()); @@ -478,12 +520,11 @@ void EgammaSuperClusters::analyze(const edm::Event &evt, hist_EE_CorSC_Size_->Fill(endcapCorSuperClusters->size()); // Do RAW ENDCAP SuperClusters - for (reco::SuperClusterCollection::const_iterator aClus = - endcapRawSuperClusters->begin(); - aClus != endcapRawSuperClusters->end(); aClus++) { + for (reco::SuperClusterCollection::const_iterator aClus = endcapRawSuperClusters->begin(); + aClus != endcapRawSuperClusters->end(); + aClus++) { hist_EE_RawSC_NumBC_->Fill(aClus->clustersSize()); - hist_EE_RawSC_ET_->Fill(aClus->energy() / - std::cosh(aClus->position().eta())); + hist_EE_RawSC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta())); hist_EE_RawSC_Eta_->Fill(aClus->position().eta()); hist_EE_RawSC_Phi_->Fill(aClus->position().phi()); @@ -503,12 +544,11 @@ void EgammaSuperClusters::analyze(const edm::Event &evt, } // Do ENDCAP SuperClusters with PRESHOWER - for (reco::SuperClusterCollection::const_iterator aClus = - endcapPreSuperClusters->begin(); - aClus != endcapPreSuperClusters->end(); aClus++) { + for (reco::SuperClusterCollection::const_iterator aClus = endcapPreSuperClusters->begin(); + aClus != endcapPreSuperClusters->end(); + aClus++) { hist_EE_PreSC_NumBC_->Fill(aClus->clustersSize()); - hist_EE_PreSC_ET_->Fill(aClus->energy() / - std::cosh(aClus->position().eta())); + hist_EE_PreSC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta())); hist_EE_PreSC_Eta_->Fill(aClus->position().eta()); hist_EE_PreSC_Phi_->Fill(aClus->position().phi()); hist_EE_PreSC_preshowerE_->Fill(aClus->preshowerEnergy()); @@ -529,23 +569,19 @@ void EgammaSuperClusters::analyze(const edm::Event &evt, } // Do CORRECTED ENDCAP SuperClusters - for (reco::SuperClusterCollection::const_iterator aClus = - endcapCorSuperClusters->begin(); - aClus != endcapCorSuperClusters->end(); aClus++) { + for (reco::SuperClusterCollection::const_iterator aClus = endcapCorSuperClusters->begin(); + aClus != endcapCorSuperClusters->end(); + aClus++) { hist_EE_CorSC_NumBC_->Fill(aClus->clustersSize()); - hist_EE_CorSC_ET_->Fill(aClus->energy() / - std::cosh(aClus->position().eta())); + hist_EE_CorSC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta())); hist_EE_CorSC_Eta_->Fill(aClus->position().eta()); hist_EE_CorSC_Phi_->Fill(aClus->position().phi()); hist_EE_CorSC_preshowerE_->Fill(aClus->preshowerEnergy()); - hist_EE_CorSC_ET_vs_Eta_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); - hist_EE_CorSC_ET_vs_Phi_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); - hist_EE_CorSC_ET_vs_R_->Fill( - aClus->energy() / std::cosh(aClus->position().eta()), - std::sqrt(std::pow(aClus->x(), 2) + std::pow(aClus->y(), 2))); + hist_EE_CorSC_ET_vs_Eta_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta()); + hist_EE_CorSC_ET_vs_Phi_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi()); + hist_EE_CorSC_ET_vs_R_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), + std::sqrt(std::pow(aClus->x(), 2) + std::pow(aClus->y(), 2))); // correction variables hist_EE_CorSC_phiWidth_->Fill(aClus->phiWidth()); @@ -574,7 +610,6 @@ void EgammaSuperClusters::closestMCParticle(const HepMC::GenEvent *genEvent, const reco::SuperCluster &sc, double &dRClosest, double &energyClosest) const { - // SuperCluster eta, phi double scEta = sc.eta(); double scPhi = sc.phi(); @@ -584,16 +619,14 @@ void EgammaSuperClusters::closestMCParticle(const HepMC::GenEvent *genEvent, // loop over the MC truth particles to find the // closest to the superCluster in dR space - for (HepMC::GenEvent::particle_const_iterator currentParticle = - genEvent->particles_begin(); - currentParticle != genEvent->particles_end(); currentParticle++) { + for (HepMC::GenEvent::particle_const_iterator currentParticle = genEvent->particles_begin(); + currentParticle != genEvent->particles_end(); + currentParticle++) { if ((*currentParticle)->status() == 1) { // need GenParticle in ECAL co-ordinates - HepMC::FourVector vtx = - (*currentParticle)->production_vertex()->position(); + HepMC::FourVector vtx = (*currentParticle)->production_vertex()->position(); double phiTrue = (*currentParticle)->momentum().phi(); - double etaTrue = ecalEta((*currentParticle)->momentum().eta(), - vtx.z() / 10., vtx.perp() / 10.); + double etaTrue = ecalEta((*currentParticle)->momentum().eta(), vtx.z() / 10., vtx.perp() / 10.); double dPhi = reco::deltaPhi(phiTrue, scPhi); double dEta = scEta - etaTrue; @@ -604,16 +637,15 @@ void EgammaSuperClusters::closestMCParticle(const HepMC::GenEvent *genEvent, energyClosest = (*currentParticle)->momentum().e(); } - } // end if stable particle + } // end if stable particle - } // end loop on get particles + } // end loop on get particles } // // Compute Eta in the ECAL co-ordinate system // -float EgammaSuperClusters::ecalEta(float EtaParticle, float Zvertex, - float plane_Radius) const { +float EgammaSuperClusters::ecalEta(float EtaParticle, float Zvertex, float plane_Radius) const { const float R_ECAL = 136.5; const float Z_Endcap = 328.0; const float etaBarrelEndcap = 1.479; diff --git a/Validation/EcalClusters/src/EnergyScaleAnalyzer.cc b/Validation/EcalClusters/src/EnergyScaleAnalyzer.cc index 5011852f63375..c15259ed81384 100644 --- a/Validation/EcalClusters/src/EnergyScaleAnalyzer.cc +++ b/Validation/EcalClusters/src/EnergyScaleAnalyzer.cc @@ -74,39 +74,26 @@ EnergyScaleAnalyzer::EnergyScaleAnalyzer(const edm::ParameterSet &ps) //======================================================================== { - - hepMCLabel_ = - consumes(ps.getParameter("hepMCLabel")); + hepMCLabel_ = consumes(ps.getParameter("hepMCLabel")); hybridSuperClusters_token = consumes( - ps.getUntrackedParameter( - "hybridSuperClusters", edm::InputTag("hybridSuperClusters"))); - dynamicHybridSuperClusters_token = consumes( - ps.getUntrackedParameter( - "dynamicHybridSuperClusters", - edm::InputTag("dynamicHybridSuperClusters"))); - correctedHybridSuperClusters_token = consumes( - ps.getUntrackedParameter( - "correctedHybridSuperClusters", - edm::InputTag("correctedHybridSuperClusters"))); + ps.getUntrackedParameter("hybridSuperClusters", edm::InputTag("hybridSuperClusters"))); + dynamicHybridSuperClusters_token = consumes(ps.getUntrackedParameter( + "dynamicHybridSuperClusters", edm::InputTag("dynamicHybridSuperClusters"))); + correctedHybridSuperClusters_token = consumes(ps.getUntrackedParameter( + "correctedHybridSuperClusters", edm::InputTag("correctedHybridSuperClusters"))); correctedDynamicHybridSuperClusters_token = - consumes( - ps.getUntrackedParameter( - "correctedDynamicHybridSuperClusters", - edm::InputTag("correctedDynamicHybridSuperClusters"))); - correctedFixedMatrixSuperClustersWithPreshower_token = - consumes( - ps.getUntrackedParameter( - "correctedFixedMatrixSuperClustersWithPreshower", - edm::InputTag("correctedFixedMatrixSuperClustersWithPreshower"))); + consumes(ps.getUntrackedParameter( + "correctedDynamicHybridSuperClusters", edm::InputTag("correctedDynamicHybridSuperClusters"))); + correctedFixedMatrixSuperClustersWithPreshower_token = consumes( + ps.getUntrackedParameter("correctedFixedMatrixSuperClustersWithPreshower", + edm::InputTag("correctedFixedMatrixSuperClustersWithPreshower"))); fixedMatrixSuperClustersWithPreshower_token = - consumes( - ps.getUntrackedParameter( - "fixedMatrixSuperClustersWithPreshower", - edm::InputTag("fixedMatrixSuperClustersWithPreshower"))); + consumes(ps.getUntrackedParameter( + "fixedMatrixSuperClustersWithPreshower", edm::InputTag("fixedMatrixSuperClustersWithPreshower"))); outputFile_ = ps.getParameter("outputFile"); rootFile_ = TFile::Open(outputFile_.c_str(), - "RECREATE"); // open output file to store histograms + "RECREATE"); // open output file to store histograms evtN = 0; } @@ -125,32 +112,28 @@ void EnergyScaleAnalyzer::beginJob() { mytree_ = new TTree("energyScale", ""); TString treeVariables = "mc_npar/I:parID:mc_sep/" - "F:mc_e:mc_et:mc_phi:mc_eta:mc_theta:"; // MC information - treeVariables += "em_dR/F:"; // MC <-> EM matching information + "F:mc_e:mc_et:mc_phi:mc_eta:mc_theta:"; // MC information + treeVariables += "em_dR/F:"; // MC <-> EM matching information treeVariables += "em_isInCrack/I:em_scType:em_e/F:em_et:em_phi:em_eta:em_theta:em_nCell/" - "I:em_nBC:"; // EM SC info - treeVariables += - "em_pet/F:em_pe:em_peta:em_ptheta:"; // EM SC physics (eta corrected - // information) + "I:em_nBC:"; // EM SC info + treeVariables += "em_pet/F:em_pe:em_peta:em_ptheta:"; // EM SC physics (eta corrected + // information) - treeVariables += - "emCorr_e/F:emCorr_et:emCorr_eta:emCorr_phi:emCorr_theta:"; // CMSSW - // standard - // corrections - treeVariables += - "emCorr_pet/F:emCorr_peta:emCorr_ptheta:"; // CMSSW standard physics + treeVariables += "emCorr_e/F:emCorr_et:emCorr_eta:emCorr_phi:emCorr_theta:"; // CMSSW + // standard + // corrections + treeVariables += "emCorr_pet/F:emCorr_peta:emCorr_ptheta:"; // CMSSW standard physics - treeVariables += "em_pw/F:em_ew:em_br"; // EM widths pw -- phiWidth, ew -- - // etaWidth, ratios of pw/ew + treeVariables += "em_pw/F:em_ew:em_br"; // EM widths pw -- phiWidth, ew -- + // etaWidth, ratios of pw/ew mytree_->Branch("energyScale", &(tree_.mc_npar), treeVariables); } //======================================================================== -void EnergyScaleAnalyzer::analyze(const edm::Event &evt, - const edm::EventSetup &es) { - using namespace edm; // needed for all fwk related classes +void EnergyScaleAnalyzer::analyze(const edm::Event &evt, const edm::EventSetup &es) { + using namespace edm; // needed for all fwk related classes using namespace std; // std::cout << "Proceccing event # " << ++evtN << std::endl; @@ -197,27 +180,22 @@ void EnergyScaleAnalyzer::analyze(const edm::Event &evt, try { evt.getByToken(hybridSuperClusters_token, hybridSuperClusters); } catch (cms::Exception &ex) { - edm::LogError("EnergyScaleAnalyzer") - << "Can't get collection with producer hybridSuperClusters."; + edm::LogError("EnergyScaleAnalyzer") << "Can't get collection with producer hybridSuperClusters."; } Handle dynamicHybridSuperClusters; try { - evt.getByToken(dynamicHybridSuperClusters_token, - dynamicHybridSuperClusters); + evt.getByToken(dynamicHybridSuperClusters_token, dynamicHybridSuperClusters); } catch (cms::Exception &ex) { - edm::LogError("EnergyScaleAnalyzer") - << "Can't get collection with producer dynamicHybridSuperClusters."; + edm::LogError("EnergyScaleAnalyzer") << "Can't get collection with producer dynamicHybridSuperClusters."; } Handle fixedMatrixSuperClustersWithPS; try { - evt.getByToken(fixedMatrixSuperClustersWithPreshower_token, - fixedMatrixSuperClustersWithPS); + evt.getByToken(fixedMatrixSuperClustersWithPreshower_token, fixedMatrixSuperClustersWithPS); } catch (cms::Exception &ex) { - edm::LogError("EnergyScaleAnalyzer") - << "Can't get collection with producer " - "fixedMatrixSuperClustersWithPreshower."; + edm::LogError("EnergyScaleAnalyzer") << "Can't get collection with producer " + "fixedMatrixSuperClustersWithPreshower."; } // Corrected collections @@ -225,39 +203,31 @@ void EnergyScaleAnalyzer::analyze(const edm::Event &evt, try { evt.getByToken(correctedHybridSuperClusters_token, correctedHybridSC); } catch (cms::Exception &ex) { - edm::LogError("EnergyScaleAnalyzer") - << "Can't get collection with producer correctedHybridSuperClusters."; + edm::LogError("EnergyScaleAnalyzer") << "Can't get collection with producer correctedHybridSuperClusters."; } Handle correctedDynamicHybridSC; try { - evt.getByToken(correctedDynamicHybridSuperClusters_token, - correctedDynamicHybridSC); + evt.getByToken(correctedDynamicHybridSuperClusters_token, correctedDynamicHybridSC); } catch (cms::Exception &ex) { - edm::LogError("EnergyScaleAnalyzer") - << "Can't get collection with producer " - "correctedDynamicHybridSuperClusters."; + edm::LogError("EnergyScaleAnalyzer") << "Can't get collection with producer " + "correctedDynamicHybridSuperClusters."; } Handle correctedFixedMatrixSCWithPS; try { - evt.getByToken(correctedFixedMatrixSuperClustersWithPreshower_token, - correctedFixedMatrixSCWithPS); + evt.getByToken(correctedFixedMatrixSuperClustersWithPreshower_token, correctedFixedMatrixSCWithPS); } catch (cms::Exception &ex) { - edm::LogError("EnergyScaleAnalyzer") - << "Can't get collection with producer " - "correctedFixedMatrixSuperClustersWithPreshower."; + edm::LogError("EnergyScaleAnalyzer") << "Can't get collection with producer " + "correctedFixedMatrixSuperClustersWithPreshower."; } - const reco::SuperClusterCollection *dSC = - dynamicHybridSuperClusters.product(); + const reco::SuperClusterCollection *dSC = dynamicHybridSuperClusters.product(); const reco::SuperClusterCollection *hSC = hybridSuperClusters.product(); - const reco::SuperClusterCollection *fmSC = - fixedMatrixSuperClustersWithPS.product(); + const reco::SuperClusterCollection *fmSC = fixedMatrixSuperClustersWithPS.product(); const reco::SuperClusterCollection *chSC = correctedHybridSC.product(); const reco::SuperClusterCollection *cdSC = correctedDynamicHybridSC.product(); - const reco::SuperClusterCollection *cfmSC = - correctedFixedMatrixSCWithPS.product(); + const reco::SuperClusterCollection *cfmSC = correctedFixedMatrixSCWithPS.product(); // ----------------------- Print outs for debugging /* @@ -307,8 +277,7 @@ void EnergyScaleAnalyzer::analyze(const edm::Event &evt, std::vector mcParticles; // int counter = 0; - for (HepMC::GenEvent::particle_const_iterator p = genEvent->particles_begin(); - p != genEvent->particles_end(); ++p) { + for (HepMC::GenEvent::particle_const_iterator p = genEvent->particles_begin(); p != genEvent->particles_end(); ++p) { // LogInfo("EnergyScaleAnalyzer") << "Particle " << ++counter //<< " PDG ID = " << (*p)->pdg_id() << " pT = " << (*p)->momentum().perp(); // require photon or electron @@ -316,8 +285,7 @@ void EnergyScaleAnalyzer::analyze(const edm::Event &evt, continue; // require selection criteria - bool satisfySelectionCriteria = (*p)->momentum().perp() > min_eT && - fabs((*p)->momentum().eta()) < max_eta; + bool satisfySelectionCriteria = (*p)->momentum().perp() > min_eT && fabs((*p)->momentum().eta()) < max_eta; if (!satisfySelectionCriteria) continue; @@ -330,16 +298,14 @@ void EnergyScaleAnalyzer::analyze(const edm::Event &evt, if (mcParticles.size() == 2) { HepMC::GenParticle *mc1 = mcParticles[0]; HepMC::GenParticle *mc2 = mcParticles[1]; - tree_.mc_sep = kinem::delta_R(mc1->momentum().eta(), mc1->momentum().phi(), - mc2->momentum().eta(), mc2->momentum().phi()); + tree_.mc_sep = + kinem::delta_R(mc1->momentum().eta(), mc1->momentum().phi(), mc2->momentum().eta(), mc2->momentum().phi()); } else tree_.mc_sep = -100; // now loop over MC particles, find the match with SC and do everything we // need then save info in the tree for every MC particle - for (std::vector::const_iterator p = - mcParticles.begin(); - p != mcParticles.end(); ++p) { + for (std::vector::const_iterator p = mcParticles.begin(); p != mcParticles.end(); ++p) { HepMC::GenParticle *mc = *p; // Fill MC information @@ -370,23 +336,25 @@ void EnergyScaleAnalyzer::analyze(const edm::Event &evt, // tree_.em_phi << " : " << tree_.em_eta << std::endl; // mytree_->Fill(); - } // loop over particles + } // loop over particles } -void EnergyScaleAnalyzer::fillTree( - const reco::SuperClusterCollection *scColl, - const reco::SuperClusterCollection *corrSCColl, HepMC::GenParticle *mc, - tree_structure_ &tree_, float xV, float yV, float zV, int scType) { - +void EnergyScaleAnalyzer::fillTree(const reco::SuperClusterCollection *scColl, + const reco::SuperClusterCollection *corrSCColl, + HepMC::GenParticle *mc, + tree_structure_ &tree_, + float xV, + float yV, + float zV, + int scType) { // ----------------------------- SuperClusters before energy correction reco::SuperClusterCollection::const_iterator em = scColl->end(); - float energyMax = -100.0; // dummy energy of the matched SC - for (reco::SuperClusterCollection::const_iterator aClus = scColl->begin(); - aClus != scColl->end(); ++aClus) { + float energyMax = -100.0; // dummy energy of the matched SC + for (reco::SuperClusterCollection::const_iterator aClus = scColl->begin(); aClus != scColl->end(); ++aClus) { // check the matching - float dR = kinem::delta_R(mc->momentum().eta(), mc->momentum().phi(), - aClus->position().eta(), aClus->position().phi()); - if (dR < 0.4) { // a rather loose matching cut + float dR = + kinem::delta_R(mc->momentum().eta(), mc->momentum().phi(), aClus->position().eta(), aClus->position().phi()); + if (dR < 0.4) { // a rather loose matching cut float energy = aClus->energy(); if (energy < energyMax) continue; @@ -409,14 +377,11 @@ void EnergyScaleAnalyzer::fillTree( double emAbsEta = fabs(em->position().eta()); // copied from // RecoEgama/EgammaElectronAlgos/src/EgammaElectronClassification.cc - if (emAbsEta < 0.018 || (emAbsEta > 0.423 && emAbsEta < 0.461) || - (emAbsEta > 0.770 && emAbsEta < 0.806) || - (emAbsEta > 1.127 && emAbsEta < 1.163) || - (emAbsEta > 1.460 && emAbsEta < 1.558)) + if (emAbsEta < 0.018 || (emAbsEta > 0.423 && emAbsEta < 0.461) || (emAbsEta > 0.770 && emAbsEta < 0.806) || + (emAbsEta > 1.127 && emAbsEta < 1.163) || (emAbsEta > 1.460 && emAbsEta < 1.558)) tree_.em_isInCrack = 1; - tree_.em_dR = kinem::delta_R(mc->momentum().eta(), mc->momentum().phi(), - em->position().eta(), em->position().phi()); + tree_.em_dR = kinem::delta_R(mc->momentum().eta(), mc->momentum().phi(), em->position().eta(), em->position().phi()); tree_.em_e = em->energy(); tree_.em_et = em->energy() * sin(em->position().theta()); tree_.em_phi = em->position().phi(); @@ -443,8 +408,7 @@ void EnergyScaleAnalyzer::fillTree( if (phiMax_ < 0) phiMax_ += 2 * 3.14159; - rClust_vtx_ = sqrt(xClust_vtx_ * xClust_vtx_ + yClust_vtx_ * yClust_vtx_ + - zClust_vtx_ * zClust_vtx_); + rClust_vtx_ = sqrt(xClust_vtx_ * xClust_vtx_ + yClust_vtx_ * yClust_vtx_ + zClust_vtx_ * zClust_vtx_); thetaMaxVtx_ = acos(zClust_vtx_ / rClust_vtx_); etaMaxVtx_ = -log(tan(thetaMaxVtx_ / 2)); eTMaxVtx_ = energyMax_ * sin(thetaMaxVtx_); @@ -460,12 +424,11 @@ void EnergyScaleAnalyzer::fillTree( //------------------------------- Get SC after energy correction em = corrSCColl->end(); - energyMax = -100.0; // dummy energy of the matched SC - for (reco::SuperClusterCollection::const_iterator aClus = corrSCColl->begin(); - aClus != corrSCColl->end(); ++aClus) { + energyMax = -100.0; // dummy energy of the matched SC + for (reco::SuperClusterCollection::const_iterator aClus = corrSCColl->begin(); aClus != corrSCColl->end(); ++aClus) { // check the matching - float dR = kinem::delta_R(mc->momentum().eta(), mc->momentum().phi(), - aClus->position().eta(), aClus->position().phi()); + float dR = + kinem::delta_R(mc->momentum().eta(), mc->momentum().phi(), aClus->position().eta(), aClus->position().phi()); if (dR < 0.4) { float energy = aClus->energy(); if (energy < energyMax) diff --git a/Validation/GlobalDigis/interface/GlobalDigisAnalyzer.h b/Validation/GlobalDigis/interface/GlobalDigisAnalyzer.h index b0c9418b3b8f7..125893c08fbd3 100644 --- a/Validation/GlobalDigis/interface/GlobalDigisAnalyzer.h +++ b/Validation/GlobalDigis/interface/GlobalDigisAnalyzer.h @@ -106,7 +106,6 @@ class PGlobalDigi; class GlobalDigisAnalyzer : public DQMEDAnalyzer { - public: typedef std::vector FloatVector; typedef std::vector DoubleVector; @@ -118,8 +117,7 @@ class GlobalDigisAnalyzer : public DQMEDAnalyzer { void analyze(const edm::Event &, const edm::EventSetup &) override; protected: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // production related methods @@ -244,7 +242,7 @@ class GlobalDigisAnalyzer : public DQMEDAnalyzer { // private statistics information unsigned int count; -}; // end class declaration +}; // end class declaration #endif @@ -285,4 +283,4 @@ static const int sdHcalTT = 5; static const int sdHcalCalib = 6; static const int sdHcalCompst = 7; -#endif // PGlobalDigisAnalyzer_h +#endif // PGlobalDigisAnalyzer_h diff --git a/Validation/GlobalDigis/interface/GlobalDigisHistogrammer.h b/Validation/GlobalDigis/interface/GlobalDigisHistogrammer.h index 282490590ee93..c61f46a5fb3e7 100644 --- a/Validation/GlobalDigis/interface/GlobalDigisHistogrammer.h +++ b/Validation/GlobalDigis/interface/GlobalDigisHistogrammer.h @@ -47,7 +47,6 @@ #include "TString.h" class GlobalDigisHistogrammer : public DQMEDAnalyzer { - public: // typedef std::vector FloatVector; // typedef std::vector DoubleVector; @@ -57,8 +56,7 @@ class GlobalDigisHistogrammer : public DQMEDAnalyzer { explicit GlobalDigisHistogrammer(const edm::ParameterSet &); ~GlobalDigisHistogrammer() override; void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // parameter information @@ -126,6 +124,6 @@ class GlobalDigisHistogrammer : public DQMEDAnalyzer { // private statistics information unsigned int count; -}; // end class declaration +}; // end class declaration -#endif // PGlobalDigisHistogrammer_h +#endif // PGlobalDigisHistogrammer_h diff --git a/Validation/GlobalDigis/interface/GlobalDigisProducer.h b/Validation/GlobalDigis/interface/GlobalDigisProducer.h index ef4c025498b1b..82b748b0ea6b9 100644 --- a/Validation/GlobalDigis/interface/GlobalDigisProducer.h +++ b/Validation/GlobalDigis/interface/GlobalDigisProducer.h @@ -101,7 +101,6 @@ class PGlobalDigi; class GlobalDigisProducer : public edm::EDProducer { - public: typedef std::vector FloatVector; typedef std::vector DoubleVector; @@ -187,10 +186,8 @@ class GlobalDigisProducer : public edm::EDProducer { FloatVector TIDW1ADC, TIDW2ADC, TIDW3ADC; IntVector TIDW1Strip, TIDW2Strip, TIDW3Strip; - FloatVector TECW1ADC, TECW2ADC, TECW3ADC, TECW4ADC, TECW5ADC, TECW6ADC, - TECW7ADC, TECW8ADC; - IntVector TECW1Strip, TECW2Strip, TECW3Strip, TECW4Strip, TECW5Strip, - TECW6Strip, TECW7Strip, TECW8Strip; + FloatVector TECW1ADC, TECW2ADC, TECW3ADC, TECW4ADC, TECW5ADC, TECW6ADC, TECW7ADC, TECW8ADC; + IntVector TECW1Strip, TECW2Strip, TECW3Strip, TECW4Strip, TECW5Strip, TECW6Strip, TECW7Strip, TECW8Strip; edm::InputTag SiStripSrc_; @@ -250,7 +247,7 @@ class GlobalDigisProducer : public edm::EDProducer { edm::EDGetTokenT> EEHits_Token_; edm::EDGetTokenT> ESHits_Token_; -}; // end class declaration +}; // end class declaration #endif @@ -291,4 +288,4 @@ static const int sdHcalTT = 5; static const int sdHcalCalib = 6; static const int sdHcalCompst = 7; -#endif // PGlobalDigisProducer_h +#endif // PGlobalDigisProducer_h diff --git a/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc b/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc index 110e4c6e1a12f..5f8405157f137 100644 --- a/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc +++ b/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc @@ -11,20 +11,25 @@ #include "Validation/GlobalDigis/interface/GlobalDigisAnalyzer.h" GlobalDigisAnalyzer::GlobalDigisAnalyzer(const edm::ParameterSet &iPSet) - : fName(""), verbosity(0), frequency(0), label(""), - getAllProvenances(false), printProvenanceInfo(false), hitsProducer(""), - theCSCStripPedestalSum(0), theCSCStripPedestalCount(0), count(0) { + : fName(""), + verbosity(0), + frequency(0), + label(""), + getAllProvenances(false), + printProvenanceInfo(false), + hitsProducer(""), + theCSCStripPedestalSum(0), + theCSCStripPedestalCount(0), + count(0) { std::string MsgLoggerCat = "GlobalDigisAnalyzer_GlobalDigisAnalyzer"; // get information from parameter set fName = iPSet.getUntrackedParameter("Name"); verbosity = iPSet.getUntrackedParameter("Verbosity"); frequency = iPSet.getUntrackedParameter("Frequency"); - edm::ParameterSet m_Prov = - iPSet.getParameter("ProvenanceLookup"); + edm::ParameterSet m_Prov = iPSet.getParameter("ProvenanceLookup"); getAllProvenances = m_Prov.getUntrackedParameter("GetAllProvenances"); - printProvenanceInfo = - m_Prov.getUntrackedParameter("PrintProvenanceInfo"); + printProvenanceInfo = m_Prov.getUntrackedParameter("PrintProvenanceInfo"); hitsProducer = iPSet.getParameter("hitsProducer"); // get Labels to use to extract information @@ -40,82 +45,57 @@ GlobalDigisAnalyzer::GlobalDigisAnalyzer(const edm::ParameterSet &iPSet) MuCSCWireSrc_ = iPSet.getParameter("MuCSCWireSrc"); MuRPCSrc_ = iPSet.getParameter("MuRPCSrc"); - ECalEBSrc_Token_ = consumes( - iPSet.getParameter("ECalEBSrc")); - ECalEESrc_Token_ = consumes( - iPSet.getParameter("ECalEESrc")); - ECalESSrc_Token_ = consumes( - iPSet.getParameter("ECalESSrc")); - HCalSrc_Token_ = consumes( - iPSet.getParameter("HCalSrc")); - HBHEDigi_Token_ = consumes>( - iPSet.getParameter("HCalDigi")); - HODigi_Token_ = consumes>( - iPSet.getParameter("HCalDigi")); - HFDigi_Token_ = consumes>( - iPSet.getParameter("HCalDigi")); - SiStripSrc_Token_ = consumes>( - iPSet.getParameter("SiStripSrc")); - SiPxlSrc_Token_ = consumes>( - iPSet.getParameter("SiPxlSrc")); - MuDTSrc_Token_ = - consumes(iPSet.getParameter("MuDTSrc")); - MuCSCStripSrc_Token_ = consumes( - iPSet.getParameter("MuCSCStripSrc")); - MuCSCWireSrc_Token_ = consumes( - iPSet.getParameter("MuCSCWireSrc")); - MuRPCSrc_Token_ = consumes( - iPSet.getParameter("MuRPCSrc")); + ECalEBSrc_Token_ = consumes(iPSet.getParameter("ECalEBSrc")); + ECalEESrc_Token_ = consumes(iPSet.getParameter("ECalEESrc")); + ECalESSrc_Token_ = consumes(iPSet.getParameter("ECalESSrc")); + HCalSrc_Token_ = consumes(iPSet.getParameter("HCalSrc")); + HBHEDigi_Token_ = consumes>(iPSet.getParameter("HCalDigi")); + HODigi_Token_ = consumes>(iPSet.getParameter("HCalDigi")); + HFDigi_Token_ = consumes>(iPSet.getParameter("HCalDigi")); + SiStripSrc_Token_ = consumes>(iPSet.getParameter("SiStripSrc")); + SiPxlSrc_Token_ = consumes>(iPSet.getParameter("SiPxlSrc")); + MuDTSrc_Token_ = consumes(iPSet.getParameter("MuDTSrc")); + MuCSCStripSrc_Token_ = consumes(iPSet.getParameter("MuCSCStripSrc")); + MuCSCWireSrc_Token_ = consumes(iPSet.getParameter("MuCSCWireSrc")); + MuRPCSrc_Token_ = consumes(iPSet.getParameter("MuRPCSrc")); // const std::string barrelHitsName(hitsProducer + "EcalHitsEB"); const std::string endcapHitsName(hitsProducer + "EcalHitsEE"); const std::string preshowerHitsName(hitsProducer + "EcalHitsES"); - EBHits_Token_ = consumes>( - edm::InputTag(std::string("mix"), std::string("barrelHitsName"))); - EEHits_Token_ = consumes>( - edm::InputTag(std::string("mix"), std::string("endcapHitsName"))); - ESHits_Token_ = consumes>( - edm::InputTag(std::string("mix"), std::string("preshowerHitsName"))); - - RPCSimHit_Token_ = consumes( - edm::InputTag(std::string("g4SimHits"), std::string("MuonRPCHits"))); + EBHits_Token_ = consumes>(edm::InputTag(std::string("mix"), std::string("barrelHitsName"))); + EEHits_Token_ = consumes>(edm::InputTag(std::string("mix"), std::string("endcapHitsName"))); + ESHits_Token_ = + consumes>(edm::InputTag(std::string("mix"), std::string("preshowerHitsName"))); + + RPCSimHit_Token_ = + consumes(edm::InputTag(std::string("g4SimHits"), std::string("MuonRPCHits"))); // use value of first digit to determine default output level (inclusive) // 0 is none, 1 is basic, 2 is fill output, 3 is gather output verbosity %= 10; // print out Parameter Set information being used if (verbosity >= 0) { - edm::LogInfo(MsgLoggerCat) - << "\n===============================\n" - << "Initialized as EDAnalyzer with parameter values:\n" - << " Name = " << fName << "\n" - << " Verbosity = " << verbosity << "\n" - << " Frequency = " << frequency << "\n" - << " GetProv = " << getAllProvenances << "\n" - << " PrintProv = " << printProvenanceInfo << "\n" - << " ECalEBSrc = " << ECalEBSrc_.label() << ":" - << ECalEBSrc_.instance() << "\n" - << " ECalEESrc = " << ECalEESrc_.label() << ":" - << ECalEESrc_.instance() << "\n" - << " ECalESSrc = " << ECalESSrc_.label() << ":" - << ECalESSrc_.instance() << "\n" - << " HCalSrc = " << HCalSrc_.label() << ":" - << HCalSrc_.instance() << "\n" - << " HCalDigi = " << HCalDigi_.label() << ":" - << HCalDigi_.instance() << "\n" - << " SiStripSrc = " << SiStripSrc_.label() << ":" - << SiStripSrc_.instance() << "\n" - << " SiPixelSrc = " << SiPxlSrc_.label() << ":" - << SiPxlSrc_.instance() << "\n" - << " MuDTSrc = " << MuDTSrc_.label() << ":" - << MuDTSrc_.instance() << "\n" - << " MuCSCStripSrc = " << MuCSCStripSrc_.label() << ":" - << MuCSCStripSrc_.instance() << "\n" - << " MuCSCWireSrc = " << MuCSCWireSrc_.label() << ":" - << MuCSCWireSrc_.instance() << "\n" - << " MuRPCSrc = " << MuRPCSrc_.label() << ":" - << MuRPCSrc_.instance() << "\n" - << "===============================\n"; + edm::LogInfo(MsgLoggerCat) << "\n===============================\n" + << "Initialized as EDAnalyzer with parameter values:\n" + << " Name = " << fName << "\n" + << " Verbosity = " << verbosity << "\n" + << " Frequency = " << frequency << "\n" + << " GetProv = " << getAllProvenances << "\n" + << " PrintProv = " << printProvenanceInfo << "\n" + << " ECalEBSrc = " << ECalEBSrc_.label() << ":" << ECalEBSrc_.instance() << "\n" + << " ECalEESrc = " << ECalEESrc_.label() << ":" << ECalEESrc_.instance() << "\n" + << " ECalESSrc = " << ECalESSrc_.label() << ":" << ECalESSrc_.instance() << "\n" + << " HCalSrc = " << HCalSrc_.label() << ":" << HCalSrc_.instance() << "\n" + << " HCalDigi = " << HCalDigi_.label() << ":" << HCalDigi_.instance() << "\n" + << " SiStripSrc = " << SiStripSrc_.label() << ":" << SiStripSrc_.instance() << "\n" + << " SiPixelSrc = " << SiPxlSrc_.label() << ":" << SiPxlSrc_.instance() << "\n" + << " MuDTSrc = " << MuDTSrc_.label() << ":" << MuDTSrc_.instance() << "\n" + << " MuCSCStripSrc = " << MuCSCStripSrc_.label() << ":" << MuCSCStripSrc_.instance() + << "\n" + << " MuCSCWireSrc = " << MuCSCWireSrc_.label() << ":" << MuCSCWireSrc_.instance() + << "\n" + << " MuRPCSrc = " << MuRPCSrc_.label() << ":" << MuRPCSrc_.instance() << "\n" + << "===============================\n"; } // set default constants @@ -131,23 +111,35 @@ GlobalDigisAnalyzer::GlobalDigisAnalyzer(const edm::ParameterSet &iPSet) ECalgainConv_[3] = ECalgainConv_[2] * (defaultRatios.gain6Over1()); if (verbosity >= 0) { - edm::LogInfo(MsgLoggerCat) - << "Modified Calorimeter gain constants: g0 = " << ECalgainConv_[0] - << ", g1 = " << ECalgainConv_[1] << ", g2 = " << ECalgainConv_[2] - << ", g3 = " << ECalgainConv_[3]; + edm::LogInfo(MsgLoggerCat) << "Modified Calorimeter gain constants: g0 = " << ECalgainConv_[0] + << ", g1 = " << ECalgainConv_[1] << ", g2 = " << ECalgainConv_[2] + << ", g3 = " << ECalgainConv_[3]; } } GlobalDigisAnalyzer::~GlobalDigisAnalyzer() {} -void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, - edm::Run const &, - edm::EventSetup const &) { +void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &) { // Si Strip - std::string SiStripString[19] = {"TECW1", "TECW2", "TECW3", "TECW4", "TECW5", - "TECW6", "TECW7", "TECW8", "TIBL1", "TIBL2", - "TIBL3", "TIBL4", "TIDW1", "TIDW2", "TIDW3", - "TOBL1", "TOBL2", "TOBL3", "TOBL4"}; + std::string SiStripString[19] = {"TECW1", + "TECW2", + "TECW3", + "TECW4", + "TECW5", + "TECW6", + "TECW7", + "TECW8", + "TIBL1", + "TIBL2", + "TIBL3", + "TIBL4", + "TIDW1", + "TIDW2", + "TIDW3", + "TOBL1", + "TOBL2", + "TOBL3", + "TOBL4"}; for (int i = 0; i < 19; ++i) { mehSiStripn[i] = nullptr; mehSiStripADC[i] = nullptr; @@ -158,22 +150,19 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, for (int amend = 0; amend < 19; ++amend) { hcharname = "hSiStripn_" + SiStripString[amend]; hchartitle = SiStripString[amend] + " Digis"; - mehSiStripn[amend] = - iBooker.book1D(hcharname, hchartitle, 5000, 0., 10000.); + mehSiStripn[amend] = iBooker.book1D(hcharname, hchartitle, 5000, 0., 10000.); mehSiStripn[amend]->setAxisTitle("Number of Digis", 1); mehSiStripn[amend]->setAxisTitle("Count", 2); hcharname = "hSiStripADC_" + SiStripString[amend]; hchartitle = SiStripString[amend] + " ADC"; - mehSiStripADC[amend] = - iBooker.book1D(hcharname, hchartitle, 150, 0.0, 300.); + mehSiStripADC[amend] = iBooker.book1D(hcharname, hchartitle, 150, 0.0, 300.); mehSiStripADC[amend]->setAxisTitle("ADC", 1); mehSiStripADC[amend]->setAxisTitle("Count", 2); hcharname = "hSiStripStripADC_" + SiStripString[amend]; hchartitle = SiStripString[amend] + " Strip"; - mehSiStripStrip[amend] = - iBooker.book1D(hcharname, hchartitle, 200, 0.0, 800.); + mehSiStripStrip[amend] = iBooker.book1D(hcharname, hchartitle, 200, 0.0, 800.); mehSiStripStrip[amend]->setAxisTitle("Strip Number", 1); mehSiStripStrip[amend]->setAxisTitle("Count", 2); } @@ -200,8 +189,7 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, for (int amend = 0; amend < 4; ++amend) { hcharname = "hHcaln_" + HCalString[amend]; hchartitle = HCalString[amend] + " digis"; - mehHcaln[amend] = iBooker.book1D(hcharname, hchartitle, 10000, - calnLower[amend], calnUpper[amend]); + mehHcaln[amend] = iBooker.book1D(hcharname, hchartitle, 10000, calnLower[amend], calnUpper[amend]); mehHcaln[amend]->setAxisTitle("Number of Digis", 1); mehHcaln[amend]->setAxisTitle("Count", 2); @@ -213,24 +201,21 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, hcharname = "hHcalSHE_" + HCalString[amend]; hchartitle = HCalString[amend] + "Cal SHE"; - mehHcalSHE[amend] = - iBooker.book1D(hcharname, hchartitle, 1000, 0.0, SHEUpper[amend]); + mehHcalSHE[amend] = iBooker.book1D(hcharname, hchartitle, 1000, 0.0, SHEUpper[amend]); mehHcalSHE[amend]->setAxisTitle("Simulated Hit Energy", 1); mehHcalSHE[amend]->setAxisTitle("Count", 2); hcharname = "hHcalAEESHE_" + HCalString[amend]; hchartitle = HCalString[amend] + "Cal AEE/SHE"; mehHcalAEESHE[amend] = - iBooker.book1D(hcharname, hchartitle, SHEvAEEnBins[amend], - SHEvAEELower[amend], SHEvAEEUpper[amend]); + iBooker.book1D(hcharname, hchartitle, SHEvAEEnBins[amend], SHEvAEELower[amend], SHEvAEEUpper[amend]); mehHcalAEESHE[amend]->setAxisTitle("ADC / SHE", 1); mehHcalAEESHE[amend]->setAxisTitle("Count", 2); hcharname = "hHcalSHEvAEE_" + HCalString[amend]; hchartitle = HCalString[amend] + "Cal SHE vs. AEE"; mehHcalSHEvAEE[amend] = - iBooker.bookProfile(hcharname, hchartitle, 60, -10., 50., 100, 0., - (float)ProfileUpper[amend], ""); + iBooker.bookProfile(hcharname, hchartitle, 60, -10., 50., 100, 0., (float)ProfileUpper[amend], ""); mehHcalSHEvAEE[amend]->setAxisTitle("AEE / SHE", 1); mehHcalSHEvAEE[amend]->setAxisTitle("SHE", 2); } @@ -275,15 +260,13 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, hcharname = "hEcalSHEvAEESHE_" + ECalString[amend]; hchartitle = ECalString[amend] + "Cal SHE vs. AEE/SHE"; - mehEcalSHEvAEESHE[amend] = iBooker.bookProfile(hcharname, hchartitle, 1000, - 0., 100., 500, 0., 50., ""); + mehEcalSHEvAEESHE[amend] = iBooker.bookProfile(hcharname, hchartitle, 1000, 0., 100., 500, 0., 50., ""); mehEcalSHEvAEESHE[amend]->setAxisTitle("AEE / SHE", 1); mehEcalSHEvAEESHE[amend]->setAxisTitle("SHE", 2); hcharname = "hEcalMultvAEE_" + ECalString[amend]; hchartitle = ECalString[amend] + "Cal Multi vs. AEE"; - mehEcalMultvAEE[amend] = iBooker.bookProfile( - hcharname, hchartitle, 1000, 0., 100., 4000, 0., 40000., ""); + mehEcalMultvAEE[amend] = iBooker.bookProfile(hcharname, hchartitle, 1000, 0., 100., 4000, 0., 40000., ""); mehEcalMultvAEE[amend]->setAxisTitle("Analog Equivalent Energy", 1); mehEcalMultvAEE[amend]->setAxisTitle("Number of Digis", 2); } @@ -306,8 +289,7 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, } // Si Pixels ***DONE*** - std::string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", - "FWD1p", "FWD2n", "FWD2p"}; + std::string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p", "FWD2n", "FWD2p"}; for (int j = 0; j < 7; ++j) { mehSiPixeln[j] = nullptr; mehSiPixelADC[j] = nullptr; @@ -320,32 +302,27 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, hcharname = "hSiPixeln_" + SiPixelString[amend]; hchartitle = SiPixelString[amend] + " Digis"; if (amend < 3) - mehSiPixeln[amend] = - iBooker.book1D(hcharname, hchartitle, 500, 0., 1000.); + mehSiPixeln[amend] = iBooker.book1D(hcharname, hchartitle, 500, 0., 1000.); else - mehSiPixeln[amend] = - iBooker.book1D(hcharname, hchartitle, 500, 0., 1000.); + mehSiPixeln[amend] = iBooker.book1D(hcharname, hchartitle, 500, 0., 1000.); mehSiPixeln[amend]->setAxisTitle("Number of Digis", 1); mehSiPixeln[amend]->setAxisTitle("Count", 2); hcharname = "hSiPixelADC_" + SiPixelString[amend]; hchartitle = SiPixelString[amend] + " ADC"; - mehSiPixelADC[amend] = - iBooker.book1D(hcharname, hchartitle, 150, 0.0, 300.); + mehSiPixelADC[amend] = iBooker.book1D(hcharname, hchartitle, 150, 0.0, 300.); mehSiPixelADC[amend]->setAxisTitle("ADC", 1); mehSiPixelADC[amend]->setAxisTitle("Count", 2); hcharname = "hSiPixelRow_" + SiPixelString[amend]; hchartitle = SiPixelString[amend] + " Row"; - mehSiPixelRow[amend] = - iBooker.book1D(hcharname, hchartitle, 100, 0.0, 100.); + mehSiPixelRow[amend] = iBooker.book1D(hcharname, hchartitle, 100, 0.0, 100.); mehSiPixelRow[amend]->setAxisTitle("Row Number", 1); mehSiPixelRow[amend]->setAxisTitle("Count", 2); hcharname = "hSiPixelColumn_" + SiPixelString[amend]; hchartitle = SiPixelString[amend] + " Column"; - mehSiPixelCol[amend] = - iBooker.book1D(hcharname, hchartitle, 200, 0.0, 500.); + mehSiPixelCol[amend] = iBooker.book1D(hcharname, hchartitle, 200, 0.0, 500.); mehSiPixelCol[amend]->setAxisTitle("Column Number", 1); mehSiPixelCol[amend]->setAxisTitle("Count", 2); } @@ -384,8 +361,7 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, hcharname = "hDtMuonTimevLayer_" + MuonString[j]; hchartitle = MuonString[j] + " Time vs. Layer"; - mehDtMuonTimevLayer[j] = iBooker.bookProfile(hcharname, hchartitle, 12, 1., - 13., 300, 400., 1000., ""); + mehDtMuonTimevLayer[j] = iBooker.bookProfile(hcharname, hchartitle, 12, 1., 13., 300, 400., 1000., ""); mehDtMuonTimevLayer[j]->setAxisTitle("4 * (SuperLayer - 1) + Layer", 1); mehDtMuonTimevLayer[j]->setAxisTitle("Time", 2); } @@ -441,8 +417,7 @@ void GlobalDigisAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, } } -void GlobalDigisAnalyzer::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisAnalyzer_analyze"; // keep track of number of events processed @@ -456,9 +431,8 @@ void GlobalDigisAnalyzer::analyze(const edm::Event &iEvent, ECalbarrelADCtoGeV_ = agc->getEBValue(); ECalendcapADCtoGeV_ = agc->getEEValue(); if (verbosity >= 0) { - edm::LogInfo(MsgLoggerCat) - << "Modified Calorimeter ADCtoGeV constants: barrel = " - << ECalbarrelADCtoGeV_ << ", endcap = " << ECalendcapADCtoGeV_; + edm::LogInfo(MsgLoggerCat) << "Modified Calorimeter ADCtoGeV constants: barrel = " << ECalbarrelADCtoGeV_ + << ", endcap = " << ECalendcapADCtoGeV_; } // get event id information @@ -466,24 +440,21 @@ void GlobalDigisAnalyzer::analyze(const edm::Event &iEvent, edm::EventNumber_t nevt = iEvent.id().event(); if (verbosity > 0) { - edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " - << nevt << " (" << count << " events total)"; + edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count << " events total)"; } else if (verbosity == 0) { if (nevt % frequency == 0 || nevt == 1) { - edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " - << nevt << " (" << count << " events total)"; + edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count + << " events total)"; } } // look at information available in the event if (getAllProvenances) { - std::vector AllProv; iEvent.getAllStableProvenance(AllProv); if (verbosity >= 0) - edm::LogInfo(MsgLoggerCat) - << "Number of Provenances = " << AllProv.size(); + edm::LogInfo(MsgLoggerCat) << "Number of Provenances = " << AllProv.size(); if (printProvenanceInfo && (verbosity >= 0)) { TString eventout("\nProvenance info:\n"); @@ -527,8 +498,7 @@ void GlobalDigisAnalyzer::analyze(const edm::Event &iEvent, return; } -void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillECal"; TString eventout; @@ -554,14 +524,12 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, isBarrel = false; if (isBarrel) { - // loop over simhits MapType ebSimMap; iEvent.getByToken(EBHits_Token_, crossingFrame); bool validXFrame = true; if (!crossingFrame.isValid()) { - LogDebug(MsgLoggerCat) - << "Unable to find cal barrel crossingFrame in event!"; + LogDebug(MsgLoggerCat) << "Unable to find cal barrel crossingFrame in event!"; validXFrame = false; } if (validXFrame) { @@ -569,7 +537,6 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, // keep track of sum of simhit energy in each crystal for (auto const &iHit : barrelHits) { - EBDetId ebid = EBDetId(iHit.id()); uint32_t crystid = ebid.rawId(); @@ -589,7 +556,6 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, int i = 0; for (unsigned int digis = 0; digis < EcalDigiEB->size(); ++digis) { - ++i; EBDataFrame ebdf = (*barrelDigi)[digis]; @@ -610,30 +576,25 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, // calculate maximum energy and pedestal for (int sample = 0; sample < nrSamples; ++sample) { - EcalMGPASample thisSample = ebdf[sample]; ebADCCounts[sample] = (thisSample.adc()); ebADCGains[sample] = (thisSample.gainId()); - ebAnalogSignal[sample] = - (ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * - ECalbarrelADCtoGeV_); + ebAnalogSignal[sample] = (ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_); if (Emax < ebAnalogSignal[sample]) { Emax = ebAnalogSignal[sample]; Pmax = sample; } if (sample < 3) { pedestalPreSample += ebADCCounts[sample]; - pedestalPreSampleAnalog += ebADCCounts[sample] * - ECalgainConv_[(int)ebADCGains[sample]] * - ECalbarrelADCtoGeV_; + pedestalPreSampleAnalog += + ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_; } } pedestalPreSample /= 3.; pedestalPreSampleAnalog /= 3.; // calculate pedestal subtracted digi energy in the crystal - double Erec = Emax - pedestalPreSampleAnalog * - ECalgainConv_[(int)ebADCGains[Pmax]]; + double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)ebADCGains[Pmax]]; // gather necessary information mehEcalMaxPos[0]->Fill(Pmax); @@ -641,8 +602,7 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, mehEcalAEE[0]->Fill(Erec); // Adding protection against FPE if (ebSimMap[ebid.rawId()] != 0) { - mehEcalSHEvAEESHE[0]->Fill(Erec / ebSimMap[ebid.rawId()], - ebSimMap[ebid.rawId()]); + mehEcalSHEvAEESHE[0]->Fill(Erec / ebSimMap[ebid.rawId()], ebSimMap[ebid.rawId()]); } // else { // std::cout<<"Would have been an FPE! with @@ -676,14 +636,12 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, isEndCap = false; if (isEndCap) { - // loop over simhits MapType eeSimMap; iEvent.getByToken(EEHits_Token_, crossingFrame); bool validXFrame = true; if (!crossingFrame.isValid()) { - LogDebug(MsgLoggerCat) - << "Unable to find cal endcap crossingFrame in event!"; + LogDebug(MsgLoggerCat) << "Unable to find cal endcap crossingFrame in event!"; validXFrame = false; } if (validXFrame) { @@ -691,7 +649,6 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, // keep track of sum of simhit energy in each crystal for (auto const &iHit : endcapHits) { - EEDetId eeid = EEDetId(iHit.id()); uint32_t crystid = eeid.rawId(); @@ -711,7 +668,6 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, int inc = 0; for (unsigned int digis = 0; digis < EcalDigiEE->size(); ++digis) { - ++inc; EEDataFrame eedf = (*endcapDigi)[digis]; @@ -732,31 +688,26 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, // calculate maximum enery and pedestal for (int sample = 0; sample < nrSamples; ++sample) { - EcalMGPASample thisSample = eedf[sample]; eeADCCounts[sample] = (thisSample.adc()); eeADCGains[sample] = (thisSample.gainId()); - eeAnalogSignal[sample] = - (eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * - ECalbarrelADCtoGeV_); + eeAnalogSignal[sample] = (eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_); if (Emax < eeAnalogSignal[sample]) { Emax = eeAnalogSignal[sample]; Pmax = sample; } if (sample < 3) { pedestalPreSample += eeADCCounts[sample]; - pedestalPreSampleAnalog += eeADCCounts[sample] * - ECalgainConv_[(int)eeADCGains[sample]] * - ECalbarrelADCtoGeV_; + pedestalPreSampleAnalog += + eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_; } } pedestalPreSample /= 3.; pedestalPreSampleAnalog /= 3.; // calculate pedestal subtracted digi energy in the crystal - double Erec = Emax - pedestalPreSampleAnalog * - ECalgainConv_[(int)eeADCGains[Pmax]]; + double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)eeADCGains[Pmax]]; // gather necessary information mehEcalMaxPos[1]->Fill(Pmax); @@ -764,8 +715,7 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, mehEcalAEE[1]->Fill(Erec); // Adding protection against FPE if (eeSimMap[eeid.rawId()] != 0) { - mehEcalSHEvAEESHE[1]->Fill(Erec / eeSimMap[eeid.rawId()], - eeSimMap[eeid.rawId()]); + mehEcalSHEvAEESHE[1]->Fill(Erec / eeSimMap[eeid.rawId()], eeSimMap[eeid.rawId()]); } // else{ // std::cout<<"Would have been an FPE! with @@ -803,13 +753,11 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, isPreshower = false; if (isPreshower) { - // loop over simhits iEvent.getByToken(ESHits_Token_, crossingFrame); bool validXFrame = true; if (!crossingFrame.isValid()) { - LogDebug(MsgLoggerCat) - << "Unable to find cal preshower crossingFrame in event!"; + LogDebug(MsgLoggerCat) << "Unable to find cal preshower crossingFrame in event!"; validXFrame = false; } if (validXFrame) { @@ -818,7 +766,6 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, // keep track of sum of simhit energy in each crystal MapType esSimMap; for (auto const &iHit : preshowerHits) { - ESDetId esid = ESDetId(iHit.id()); uint32_t crystid = esid.rawId(); @@ -834,7 +781,6 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, int i = 0; for (unsigned int digis = 0; digis < EcalDigiES->size(); ++digis) { - ++i; ESDataFrame esdf = (*preshowerDigi)[digis]; @@ -846,7 +792,6 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, // gether ADC counts for (int sample = 0; sample < nrSamples; ++sample) { - ESSample thisSample = esdf[sample]; esADCCounts[sample] = (thisSample.adc()); } @@ -870,8 +815,7 @@ void GlobalDigisAnalyzer::fillECal(const edm::Event &iEvent, return; } -void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillHCal"; TString eventout; @@ -905,9 +849,8 @@ void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, if (validhcalHits) { const edm::PCaloHitContainer *simhitResult = hcalHits.product(); - for (std::vector::const_iterator simhits = simhitResult->begin(); - simhits != simhitResult->end(); ++simhits) { - + for (std::vector::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); + ++simhits) { HcalDetId detId(simhits->id()); uint32_t cellid = detId.rawId(); @@ -946,10 +889,8 @@ void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, HcalDetId cell(ihbhe->id()); if ((cell.subdet() == sdHcalBrl) || (cell.subdet() == sdHcalEC)) { - // HCalconditions->makeHcalCalibration(cell, &calibrations); - const HcalCalibrations &calibrations = - HCalconditions->getHcalCalibrations(cell); + const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell); const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell); const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder); HcalCoderDb coder(*channelCoder, *shape); @@ -957,7 +898,6 @@ void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, // get HB info if (cell.subdet() == sdHcalBrl) { - ++iHB; float fDigiSum = 0.0; for (int ii = 0; ii < tool.size(); ++ii) { @@ -981,7 +921,6 @@ void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, // get HE info if (cell.subdet() == sdHcalEC) { - ++iHE; float fDigiSum = 0.0; for (int ii = 0; ii < tool.size(); ++ii) { @@ -1035,10 +974,8 @@ void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, HcalDetId cell(iho->id()); if (cell.subdet() == sdHcalOut) { - // HCalconditions->makeHcalCalibration(cell, &calibrations); - const HcalCalibrations &calibrations = - HCalconditions->getHcalCalibrations(cell); + const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell); const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell); const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder); HcalCoderDb coder(*channelCoder, *shape); @@ -1091,10 +1028,8 @@ void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, HcalDetId cell(ihf->id()); if (cell.subdet() == sdHcalFwd) { - // HCalconditions->makeHcalCalibration(cell, &calibrations); - const HcalCalibrations &calibrations = - HCalconditions->getHcalCalibrations(cell); + const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell); const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell); const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder); HcalCoderDb coder(*channelCoder, *shape); @@ -1135,8 +1070,7 @@ void GlobalDigisAnalyzer::fillHCal(const edm::Event &iEvent, return; } -void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, const edm::EventSetup &iSetup) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; iSetup.get().get(tTopoHandle); @@ -1160,8 +1094,7 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, if (validstripDigis) { int nStripBrl = 0, nStripFwd = 0; edm::DetSetVector::const_iterator DSViter; - for (DSViter = stripDigis->begin(); DSViter != stripDigis->end(); - ++DSViter) { + for (DSViter = stripDigis->begin(); DSViter != stripDigis->end(); ++DSViter) { unsigned int id = DSViter->id; DetId detId(id); edm::DetSet::const_iterator begin = DSViter->data.begin(); @@ -1170,7 +1103,6 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, // get TIB if (detId.subdetId() == sdSiTIB) { - for (iter = begin; iter != end; ++iter) { ++nStripBrl; if (tTopo->tibLayer(id) == 1) { @@ -1194,7 +1126,6 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, // get TOB if (detId.subdetId() == sdSiTOB) { - for (iter = begin; iter != end; ++iter) { ++nStripBrl; if (tTopo->tobLayer(id) == 1) { @@ -1218,7 +1149,6 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, // get TID if (detId.subdetId() == sdSiTID) { - for (iter = begin; iter != end; ++iter) { ++nStripFwd; if (tTopo->tidWheel(id) == 1) { @@ -1238,7 +1168,6 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, // get TEC if (detId.subdetId() == sdSiTEC) { - for (iter = begin; iter != end; ++iter) { ++nStripFwd; if (tTopo->tecWheel(id) == 1) { @@ -1275,7 +1204,7 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, } } } - } // end loop over DataSetVector + } // end loop over DataSetVector if (verbosity > 1) { eventout += "\n Number of BrlStripDigis collected:........ "; @@ -1305,8 +1234,7 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, if (validpixelDigis) { int nPxlBrl = 0, nPxlFwd = 0; edm::DetSetVector::const_iterator DPViter; - for (DPViter = pixelDigis->begin(); DPViter != pixelDigis->end(); - ++DPViter) { + for (DPViter = pixelDigis->begin(); DPViter != pixelDigis->end(); ++DPViter) { unsigned int id = DPViter->id; DetId detId(id); edm::DetSet::const_iterator begin = DPViter->data.begin(); @@ -1315,7 +1243,6 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, // get Barrel pixels if (detId.subdetId() == sdPxlBrl) { - for (iter = begin; iter != end; ++iter) { ++nPxlBrl; if (tTopo->pxbLayer(id) == 1) { @@ -1338,7 +1265,6 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, // get Forward pixels if (detId.subdetId() == sdPxlFwd) { - for (iter = begin; iter != end; ++iter) { ++nPxlFwd; if (tTopo->pxfDisk(id) == 1) { @@ -1355,7 +1281,6 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, } if (tTopo->pxfDisk(id) == 2) { if (tTopo->pxfSide(id) == 1) { - mehSiPixelADC[6]->Fill((*iter).adc()); mehSiPixelRow[6]->Fill((*iter).row()); mehSiPixelCol[6]->Fill((*iter).column()); @@ -1394,8 +1319,7 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event &iEvent, return; } -void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillMuon"; TString eventout; @@ -1417,14 +1341,10 @@ void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, int nDt3 = 0; int nDt = 0; DTDigiCollection::DigiRangeIterator detUnitIt; - for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); - ++detUnitIt) { - + for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) { const DTLayerId &id = (*detUnitIt).first; const DTDigiCollection::Range &range = (*detUnitIt).second; - for (DTDigiCollection::const_iterator digiIt = range.first; - digiIt != range.second; ++digiIt) { - + for (DTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { ++nDt; DTWireId wireId(id, (*digiIt).wire()); @@ -1476,9 +1396,7 @@ void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, if (validstrips) { int nStrips = 0; - for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); - j != strips->end(); ++j) { - + for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); ++j) { std::vector::const_iterator digiItr = (*j).second.first; std::vector::const_iterator last = (*j).second.second; @@ -1518,9 +1436,7 @@ void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, if (validwires) { int nWires = 0; - for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); - j != wires->end(); ++j) { - + for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); ++j) { std::vector::const_iterator digiItr = (*j).second.first; std::vector::const_iterator endDigi = (*j).second.second; @@ -1542,8 +1458,7 @@ void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, edm::ESHandle rpcGeom; iSetup.get().get(rpcGeom); if (!rpcGeom.isValid()) { - edm::LogWarning(MsgLoggerCat) - << "Unable to find RPCGeometryRecord in event!"; + edm::LogWarning(MsgLoggerCat) << "Unable to find RPCGeometryRecord in event!"; return; } @@ -1571,8 +1486,7 @@ void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, std::map> allsims; if (validrpcsim) { - for (rpcsimIt = rpcsimHit->begin(); rpcsimIt != rpcsimHit->end(); - rpcsimIt++) { + for (rpcsimIt = rpcsimHit->begin(); rpcsimIt != rpcsimHit->end(); rpcsimIt++) { RPCDetId Rsid = (RPCDetId)(*rpcsimIt).detUnitId(); int ptype = rpcsimIt->particleType(); @@ -1592,9 +1506,7 @@ void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, if (validrpcdigi) { int nRPC = 0; RPCDigiCollection::DigiRangeIterator rpcdetUnitIt; - for (rpcdetUnitIt = rpcDigis->begin(); rpcdetUnitIt != rpcDigis->end(); - ++rpcdetUnitIt) { - + for (rpcdetUnitIt = rpcDigis->begin(); rpcdetUnitIt != rpcDigis->end(); ++rpcdetUnitIt) { const RPCDetId Rsid = (*rpcdetUnitIt).first; const RPCRoll *roll = dynamic_cast(rpcGeom->roll(Rsid)); const RPCDigiCollection::Range &range = (*rpcdetUnitIt).second; @@ -1605,9 +1517,7 @@ void GlobalDigisAnalyzer::fillMuon(const edm::Event &iEvent, } int ndigi = 0; - for (RPCDigiCollection::const_iterator rpcdigiIt = range.first; - rpcdigiIt != range.second; ++rpcdigiIt) { - + for (RPCDigiCollection::const_iterator rpcdigiIt = range.first; rpcdigiIt != range.second; ++rpcdigiIt) { ++ndigi; ++nRPC; } diff --git a/Validation/GlobalDigis/src/GlobalDigisHistogrammer.cc b/Validation/GlobalDigis/src/GlobalDigisHistogrammer.cc index 776e586473796..477dff4226290 100644 --- a/Validation/GlobalDigis/src/GlobalDigisHistogrammer.cc +++ b/Validation/GlobalDigis/src/GlobalDigisHistogrammer.cc @@ -8,9 +8,15 @@ #include "Validation/GlobalDigis/interface/GlobalDigisHistogrammer.h" GlobalDigisHistogrammer::GlobalDigisHistogrammer(const edm::ParameterSet &iPSet) - : fName(""), verbosity(0), frequency(0), label(""), - getAllProvenances(false), printProvenanceInfo(false), - theCSCStripPedestalSum(0), theCSCStripPedestalCount(0), count(0) { + : fName(""), + verbosity(0), + frequency(0), + label(""), + getAllProvenances(false), + printProvenanceInfo(false), + theCSCStripPedestalSum(0), + theCSCStripPedestalCount(0), + count(0) { std::string MsgLoggerCat = "GlobalDigisHistogrammer_GlobalDigisHistogrammer"; // get information from parameter set @@ -19,11 +25,9 @@ GlobalDigisHistogrammer::GlobalDigisHistogrammer(const edm::ParameterSet &iPSet) frequency = iPSet.getUntrackedParameter("Frequency"); outputfile = iPSet.getParameter("outputFile"); doOutput = iPSet.getParameter("DoOutput"); - edm::ParameterSet m_Prov = - iPSet.getParameter("ProvenanceLookup"); + edm::ParameterSet m_Prov = iPSet.getParameter("ProvenanceLookup"); getAllProvenances = m_Prov.getUntrackedParameter("GetAllProvenances"); - printProvenanceInfo = - m_Prov.getUntrackedParameter("PrintProvenanceInfo"); + printProvenanceInfo = m_Prov.getUntrackedParameter("PrintProvenanceInfo"); // get Labels to use to extract information GlobalDigisSrc_ = iPSet.getParameter("GlobalDigisSrc"); @@ -38,8 +42,7 @@ GlobalDigisHistogrammer::GlobalDigisHistogrammer(const edm::ParameterSet &iPSet) // MuCSCWireSrc_ = iPSet.getParameter("MuCSCWireSrc"); // fix for consumes - GlobalDigisSrc_Token_ = consumes( - iPSet.getParameter("GlobalDigisSrc")); + GlobalDigisSrc_Token_ = consumes(iPSet.getParameter("GlobalDigisSrc")); // use value of first digit to determine default output level (inclusive) // 0 is none, 1 is basic, 2 is fill output, 3 is gather output verbosity %= 10; @@ -49,19 +52,18 @@ GlobalDigisHistogrammer::GlobalDigisHistogrammer(const edm::ParameterSet &iPSet) // print out Parameter Set information being used if (verbosity >= 0) { - edm::LogInfo(MsgLoggerCat) - << "\n===============================\n" - << "Initialized as EDHistogrammer with parameter values:\n" - << " Name = " << fName << "\n" - << " Verbosity = " << verbosity << "\n" - << " Frequency = " << frequency << "\n" - << " OutputFile = " << outputfile << "\n" - << " DoOutput = " << doOutput << "\n" - << " GetProv = " << getAllProvenances << "\n" - << " PrintProv = " << printProvenanceInfo << "\n" - << " Global Src = " << GlobalDigisSrc_ << "\n" - - << "===============================\n"; + edm::LogInfo(MsgLoggerCat) << "\n===============================\n" + << "Initialized as EDHistogrammer with parameter values:\n" + << " Name = " << fName << "\n" + << " Verbosity = " << verbosity << "\n" + << " Frequency = " << frequency << "\n" + << " OutputFile = " << outputfile << "\n" + << " DoOutput = " << doOutput << "\n" + << " GetProv = " << getAllProvenances << "\n" + << " PrintProv = " << printProvenanceInfo << "\n" + << " Global Src = " << GlobalDigisSrc_ << "\n" + + << "===============================\n"; } } @@ -75,17 +77,29 @@ GlobalDigisHistogrammer::GlobalDigisHistogrammer(const edm::ParameterSet &iPSet) // ECalbarrelADCtoGeV_ = 0.035; // ECalendcapADCtoGeV_ = 0.06; -void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, - edm::Run const &, - edm::EventSetup const &) { - +void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) { // monitor elements // Si Strip ***Done*** - std::string SiStripString[19] = {"TECW1", "TECW2", "TECW3", "TECW4", "TECW5", - "TECW6", "TECW7", "TECW8", "TIBL1", "TIBL2", - "TIBL3", "TIBL4", "TIDW1", "TIDW2", "TIDW3", - "TOBL1", "TOBL2", "TOBL3", "TOBL4"}; + std::string SiStripString[19] = {"TECW1", + "TECW2", + "TECW3", + "TECW4", + "TECW5", + "TECW6", + "TECW7", + "TECW8", + "TIBL1", + "TIBL2", + "TIBL3", + "TIBL4", + "TIDW1", + "TIDW2", + "TIDW3", + "TOBL1", + "TOBL2", + "TOBL3", + "TOBL4"}; for (int i = 0; i < 19; ++i) { mehSiStripn[i] = nullptr; @@ -96,20 +110,17 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, ibooker.setCurrentFolder("GlobalDigisV/SiStrips"); for (int amend = 0; amend < 19; ++amend) { mehSiStripn[amend] = - ibooker.book1D("hSiStripn_" + SiStripString[amend], - SiStripString[amend] + " Digis", 500, 0., 1000.); + ibooker.book1D("hSiStripn_" + SiStripString[amend], SiStripString[amend] + " Digis", 500, 0., 1000.); mehSiStripn[amend]->setAxisTitle("Number of Digis", 1); mehSiStripn[amend]->setAxisTitle("Count", 2); mehSiStripADC[amend] = - ibooker.book1D("hSiStripADC_" + SiStripString[amend], - SiStripString[amend] + " ADC", 150, 0.0, 300.); + ibooker.book1D("hSiStripADC_" + SiStripString[amend], SiStripString[amend] + " ADC", 150, 0.0, 300.); mehSiStripADC[amend]->setAxisTitle("ADC", 1); mehSiStripADC[amend]->setAxisTitle("Count", 2); mehSiStripStrip[amend] = - ibooker.book1D("hSiStripStripADC_" + SiStripString[amend], - SiStripString[amend] + " Strip", 200, 0.0, 800.); + ibooker.book1D("hSiStripStripADC_" + SiStripString[amend], SiStripString[amend] + " Strip", 200, 0.0, 800.); mehSiStripStrip[amend]->setAxisTitle("Strip Number", 1); mehSiStripStrip[amend]->setAxisTitle("Count", 2); } @@ -134,36 +145,39 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, ibooker.setCurrentFolder("GlobalDigisV/HCals"); for (int amend = 0; amend < 4; ++amend) { - mehHcaln[amend] = ibooker.book1D("hHcaln_" + HCalString[amend], - HCalString[amend] + " digis", 1000, - calnLower[amend], calnUpper[amend]); + mehHcaln[amend] = ibooker.book1D( + "hHcaln_" + HCalString[amend], HCalString[amend] + " digis", 1000, calnLower[amend], calnUpper[amend]); mehHcaln[amend]->setAxisTitle("Number of Digis", 1); mehHcaln[amend]->setAxisTitle("Count", 2); - mehHcalAEE[amend] = - ibooker.book1D("hHcalAEE_" + HCalString[amend], - HCalString[amend] + "Cal AEE", 60, -10., 50.); + mehHcalAEE[amend] = ibooker.book1D("hHcalAEE_" + HCalString[amend], HCalString[amend] + "Cal AEE", 60, -10., 50.); mehHcalAEE[amend]->setAxisTitle("Analog Equivalent Energy", 1); mehHcalAEE[amend]->setAxisTitle("Count", 2); - mehHcalSHE[amend] = ibooker.book1D("hHcalSHE_" + HCalString[amend], - HCalString[amend] + "Cal SHE", 100, 0.0, - SHEUpper[amend]); + mehHcalSHE[amend] = + ibooker.book1D("hHcalSHE_" + HCalString[amend], HCalString[amend] + "Cal SHE", 100, 0.0, SHEUpper[amend]); mehHcalSHE[amend]->setAxisTitle("Simulated Hit Energy", 1); mehHcalSHE[amend]->setAxisTitle("Count", 2); - mehHcalAEESHE[amend] = ibooker.book1D( - "hHcalAEESHE_" + HCalString[amend], HCalString[amend] + "Cal AEE/SHE", - SHEvAEEnBins[amend], SHEvAEELower[amend], SHEvAEEUpper[amend]); + mehHcalAEESHE[amend] = ibooker.book1D("hHcalAEESHE_" + HCalString[amend], + HCalString[amend] + "Cal AEE/SHE", + SHEvAEEnBins[amend], + SHEvAEELower[amend], + SHEvAEEUpper[amend]); mehHcalAEESHE[amend]->setAxisTitle("ADC / SHE", 1); mehHcalAEESHE[amend]->setAxisTitle("Count", 2); //************ Not sure how to do Profile ME ************** - mehHcalSHEvAEE[amend] = ibooker.bookProfile( - "hHcalSHEvAEE_" + HCalString[amend], - HCalString[amend] + "Cal SHE vs. AEE", 60, (float)-10., (float)50., 100, - (float)0., (float)ProfileUpper[amend], ""); + mehHcalSHEvAEE[amend] = ibooker.bookProfile("hHcalSHEvAEE_" + HCalString[amend], + HCalString[amend] + "Cal SHE vs. AEE", + 60, + (float)-10., + (float)50., + 100, + (float)0., + (float)ProfileUpper[amend], + ""); mehHcalSHEvAEE[amend]->setAxisTitle("AEE / SHE", 1); mehHcalSHEvAEE[amend]->setAxisTitle("SHE", 2); @@ -183,43 +197,46 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, ibooker.setCurrentFolder("GlobalDigisV/ECals"); for (int amend = 0; amend < 2; ++amend) { - mehEcaln[amend] = - ibooker.book1D("hEcaln_" + ECalString[amend], - ECalString[amend] + " digis", 300, 1000., 4000.); + mehEcaln[amend] = ibooker.book1D("hEcaln_" + ECalString[amend], ECalString[amend] + " digis", 300, 1000., 4000.); mehEcaln[amend]->setAxisTitle("Number of Digis", 1); mehEcaln[amend]->setAxisTitle("Count", 2); - mehEcalAEE[amend] = - ibooker.book1D("hEcalAEE_" + ECalString[amend], - ECalString[amend] + "Cal AEE", 100, 0., 1.); + mehEcalAEE[amend] = ibooker.book1D("hEcalAEE_" + ECalString[amend], ECalString[amend] + "Cal AEE", 100, 0., 1.); mehEcalAEE[amend]->setAxisTitle("Analog Equivalent Energy", 1); mehEcalAEE[amend]->setAxisTitle("Count", 2); - mehEcalSHE[amend] = - ibooker.book1D("hEcalSHE_" + ECalString[amend], - ECalString[amend] + "Cal SHE", 50, 0., 5.); + mehEcalSHE[amend] = ibooker.book1D("hEcalSHE_" + ECalString[amend], ECalString[amend] + "Cal SHE", 50, 0., 5.); mehEcalSHE[amend]->setAxisTitle("Simulated Hit Energy", 1); mehEcalSHE[amend]->setAxisTitle("Count", 2); mehEcalMaxPos[amend] = - ibooker.book1D("hEcalMaxPos_" + ECalString[amend], - ECalString[amend] + "Cal MaxPos", 10, 0., 10.); + ibooker.book1D("hEcalMaxPos_" + ECalString[amend], ECalString[amend] + "Cal MaxPos", 10, 0., 10.); mehEcalMaxPos[amend]->setAxisTitle("Maximum Position", 1); mehEcalMaxPos[amend]->setAxisTitle("Count", 2); //************ Not sure how to do Profile ME ************** - mehEcalSHEvAEESHE[amend] = ibooker.bookProfile( - "hEcalSHEvAEESHE_" + ECalString[amend], - ECalString[amend] + "Cal SHE vs. AEE/SHE", 100, (float)0., (float)10., - 50, (float)0., (float)5., ""); + mehEcalSHEvAEESHE[amend] = ibooker.bookProfile("hEcalSHEvAEESHE_" + ECalString[amend], + ECalString[amend] + "Cal SHE vs. AEE/SHE", + 100, + (float)0., + (float)10., + 50, + (float)0., + (float)5., + ""); mehEcalSHEvAEESHE[amend]->setAxisTitle("AEE / SHE", 1); mehEcalSHEvAEESHE[amend]->setAxisTitle("SHE", 2); - mehEcalMultvAEE[amend] = ibooker.bookProfile( - "hEcalMultvAEE_" + ECalString[amend], - ECalString[amend] + "Cal Multi vs. AEE", 100, (float)0., (float)10., - 400, (float)0., (float)4000., ""); + mehEcalMultvAEE[amend] = ibooker.bookProfile("hEcalMultvAEE_" + ECalString[amend], + ECalString[amend] + "Cal Multi vs. AEE", + 100, + (float)0., + (float)10., + 400, + (float)0., + (float)4000., + ""); mehEcalMultvAEE[amend]->setAxisTitle("Analog Equivalent Energy", 1); mehEcalMultvAEE[amend]->setAxisTitle("Number of Digis", 2); } @@ -231,17 +248,14 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, std::string ADCNumber[3] = {"0", "1", "2"}; for (int i = 0; i < 3; ++i) { mehEScalADC[i] = nullptr; - mehEScalADC[i] = - ibooker.book1D("hEcalADC" + ADCNumber[i] + "_ES", - "ESCAL ADC" + ADCNumber[i], 150, 950., 1500.); + mehEScalADC[i] = ibooker.book1D("hEcalADC" + ADCNumber[i] + "_ES", "ESCAL ADC" + ADCNumber[i], 150, 950., 1500.); mehEScalADC[i]->setAxisTitle("ADC" + ADCNumber[i], 1); mehEScalADC[i]->setAxisTitle("Count", 2); } // Si Pixels ***DONE*** - std::string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", - "FWD1p", "FWD2n", "FWD2p"}; + std::string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p", "FWD2n", "FWD2p"}; for (int j = 0; j < 7; ++j) { mehSiPixeln[j] = nullptr; @@ -254,31 +268,26 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, for (int amend = 0; amend < 7; ++amend) { if (amend < 3) { mehSiPixeln[amend] = - ibooker.book1D("hSiPixeln_" + SiPixelString[amend], - SiPixelString[amend] + " Digis", 50, 0., 100.); + ibooker.book1D("hSiPixeln_" + SiPixelString[amend], SiPixelString[amend] + " Digis", 50, 0., 100.); } else { mehSiPixeln[amend] = - ibooker.book1D("hSiPixeln_" + SiPixelString[amend], - SiPixelString[amend] + " Digis", 25, 0., 50.); + ibooker.book1D("hSiPixeln_" + SiPixelString[amend], SiPixelString[amend] + " Digis", 25, 0., 50.); } mehSiPixeln[amend]->setAxisTitle("Number of Digis", 1); mehSiPixeln[amend]->setAxisTitle("Count", 2); mehSiPixelADC[amend] = - ibooker.book1D("hSiPixelADC_" + SiPixelString[amend], - SiPixelString[amend] + " ADC", 150, 0.0, 300.); + ibooker.book1D("hSiPixelADC_" + SiPixelString[amend], SiPixelString[amend] + " ADC", 150, 0.0, 300.); mehSiPixelADC[amend]->setAxisTitle("ADC", 1); mehSiPixelADC[amend]->setAxisTitle("Count", 2); mehSiPixelRow[amend] = - ibooker.book1D("hSiPixelRow_" + SiPixelString[amend], - SiPixelString[amend] + " Row", 100, 0.0, 100.); + ibooker.book1D("hSiPixelRow_" + SiPixelString[amend], SiPixelString[amend] + " Row", 100, 0.0, 100.); mehSiPixelRow[amend]->setAxisTitle("Row Number", 1); mehSiPixelRow[amend]->setAxisTitle("Count", 2); mehSiPixelCol[amend] = - ibooker.book1D("hSiPixelColumn_" + SiPixelString[amend], - SiPixelString[amend] + " Column", 200, 0.0, 500.); + ibooker.book1D("hSiPixelColumn_" + SiPixelString[amend], SiPixelString[amend] + " Column", 200, 0.0, 500.); mehSiPixelCol[amend]->setAxisTitle("Column Number", 1); mehSiPixelCol[amend]->setAxisTitle("Count", 2); @@ -296,25 +305,20 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, } for (int j = 0; j < 4; ++j) { - mehDtMuonn[j] = ibooker.book1D("hDtMuonn_" + MuonString[j], - MuonString[j] + " digis", 25, 0., 50.); + mehDtMuonn[j] = ibooker.book1D("hDtMuonn_" + MuonString[j], MuonString[j] + " digis", 25, 0., 50.); mehDtMuonn[j]->setAxisTitle("Number of Digis", 1); mehDtMuonn[j]->setAxisTitle("Count", 2); - mehDtMuonLayer[j] = ibooker.book1D("hDtLayer_" + MuonString[j], - MuonString[j] + " Layer", 12, 1., 13.); + mehDtMuonLayer[j] = ibooker.book1D("hDtLayer_" + MuonString[j], MuonString[j] + " Layer", 12, 1., 13.); mehDtMuonLayer[j]->setAxisTitle("4 * (SuperLayer - 1) + Layer", 1); mehDtMuonLayer[j]->setAxisTitle("Count", 2); - mehDtMuonTime[j] = - ibooker.book1D("hDtMuonTime_" + MuonString[j], MuonString[j] + " Time", - 300, 400., 1000.); + mehDtMuonTime[j] = ibooker.book1D("hDtMuonTime_" + MuonString[j], MuonString[j] + " Time", 300, 400., 1000.); mehDtMuonTime[j]->setAxisTitle("Time", 1); mehDtMuonTime[j]->setAxisTitle("Count", 2); mehDtMuonTimevLayer[j] = ibooker.bookProfile( - "hDtMuonTimevLayer_" + MuonString[j], - MuonString[j] + " Time vs. Layer", 12, 1., 13., 300, 400., 1000., ""); + "hDtMuonTimevLayer_" + MuonString[j], MuonString[j] + " Time vs. Layer", 12, 1., 13., 300, 400., 1000., ""); mehDtMuonTimevLayer[j]->setAxisTitle("4 * (SuperLayer - 1) + Layer", 1); mehDtMuonTimevLayer[j]->setAxisTitle("Time", 2); @@ -328,8 +332,7 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, mehCSCStripn->setAxisTitle("Count", 2); mehCSCStripADC = nullptr; - mehCSCStripADC = - ibooker.book1D("hCSCStripADC", "CSC Strip ADC", 110, 0., 1100.); + mehCSCStripADC = ibooker.book1D("hCSCStripADC", "CSC Strip ADC", 110, 0., 1100.); mehCSCStripADC->setAxisTitle("ADC", 1); mehCSCStripADC->setAxisTitle("Count", 2); @@ -343,12 +346,11 @@ void GlobalDigisHistogrammer::bookHistograms(DQMStore::IBooker &ibooker, mehCSCWiren->setAxisTitle("Time", 1); mehCSCWiren->setAxisTitle("Count", 2); -} // close bookHistograms +} // close bookHistograms GlobalDigisHistogrammer::~GlobalDigisHistogrammer() {} -void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisHistogrammer_analyze"; // keep track of number of events processed @@ -359,12 +361,11 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, edm::EventNumber_t nevt = iEvent.id().event(); if (verbosity > 0) { - edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " - << nevt << " (" << count << " events total)"; + edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count << " events total)"; } else if (verbosity == 0) { if (nevt % frequency == 0 || nevt == 1) { - edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " - << nevt << " (" << count << " events total)"; + edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count + << " events total)"; } } @@ -373,13 +374,11 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, // look at information available in the event if (getAllProvenances) { - std::vector AllProv; iEvent.getAllStableProvenance(AllProv); if (verbosity >= 0) - edm::LogInfo(MsgLoggerCat) - << "Number of Provenances = " << AllProv.size(); + edm::LogInfo(MsgLoggerCat) << "Number of Provenances = " << AllProv.size(); if (printProvenanceInfo && (verbosity >= 0)) { TString eventout("\nProvenance info:\n"); @@ -461,8 +460,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, int nCSCwireDigis = srcGlobalDigis->getnCSCwireDigis(); // get Ecal info - std::vector EECalDigis = - srcGlobalDigis->getEECalDigis(); + std::vector EECalDigis = srcGlobalDigis->getEECalDigis(); mehEcaln[0]->Fill((float)nEECalDigis); for (unsigned int i = 0; i < EECalDigis.size(); ++i) { mehEcalAEE[0]->Fill(EECalDigis[i].AEE); @@ -470,13 +468,11 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehEcalMultvAEE[0]->Fill(EECalDigis[i].AEE, (float)nEECalDigis, 1); if (EECalDigis[i].SHE != 0.) { mehEcalSHE[0]->Fill(EECalDigis[i].SHE); - mehEcalSHEvAEESHE[0]->Fill(EECalDigis[i].AEE / EECalDigis[i].SHE, - EECalDigis[i].SHE, 1); + mehEcalSHEvAEESHE[0]->Fill(EECalDigis[i].AEE / EECalDigis[i].SHE, EECalDigis[i].SHE, 1); } } - std::vector EBCalDigis = - srcGlobalDigis->getEBCalDigis(); + std::vector EBCalDigis = srcGlobalDigis->getEBCalDigis(); mehEcaln[1]->Fill((float)nEBCalDigis); for (unsigned int i = 0; i < EBCalDigis.size(); ++i) { mehEcalAEE[1]->Fill(EBCalDigis[i].AEE); @@ -484,13 +480,11 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehEcalMultvAEE[1]->Fill(EBCalDigis[i].AEE, (float)nEBCalDigis, 1); if (EBCalDigis[i].SHE != 0.) { mehEcalSHE[1]->Fill(EBCalDigis[i].SHE); - mehEcalSHEvAEESHE[1]->Fill(EBCalDigis[i].AEE / EBCalDigis[i].SHE, - EBCalDigis[i].SHE, 1); + mehEcalSHEvAEESHE[1]->Fill(EBCalDigis[i].AEE / EBCalDigis[i].SHE, EBCalDigis[i].SHE, 1); } } - std::vector ESCalDigis = - srcGlobalDigis->getESCalDigis(); + std::vector ESCalDigis = srcGlobalDigis->getESCalDigis(); mehEcaln[2]->Fill((float)nESCalDigis); for (unsigned int i = 0; i < ESCalDigis.size(); ++i) { mehEScalADC[0]->Fill(ESCalDigis[i].ADC0); @@ -499,8 +493,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, } // Get HCal info - std::vector HBCalDigis = - srcGlobalDigis->getHBCalDigis(); + std::vector HBCalDigis = srcGlobalDigis->getHBCalDigis(); mehHcaln[0]->Fill((float)nHBCalDigis); for (unsigned int i = 0; i < HBCalDigis.size(); ++i) { mehHcalAEE[0]->Fill(HBCalDigis[i].AEE); @@ -510,8 +503,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehHcalSHEvAEE[0]->Fill(HBCalDigis[i].AEE, HBCalDigis[i].SHE, 1); } } - std::vector HECalDigis = - srcGlobalDigis->getHECalDigis(); + std::vector HECalDigis = srcGlobalDigis->getHECalDigis(); mehHcaln[1]->Fill((float)nHECalDigis); for (unsigned int i = 0; i < HECalDigis.size(); ++i) { mehHcalAEE[1]->Fill(HECalDigis[i].AEE); @@ -522,8 +514,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, } } - std::vector HOCalDigis = - srcGlobalDigis->getHOCalDigis(); + std::vector HOCalDigis = srcGlobalDigis->getHOCalDigis(); mehHcaln[2]->Fill((float)nHOCalDigis); for (unsigned int i = 0; i < HOCalDigis.size(); ++i) { mehHcalAEE[2]->Fill(HOCalDigis[i].AEE); @@ -534,8 +525,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, } } - std::vector HFCalDigis = - srcGlobalDigis->getHFCalDigis(); + std::vector HFCalDigis = srcGlobalDigis->getHFCalDigis(); mehHcaln[3]->Fill((float)nHFCalDigis); for (unsigned int i = 0; i < HFCalDigis.size(); ++i) { mehHcalAEE[3]->Fill(HFCalDigis[i].AEE); @@ -547,152 +537,133 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, } // get SiStrip info - std::vector TIBL1Digis = - srcGlobalDigis->getTIBL1Digis(); + std::vector TIBL1Digis = srcGlobalDigis->getTIBL1Digis(); mehSiStripn[0]->Fill((float)nTIBL1Digis); for (unsigned int i = 0; i < TIBL1Digis.size(); ++i) { mehSiStripADC[0]->Fill(TIBL1Digis[i].ADC); mehSiStripStrip[0]->Fill(TIBL1Digis[i].STRIP); } - std::vector TIBL2Digis = - srcGlobalDigis->getTIBL2Digis(); + std::vector TIBL2Digis = srcGlobalDigis->getTIBL2Digis(); mehSiStripn[1]->Fill((float)nTIBL2Digis); for (unsigned int i = 0; i < TIBL2Digis.size(); ++i) { mehSiStripADC[1]->Fill(TIBL2Digis[i].ADC); mehSiStripStrip[1]->Fill(TIBL2Digis[i].STRIP); } - std::vector TIBL3Digis = - srcGlobalDigis->getTIBL3Digis(); + std::vector TIBL3Digis = srcGlobalDigis->getTIBL3Digis(); mehSiStripn[2]->Fill((float)nTIBL3Digis); for (unsigned int i = 0; i < TIBL3Digis.size(); ++i) { mehSiStripADC[2]->Fill(TIBL3Digis[i].ADC); mehSiStripStrip[2]->Fill(TIBL3Digis[i].STRIP); } - std::vector TIBL4Digis = - srcGlobalDigis->getTIBL4Digis(); + std::vector TIBL4Digis = srcGlobalDigis->getTIBL4Digis(); mehSiStripn[3]->Fill((float)nTIBL4Digis); for (unsigned int i = 0; i < TIBL4Digis.size(); ++i) { mehSiStripADC[3]->Fill(TIBL4Digis[i].ADC); mehSiStripStrip[3]->Fill(TIBL4Digis[i].STRIP); } - std::vector TOBL1Digis = - srcGlobalDigis->getTOBL1Digis(); + std::vector TOBL1Digis = srcGlobalDigis->getTOBL1Digis(); mehSiStripn[4]->Fill((float)nTOBL1Digis); for (unsigned int i = 0; i < TOBL1Digis.size(); ++i) { mehSiStripADC[4]->Fill(TOBL1Digis[i].ADC); mehSiStripStrip[4]->Fill(TOBL1Digis[i].STRIP); } - std::vector TOBL2Digis = - srcGlobalDigis->getTOBL2Digis(); + std::vector TOBL2Digis = srcGlobalDigis->getTOBL2Digis(); mehSiStripn[5]->Fill((float)nTOBL2Digis); for (unsigned int i = 0; i < TOBL2Digis.size(); ++i) { mehSiStripADC[5]->Fill(TOBL2Digis[i].ADC); mehSiStripStrip[5]->Fill(TOBL2Digis[i].STRIP); } - std::vector TOBL3Digis = - srcGlobalDigis->getTOBL3Digis(); + std::vector TOBL3Digis = srcGlobalDigis->getTOBL3Digis(); mehSiStripn[6]->Fill((float)nTOBL3Digis); for (unsigned int i = 0; i < TOBL3Digis.size(); ++i) { mehSiStripADC[6]->Fill(TOBL3Digis[i].ADC); mehSiStripStrip[6]->Fill(TOBL3Digis[i].STRIP); } - std::vector TOBL4Digis = - srcGlobalDigis->getTOBL4Digis(); + std::vector TOBL4Digis = srcGlobalDigis->getTOBL4Digis(); mehSiStripn[7]->Fill((float)nTOBL4Digis); for (unsigned int i = 0; i < TOBL4Digis.size(); ++i) { mehSiStripADC[7]->Fill(TOBL4Digis[i].ADC); mehSiStripStrip[7]->Fill(TOBL4Digis[i].STRIP); } - std::vector TIDW1Digis = - srcGlobalDigis->getTIDW1Digis(); + std::vector TIDW1Digis = srcGlobalDigis->getTIDW1Digis(); mehSiStripn[8]->Fill((float)nTIDW1Digis); for (unsigned int i = 0; i < TIDW1Digis.size(); ++i) { mehSiStripADC[8]->Fill(TIDW1Digis[i].ADC); mehSiStripStrip[8]->Fill(TIDW1Digis[i].STRIP); } - std::vector TIDW2Digis = - srcGlobalDigis->getTIDW2Digis(); + std::vector TIDW2Digis = srcGlobalDigis->getTIDW2Digis(); mehSiStripn[9]->Fill((float)nTIDW2Digis); for (unsigned int i = 0; i < TIDW2Digis.size(); ++i) { mehSiStripADC[9]->Fill(TIDW2Digis[i].ADC); mehSiStripStrip[9]->Fill(TIDW2Digis[i].STRIP); } - std::vector TIDW3Digis = - srcGlobalDigis->getTIDW3Digis(); + std::vector TIDW3Digis = srcGlobalDigis->getTIDW3Digis(); mehSiStripn[10]->Fill((float)nTIDW3Digis); for (unsigned int i = 0; i < TIDW3Digis.size(); ++i) { mehSiStripADC[10]->Fill(TIDW3Digis[i].ADC); mehSiStripStrip[10]->Fill(TIDW3Digis[i].STRIP); } - std::vector TECW1Digis = - srcGlobalDigis->getTECW1Digis(); + std::vector TECW1Digis = srcGlobalDigis->getTECW1Digis(); mehSiStripn[11]->Fill((float)nTECW1Digis); for (unsigned int i = 0; i < TECW1Digis.size(); ++i) { mehSiStripADC[11]->Fill(TECW1Digis[i].ADC); mehSiStripStrip[11]->Fill(TECW1Digis[i].STRIP); } - std::vector TECW2Digis = - srcGlobalDigis->getTECW2Digis(); + std::vector TECW2Digis = srcGlobalDigis->getTECW2Digis(); mehSiStripn[12]->Fill((float)nTECW2Digis); for (unsigned int i = 0; i < TECW2Digis.size(); ++i) { mehSiStripADC[12]->Fill(TECW2Digis[i].ADC); mehSiStripStrip[12]->Fill(TECW2Digis[i].STRIP); } - std::vector TECW3Digis = - srcGlobalDigis->getTECW3Digis(); + std::vector TECW3Digis = srcGlobalDigis->getTECW3Digis(); mehSiStripn[13]->Fill((float)nTECW3Digis); for (unsigned int i = 0; i < TECW3Digis.size(); ++i) { mehSiStripADC[13]->Fill(TECW3Digis[i].ADC); mehSiStripStrip[13]->Fill(TECW3Digis[i].STRIP); } - std::vector TECW4Digis = - srcGlobalDigis->getTECW4Digis(); + std::vector TECW4Digis = srcGlobalDigis->getTECW4Digis(); mehSiStripn[14]->Fill((float)nTECW4Digis); for (unsigned int i = 0; i < TECW4Digis.size(); ++i) { mehSiStripADC[14]->Fill(TECW4Digis[i].ADC); mehSiStripStrip[14]->Fill(TECW4Digis[i].STRIP); } - std::vector TECW5Digis = - srcGlobalDigis->getTECW5Digis(); + std::vector TECW5Digis = srcGlobalDigis->getTECW5Digis(); mehSiStripn[15]->Fill((float)nTECW5Digis); for (unsigned int i = 0; i < TECW5Digis.size(); ++i) { mehSiStripADC[15]->Fill(TECW5Digis[i].ADC); mehSiStripStrip[15]->Fill(TECW5Digis[i].STRIP); } - std::vector TECW6Digis = - srcGlobalDigis->getTECW6Digis(); + std::vector TECW6Digis = srcGlobalDigis->getTECW6Digis(); mehSiStripn[16]->Fill((float)nTECW6Digis); for (unsigned int i = 0; i < TECW6Digis.size(); ++i) { mehSiStripADC[16]->Fill(TECW6Digis[i].ADC); mehSiStripStrip[16]->Fill(TECW6Digis[i].STRIP); } - std::vector TECW7Digis = - srcGlobalDigis->getTECW7Digis(); + std::vector TECW7Digis = srcGlobalDigis->getTECW7Digis(); mehSiStripn[17]->Fill((float)nTECW7Digis); for (unsigned int i = 0; i < TECW7Digis.size(); ++i) { mehSiStripADC[17]->Fill(TECW7Digis[i].ADC); mehSiStripStrip[17]->Fill(TECW7Digis[i].STRIP); } - std::vector TECW8Digis = - srcGlobalDigis->getTECW8Digis(); + std::vector TECW8Digis = srcGlobalDigis->getTECW8Digis(); mehSiStripn[18]->Fill((float)nTECW8Digis); for (unsigned int i = 0; i < TECW8Digis.size(); ++i) { mehSiStripADC[18]->Fill(TECW8Digis[i].ADC); @@ -700,8 +671,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, } // get SiPixel info - std::vector BRL1Digis = - srcGlobalDigis->getBRL1Digis(); + std::vector BRL1Digis = srcGlobalDigis->getBRL1Digis(); mehSiPixeln[0]->Fill((float)nBRL1Digis); for (unsigned int i = 0; i < BRL1Digis.size(); ++i) { mehSiPixelADC[0]->Fill(BRL1Digis[i].ADC); @@ -709,8 +679,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehSiPixelCol[0]->Fill(BRL1Digis[i].COLUMN); } - std::vector BRL2Digis = - srcGlobalDigis->getBRL2Digis(); + std::vector BRL2Digis = srcGlobalDigis->getBRL2Digis(); mehSiPixeln[1]->Fill((float)nBRL2Digis); for (unsigned int i = 0; i < BRL2Digis.size(); ++i) { mehSiPixelADC[1]->Fill(BRL2Digis[i].ADC); @@ -718,8 +687,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehSiPixelCol[1]->Fill(BRL2Digis[i].COLUMN); } - std::vector BRL3Digis = - srcGlobalDigis->getBRL3Digis(); + std::vector BRL3Digis = srcGlobalDigis->getBRL3Digis(); mehSiPixeln[2]->Fill((float)nBRL3Digis); for (unsigned int i = 0; i < BRL3Digis.size(); ++i) { mehSiPixelADC[2]->Fill(BRL3Digis[i].ADC); @@ -727,8 +695,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehSiPixelCol[2]->Fill(BRL3Digis[i].COLUMN); } - std::vector FWD1pDigis = - srcGlobalDigis->getFWD1pDigis(); + std::vector FWD1pDigis = srcGlobalDigis->getFWD1pDigis(); mehSiPixeln[3]->Fill((float)nFWD1pDigis); for (unsigned int i = 0; i < FWD1pDigis.size(); ++i) { mehSiPixelADC[3]->Fill(FWD1pDigis[i].ADC); @@ -736,8 +703,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehSiPixelCol[3]->Fill(FWD1pDigis[i].COLUMN); } - std::vector FWD1nDigis = - srcGlobalDigis->getFWD1nDigis(); + std::vector FWD1nDigis = srcGlobalDigis->getFWD1nDigis(); mehSiPixeln[4]->Fill((float)nFWD1nDigis); for (unsigned int i = 0; i < FWD1nDigis.size(); ++i) { mehSiPixelADC[4]->Fill(FWD1nDigis[i].ADC); @@ -745,8 +711,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehSiPixelCol[4]->Fill(FWD1nDigis[i].COLUMN); } - std::vector FWD2pDigis = - srcGlobalDigis->getFWD2pDigis(); + std::vector FWD2pDigis = srcGlobalDigis->getFWD2pDigis(); mehSiPixeln[5]->Fill((float)nFWD2pDigis); for (unsigned int i = 0; i < FWD2pDigis.size(); ++i) { mehSiPixelADC[5]->Fill(FWD2pDigis[i].ADC); @@ -754,8 +719,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, mehSiPixelCol[5]->Fill(FWD2pDigis[i].COLUMN); } - std::vector FWD2nDigis = - srcGlobalDigis->getFWD2nDigis(); + std::vector FWD2nDigis = srcGlobalDigis->getFWD2nDigis(); mehSiPixeln[6]->Fill((float)nFWD2nDigis); for (unsigned int i = 0; i < FWD2nDigis.size(); ++i) { mehSiPixelADC[6]->Fill(FWD2nDigis[i].ADC); @@ -801,16 +765,14 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, } // get CSC Strip info - std::vector CSCstripDigis = - srcGlobalDigis->getCSCstripDigis(); + std::vector CSCstripDigis = srcGlobalDigis->getCSCstripDigis(); mehCSCStripn->Fill((float)nCSCstripDigis); for (unsigned int i = 0; i < CSCstripDigis.size(); ++i) { mehCSCStripADC->Fill(CSCstripDigis[i].ADC); } // get CSC Wire info - std::vector CSCwireDigis = - srcGlobalDigis->getCSCwireDigis(); + std::vector CSCwireDigis = srcGlobalDigis->getCSCwireDigis(); mehCSCWiren->Fill((float)nCSCwireDigis); for (unsigned int i = 0; i < CSCwireDigis.size(); ++i) { mehCSCWireTime->Fill(CSCwireDigis[i].TIME); @@ -818,7 +780,7 @@ void GlobalDigisHistogrammer::analyze(const edm::Event &iEvent, if (verbosity > 0) edm::LogInfo(MsgLoggerCat) << "Done gathering data from event."; - } // end loop through events + } // end loop through events } // define this as a plug-in diff --git a/Validation/GlobalDigis/src/GlobalDigisProducer.cc b/Validation/GlobalDigis/src/GlobalDigisProducer.cc index 3eb6732cdac5c..d438208350e7f 100644 --- a/Validation/GlobalDigis/src/GlobalDigisProducer.cc +++ b/Validation/GlobalDigis/src/GlobalDigisProducer.cc @@ -10,9 +10,15 @@ #include "Validation/GlobalDigis/interface/GlobalDigisProducer.h" GlobalDigisProducer::GlobalDigisProducer(const edm::ParameterSet &iPSet) - : fName(""), verbosity(0), frequency(0), label(""), - getAllProvenances(false), printProvenanceInfo(false), - theCSCStripPedestalSum(0), theCSCStripPedestalCount(0), count(0) { + : fName(""), + verbosity(0), + frequency(0), + label(""), + getAllProvenances(false), + printProvenanceInfo(false), + theCSCStripPedestalSum(0), + theCSCStripPedestalCount(0), + count(0) { std::string MsgLoggerCat = "GlobalDigisProducer_GlobalDigisProducer"; // get information from parameter set @@ -20,11 +26,9 @@ GlobalDigisProducer::GlobalDigisProducer(const edm::ParameterSet &iPSet) verbosity = iPSet.getUntrackedParameter("Verbosity"); frequency = iPSet.getUntrackedParameter("Frequency"); label = iPSet.getParameter("Label"); - edm::ParameterSet m_Prov = - iPSet.getParameter("ProvenanceLookup"); + edm::ParameterSet m_Prov = iPSet.getParameter("ProvenanceLookup"); getAllProvenances = m_Prov.getUntrackedParameter("GetAllProvenances"); - printProvenanceInfo = - m_Prov.getUntrackedParameter("PrintProvenanceInfo"); + printProvenanceInfo = m_Prov.getUntrackedParameter("PrintProvenanceInfo"); // get Labels to use to extract information ECalEBSrc_ = iPSet.getParameter("ECalEBSrc"); @@ -38,40 +42,26 @@ GlobalDigisProducer::GlobalDigisProducer(const edm::ParameterSet &iPSet) MuCSCStripSrc_ = iPSet.getParameter("MuCSCStripSrc"); MuCSCWireSrc_ = iPSet.getParameter("MuCSCWireSrc"); // fix for consumes - ECalEBSrc_Token_ = consumes( - iPSet.getParameter("ECalEBSrc")); - ECalEESrc_Token_ = consumes( - iPSet.getParameter("ECalEESrc")); - ECalESSrc_Token_ = consumes( - iPSet.getParameter("ECalESSrc")); - HCalSrc_Token_ = consumes( - iPSet.getParameter("HCalSrc")); - HBHEDigi_Token_ = consumes>( - iPSet.getParameter("HCalDigi")); - HODigi_Token_ = consumes>( - iPSet.getParameter("HCalDigi")); - HFDigi_Token_ = consumes>( - iPSet.getParameter("HCalDigi")); - SiStripSrc_Token_ = consumes>( - iPSet.getParameter("SiStripSrc")); - SiPxlSrc_Token_ = consumes>( - iPSet.getParameter("SiPxlSrc")); - MuDTSrc_Token_ = - consumes(iPSet.getParameter("MuDTSrc")); - MuCSCStripSrc_Token_ = consumes( - iPSet.getParameter("MuCSCStripSrc")); - MuCSCWireSrc_Token_ = consumes( - iPSet.getParameter("MuCSCWireSrc")); + ECalEBSrc_Token_ = consumes(iPSet.getParameter("ECalEBSrc")); + ECalEESrc_Token_ = consumes(iPSet.getParameter("ECalEESrc")); + ECalESSrc_Token_ = consumes(iPSet.getParameter("ECalESSrc")); + HCalSrc_Token_ = consumes(iPSet.getParameter("HCalSrc")); + HBHEDigi_Token_ = consumes>(iPSet.getParameter("HCalDigi")); + HODigi_Token_ = consumes>(iPSet.getParameter("HCalDigi")); + HFDigi_Token_ = consumes>(iPSet.getParameter("HCalDigi")); + SiStripSrc_Token_ = consumes>(iPSet.getParameter("SiStripSrc")); + SiPxlSrc_Token_ = consumes>(iPSet.getParameter("SiPxlSrc")); + MuDTSrc_Token_ = consumes(iPSet.getParameter("MuDTSrc")); + MuCSCStripSrc_Token_ = consumes(iPSet.getParameter("MuCSCStripSrc")); + MuCSCWireSrc_Token_ = consumes(iPSet.getParameter("MuCSCWireSrc")); // const std::string barrelHitsName("EcalHitsEB"); const std::string endcapHitsName("EcalHitsEE"); const std::string preshowerHitsName("EcalHitsES"); - EBHits_Token_ = consumes>( - edm::InputTag(std::string("mix"), std::string("barrelHitsName"))); - EEHits_Token_ = consumes>( - edm::InputTag(std::string("mix"), std::string("endcapHitsName"))); - ESHits_Token_ = consumes>( - edm::InputTag(std::string("mix"), std::string("preshowerHitsName"))); + EBHits_Token_ = consumes>(edm::InputTag(std::string("mix"), std::string("barrelHitsName"))); + EEHits_Token_ = consumes>(edm::InputTag(std::string("mix"), std::string("endcapHitsName"))); + ESHits_Token_ = + consumes>(edm::InputTag(std::string("mix"), std::string("preshowerHitsName"))); // use value of first digit to determine default output level (inclusive) // 0 is none, 1 is basic, 2 is fill output, 3 is gather output @@ -82,36 +72,27 @@ GlobalDigisProducer::GlobalDigisProducer(const edm::ParameterSet &iPSet) // print out Parameter Set information being used if (verbosity >= 0) { - edm::LogInfo(MsgLoggerCat) - << "\n===============================\n" - << "Initialized as EDProducer with parameter values:\n" - << " Name = " << fName << "\n" - << " Verbosity = " << verbosity << "\n" - << " Frequency = " << frequency << "\n" - << " Label = " << label << "\n" - << " GetProv = " << getAllProvenances << "\n" - << " PrintProv = " << printProvenanceInfo << "\n" - << " ECalEBSrc = " << ECalEBSrc_.label() << ":" - << ECalEBSrc_.instance() << "\n" - << " ECalEESrc = " << ECalEESrc_.label() << ":" - << ECalEESrc_.instance() << "\n" - << " ECalESSrc = " << ECalESSrc_.label() << ":" - << ECalESSrc_.instance() << "\n" - << " HCalSrc = " << HCalSrc_.label() << ":" - << HCalSrc_.instance() << "\n" - << " HCalDigi = " << HCalDigi_.label() << ":" - << HCalDigi_.instance() << "\n" - << " SiStripSrc = " << SiStripSrc_.label() << ":" - << SiStripSrc_.instance() << "\n" - << " SiPixelSrc = " << SiPxlSrc_.label() << ":" - << SiPxlSrc_.instance() << "\n" - << " MuDTSrc = " << MuDTSrc_.label() << ":" - << MuDTSrc_.instance() << "\n" - << " MuCSCStripSrc = " << MuCSCStripSrc_.label() << ":" - << MuCSCStripSrc_.instance() << "\n" - << " MuCSCWireSrc = " << MuCSCWireSrc_.label() << ":" - << MuCSCWireSrc_.instance() << "\n" - << "===============================\n"; + edm::LogInfo(MsgLoggerCat) << "\n===============================\n" + << "Initialized as EDProducer with parameter values:\n" + << " Name = " << fName << "\n" + << " Verbosity = " << verbosity << "\n" + << " Frequency = " << frequency << "\n" + << " Label = " << label << "\n" + << " GetProv = " << getAllProvenances << "\n" + << " PrintProv = " << printProvenanceInfo << "\n" + << " ECalEBSrc = " << ECalEBSrc_.label() << ":" << ECalEBSrc_.instance() << "\n" + << " ECalEESrc = " << ECalEESrc_.label() << ":" << ECalEESrc_.instance() << "\n" + << " ECalESSrc = " << ECalESSrc_.label() << ":" << ECalESSrc_.instance() << "\n" + << " HCalSrc = " << HCalSrc_.label() << ":" << HCalSrc_.instance() << "\n" + << " HCalDigi = " << HCalDigi_.label() << ":" << HCalDigi_.instance() << "\n" + << " SiStripSrc = " << SiStripSrc_.label() << ":" << SiStripSrc_.instance() << "\n" + << " SiPixelSrc = " << SiPxlSrc_.label() << ":" << SiPxlSrc_.instance() << "\n" + << " MuDTSrc = " << MuDTSrc_.label() << ":" << MuDTSrc_.instance() << "\n" + << " MuCSCStripSrc = " << MuCSCStripSrc_.label() << ":" << MuCSCStripSrc_.instance() + << "\n" + << " MuCSCWireSrc = " << MuCSCWireSrc_.label() << ":" << MuCSCWireSrc_.instance() + << "\n" + << "===============================\n"; } // set default constants @@ -147,10 +128,9 @@ void GlobalDigisProducer::beginJob(void) { // ECalendcapADCtoGeV_ = agc->getEEValue(); if (verbosity >= 0) { - edm::LogInfo(MsgLoggerCat) - << "Modified Calorimeter gain constants: g0 = " << ECalgainConv_[0] - << ", g1 = " << ECalgainConv_[1] << ", g2 = " << ECalgainConv_[2] - << ", g3 = " << ECalgainConv_[3]; + edm::LogInfo(MsgLoggerCat) << "Modified Calorimeter gain constants: g0 = " << ECalgainConv_[0] + << ", g1 = " << ECalgainConv_[1] << ", g2 = " << ECalgainConv_[2] + << ", g3 = " << ECalgainConv_[3]; // edm::LogInfo(MsgLoggerCat) // << "Modified Calorimeter ADCtoGeV constants: barrel = " // << ECalbarrelADCtoGeV_ << ", endcap = " << ECalendcapADCtoGeV_; @@ -164,13 +144,11 @@ void GlobalDigisProducer::beginJob(void) { void GlobalDigisProducer::endJob() { std::string MsgLoggerCat = "GlobalDigisProducer_endJob"; if (verbosity >= 0) - edm::LogInfo(MsgLoggerCat) - << "Terminating having processed " << count << " events."; + edm::LogInfo(MsgLoggerCat) << "Terminating having processed " << count << " events."; return; } -void GlobalDigisProducer::produce(edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisProducer::produce(edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisProducer_produce"; // keep track of number of events processed @@ -184,9 +162,8 @@ void GlobalDigisProducer::produce(edm::Event &iEvent, ECalbarrelADCtoGeV_ = agc->getEBValue(); ECalendcapADCtoGeV_ = agc->getEEValue(); if (verbosity >= 0) { - edm::LogInfo(MsgLoggerCat) - << "Modified Calorimeter ADCtoGeV constants: barrel = " - << ECalbarrelADCtoGeV_ << ", endcap = " << ECalendcapADCtoGeV_; + edm::LogInfo(MsgLoggerCat) << "Modified Calorimeter ADCtoGeV constants: barrel = " << ECalbarrelADCtoGeV_ + << ", endcap = " << ECalendcapADCtoGeV_; } // get event id information @@ -194,12 +171,11 @@ void GlobalDigisProducer::produce(edm::Event &iEvent, edm::EventNumber_t nevt = iEvent.id().event(); if (verbosity > 0) { - edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " - << nevt << " (" << count << " events total)"; + edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count << " events total)"; } else if (verbosity == 0) { if (nevt % frequency == 0 || nevt == 1) { - edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " - << nevt << " (" << count << " events total)"; + edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count + << " events total)"; } } @@ -208,13 +184,11 @@ void GlobalDigisProducer::produce(edm::Event &iEvent, // look at information available in the event if (getAllProvenances) { - std::vector AllProv; iEvent.getAllStableProvenance(AllProv); if (verbosity >= 0) - edm::LogInfo(MsgLoggerCat) - << "Number of Provenances = " << AllProv.size(); + edm::LogInfo(MsgLoggerCat) << "Number of Provenances = " << AllProv.size(); if (printProvenanceInfo && (verbosity >= 0)) { TString eventout("\nProvenance info:\n"); @@ -279,8 +253,7 @@ void GlobalDigisProducer::produce(edm::Event &iEvent, return; } -void GlobalDigisProducer::fillECal(edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisProducer::fillECal(edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisProducer_fillECal"; TString eventout; @@ -311,25 +284,20 @@ void GlobalDigisProducer::fillECal(edm::Event &iEvent, isBarrel = false; if (isBarrel) { - // loop over simhits iEvent.getByToken(EBHits_Token_, crossingFrame); if (!crossingFrame.isValid()) { - edm::LogWarning(MsgLoggerCat) - << "Unable to find cal barrel crossingFrame in event!"; + edm::LogWarning(MsgLoggerCat) << "Unable to find cal barrel crossingFrame in event!"; return; } // std::unique_ptr > // barrelHits(new MixCollection // (crossingFrame.product(), barrelHitsName)); - std::unique_ptr> barrelHits( - new MixCollection(crossingFrame.product())); + std::unique_ptr> barrelHits(new MixCollection(crossingFrame.product())); // keep track of sum of simhit energy in each crystal MapType ebSimMap; - for (MixCollection::MixItr hitItr = barrelHits->begin(); - hitItr != barrelHits->end(); ++hitItr) { - + for (MixCollection::MixItr hitItr = barrelHits->begin(); hitItr != barrelHits->end(); ++hitItr) { EBDetId ebid = EBDetId(hitItr->id()); uint32_t crystid = ebid.rawId(); @@ -380,26 +348,21 @@ void GlobalDigisProducer::fillECal(edm::Event &iEvent, EcalMGPASample thisSample = ebdf[sample]; ebADCCounts[sample] = (thisSample.adc()); ebADCGains[sample] = (thisSample.gainId()); - ebAnalogSignal[sample] = - (ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * - ECalbarrelADCtoGeV_); + ebAnalogSignal[sample] = (ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_); if (Emax < ebAnalogSignal[sample]) { Emax = ebAnalogSignal[sample]; Pmax = sample; } if (sample < 3) { pedestalPreSample += ebADCCounts[sample]; - pedestalPreSampleAnalog += ebADCCounts[sample] * - ECalgainConv_[(int)ebADCGains[sample]] * - ECalbarrelADCtoGeV_; + pedestalPreSampleAnalog += ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]] * ECalbarrelADCtoGeV_; } } pedestalPreSample /= 3.; pedestalPreSampleAnalog /= 3.; // calculate pedestal subtracted digi energy in the crystal - double Erec = - Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)ebADCGains[Pmax]]; + double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)ebADCGains[Pmax]]; // gather necessary information EBCalAEE.push_back(Erec); @@ -427,25 +390,20 @@ void GlobalDigisProducer::fillECal(edm::Event &iEvent, isEndCap = false; if (isEndCap) { - // loop over simhits iEvent.getByToken(EEHits_Token_, crossingFrame); if (!crossingFrame.isValid()) { - edm::LogWarning(MsgLoggerCat) - << "Unable to find cal endcap crossingFrame in event!"; + edm::LogWarning(MsgLoggerCat) << "Unable to find cal endcap crossingFrame in event!"; return; } // std::unique_ptr > // endcapHits(new MixCollection // (crossingFrame.product(), endcapHitsName)); - std::unique_ptr> endcapHits( - new MixCollection(crossingFrame.product())); + std::unique_ptr> endcapHits(new MixCollection(crossingFrame.product())); // keep track of sum of simhit energy in each crystal MapType eeSimMap; - for (MixCollection::MixItr hitItr = endcapHits->begin(); - hitItr != endcapHits->end(); ++hitItr) { - + for (MixCollection::MixItr hitItr = endcapHits->begin(); hitItr != endcapHits->end(); ++hitItr) { EEDetId eeid = EEDetId(hitItr->id()); uint32_t crystid = eeid.rawId(); @@ -468,7 +426,6 @@ void GlobalDigisProducer::fillECal(edm::Event &iEvent, // digis != endcapDigi->end(); // ++digis) { for (unsigned int digis = 0; digis < EcalDigiEE->size(); ++digis) { - ++i; EEDataFrame eedf = (*endcapDigi)[digis]; @@ -497,26 +454,21 @@ void GlobalDigisProducer::fillECal(edm::Event &iEvent, eeADCCounts[sample] = (thisSample.adc()); eeADCGains[sample] = (thisSample.gainId()); - eeAnalogSignal[sample] = - (eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * - ECalbarrelADCtoGeV_); + eeAnalogSignal[sample] = (eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_); if (Emax < eeAnalogSignal[sample]) { Emax = eeAnalogSignal[sample]; Pmax = sample; } if (sample < 3) { pedestalPreSample += eeADCCounts[sample]; - pedestalPreSampleAnalog += eeADCCounts[sample] * - ECalgainConv_[(int)eeADCGains[sample]] * - ECalbarrelADCtoGeV_; + pedestalPreSampleAnalog += eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]] * ECalbarrelADCtoGeV_; } } pedestalPreSample /= 3.; pedestalPreSampleAnalog /= 3.; // calculate pedestal subtracted digi energy in the crystal - double Erec = - Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)eeADCGains[Pmax]]; + double Erec = Emax - pedestalPreSampleAnalog * ECalgainConv_[(int)eeADCGains[Pmax]]; // gather necessary information EECalAEE.push_back(Erec); @@ -544,25 +496,20 @@ void GlobalDigisProducer::fillECal(edm::Event &iEvent, isPreshower = false; if (isPreshower) { - // loop over simhits iEvent.getByToken(ESHits_Token_, crossingFrame); if (!crossingFrame.isValid()) { - edm::LogWarning(MsgLoggerCat) - << "Unable to find cal preshower crossingFrame in event!"; + edm::LogWarning(MsgLoggerCat) << "Unable to find cal preshower crossingFrame in event!"; return; } // std::unique_ptr > // preshowerHits(new MixCollection // (crossingFrame.product(), preshowerHitsName)); - std::unique_ptr> preshowerHits( - new MixCollection(crossingFrame.product())); + std::unique_ptr> preshowerHits(new MixCollection(crossingFrame.product())); // keep track of sum of simhit energy in each crystal MapType esSimMap; - for (MixCollection::MixItr hitItr = preshowerHits->begin(); - hitItr != preshowerHits->end(); ++hitItr) { - + for (MixCollection::MixItr hitItr = preshowerHits->begin(); hitItr != preshowerHits->end(); ++hitItr) { ESDetId esid = ESDetId(hitItr->id()); uint32_t crystid = esid.rawId(); @@ -597,7 +544,6 @@ void GlobalDigisProducer::fillECal(edm::Event &iEvent, // gether ADC counts for (int sample = 0; sample < nrSamples; ++sample) { - ESSample thisSample = esdf[sample]; // for (int sample = 0; sample < digis->size(); ++sample) { esADCCounts[sample] = (thisSample.adc()); @@ -670,8 +616,7 @@ void GlobalDigisProducer::storeECal(PGlobalDigi &product) { return; } -void GlobalDigisProducer::fillHCal(edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisProducer::fillHCal(edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisProducer_fillHCal"; TString eventout; @@ -703,9 +648,8 @@ void GlobalDigisProducer::fillHCal(edm::Event &iEvent, MapType fHEEnergySimHits; MapType fHOEnergySimHits; MapType fHFEnergySimHits; - for (std::vector::const_iterator simhits = simhitResult->begin(); - simhits != simhitResult->end(); ++simhits) { - + for (std::vector::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); + ++simhits) { HcalDetId detId(simhits->id()); uint32_t cellid = detId.rawId(); @@ -740,10 +684,8 @@ void GlobalDigisProducer::fillHCal(edm::Event &iEvent, HcalDetId cell(ihbhe->id()); if ((cell.subdet() == sdHcalBrl) || (cell.subdet() == sdHcalEC)) { - // HCalconditions->makeHcalCalibration(cell, &calibrations); - const HcalCalibrations &calibrations = - HCalconditions->getHcalCalibrations(cell); + const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell); const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell); const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder); @@ -752,7 +694,6 @@ void GlobalDigisProducer::fillHCal(edm::Event &iEvent, // get HB info if (cell.subdet() == sdHcalBrl) { - ++iHB; float fDigiSum = 0.0; for (int ii = 0; ii < tool.size(); ++ii) { @@ -767,7 +708,6 @@ void GlobalDigisProducer::fillHCal(edm::Event &iEvent, // get HE info if (cell.subdet() == sdHcalEC) { - ++iHE; float fDigiSum = 0.0; for (int ii = 0; ii < tool.size(); ++ii) { @@ -807,10 +747,8 @@ void GlobalDigisProducer::fillHCal(edm::Event &iEvent, HcalDetId cell(iho->id()); if (cell.subdet() == sdHcalOut) { - // HCalconditions->makeHcalCalibration(cell, &calibrations); - const HcalCalibrations &calibrations = - HCalconditions->getHcalCalibrations(cell); + const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell); const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell); const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder); @@ -851,10 +789,8 @@ void GlobalDigisProducer::fillHCal(edm::Event &iEvent, HcalDetId cell(ihf->id()); if (cell.subdet() == sdHcalFwd) { - // HCalconditions->makeHcalCalibration(cell, &calibrations); - const HcalCalibrations &calibrations = - HCalconditions->getHcalCalibrations(cell); + const HcalCalibrations &calibrations = HCalconditions->getHcalCalibrations(cell); const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell); const HcalQIEShape *shape = HCalconditions->getHcalShape(channelCoder); @@ -937,8 +873,7 @@ void GlobalDigisProducer::storeHCal(PGlobalDigi &product) { return; } -void GlobalDigisProducer::fillTrk(edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisProducer::fillTrk(edm::Event &iEvent, const edm::EventSetup &iSetup) { // Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; iSetup.get().get(tTopoHandle); @@ -969,7 +904,6 @@ void GlobalDigisProducer::fillTrk(edm::Event &iEvent, // get TIB if (detId.subdetId() == sdSiTIB) { - for (iter = begin; iter != end; ++iter) { ++nStripBrl; if (tTopo->tibLayer(id) == 1) { @@ -993,7 +927,6 @@ void GlobalDigisProducer::fillTrk(edm::Event &iEvent, // get TOB if (detId.subdetId() == sdSiTOB) { - for (iter = begin; iter != end; ++iter) { ++nStripBrl; if (tTopo->tobLayer(id) == 1) { @@ -1017,7 +950,6 @@ void GlobalDigisProducer::fillTrk(edm::Event &iEvent, // get TID if (detId.subdetId() == sdSiTID) { - for (iter = begin; iter != end; ++iter) { ++nStripFwd; if (tTopo->tidWheel(id) == 1) { @@ -1037,7 +969,6 @@ void GlobalDigisProducer::fillTrk(edm::Event &iEvent, // get TEC if (detId.subdetId() == sdSiTEC) { - for (iter = begin; iter != end; ++iter) { ++nStripFwd; if (tTopo->tecWheel(id) == 1) { @@ -1074,7 +1005,7 @@ void GlobalDigisProducer::fillTrk(edm::Event &iEvent, } } } - } // end loop over DataSetVector + } // end loop over DataSetVector if (verbosity > 1) { eventout += "\n Number of BrlStripDigis collected:........ "; @@ -1105,7 +1036,6 @@ void GlobalDigisProducer::fillTrk(edm::Event &iEvent, // get Barrel pixels if (detId.subdetId() == sdPxlBrl) { - for (iter = begin; iter != end; ++iter) { ++nPxlBrl; if (tTopo->pxbLayer(id) == 1) { @@ -1128,7 +1058,6 @@ void GlobalDigisProducer::fillTrk(edm::Event &iEvent, // get Forward pixels if (detId.subdetId() == sdPxlFwd) { - for (iter = begin; iter != end; ++iter) { ++nPxlFwd; if (tTopo->pxfDisk(id) == 1) { @@ -1179,7 +1108,6 @@ void GlobalDigisProducer::storeTrk(PGlobalDigi &product) { std::string MsgLoggerCat = "GlobalDigisProducer_storeTrk"; if (verbosity > 2) { - // strip output TString eventout("\n nTIBL1 = "); eventout += TIBL1ADC.size(); @@ -1468,8 +1396,7 @@ void GlobalDigisProducer::storeTrk(PGlobalDigi &product) { return; } -void GlobalDigisProducer::fillMuon(edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalDigisProducer::fillMuon(edm::Event &iEvent, const edm::EventSetup &iSetup) { std::string MsgLoggerCat = "GlobalDigisProducer_fillMuon"; TString eventout; @@ -1487,13 +1414,10 @@ void GlobalDigisProducer::fillMuon(edm::Event &iEvent, int nDt = 0; DTDigiCollection::DigiRangeIterator detUnitIt; for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) { - const DTLayerId &id = (*detUnitIt).first; const DTDigiCollection::Range &range = (*detUnitIt).second; - for (DTDigiCollection::const_iterator digiIt = range.first; - digiIt != range.second; ++digiIt) { - + for (DTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { ++nDt; DTWireId wireId(id, (*digiIt).wire()); @@ -1534,9 +1458,7 @@ void GlobalDigisProducer::fillMuon(edm::Event &iEvent, } int nStrips = 0; - for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); - j != strips->end(); ++j) { - + for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); ++j) { std::vector::const_iterator digiItr = (*j).second.first; std::vector::const_iterator last = (*j).second.second; @@ -1572,9 +1494,7 @@ void GlobalDigisProducer::fillMuon(edm::Event &iEvent, } int nWires = 0; - for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); - j != wires->end(); ++j) { - + for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); ++j) { std::vector::const_iterator digiItr = (*j).second.first; std::vector::const_iterator endDigi = (*j).second.second; @@ -1600,7 +1520,6 @@ void GlobalDigisProducer::storeMuon(PGlobalDigi &product) { std::string MsgLoggerCat = "GlobalDigisProducer_storeMuon"; if (verbosity > 2) { - // dt output TString eventout("\n nMB1 = "); eventout += MB1SLayer.size(); diff --git a/Validation/HcalHits/interface/HcalSimHitStudy.h b/Validation/HcalHits/interface/HcalSimHitStudy.h index 77d44f8af8af0..4df511a22584b 100644 --- a/Validation/HcalHits/interface/HcalSimHitStudy.h +++ b/Validation/HcalHits/interface/HcalSimHitStudy.h @@ -33,8 +33,7 @@ class HcalSimHitStudy : public DQMEDAnalyzer { HcalSimHitStudy(const edm::ParameterSet &ps); ~HcalSimHitStudy() override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; protected: // void endJob (); @@ -66,20 +65,16 @@ class HcalSimHitStudy : public DQMEDAnalyzer { MonitorElement *meAllNHit_, *meBadDetHit_, *meBadSubHit_, *meBadIdHit_; MonitorElement *meHBNHit_, *meHENHit_, *meHONHit_, *meHFNHit_; - MonitorElement *meDetectHit_, *meSubdetHit_, *meDepthHit_, *meEtaHit_, - *meEtaPhiHit_; + MonitorElement *meDetectHit_, *meSubdetHit_, *meDepthHit_, *meEtaHit_, *meEtaPhiHit_; std::vector meEtaPhiHitDepth_; - MonitorElement *mePhiHit_, *mePhiHitb_, *meEnergyHit_, *meTimeHit_, - *meTimeWHit_; - MonitorElement *meHBDepHit_, *meHEDepHit_, *meHODepHit_, *meHFDepHit_, - *meHFDepHitw_; + MonitorElement *mePhiHit_, *mePhiHitb_, *meEnergyHit_, *meTimeHit_, *meTimeWHit_; + MonitorElement *meHBDepHit_, *meHEDepHit_, *meHODepHit_, *meHFDepHit_, *meHFDepHitw_; MonitorElement *meHBEtaHit_, *meHEEtaHit_, *meHOEtaHit_, *meHFEtaHit_; MonitorElement *meHBPhiHit_, *meHEPhiHit_, *meHOPhiHit_, *meHFPhiHit_; MonitorElement *meHBEneHit_, *meHEEneHit_, *meHOEneHit_, *meHFEneHit_; MonitorElement *meHBEneMap_, *meHEEneMap_, *meHOEneMap_, *meHFEneMap_; MonitorElement *meHBEneSum_, *meHEEneSum_, *meHOEneSum_, *meHFEneSum_; - MonitorElement *meHBEneSum_vs_ieta_, *meHEEneSum_vs_ieta_, - *meHOEneSum_vs_ieta_, *meHFEneSum_vs_ieta_; + MonitorElement *meHBEneSum_vs_ieta_, *meHEEneSum_vs_ieta_, *meHOEneSum_vs_ieta_, *meHFEneSum_vs_ieta_; MonitorElement *meHBTimHit_, *meHETimHit_, *meHOTimHit_, *meHFTimHit_; MonitorElement *meHBEneHit2_, *meHEEneHit2_, *meHOEneHit2_, *meHFEneHit2_; MonitorElement *meHBL10Ene_, *meHEL10Ene_, *meHOL10Ene_, *meHFL10Ene_; diff --git a/Validation/HcalHits/interface/HcalSimHitsClient.h b/Validation/HcalHits/interface/HcalSimHitsClient.h index 60737054237c9..31b31132fbfa2 100644 --- a/Validation/HcalHits/interface/HcalSimHitsClient.h +++ b/Validation/HcalHits/interface/HcalSimHitsClient.h @@ -34,7 +34,6 @@ class MonitorElement; class HcalSimHitsClient : public DQMEDHarvester { - private: int SimHitsEndjob(const std::vector &hcalMEs); std::vector getHistogramTypes(); diff --git a/Validation/HcalHits/interface/HcalSimHitsValidation.h b/Validation/HcalHits/interface/HcalSimHitsValidation.h index 54ce4c93a26fd..e3c82c43f4ecb 100644 --- a/Validation/HcalHits/interface/HcalSimHitsValidation.h +++ b/Validation/HcalHits/interface/HcalSimHitsValidation.h @@ -40,13 +40,11 @@ #include class HcalSimHitsValidation : public DQMEDAnalyzer { - public: HcalSimHitsValidation(edm::ParameterSet const &conf); ~HcalSimHitsValidation() override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(edm::Event const &ev, edm::EventSetup const &c) override; void endJob() override; diff --git a/Validation/HcalHits/interface/SimG4HcalHitCluster.h b/Validation/HcalHits/interface/SimG4HcalHitCluster.h index 85da525860e9e..3c0fb1bb356cd 100644 --- a/Validation/HcalHits/interface/SimG4HcalHitCluster.h +++ b/Validation/HcalHits/interface/SimG4HcalHitCluster.h @@ -10,7 +10,6 @@ #include class SimG4HcalHitCluster { - public: SimG4HcalHitCluster(); virtual ~SimG4HcalHitCluster(); diff --git a/Validation/HcalHits/interface/SimG4HcalHitJetFinder.h b/Validation/HcalHits/interface/SimG4HcalHitJetFinder.h index 5588236dce040..70bc620f385b6 100644 --- a/Validation/HcalHits/interface/SimG4HcalHitJetFinder.h +++ b/Validation/HcalHits/interface/SimG4HcalHitJetFinder.h @@ -11,7 +11,6 @@ #include class SimG4HcalHitJetFinder { - public: SimG4HcalHitJetFinder(double cone = 0.5); virtual ~SimG4HcalHitJetFinder(); diff --git a/Validation/HcalHits/interface/SimG4HcalValidation.h b/Validation/HcalHits/interface/SimG4HcalValidation.h index c4f420cb1a540..348ee1ec27384 100644 --- a/Validation/HcalHits/interface/SimG4HcalValidation.h +++ b/Validation/HcalHits/interface/SimG4HcalValidation.h @@ -28,7 +28,7 @@ class BeginOfEvent; class EndOfEvent; namespace edm { -class ParameterSet; + class ParameterSet; } class SimG4HcalValidation : public SimProducer, @@ -37,7 +37,6 @@ class SimG4HcalValidation : public SimProducer, public Observer, public Observer, public Observer { - public: SimG4HcalValidation(const edm::ParameterSet &p); ~SimG4HcalValidation() override; @@ -45,7 +44,7 @@ class SimG4HcalValidation : public SimProducer, void produce(edm::Event &, const edm::EventSetup &) override; private: - SimG4HcalValidation(const SimG4HcalValidation &) = delete; // stop default + SimG4HcalValidation(const SimG4HcalValidation &) = delete; // stop default const SimG4HcalValidation &operator=(const SimG4HcalValidation &) = delete; void init(); @@ -78,7 +77,7 @@ class SimG4HcalValidation : public SimProducer, HcalTestNumberingScheme *org; // Hit cache for cluster analysis - std::vector hitcache; // e, eta, phi, time, layer, calo type + std::vector hitcache; // e, eta, phi, time, layer, calo type // scale factors : std::vector scaleHB; @@ -101,7 +100,7 @@ class SimG4HcalValidation : public SimProducer, unsigned int count; double edepEB, edepEE, edepHB, edepHE, edepHO; double edepd[5], edepl[20]; - double een, hen, hoen; // Energy sum in ECAL, HCAL, HO + double een, hen, hoen; // Energy sum in ECAL, HCAL, HO double vhitec, vhithc, enEcal, enHcal; }; diff --git a/Validation/HcalHits/interface/SimHitsValidationHcal.h b/Validation/HcalHits/interface/SimHitsValidationHcal.h index a7ad1bfb11f7d..8fe63e25cbbac 100644 --- a/Validation/HcalHits/interface/SimHitsValidationHcal.h +++ b/Validation/HcalHits/interface/SimHitsValidationHcal.h @@ -34,8 +34,7 @@ class SimHitsValidationHcal : public DQMEDAnalyzer { protected: void analyze(const edm::Event &e, const edm::EventSetup &c) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyzeHits(std::vector &); diff --git a/Validation/HcalHits/interface/ZdcSimHitStudy.h b/Validation/HcalHits/interface/ZdcSimHitStudy.h index 922bd0e395145..0b8e02ffbba4e 100644 --- a/Validation/HcalHits/interface/ZdcSimHitStudy.h +++ b/Validation/HcalHits/interface/ZdcSimHitStudy.h @@ -62,13 +62,11 @@ class ZdcSimHitStudy : public DQMEDAnalyzer { protected: void endRun(const edm::Run &run, const edm::EventSetup &c) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(const edm::Event &e, const edm::EventSetup &c) override; void analyzeHits(std::vector &); - int FillHitValHist(int side, int section, int channel, double energy, - double time); + int FillHitValHist(int side, int section, int channel, double energy, double time); private: double enetotEmN, enetotHadN, enetotN; @@ -86,33 +84,22 @@ class ZdcSimHitStudy : public DQMEDAnalyzer { edm::EDGetTokenT tok_hits_; bool verbose_, checkHit_; - MonitorElement *meAllZdcNHit_, *meBadZdcDetHit_, *meBadZdcSecHit_, - *meBadZdcIdHit_; + MonitorElement *meAllZdcNHit_, *meBadZdcDetHit_, *meBadZdcSecHit_, *meBadZdcIdHit_; MonitorElement *meZdcNHit_, *meZdcDetectHit_, *meZdcSideHit_, *meZdcETime_; MonitorElement *meZdcNHitEM_, *meZdcNHitHad_, *meZdcNHitLum_, *meZdc10Ene_; - MonitorElement *meZdcSectionHit_, *meZdcChannelHit_, *meZdcEnergyHit_, - *meZdcTimeWHit_; - MonitorElement *meZdcHadEnergyHit_, *meZdcEMEnergyHit_, *meZdcTimeHit_, - *meZdcHadL10EneP_; + MonitorElement *meZdcSectionHit_, *meZdcChannelHit_, *meZdcEnergyHit_, *meZdcTimeWHit_; + MonitorElement *meZdcHadEnergyHit_, *meZdcEMEnergyHit_, *meZdcTimeHit_, *meZdcHadL10EneP_; MonitorElement *meZdc10EneP_, *meZdcEHadCh_, *meZdcEEMCh_, *meZdcEML10EneP_; - MonitorElement *meZdcEneEmN1_, *meZdcEneEmN2_, *meZdcEneEmN3_, *meZdcEneEmN4_, - *meZdcEneEmN5_; - MonitorElement *meZdcEneHadN1_, *meZdcEneHadN2_, *meZdcEneHadN3_, - *meZdcEneHadN4_; - MonitorElement *meZdcEneTEmN1_, *meZdcEneTEmN2_, *meZdcEneTEmN3_, - *meZdcEneTEmN4_, *meZdcEneTEmN5_; - MonitorElement *meZdcEneTHadN1_, *meZdcEneTHadN2_, *meZdcEneTHadN3_, - *meZdcEneTHadN4_; + MonitorElement *meZdcEneEmN1_, *meZdcEneEmN2_, *meZdcEneEmN3_, *meZdcEneEmN4_, *meZdcEneEmN5_; + MonitorElement *meZdcEneHadN1_, *meZdcEneHadN2_, *meZdcEneHadN3_, *meZdcEneHadN4_; + MonitorElement *meZdcEneTEmN1_, *meZdcEneTEmN2_, *meZdcEneTEmN3_, *meZdcEneTEmN4_, *meZdcEneTEmN5_; + MonitorElement *meZdcEneTHadN1_, *meZdcEneTHadN2_, *meZdcEneTHadN3_, *meZdcEneTHadN4_; MonitorElement *meZdcEneHadNTot_, *meZdcEneEmNTot_, *meZdcEneNTot_; MonitorElement *meZdcCorEEmNEHadN_; - MonitorElement *meZdcEneEmP1_, *meZdcEneEmP2_, *meZdcEneEmP3_, *meZdcEneEmP4_, - *meZdcEneEmP5_; - MonitorElement *meZdcEneHadP1_, *meZdcEneHadP2_, *meZdcEneHadP3_, - *meZdcEneHadP4_; - MonitorElement *meZdcEneTEmP1_, *meZdcEneTEmP2_, *meZdcEneTEmP3_, - *meZdcEneTEmP4_, *meZdcEneTEmP5_; - MonitorElement *meZdcEneTHadP1_, *meZdcEneTHadP2_, *meZdcEneTHadP3_, - *meZdcEneTHadP4_; + MonitorElement *meZdcEneEmP1_, *meZdcEneEmP2_, *meZdcEneEmP3_, *meZdcEneEmP4_, *meZdcEneEmP5_; + MonitorElement *meZdcEneHadP1_, *meZdcEneHadP2_, *meZdcEneHadP3_, *meZdcEneHadP4_; + MonitorElement *meZdcEneTEmP1_, *meZdcEneTEmP2_, *meZdcEneTEmP3_, *meZdcEneTEmP4_, *meZdcEneTEmP5_; + MonitorElement *meZdcEneTHadP1_, *meZdcEneTHadP2_, *meZdcEneTHadP3_, *meZdcEneTHadP4_; MonitorElement *meZdcEneHadPTot_, *meZdcEneEmPTot_, *meZdcEnePTot_; MonitorElement *meZdcCorEEmPEHadP_, *meZdcCorEtotNEtotP_, *meZdcEneTot_; diff --git a/Validation/HcalHits/src/HcalSimHitStudy.cc b/Validation/HcalHits/src/HcalSimHitStudy.cc index 44ba76e05ddfa..ccb23971777ba 100644 --- a/Validation/HcalHits/src/HcalSimHitStudy.cc +++ b/Validation/HcalHits/src/HcalSimHitStudy.cc @@ -5,7 +5,6 @@ #include "FWCore/Utilities/interface/Exception.h" HcalSimHitStudy::HcalSimHitStudy(const edm::ParameterSet &ps) { - g4Label = ps.getUntrackedParameter("moduleLabel", "g4SimHits"); hcalHits = ps.getUntrackedParameter("HitCollection", "HcalHits"); outFile_ = ps.getUntrackedParameter("outputFile", "hcHit.root"); @@ -14,18 +13,15 @@ HcalSimHitStudy::HcalSimHitStudy(const edm::ParameterSet &ps) { hep17_ = ps.getParameter("hep17"); checkHit_ = true; - tok_hits_ = - consumes(edm::InputTag(g4Label, hcalHits)); + tok_hits_ = consumes(edm::InputTag(g4Label, hcalHits)); - edm::LogInfo("HcalSim") << "Module Label: " << g4Label - << " Hits: " << hcalHits << " / " << checkHit_ + edm::LogInfo("HcalSim") << "Module Label: " << g4Label << " Hits: " << hcalHits << " / " << checkHit_ << " Output: " << outFile_; } HcalSimHitStudy::~HcalSimHitStudy() {} -void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, - edm::EventSetup const &es) { +void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, edm::EventSetup const &es) { edm::ESHandle pHRNDC; es.get().get(pHRNDC); hcons = &(*pHRNDC); @@ -93,8 +89,7 @@ void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, // Histograms for Hits if (checkHit_) { - meAllNHit_ = - ib.book1D("Hit01", "Number of Hits in HCal", 20000, 0., 20000.); + meAllNHit_ = ib.book1D("Hit01", "Number of Hits in HCal", 20000, 0., 20000.); meBadDetHit_ = ib.book1D("Hit02", "Hits with wrong Det", 100, 0., 100.); meBadSubHit_ = ib.book1D("Hit03", "Hits with wrong Subdet", 100, 0., 100.); meBadIdHit_ = ib.book1D("Hit04", "Hits with wrong ID", 100, 0., 100.); @@ -105,24 +100,19 @@ void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, meDetectHit_ = ib.book1D("Hit09", "Detector ID", 50, 0., 50.); meSubdetHit_ = ib.book1D("Hit10", "Subdetectors in HCal", 50, 0., 50.); meDepthHit_ = ib.book1D("Hit11", "Depths in HCal", 20, 0., 20.); - meEtaHit_ = ib.book1D("Hit12", "Eta in HCal", ieta_bins_HF, ieta_min_HF, - ieta_max_HF); + meEtaHit_ = ib.book1D("Hit12", "Eta in HCal", ieta_bins_HF, ieta_min_HF, ieta_max_HF); meEtaPhiHit_ = - ib.book2D("Hit12b", "Eta-phi in HCal", ieta_bins_HF, ieta_min_HF, - ieta_max_HF, iphi_bins, iphi_min, iphi_max); + ib.book2D("Hit12b", "Eta-phi in HCal", ieta_bins_HF, ieta_min_HF, ieta_max_HF, iphi_bins, iphi_min, iphi_max); for (int depth = 1; depth <= maxDepth_; depth++) { sprintf(hname, "Hit12bd%d", depth); sprintf(htitle, "Eta-phi in HCal d%d", depth); - meEtaPhiHitDepth_.push_back(ib.book2D(hname, htitle, ieta_bins_HF, - ieta_min_HF, ieta_max_HF, iphi_bins, - iphi_min, iphi_max)); + meEtaPhiHitDepth_.push_back( + ib.book2D(hname, htitle, ieta_bins_HF, ieta_min_HF, ieta_max_HF, iphi_bins, iphi_min, iphi_max)); } // KC: There are different phi segmentation schemes, this plot uses wider // bins to represent the most sparse segmentation - mePhiHit_ = ib.book1D("Hit13", "Phi in HCal (HB,HO)", iphi_bins, iphi_min, - iphi_max); - mePhiHitb_ = ib.book1D("Hit13b", "Phi in HCal (HE,HF)", iphi_bins, iphi_min, - iphi_max); + mePhiHit_ = ib.book1D("Hit13", "Phi in HCal (HB,HO)", iphi_bins, iphi_min, iphi_max); + mePhiHitb_ = ib.book1D("Hit13b", "Phi in HCal (HE,HF)", iphi_bins, iphi_min, iphi_max); meEnergyHit_ = ib.book1D("Hit14", "Energy in HCal", 2000, 0., 20.); meTimeHit_ = ib.book1D("Hit15", "Time in HCal", 528, 0., 528.); meTimeWHit_ = ib.book1D("Hit16", "Time in HCal (E wtd)", 528, 0., 528.); @@ -130,24 +120,15 @@ void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, meHEDepHit_ = ib.book1D("Hit18", "Depths in HE", 20, 0., 20.); meHODepHit_ = ib.book1D("Hit19", "Depths in HO", 20, 0., 20.); meHFDepHit_ = ib.book1D("Hit20", "Depths in HF", 20, 0., 20.); - meHFDepHitw_ = - ib.book1D("Hit20b", "Depths in HF (p.e. weighted)", 20, 0., 20.); - meHBEtaHit_ = - ib.book1D("Hit21", "Eta in HB", ieta_bins_HB, ieta_min_HB, ieta_max_HB); - meHEEtaHit_ = - ib.book1D("Hit22", "Eta in HE", ieta_bins_HE, ieta_min_HE, ieta_max_HE); - meHOEtaHit_ = - ib.book1D("Hit23", "Eta in HO", ieta_bins_HO, ieta_min_HO, ieta_max_HO); - meHFEtaHit_ = - ib.book1D("Hit24", "Eta in HF", ieta_bins_HF, ieta_min_HF, ieta_max_HF); - meHBPhiHit_ = - ib.book1D("Hit25", "Phi in HB", iphi_bins, iphi_min, iphi_max); - meHEPhiHit_ = - ib.book1D("Hit26", "Phi in HE", iphi_bins, iphi_min, iphi_max); - meHOPhiHit_ = - ib.book1D("Hit27", "Phi in HO", iphi_bins, iphi_min, iphi_max); - meHFPhiHit_ = - ib.book1D("Hit28", "Phi in HF", iphi_bins, iphi_min, iphi_max); + meHFDepHitw_ = ib.book1D("Hit20b", "Depths in HF (p.e. weighted)", 20, 0., 20.); + meHBEtaHit_ = ib.book1D("Hit21", "Eta in HB", ieta_bins_HB, ieta_min_HB, ieta_max_HB); + meHEEtaHit_ = ib.book1D("Hit22", "Eta in HE", ieta_bins_HE, ieta_min_HE, ieta_max_HE); + meHOEtaHit_ = ib.book1D("Hit23", "Eta in HO", ieta_bins_HO, ieta_min_HO, ieta_max_HO); + meHFEtaHit_ = ib.book1D("Hit24", "Eta in HF", ieta_bins_HF, ieta_min_HF, ieta_max_HF); + meHBPhiHit_ = ib.book1D("Hit25", "Phi in HB", iphi_bins, iphi_min, iphi_max); + meHEPhiHit_ = ib.book1D("Hit26", "Phi in HE", iphi_bins, iphi_min, iphi_max); + meHOPhiHit_ = ib.book1D("Hit27", "Phi in HO", iphi_bins, iphi_min, iphi_max); + meHFPhiHit_ = ib.book1D("Hit28", "Phi in HF", iphi_bins, iphi_min, iphi_max); meHBEneHit_ = ib.book1D("Hit29", "Energy in HB", 2000, 0., 20.); meHEEneHit_ = ib.book1D("Hit30", "Energy in HE", 500, 0., 5.); meHEP17EneHit_ = ib.book1D("Hit30b", "Energy in HEP17", 500, 0., 5.); @@ -157,32 +138,28 @@ void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, // HxEneMap, HxEneSum, HxEneSum_vs_ieta plot the sum of the simhits energy // within a single ieta-iphi tower. - meHBEneMap_ = ib.book2D("HBEneMap", "HBEneMap", ieta_bins_HB, ieta_min_HB, - ieta_max_HB, iphi_bins, iphi_min, iphi_max); - meHEEneMap_ = ib.book2D("HEEneMap", "HEEneMap", ieta_bins_HE, ieta_min_HE, - ieta_max_HE, iphi_bins, iphi_min, iphi_max); - meHOEneMap_ = ib.book2D("HOEneMap", "HOEneMap", ieta_bins_HO, ieta_min_HO, - ieta_max_HO, iphi_bins, iphi_min, iphi_max); - meHFEneMap_ = ib.book2D("HFEneMap", "HFEneMap", ieta_bins_HF, ieta_min_HF, - ieta_max_HF, iphi_bins, iphi_min, iphi_max); + meHBEneMap_ = + ib.book2D("HBEneMap", "HBEneMap", ieta_bins_HB, ieta_min_HB, ieta_max_HB, iphi_bins, iphi_min, iphi_max); + meHEEneMap_ = + ib.book2D("HEEneMap", "HEEneMap", ieta_bins_HE, ieta_min_HE, ieta_max_HE, iphi_bins, iphi_min, iphi_max); + meHOEneMap_ = + ib.book2D("HOEneMap", "HOEneMap", ieta_bins_HO, ieta_min_HO, ieta_max_HO, iphi_bins, iphi_min, iphi_max); + meHFEneMap_ = + ib.book2D("HFEneMap", "HFEneMap", ieta_bins_HF, ieta_min_HF, ieta_max_HF, iphi_bins, iphi_min, iphi_max); meHBEneSum_ = ib.book1D("HBEneSum", "HBEneSum", 2000, 0., 20.); meHEEneSum_ = ib.book1D("HEEneSum", "HEEneSum", 500, 0., 5.); meHOEneSum_ = ib.book1D("HOEneSum", "HOEneSum", 500, 0., 5.); meHFEneSum_ = ib.book1D("HFEneSum", "HFEneSum", 1001, -0.5, 1000.5); - meHBEneSum_vs_ieta_ = - ib.bookProfile("HBEneSum_vs_ieta", "HBEneSum_vs_ieta", ieta_bins_HB, - ieta_min_HB, ieta_max_HB, 2011, -10.5, 2000.5, " "); - meHEEneSum_vs_ieta_ = - ib.bookProfile("HEEneSum_vs_ieta", "HEEneSum_vs_ieta", ieta_bins_HE, - ieta_min_HE, ieta_max_HE, 2011, -10.5, 2000.5, " "); - meHOEneSum_vs_ieta_ = - ib.bookProfile("HOEneSum_vs_ieta", "HOEneSum_vs_ieta", ieta_bins_HO, - ieta_min_HO, ieta_max_HO, 2011, -10.5, 2000.5, " "); - meHFEneSum_vs_ieta_ = - ib.bookProfile("HFEneSum_vs_ieta", "HFEneSum_vs_ieta", ieta_bins_HF, - ieta_min_HF, ieta_max_HF, 2011, -10.5, 2000.5, " "); + meHBEneSum_vs_ieta_ = ib.bookProfile( + "HBEneSum_vs_ieta", "HBEneSum_vs_ieta", ieta_bins_HB, ieta_min_HB, ieta_max_HB, 2011, -10.5, 2000.5, " "); + meHEEneSum_vs_ieta_ = ib.bookProfile( + "HEEneSum_vs_ieta", "HEEneSum_vs_ieta", ieta_bins_HE, ieta_min_HE, ieta_max_HE, 2011, -10.5, 2000.5, " "); + meHOEneSum_vs_ieta_ = ib.bookProfile( + "HOEneSum_vs_ieta", "HOEneSum_vs_ieta", ieta_bins_HO, ieta_min_HO, ieta_max_HO, 2011, -10.5, 2000.5, " "); + meHFEneSum_vs_ieta_ = ib.bookProfile( + "HFEneSum_vs_ieta", "HFEneSum_vs_ieta", ieta_bins_HF, ieta_min_HF, ieta_max_HF, 2011, -10.5, 2000.5, " "); meHBTimHit_ = ib.book1D("Hit33", "Time in HB", 528, 0., 528.); meHETimHit_ = ib.book1D("Hit34", "Time in HE", 528, 0., 528.); @@ -198,18 +175,10 @@ void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, meHEL10Ene_ = ib.book1D("Hit42", "Log10Energy in HE", 140, -10., 4.); meHFL10Ene_ = ib.book1D("Hit43", "Log10Energy in HF", 50, -1., 4.); meHOL10Ene_ = ib.book1D("Hit44", "Log10Energy in HO", 140, -10., 4.); - meHBL10EneP_ = - ib.bookProfile("Hit45", "Log10Energy in HB vs Hit contribution", 140, - -10., 4., 100, 0., 1.); - meHEL10EneP_ = - ib.bookProfile("Hit46", "Log10Energy in HE vs Hit contribution", 140, - -10., 4., 100, 0., 1.); - meHFL10EneP_ = - ib.bookProfile("Hit47", "Log10Energy in HF vs Hit contribution", 140, - -10., 4., 100, 0., 1.); - meHOL10EneP_ = - ib.bookProfile("Hit48", "Log10Energy in HO vs Hit contribution", 140, - -10., 4., 100, 0., 1.); + meHBL10EneP_ = ib.bookProfile("Hit45", "Log10Energy in HB vs Hit contribution", 140, -10., 4., 100, 0., 1.); + meHEL10EneP_ = ib.bookProfile("Hit46", "Log10Energy in HE vs Hit contribution", 140, -10., 4., 100, 0., 1.); + meHFL10EneP_ = ib.bookProfile("Hit47", "Log10Energy in HF vs Hit contribution", 140, -10., 4., 100, 0., 1.); + meHOL10EneP_ = ib.bookProfile("Hit48", "Log10Energy in HO vs Hit contribution", 140, -10., 4., 100, 0., 1.); } } @@ -218,9 +187,7 @@ void HcalSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, }*/ void HcalSimHitStudy::analyze(const edm::Event &e, const edm::EventSetup &) { - - LogDebug("HcalSim") << "Run = " << e.id().run() - << " Event = " << e.id().event(); + LogDebug("HcalSim") << "Run = " << e.id().run() << " Event = " << e.id().event(); std::vector caloHits; edm::Handle hitsHcal; @@ -242,7 +209,6 @@ void HcalSimHitStudy::analyze(const edm::Event &e, const edm::EventSetup &) { } void HcalSimHitStudy::analyzeHits(std::vector &hits) { - int nHit = hits.size(); int nHB = 0, nHE = 0, nHO = 0, nHF = 0, nBad1 = 0, nBad2 = 0, nBad = 0; std::vector encontHB(140, 0.); @@ -304,11 +270,10 @@ void HcalSimHitStudy::analyzeHits(std::vector &hits) { eta = hid.ieta(); phi = hid.iphi(); - LogDebug("HcalSim") << "Hit[" << i << "] ID " << std::hex << id_ << std::dec - << " Det " << det << " Sub " << subdet << " depth " - << depth << " Eta " << eta << " Phi " << phi << " E " - << energy << " time " << time; - if (det == 4) { // Check DetId.h + LogDebug("HcalSim") << "Hit[" << i << "] ID " << std::hex << id_ << std::dec << " Det " << det << " Sub " << subdet + << " depth " << depth << " Eta " << eta << " Phi " << phi << " E " << energy << " time " + << time; + if (det == 4) { // Check DetId.h if (subdet == static_cast(HcalBarrel)) nHB++; else if (subdet == static_cast(HcalEndcap)) @@ -452,7 +417,6 @@ void HcalSimHitStudy::analyzeHits(std::vector &hits) { for (int i = 0; i < ieta_bins_HB; i++) { for (int j = 0; j < iphi_bins; j++) { - if (HBEneMap[i][j] != 0) { meHBEneSum_->Fill(HBEneMap[i][j]); meHBEneSum_vs_ieta_->Fill((i - eta_offset_HB), HBEneMap[i][j]); @@ -463,7 +427,6 @@ void HcalSimHitStudy::analyzeHits(std::vector &hits) { for (int i = 0; i < ieta_bins_HE; i++) { for (int j = 0; j < iphi_bins; j++) { - if (HEEneMap[i][j] != 0) { meHEEneSum_->Fill(HEEneMap[i][j]); meHEEneSum_vs_ieta_->Fill((i - eta_offset_HE), HEEneMap[i][j]); @@ -474,7 +437,6 @@ void HcalSimHitStudy::analyzeHits(std::vector &hits) { for (int i = 0; i < ieta_bins_HO; i++) { for (int j = 0; j < iphi_bins; j++) { - if (HOEneMap[i][j] != 0) { meHOEneSum_->Fill(HOEneMap[i][j]); meHOEneSum_vs_ieta_->Fill((i - eta_offset_HO), HOEneMap[i][j]); @@ -485,7 +447,6 @@ void HcalSimHitStudy::analyzeHits(std::vector &hits) { for (int i = 0; i < ieta_bins_HF; i++) { for (int j = 0; j < iphi_bins; j++) { - if (HFEneMap[i][j] != 0) { meHFEneSum_->Fill(HFEneMap[i][j]); meHFEneSum_vs_ieta_->Fill((i - eta_offset_HF), HFEneMap[i][j]); @@ -494,7 +455,6 @@ void HcalSimHitStudy::analyzeHits(std::vector &hits) { } } - LogDebug("HcalSim") << "HcalSimHitStudy::analyzeHits: HB " << nHB << " HE " - << nHE << " HO " << nHO << " HF " << nHF << " Bad " - << nBad << " All " << nHit; + LogDebug("HcalSim") << "HcalSimHitStudy::analyzeHits: HB " << nHB << " HE " << nHE << " HO " << nHO << " HF " << nHF + << " Bad " << nBad << " All " << nHit; } diff --git a/Validation/HcalHits/src/HcalSimHitsClient.cc b/Validation/HcalHits/src/HcalSimHitsClient.cc index f7ed66617fc39..d6261d1883de6 100644 --- a/Validation/HcalHits/src/HcalSimHitsClient.cc +++ b/Validation/HcalHits/src/HcalSimHitsClient.cc @@ -12,15 +12,13 @@ #include "Geometry/Records/interface/HcalRecNumberingRecord.h" HcalSimHitsClient::HcalSimHitsClient(const edm::ParameterSet &iConfig) { - dirName_ = iConfig.getParameter("DQMDirName"); verbose_ = iConfig.getUntrackedParameter("Verbosity", false); } HcalSimHitsClient::~HcalSimHitsClient() {} -void HcalSimHitsClient::beginRun(edm::Run const &run, - edm::EventSetup const &c) { +void HcalSimHitsClient::beginRun(edm::Run const &run, edm::EventSetup const &c) { edm::ESHandle pHRNDC; c.get().get(pHRNDC); hcons = &(*pHRNDC); @@ -29,19 +27,13 @@ void HcalSimHitsClient::beginRun(edm::Run const &run, maxDepthHF_ = hcons->getMaxDepth(2); maxDepthHO_ = hcons->getMaxDepth(3); - edm::LogInfo("HitsValidationHcal") - << " Maximum Depths HB:" << maxDepthHB_ << " HE:" << maxDepthHE_ - << " HO:" << maxDepthHO_ << " HF:" << maxDepthHF_; -} - -void HcalSimHitsClient::dqmEndJob(DQMStore::IBooker &ib, - DQMStore::IGetter &ig) { - runClient_(ib, ig); + edm::LogInfo("HitsValidationHcal") << " Maximum Depths HB:" << maxDepthHB_ << " HE:" << maxDepthHE_ + << " HO:" << maxDepthHO_ << " HF:" << maxDepthHF_; } -void HcalSimHitsClient::runClient_(DQMStore::IBooker &ib, - DQMStore::IGetter &ig) { +void HcalSimHitsClient::dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) { runClient_(ib, ig); } +void HcalSimHitsClient::runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig) { ig.setCurrentFolder(dirName_); if (verbose_) @@ -52,23 +44,18 @@ void HcalSimHitsClient::runClient_(DQMStore::IBooker &ib, std::vector fullPathHLTFolders = ig.getSubdirs(); for (unsigned int i = 0; i < fullPathHLTFolders.size(); i++) { if (verbose_) - edm::LogInfo("HitsValidationHcal") - << "fullPath: " << fullPathHLTFolders[i]; + edm::LogInfo("HitsValidationHcal") << "fullPath: " << fullPathHLTFolders[i]; ig.setCurrentFolder(fullPathHLTFolders[i]); std::vector fullSubPathHLTFolders = ig.getSubdirs(); for (unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) { - if (verbose_) - edm::LogInfo("HitsValidationHcal") - << "fullSub: " << fullSubPathHLTFolders[j]; + edm::LogInfo("HitsValidationHcal") << "fullSub: " << fullSubPathHLTFolders[j]; - if (strcmp(fullSubPathHLTFolders[j].c_str(), - "HcalHitsV/SimHitsValidationHcal") == 0) { + if (strcmp(fullSubPathHLTFolders[j].c_str(), "HcalHitsV/SimHitsValidationHcal") == 0) { hcalMEs = ig.getContents(fullSubPathHLTFolders[j]); if (verbose_) - edm::LogInfo("HitsValidationHcal") - << "hltMES size : " << hcalMEs.size(); + edm::LogInfo("HitsValidationHcal") << "hltMES size : " << hcalMEs.size(); if (!SimHitsEndjob(hcalMEs)) edm::LogWarning("HitsValidationHcal") << "Error in SimhitEndjob!"; } @@ -78,14 +65,11 @@ void HcalSimHitsClient::runClient_(DQMStore::IBooker &ib, // called after entering the directory // hcalMEs are within that directory -int HcalSimHitsClient::SimHitsEndjob( - const std::vector &hcalMEs) { - +int HcalSimHitsClient::SimHitsEndjob(const std::vector &hcalMEs) { std::vector divisions = getHistogramTypes(); MonitorElement *Occupancy_map[nTime][divisions.size()]; MonitorElement *Energy[nType1], *Time_weighteden[nType1]; - MonitorElement *HitEnergyvsieta[divisions.size()], - *HitTimevsieta[divisions.size()]; + MonitorElement *HitEnergyvsieta[divisions.size()], *HitTimevsieta[divisions.size()]; std::string time[nTime] = {"25", "50", "100", "250"}; std::string detdivision[nType1] = {"HB", "HE", "HF", "HO"}; @@ -175,8 +159,7 @@ int HcalSimHitsClient::SimHitsEndjob( int nx = Occupancy_map[itime][det]->getNbinsX(); for (int i = 1; i < nx + 1; i++) { for (int j = 1; j < ny + 1; j++) { - cont[itime][det] = - Occupancy_map[itime][det]->getBinContent(i, j) / fev; + cont[itime][det] = Occupancy_map[itime][det]->getBinContent(i, j) / fev; Occupancy_map[itime][det]->setBinContent(i, j, cont[itime][det]); } } @@ -187,7 +170,6 @@ int HcalSimHitsClient::SimHitsEndjob( } std::vector HcalSimHitsClient::getHistogramTypes() { - int maxDepth = std::max(maxDepthHB_, maxDepthHE_); if (verbose_) edm::LogInfo("HitsValidationHcal") << "Max depth 1st step:: " << maxDepth; diff --git a/Validation/HcalHits/src/HcalSimHitsValidation.cc b/Validation/HcalHits/src/HcalSimHitsValidation.cc index 42ad528a116c6..dcf3dee6f2f6b 100644 --- a/Validation/HcalHits/src/HcalSimHitsValidation.cc +++ b/Validation/HcalHits/src/HcalSimHitsValidation.cc @@ -4,40 +4,29 @@ HcalSimHitsValidation::HcalSimHitsValidation(edm::ParameterSet const &conf) { // DQM ROOT output - outputFile_ = - conf.getUntrackedParameter("outputFile", "myfile.root"); + outputFile_ = conf.getUntrackedParameter("outputFile", "myfile.root"); testNumber_ = conf.getUntrackedParameter("TestNumber", false); auxPlots_ = conf.getUntrackedParameter("auxiliaryPlots", false); // register for data access - g4Label_ = - conf.getUntrackedParameter("ModuleLabel", "g4SimHits"); - hcalHits_ = - conf.getUntrackedParameter("HcalHitCollection", "HcalHits"); - ebHits_ = - conf.getUntrackedParameter("EBHitCollection", "EcalHitsEB"); - eeHits_ = - conf.getUntrackedParameter("EEHitCollection", "EcalHitsEE"); + g4Label_ = conf.getUntrackedParameter("ModuleLabel", "g4SimHits"); + hcalHits_ = conf.getUntrackedParameter("HcalHitCollection", "HcalHits"); + ebHits_ = conf.getUntrackedParameter("EBHitCollection", "EcalHitsEB"); + eeHits_ = conf.getUntrackedParameter("EEHitCollection", "EcalHitsEE"); // import sampling factors hf1_ = conf.getParameter("hf1"); hf2_ = conf.getParameter("hf2"); tok_evt_ = consumes(edm::InputTag("generatorSmeared")); - tok_hcal_ = - consumes(edm::InputTag(g4Label_, hcalHits_)); - tok_ecalEB_ = - consumes(edm::InputTag(g4Label_, ebHits_)); - tok_ecalEE_ = - consumes(edm::InputTag(g4Label_, eeHits_)); + tok_hcal_ = consumes(edm::InputTag(g4Label_, hcalHits_)); + tok_ecalEB_ = consumes(edm::InputTag(g4Label_, ebHits_)); + tok_ecalEE_ = consumes(edm::InputTag(g4Label_, eeHits_)); if (!outputFile_.empty()) { - edm::LogInfo("OutputInfo") - << " Hcal SimHit Task histograms will be saved to '" - << outputFile_.c_str() << "'"; + edm::LogInfo("OutputInfo") << " Hcal SimHit Task histograms will be saved to '" << outputFile_.c_str() << "'"; } else { - edm::LogInfo("OutputInfo") - << " Hcal SimHit Task histograms will NOT be saved"; + edm::LogInfo("OutputInfo") << " Hcal SimHit Task histograms will NOT be saved"; } nevtot = 0; @@ -45,9 +34,7 @@ HcalSimHitsValidation::HcalSimHitsValidation(edm::ParameterSet const &conf) { HcalSimHitsValidation::~HcalSimHitsValidation() {} -void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, - edm::Run const &run, - edm::EventSetup const &es) { +void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, edm::EventSetup const &es) { edm::ESHandle pHRNDC; es.get().get(pHRNDC); hcons = &(*pHRNDC); @@ -110,7 +97,6 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, ib.setCurrentFolder("HcalHitsV/HcalSimHitTask"); if (auxPlots_) { - // General counters for (int depth = 0; depth <= maxDepthHB_; depth++) { if (depth == 0) { @@ -152,9 +138,8 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, sprintf(histo, "emean_vs_ieta_HB%d", depth); } - emean_vs_ieta_HB.push_back(ib.bookProfile(histo, histo, ieta_bins_HB, - ieta_min_HB, ieta_max_HB, -10., - 2000., " ")); + emean_vs_ieta_HB.push_back( + ib.bookProfile(histo, histo, ieta_bins_HB, ieta_min_HB, ieta_max_HB, -10., 2000., " ")); } for (int depth = 0; depth <= maxDepthHE_; depth++) { if (depth == 0) { @@ -163,14 +148,12 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, sprintf(histo, "emean_vs_ieta_HE%d", depth); } - emean_vs_ieta_HE.push_back(ib.bookProfile(histo, histo, ieta_bins_HE, - ieta_min_HE, ieta_max_HE, -10., - 2000., " ")); + emean_vs_ieta_HE.push_back( + ib.bookProfile(histo, histo, ieta_bins_HE, ieta_min_HE, ieta_max_HE, -10., 2000., " ")); } sprintf(histo, "emean_vs_ieta_HO"); - emean_vs_ieta_HO = ib.bookProfile(histo, histo, ieta_bins_HO, ieta_min_HO, - ieta_max_HO, -10., 2000., " "); + emean_vs_ieta_HO = ib.bookProfile(histo, histo, ieta_bins_HO, ieta_min_HO, ieta_max_HO, -10., 2000., " "); for (int depth = 0; depth <= maxDepthHF_; depth++) { if (depth == 0) { @@ -179,9 +162,8 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, sprintf(histo, "emean_vs_ieta_HF%d", depth); } - emean_vs_ieta_HF.push_back(ib.bookProfile(histo, histo, ieta_bins_HF, - ieta_min_HF, ieta_max_HF, -10., - 2000., " ")); + emean_vs_ieta_HF.push_back( + ib.bookProfile(histo, histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF, -10., 2000., " ")); } // Occupancy vs. iEta TH1Fs @@ -192,8 +174,7 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, sprintf(histo, "occupancy_vs_ieta_HB%d", depth); } - occupancy_vs_ieta_HB.push_back( - ib.book1D(histo, histo, ieta_bins_HB, ieta_min_HB, ieta_max_HB)); + occupancy_vs_ieta_HB.push_back(ib.book1D(histo, histo, ieta_bins_HB, ieta_min_HB, ieta_max_HB)); } for (int depth = 0; depth <= maxDepthHE_; depth++) { if (depth == 0) { @@ -202,13 +183,11 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, sprintf(histo, "occupancy_vs_ieta_HE%d", depth); } - occupancy_vs_ieta_HE.push_back( - ib.book1D(histo, histo, ieta_bins_HE, ieta_min_HE, ieta_max_HE)); + occupancy_vs_ieta_HE.push_back(ib.book1D(histo, histo, ieta_bins_HE, ieta_min_HE, ieta_max_HE)); } sprintf(histo, "occupancy_vs_ieta_HO"); - occupancy_vs_ieta_HO = - ib.book1D(histo, histo, ieta_bins_HO, ieta_min_HO, ieta_max_HO); + occupancy_vs_ieta_HO = ib.book1D(histo, histo, ieta_bins_HO, ieta_min_HO, ieta_max_HO); for (int depth = 0; depth <= maxDepthHF_; depth++) { if (depth == 0) { @@ -217,8 +196,7 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, sprintf(histo, "occupancy_vs_ieta_HF%d", depth); } - occupancy_vs_ieta_HF.push_back( - ib.book1D(histo, histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF)); + occupancy_vs_ieta_HF.push_back(ib.book1D(histo, histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF)); } // Energy spectra @@ -254,30 +232,23 @@ void HcalSimHitsValidation::bookHistograms(DQMStore::IBooker &ib, meSimHitsEnergyHF.push_back(ib.book1D(histo, histo, 1010, -5., 500.)); } - } // auxPlots_ + } // auxPlots_ // Energy in Cone sprintf(histo, "HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths"); - meEnConeEtaProfile = ib.bookProfile(histo, histo, ieta_bins_HF, ieta_min_HF, - ieta_max_HF, -10., 200., " "); + meEnConeEtaProfile = ib.bookProfile(histo, histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF, -10., 200., " "); sprintf(histo, "HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_E"); - meEnConeEtaProfile_E = ib.bookProfile(histo, histo, ieta_bins_HF, ieta_min_HF, - ieta_max_HF, -10., 200., " "); + meEnConeEtaProfile_E = ib.bookProfile(histo, histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF, -10., 200., " "); - sprintf(histo, - "HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_EH"); - meEnConeEtaProfile_EH = ib.bookProfile( - histo, histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF, -10., 200., " "); + sprintf(histo, "HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_EH"); + meEnConeEtaProfile_EH = ib.bookProfile(histo, histo, ieta_bins_HF, ieta_min_HF, ieta_max_HF, -10., 200., " "); } void HcalSimHitsValidation::endJob() { - if (auxPlots_) { - for (int i = 1; i <= occupancy_vs_ieta_HB[0]->getNbinsX(); i++) { - - int ieta = i - 43; // -41 -1, 1 41 + int ieta = i - 43; // -41 -1, 1 41 float phi_factor; @@ -292,13 +263,11 @@ void HcalSimHitsValidation::endJob() { // Occupancy vs. iEta TH1Fs for (int depth = 0; depth <= maxDepthHB_; depth++) { - cnorm = occupancy_vs_ieta_HB[depth]->getBinContent(i) / - (phi_factor * nevtot); + cnorm = occupancy_vs_ieta_HB[depth]->getBinContent(i) / (phi_factor * nevtot); occupancy_vs_ieta_HB[depth]->setBinContent(i, cnorm); } for (int depth = 0; depth <= maxDepthHE_; depth++) { - cnorm = occupancy_vs_ieta_HE[depth]->getBinContent(i) / - (phi_factor * nevtot); + cnorm = occupancy_vs_ieta_HE[depth]->getBinContent(i) / (phi_factor * nevtot); occupancy_vs_ieta_HE[depth]->setBinContent(i, cnorm); } @@ -306,8 +275,7 @@ void HcalSimHitsValidation::endJob() { occupancy_vs_ieta_HO->setBinContent(i, cnorm); for (int depth = 0; depth <= maxDepthHF_; depth++) { - cnorm = occupancy_vs_ieta_HF[depth]->getBinContent(i) / - (phi_factor * nevtot); + cnorm = occupancy_vs_ieta_HF[depth]->getBinContent(i) / (phi_factor * nevtot); occupancy_vs_ieta_HF[depth]->setBinContent(i, cnorm); } } @@ -317,9 +285,7 @@ void HcalSimHitsValidation::endJob() { // if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_); } -void HcalSimHitsValidation::analyze(edm::Event const &ev, - edm::EventSetup const &c) { - +void HcalSimHitsValidation::analyze(edm::Event const &ev, edm::EventSetup const &c) { using namespace edm; using namespace std; @@ -327,11 +293,11 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, // Getting SimHits //=========================================================================== - double phi_MC = -999.; // phi of initial particle from HepMC - double eta_MC = -999.; // eta of initial particle from HepMC + double phi_MC = -999.; // phi of initial particle from HepMC + double eta_MC = -999.; // eta of initial particle from HepMC edm::Handle evtMC; - ev.getByToken(tok_evt_, evtMC); // generator in late 310_preX + ev.getByToken(tok_evt_, evtMC); // generator in late 310_preX if (!evtMC.isValid()) { std::cout << "no HepMCProduct found" << std::endl; } @@ -341,9 +307,8 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, int npart = 0; const HepMC::GenEvent *myGenEvent = evtMC->GetEvent(); - for (HepMC::GenEvent::particle_const_iterator p = - myGenEvent->particles_begin(); - p != myGenEvent->particles_end(); ++p) { + for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); + ++p) { double phip = (*p)->momentum().phi(); double etap = (*p)->momentum().eta(); double pt = (*p)->momentum().perp(); @@ -362,8 +327,8 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, // Approximate calibration constants const float calib_HB = 120.; const float calib_HE = 190.; - const float calib_HF1 = hf1_; // 1.0/0.383; - const float calib_HF2 = hf2_; // 1.0/0.368; + const float calib_HF1 = hf1_; // 1.0/0.383; + const float calib_HF2 = hf2_; // 1.0/0.368; edm::Handle hcalHits; ev.getByToken(tok_hcal_, hcalHits); @@ -377,16 +342,15 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, c.get().get(geometry); - for (std::vector::const_iterator SimHits = SimHitResult->begin(); - SimHits != SimHitResult->end(); ++SimHits) { + for (std::vector::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end(); + ++SimHits) { HcalDetId cell; if (testNumber_) cell = HcalHitRelabeller::relabel(SimHits->id(), hcons); else cell = HcalDetId(SimHits->id()); - auto cellGeometry = - geometry->getSubdetectorGeometry(cell)->getGeometry(cell); + auto cellGeometry = geometry->getSubdetectorGeometry(cell)->getGeometry(cell); double etaS = cellGeometry->getPosition().eta(); double phiS = cellGeometry->getPosition().phi(); double en = SimHits->energy(); @@ -416,7 +380,6 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, } if (auxPlots_) { - // HB if (sub == 1) { meSimHitsEnergyHB[0]->Fill(en); @@ -459,9 +422,9 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, occupancy_vs_ieta_HF[depth]->Fill(double(ieta)); } - } // auxPlots_ + } // auxPlots_ - } // Loop over SimHits + } // Loop over SimHits // Ecal EB SimHits double EcalCone = 0; @@ -471,14 +434,11 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, ev.getByToken(tok_ecalEB_, ecalEBHits); const PCaloHitContainer *SimHitResultEB = ecalEBHits.product(); - for (std::vector::const_iterator SimHits = - SimHitResultEB->begin(); - SimHits != SimHitResultEB->end(); ++SimHits) { - + for (std::vector::const_iterator SimHits = SimHitResultEB->begin(); SimHits != SimHitResultEB->end(); + ++SimHits) { EBDetId EBid = EBDetId(SimHits->id()); - auto cellGeometry = - geometry->getSubdetectorGeometry(EBid)->getGeometry(EBid); + auto cellGeometry = geometry->getSubdetectorGeometry(EBid)->getGeometry(EBid); double etaS = cellGeometry->getPosition().eta(); double phiS = cellGeometry->getPosition().phi(); double en = SimHits->energy(); @@ -488,7 +448,7 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, if (r < partR) EcalCone += en; } - } // ebHits_ + } // ebHits_ // Ecal EE SimHits if (!eeHits_.empty()) { @@ -496,14 +456,11 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, ev.getByToken(tok_ecalEE_, ecalEEHits); const PCaloHitContainer *SimHitResultEE = ecalEEHits.product(); - for (std::vector::const_iterator SimHits = - SimHitResultEE->begin(); - SimHits != SimHitResultEE->end(); ++SimHits) { - + for (std::vector::const_iterator SimHits = SimHitResultEE->begin(); SimHits != SimHitResultEE->end(); + ++SimHits) { EEDetId EEid = EEDetId(SimHits->id()); - auto cellGeometry = - geometry->getSubdetectorGeometry(EEid)->getGeometry(EEid); + auto cellGeometry = geometry->getSubdetectorGeometry(EEid)->getGeometry(EEid); double etaS = cellGeometry->getPosition().eta(); double phiS = cellGeometry->getPosition().phi(); double en = SimHits->energy(); @@ -513,9 +470,9 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, if (r < partR) EcalCone += en; } - } // eeHits_ + } // eeHits_ - if (ietaMax != 0) { // If ietaMax == 0, there were no good HCAL SimHits + if (ietaMax != 0) { // If ietaMax == 0, there were no good HCAL SimHits meEnConeEtaProfile->Fill(double(ietaMax), HcalCone); meEnConeEtaProfile_E->Fill(double(ietaMax), EcalCone); meEnConeEtaProfile_EH->Fill(double(ietaMax), HcalCone + EcalCone); @@ -524,8 +481,7 @@ void HcalSimHitsValidation::analyze(edm::Event const &ev, nevtot++; } -double HcalSimHitsValidation::dR(double eta1, double phi1, double eta2, - double phi2) { +double HcalSimHitsValidation::dR(double eta1, double phi1, double eta2, double phi2) { double PI = 3.1415926535898; double deltaphi = phi1 - phi2; if (phi2 > phi1) { @@ -539,8 +495,7 @@ double HcalSimHitsValidation::dR(double eta1, double phi1, double eta2, return tmp; } -double HcalSimHitsValidation::phi12(double phi1, double en1, double phi2, - double en2) { +double HcalSimHitsValidation::phi12(double phi1, double en1, double phi2, double en2) { // weighted mean value of phi1 and phi2 double tmp; diff --git a/Validation/HcalHits/src/SimG4HcalHitCluster.cc b/Validation/HcalHits/src/SimG4HcalHitCluster.cc index 8554ac2706bd7..33db5a48846d6 100644 --- a/Validation/HcalHits/src/SimG4HcalHitCluster.cc +++ b/Validation/HcalHits/src/SimG4HcalHitCluster.cc @@ -15,7 +15,6 @@ bool SimG4HcalHitCluster::operator<(const SimG4HcalHitCluster &cluster) const { } SimG4HcalHitCluster &SimG4HcalHitCluster::operator+=(const CaloHit &hit) { - hitsc.push_back(hit); if (ec == 0. && etac == 0. && phic == 0.) { @@ -55,7 +54,6 @@ SimG4HcalHitCluster &SimG4HcalHitCluster::operator+=(const CaloHit &hit) { } double SimG4HcalHitCluster::collectEcalEnergyR() { - double sum = 0.; std::vector::iterator itr; @@ -68,7 +66,6 @@ double SimG4HcalHitCluster::collectEcalEnergyR() { } std::ostream &operator<<(std::ostream &os, const SimG4HcalHitCluster &cluster) { - os << " SimG4HcalHitCluster:: E " << cluster.e() << " eta " << cluster.eta() - << " phi " << cluster.phi(); + os << " SimG4HcalHitCluster:: E " << cluster.e() << " eta " << cluster.eta() << " phi " << cluster.phi(); return os; } diff --git a/Validation/HcalHits/src/SimG4HcalHitJetFinder.cc b/Validation/HcalHits/src/SimG4HcalHitJetFinder.cc index 73a7b02bf2a25..f620b6c5eeb46 100644 --- a/Validation/HcalHits/src/SimG4HcalHitJetFinder.cc +++ b/Validation/HcalHits/src/SimG4HcalHitJetFinder.cc @@ -12,18 +12,13 @@ SimG4HcalHitJetFinder::SimG4HcalHitJetFinder(double cone) : jetcone(cone) {} -SimG4HcalHitJetFinder::~SimG4HcalHitJetFinder() { - edm::LogInfo("ValidHcal") << "SimG4HcalHitJetFinder:: Deleting"; -} +SimG4HcalHitJetFinder::~SimG4HcalHitJetFinder() { edm::LogInfo("ValidHcal") << "SimG4HcalHitJetFinder:: Deleting"; } void SimG4HcalHitJetFinder::setCone(double cone) { jetcone = cone; } -void SimG4HcalHitJetFinder::setInput(std::vector *hhit) { - input = *hhit; -} +void SimG4HcalHitJetFinder::setInput(std::vector *hhit) { input = *hhit; } -std::vector * -SimG4HcalHitJetFinder::getClusters(bool hcal_only) { +std::vector *SimG4HcalHitJetFinder::getClusters(bool hcal_only) { clusvector.erase(clusvector.begin(), clusvector.end()); if (input.empty()) { return &clusvector; @@ -31,20 +26,18 @@ SimG4HcalHitJetFinder::getClusters(bool hcal_only) { std::vector::iterator itr; for (itr = input.begin(); itr != input.end(); itr++) { - LogDebug("ValidHcal") << "HcalHitJetFinder::getClusters_1 - input : e " - << itr->e() << " eta " << itr->eta() << " phi " - << itr->phi() << " subdet " << itr->det(); + LogDebug("ValidHcal") << "HcalHitJetFinder::getClusters_1 - input : e " << itr->e() << " eta " << itr->eta() + << " phi " << itr->phi() << " subdet " << itr->det(); } - sort(input.begin(), input.end()); // sort input in descending order + sort(input.begin(), input.end()); // sort input in descending order for (itr = input.begin(); itr != input.end(); itr++) { - LogDebug("ValidHcal") << "HcalHitJetFinder::getClusters_2 - input : e " - << itr->e() << " eta " << itr->eta() << " phi " - << itr->phi() << " subdet " << itr->det(); + LogDebug("ValidHcal") << "HcalHitJetFinder::getClusters_2 - input : e " << itr->e() << " eta " << itr->eta() + << " phi " << itr->phi() << " subdet " << itr->det(); } - std::vector temp; // dummy container for clusters + std::vector temp; // dummy container for clusters // first input hit -> first cluster @@ -54,11 +47,9 @@ SimG4HcalHitJetFinder::getClusters(bool hcal_only) { std::vector::iterator itr_hits; int j, first_seed = 0; - for (j = 0, itr_hits = input.begin(); itr_hits != input.end(); - j++, itr_hits++) { - int h_type = itr_hits->det(); // if desired HCAL hits (only) clusterfinding - if (((h_type == static_cast(HcalBarrel) || - h_type == static_cast(HcalEndcap) || + for (j = 0, itr_hits = input.begin(); itr_hits != input.end(); j++, itr_hits++) { + int h_type = itr_hits->det(); // if desired HCAL hits (only) clusterfinding + if (((h_type == static_cast(HcalBarrel) || h_type == static_cast(HcalEndcap) || h_type == static_cast(HcalForward)) && hcal_only) || (!hcal_only)) { @@ -75,11 +66,9 @@ SimG4HcalHitJetFinder::getClusters(bool hcal_only) { std::vector::iterator itr_clus; - for (j = 0, itr_hits = input.begin(); itr_hits != input.end(); - j++, itr_hits++) { - int h_type = itr_hits->det(); // if desired HCAL hits (only) clusterfinding - if ((((h_type == static_cast(HcalBarrel) || - h_type == static_cast(HcalEndcap) || + for (j = 0, itr_hits = input.begin(); itr_hits != input.end(); j++, itr_hits++) { + int h_type = itr_hits->det(); // if desired HCAL hits (only) clusterfinding + if ((((h_type == static_cast(HcalBarrel) || h_type == static_cast(HcalEndcap) || h_type == static_cast(HcalForward)) && hcal_only) || (!hcal_only)) && @@ -88,15 +77,11 @@ SimG4HcalHitJetFinder::getClusters(bool hcal_only) { << " ..................\n" << (*itr_hits); - int incl = 0; // if the hit is included in one of clusters + int incl = 0; // if the hit is included in one of clusters int iclus; - for (itr_clus = temp.begin(), iclus = 0; itr_clus != temp.end(); - itr_clus++, iclus++) { - - LogDebug("ValidHcal") - << "HcalHitJetFinder::=======> Cluster " << iclus << "\n" - << (*itr_clus); + for (itr_clus = temp.begin(), iclus = 0; itr_clus != temp.end(); itr_clus++, iclus++) { + LogDebug("ValidHcal") << "HcalHitJetFinder::=======> Cluster " << iclus << "\n" << (*itr_clus); double d = rDist(&(*itr_clus), &(*itr_hits)); if (d < jetcone) { @@ -123,9 +108,7 @@ SimG4HcalHitJetFinder::getClusters(bool hcal_only) { return &clusvector; } -double SimG4HcalHitJetFinder::rDist(const SimG4HcalHitCluster *cluster, - const CaloHit *hit) const { - +double SimG4HcalHitJetFinder::rDist(const SimG4HcalHitCluster *cluster, const CaloHit *hit) const { double etac = cluster->eta(); double phic = cluster->phi(); @@ -135,10 +118,7 @@ double SimG4HcalHitJetFinder::rDist(const SimG4HcalHitCluster *cluster, return rDist(etac, phic, etah, phih); } -double SimG4HcalHitJetFinder::rDist(const double etac, const double phic, - const double etah, - const double phih) const { - +double SimG4HcalHitJetFinder::rDist(const double etac, const double phic, const double etah, const double phih) const { double delta_eta = etac - etah; double delta_phi = phic - phih; @@ -151,8 +131,7 @@ double SimG4HcalHitJetFinder::rDist(const double etac, const double phic, LogDebug("ValidHcal") << "HcalHitJetFinder::rDist:\n" << " Clus. eta, phi = " << etac << " " << phic << "\n" - << " hit eta, phi = " << etah << " " << phih - << " rDist = " << tmp; + << " hit eta, phi = " << etah << " " << phih << " rDist = " << tmp; return tmp; } diff --git a/Validation/HcalHits/src/SimG4HcalValidation.cc b/Validation/HcalHits/src/SimG4HcalValidation.cc index 8063c5da7d981..1e57576c27dcc 100644 --- a/Validation/HcalHits/src/SimG4HcalValidation.cc +++ b/Validation/HcalHits/src/SimG4HcalValidation.cc @@ -37,9 +37,7 @@ SimG4HcalValidation::SimG4HcalValidation(const edm::ParameterSet &p) : jetf(nullptr), numberingFromDDD(nullptr), org(nullptr) { - - edm::ParameterSet m_Anal = - p.getParameter("SimG4HcalValidation"); + edm::ParameterSet m_Anal = p.getParameter("SimG4HcalValidation"); infolevel = m_Anal.getParameter("InfoLevel"); hcalOnly = m_Anal.getParameter("HcalClusterOnly"); applySampling = m_Anal.getParameter("HcalSampling"); @@ -52,12 +50,9 @@ SimG4HcalValidation::SimG4HcalValidation(const edm::ParameterSet &p) eta0 = m_Anal.getParameter("Eta0"); phi0 = m_Anal.getParameter("Phi0"); names = m_Anal.getParameter>("Names"); - labelLayer = m_Anal.getUntrackedParameter("LabelLayerInfo", - "HcalInfoLayer"); - labelNxN = - m_Anal.getUntrackedParameter("LabelNxNInfo", "HcalInfoNxN"); - labelJets = m_Anal.getUntrackedParameter("LabelJetsInfo", - "HcalInfoJets"); + labelLayer = m_Anal.getUntrackedParameter("LabelLayerInfo", "HcalInfoLayer"); + labelNxN = m_Anal.getUntrackedParameter("LabelNxNInfo", "HcalInfoNxN"); + labelJets = m_Anal.getUntrackedParameter("LabelJetsInfo", "HcalInfoJets"); produces(labelLayer); if (infolevel > 0) @@ -65,29 +60,22 @@ SimG4HcalValidation::SimG4HcalValidation(const edm::ParameterSet &p) if (infolevel > 1) produces(labelJets); - edm::LogInfo("ValidHcal") - << "HcalTestAnalysis:: Initialised as observer of " - << "begin/end events and of G4step with Parameter " - << "values: \n\tInfoLevel = " << infolevel - << "\n\thcalOnly = " << hcalOnly - << "\n\tapplySampling = " << applySampling - << "\n\tconeSize = " << coneSize - << "\n\tehitThreshold = " << ehitThreshold - << "\n\thhitThreshold = " << hhitThreshold - << "\n\tttimeLowlim = " << timeLowlim - << "\n\tttimeUplim = " << timeUplim << "\n\teta0 = " << eta0 - << "\n\tphi0 = " << phi0 << "\nLabels (Layer): " << labelLayer - << " (NxN): " << labelNxN << " (Jets): " << labelJets; + edm::LogInfo("ValidHcal") << "HcalTestAnalysis:: Initialised as observer of " + << "begin/end events and of G4step with Parameter " + << "values: \n\tInfoLevel = " << infolevel << "\n\thcalOnly = " << hcalOnly + << "\n\tapplySampling = " << applySampling << "\n\tconeSize = " << coneSize + << "\n\tehitThreshold = " << ehitThreshold << "\n\thhitThreshold = " << hhitThreshold + << "\n\tttimeLowlim = " << timeLowlim << "\n\tttimeUplim = " << timeUplim + << "\n\teta0 = " << eta0 << "\n\tphi0 = " << phi0 + << "\nLabels (Layer): " << labelLayer << " (NxN): " << labelNxN << " (Jets): " << labelJets; init(); } SimG4HcalValidation::~SimG4HcalValidation() { - - edm::LogInfo("ValidHcal") - << "\n --------> Total number of selected entries" - << " : " << count << "\nPointers:: JettFinder " << jetf - << ", Numbering Scheme " << org << " and FromDDD " << numberingFromDDD; + edm::LogInfo("ValidHcal") << "\n --------> Total number of selected entries" + << " : " << count << "\nPointers:: JettFinder " << jetf << ", Numbering Scheme " << org + << " and FromDDD " << numberingFromDDD; if (jetf) { edm::LogInfo("ValidHcal") << "Delete Jetfinder"; delete jetf; @@ -101,7 +89,6 @@ SimG4HcalValidation::~SimG4HcalValidation() { } void SimG4HcalValidation::produce(edm::Event &e, const edm::EventSetup &) { - std::unique_ptr productLayer(new PHcalValidInfoLayer); layerAnalysis(*productLayer); e.put(std::move(productLayer), labelLayer); @@ -121,10 +108,9 @@ void SimG4HcalValidation::produce(edm::Event &e, const edm::EventSetup &) { //==================================================================== per RUN void SimG4HcalValidation::init() { - float sHB[4] = {117., 117., 178., 217.}; float sHE[3] = {178., 178., 178.}; - float sHF[3] = {2.84, 2.09, 0.}; // + float sHF[3] = {2.84, 2.09, 0.}; // float deta[4] = {0.0435, 0.1305, 0.2175, 0.3045}; float dphi[4] = {0.0436, 0.1309, 0.2182, 0.3054}; @@ -154,7 +140,6 @@ void SimG4HcalValidation::init() { } void SimG4HcalValidation::update(const BeginOfJob *job) { - // Numbering From DDD edm::ESHandle hdc; (*job)()->get().get(hdc); @@ -168,7 +153,6 @@ void SimG4HcalValidation::update(const BeginOfJob *job) { } void SimG4HcalValidation::update(const BeginOfRun *run) { - int irun = (*run)()->GetRunID(); edm::LogInfo("ValidHcal") << " =====> Begin of Run = " << irun; @@ -183,9 +167,8 @@ void SimG4HcalValidation::update(const BeginOfRun *run) { << "Setup"; } else { HCalSD *theCaloSD = dynamic_cast(aSD); - edm::LogInfo("ValidHcal") - << "SimG4HcalValidation::beginOfRun: Finds SD" - << "with name " << theCaloSD->GetName() << " in this Setup"; + edm::LogInfo("ValidHcal") << "SimG4HcalValidation::beginOfRun: Finds SD" + << "with name " << theCaloSD->GetName() << " in this Setup"; if (org) { theCaloSD->setNumberingScheme(org); edm::LogInfo("ValidHcal") << "SimG4HcalValidation::beginOfRun: set a " @@ -200,7 +183,6 @@ void SimG4HcalValidation::update(const BeginOfRun *run) { //=================================================================== per EVENT void SimG4HcalValidation::update(const BeginOfEvent *evt) { - int i = 0; edepEB = edepEE = edepHB = edepHE = edepHO = 0.; for (i = 0; i < 5; i++) @@ -212,13 +194,11 @@ void SimG4HcalValidation::update(const BeginOfEvent *evt) { clear(); int iev = (*evt)()->GetEventID(); - LogDebug("ValidHcal") << "SimG4HcalValidation: =====> Begin of event = " - << iev; + LogDebug("ValidHcal") << "SimG4HcalValidation: =====> Begin of event = " << iev; } //=================================================================== each STEP void SimG4HcalValidation::update(const G4Step *aStep) { - if (aStep != nullptr) { G4VPhysicalVolume *curPV = aStep->GetPreStepPoint()->GetPhysicalVolume(); G4String name = curPV->GetName(); @@ -237,8 +217,7 @@ void SimG4HcalValidation::update(const G4Step *aStep) { if (depth > 0 && depth < 4 && layer >= 0 && layer < 17) { edepHB += edeposit; } else { - edm::LogWarning("ValidHcal") << "SimG4HcalValidation:Error " - << curPV->GetName() << curPV->GetCopyNo(); + edm::LogWarning("ValidHcal") << "SimG4HcalValidation:Error " << curPV->GetName() << curPV->GetCopyNo(); depth = -1; layer = -1; } @@ -248,8 +227,7 @@ void SimG4HcalValidation::update(const G4Step *aStep) { if (depth > 0 && depth < 3 && layer >= 0 && layer < 19) { edepHE += edeposit; } else { - edm::LogWarning("ValidHcal") << "SimG4HcalValidation:Error " - << curPV->GetName() << curPV->GetCopyNo(); + edm::LogWarning("ValidHcal") << "SimG4HcalValidation:Error " << curPV->GetName() << curPV->GetCopyNo(); depth = -1; layer = -1; } @@ -259,8 +237,7 @@ void SimG4HcalValidation::update(const G4Step *aStep) { if (depth > 3 && depth < 5 && layer >= 17 && layer < 20) { edepHO += edeposit; } else { - edm::LogWarning("ValidHcal") << "SimG4HcalValidation:Error " - << curPV->GetName() << curPV->GetCopyNo(); + edm::LogWarning("ValidHcal") << "SimG4HcalValidation:Error " << curPV->GetName() << curPV->GetCopyNo(); depth = -1; layer = -1; } @@ -271,17 +248,15 @@ void SimG4HcalValidation::update(const G4Step *aStep) { edepl[layer] += edeposit; if (layer >= 0 && layer < 20) { - LogDebug("ValidHcal") - << "SimG4HcalValidation:: G4Step: " << name << " Layer " - << std::setw(3) << layer << " Depth " << std::setw(2) << depth - << " Edep " << std::setw(6) << edeposit / MeV << " MeV"; + LogDebug("ValidHcal") << "SimG4HcalValidation:: G4Step: " << name << " Layer " << std::setw(3) << layer + << " Depth " << std::setw(2) << depth << " Edep " << std::setw(6) << edeposit / MeV + << " MeV"; } } } //================================================================ End of EVENT void SimG4HcalValidation::update(const EndOfEvent *evt) { - count++; // Fill hits cache for jetfinding etc. @@ -291,9 +266,7 @@ void SimG4HcalValidation::update(const EndOfEvent *evt) { //--------------------------------------------------- void SimG4HcalValidation::fill(const EndOfEvent *evt) { - - LogDebug("ValidHcal") << "SimG4HcalValidation:Fill event " - << (*evt)()->GetEventID(); + LogDebug("ValidHcal") << "SimG4HcalValidation:Fill event " << (*evt)()->GetEventID(); // access to the G4 hit collections G4HCofThisEvent *allHC = (*evt)()->GetHCofThisEvent(); @@ -303,12 +276,10 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { // Hcal int HCHCid = G4SDManager::GetSDMpointer()->GetCollectionID(names[0]); CaloG4HitCollection *theHCHC = (CaloG4HitCollection *)allHC->GetHC(HCHCid); - LogDebug("ValidHcal") << "SimG4HcalValidation :: Hit Collection for " - << names[0] << " of ID " << HCHCid << " is obtained at " - << theHCHC; + LogDebug("ValidHcal") << "SimG4HcalValidation :: Hit Collection for " << names[0] << " of ID " << HCHCid + << " is obtained at " << theHCHC; if (HCHCid >= 0 && theHCHC != nullptr) { for (j = 0; j < theHCHC->entries(); j++) { - CaloG4Hit *aHit = (*theHCHC)[j]; double e = aHit->getEnergyDeposit() / GeV; @@ -321,8 +292,7 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { uint32_t unitID = aHit->getUnitID(); int subdet, zside, layer, etaIndex, phiIndex, lay; - org->unpackHcalIndex(unitID, subdet, zside, layer, etaIndex, phiIndex, - lay); + org->unpackHcalIndex(unitID, subdet, zside, layer, etaIndex, phiIndex, lay); // some logic to separate HO ... layer--; @@ -339,11 +309,9 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { else if (layer == 0) vhitec += e; else - edm::LogInfo("ValidHcal") - << "SimG4HcalValidation::HitPMT " << subdet << " " - << (2 * zside - 1) * etaIndex << " " << phiIndex << " " - << layer + 1 << " R " << pos.rho() << " Phi " << phi / deg - << " Edep " << e << " Time " << time; + edm::LogInfo("ValidHcal") << "SimG4HcalValidation::HitPMT " << subdet << " " << (2 * zside - 1) * etaIndex + << " " << phiIndex << " " << layer + 1 << " R " << pos.rho() << " Phi " << phi / deg + << " Edep " << e << " Time " << time; } else if (subdet == static_cast(HcalEndcap)) { if (etaIndex <= 20) { det = "HES"; @@ -351,13 +319,11 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { det = "HED"; } } - LogDebug("ValidHcal") - << "SimG4HcalValidation::debugFill Hcal " << det << " layer " - << std::setw(2) << layer << " lay " << std::setw(2) << lay << " time " - << std::setw(6) << time << " theta " << std::setw(8) << theta - << " eta " << std::setw(8) << eta << " phi " << std::setw(8) << phi - << " e " << std::setw(8) << e << " ID 0x" << std::hex << unitID - << " ID dec " << std::dec << (int)unitID; + LogDebug("ValidHcal") << "SimG4HcalValidation::debugFill Hcal " << det << " layer " << std::setw(2) << layer + << " lay " << std::setw(2) << lay << " time " << std::setw(6) << time << " theta " + << std::setw(8) << theta << " eta " << std::setw(8) << eta << " phi " << std::setw(8) << phi + << " e " << std::setw(8) << e << " ID 0x" << std::hex << unitID << " ID dec " << std::dec + << (int)unitID; // if desired, apply sampling factors in HCAL !!! if (applySampling) @@ -367,14 +333,14 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { if (time >= timeLowlim && time <= timeUplim && e > hhitThreshold) { enHcal += e; CaloHit ahit(subdet, lay, e, eta, phi, time, unitID); - hitcache.push_back(ahit); // fill cache + hitcache.push_back(ahit); // fill cache ++nhc; } } } LogDebug("ValidHcal") << "SimG4HcalValidation:: HCAL hits : " << nhc; - if (!hcalOnly) { //-------------------------- ECAL hits -------------------- + if (!hcalOnly) { //-------------------------- ECAL hits -------------------- int ndets = names.size(); if (ndets > 3) ndets = 3; @@ -387,14 +353,11 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { int nec = 0; int ECHCid = G4SDManager::GetSDMpointer()->GetCollectionID(names[idty]); - CaloG4HitCollection *theECHC = - (CaloG4HitCollection *)allHC->GetHC(ECHCid); - LogDebug("ValidHcal") - << "SimG4HcalValidation:: Hit Collection for " << names[idty] - << " of ID " << ECHCid << " is obtained at " << theECHC; + CaloG4HitCollection *theECHC = (CaloG4HitCollection *)allHC->GetHC(ECHCid); + LogDebug("ValidHcal") << "SimG4HcalValidation:: Hit Collection for " << names[idty] << " of ID " << ECHCid + << " is obtained at " << theECHC; if (ECHCid >= 0 && theECHC != nullptr) { for (j = 0; j < theECHC->entries(); j++) { - CaloG4Hit *aHit = (*theECHC)[j]; double e = aHit->getEnergyDeposit() / GeV; @@ -404,8 +367,7 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { double theta = pos.theta(); double eta = -log(tan(theta / 2.)); double phi = pos.phi(); - HcalNumberingFromDDD::HcalID id = - numberingFromDDD->unitID(eta, phi, 1, 1); + HcalNumberingFromDDD::HcalID id = numberingFromDDD->unitID(eta, phi, 1, 1); uint32_t unitID = org->getUnitID(id); int subdet, zside, layer, ieta, iphi, lay; org->unpackHcalIndex(unitID, subdet, zside, layer, ieta, iphi, lay); @@ -417,53 +379,43 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) { if (time >= timeLowlim && time <= timeUplim && e > ehitThreshold) { enEcal += e; CaloHit ahit(subdet, lay, e, eta, phi, time, unitID); - hitcache.push_back(ahit); // fill cache + hitcache.push_back(ahit); // fill cache ++nec; } - LogDebug("ValidHcal") - << "SimG4HcalValidation::debugFill Ecal " << det << " layer " - << std::setw(2) << layer << " lay " << std::setw(2) << lay - << " time " << std::setw(6) << time << " theta " << std::setw(8) - << theta << " eta " << std::setw(8) << eta << " phi " - << std::setw(8) << phi << " e " << std::setw(8) << e << " ID 0x" - << std::hex << unitID << " ID dec " << std::dec << (int)unitID; + LogDebug("ValidHcal") << "SimG4HcalValidation::debugFill Ecal " << det << " layer " << std::setw(2) << layer + << " lay " << std::setw(2) << lay << " time " << std::setw(6) << time << " theta " + << std::setw(8) << theta << " eta " << std::setw(8) << eta << " phi " << std::setw(8) + << phi << " e " << std::setw(8) << e << " ID 0x" << std::hex << unitID << " ID dec " + << std::dec << (int)unitID; } } - LogDebug("ValidHcal") - << "SimG4HcalValidation:: " << det << " hits : " << nec; + LogDebug("ValidHcal") << "SimG4HcalValidation:: " << det << " hits : " << nec; } - } // end of if(!hcalOnly) + } // end of if(!hcalOnly) } void SimG4HcalValidation::layerAnalysis(PHcalValidInfoLayer &product) { - int i = 0; LogDebug("ValidHcal") << "\n ===>>> SimG4HcalValidation: Energy deposit " - << "in MeV\n at EB : " << std::setw(6) << edepEB / MeV - << "\n at EE : " << std::setw(6) << edepEE / MeV - << "\n at HB : " << std::setw(6) << edepHB / MeV - << "\n at HE : " << std::setw(6) << edepHE / MeV - << "\n at HO : " << std::setw(6) << edepHO / MeV - << "\n ---- SimG4HcalValidation: Energy deposit in"; + << "in MeV\n at EB : " << std::setw(6) << edepEB / MeV << "\n at EE : " << std::setw(6) + << edepEE / MeV << "\n at HB : " << std::setw(6) << edepHB / MeV + << "\n at HE : " << std::setw(6) << edepHE / MeV << "\n at HO : " << std::setw(6) + << edepHO / MeV << "\n ---- SimG4HcalValidation: Energy deposit in"; for (i = 0; i < 5; i++) - LogDebug("ValidHcal") << " Depth " << std::setw(2) << i << " E " - << std::setw(8) << edepd[i] / MeV << " MeV"; + LogDebug("ValidHcal") << " Depth " << std::setw(2) << i << " E " << std::setw(8) << edepd[i] / MeV << " MeV"; LogDebug("ValidHcal") << " ---- SimG4HcalValidation: Energy deposit in" << "layers"; for (i = 0; i < 20; i++) - LogDebug("ValidHcal") << " Layer " << std::setw(2) << i << " E " - << std::setw(8) << edepl[i] / MeV << " MeV"; + LogDebug("ValidHcal") << " Layer " << std::setw(2) << i << " E " << std::setw(8) << edepl[i] / MeV << " MeV"; product.fillLayers(edepl, edepd, edepHO, edepHB + edepHE, edepEB + edepEE); // Hits in HF product.fillHF(vhitec, vhithc, enEcal, enHcal); - LogDebug("ValidHcal") << "SimG4HcalValidation::HF hits " << vhitec - << " in EC and " << vhithc << " in HC\n" - << " HB/HE " << enEcal - << " in EC and " << enHcal << " in HC"; + LogDebug("ValidHcal") << "SimG4HcalValidation::HF hits " << vhitec << " in EC and " << vhithc << " in HC\n" + << " HB/HE " << enEcal << " in EC and " << enHcal << " in HC"; // Another HCAL hist to porcess and store separately (a bit more complicated) fetchHits(product); @@ -473,27 +425,24 @@ void SimG4HcalValidation::layerAnalysis(PHcalValidInfoLayer &product) { //----------------------------------------------------------------------------- void SimG4HcalValidation::nxNAnalysis(PHcalValidInfoNxN &product) { - std::vector *hits = &hitcache; std::vector::iterator hit_itr; LogDebug("ValidHcal") << "SimG4HcalValidation::NxNAnalysis : entrance "; - collectEnergyRdir(eta0, phi0); // HCAL and ECAL energy in SimHitCache - // around (eta0,phi0) + collectEnergyRdir(eta0, phi0); // HCAL and ECAL energy in SimHitCache + // around (eta0,phi0) - LogDebug("ValidHcal") << " NxNAnalysis : coolectEnergyRdir - Ecal " << een - << " Hcal " << hen; + LogDebug("ValidHcal") << " NxNAnalysis : coolectEnergyRdir - Ecal " << een << " Hcal " << hen; - double etot = 0.; // total e deposited in "cluster" - double ee = 0.; // ECAL e deposited in "cluster" - double he = 0.; // HCAL e deposited in "cluster" - double hoe = 0.; // HO e deposited in "cluster" + double etot = 0.; // total e deposited in "cluster" + double ee = 0.; // ECAL e deposited in "cluster" + double he = 0.; // HCAL e deposited in "cluster" + double hoe = 0.; // HO e deposited in "cluster" - int max = dEta.size(); // 4 + int max = dEta.size(); // 4 for (hit_itr = hits->begin(); hit_itr < hits->end(); hit_itr++) { - double e = hit_itr->e(); double t = hit_itr->t(); double eta = hit_itr->eta(); @@ -503,13 +452,11 @@ void SimG4HcalValidation::nxNAnalysis(PHcalValidInfoNxN &product) { // NxN calulation - if (fabs(eta0 - eta) <= dEta[max - 1] && - fabs(phi0 - phi) <= dPhi[max - 1]) { + if (fabs(eta0 - eta) <= dEta[max - 1] && fabs(phi0 - phi) <= dPhi[max - 1]) { etot += e; if (type == 10 || type == 11 || type == 12) ee += e; - if (type == static_cast(HcalBarrel) || - type == static_cast(HcalEndcap) || + if (type == static_cast(HcalBarrel) || type == static_cast(HcalEndcap) || type == static_cast(HcalForward)) { he += e; if (type == static_cast(HcalBarrel) && layer > 17) @@ -517,12 +464,10 @@ void SimG4HcalValidation::nxNAnalysis(PHcalValidInfoNxN &product) { // which concrete i-th square ? for (int i = 0; i < max; i++) { - if ((eta0 - eta) <= dEta[i] && (eta0 - eta) >= -dEta[i] && - (phi0 - phi) <= dPhi[i] && (phi0 - phi) >= -dPhi[i]) { - + if ((eta0 - eta) <= dEta[i] && (eta0 - eta) >= -dEta[i] && (phi0 - phi) <= dPhi[i] && + (phi0 - phi) >= -dPhi[i]) { LogDebug("ValidHcal") << "SimG4HcalValidation:: nxNAnalysis eta0," - << " phi0 = " << eta0 << " " << phi0 - << " type, layer = " << type << "," << layer + << " phi0 = " << eta0 << " " << phi0 << " type, layer = " << type << "," << layer << " eta, phi = " << eta << " " << phi; product.fillTProfileNxN(e, i, t); @@ -542,7 +487,6 @@ void SimG4HcalValidation::nxNAnalysis(PHcalValidInfoNxN &product) { //----------------------------------------------------------------------------- void SimG4HcalValidation::jetAnalysis(PHcalValidInfoJets &product) { - std::vector *hhit = &hitcache; jetf->setInput(hhit); @@ -552,30 +496,27 @@ void SimG4HcalValidation::jetAnalysis(PHcalValidInfoJets &product) { std::vector::iterator clus_itr; - LogDebug("ValidHcal") << "\n ---------- Final list of " << (*result).size() - << " clusters ---------------"; + LogDebug("ValidHcal") << "\n ---------- Final list of " << (*result).size() << " clusters ---------------"; for (clus_itr = result->begin(); clus_itr < result->end(); clus_itr++) LogDebug("ValidHcal") << (*clus_itr); std::vector enevec, etavec, phivec; if (!(*result).empty()) { - sort((*result).begin(), (*result).end()); - clus_itr = result->begin(); // first cluster only + clus_itr = result->begin(); // first cluster only double etac = clus_itr->eta(); double phic = clus_itr->phi(); - double ecal_collect = 0.; // collect Ecal energy in the cone + double ecal_collect = 0.; // collect Ecal energy in the cone if (!hcalOnly) { ecal_collect = clus_itr->collectEcalEnergyR(); } else { collectEnergyRdir(etac, phic); ecal_collect = een; } - LogDebug("ValidHcal") << " JetAnalysis ===> ecal_collect = " - << ecal_collect; + LogDebug("ValidHcal") << " JetAnalysis ===> ecal_collect = " << ecal_collect; // eta-phi deviation of the cluster from nominal (eta0, phi0) values double dist = jetf->rDist(eta0, phi0, etac, phic); @@ -599,17 +540,14 @@ void SimG4HcalValidation::jetAnalysis(PHcalValidInfoJets &product) { etot += e; if (hit_itr->det() == 10 || hit_itr->det() == 11 || hit_itr->det() == 12) ee += e; - if (hit_itr->det() == static_cast(HcalBarrel) || - hit_itr->det() == static_cast(HcalEndcap) || + if (hit_itr->det() == static_cast(HcalBarrel) || hit_itr->det() == static_cast(HcalEndcap) || hit_itr->det() == static_cast(HcalForward)) { he += e; - if (hit_itr->det() == static_cast(HcalBarrel) && - hit_itr->layer() > 17) + if (hit_itr->det() == static_cast(HcalBarrel) && hit_itr->layer() > 17) hoe += e; } - if (hit_itr->det() == static_cast(HcalBarrel) || - hit_itr->det() == static_cast(HcalEndcap) || + if (hit_itr->det() == static_cast(HcalBarrel) || hit_itr->det() == static_cast(HcalEndcap) || hit_itr->det() == static_cast(HcalForward)) { product.fillTProfileJet(he, r, t); } @@ -618,8 +556,7 @@ void SimG4HcalValidation::jetAnalysis(PHcalValidInfoJets &product) { product.fillEcollectJet(ee, he, hoe, etot); LogDebug("ValidHcal") << " JetAnalysis ===> after fillEcollectJet: " - << "ee/he/hoe/etot " << ee << "/" << he << "/" << hoe - << "/" << etot; + << "ee/he/hoe/etot " << ee << "/" << he << "/" << hoe << "/" << etot; // Loop over clusters for (clus_itr = result->begin(); clus_itr < result->end(); clus_itr++) { @@ -632,19 +569,15 @@ void SimG4HcalValidation::jetAnalysis(PHcalValidInfoJets &product) { product.fillJets(enevec, etavec, phivec); LogDebug("ValidHcal") << " JetAnalysis ===> after fillJets\n" - << " JetAnalysis ===> (*result).size() " - << (*result).size(); + << " JetAnalysis ===> (*result).size() " << (*result).size(); // Di-jet mass if (etavec.size() > 1) { - if (etavec[0] > -2.5 && etavec[0] < 2.5 && etavec[1] > -2.5 && - etavec[1] < 2.5) { - + if (etavec[0] > -2.5 && etavec[0] < 2.5 && etavec[1] > -2.5 && etavec[1] < 2.5) { LogDebug("ValidHcal") << " JetAnalysis ===> Di-jet mass enter\n" << " JetAnalysis ===> Di-jet vectors "; for (unsigned int i = 0; i < enevec.size(); i++) - LogDebug("ValidHcal") << " e, eta, phi = " << enevec[i] << " " - << etavec[i] << " " << phivec[i]; + LogDebug("ValidHcal") << " e, eta, phi = " << enevec[i] << " " << etavec[i] << " " << phivec[i]; double et0 = enevec[0] / cosh(etavec[0]); double px0 = et0 * cos(phivec[0]); @@ -655,13 +588,10 @@ void SimG4HcalValidation::jetAnalysis(PHcalValidInfoJets &product) { double py1 = et1 * sin(phivec[1]); double pz1 = et1 * sinh(etavec[1]); - double dijetmass2 = (enevec[0] + enevec[1]) * (enevec[0] + enevec[1]) - - (px1 + px0) * (px1 + px0) - - (py1 + py0) * (py1 + py0) - - (pz1 + pz0) * (pz1 + pz0); + double dijetmass2 = (enevec[0] + enevec[1]) * (enevec[0] + enevec[1]) - (px1 + px0) * (px1 + px0) - + (py1 + py0) * (py1 + py0) - (pz1 + pz0) * (pz1 + pz0); - LogDebug("ValidHcal") - << " JetAnalysis ===> Di-jet massSQ " << dijetmass2; + LogDebug("ValidHcal") << " JetAnalysis ===> Di-jet massSQ " << dijetmass2; double dijetmass; if (dijetmass2 >= 0.) @@ -679,9 +609,7 @@ void SimG4HcalValidation::jetAnalysis(PHcalValidInfoJets &product) { //--------------------------------------------------- void SimG4HcalValidation::fetchHits(PHcalValidInfoLayer &product) { - - LogDebug("ValidHcal") << "Enter SimG4HcalValidation::fetchHits with " - << hitcache.size() << " hits"; + LogDebug("ValidHcal") << "Enter SimG4HcalValidation::fetchHits with " << hitcache.size() << " hits"; int nHit = hitcache.size(); int hit = 0; int i; @@ -690,8 +618,7 @@ void SimG4HcalValidation::fetchHits(PHcalValidInfoLayer &product) { for (i = 0, itr = hitcache.begin(); itr != hitcache.end(); i++, itr++) { uint32_t unitID = itr->id(); int subdet, zside, group, ieta, iphi, lay; - HcalTestNumbering::unpackHcalIndex(unitID, subdet, zside, group, ieta, iphi, - lay); + HcalTestNumbering::unpackHcalIndex(unitID, subdet, zside, group, ieta, iphi, lay); subdet = itr->det(); lay = itr->layer(); group = (subdet & 15) << 20; @@ -701,28 +628,22 @@ void SimG4HcalValidation::fetchHits(PHcalValidInfoLayer &product) { group += (iphi & 127); itr->setId(group); lhits[i] = &hitcache[i]; - LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Original " << i - << " " << hitcache[i] << "\n" - << "SimG4HcalValidation::fetchHits:Copied " << i - << " " << *lhits[i]; + LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Original " << i << " " << hitcache[i] << "\n" + << "SimG4HcalValidation::fetchHits:Copied " << i << " " << *lhits[i]; } sort(lhits.begin(), lhits.end(), CaloHitIdMore()); std::vector::iterator k1, k2; for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++) - LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Sorted " << i - << " " << **k1; + LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Sorted " << i << " " << **k1; int nHits = 0; for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++) { double ehit = (**k1).e(); double t = (**k1).t(); uint32_t unitID = (**k1).id(); int jump = 0; - LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Start " << i - << " U/T/E" - << " 0x" << std::hex << unitID << std::dec << " " << t - << " " << ehit; - for (k2 = k1 + 1; k2 != lhits.end() && (t - (**k2).t()) < 1 && - (t - (**k2).t()) > -1 && unitID == (**k2).id(); + LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Start " << i << " U/T/E" + << " 0x" << std::hex << unitID << std::dec << " " << t << " " << ehit; + for (k2 = k1 + 1; k2 != lhits.end() && (t - (**k2).t()) < 1 && (t - (**k2).t()) > -1 && unitID == (**k2).id(); k2++) { ehit += (**k2).e(); LogDebug("ValidHcal") << "\t + " << (**k2).e(); @@ -742,37 +663,28 @@ void SimG4HcalValidation::fetchHits(PHcalValidInfoLayer &product) { product.fillHits(nHits, lay, subdet, eta, phi, ehit, t); nHits++; - LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Hit " << nHits - << " " << i << " ID 0x" << std::hex << unitID - << " det " << std::dec << subdet << " " << lay - << " " << zside << " " << ieta << " " << iphi - << " Time " << t << " E " << ehit; + LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits:Hit " << nHits << " " << i << " ID 0x" << std::hex + << unitID << " det " << std::dec << subdet << " " << lay << " " << zside << " " << ieta + << " " << iphi << " Time " << t << " E " << ehit; i += jump; k1 += jump; } - LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits called with " << nHit - << " hits" - << " and writes out " << nHits << '(' << hit - << ") hits"; + LogDebug("ValidHcal") << "SimG4HcalValidation::fetchHits called with " << nHit << " hits" + << " and writes out " << nHits << '(' << hit << ") hits"; } //--------------------------------------------------- -void SimG4HcalValidation::clear() { - hitcache.erase(hitcache.begin(), hitcache.end()); -} +void SimG4HcalValidation::clear() { hitcache.erase(hitcache.begin(), hitcache.end()); } //--------------------------------------------------- -void SimG4HcalValidation::collectEnergyRdir(const double eta0, - const double phi0) { - +void SimG4HcalValidation::collectEnergyRdir(const double eta0, const double phi0) { std::vector *hits = &hitcache; std::vector::iterator hit_itr; double sume = 0., sumh = 0., sumho = 0.; for (hit_itr = hits->begin(); hit_itr < hits->end(); hit_itr++) { - double e = hit_itr->e(); double eta = hit_itr->eta(); double phi = hit_itr->phi(); @@ -798,7 +710,6 @@ void SimG4HcalValidation::collectEnergyRdir(const double eta0, //--------------------------------------------------- double SimG4HcalValidation::getHcalScale(std::string det, int layer) const { - double tmp = 0.; if (det == "HB") { diff --git a/Validation/HcalHits/src/SimHitsValidationHcal.cc b/Validation/HcalHits/src/SimHitsValidationHcal.cc index 6c15cbed14994..8f3b3775eac4b 100644 --- a/Validation/HcalHits/src/SimHitsValidationHcal.cc +++ b/Validation/HcalHits/src/SimHitsValidationHcal.cc @@ -6,26 +6,20 @@ #define DebugLog SimHitsValidationHcal::SimHitsValidationHcal(const edm::ParameterSet &ps) { - g4Label_ = ps.getParameter("ModuleLabel"); hcalHits_ = ps.getParameter("HitCollection"); verbose_ = ps.getParameter("Verbose"); testNumber_ = ps.getParameter("TestNumber"); - tok_hits_ = - consumes(edm::InputTag(g4Label_, hcalHits_)); + tok_hits_ = consumes(edm::InputTag(g4Label_, hcalHits_)); - edm::LogInfo("HitsValidationHcal") - << "Module Label: " << g4Label_ << " Hits: " << hcalHits_ - << " TestNumbering " << testNumber_; + edm::LogInfo("HitsValidationHcal") << "Module Label: " << g4Label_ << " Hits: " << hcalHits_ << " TestNumbering " + << testNumber_; } SimHitsValidationHcal::~SimHitsValidationHcal() {} -void SimHitsValidationHcal::bookHistograms(DQMStore::IBooker &ib, - edm::Run const &run, - edm::EventSetup const &es) { - +void SimHitsValidationHcal::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, edm::EventSetup const &es) { edm::ESHandle pHRNDC; es.get().get(pHRNDC); hcons = &(*pHRNDC); @@ -83,12 +77,10 @@ void SimHitsValidationHcal::bookHistograms(DQMStore::IBooker &ib, // int ieta_bins_HO = (int) (ieta_max_HO - ieta_min_HO); #ifdef DebugLog - edm::LogInfo("HitsValidationHcal") - << " Maximum Depths HB:" << maxDepthHB_ << " HE:" << maxDepthHE_ - << " HO:" << maxDepthHO_ << " HF:" << maxDepthHF_; + edm::LogInfo("HitsValidationHcal") << " Maximum Depths HB:" << maxDepthHB_ << " HE:" << maxDepthHE_ + << " HO:" << maxDepthHO_ << " HF:" << maxDepthHF_; #endif - std::vector> divisions = - getHistogramTypes(); + std::vector> divisions = getHistogramTypes(); edm::LogInfo("HitsValidationHcal") << "Booking the Histograms"; ib.setCurrentFolder("HcalHitsV/SimHitsValidationHcal"); @@ -99,44 +91,32 @@ void SimHitsValidationHcal::bookHistograms(DQMStore::IBooker &ib, for (unsigned int i = 0; i < types.size(); ++i) { etaRange limit = getLimits(types[i]); sprintf(name, "HcalHitEta%s", divisions[i].first.c_str()); - sprintf(title, "Hit energy as a function of eta tower index in %s", - divisions[i].second.c_str()); - meHcalHitEta_.push_back( - ib.book1D(name, title, limit.bins, limit.low, limit.high)); + sprintf(title, "Hit energy as a function of eta tower index in %s", divisions[i].second.c_str()); + meHcalHitEta_.push_back(ib.book1D(name, title, limit.bins, limit.low, limit.high)); sprintf(name, "HcalHitTimeAEta%s", divisions[i].first.c_str()); - sprintf(title, "Hit time as a function of eta tower index in %s", - divisions[i].second.c_str()); - meHcalHitTimeEta_.push_back( - ib.book1D(name, title, limit.bins, limit.low, limit.high)); + sprintf(title, "Hit time as a function of eta tower index in %s", divisions[i].second.c_str()); + meHcalHitTimeEta_.push_back(ib.book1D(name, title, limit.bins, limit.low, limit.high)); sprintf(name, "HcalHitE25%s", divisions[i].first.c_str()); - sprintf(title, "Energy in time window 0 to 25 for a tower in %s", - divisions[i].second.c_str()); - meHcalEnergyl25_.push_back(ib.book2D(name, title, limit.bins, limit.low, - limit.high, iphi_bins, iphi_min, - iphi_max)); + sprintf(title, "Energy in time window 0 to 25 for a tower in %s", divisions[i].second.c_str()); + meHcalEnergyl25_.push_back( + ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max)); sprintf(name, "HcalHitE50%s", divisions[i].first.c_str()); - sprintf(title, "Energy in time window 0 to 50 for a tower in %s", - divisions[i].second.c_str()); - meHcalEnergyl50_.push_back(ib.book2D(name, title, limit.bins, limit.low, - limit.high, iphi_bins, iphi_min, - iphi_max)); + sprintf(title, "Energy in time window 0 to 50 for a tower in %s", divisions[i].second.c_str()); + meHcalEnergyl50_.push_back( + ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max)); sprintf(name, "HcalHitE100%s", divisions[i].first.c_str()); - sprintf(title, "Energy in time window 0 to 100 for a tower in %s", - divisions[i].second.c_str()); - meHcalEnergyl100_.push_back(ib.book2D(name, title, limit.bins, limit.low, - limit.high, iphi_bins, iphi_min, - iphi_max)); + sprintf(title, "Energy in time window 0 to 100 for a tower in %s", divisions[i].second.c_str()); + meHcalEnergyl100_.push_back( + ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max)); sprintf(name, "HcalHitE250%s", divisions[i].first.c_str()); - sprintf(title, "Energy in time window 0 to 250 for a tower in %s", - divisions[i].second.c_str()); - meHcalEnergyl250_.push_back(ib.book2D(name, title, limit.bins, limit.low, - limit.high, iphi_bins, iphi_min, - iphi_max)); + sprintf(title, "Energy in time window 0 to 250 for a tower in %s", divisions[i].second.c_str()); + meHcalEnergyl250_.push_back( + ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max)); } sprintf(name, "Energy_HB"); @@ -167,12 +147,9 @@ void SimHitsValidationHcal::bookHistograms(DQMStore::IBooker &ib, metime_enweighted_HF = ib.book1D(name, name, 300, -150, 150); } -void SimHitsValidationHcal::analyze(const edm::Event &e, - const edm::EventSetup &) { - +void SimHitsValidationHcal::analyze(const edm::Event &e, const edm::EventSetup &) { #ifdef DebugLog - edm::LogInfo("HitsValidationHcal") - << "Run = " << e.id().run() << " Event = " << e.id().event(); + edm::LogInfo("HitsValidationHcal") << "Run = " << e.id().run() << " Event = " << e.id().event(); #endif std::vector caloHits; edm::Handle hitsHcal; @@ -182,8 +159,7 @@ void SimHitsValidationHcal::analyze(const edm::Event &e, if (hitsHcal.isValid()) getHits = true; #ifdef DebugLog - edm::LogInfo("HitsValidationHcal") - << "HitsValidationHcal.: Input flags Hits " << getHits; + edm::LogInfo("HitsValidationHcal") << "HitsValidationHcal.: Input flags Hits " << getHits; #endif if (getHits) { caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end()); @@ -201,15 +177,13 @@ void SimHitsValidationHcal::analyze(const edm::Event &e, } } #ifdef DebugLog - edm::LogInfo("HitsValidationHcal") - << "HitsValidationHcal: Hit buffer " << caloHits.size(); + edm::LogInfo("HitsValidationHcal") << "HitsValidationHcal: Hit buffer " << caloHits.size(); #endif analyzeHits(caloHits); } } void SimHitsValidationHcal::analyzeHits(std::vector &hits) { - int nHit = hits.size(); double entotHB = 0, entotHE = 0, entotHF = 0, entotHO = 0; double timetotHB = 0, timetotHE = 0, timetotHF = 0, timetotHO = 0; @@ -266,12 +240,10 @@ void SimHitsValidationHcal::analyzeHits(std::vector &hits) { map_try[id0] = ensum; #ifdef DebugLog - edm::LogInfo("HitsValidationHcal") - << "Hit[" << i << "] ID " << std::dec << " " << id << std::dec - << " Det " << id.det() << " Sub " << subdet << " depth " << depth - << " depthX " << dep << " Eta " << eta << " Phi " << id.iphi() << " E " - << energy << " time " << time << " type " << types.first << " " - << types.second; + edm::LogInfo("HitsValidationHcal") << "Hit[" << i << "] ID " << std::dec << " " << id << std::dec << " Det " + << id.det() << " Sub " << subdet << " depth " << depth << " depthX " << dep + << " Eta " << eta << " Phi " << id.iphi() << " E " << energy << " time " << time + << " type " << types.first << " " << types.second; #endif double etax = eta - 0.5; @@ -305,8 +277,7 @@ void SimHitsValidationHcal::analyzeHits(std::vector &hits) { for (itr = map_try.begin(); itr != map_try.end(); ++itr) { HcalDetId id = (*itr).first.first; energysum ensum = (*itr).second; - std::pair types = - histId((int)(id.subdet()), id.ieta(), id.depth(), (*itr).first.second); + std::pair types = histId((int)(id.subdet()), id.ieta(), id.depth(), (*itr).first.second); int eta = id.ieta(); int phi = id.iphi(); double etax = eta - 0.5; @@ -325,18 +296,16 @@ void SimHitsValidationHcal::analyzeHits(std::vector &hits) { } #ifdef DebugLog - edm::LogInfo("HitsValidationHcal") - << " energy of tower =" << (*itr).first.first - << " in time 25ns is == " << (*itr).second.e25 - << " in time 25-50ns == " << (*itr).second.e50 - << " in time 50-100ns == " << (*itr).second.e100 - << " in time 100-250 ns == " << (*itr).second.e250; + edm::LogInfo("HitsValidationHcal") << " energy of tower =" << (*itr).first.first + << " in time 25ns is == " << (*itr).second.e25 + << " in time 25-50ns == " << (*itr).second.e50 + << " in time 50-100ns == " << (*itr).second.e100 + << " in time 100-250 ns == " << (*itr).second.e250; #endif } } SimHitsValidationHcal::etaRange SimHitsValidationHcal::getLimits(idType type) { - int bins; std::pair range; double low, high; @@ -377,29 +346,24 @@ SimHitsValidationHcal::etaRange SimHitsValidationHcal::getLimits(idType type) { high = 41; } #ifdef DebugLog - edm::LogInfo("HitsValidationHcal") - << "Subdetector:" << type.subdet << " z:" << type.z - << " range.first:" << range.first << " and second:" << range.second; - edm::LogInfo("HitsValidationHcal") - << "bins: " << bins << " low:" << low << " high:" << high; + edm::LogInfo("HitsValidationHcal") << "Subdetector:" << type.subdet << " z:" << type.z + << " range.first:" << range.first << " and second:" << range.second; + edm::LogInfo("HitsValidationHcal") << "bins: " << bins << " low:" << low << " high:" << high; #endif return SimHitsValidationHcal::etaRange(bins, low, high); } -std::pair SimHitsValidationHcal::histId(int subdet, int eta, - int depth, unsigned int dep) { - +std::pair SimHitsValidationHcal::histId(int subdet, int eta, int depth, unsigned int dep) { int id1(-1), id2(-1); for (unsigned int k = 0; k < types.size(); ++k) { if (subdet == HcalForward) { - if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 && - eta * types[k].z > 0 && dep == (unsigned int)(types[k].depth2)) { + if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 && eta * types[k].z > 0 && + dep == (unsigned int)(types[k].depth2)) { id1 = k; break; } } else if (subdet == HcalEndcap) { - if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 && - eta * types[k].z > 0) { + if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 && eta * types[k].z > 0) { id1 = k; break; } @@ -421,9 +385,7 @@ std::pair SimHitsValidationHcal::histId(int subdet, int eta, return std::pair(id1, id2); } -std::vector> -SimHitsValidationHcal::getHistogramTypes() { - +std::vector> SimHitsValidationHcal::getHistogramTypes() { int maxDepth = std::max(maxDepthHB_, maxDepthHE_); maxDepth = std::max(maxDepth, maxDepthHF_); maxDepth = std::max(maxDepth, maxDepthHO_); @@ -436,8 +398,7 @@ SimHitsValidationHcal::getHistogramTypes() { for (int depth = 0; depth < maxDepth; ++depth) { snprintf(name1, 40, "HC%d", depth); snprintf(name2, 40, "HCAL depth%d", depth + 1); - names = std::pair(std::string(name1), - std::string(name2)); + names = std::pair(std::string(name1), std::string(name2)); type = SimHitsValidationHcal::idType(HcalEmpty, 0, depth + 1, depth + 1); divisions.push_back(names); types.push_back(type); @@ -446,8 +407,7 @@ SimHitsValidationHcal::getHistogramTypes() { for (int depth = 0; depth < maxDepthHB_; ++depth) { snprintf(name1, 40, "HB%d", depth); snprintf(name2, 40, "HB depth%d", depth + 1); - names = std::pair(std::string(name1), - std::string(name2)); + names = std::pair(std::string(name1), std::string(name2)); type = SimHitsValidationHcal::idType(HcalBarrel, 0, depth + 1, depth + 1); divisions.push_back(names); types.push_back(type); @@ -456,15 +416,13 @@ SimHitsValidationHcal::getHistogramTypes() { for (int depth = 0; depth < maxDepthHE_; ++depth) { snprintf(name1, 40, "HE%d+z", depth); snprintf(name2, 40, "HE +z depth%d", depth + 1); - names = std::pair(std::string(name1), - std::string(name2)); + names = std::pair(std::string(name1), std::string(name2)); type = SimHitsValidationHcal::idType(HcalEndcap, 1, depth + 1, depth + 1); divisions.push_back(names); types.push_back(type); snprintf(name1, 40, "HE%d-z", depth); snprintf(name2, 40, "HE -z depth%d", depth + 1); - names = std::pair(std::string(name1), - std::string(name2)); + names = std::pair(std::string(name1), std::string(name2)); type = SimHitsValidationHcal::idType(HcalEndcap, -1, depth + 1, depth + 1); divisions.push_back(names); types.push_back(type); @@ -474,8 +432,7 @@ SimHitsValidationHcal::getHistogramTypes() { int depth = maxDepthHO_; snprintf(name1, 40, "HO%d", depth); snprintf(name2, 40, "HO depth%d", depth); - names = std::pair(std::string(name1), - std::string(name2)); + names = std::pair(std::string(name1), std::string(name2)); type = SimHitsValidationHcal::idType(HcalOuter, 0, depth, depth); divisions.push_back(names); types.push_back(type); @@ -488,17 +445,14 @@ SimHitsValidationHcal::getHistogramTypes() { for (int depth = 0; depth < maxDepthHF_; ++depth) { snprintf(name1, 40, "HF%s%d+z", hfty1[k].c_str(), depth); snprintf(name2, 40, "HF (%s) +z depth%d", hfty2[k].c_str(), depth + 1); - names = std::pair(std::string(name1), - std::string(name2)); + names = std::pair(std::string(name1), std::string(name2)); type = SimHitsValidationHcal::idType(HcalForward, 1, depth + 1, dept0[k]); divisions.push_back(names); types.push_back(type); snprintf(name1, 40, "HF%s%d-z", hfty1[k].c_str(), depth); snprintf(name2, 40, "HF (%s) -z depth%d", hfty2[k].c_str(), depth + 1); - names = std::pair(std::string(name1), - std::string(name2)); - type = - SimHitsValidationHcal::idType(HcalForward, -1, depth + 1, dept0[k]); + names = std::pair(std::string(name1), std::string(name2)); + type = SimHitsValidationHcal::idType(HcalForward, -1, depth + 1, dept0[k]); divisions.push_back(names); types.push_back(type); } @@ -507,8 +461,7 @@ SimHitsValidationHcal::getHistogramTypes() { return divisions; } -void SimHitsValidationHcal::fillDescriptions( - edm::ConfigurationDescriptions &descriptions) { +void SimHitsValidationHcal::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { edm::ParameterSetDescription desc; desc.add("ModuleLabel", "g4SimHits"); desc.add("HitCollection", "HcalHits"); diff --git a/Validation/HcalHits/src/ZdcSimHitStudy.cc b/Validation/HcalHits/src/ZdcSimHitStudy.cc index bbb9de7ed0484..65083c0ec7b8e 100644 --- a/Validation/HcalHits/src/ZdcSimHitStudy.cc +++ b/Validation/HcalHits/src/ZdcSimHitStudy.cc @@ -32,28 +32,23 @@ #include "FWCore/Utilities/interface/Exception.h" ZdcSimHitStudy::ZdcSimHitStudy(const edm::ParameterSet &ps) { - g4Label = ps.getUntrackedParameter("moduleLabel", "g4SimHits"); zdcHits = ps.getUntrackedParameter("HitCollection", "ZdcHits"); - outFile_ = - ps.getUntrackedParameter("outputFile", "zdcHitStudy.root"); + outFile_ = ps.getUntrackedParameter("outputFile", "zdcHitStudy.root"); verbose_ = ps.getUntrackedParameter("Verbose", false); checkHit_ = true; - tok_gen_ = - consumes(edm::InputTag("genParticles")); + tok_gen_ = consumes(edm::InputTag("genParticles")); tok_hits_ = consumes(edm::InputTag(g4Label, zdcHits)); edm::LogInfo("ZdcSimHitStudy") // std::cout - << "Module Label: " << g4Label << " Hits: " << zdcHits << " / " - << checkHit_ << " Output: " << outFile_; + << "Module Label: " << g4Label << " Hits: " << zdcHits << " / " << checkHit_ << " Output: " << outFile_; } ZdcSimHitStudy::~ZdcSimHitStudy() {} -void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, - edm::EventSetup const &es) { +void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, edm::EventSetup const &es) { ib.setCurrentFolder("ZDCValidation"); // Histograms for Hits ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -68,45 +63,37 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, if (checkHit_) { /////////////////////////1/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits"); - meAllZdcNHit_ = - ib.book1D("ZDC Hits", "Number of All Hits in ZDC", 100, 0., 100.); + meAllZdcNHit_ = ib.book1D("ZDC Hits", "Number of All Hits in ZDC", 100, 0., 100.); meAllZdcNHit_->setAxisTitle("Total Hits", 1); meAllZdcNHit_->setAxisTitle("Counts", 2); /////////////////////////2/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/Excess_Info/Debug_Helper"); - meBadZdcDetHit_ = ib.book1D("Hiits with the wrong Det", - "Hits with wrong Det in ZDC", 100, 0., 100.); + meBadZdcDetHit_ = ib.book1D("Hiits with the wrong Det", "Hits with wrong Det in ZDC", 100, 0., 100.); meBadZdcDetHit_->setAxisTitle("Wrong Hits", 1); meBadZdcDetHit_->setAxisTitle("Counts", 2); /////////////////////////3/////////////////////////// - meBadZdcSecHit_ = ib.book1D( - "Wrong Section Hits", "Hits with wrong Section in ZDC", 100, 0., 100.); + meBadZdcSecHit_ = ib.book1D("Wrong Section Hits", "Hits with wrong Section in ZDC", 100, 0., 100.); meBadZdcSecHit_->setAxisTitle("Hits in wrong section", 1); meBadZdcSecHit_->setAxisTitle("Counts", 2); /////////////////////////4/////////////////////////// - meBadZdcIdHit_ = - ib.book1D("Wrong_ID_Hits", "Hits with wrong ID in ZDC", 100, 0., 100.); + meBadZdcIdHit_ = ib.book1D("Wrong_ID_Hits", "Hits with wrong ID in ZDC", 100, 0., 100.); meBadZdcIdHit_->setAxisTitle("Hits with wrong ID", 1); meBadZdcIdHit_->setAxisTitle("Counts", 2); /////////////////////////5/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo"); - meZdcNHitEM_ = - ib.book1D("Hits in EM", "Number of Hits in ZDC EM", 100, 0., 100.); + meZdcNHitEM_ = ib.book1D("Hits in EM", "Number of Hits in ZDC EM", 100, 0., 100.); meZdcNHitEM_->setAxisTitle("EM Hits", 1); meZdcNHitEM_->setAxisTitle("Counts", 2); /////////////////////////6/////////////////////////// - meZdcNHitHad_ = - ib.book1D("Hits in HAD", "Number of Hits in ZDC Had", 100, 0., 100.); + meZdcNHitHad_ = ib.book1D("Hits in HAD", "Number of Hits in ZDC Had", 100, 0., 100.); meZdcNHitHad_->setAxisTitle("HAD Hits", 1); meZdcNHitHad_->setAxisTitle("Counts", 2); /////////////////////////7/////////////////////////// - meZdcNHitLum_ = - ib.book1D("Hits in LUM", "Number of Hits in ZDC Lum", 100, 0., 100.); + meZdcNHitLum_ = ib.book1D("Hits in LUM", "Number of Hits in ZDC Lum", 100, 0., 100.); meZdcNHitLum_->setAxisTitle("LUM Hits", 1); meZdcNHitLum_->setAxisTitle("Counts", 2); /////////////////////////8/////////////////////////// - meZdcDetectHit_ = - ib.book1D("Calo Detector ID", "Calo Detector ID", 50, 0., 50.); + meZdcDetectHit_ = ib.book1D("Calo Detector ID", "Calo Detector ID", 50, 0., 50.); meZdcDetectHit_->setAxisTitle("Detector Hits", 1); meZdcDetectHit_->setAxisTitle("Counts", 2); /////////////////////////9/////////////////////////// @@ -127,13 +114,11 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, meZdcEnergyHit_->setAxisTitle("Counts", 2); meZdcEnergyHit_->setAxisTitle("Energy (GeV)", 1); /////////////////////////13/////////////////////////// - meZdcHadEnergyHit_ = ib.book1D( - "Hit Energy HAD", "Hits Energy in Had Section", 4000, 0., 8000.); + meZdcHadEnergyHit_ = ib.book1D("Hit Energy HAD", "Hits Energy in Had Section", 4000, 0., 8000.); meZdcHadEnergyHit_->setAxisTitle("Counts", 2); meZdcHadEnergyHit_->setAxisTitle("Energy (GeV)", 1); /////////////////////////14/////////////////////////// - meZdcEMEnergyHit_ = ib.book1D("Hit Energy EM", "Hits Energy in EM Section", - 4000, 0., 8000.); + meZdcEMEnergyHit_ = ib.book1D("Hit Energy EM", "Hits Energy in EM Section", 4000, 0., 8000.); meZdcEMEnergyHit_->setAxisTitle("Counts", 2); meZdcEMEnergyHit_->setAxisTitle("Energy (GeV)", 1); /////////////////////////15/////////////////////////// @@ -142,8 +127,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, meZdcTimeHit_->setAxisTitle("Time (ns)", 1); meZdcTimeHit_->setAxisTitle("Counts", 2); /////////////////////////16/////////////////////////// - meZdcTimeWHit_ = ib.book1D("Energy Weighted Time in ZDC", - "Time in ZDC (E wtd)", 300, 0., 600.); + meZdcTimeWHit_ = ib.book1D("Energy Weighted Time in ZDC", "Time in ZDC (E wtd)", 300, 0., 600.); meZdcTimeWHit_->setAxisTitle("Time (ns)", 1); meZdcTimeWHit_->setAxisTitle("Counts", 2); /////////////////////////17/////////////////////////// @@ -151,291 +135,224 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, meZdc10Ene_->setAxisTitle("Log(E) (GeV)", 1); meZdc10Ene_->setAxisTitle("Counts", 2); /////////////////////////18/////////////////////////// - meZdcHadL10EneP_ = - ib.bookProfile("Log(EHAD) vs Contribution", - "Log10Energy in Had ZDC vs Hit contribution", 140, -1., - 20., 100, 0., 1.); + meZdcHadL10EneP_ = ib.bookProfile( + "Log(EHAD) vs Contribution", "Log10Energy in Had ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1.); meZdcHadL10EneP_->setAxisTitle("Log(EHAD) (GeV)", 1); meZdcHadL10EneP_->setAxisTitle("Counts", 2); /////////////////////////19/////////////////////////// meZdcEML10EneP_ = ib.bookProfile( - "Log(EEM) vs Contribution", "Log10Energy in EM ZDC vs Hit contribution", - 140, -1., 20., 100, 0., 1.); + "Log(EEM) vs Contribution", "Log10Energy in EM ZDC vs Hit contribution", 140, -1., 20., 100, 0., 1.); meZdcEML10EneP_->setAxisTitle("Log(EEM) (GeV)", 1); meZdcEML10EneP_->setAxisTitle("Counts", 2); /////////////////////////20/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits"); - meZdcEHadCh_ = - ib.book2D("ZDC EHAD vs Channel", "ZDC Had Section Energy vs Channel", - 4000, 0., 8000., 6, 0., 6.); + meZdcEHadCh_ = ib.book2D("ZDC EHAD vs Channel", "ZDC Had Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6.); meZdcEHadCh_->setAxisTitle("Hadronic Channel Number", 2); meZdcEHadCh_->setAxisTitle("Energy (GeV)", 1); /////////////////////////21/////////////////////////// - meZdcEEMCh_ = - ib.book2D("ZDC EEM vs Channel", "ZDC EM Section Energy vs Channel", - 4000, 0., 8000., 6, 0., 6.); + meZdcEEMCh_ = ib.book2D("ZDC EEM vs Channel", "ZDC EM Section Energy vs Channel", 4000, 0., 8000., 6, 0., 6.); meZdcEEMCh_->setAxisTitle("EM Channel Number", 2); meZdcEEMCh_->setAxisTitle("Energy (GeV)", 1); /////////////////////////22/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/Excess_Info/BasicHitInfo"); - meZdcETime_ = ib.book2D("E vs T", "Hits ZDC Energy vs Time", 4000, 0., - 8000., 300, 0., 600.); + meZdcETime_ = ib.book2D("E vs T", "Hits ZDC Energy vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcETime_->setAxisTitle("Energy (GeV)", 1); meZdcETime_->setAxisTitle("Time (ns)", 2); /////////////////////////23/////////////////////////// - ib.setCurrentFolder( - "ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/NZDC"); - meZdcEneEmN1_ = - ib.book1D("NZDC EM1 Energy", "Energy EM module N1", 4000, 0., 8000.); + ib.setCurrentFolder("ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/NZDC"); + meZdcEneEmN1_ = ib.book1D("NZDC EM1 Energy", "Energy EM module N1", 4000, 0., 8000.); meZdcEneEmN1_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmN1_->setAxisTitle("Counts", 2); /////////////////////////24/////////////////////////// - meZdcEneEmN2_ = - ib.book1D("NZDC EM2 Energy", "Energy EM module N2", 4000, 0., 8000.); + meZdcEneEmN2_ = ib.book1D("NZDC EM2 Energy", "Energy EM module N2", 4000, 0., 8000.); meZdcEneEmN2_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmN2_->setAxisTitle("Counts", 2); /////////////////////////25/////////////////////////// - meZdcEneEmN3_ = - ib.book1D("NZDC EM3 Energy", "Energy EM module N3", 4000, 0., 8000.); + meZdcEneEmN3_ = ib.book1D("NZDC EM3 Energy", "Energy EM module N3", 4000, 0., 8000.); meZdcEneEmN3_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmN3_->setAxisTitle("Counts", 2); /////////////////////////26/////////////////////////// - meZdcEneEmN4_ = - ib.book1D("NZDC EM4 Energy", "Energy EM module N4", 4000, 0., 8000.); + meZdcEneEmN4_ = ib.book1D("NZDC EM4 Energy", "Energy EM module N4", 4000, 0., 8000.); meZdcEneEmN4_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmN4_->setAxisTitle("Counts", 2); /////////////////////////27/////////////////////////// - meZdcEneEmN5_ = - ib.book1D("NZDC EM5 Energy", "Energy EM module N5", 4000, 0., 8000.); + meZdcEneEmN5_ = ib.book1D("NZDC EM5 Energy", "Energy EM module N5", 4000, 0., 8000.); meZdcEneEmN5_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmN5_->setAxisTitle("Counts", 2); /////////////////////////28/////////////////////////// - meZdcEneHadN1_ = - ib.book1D("NZDC HAD1 Energy", "Energy HAD module N1", 4000, 0., 8000.); + meZdcEneHadN1_ = ib.book1D("NZDC HAD1 Energy", "Energy HAD module N1", 4000, 0., 8000.); meZdcEneHadN1_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadN1_->setAxisTitle("Counts", 2); /////////////////////////29/////////////////////////// - meZdcEneHadN2_ = - ib.book1D("NZDC HAD2 Energy", "Energy HAD module N2", 4000, 0., 8000.); + meZdcEneHadN2_ = ib.book1D("NZDC HAD2 Energy", "Energy HAD module N2", 4000, 0., 8000.); meZdcEneHadN2_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadN2_->setAxisTitle("Counts", 2); /////////////////////////30/////////////////////////// - meZdcEneHadN3_ = - ib.book1D("NZDC HAD3 Energy", "Energy HAD module N3", 4000, 0., 8000.); + meZdcEneHadN3_ = ib.book1D("NZDC HAD3 Energy", "Energy HAD module N3", 4000, 0., 8000.); meZdcEneHadN3_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadN3_->setAxisTitle("Counts", 2); /////////////////////////31/////////////////////////// - meZdcEneHadN4_ = - ib.book1D("NZDC HAD4 Energy", "Energy HAD module N4", 4000, 0., 8000.); + meZdcEneHadN4_ = ib.book1D("NZDC HAD4 Energy", "Energy HAD module N4", 4000, 0., 8000.); meZdcEneHadN4_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadN4_->setAxisTitle("Counts", 2); /////////////////////////32/////////////////////////// - ib.setCurrentFolder( - "ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/NZDC"); - meZdcEneTEmN1_ = - ib.book2D("NZDC EM1 Energy vs Time", "Energy EM mod N1 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.setCurrentFolder("ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/NZDC"); + meZdcEneTEmN1_ = ib.book2D("NZDC EM1 Energy vs Time", "Energy EM mod N1 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmN1_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmN1_->setAxisTitle("Time (ns)", 2); /////////////////////////33/////////////////////////// - meZdcEneTEmN2_ = - ib.book2D("NZDC EM2 Energy vs Time", "Energy EM mod N2 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmN2_ = ib.book2D("NZDC EM2 Energy vs Time", "Energy EM mod N2 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmN2_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmN2_->setAxisTitle("Time (ns)", 2); /////////////////////////34/////////////////////////// - meZdcEneTEmN3_ = - ib.book2D("NZDC EM3 Energy vs Time", "Energy EM mod N3 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmN3_ = ib.book2D("NZDC EM3 Energy vs Time", "Energy EM mod N3 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmN3_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmN3_->setAxisTitle("Time (ns)", 2); /////////////////////////35/////////////////////////// - meZdcEneTEmN4_ = - ib.book2D("NZDC EM4 Energy vs Time", "Energy EM mod N4 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmN4_ = ib.book2D("NZDC EM4 Energy vs Time", "Energy EM mod N4 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmN4_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmN4_->setAxisTitle("Time (ns)", 2); /////////////////////////36/////////////////////////// - meZdcEneTEmN5_ = - ib.book2D("NZDC EM5 Energy vs Time", "Energy EM mod N5 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmN5_ = ib.book2D("NZDC EM5 Energy vs Time", "Energy EM mod N5 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmN5_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmN5_->setAxisTitle("Time (ns)", 2); /////////////////////////37/////////////////////////// meZdcEneTHadN1_ = - ib.book2D("NZDC HAD1 Energy vs Time", "Energy HAD mod N1 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("NZDC HAD1 Energy vs Time", "Energy HAD mod N1 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadN1_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadN1_->setAxisTitle("Time (ns)", 2); /////////////////////////38/////////////////////////// meZdcEneTHadN2_ = - ib.book2D("NZDC HAD2 Energy vs Time", "Energy HAD mod N2 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("NZDC HAD2 Energy vs Time", "Energy HAD mod N2 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadN2_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadN2_->setAxisTitle("Time (ns)", 2); /////////////////////////39/////////////////////////// meZdcEneTHadN3_ = - ib.book2D("NZDC HAD3 Energy vs Time", "Energy HAD mod N3 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("NZDC HAD3 Energy vs Time", "Energy HAD mod N3 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadN3_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadN3_->setAxisTitle("Time (ns)", 2); /////////////////////////40/////////////////////////// meZdcEneTHadN4_ = - ib.book2D("NZDC HAD4 Energy vs Time", "Energy HAD mod N4 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("NZDC HAD4 Energy vs Time", "Energy HAD mod N4 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadN4_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadN4_->setAxisTitle("Time (ns)", 2); /////////////////////////41/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/ENERGY_SUMS/NZDC"); - meZdcEneHadNTot_ = - ib.book1D("NZDC EHAD", "Total N-ZDC HAD Energy", 4000, 0., 4000.); + meZdcEneHadNTot_ = ib.book1D("NZDC EHAD", "Total N-ZDC HAD Energy", 4000, 0., 4000.); meZdcEneHadNTot_->setAxisTitle("Counts", 2); meZdcEneHadNTot_->setAxisTitle("Energy (GeV)", 1); /////////////////////////42/////////////////////////// - meZdcEneEmNTot_ = - ib.book1D("NZDC EEM", "Total N-ZDC EM Energy", 3000, 0., 3000.); + meZdcEneEmNTot_ = ib.book1D("NZDC EEM", "Total N-ZDC EM Energy", 3000, 0., 3000.); meZdcEneEmNTot_->setAxisTitle("Counts", 2); meZdcEneEmNTot_->setAxisTitle("Energy (GeV)", 1); /////////////////////////43/////////////////////////// - meZdcEneNTot_ = - ib.book1D("NZDC ETOT", "Total N-ZDC Energy ", 7000, 0., 7000.); + meZdcEneNTot_ = ib.book1D("NZDC ETOT", "Total N-ZDC Energy ", 7000, 0., 7000.); meZdcEneNTot_->setAxisTitle("Counts", 2); meZdcEneNTot_->setAxisTitle("Energy (GeV)", 1); /////////////////////////44/////////////////////////// - ib.setCurrentFolder( - "ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/PZDC"); - meZdcEneEmP1_ = - ib.book1D("PZDC EM1 Energy", "Energy EM module P1", 3000, 0., 3000.); + ib.setCurrentFolder("ZDCValidation/ZdcSimHits/ENERGY_SUMS/Individual_Channels/PZDC"); + meZdcEneEmP1_ = ib.book1D("PZDC EM1 Energy", "Energy EM module P1", 3000, 0., 3000.); meZdcEneEmP1_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmP1_->setAxisTitle("Counts", 2); /////////////////////////45/////////////////////////// - meZdcEneEmP2_ = - ib.book1D("PZDC EM2 Energy", "Energy EM module P2", 3000, 0., 3000.); + meZdcEneEmP2_ = ib.book1D("PZDC EM2 Energy", "Energy EM module P2", 3000, 0., 3000.); meZdcEneEmP2_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmP2_->setAxisTitle("Counts", 2); /////////////////////////46/////////////////////////// - meZdcEneEmP3_ = - ib.book1D("PZDC EM3 Energy", "Energy EM module P3", 3000, 0., 3000.); + meZdcEneEmP3_ = ib.book1D("PZDC EM3 Energy", "Energy EM module P3", 3000, 0., 3000.); meZdcEneEmP3_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmP3_->setAxisTitle("Counts", 2); /////////////////////////47/////////////////////////// - meZdcEneEmP4_ = - ib.book1D("PZDC EM4 Energy", "Energy EM module P4", 3000, 0., 3000.); + meZdcEneEmP4_ = ib.book1D("PZDC EM4 Energy", "Energy EM module P4", 3000, 0., 3000.); meZdcEneEmP4_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmP4_->setAxisTitle("Counts", 2); /////////////////////////48/////////////////////////// - meZdcEneEmP5_ = - ib.book1D("PZDC EM5 Energy", "Energy EM module P5", 3000, 0., 3000.); + meZdcEneEmP5_ = ib.book1D("PZDC EM5 Energy", "Energy EM module P5", 3000, 0., 3000.); meZdcEneEmP5_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmP5_->setAxisTitle("Counts", 2); /////////////////////////49/////////////////////////// - meZdcEneHadP1_ = - ib.book1D("PZDC HAD1 Energy", "Energy HAD module P1", 3000, 0., 3000.); + meZdcEneHadP1_ = ib.book1D("PZDC HAD1 Energy", "Energy HAD module P1", 3000, 0., 3000.); meZdcEneHadP1_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadP1_->setAxisTitle("Counts", 2); /////////////////////////50/////////////////////////// - meZdcEneHadP2_ = - ib.book1D("PZDC HAD2 Energy", "Energy HAD module P2", 3000, 0., 3000.); + meZdcEneHadP2_ = ib.book1D("PZDC HAD2 Energy", "Energy HAD module P2", 3000, 0., 3000.); meZdcEneHadP2_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadP2_->setAxisTitle("Counts", 2); /////////////////////////51/////////////////////////// - meZdcEneHadP3_ = - ib.book1D("PZDC HAD3 Energy", "Energy HAD module P3", 3000, 0., 3000.); + meZdcEneHadP3_ = ib.book1D("PZDC HAD3 Energy", "Energy HAD module P3", 3000, 0., 3000.); meZdcEneHadP3_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadP3_->setAxisTitle("Counts", 2); /////////////////////////52/////////////////////////// - meZdcEneHadP4_ = - ib.book1D("PZDC HAD4 Energy", "Energy HAD module P4", 3000, 0., 3000.); + meZdcEneHadP4_ = ib.book1D("PZDC HAD4 Energy", "Energy HAD module P4", 3000, 0., 3000.); meZdcEneHadP4_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadP4_->setAxisTitle("Counts", 2); /////////////////////////53/////////////////////////// - ib.setCurrentFolder( - "ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/PZDC"); - meZdcEneTEmP1_ = - ib.book2D("PZDC EM1 Energy vs Time", "Energy EM mod P1 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.setCurrentFolder("ZDCValidation/ZdcSimHits/Excess_Info/Individual_ChannelvsTime/PZDC"); + meZdcEneTEmP1_ = ib.book2D("PZDC EM1 Energy vs Time", "Energy EM mod P1 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmP1_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmP1_->setAxisTitle("Time (ns)", 2); /////////////////////////54/////////////////////////// - meZdcEneTEmP2_ = - ib.book2D("PZDC EM2 Energy vs Time", "Energy EM mod P2 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmP2_ = ib.book2D("PZDC EM2 Energy vs Time", "Energy EM mod P2 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmP2_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmP2_->setAxisTitle("Time (ns)", 2); /////////////////////////55/////////////////////////// - meZdcEneTEmP3_ = - ib.book2D("PZDC EM3 Energy vs Time", "Energy EM mod P3 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmP3_ = ib.book2D("PZDC EM3 Energy vs Time", "Energy EM mod P3 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmP3_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmP3_->setAxisTitle("Time (ns)", 2); /////////////////////////56/////////////////////////// - meZdcEneTEmP4_ = - ib.book2D("PZDC EM4 Energy vs Time", "Energy EM mod P4 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmP4_ = ib.book2D("PZDC EM4 Energy vs Time", "Energy EM mod P4 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmP4_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmP4_->setAxisTitle("Time (ns)", 2); /////////////////////////57/////////////////////////// - meZdcEneTEmP5_ = - ib.book2D("PZDC EM5 Energy vs Time", "Energy EM mod P5 vs Time", 4000, - 0., 8000., 300, 0., 600.); + meZdcEneTEmP5_ = ib.book2D("PZDC EM5 Energy vs Time", "Energy EM mod P5 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTEmP5_->setAxisTitle("Energy (GeV)", 1); meZdcEneTEmP5_->setAxisTitle("Time (ns)", 2); /////////////////////////58/////////////////////////// meZdcEneTHadP1_ = - ib.book2D("PZDC HAD1 Energy vs Time", "Energy HAD mod P1 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("PZDC HAD1 Energy vs Time", "Energy HAD mod P1 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadP1_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadP1_->setAxisTitle("Time (ns)", 2); /////////////////////////59/////////////////////////// meZdcEneTHadP2_ = - ib.book2D("PZDC HAD2 Energy vs Time", "Energy HAD mod P2 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("PZDC HAD2 Energy vs Time", "Energy HAD mod P2 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadP2_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadP2_->setAxisTitle("Time (ns)", 2); /////////////////////////60/////////////////////////// meZdcEneTHadP3_ = - ib.book2D("PZDC HAD3 Energy vs Time", "Energy HAD mod P3 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("PZDC HAD3 Energy vs Time", "Energy HAD mod P3 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadP3_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadP3_->setAxisTitle("Time (ns)", 2); /////////////////////////61/////////////////////////// meZdcEneTHadP4_ = - ib.book2D("PZDC HAD4 Energy vs Time", "Energy HAD mod P4 vs Time", 4000, - 0., 8000., 300, 0., 600.); + ib.book2D("PZDC HAD4 Energy vs Time", "Energy HAD mod P4 vs Time", 4000, 0., 8000., 300, 0., 600.); meZdcEneTHadP4_->setAxisTitle("Energy (GeV)", 1); meZdcEneTHadP4_->setAxisTitle("Time (ns)", 2); /////////////////////////62///////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/ENERGY_SUMS/PZDC"); - meZdcEneHadPTot_ = - ib.book1D("PZDC EHAD", "Total P-ZDC HAD Energy", 10000, 0., 10000.); + meZdcEneHadPTot_ = ib.book1D("PZDC EHAD", "Total P-ZDC HAD Energy", 10000, 0., 10000.); meZdcEneHadPTot_->setAxisTitle("Energy (GeV)", 1); meZdcEneHadPTot_->setAxisTitle("Counts", 2); /////////////////////////63/////////////////////////// - meZdcEneEmPTot_ = - ib.book1D("PZDC EEM", "Total P-ZDC EM Energy", 10000, 0., 10000.); + meZdcEneEmPTot_ = ib.book1D("PZDC EEM", "Total P-ZDC EM Energy", 10000, 0., 10000.); meZdcEneEmPTot_->setAxisTitle("Energy (GeV)", 1); meZdcEneEmPTot_->setAxisTitle("Counts", 2); /////////////////////////64/////////////////////////// - meZdcEnePTot_ = - ib.book1D("PZDC ETOT", "Total P-ZDC Energy", 10000, 0., 10000.); + meZdcEnePTot_ = ib.book1D("PZDC ETOT", "Total P-ZDC Energy", 10000, 0., 10000.); meZdcEnePTot_->setAxisTitle("Energy (GeV)", 1); meZdcEnePTot_->setAxisTitle("Counts", 2); /////////////////////////65/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/ENERGY_SUMS/NZDC"); - meZdcCorEEmNEHadN_ = ib.book2D("NZDC EMvHAD", "N-ZDC Energy EM vs HAD", - 3000, 0., 3000., 3000, 0., 3000.); + meZdcCorEEmNEHadN_ = ib.book2D("NZDC EMvHAD", "N-ZDC Energy EM vs HAD", 3000, 0., 3000., 3000, 0., 3000.); meZdcCorEEmNEHadN_->setAxisTitle("EM Energy (GeV)", 1); meZdcCorEEmNEHadN_->setAxisTitle("HAD Energy (GeV)", 2); /////////////////////////66/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/ENERGY_SUMS/PZDC"); - meZdcCorEEmPEHadP_ = ib.book2D("PZDC EMvHAD", "P-ZDC Energy EM vs HAD", - 3000, 0., 3000., 3000, 0., 3000.); + meZdcCorEEmPEHadP_ = ib.book2D("PZDC EMvHAD", "P-ZDC Energy EM vs HAD", 3000, 0., 3000., 3000, 0., 3000.); meZdcCorEEmPEHadP_->setAxisTitle("EM Energy (GeV)", 1); meZdcCorEEmPEHadP_->setAxisTitle("HAD Energy (GeV)", 2); /////////////////////////67/////////////////////////// ib.setCurrentFolder("ZDCValidation/ZdcSimHits/ENERGY_SUMS"); - meZdcCorEtotNEtotP_ = ib.book2D("PZDC vs NZDC", "Energy N-ZDC vs P-ZDC", - 3000, 0., 3000., 3000, 0., 3000.); + meZdcCorEtotNEtotP_ = ib.book2D("PZDC vs NZDC", "Energy N-ZDC vs P-ZDC", 3000, 0., 3000., 3000, 0., 3000.); meZdcCorEtotNEtotP_->setAxisTitle("N-ZDC Total Energy (GeV)", 1); meZdcCorEtotNEtotP_->setAxisTitle("P-ZDC Total Energy (GeV)", 2); /////////////////////////68/////////////////////////// @@ -451,8 +368,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, ib.setCurrentFolder("ZDCValidation/GenParticles/Forward"); ////////////////////////////////////////////////////////////////////////////// ///////////////////////////////69///////////////////////////////////////////// - genpart_Pi0F = ib.book2D("Pi0_Forward", "Forward Generated Pi0s", 200, 7.5, - 13, 100, -3.15, 3.15); + genpart_Pi0F = ib.book2D("Pi0_Forward", "Forward Generated Pi0s", 200, 7.5, 13, 100, -3.15, 3.15); genpart_Pi0F->setAxisTitle("Eta", 1); genpart_Pi0F->setAxisTitle("Phi (radians)", 2); genpart_Pi0F->setAxisTitle("Energy (GeV)", 3); @@ -461,8 +377,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, genpart_Pi0F->getTH2F()->SetTitleOffset(1.4, "y"); genpart_Pi0F_counts = - ib.book2D("Pi0_Forward_Counts", "Number of Forward Generated Pi0s", 200, - 7.5, 13, 100, -3.15, 3.15); + ib.book2D("Pi0_Forward_Counts", "Number of Forward Generated Pi0s", 200, 7.5, 13, 100, -3.15, 3.15); genpart_Pi0F_counts->setAxisTitle("#eta", 1); genpart_Pi0F_counts->setAxisTitle("#phi (radians)", 2); genpart_Pi0F_counts->setAxisTitle("Energy (GeV)", 3); @@ -472,8 +387,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////70///////////////////////////////////////////// - genpart_NeutF = ib.book2D("Neutron_Forward", "Forward Generated Neutrons", - 200, 7.5, 13, 100, -3.15, 3.15); + genpart_NeutF = ib.book2D("Neutron_Forward", "Forward Generated Neutrons", 200, 7.5, 13, 100, -3.15, 3.15); genpart_NeutF->setAxisTitle("Eta", 1); genpart_NeutF->setAxisTitle("Phi (radians)", 2); genpart_NeutF->setAxisTitle("Energy (GeV)", 3); @@ -481,9 +395,8 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, genpart_NeutF->getTH2F()->SetTitleOffset(1.4, "x"); genpart_NeutF->getTH2F()->SetTitleOffset(1.4, "y"); - genpart_NeutF_counts = ib.book2D("Neutron_Forward_Counts", - "Number of Forward Generated Neutrons", - 200, 7.5, 13, 100, -3.15, 3.15); + genpart_NeutF_counts = + ib.book2D("Neutron_Forward_Counts", "Number of Forward Generated Neutrons", 200, 7.5, 13, 100, -3.15, 3.15); genpart_NeutF_counts->setAxisTitle("#eta", 1); genpart_NeutF_counts->setAxisTitle("#phi (radians)", 2); genpart_NeutF_counts->setAxisTitle("Energy (GeV)", 3); @@ -493,8 +406,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////71///////////////////////////////////////////// - genpart_GammaF = ib.book2D("Gamma_Forward", "Forward Generated Gammas", 200, - 7.5, 13, 100, -3.15, 3.15); + genpart_GammaF = ib.book2D("Gamma_Forward", "Forward Generated Gammas", 200, 7.5, 13, 100, -3.15, 3.15); genpart_GammaF->setAxisTitle("Eta", 1); genpart_GammaF->setAxisTitle("Phi (radians)", 2); genpart_GammaF->setAxisTitle("Energy (GeV)", 3); @@ -503,8 +415,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, genpart_GammaF->getTH2F()->SetTitleOffset(1.4, "y"); genpart_GammaF_counts = - ib.book2D("Gamma_Forward_Counts", "Number of Forward Generated Gammas", - 200, 7.5, 13, 100, -3.15, 3.15); + ib.book2D("Gamma_Forward_Counts", "Number of Forward Generated Gammas", 200, 7.5, 13, 100, -3.15, 3.15); genpart_GammaF_counts->setAxisTitle("#eta", 1); genpart_GammaF_counts->setAxisTitle("#phi (radians)", 2); genpart_GammaF_counts->setAxisTitle("Energy (GeV)", 3); @@ -514,31 +425,25 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - genpart_Pi0F_energydist = - ib.book1D("Pi0_Forward_EDistribution", "Gen-Level Forward Pi0 Energy", - 1500, 0, 1500); + genpart_Pi0F_energydist = ib.book1D("Pi0_Forward_EDistribution", "Gen-Level Forward Pi0 Energy", 1500, 0, 1500); genpart_Pi0F_energydist->setAxisTitle("Energy (GeV)", 1); genpart_Pi0F_energydist->setAxisTitle("Counts", 2); //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - genpart_NeutF_energydist = - ib.book1D("N_Forward_EDistribution", "Gen-Level Forward Neutron Energy", - 1500, 0, 1500); + genpart_NeutF_energydist = ib.book1D("N_Forward_EDistribution", "Gen-Level Forward Neutron Energy", 1500, 0, 1500); genpart_NeutF_energydist->setAxisTitle("Energy (GeV)", 1); genpart_NeutF_energydist->setAxisTitle("Counts", 2); /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// genpart_GammaF_energydist = - ib.book1D("Gamma_Forward_EDistribution", - "Gen-Level Fowarad Gamma Energy", 1500, 0, 1500); + ib.book1D("Gamma_Forward_EDistribution", "Gen-Level Fowarad Gamma Energy", 1500, 0, 1500); genpart_GammaF_energydist->setAxisTitle("Energy (GeV)", 1); genpart_GammaF_energydist->setAxisTitle("Counts", 2); ///////////////////////////////////////////////////////////////////////////////// ib.setCurrentFolder("ZDCValidation/GenParticles/Backward"); //////////////////////////////////////////////////////////////////////////////// ///////////////////////////////72///////////////////////////////////////////// - genpart_Pi0B = ib.book2D("Pi0_Backward", "Backward Generated Pi0s", 1000, - -13, -7.5, 100, -3.15, 3.15); + genpart_Pi0B = ib.book2D("Pi0_Backward", "Backward Generated Pi0s", 1000, -13, -7.5, 100, -3.15, 3.15); genpart_Pi0B->setAxisTitle("Eta", 1); genpart_Pi0B->setAxisTitle("Phi (radians)", 2); genpart_Pi0B->setAxisTitle("Energy (GeV)", 3); @@ -547,8 +452,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, genpart_Pi0B->getTH2F()->SetTitleOffset(1.4, "y"); genpart_Pi0B_counts = - ib.book2D("Pi0_Backwards_Counts", "Number of Backward Generated Pi0s", - 200, -13, -7.5, 100, -3.15, 3.15); + ib.book2D("Pi0_Backwards_Counts", "Number of Backward Generated Pi0s", 200, -13, -7.5, 100, -3.15, 3.15); genpart_Pi0B_counts->setAxisTitle("#eta", 1); genpart_Pi0B_counts->setAxisTitle("#phi (radians)", 2); genpart_Pi0B_counts->setAxisTitle("Energy (GeV)", 3); @@ -558,8 +462,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////73///////////////////////////////////////////// - genpart_NeutB = ib.book2D("Neutron_Backward", "Backward Generated Neutrons", - 1000, -13, -7.5, 100, -3.15, 3.15); + genpart_NeutB = ib.book2D("Neutron_Backward", "Backward Generated Neutrons", 1000, -13, -7.5, 100, -3.15, 3.15); genpart_NeutB->setAxisTitle("Eta", 1); genpart_NeutB->setAxisTitle("Phi (radians)", 2); genpart_NeutB->setAxisTitle("Energy (GeV)", 3); @@ -567,9 +470,8 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, genpart_NeutB->getTH2F()->SetTitleOffset(1.4, "x"); genpart_NeutB->getTH2F()->SetTitleOffset(1.4, "y"); - genpart_NeutB_counts = ib.book2D("Neutron_Backwards_Counts", - "Number of Backward Generated Neutrons", - 200, -13, -7.5, 100, -3.15, 3.15); + genpart_NeutB_counts = ib.book2D( + "Neutron_Backwards_Counts", "Number of Backward Generated Neutrons", 200, -13, -7.5, 100, -3.15, 3.15); genpart_NeutB_counts->setAxisTitle("#eta", 1); genpart_NeutB_counts->setAxisTitle("#phi (radians)", 2); genpart_NeutB_counts->setAxisTitle("Energy (GeV)", 3); @@ -578,8 +480,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, genpart_NeutB_counts->getTH2F()->SetTitleOffset(1.4, "y"); ///////////////////////////////74///////////////////////////////////////////// - genpart_GammaB = ib.book2D("Gamma_Backward", "Backward Generated Gammas", - 1000, -13, -7.5, 100, -3.15, 3.15); + genpart_GammaB = ib.book2D("Gamma_Backward", "Backward Generated Gammas", 1000, -13, -7.5, 100, -3.15, 3.15); genpart_GammaB->setAxisTitle("Eta", 1); genpart_GammaB->setAxisTitle("Phi (radians)", 2); genpart_GammaB->setAxisTitle("Energy (GeV)", 3); @@ -587,9 +488,8 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, genpart_GammaB->getTH2F()->SetTitleOffset(1.4, "x"); genpart_GammaB->getTH2F()->SetTitleOffset(1.4, "y"); - genpart_GammaB_counts = ib.book2D("Gamma_Backwards_Counts", - "Number of Backward Generated Gammas", - 200, -13, -7.5, 100, -3.15, 3.15); + genpart_GammaB_counts = + ib.book2D("Gamma_Backwards_Counts", "Number of Backward Generated Gammas", 200, -13, -7.5, 100, -3.15, 3.15); genpart_GammaB_counts->setAxisTitle("#eta", 1); genpart_GammaB_counts->setAxisTitle("#phi (radians)", 2); genpart_GammaB_counts->setAxisTitle("Energy (GeV)", 3); @@ -601,23 +501,18 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, ///////////////////////////////GEN Particle Energy /// Distributions///////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// - genpart_Pi0B_energydist = - ib.book1D("Pi0_Backward_EDistribution", "Gen-Level Backward Pi0 Energy", - 1500, 0, 1500); + genpart_Pi0B_energydist = ib.book1D("Pi0_Backward_EDistribution", "Gen-Level Backward Pi0 Energy", 1500, 0, 1500); genpart_Pi0B_energydist->setAxisTitle("Energy (GeV)", 1); genpart_Pi0B_energydist->setAxisTitle("Counts", 2); ////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////// - genpart_NeutB_energydist = - ib.book1D("N_Backward_EDistribution", "Gen-Level Foward Neutron Energy", - 1500, 0, 1500); + genpart_NeutB_energydist = ib.book1D("N_Backward_EDistribution", "Gen-Level Foward Neutron Energy", 1500, 0, 1500); genpart_NeutB_energydist->setAxisTitle("Energy (GeV)", 1); genpart_NeutB_energydist->setAxisTitle("Counts", 2); /////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// genpart_GammaB_energydist = - ib.book1D("Gamma_Backward_EDistribution", - "Gen-Level Backward Gamma Energy", 1500, 0, 1500); + ib.book1D("Gamma_Backward_EDistribution", "Gen-Level Backward Gamma Energy", 1500, 0, 1500); genpart_GammaB_energydist->setAxisTitle("Energy (GeV)", 1); genpart_GammaB_energydist->setAxisTitle("Counts", 2); ///////////////////////////////////////////////////////////////////////////////////////// @@ -630,8 +525,7 @@ void ZdcSimHitStudy::bookHistograms(DQMStore::IBooker &ib, edm::Run const &run, }*/ // void ZdcSimHitStudy::analyze(const edm::Event& e, const edm::EventSetup& ) { -void ZdcSimHitStudy::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void ZdcSimHitStudy::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { //////////NEW STUFF////////////////////// using namespace edm; @@ -640,8 +534,8 @@ void ZdcSimHitStudy::analyze(const edm::Event &iEvent, Handle genhandle; if (!(iEvent.getByToken(tok_gen_, genhandle))) { - gotGenParticles = false; // this is the same kind of boolean except for the - // genparticles collection + gotGenParticles = false; // this is the same kind of boolean except for the + // genparticles collection } if (!(genhandle.isValid())) { gotGenParticles = false; @@ -652,26 +546,22 @@ void ZdcSimHitStudy::analyze(const edm::Event &iEvent, ////////////////////////////////////GEN PARTICLE /// HISTOS/////////////////////////////////// - if (gotGenParticles == true) { // if the boolean was able to find the leaf - // "genparticles" then do this - for (reco::GenParticleCollection::const_iterator gen = genhandle->begin(); - gen != genhandle->end(); - ++gen) // here we iterate over all generated particles + if (gotGenParticles == true) { // if the boolean was able to find the leaf + // "genparticles" then do this + for (reco::GenParticleCollection::const_iterator gen = genhandle->begin(); gen != genhandle->end(); + ++gen) // here we iterate over all generated particles { // double energy=gen->energy(); - reco::GenParticle thisParticle = - (reco::GenParticle)(*gen); // get the particle "gen" points to - double energy_2 = - thisParticle - .energy(); // here I grab some of the attributes of the generated - // particle....like its energy, its phi and its eta and - // what kind of particle it is + reco::GenParticle thisParticle = (reco::GenParticle)(*gen); // get the particle "gen" points to + double energy_2 = thisParticle.energy(); // here I grab some of the attributes of the generated + // particle....like its energy, its phi and its eta and + // what kind of particle it is double gen_phi = thisParticle.phi(); double gen_eta = thisParticle.eta(); int gen_id = thisParticle.pdgId(); - if (gen_id == 111) { // here i require a pi0 - if (gen_eta > 8.3) { // eta requirement + if (gen_id == 111) { // here i require a pi0 + if (gen_eta > 8.3) { // eta requirement ////////////////////////////////////////////////////////////////////////////////////// //# IMPORTANT IMPORTANT IMPORTANT IMPORTANT # @@ -683,19 +573,19 @@ void ZdcSimHitStudy::analyze(const edm::Event &iEvent, // IMPORTANT IMPORTANT # ///////////////////////////////////////////////////////////////////////////////////// - genpart_Pi0F->Fill(gen_eta, gen_phi, energy_2); // fill the lego plot + genpart_Pi0F->Fill(gen_eta, gen_phi, energy_2); // fill the lego plot genpart_Pi0F_counts->Fill(gen_eta, gen_phi, 1); // genpart_Pi0F_profile->Fill(gen_eta,gen_phi,energy_2); - genpart_Pi0F_energydist->Fill(energy_2); // fill the 1D distribution + genpart_Pi0F_energydist->Fill(energy_2); // fill the 1D distribution } - if (gen_eta < -8.3) { // neg eta requirement + if (gen_eta < -8.3) { // neg eta requirement genpart_Pi0B->Fill(gen_eta, gen_phi, energy_2); // genpart_Pi0B_profile->Fill(gen_eta,gen_phi,energy_2); genpart_Pi0B_counts->Fill(gen_eta, gen_phi, 1); genpart_Pi0B_energydist->Fill(energy_2); } } - if (gen_id == 2112) { // require neutron + if (gen_id == 2112) { // require neutron if (gen_eta > 8.3) { genpart_NeutF->Fill(gen_eta, gen_phi, energy_2); // genpart_NeutF_profile->Fill(gen_eta,gen_phi,energy_2); @@ -710,7 +600,7 @@ void ZdcSimHitStudy::analyze(const edm::Event &iEvent, } } - if (gen_id == 22) { // require gamma + if (gen_id == 22) { // require gamma if (gen_eta > 8.3) { genpart_GammaF->Fill(gen_eta, gen_phi, energy_2); // genpart_GammaF_profile->Fill(gen_eta,gen_phi,energy_2); @@ -725,7 +615,7 @@ void ZdcSimHitStudy::analyze(const edm::Event &iEvent, } } - } // end of GEN loop + } // end of GEN loop } ///////////////////////////////////////////////////////////////////// @@ -795,13 +685,12 @@ void ZdcSimHitStudy::analyzeHits(std::vector &hits) { LogDebug("ZdcSimHitStudy") // std::cout - << "Hit[" << i << "] ID " << std::hex << id_ << std::dec << " DetID " - << id << " Det " << det << " side " << side << " Section " << section - << " channel " << channel << " E " << energy << " time \n" + << "Hit[" << i << "] ID " << std::hex << id_ << std::dec << " DetID " << id << " Det " << det << " side " + << side << " Section " << section << " channel " << channel << " E " << energy << " time \n" << time; //< &hits) { if (entotZdcEM != 0) for (int i = 0; i < 140; i++) - meZdcEML10EneP_->Fill(-10. + (float(i) + 0.5) / 10., - encontZdcEM[i] / entotZdcEM); + meZdcEML10EneP_->Fill(-10. + (float(i) + 0.5) / 10., encontZdcEM[i] / entotZdcEM); if (entotZdcHad != 0) for (int i = 0; i < 140; i++) - meZdcHadL10EneP_->Fill(-10. + (float(i) + 0.5) / 10., - encontZdcHad[i] / entotZdcHad); + meZdcHadL10EneP_->Fill(-10. + (float(i) + 0.5) / 10., encontZdcHad[i] / entotZdcHad); if (nHit > 0) { meAllZdcNHit_->Fill(double(nHit)); @@ -874,60 +761,58 @@ void ZdcSimHitStudy::analyzeHits(std::vector &hits) { } LogDebug("HcalSimHitStudy") // std::cout - << "HcalSimHitStudy::analyzeHits: Had " << nZdcHad << " EM " << nZdcEM - << " Bad " << nBad << " All " << nHit; + << "HcalSimHitStudy::analyzeHits: Had " << nZdcHad << " EM " << nZdcEM << " Bad " << nBad << " All " << nHit; //<Fill(energy); - meZdcEneTEmN1_->Fill(energy, time); - break; - case 2: - meZdcEneEmN2_->Fill(energy); - meZdcEneTEmN2_->Fill(energy, time); - break; - case 3: - meZdcEneEmN3_->Fill(energy); - meZdcEneTEmN3_->Fill(energy, time); - break; - case 4: - meZdcEneEmN4_->Fill(energy); - meZdcEneTEmN4_->Fill(energy, time); - break; - case 5: - meZdcEneEmN4_->Fill(energy); - meZdcEneTEmN4_->Fill(energy, time); - break; + case 1: + meZdcEneEmN1_->Fill(energy); + meZdcEneTEmN1_->Fill(energy, time); + break; + case 2: + meZdcEneEmN2_->Fill(energy); + meZdcEneTEmN2_->Fill(energy, time); + break; + case 3: + meZdcEneEmN3_->Fill(energy); + meZdcEneTEmN3_->Fill(energy, time); + break; + case 4: + meZdcEneEmN4_->Fill(energy); + meZdcEneTEmN4_->Fill(energy, time); + break; + case 5: + meZdcEneEmN4_->Fill(energy); + meZdcEneTEmN4_->Fill(energy, time); + break; } } if (section == HcalZDCDetId::HAD) { enetotHadN += energy; switch (channel) { - case 1: - meZdcEneHadN1_->Fill(energy); - meZdcEneTHadN1_->Fill(energy, time); - break; - case 2: - meZdcEneHadN2_->Fill(energy); - meZdcEneTHadN2_->Fill(energy, time); - break; - case 3: - meZdcEneHadN3_->Fill(energy); - meZdcEneTHadN3_->Fill(energy, time); - break; - case 4: - meZdcEneHadN4_->Fill(energy); - meZdcEneTHadN4_->Fill(energy, time); - break; + case 1: + meZdcEneHadN1_->Fill(energy); + meZdcEneTHadN1_->Fill(energy, time); + break; + case 2: + meZdcEneHadN2_->Fill(energy); + meZdcEneTHadN2_->Fill(energy, time); + break; + case 3: + meZdcEneHadN3_->Fill(energy); + meZdcEneTHadN3_->Fill(energy, time); + break; + case 4: + meZdcEneHadN4_->Fill(energy); + meZdcEneTHadN4_->Fill(energy, time); + break; } } } @@ -936,47 +821,47 @@ int ZdcSimHitStudy::FillHitValHist(int side, int section, int channel, if (section == HcalZDCDetId::EM) { enetotEmP += energy; switch (channel) { - case 1: - meZdcEneEmP1_->Fill(energy); - meZdcEneTEmP1_->Fill(energy, time); - break; - case 2: - meZdcEneEmP2_->Fill(energy); - meZdcEneTEmP2_->Fill(energy, time); - break; - case 3: - meZdcEneEmP3_->Fill(energy); - meZdcEneTEmP3_->Fill(energy, time); - break; - case 4: - meZdcEneEmP4_->Fill(energy); - meZdcEneTEmP4_->Fill(energy, time); - break; - case 5: - meZdcEneEmP4_->Fill(energy); - meZdcEneTEmP4_->Fill(energy, time); - break; + case 1: + meZdcEneEmP1_->Fill(energy); + meZdcEneTEmP1_->Fill(energy, time); + break; + case 2: + meZdcEneEmP2_->Fill(energy); + meZdcEneTEmP2_->Fill(energy, time); + break; + case 3: + meZdcEneEmP3_->Fill(energy); + meZdcEneTEmP3_->Fill(energy, time); + break; + case 4: + meZdcEneEmP4_->Fill(energy); + meZdcEneTEmP4_->Fill(energy, time); + break; + case 5: + meZdcEneEmP4_->Fill(energy); + meZdcEneTEmP4_->Fill(energy, time); + break; } } if (section == HcalZDCDetId::HAD) { enetotHadP += energy; switch (channel) { - case 1: - meZdcEneHadP1_->Fill(energy); - meZdcEneTHadP1_->Fill(energy, time); - break; - case 2: - meZdcEneHadP2_->Fill(energy); - meZdcEneTHadP2_->Fill(energy, time); - break; - case 3: - meZdcEneHadP3_->Fill(energy); - meZdcEneTHadP3_->Fill(energy, time); - break; - case 4: - meZdcEneHadP4_->Fill(energy); - meZdcEneTHadP4_->Fill(energy, time); - break; + case 1: + meZdcEneHadP1_->Fill(energy); + meZdcEneTHadP1_->Fill(energy, time); + break; + case 2: + meZdcEneHadP2_->Fill(energy); + meZdcEneTHadP2_->Fill(energy, time); + break; + case 3: + meZdcEneHadP3_->Fill(energy); + meZdcEneTHadP3_->Fill(energy, time); + break; + case 4: + meZdcEneHadP4_->Fill(energy); + meZdcEneTHadP4_->Fill(energy, time); + break; } } } diff --git a/Validation/HcalHits/test/HcalHitValidation.cc b/Validation/HcalHits/test/HcalHitValidation.cc index 0af0054fabf2a..c6b87a576fb99 100644 --- a/Validation/HcalHits/test/HcalHitValidation.cc +++ b/Validation/HcalHits/test/HcalHitValidation.cc @@ -4,17 +4,12 @@ #include "FWCore/Utilities/interface/Exception.h" HcalHitValidation::HcalHitValidation(const edm::ParameterSet &ps) { - g4Label = ps.getUntrackedParameter("moduleLabel", "g4SimHits"); hcalHits = ps.getUntrackedParameter("HitCollection", "HcalHits"); - layerInfo = - ps.getUntrackedParameter("LayerInfo", "PHcalValidInfoLayer"); - nxNInfo = - ps.getUntrackedParameter("NxNInfo", "PHcalValidInfoNxN"); - jetsInfo = - ps.getUntrackedParameter("JetsInfo", "PHcalValidInfoJets"); - outFile_ = - ps.getUntrackedParameter("outputFile", "hcValid.root"); + layerInfo = ps.getUntrackedParameter("LayerInfo", "PHcalValidInfoLayer"); + nxNInfo = ps.getUntrackedParameter("NxNInfo", "PHcalValidInfoNxN"); + jetsInfo = ps.getUntrackedParameter("JetsInfo", "PHcalValidInfoJets"); + outFile_ = ps.getUntrackedParameter("outputFile", "hcValid.root"); verbose_ = ps.getUntrackedParameter("Verbose", false); scheme_ = ps.getUntrackedParameter("TestNumbering", true); checkHit_ = ps.getUntrackedParameter("CheckHits", true); @@ -28,42 +23,29 @@ HcalHitValidation::HcalHitValidation(const edm::ParameterSet &ps) { tok_iN_ = consumes(edm::InputTag(g4Label, nxNInfo)); tok_iJ_ = consumes(edm::InputTag(g4Label, jetsInfo)); - edm::LogInfo("HcalHitValid") - << "Module Label: " << g4Label << " Hits: " << hcalHits << " / " - << checkHit_ << " LayerInfo: " << layerInfo << " / " << checkLay_ - << " NxNInfo: " << nxNInfo << " / " << checkNxN_ - << " jetsInfo: " << jetsInfo << " / " << checkJet_ - << " Output: " << outFile_ << " Usage of TestNumberingScheme " - << scheme_; + edm::LogInfo("HcalHitValid") << "Module Label: " << g4Label << " Hits: " << hcalHits << " / " << checkHit_ + << " LayerInfo: " << layerInfo << " / " << checkLay_ << " NxNInfo: " << nxNInfo + << " / " << checkNxN_ << " jetsInfo: " << jetsInfo << " / " << checkJet_ + << " Output: " << outFile_ << " Usage of TestNumberingScheme " << scheme_; } HcalHitValidation::~HcalHitValidation() {} -void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, - edm::Run const &, - edm::EventSetup const &) { - +void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) { ibooker.setCurrentFolder("HcalHitValidation"); char title[60], name[20]; double my_pi = 3.1415926; // Histograms for Hits if (checkHit_) { - meAllNHit_ = - ibooker.book1D("Hit01", "Number of Hits in HCal", 1000, 0., 5000.); - meBadDetHit_ = - ibooker.book1D("Hit02", "Hits with wrong Det", 100, 0., 100.); - meBadSubHit_ = - ibooker.book1D("Hit03", "Hits with wrong Subdet", 100, 0., 100.); + meAllNHit_ = ibooker.book1D("Hit01", "Number of Hits in HCal", 1000, 0., 5000.); + meBadDetHit_ = ibooker.book1D("Hit02", "Hits with wrong Det", 100, 0., 100.); + meBadSubHit_ = ibooker.book1D("Hit03", "Hits with wrong Subdet", 100, 0., 100.); meBadIdHit_ = ibooker.book1D("Hit04", "Hits with wrong ID", 100, 0., 100.); - meHBNHit_ = - ibooker.book1D("Hit05", "Number of Hits in HB", 1000, 0., 5000.); - meHENHit_ = - ibooker.book1D("Hit06", "Number of Hits in HE", 1000, 0., 5000.); - meHONHit_ = - ibooker.book1D("Hit07", "Number of Hits in HO", 1000, 0., 5000.); - meHFNHit_ = - ibooker.book1D("Hit08", "Number of Hits in HF", 1000, 0., 5000.); + meHBNHit_ = ibooker.book1D("Hit05", "Number of Hits in HB", 1000, 0., 5000.); + meHENHit_ = ibooker.book1D("Hit06", "Number of Hits in HE", 1000, 0., 5000.); + meHONHit_ = ibooker.book1D("Hit07", "Number of Hits in HO", 1000, 0., 5000.); + meHFNHit_ = ibooker.book1D("Hit08", "Number of Hits in HF", 1000, 0., 5000.); meDetectHit_ = ibooker.book1D("Hit09", "Detector ID", 50, 0., 50.); meSubdetHit_ = ibooker.book1D("Hit10", "Subdetectors in HCal", 50, 0., 50.); meDepthHit_ = ibooker.book1D("Hit11", "Depths in HCal", 20, 0., 20.); @@ -71,8 +53,7 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, mePhiHit_ = ibooker.book1D("Hit13", "Phi in HCal", 100, 0., 100.); meEnergyHit_ = ibooker.book1D("Hit14", "Energy in HCal", 100, 0., 1.); meTimeHit_ = ibooker.book1D("Hit15", "Time in HCal", 100, 0., 400.); - meTimeWHit_ = - ibooker.book1D("Hit16", "Time in HCal (E wtd)", 100, 0., 400.); + meTimeWHit_ = ibooker.book1D("Hit16", "Time in HCal (E wtd)", 100, 0., 400.); meHBDepHit_ = ibooker.book1D("Hit17", "Depths in HB", 20, 0., 20.); meHEDepHit_ = ibooker.book1D("Hit18", "Depths in HE", 20, 0., 20.); meHODepHit_ = ibooker.book1D("Hit19", "Depths in HO", 20, 0., 20.); @@ -93,15 +74,12 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, meHETimHit_ = ibooker.book1D("Hit34", "Time in HE", 100, 0., 400.); meHOTimHit_ = ibooker.book1D("Hit35", "Time in HO", 100, 0., 400.); meHFTimHit_ = ibooker.book1D("Hit36", "Time in HF", 100, 0., 400.); - mePMTHit_ = - ibooker.book1D("Hit37", "Number of Hit in PMT", 1000, 0., 1000.); + mePMTHit_ = ibooker.book1D("Hit37", "Number of Hit in PMT", 1000, 0., 1000.); mePMTDepHit_ = ibooker.book1D("Hit38", "Depths in HF PMT", 20, 0., 20.); mePMTEtaHit_ = ibooker.book1D("Hit39", "Eta in HF PMT", 100, -50., 50.); mePMTPhiHit_ = ibooker.book1D("Hit40", "Phi in HF PMT", 100, 0., 100.); - mePMTEn1Hit_ = - ibooker.book1D("Hit41", "Energy (Ceren) in PMT", 100, 0., 100.); - mePMTEn2Hit_ = - ibooker.book1D("Hit42", "Energy (dE/dx) in PMT", 100, 0., 100.); + mePMTEn1Hit_ = ibooker.book1D("Hit41", "Energy (Ceren) in PMT", 100, 0., 100.); + mePMTEn2Hit_ = ibooker.book1D("Hit42", "Energy (dE/dx) in PMT", 100, 0., 100.); mePMTTimHit_ = ibooker.book1D("Hit43", "Time in HF PMT", 100, 0., 400.); } @@ -114,8 +92,7 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, meDepHlay_ = ibooker.book1D("Lay05", "Depth of the Hits", 10, 0., 10.); meTimHLay_ = ibooker.book1D("Lay06", "Time of the Hits", 100, 0., 400.); meTimWLay_ = ibooker.book1D("Lay07", "Time (wtd) of Hits", 100, 0., 400.); - meEtaPhi_ = ibooker.book2D("Lay08", "Phi%Eta of the Hits", 100, -5., 5., - 100, -my_pi, my_pi); + meEtaPhi_ = ibooker.book2D("Lay08", "Phi%Eta of the Hits", 100, -5., 5., 100, -my_pi, my_pi); meHitELay_ = ibooker.book1D("Lay09", "Hit in Ecal", 1000, 0., 2000.); meHitHLay_ = ibooker.book1D("Lay10", "Hit in Hcal", 1000, 0., 2000.); @@ -128,8 +105,7 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, sprintf(title, "Energy deposit in Layer %d", i); meEneLay_[i] = ibooker.book1D(name, title, 100, 0., 0.4); } - meLngLay_ = - ibooker.book1D("Lay13", "Lonitudinal Shower Profile", 20, 0, 20.); + meLngLay_ = ibooker.book1D("Lay13", "Lonitudinal Shower Profile", 20, 0, 20.); meEneDLay_ = ibooker.book1D("Lay14", "Energy per depth", 100, 0., 1.); for (int i = 0; i < nDepthsMAX; i++) { sprintf(name, "Layl%d", nn); @@ -142,18 +118,15 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, meEHOLay_ = ibooker.book1D("Lay16", "Energy in HO", 100, 0., 2000.); meEHBHELay_ = ibooker.book1D("Lay17", "Energy in HB/HE", 100, 0., 2000.); meEFibLLay_ = ibooker.book1D("Lay18", "Energy in HF (Long)", 100, 0., 100.); - meEFibSLay_ = - ibooker.book1D("Lay19", "Energy in HF (Short)", 100, 0., 100.); + meEFibSLay_ = ibooker.book1D("Lay19", "Energy in HF (Short)", 100, 0., 100.); meEHFEmLay_ = ibooker.book1D("Lay20", "EM energy in HF", 100, 0., 200.); meEHFHdLay_ = ibooker.book1D("Lay21", "Had. energy in HF", 100, 0., 200.); } // Histograms for NxN analysis if (checkNxN_) { - meEcalRNxN_ = - ibooker.book1D("NxN01", "Energy in ECal (NxN)r", 100, 0., 200.); - meHcalRNxN_ = - ibooker.book1D("NxN02", "Energy in HCal (NxN)r", 100, 0., 200.); + meEcalRNxN_ = ibooker.book1D("NxN01", "Energy in ECal (NxN)r", 100, 0., 200.); + meHcalRNxN_ = ibooker.book1D("NxN02", "Energy in HCal (NxN)r", 100, 0., 200.); meHoRNxN_ = ibooker.book1D("NxN03", "Energy in HO (NxN)r", 100, 0., 200.); meEtotRNxN_ = ibooker.book1D("NxN04", "Energy Total (NxN)r", 100, 0., 200.); meEcalNxN_ = ibooker.book1D("NxN05", "Energy in ECal (NxN)", 100, 0., 200.); @@ -161,8 +134,7 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, meHoNxN_ = ibooker.book1D("NxN07", "Energy in HO (NxN)", 100, 0., 200.); meEtotNxN_ = ibooker.book1D("NxN08", "Energy Total (NxN)", 100, 0., 200.); meEiNxN_ = ibooker.book1D("NxN09", "Energy of Hits in (NxN)", 100, 0., 1.); - meTiNxN_ = - ibooker.book1D("NxN10", "Time of Hits in (NxN)", 100, 0., 400.); + meTiNxN_ = ibooker.book1D("NxN10", "Time of Hits in (NxN)", 100, 0., 400.); meTrNxN_ = ibooker.book1D("NxN11", "Dist. of Hits in (NxN)", 100, 0., 1.); } @@ -171,16 +143,11 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, meRJet_ = ibooker.book1D("Jet01", "R of Hits", 100, 0., 1.); meTJet_ = ibooker.book1D("Jet02", "T of Hits", 100, 0., 200.); meEJet_ = ibooker.book1D("Jet03", "E of Hits", 100, 0., 200.); - meEcalJet_ = - ibooker.book1D("Jet04", "Ecal Energy (First Jet)", 100, 0., 200.); - meHcalJet_ = - ibooker.book1D("Jet05", "Hcal Energy (First Jet)", 100, 0., 200.); - meHoJet_ = - ibooker.book1D("Jet06", "Ho Energy (First Jet)", 100, 0., 200.); - meEtotJet_ = - ibooker.book1D("Jet07", "Total Energy(First Jet)", 100, 0., 200.); - meEcHcJet_ = ibooker.book2D("Jet08", "Energy in Hcal% Ecal", 100, 0., 200., - 100, 0., 200.); + meEcalJet_ = ibooker.book1D("Jet04", "Ecal Energy (First Jet)", 100, 0., 200.); + meHcalJet_ = ibooker.book1D("Jet05", "Hcal Energy (First Jet)", 100, 0., 200.); + meHoJet_ = ibooker.book1D("Jet06", "Ho Energy (First Jet)", 100, 0., 200.); + meEtotJet_ = ibooker.book1D("Jet07", "Total Energy(First Jet)", 100, 0., 200.); + meEcHcJet_ = ibooker.book2D("Jet08", "Energy in Hcal% Ecal", 100, 0., 200., 100, 0., 200.); meDetaJet_ = ibooker.book1D("Jet09", "Delta Eta", 100, 0., 2.); meDphiJet_ = ibooker.book1D("Jet10", "Delta Phi", 100, 0., 1.); @@ -193,9 +160,7 @@ void HcalHitValidation::bookHistograms(DQMStore::IBooker &ibooker, } void HcalHitValidation::analyze(const edm::Event &e, const edm::EventSetup &) { - - LogDebug("HcalHitValid") << "Run = " << e.id().run() - << " Event = " << e.id().event(); + LogDebug("HcalHitValid") << "Run = " << e.id().run() << " Event = " << e.id().event(); std::vector caloHits; edm::Handle hitsHcal; @@ -231,14 +196,12 @@ void HcalHitValidation::analyze(const edm::Event &e, const edm::EventSetup &) { getJets = true; } - LogDebug("HcalHitValid") << "HcalValidation: Input flags Hits " << getHits - << ", Layer " << getLayer << ", NxN " << getNxN - << ", Jets " << getJets; + LogDebug("HcalHitValid") << "HcalValidation: Input flags Hits " << getHits << ", Layer " << getLayer << ", NxN " + << getNxN << ", Jets " << getJets; if (getHits) { caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end()); - LogDebug("HcalHitValid") - << "HcalValidation: Hit buffer " << caloHits.size(); + LogDebug("HcalHitValid") << "HcalValidation: Hit buffer " << caloHits.size(); analyzeHits(caloHits); } @@ -251,10 +214,8 @@ void HcalHitValidation::analyze(const edm::Event &e, const edm::EventSetup &) { } void HcalHitValidation::analyzeHits(std::vector &hits) { - int nHit = hits.size(); - int nHB = 0, nHE = 0, nHO = 0, nHF = 0, nPMT = 0, nBad1 = 0, nBad2 = 0, - nBad = 0; + int nHB = 0, nHE = 0, nHO = 0, nHF = 0, nPMT = 0, nBad1 = 0, nBad2 = 0, nBad = 0; for (int i = 0; i < nHit; i++) { double energy = hits[i].energy(); double time = hits[i].time(); @@ -279,12 +240,10 @@ void HcalHitValidation::analyzeHits(std::vector &hits) { uint16_t depth_ = hits[i].depth(); double energyEM = hits[i].energyEM(); double energyHad = hits[i].energyHad(); - LogDebug("HcalHitValid") - << "Hit[" << i << "] ID " << std::hex << id_ << std::dec << " Det " - << det << " Sub " << subdet << " depth " << depth << " " << depth_ - << " Eta " << eta << " Phi " << phi << " E " << energy << "(EM " - << energyEM << ", Had " << energyHad << ") time " << time; - if (det == 4) { // Check DetId.h + LogDebug("HcalHitValid") << "Hit[" << i << "] ID " << std::hex << id_ << std::dec << " Det " << det << " Sub " + << subdet << " depth " << depth << " " << depth_ << " Eta " << eta << " Phi " << phi + << " E " << energy << "(EM " << energyEM << ", Had " << energyHad << ") time " << time; + if (det == 4) { // Check DetId.h if (subdet == static_cast(HcalBarrel)) { nHB++; } else if (subdet == static_cast(HcalEndcap)) { @@ -358,15 +317,11 @@ void HcalHitValidation::analyzeHits(std::vector &hits) { meHFNHit_->Fill(double(nHF)); mePMTHit_->Fill(double(nPMT)); - LogDebug("HcalHitValid") << "HcalHitValidation::analyzeHits: HB " << nHB - << " HE " << nHE << " HO " << nHO << " HF " << nHF - << " PMT " << nPMT << " Bad " << nBad << " All " - << nHit; + LogDebug("HcalHitValid") << "HcalHitValidation::analyzeHits: HB " << nHB << " HE " << nHE << " HO " << nHO << " HF " + << nHF << " PMT " << nPMT << " Bad " << nBad << " All " << nHit; } -void HcalHitValidation::analyzeLayer( - edm::Handle &infoLayer) { - +void HcalHitValidation::analyzeLayer(edm::Handle &infoLayer) { // CaloHits from PHcalValidInfoLayer int nHits = infoLayer->nHit(); std::vector idHits = infoLayer->idHit(); @@ -397,7 +352,7 @@ void HcalHitValidation::analyzeLayer( meDepHlay_->Fill(idHits[j]); meTimHLay_->Fill(tHits[j]); meTimWLay_->Fill(tHits[j], eHits[j]); - if (id < 6) // HCAL only. Depth is needed, not layer !!! + if (id < 6) // HCAL only. Depth is needed, not layer !!! { meEtaPhi_->Fill(etaHits[j], phiHits[j]); } @@ -416,7 +371,7 @@ void HcalHitValidation::analyzeLayer( eTot += eLayer[j]; meEneLLay_->Fill(eLayer[j]); meEneLay_[j]->Fill(eLayer[j]); - meLngLay_->Fill((double)(j), eLayer[j]); // HCAL SimHits only + meLngLay_->Fill((double)(j), eLayer[j]); // HCAL SimHits only } for (int j = 0; j < nDepthsMAX; j++) { meEneDLay_->Fill(eDepth[j]); @@ -439,15 +394,12 @@ void HcalHitValidation::analyzeLayer( meEHFEmLay_->Fill(eEcalHF); meEHFHdLay_->Fill(eHcalHF); - LogDebug("HcalHitValid") << "HcalHitValidation::analyzeLayer: eHO " << eHO - << " eHBHE = " << eHBHE << " elongHF = " << elongHF - << " eshortHF = " << eshortHF - << " eEcalHF = " << eEcalHF + LogDebug("HcalHitValid") << "HcalHitValidation::analyzeLayer: eHO " << eHO << " eHBHE = " << eHBHE + << " elongHF = " << elongHF << " eshortHF = " << eshortHF << " eEcalHF = " << eEcalHF << " eHcalHF = " << eHcalHF; } void HcalHitValidation::analyzeNxN(edm::Handle &infoNxN) { - // NxN quantities double ecalNxNr = infoNxN->ecalnxnr(); double hcalNxNr = infoNxN->hcalnxnr(); @@ -474,20 +426,18 @@ void HcalHitValidation::analyzeNxN(edm::Handle &infoNxN) { std::vector eIxI = infoNxN->enxn(); std::vector tIxI = infoNxN->tnxn(); - for (int j = 0; j < nIxI; j++) // NB !!! j < nIxI + for (int j = 0; j < nIxI; j++) // NB !!! j < nIxI { meEiNxN_->Fill(eIxI[j]); meTiNxN_->Fill(tIxI[j]); - meTrNxN_->Fill(idIxI[j], eIxI[j]); // transverse profile + meTrNxN_->Fill(idIxI[j], eIxI[j]); // transverse profile } - LogDebug("HcalHitValid") << "HcalHitValidation::analyzeNxN: " << nIxI - << " hits in NxN analysis; Total Energy " << etotNxN - << "/" << etotNxNr; + LogDebug("HcalHitValid") << "HcalHitValidation::analyzeNxN: " << nIxI << " hits in NxN analysis; Total Energy " + << etotNxN << "/" << etotNxNr; } void HcalHitValidation::analyzeJets(edm::Handle &infoJets) { - // -- Leading Jet int nJetHits = infoJets->njethit(); @@ -533,11 +483,10 @@ void HcalHitValidation::analyzeJets(edm::Handle &infoJets) { meEtaJet_->Fill(jetEta[j]); mePhiJet_->Fill(jetPhi[j]); } - LogDebug("HcalHitValid") << "HcalHitValidation::analyzeJets: " << nJets - << " jets with " << nJetHits << " hits in the " + LogDebug("HcalHitValid") << "HcalHitValidation::analyzeJets: " << nJets << " jets with " << nJetHits + << " hits in the " << "leading jet\n" - << " d(Eta) = " << detaJet - << " d(Phi) = " << dphiJet << " d(R) = " << drJet + << " d(Eta) = " << detaJet << " d(Phi) = " << dphiJet << " d(R) = " << drJet << " diJet Mass = " << dijetM; } diff --git a/Validation/HcalHits/test/HcalHitValidation.h b/Validation/HcalHits/test/HcalHitValidation.h index ff937b0ce89c6..e8614a4bb8e0d 100644 --- a/Validation/HcalHits/test/HcalHitValidation.h +++ b/Validation/HcalHits/test/HcalHitValidation.h @@ -33,8 +33,7 @@ class HcalHitValidation : public DQMEDAnalyzer { protected: void analyze(const edm::Event &e, const edm::EventSetup &c) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyzeHits(std::vector &); void analyzeLayer(edm::Handle &); diff --git a/Validation/Mixing/interface/GlobalTest.h b/Validation/Mixing/interface/GlobalTest.h index 1e5089c736164..d322d93427ad8 100644 --- a/Validation/Mixing/interface/GlobalTest.h +++ b/Validation/Mixing/interface/GlobalTest.h @@ -47,8 +47,7 @@ class GlobalTest : public DQMEDAnalyzer { explicit GlobalTest(const edm::ParameterSet &); ~GlobalTest() override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(const edm::Event &, const edm::EventSetup &) override; private: diff --git a/Validation/Mixing/interface/MixCollectionValidation.h b/Validation/Mixing/interface/MixCollectionValidation.h index b366a75f54fa5..0b6ef20e33c87 100644 --- a/Validation/Mixing/interface/MixCollectionValidation.h +++ b/Validation/Mixing/interface/MixCollectionValidation.h @@ -35,8 +35,7 @@ class MixCollectionValidation : public DQMEDAnalyzer { public: explicit MixCollectionValidation(const edm::ParameterSet &); ~MixCollectionValidation() override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(const edm::Event &, const edm::EventSetup &) override; private: @@ -46,8 +45,7 @@ class MixCollectionValidation : public DQMEDAnalyzer { void fillMultiplicity(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_); template - void fillGenParticleMulti(T1 &theItr_, T2 &theColl_, - MonitorElement *theProfile_); + void fillGenParticleMulti(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_); template void fillSimHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_); @@ -65,10 +63,8 @@ class MixCollectionValidation : public DQMEDAnalyzer { edm::EDGetTokenT> crossingFrame_Hep_Token_; edm::EDGetTokenT> crossingFrame_SimTr_Token_; edm::EDGetTokenT> crossingFrame_SimVtx_Token_; - std::vector>> - crossingFrame_PSimHit_Tokens_; - std::vector>> - crossingFrame_PCaloHit_Tokens_; + std::vector>> crossingFrame_PSimHit_Tokens_; + std::vector>> crossingFrame_PCaloHit_Tokens_; std::string outputFile_; int minbunch_; diff --git a/Validation/Mixing/src/GlobalTest.cc b/Validation/Mixing/src/GlobalTest.cc index 629d30a509e78..9cfd41eef0e71 100644 --- a/Validation/Mixing/src/GlobalTest.cc +++ b/Validation/Mixing/src/GlobalTest.cc @@ -40,20 +40,15 @@ GlobalTest::GlobalTest(const edm::ParameterSet &iConfig) : filename_(iConfig.getParameter("fileName")), minbunch_(iConfig.getParameter("minBunch")), maxbunch_(iConfig.getParameter("maxBunch")), - cfTrackToken_(consumes>( - iConfig.getParameter("cfTrackTag"))), - cfVertexToken_(consumes>( - iConfig.getParameter("cfVertexTag"))) { + cfTrackToken_(consumes>(iConfig.getParameter("cfTrackTag"))), + cfVertexToken_(consumes>(iConfig.getParameter("cfVertexTag"))) { std::string ecalsubdetb(""); std::string ecalsubdete("g4SimHitsEcalHitsEE"); - g4SimHits_EB_Token_ = consumes>( - edm::InputTag("mix", "g4SimHitsEcalHitsEB")); - g4SimHits_EE_Token_ = consumes>( - edm::InputTag("mix", "g4SimHitsEcalHitsEE")); - - std::cout << "Constructed GlobalTest, filename: " << filename_ - << " minbunch: " << minbunch_ << ", maxbunch: " << maxbunch_ - << std::endl; + g4SimHits_EB_Token_ = consumes>(edm::InputTag("mix", "g4SimHitsEcalHitsEB")); + g4SimHits_EE_Token_ = consumes>(edm::InputTag("mix", "g4SimHitsEcalHitsEE")); + + std::cout << "Constructed GlobalTest, filename: " << filename_ << " minbunch: " << minbunch_ + << ", maxbunch: " << maxbunch_ << std::endl; } GlobalTest::~GlobalTest() { @@ -61,8 +56,7 @@ GlobalTest::~GlobalTest() { delete[] labels[i]; } -void GlobalTest::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, - edm::EventSetup const &) { +void GlobalTest::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) { using namespace std; ibooker.setCurrentFolder("MixingV/Mixing"); @@ -117,8 +111,7 @@ void GlobalTest::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, // // ------------ method called to analyze the data ------------ -void GlobalTest::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void GlobalTest::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { using namespace edm; using namespace std; @@ -147,8 +140,7 @@ void GlobalTest::analyze(const edm::Event &iEvent, } // part id for each track - std::unique_ptr> coltr( - new MixCollection(cf_track.product())); + std::unique_ptr> coltr(new MixCollection(cf_track.product())); MixCollection::iterator cfitr; for (cfitr = coltr->begin(); cfitr != coltr->end(); cfitr++) { trackPartIdH_[cfitr.bunch() - minbunch_]->Fill(cfitr->type()); @@ -156,8 +148,7 @@ void GlobalTest::analyze(const edm::Event &iEvent, // energy sum double sumE[10] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}; - std::unique_ptr> colecalb( - new MixCollection(cf_calohitB.product())); + std::unique_ptr> colecalb(new MixCollection(cf_calohitB.product())); MixCollection::iterator cfiecalb; for (cfiecalb = colecalb->begin(); cfiecalb != colecalb->end(); cfiecalb++) { sumE[cfiecalb.bunch() - minbunch_] += cfiecalb->energy(); @@ -168,8 +159,7 @@ void GlobalTest::analyze(const edm::Event &iEvent, caloEnergyEBH_[i - minbunch_]->Fill(sumE[i - minbunch_]); } double sumEE[10] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}; - std::unique_ptr> colecale( - new MixCollection(cf_calohitE.product())); + std::unique_ptr> colecale(new MixCollection(cf_calohitE.product())); MixCollection::iterator cfiecale; for (cfiecale = colecale->begin(); cfiecale != colecale->end(); cfiecale++) { sumEE[cfiecale.bunch() - minbunch_] += cfiecale->energy(); diff --git a/Validation/Mixing/src/MixCollectionValidation.cc b/Validation/Mixing/src/MixCollectionValidation.cc index b0663b2f6ef99..622644a24e934 100644 --- a/Validation/Mixing/src/MixCollectionValidation.cc +++ b/Validation/Mixing/src/MixCollectionValidation.cc @@ -19,15 +19,13 @@ using namespace edm; -MixCollectionValidation::MixCollectionValidation( - const edm::ParameterSet &iConfig) +MixCollectionValidation::MixCollectionValidation(const edm::ParameterSet &iConfig) : minbunch_(iConfig.getParameter("minBunch")), maxbunch_(iConfig.getParameter("maxBunch")), verbose_(iConfig.getUntrackedParameter("verbose", false)), nbin_(maxbunch_ - minbunch_ + 1) { // Histograms will be defined according to the configuration - ParameterSet mixObjextsSet_ = - iConfig.getParameter("mixObjects"); + ParameterSet mixObjextsSet_ = iConfig.getParameter("mixObjects"); } MixCollectionValidation::~MixCollectionValidation() { @@ -35,113 +33,94 @@ MixCollectionValidation::~MixCollectionValidation() { // (e.g. close files, deallocate resources etc.) } -void MixCollectionValidation::bookHistograms( - DQMStore::IBooker &iBooker, edm::Run const &iRun, - edm::EventSetup const & /* iSetup */) { +void MixCollectionValidation::bookHistograms(DQMStore::IBooker &iBooker, + edm::Run const &iRun, + edm::EventSetup const & /* iSetup */) { iBooker.setCurrentFolder("MixingV/Mixing"); std::vector names = mixObjextsSet_.getParameterNames(); - for (std::vector::iterator it = names.begin(); it != names.end(); - ++it) { + for (std::vector::iterator it = names.begin(); it != names.end(); ++it) { ParameterSet pset = mixObjextsSet_.getParameter((*it)); if (!pset.exists("type")) - continue; // to allow replacement by empty pset + continue; // to allow replacement by empty pset std::string object = pset.getParameter("type"); - std::vector tags = - pset.getParameter>("input"); + std::vector tags = pset.getParameter>("input"); if (object == "HepMCProduct") { - std::string title = "Log10 Number of GenParticle in " + object; std::string name = "NumberOf" + object; - nrHepMCProductH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, - maxbunch_ + 1, 40, 0., 40.); + nrHepMCProductH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.); HepMCProductTags_ = tags; if (!HepMCProductTags_.empty()) { - crossingFrame_Hep_Token_ = consumes>( - edm::InputTag("mix", HepMCProductTags_[0].label())); + crossingFrame_Hep_Token_ = + consumes>(edm::InputTag("mix", HepMCProductTags_[0].label())); } } else if (object == "SimTrack") { - std::string title = "Log10 Number of " + object; std::string name = "NumberOf" + object; - nrSimTrackH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, - maxbunch_ + 1, 40, 0., 40.); + nrSimTrackH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.); SimTrackTags_ = tags; if (!SimTrackTags_.empty()) { - crossingFrame_SimTr_Token_ = consumes>( - edm::InputTag("mix", SimTrackTags_[0].label())); + crossingFrame_SimTr_Token_ = consumes>(edm::InputTag("mix", SimTrackTags_[0].label())); } } else if (object == "SimVertex") { - std::string title = "Log10 Number of " + object; std::string name = "NumberOf" + object; - nrSimVertexH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, - maxbunch_ + 1, 40, 0., 40.); + nrSimVertexH_ = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.); SimVertexTags_ = tags; if (!SimVertexTags_.empty()) { - crossingFrame_SimVtx_Token_ = consumes>( - edm::InputTag("mix", SimVertexTags_[0].label())); + crossingFrame_SimVtx_Token_ = + consumes>(edm::InputTag("mix", SimVertexTags_[0].label())); } } else if (object == "PSimHit") { - std::vector subdets = - pset.getParameter>("subdets"); + std::vector subdets = pset.getParameter>("subdets"); for (unsigned int ii = 0; ii < subdets.size(); ii++) { - std::string title = "Log10 Number of " + subdets[ii]; std::string name = "NumberOf" + subdets[ii]; - SimHitNrmap_[subdets[ii]] = iBooker.bookProfile( - name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.); + SimHitNrmap_[subdets[ii]] = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.); title = "Time of " + subdets[ii]; name = "TimeOf" + subdets[ii]; - SimHitTimemap_[subdets[ii]] = iBooker.bookProfile( - name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.); + SimHitTimemap_[subdets[ii]] = + iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.); } PSimHitTags_ = tags; for (auto const &it : PSimHitTags_) crossingFrame_PSimHit_Tokens_.push_back( - consumes>( - edm::InputTag("mix", it.label() + it.instance()))); + consumes>(edm::InputTag("mix", it.label() + it.instance()))); } else if (object == "PCaloHit") { - std::vector subdets = - pset.getParameter>("subdets"); + std::vector subdets = pset.getParameter>("subdets"); for (unsigned int ii = 0; ii < subdets.size(); ii++) { - std::string title = "Log10 Number of " + subdets[ii]; std::string name = "NumberOf" + subdets[ii]; - CaloHitNrmap_[subdets[ii]] = iBooker.bookProfile( - name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.); + CaloHitNrmap_[subdets[ii]] = iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, 0., 40.); title = "Time of " + subdets[ii]; name = "TimeOf" + subdets[ii]; - CaloHitTimemap_[subdets[ii]] = iBooker.bookProfile( - name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.); + CaloHitTimemap_[subdets[ii]] = + iBooker.bookProfile(name, title, nbin_, minbunch_, maxbunch_ + 1, 40, -125., 375.); } PCaloHitTags_ = tags; for (auto const &it : PCaloHitTags_) crossingFrame_PCaloHit_Tokens_.push_back( - consumes>( - edm::InputTag("mix", it.label() + it.instance()))); + consumes>(edm::InputTag("mix", it.label() + it.instance()))); } } } -void MixCollectionValidation::analyze(const edm::Event &iEvent, - const edm::EventSetup &iConfig) { +void MixCollectionValidation::analyze(const edm::Event &iEvent, const edm::EventSetup &iConfig) { using namespace edm; if (!HepMCProductTags_.empty()) { bool gotHepMCProduct; edm::Handle> crossingFrame; - gotHepMCProduct = - iEvent.getByToken(crossingFrame_Hep_Token_, crossingFrame); + gotHepMCProduct = iEvent.getByToken(crossingFrame_Hep_Token_, crossingFrame); if (gotHepMCProduct) { std::unique_ptr> hepMCProduct( @@ -158,8 +137,7 @@ void MixCollectionValidation::analyze(const edm::Event &iEvent, gotSimTrack = iEvent.getByToken(crossingFrame_SimTr_Token_, crossingFrame); if (gotSimTrack) { - std::unique_ptr> simTracks( - new MixCollection(crossingFrame.product())); + std::unique_ptr> simTracks(new MixCollection(crossingFrame.product())); MixCollection::MixItr hitItr; fillMultiplicity(hitItr, simTracks, nrSimTrackH_); @@ -170,12 +148,10 @@ void MixCollectionValidation::analyze(const edm::Event &iEvent, bool gotSimVertex; edm::Handle> crossingFrame; std::string SimVertexLabel = SimVertexTags_[0].label(); - gotSimVertex = - iEvent.getByToken(crossingFrame_SimVtx_Token_, crossingFrame); + gotSimVertex = iEvent.getByToken(crossingFrame_SimVtx_Token_, crossingFrame); if (gotSimVertex) { - std::unique_ptr> simVerteces( - new MixCollection(crossingFrame.product())); + std::unique_ptr> simVerteces(new MixCollection(crossingFrame.product())); MixCollection::MixItr hitItr; fillMultiplicity(hitItr, simVerteces, nrSimVertexH_); @@ -183,136 +159,107 @@ void MixCollectionValidation::analyze(const edm::Event &iEvent, } if (!PSimHitTags_.empty()) { - edm::Handle> crossingFrame; for (int i = 0; i < (int)PSimHitTags_.size(); i++) { bool gotPSimHit; - gotPSimHit = - iEvent.getByToken(crossingFrame_PSimHit_Tokens_[i], crossingFrame); + gotPSimHit = iEvent.getByToken(crossingFrame_PSimHit_Tokens_[i], crossingFrame); if (gotPSimHit) { - std::unique_ptr> simHits( - new MixCollection(crossingFrame.product())); + std::unique_ptr> simHits(new MixCollection(crossingFrame.product())); MixCollection::MixItr hitItr; - fillMultiplicity(hitItr, simHits, - SimHitNrmap_[PSimHitTags_[i].instance()]); + fillMultiplicity(hitItr, simHits, SimHitNrmap_[PSimHitTags_[i].instance()]); - fillSimHitTime(hitItr, simHits, - SimHitTimemap_[PSimHitTags_[i].instance()]); + fillSimHitTime(hitItr, simHits, SimHitTimemap_[PSimHitTags_[i].instance()]); } } } if (!PCaloHitTags_.empty()) { - edm::Handle> crossingFrame; for (int i = 0; i < (int)PCaloHitTags_.size(); i++) { bool gotPCaloHit; - std::string PCaloHitLabel = - PCaloHitTags_[i].label() + PCaloHitTags_[i].instance(); - gotPCaloHit = - iEvent.getByToken(crossingFrame_PCaloHit_Tokens_[i], crossingFrame); + std::string PCaloHitLabel = PCaloHitTags_[i].label() + PCaloHitTags_[i].instance(); + gotPCaloHit = iEvent.getByToken(crossingFrame_PCaloHit_Tokens_[i], crossingFrame); if (gotPCaloHit) { - std::unique_ptr> caloHits( - new MixCollection(crossingFrame.product())); + std::unique_ptr> caloHits(new MixCollection(crossingFrame.product())); MixCollection::MixItr hitItr; - fillMultiplicity(hitItr, caloHits, - CaloHitNrmap_[PCaloHitTags_[i].instance()]); + fillMultiplicity(hitItr, caloHits, CaloHitNrmap_[PCaloHitTags_[i].instance()]); - fillCaloHitTime(hitItr, caloHits, - CaloHitTimemap_[PCaloHitTags_[i].instance()]); + fillCaloHitTime(hitItr, caloHits, CaloHitTimemap_[PCaloHitTags_[i].instance()]); } } } } template -void MixCollectionValidation::fillMultiplicity(T1 &theItr_, T2 &theColl_, - MonitorElement *theProfile_) { - +void MixCollectionValidation::fillMultiplicity(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_) { std::vector theMult(nbin_); for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) { - int bunch = (*theItr_).eventId().bunchCrossing(); int index = bunch - minbunch_; if (index >= 0 && index < nbin_) { theMult[index] += 1; } else { - edm::LogWarning("MixCollectionValidation") - << "fillMultiplicity: bunch number " << bunch << " out of range"; + edm::LogWarning("MixCollectionValidation") << "fillMultiplicity: bunch number " << bunch << " out of range"; } } for (int i = 0; i < nbin_; i++) { - theProfile_->Fill(float(i + minbunch_ + 0.5), - std::log10(std::max(float(0.1), float(theMult[i])))); + theProfile_->Fill(float(i + minbunch_ + 0.5), std::log10(std::max(float(0.1), float(theMult[i])))); } } template -void MixCollectionValidation::fillGenParticleMulti( - T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_) { - +void MixCollectionValidation::fillGenParticleMulti(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_) { std::vector theMult(nbin_); for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) { - int bunch = theItr_.bunch(); int index = bunch - minbunch_; if (index >= 0 && index < nbin_) { theMult[index] += (*theItr_).GetEvent()->particles_size(); } else { - edm::LogWarning("MixCollectionValidation") - << "fillMultiplicity: bunch number " << bunch << " out of range"; + edm::LogWarning("MixCollectionValidation") << "fillMultiplicity: bunch number " << bunch << " out of range"; } } for (int i = 0; i < nbin_; i++) { - theProfile_->Fill(float(i + minbunch_ + 0.5), - std::log10(std::max(float(0.1), float(theMult[i])))); + theProfile_->Fill(float(i + minbunch_ + 0.5), std::log10(std::max(float(0.1), float(theMult[i])))); } } template -void MixCollectionValidation::fillSimHitTime(T1 &theItr_, T2 &theColl_, - MonitorElement *theProfile_) { - +void MixCollectionValidation::fillSimHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_) { for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) { - int bunch = (*theItr_).eventId().bunchCrossing(); float time = (*theItr_).timeOfFlight(); int index = bunch - minbunch_; if (index >= 0 && index < nbin_) { theProfile_->Fill(float(bunch + 0.5), time); } else { - edm::LogWarning("MixCollectionValidation") - << "fillSimHitTime: bunch number " << bunch << " out of range"; + edm::LogWarning("MixCollectionValidation") << "fillSimHitTime: bunch number " << bunch << " out of range"; } } } template -void MixCollectionValidation::fillCaloHitTime(T1 &theItr_, T2 &theColl_, - MonitorElement *theProfile_) { - +void MixCollectionValidation::fillCaloHitTime(T1 &theItr_, T2 &theColl_, MonitorElement *theProfile_) { for (theItr_ = theColl_->begin(); theItr_ != theColl_->end(); ++theItr_) { - int bunch = (*theItr_).eventId().bunchCrossing(); float time = (*theItr_).time(); int index = bunch - minbunch_; if (index >= 0 && index < nbin_) { theProfile_->Fill(float(bunch + 0.5), time); } else { - edm::LogWarning("MixCollectionValidation") - << "fillCaloHitTime: bunch number " << bunch << " out of range"; + edm::LogWarning("MixCollectionValidation") << "fillCaloHitTime: bunch number " << bunch << " out of range"; } } } diff --git a/Validation/Mixing/src/TestSuite.cc b/Validation/Mixing/src/TestSuite.cc index aec9e1c4bc803..cc00e611ce337 100644 --- a/Validation/Mixing/src/TestSuite.cc +++ b/Validation/Mixing/src/TestSuite.cc @@ -31,29 +31,22 @@ TestSuite::TestSuite(const edm::ParameterSet &iConfig) : filename_(iConfig.getParameter("fileName")), bunchcr_(iConfig.getParameter("BunchNr")), minbunch_(iConfig.getParameter("minBunch")), - maxbunch_(iConfig.getParameter("maxBunch")), dbe_(nullptr), - cfTrackToken_(consumes>( - iConfig.getParameter("cfTrackTag"))), - cfVertexToken_(consumes>( - iConfig.getParameter("cfVertexTag"))), - g4SimHits_Token_(consumes>( - edm::InputTag("mix", "g4SimHitsTrackerHitsTECLowTof"))), - g4SimHits_Ecal_Token_(consumes>( - edm::InputTag("mix", "g4SimHitsEcalHitsEB"))), - g4SimHits_HCal_Token_(consumes>( - edm::InputTag("mix", "g4SimHitsHcalHits"))) { - std::cout << "Constructed testSuite , bunchcr " << bunchcr_ - << " filename: " << filename_ << std::endl; + maxbunch_(iConfig.getParameter("maxBunch")), + dbe_(nullptr), + cfTrackToken_(consumes>(iConfig.getParameter("cfTrackTag"))), + cfVertexToken_(consumes>(iConfig.getParameter("cfVertexTag"))), + g4SimHits_Token_(consumes>(edm::InputTag("mix", "g4SimHitsTrackerHitsTECLowTof"))), + g4SimHits_Ecal_Token_(consumes>(edm::InputTag("mix", "g4SimHitsEcalHitsEB"))), + g4SimHits_HCal_Token_(consumes>(edm::InputTag("mix", "g4SimHitsHcalHits"))) { + std::cout << "Constructed testSuite , bunchcr " << bunchcr_ << " filename: " << filename_ << std::endl; } TestSuite::~TestSuite() { - // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) } void TestSuite::beginJob() { - // get hold of back-end interface dbe_ = Service().operator->(); dbe_->showDirStructure(); @@ -66,8 +59,7 @@ void TestSuite::endJob() { } // ------------ method called to analyze the data ------------ -void TestSuite::analyze(const edm::Event &iEvent, - const edm::EventSetup &iSetup) { +void TestSuite::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { using namespace edm; // Get input @@ -90,24 +82,18 @@ void TestSuite::analyze(const edm::Event &iEvent, // itself while operator-> points to the templated objects!!!! // track histo - char histotracks[30], sighistotracks[30], histotracksindsig[30], - histotracksind[30]; + char histotracks[30], sighistotracks[30], histotracksindsig[30], histotracksind[30]; sprintf(histotracks, "Tracks_bcr_%d", bunchcr_); sprintf(sighistotracks, "SignalTracks_bcr_%d", bunchcr_); sprintf(histotracksind, "VtxPointers_%d", bunchcr_); sprintf(histotracksindsig, "VtxPointers_signal_%d", bunchcr_); MonitorElement *trhist = - dbe_->book1D(histotracks, "Bunchcrossings", maxbunch_ - minbunch_ + 1, - minbunch_, maxbunch_ + 1); + dbe_->book1D(histotracks, "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1); MonitorElement *trhistsig = - dbe_->book1D(sighistotracks, "Bunchcrossings", maxbunch_ - minbunch_ + 1, - minbunch_, maxbunch_ + 1); - MonitorElement *trindhist = - dbe_->book1D(histotracksind, "Track to Vertex indices", 100, 0, 500); - MonitorElement *trindhistsig = dbe_->book1D( - histotracksindsig, "Signal Track to Vertex indices", 100, 0, 500); - std::unique_ptr> col1( - new MixCollection(cf_track.product())); + dbe_->book1D(sighistotracks, "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1); + MonitorElement *trindhist = dbe_->book1D(histotracksind, "Track to Vertex indices", 100, 0, 500); + MonitorElement *trindhistsig = dbe_->book1D(histotracksindsig, "Signal Track to Vertex indices", 100, 0, 500); + std::unique_ptr> col1(new MixCollection(cf_track.product())); MixCollection::iterator cfi1; for (cfi1 = col1->begin(); cfi1 != col1->end(); cfi1++) { if (cfi1.getTrigger() == 0) { @@ -120,24 +106,18 @@ void TestSuite::analyze(const edm::Event &iEvent, } // vertex histo - char histovertices[30], sighistovertices[30], histovertexindices[30], - histovertexindicessig[30]; + char histovertices[30], sighistovertices[30], histovertexindices[30], histovertexindicessig[30]; sprintf(histovertices, "Vertices_bcr_%d", bunchcr_); sprintf(sighistovertices, "SignalVertices_bcr_%d", bunchcr_); sprintf(histovertexindices, "TrackPointers_%d", bunchcr_); sprintf(histovertexindicessig, "TrackPointers_signal_%d", bunchcr_); MonitorElement *vtxhist = - dbe_->book1D(histovertices, "Bunchcrossings", maxbunch_ - minbunch_ + 1, - minbunch_, maxbunch_ + 1); + dbe_->book1D(histovertices, "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1); MonitorElement *vtxhistsig = - dbe_->book1D(sighistovertices, "Bunchcrossings", - maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1); - MonitorElement *vtxindhist = - dbe_->book1D(histovertexindices, "Vertex to Track Indices", 100, 0, 300); - MonitorElement *vtxindhistsig = dbe_->book1D( - histovertexindicessig, "Signal Vertex to Track Indices", 100, 0, 300); - std::unique_ptr> col2( - new MixCollection(cf_vertex.product())); + dbe_->book1D(sighistovertices, "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1); + MonitorElement *vtxindhist = dbe_->book1D(histovertexindices, "Vertex to Track Indices", 100, 0, 300); + MonitorElement *vtxindhistsig = dbe_->book1D(histovertexindicessig, "Signal Vertex to Track Indices", 100, 0, 300); + std::unique_ptr> col2(new MixCollection(cf_vertex.product())); MixCollection::iterator cfi2; for (cfi2 = col2->begin(); cfi2 != col2->end(); cfi2++) { if (cfi2.getTrigger() == 0) { @@ -157,14 +137,11 @@ void TestSuite::analyze(const edm::Event &iEvent, sprintf(tof, "TrackerHit_Tof_bcr_%d", bunchcr_); MonitorElement *tofhist = - dbe_->book1D(tof, "TrackerHit_ToF", 100, float(bsp * minbunch_), - float(bsp * maxbunch_) + 50.); + dbe_->book1D(tof, "TrackerHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.); sprintf(tof, "SignalTrackerHit_Tof_bcr_%d", bunchcr_); MonitorElement *tofhist_sig = - dbe_->book1D(tof, "TrackerHit_ToF", 100, float(bsp * minbunch_), - float(bsp * maxbunch_) + 50.); - std::unique_ptr> colsh( - new MixCollection(cf_simhit.product())); + dbe_->book1D(tof, "TrackerHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.); + std::unique_ptr> colsh(new MixCollection(cf_simhit.product())); MixCollection::iterator cfish; for (cfish = colsh->begin(); cfish != colsh->end(); cfish++) { if (cfish.getTrigger()) { @@ -177,15 +154,12 @@ void TestSuite::analyze(const edm::Event &iEvent, // Ecal sprintf(tof, "EcalEBHit_Tof_bcr_%d", bunchcr_); MonitorElement *tofecalhist = - dbe_->book1D(tof, "EcalEBHit_ToF", 100, float(bsp * minbunch_), - float(bsp * maxbunch_) + 50.); + dbe_->book1D(tof, "EcalEBHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.); sprintf(tof, "SignalEcalEBHit_Tof_bcr_%d", bunchcr_); MonitorElement *tofecalhist_sig = - dbe_->book1D(tof, "EcalEBHit_ToF", 100, float(bsp * minbunch_), - float(bsp * maxbunch_) + 50.); + dbe_->book1D(tof, "EcalEBHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.); // std::string ecalsubdet("EcalHitsEB"); - std::unique_ptr> colecal( - new MixCollection(cf_calohitEcal.product())); + std::unique_ptr> colecal(new MixCollection(cf_calohitEcal.product())); MixCollection::iterator cfiecal; for (cfiecal = colecal->begin(); cfiecal != colecal->end(); cfiecal++) { if (cfiecal.getTrigger()) @@ -197,15 +171,12 @@ void TestSuite::analyze(const edm::Event &iEvent, // Hcal sprintf(tof, "HcalHit_Tof_bcr_%d", bunchcr_); MonitorElement *tofhcalhist = - dbe_->book1D(tof, "HcalHit_ToF", 100, float(bsp * minbunch_), - float(bsp * maxbunch_) + 50.); + dbe_->book1D(tof, "HcalHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.); sprintf(tof, "SignalHcalHit_Tof_bcr_%d", bunchcr_); MonitorElement *tofhcalhist_sig = - dbe_->book1D(tof, "HcalHit_ToF", 100, float(bsp * minbunch_), - float(bsp * maxbunch_) + 50.); + dbe_->book1D(tof, "HcalHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.); // std::string hcalsubdet("HcalHits"); - std::unique_ptr> colhcal( - new MixCollection(cf_calohitHcal.product())); + std::unique_ptr> colhcal(new MixCollection(cf_calohitHcal.product())); MixCollection::iterator cfihcal; for (cfihcal = colhcal->begin(); cfihcal != colhcal->end(); cfihcal++) { diff --git a/Validation/MuonCSCDigis/interface/CSCBaseValidation.h b/Validation/MuonCSCDigis/interface/CSCBaseValidation.h index e6f4af2819dba..f6df75f5ef2a0 100644 --- a/Validation/MuonCSCDigis/interface/CSCBaseValidation.h +++ b/Validation/MuonCSCDigis/interface/CSCBaseValidation.h @@ -18,8 +18,7 @@ class CSCBaseValidation { virtual ~CSCBaseValidation() {} void setGeometry(const CSCGeometry *geom) { theCSCGeometry = geom; } void setSimHitMap(const PSimHitMap *simHitMap) { theSimHitMap = simHitMap; } - virtual void analyze(const edm::Event &e, - const edm::EventSetup &eventSetup) = 0; + virtual void analyze(const edm::Event &e, const edm::EventSetup &eventSetup) = 0; protected: const CSCLayer *findLayer(int detId) const; diff --git a/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc index 917dd2bdf7296..eab2a8a07c1b8 100644 --- a/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc @@ -6,8 +6,7 @@ #include "Geometry/CSCGeometry/interface/CSCGeometry.h" #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h" -CSCALCTDigiValidation::CSCALCTDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC) +CSCALCTDigiValidation::CSCALCTDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC) : CSCBaseValidation(inputTag), theTimeBinPlots(), theNDigisPerLayerPlots() { alcts_Token_ = iC.consumes(inputTag); } @@ -15,8 +14,7 @@ CSCALCTDigiValidation::CSCALCTDigiValidation(const edm::InputTag &inputTag, CSCALCTDigiValidation::~CSCALCTDigiValidation() {} void CSCALCTDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { - theNDigisPerEventPlot = iBooker.book1D( - "CSCALCTDigisPerEvent", "CSC ALCT Digis per event", 100, 0, 100); + theNDigisPerEventPlot = iBooker.book1D("CSCALCTDigisPerEvent", "CSC ALCT Digis per event", 100, 0, 100); for (int i = 0; i < 10; ++i) { char title1[200], title2[200]; sprintf(title1, "CSCALCTDigiTimeType%d", i + 1); @@ -26,19 +24,16 @@ void CSCALCTDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { } } -void CSCALCTDigiValidation::analyze(const edm::Event &e, - const edm::EventSetup &) { +void CSCALCTDigiValidation::analyze(const edm::Event &e, const edm::EventSetup &) { edm::Handle alcts; e.getByToken(alcts_Token_, alcts); if (!alcts.isValid()) { - edm::LogError("CSCDigiDump") - << "Cannot get alcts by label " << theInputTag.encode(); + edm::LogError("CSCDigiDump") << "Cannot get alcts by label " << theInputTag.encode(); } unsigned nDigisPerEvent = 0; - for (CSCALCTDigiCollection::DigiRangeIterator j = alcts->begin(); - j != alcts->end(); j++) { + for (CSCALCTDigiCollection::DigiRangeIterator j = alcts->begin(); j != alcts->end(); j++) { std::vector::const_iterator beginDigi = (*j).second.first; std::vector::const_iterator endDigi = (*j).second.second; CSCDetId detId((*j).first.rawId()); @@ -47,8 +42,7 @@ void CSCALCTDigiValidation::analyze(const edm::Event &e, nDigisPerEvent += nDigis; theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis); - for (std::vector::const_iterator digiItr = beginDigi; - digiItr != endDigi; ++digiItr) { + for (std::vector::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) { theTimeBinPlots[chamberType - 1]->Fill(digiItr->getBX()); } } diff --git a/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.h b/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.h index d70dcdac7d74e..115bf2a9da894 100644 --- a/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.h +++ b/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.h @@ -11,8 +11,7 @@ class CSCALCTDigiValidation : public CSCBaseValidation { public: - CSCALCTDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC); + CSCALCTDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC); ~CSCALCTDigiValidation() override; void bookHistograms(DQMStore::IBooker &); void analyze(const edm::Event &, const edm::EventSetup &) override; diff --git a/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc index 83719f34f4221..915dfc58307e1 100644 --- a/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc @@ -6,8 +6,7 @@ #include "Geometry/CSCGeometry/interface/CSCGeometry.h" #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h" -CSCCLCTDigiValidation::CSCCLCTDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC) +CSCCLCTDigiValidation::CSCCLCTDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC) : CSCBaseValidation(inputTag), theTimeBinPlots(), theNDigisPerLayerPlots() { clcts_Token_ = iC.consumes(inputTag); } @@ -15,8 +14,7 @@ CSCCLCTDigiValidation::CSCCLCTDigiValidation(const edm::InputTag &inputTag, CSCCLCTDigiValidation::~CSCCLCTDigiValidation() {} void CSCCLCTDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { - theNDigisPerEventPlot = iBooker.book1D( - "CSCCLCTDigisPerEvent", "CSC CLCT Digis per event", 100, 0, 100); + theNDigisPerEventPlot = iBooker.book1D("CSCCLCTDigisPerEvent", "CSC CLCT Digis per event", 100, 0, 100); for (int i = 0; i < 10; ++i) { char title1[200], title2[200]; sprintf(title1, "CSCCLCTDigiTimeType%d", i + 1); @@ -26,20 +24,17 @@ void CSCCLCTDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { } } -void CSCCLCTDigiValidation::analyze(const edm::Event &e, - const edm::EventSetup &) { +void CSCCLCTDigiValidation::analyze(const edm::Event &e, const edm::EventSetup &) { edm::Handle clcts; e.getByToken(clcts_Token_, clcts); if (!clcts.isValid()) { - edm::LogError("CSCDigiDump") - << "Cannot get clcts by label " << theInputTag.encode(); + edm::LogError("CSCDigiDump") << "Cannot get clcts by label " << theInputTag.encode(); } unsigned nDigisPerEvent = 0; - for (CSCCLCTDigiCollection::DigiRangeIterator j = clcts->begin(); - j != clcts->end(); j++) { + for (CSCCLCTDigiCollection::DigiRangeIterator j = clcts->begin(); j != clcts->end(); j++) { std::vector::const_iterator beginDigi = (*j).second.first; std::vector::const_iterator endDigi = (*j).second.second; CSCDetId detId((*j).first.rawId()); @@ -49,8 +44,7 @@ void CSCCLCTDigiValidation::analyze(const edm::Event &e, nDigisPerEvent += nDigis; theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis); - for (std::vector::const_iterator digiItr = beginDigi; - digiItr != endDigi; ++digiItr) { + for (std::vector::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) { theTimeBinPlots[chamberType - 1]->Fill(digiItr->getBX()); } } diff --git a/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.h b/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.h index 2b811e1213559..671e2f38a29be 100644 --- a/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.h +++ b/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.h @@ -11,8 +11,7 @@ class CSCCLCTDigiValidation : public CSCBaseValidation { public: - CSCCLCTDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC); + CSCCLCTDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC); ~CSCCLCTDigiValidation() override; void bookHistograms(DQMStore::IBooker &); void analyze(const edm::Event &, const edm::EventSetup &) override; diff --git a/Validation/MuonCSCDigis/src/CSCComparatorDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCComparatorDigiValidation.cc index 2455c1098f466..8d8c8f65c96d8 100644 --- a/Validation/MuonCSCDigis/src/CSCComparatorDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCComparatorDigiValidation.cc @@ -3,13 +3,14 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Validation/MuonCSCDigis/src/CSCComparatorDigiValidation.h" -CSCComparatorDigiValidation::CSCComparatorDigiValidation( - const edm::InputTag &inputTag, const edm::InputTag &stripDigiInputTag, - edm::ConsumesCollector &&iC) +CSCComparatorDigiValidation::CSCComparatorDigiValidation(const edm::InputTag &inputTag, + const edm::InputTag &stripDigiInputTag, + edm::ConsumesCollector &&iC) : CSCBaseValidation(inputTag), - theStripDigi_Token_( - iC.consumes(stripDigiInputTag)), - theTimeBinPlots(), theNDigisPerLayerPlots(), theStripDigiPlots(), + theStripDigi_Token_(iC.consumes(stripDigiInputTag)), + theTimeBinPlots(), + theNDigisPerLayerPlots(), + theStripDigiPlots(), the3StripPlots() { comparators_Token_ = iC.consumes(inputTag); } @@ -17,9 +18,7 @@ CSCComparatorDigiValidation::CSCComparatorDigiValidation( CSCComparatorDigiValidation::~CSCComparatorDigiValidation() {} void CSCComparatorDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { - theNDigisPerEventPlot = - iBooker.book1D("CSCComparatorDigisPerEvent", - "CSC Comparator Digis per event", 100, 0, 100); + theNDigisPerEventPlot = iBooker.book1D("CSCComparatorDigisPerEvent", "CSC Comparator Digis per event", 100, 0, 100); for (int i = 0; i < 10; ++i) { char title1[200], title2[200], title3[200], title4[200]; sprintf(title1, "CSCComparatorDigiTimeType%d", i + 1); @@ -33,26 +32,22 @@ void CSCComparatorDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { } } -void CSCComparatorDigiValidation::analyze(const edm::Event &e, - const edm::EventSetup &) { +void CSCComparatorDigiValidation::analyze(const edm::Event &e, const edm::EventSetup &) { edm::Handle comparators; edm::Handle stripDigis; e.getByToken(comparators_Token_, comparators); if (!comparators.isValid()) { - edm::LogError("CSCDigiDump") - << "Cannot get comparators by label " << theInputTag.encode(); + edm::LogError("CSCDigiDump") << "Cannot get comparators by label " << theInputTag.encode(); } e.getByToken(theStripDigi_Token_, stripDigis); if (!stripDigis.isValid()) { - edm::LogError("CSCDigiDump") - << "Cannot get comparators by label " << theInputTag.encode(); + edm::LogError("CSCDigiDump") << "Cannot get comparators by label " << theInputTag.encode(); } unsigned nDigisPerEvent = 0; - for (CSCComparatorDigiCollection::DigiRangeIterator j = comparators->begin(); - j != comparators->end(); j++) { + for (CSCComparatorDigiCollection::DigiRangeIterator j = comparators->begin(); j != comparators->end(); j++) { std::vector::const_iterator digiItr = (*j).second.first; std::vector::const_iterator last = (*j).second.second; @@ -69,17 +64,15 @@ void CSCComparatorDigiValidation::analyze(const edm::Event &e, theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin()); int strip = digiItr->getStrip(); - for (std::vector::const_iterator stripItr = - stripRange.first; - stripItr != stripRange.second; ++stripItr) { + for (std::vector::const_iterator stripItr = stripRange.first; stripItr != stripRange.second; + ++stripItr) { if (stripItr->getStrip() == strip) { std::vector adc = stripItr->getADCCounts(); float pedc = 0.5 * (adc[0] + adc[1]); float amp = adc[4] - pedc; theStripDigiPlots[chamberType - 1]->Fill(amp); // check neighbors - if (stripItr != stripRange.first && - stripItr != stripRange.second - 1) { + if (stripItr != stripRange.first && stripItr != stripRange.second - 1) { std::vector adcl = (stripItr - 1)->getADCCounts(); std::vector adcr = (stripItr + 1)->getADCCounts(); float pedl = 0.5 * (adcl[0] + adcl[1]); diff --git a/Validation/MuonCSCDigis/src/CSCDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCDigiValidation.cc index 12f7fe75eabe7..d3b527e6fcb5a 100644 --- a/Validation/MuonCSCDigis/src/CSCDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCDigiValidation.cc @@ -13,23 +13,22 @@ CSCDigiValidation::CSCDigiValidation(const edm::ParameterSet &ps) : doSim_(ps.getParameter("doSim")), - theSimHitMap(ps.getParameter("simHitsTag"), - consumesCollector()), - theCSCGeometry(nullptr), theStripDigiValidation(nullptr), - theWireDigiValidation(nullptr), theComparatorDigiValidation(nullptr), - theALCTDigiValidation(nullptr), theCLCTDigiValidation(nullptr) { - theStripDigiValidation = new CSCStripDigiValidation( - ps.getParameter("stripDigiTag"), consumesCollector()); + theSimHitMap(ps.getParameter("simHitsTag"), consumesCollector()), + theCSCGeometry(nullptr), + theStripDigiValidation(nullptr), + theWireDigiValidation(nullptr), + theComparatorDigiValidation(nullptr), + theALCTDigiValidation(nullptr), + theCLCTDigiValidation(nullptr) { + theStripDigiValidation = + new CSCStripDigiValidation(ps.getParameter("stripDigiTag"), consumesCollector()); theWireDigiValidation = - new CSCWireDigiValidation(ps.getParameter("wireDigiTag"), - consumesCollector(), doSim_); - theComparatorDigiValidation = new CSCComparatorDigiValidation( - ps.getParameter("comparatorDigiTag"), - ps.getParameter("stripDigiTag"), consumesCollector()); - theALCTDigiValidation = new CSCALCTDigiValidation( - ps.getParameter("alctDigiTag"), consumesCollector()); - theCLCTDigiValidation = new CSCCLCTDigiValidation( - ps.getParameter("clctDigiTag"), consumesCollector()); + new CSCWireDigiValidation(ps.getParameter("wireDigiTag"), consumesCollector(), doSim_); + theComparatorDigiValidation = new CSCComparatorDigiValidation(ps.getParameter("comparatorDigiTag"), + ps.getParameter("stripDigiTag"), + consumesCollector()); + theALCTDigiValidation = new CSCALCTDigiValidation(ps.getParameter("alctDigiTag"), consumesCollector()); + theCLCTDigiValidation = new CSCCLCTDigiValidation(ps.getParameter("clctDigiTag"), consumesCollector()); if (doSim_) { theStripDigiValidation->setSimHitMap(&theSimHitMap); @@ -57,8 +56,7 @@ void CSCDigiValidation::bookHistograms(DQMStore::IBooker &iBooker, theCLCTDigiValidation->bookHistograms(iBooker); } -void CSCDigiValidation::analyze(const edm::Event &e, - const edm::EventSetup &eventSetup) { +void CSCDigiValidation::analyze(const edm::Event &e, const edm::EventSetup &eventSetup) { theSimHitMap.fill(e); // find the geometry & conditions for this event diff --git a/Validation/MuonCSCDigis/src/CSCDigiValidation.h b/Validation/MuonCSCDigis/src/CSCDigiValidation.h index 2450c448069df..7f27bc1743597 100644 --- a/Validation/MuonCSCDigis/src/CSCDigiValidation.h +++ b/Validation/MuonCSCDigis/src/CSCDigiValidation.h @@ -22,8 +22,7 @@ class CSCDigiValidation : public DQMEDAnalyzer { public: explicit CSCDigiValidation(const edm::ParameterSet &); ~CSCDigiValidation() override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; void analyze(const edm::Event &, const edm::EventSetup &) override; private: diff --git a/Validation/MuonCSCDigis/src/CSCStripDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCStripDigiValidation.cc index 420631bf40cc9..459aca23ffb04 100644 --- a/Validation/MuonCSCDigis/src/CSCStripDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCStripDigiValidation.cc @@ -3,10 +3,11 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Validation/MuonCSCDigis/src/CSCStripDigiValidation.h" -CSCStripDigiValidation::CSCStripDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC) - : CSCBaseValidation(inputTag), thePedestalSum(0), - thePedestalCovarianceSum(0), thePedestalCount(0), +CSCStripDigiValidation::CSCStripDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC) + : CSCBaseValidation(inputTag), + thePedestalSum(0), + thePedestalCovarianceSum(0), + thePedestalCount(0), thePedestalTimeCorrelationPlot(nullptr), thePedestalNeighborCorrelationPlot(nullptr), theNDigisPerChamberPlot(nullptr) { @@ -15,22 +16,13 @@ CSCStripDigiValidation::CSCStripDigiValidation(const edm::InputTag &inputTag, CSCStripDigiValidation::~CSCStripDigiValidation() {} -void CSCStripDigiValidation::bookHistograms(DQMStore::IBooker &iBooker, - bool doSim) { - thePedestalPlot = - iBooker.book1D("CSCPedestal", "CSC Pedestal ", 400, 550, 650); - theAmplitudePlot = - iBooker.book1D("CSCStripAmplitude", "CSC Strip Amplitude", 200, 0, 2000); - theRatio4to5Plot = iBooker.book1D( - "CSCStrip4to5", "CSC Strip Ratio tbin 4 to tbin 5", 100, 0, 1); - theRatio6to5Plot = iBooker.book1D( - "CSCStrip6to5", "CSC Strip Ratio tbin 6 to tbin 5", 120, 0, 1.2); - theNDigisPerLayerPlot = - iBooker.book1D("CSCStripDigisPerLayer", - "Number of CSC Strip Digis per layer", 48, 0, 48); - theNDigisPerEventPlot = - iBooker.book1D("CSCStripDigisPerEvent", - "Number of CSC Strip Digis per event", 100, 0, 500); +void CSCStripDigiValidation::bookHistograms(DQMStore::IBooker &iBooker, bool doSim) { + thePedestalPlot = iBooker.book1D("CSCPedestal", "CSC Pedestal ", 400, 550, 650); + theAmplitudePlot = iBooker.book1D("CSCStripAmplitude", "CSC Strip Amplitude", 200, 0, 2000); + theRatio4to5Plot = iBooker.book1D("CSCStrip4to5", "CSC Strip Ratio tbin 4 to tbin 5", 100, 0, 1); + theRatio6to5Plot = iBooker.book1D("CSCStrip6to5", "CSC Strip Ratio tbin 6 to tbin 5", 120, 0, 1.2); + theNDigisPerLayerPlot = iBooker.book1D("CSCStripDigisPerLayer", "Number of CSC Strip Digis per layer", 48, 0, 48); + theNDigisPerEventPlot = iBooker.book1D("CSCStripDigisPerEvent", "Number of CSC Strip Digis per event", 100, 0, 500); if (doSim) { for (int i = 0; i < 10; ++i) { char title1[200]; @@ -40,19 +32,16 @@ void CSCStripDigiValidation::bookHistograms(DQMStore::IBooker &iBooker, } } -void CSCStripDigiValidation::analyze(const edm::Event &e, - const edm::EventSetup &) { +void CSCStripDigiValidation::analyze(const edm::Event &e, const edm::EventSetup &) { edm::Handle strips; e.getByToken(strips_Token_, strips); if (!strips.isValid()) { - edm::LogError("CSCDigiValidation") - << "Cannot get strips by label " << theInputTag.encode(); + edm::LogError("CSCDigiValidation") << "Cannot get strips by label " << theInputTag.encode(); } unsigned nDigisPerEvent = 0; - for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); - j != strips->end(); j++) { + for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); j++) { std::vector::const_iterator digiItr = (*j).second.first; std::vector::const_iterator last = (*j).second.second; int nDigis = last - digiItr; @@ -84,7 +73,7 @@ void CSCStripDigiValidation::analyze(const edm::Event &e, } } } - } // loop over digis + } // loop over digis theNDigisPerEventPlot->Fill(nDigisPerEvent); } @@ -103,9 +92,7 @@ void CSCStripDigiValidation::fillSignalPlots(const CSCStripDigi &digi) { theRatio6to5Plot->Fill((adcCounts[5] - pedestal) / (adcCounts[4] - pedestal)); } -void CSCStripDigiValidation::plotResolution(const PSimHit &hit, int strip, - const CSCLayer *layer, - int chamberType) { +void CSCStripDigiValidation::plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType) { double hitX = hit.localPosition().x(); double hitY = hit.localPosition().y(); double digiX = layer->geometry()->xOfStrip(strip, hitY); diff --git a/Validation/MuonCSCDigis/src/CSCStripDigiValidation.h b/Validation/MuonCSCDigis/src/CSCStripDigiValidation.h index f45cd2bfbd91d..a3a19792b3323 100644 --- a/Validation/MuonCSCDigis/src/CSCStripDigiValidation.h +++ b/Validation/MuonCSCDigis/src/CSCStripDigiValidation.h @@ -11,14 +11,12 @@ class CSCStripDigiValidation : public CSCBaseValidation { public: - CSCStripDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC); + CSCStripDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC); ~CSCStripDigiValidation() override; void bookHistograms(DQMStore::IBooker &, bool doSim); void analyze(const edm::Event &e, const edm::EventSetup &) override; void setGeometry(const CSCGeometry *geom) { theCSCGeometry = geom; } - void plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, - int chamberType); + void plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType); private: void fillPedestalPlots(const CSCStripDigi &digi); diff --git a/Validation/MuonCSCDigis/src/CSCWireDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCWireDigiValidation.cc index 63d71ac303ccb..fa9721a1cec78 100644 --- a/Validation/MuonCSCDigis/src/CSCWireDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCWireDigiValidation.cc @@ -6,19 +6,15 @@ #include "Geometry/CSCGeometry/interface/CSCGeometry.h" #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h" -CSCWireDigiValidation::CSCWireDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC, - bool doSim) - : CSCBaseValidation(inputTag), doSim_(doSim), theTimeBinPlots(), - theNDigisPerLayerPlots() { +CSCWireDigiValidation::CSCWireDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC, bool doSim) + : CSCBaseValidation(inputTag), doSim_(doSim), theTimeBinPlots(), theNDigisPerLayerPlots() { wires_Token_ = iC.consumes(inputTag); } CSCWireDigiValidation::~CSCWireDigiValidation() {} void CSCWireDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { - theNDigisPerEventPlot = iBooker.book1D( - "CSCWireDigisPerEvent", "CSC Wire Digis per event", 100, 0, 100); + theNDigisPerEventPlot = iBooker.book1D("CSCWireDigisPerEvent", "CSC Wire Digis per event", 100, 0, 100); for (int i = 0; i < 10; ++i) { char title1[200], title2[200], title3[200]; sprintf(title1, "CSCWireDigiTimeType%d", i + 1); @@ -30,21 +26,18 @@ void CSCWireDigiValidation::bookHistograms(DQMStore::IBooker &iBooker) { } } -void CSCWireDigiValidation::analyze(const edm::Event &e, - const edm::EventSetup &) { +void CSCWireDigiValidation::analyze(const edm::Event &e, const edm::EventSetup &) { edm::Handle wires; e.getByToken(wires_Token_, wires); if (!wires.isValid()) { - edm::LogError("CSCDigiDump") - << "Cannot get wires by label " << theInputTag.encode(); + edm::LogError("CSCDigiDump") << "Cannot get wires by label " << theInputTag.encode(); } unsigned nDigisPerEvent = 0; - for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); - j != wires->end(); j++) { + for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); j++) { std::vector::const_iterator beginDigi = (*j).second.first; std::vector::const_iterator endDigi = (*j).second.second; int detId = (*j).first.rawId(); @@ -55,8 +48,7 @@ void CSCWireDigiValidation::analyze(const edm::Event &e, nDigisPerEvent += nDigis; theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis); - for (std::vector::const_iterator digiItr = beginDigi; - digiItr != endDigi; ++digiItr) { + for (std::vector::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) { theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin()); } diff --git a/Validation/MuonCSCDigis/src/CSCWireDigiValidation.h b/Validation/MuonCSCDigis/src/CSCWireDigiValidation.h index cd6a0cd95f221..1cabd3c60a2c1 100644 --- a/Validation/MuonCSCDigis/src/CSCWireDigiValidation.h +++ b/Validation/MuonCSCDigis/src/CSCWireDigiValidation.h @@ -11,13 +11,11 @@ class CSCWireDigiValidation : public CSCBaseValidation { public: - CSCWireDigiValidation(const edm::InputTag &inputTag, - edm::ConsumesCollector &&iC, bool doSim); + CSCWireDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC, bool doSim); ~CSCWireDigiValidation() override; void bookHistograms(DQMStore::IBooker &); void analyze(const edm::Event &, const edm::EventSetup &) override; - void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, - const CSCLayer *layer, int chamberType); + void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType); private: edm::EDGetTokenT wires_Token_; diff --git a/Validation/MuonDTDigis/src/MuonDTDigis.cc b/Validation/MuonDTDigis/src/MuonDTDigis.cc index 00c78a70cbc5c..a9bde61134227 100644 --- a/Validation/MuonDTDigis/src/MuonDTDigis.cc +++ b/Validation/MuonDTDigis/src/MuonDTDigis.cc @@ -17,18 +17,15 @@ using namespace edm; using namespace std; MuonDTDigis::MuonDTDigis(const ParameterSet &pset) { - // ---------------------- // Get the debug parameter for verbose output verbose_ = pset.getUntrackedParameter("verbose", false); // the name of the Digi collection - SimHitToken_ = consumes( - pset.getParameter("SimHitLabel")); + SimHitToken_ = consumes(pset.getParameter("SimHitLabel")); // the name of the Digi collection - DigiToken_ = consumes( - pset.getParameter(("DigiLabel"))); + DigiToken_ = consumes(pset.getParameter(("DigiLabel"))); hDigis_global = std::make_unique("Global"); hDigis_W0 = std::make_unique("Wheel0"); @@ -163,10 +160,9 @@ void MuonDTDigis::bookHistograms(DQMStore::IBooker &iBooker, } void MuonDTDigis::analyze(const Event &event, const EventSetup &eventSetup) { - if (verbose_) - cout << "--- [MuonDTDigis] Analysing Event: #Run: " << event.id().run() - << " #Event: " << event.id().event() << endl; + cout << "--- [MuonDTDigis] Analysing Event: #Run: " << event.id().run() << " #Event: " << event.id().event() + << endl; // Get the DT Geometry ESHandle muonGeom; @@ -191,8 +187,7 @@ void MuonDTDigis::analyze(const Event &event, const EventSetup &eventSetup) { num_musimhits = 0; DTWireIdMap wireMap; - for (vector::const_iterator hit = simHits->begin(); - hit != simHits->end(); hit++) { + for (vector::const_iterator hit = simHits->begin(); hit != simHits->end(); hit++) { // Create the id of the wire, the simHits in the DT known also the wireId DTWireId wireId(hit->detUnitId()); // cout << " PSimHits wire id " << wireId << " part type " << @@ -219,8 +214,16 @@ void MuonDTDigis::analyze(const Event &event, const EventSetup &eventSetup) { float path = (exitP - entryP).mag(); float path_x = fabs((exitP - entryP).x()); - hAllHits->Fill(entryP.x(), exitP.x(), entryP.y(), exitP.y(), entryP.z(), - exitP.z(), path, path_x, partType, hit->processType(), + hAllHits->Fill(entryP.x(), + exitP.x(), + entryP.y(), + exitP.y(), + entryP.z(), + exitP.z(), + path, + path_x, + partType, + hit->processType(), hit->pabs()); } @@ -228,7 +231,6 @@ void MuonDTDigis::analyze(const Event &event, const EventSetup &eventSetup) { DTDigiCollection::DigiRangeIterator detUnitIt; for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) { - const DTLayerId &id = (*detUnitIt).first; const DTDigiCollection::Range &range = (*detUnitIt).second; @@ -237,8 +239,7 @@ void MuonDTDigis::analyze(const Event &event, const EventSetup &eventSetup) { wire_touched = 0; // Loop over the digis of this DetUnit - for (DTDigiCollection::const_iterator digiIt = range.first; - digiIt != range.second; ++digiIt) { + for (DTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { // cout<<" Wire: "<<(*digiIt).wire()<Fill((*digiIt).time()); @@ -288,12 +288,9 @@ void MuonDTDigis::analyze(const Event &event, const EventSetup &eventSetup) { int mu = 0; float theta = 0; - for (vector::iterator hit = wireMap[wireId].begin(); - hit != wireMap[wireId].end(); hit++) + for (vector::iterator hit = wireMap[wireId].begin(); hit != wireMap[wireId].end(); hit++) if (abs((*hit)->particleType()) == 13) { - theta = atan((*hit)->momentumAtEntry().x() / - (-(*hit)->momentumAtEntry().z())) * - 180 / M_PI; + theta = atan((*hit)->momentumAtEntry().x() / (-(*hit)->momentumAtEntry().z())) * 180 / M_PI; // cout<<"momentum x: "<<(*hit)->momentumAtEntry().x()<momentumAtEntry().z()<Fill((*digiIt).time(), theta, id.superlayer()); } - } // for digis in layer + } // for digis in layer meDoubleDigi_->Fill((float)num_digis_layer); - } // for layers + } // for layers // cout << "num_digis " << num_digis << "mu digis " << num_mudigis << endl; @@ -328,18 +325,17 @@ void MuonDTDigis::analyze(const Event &event, const EventSetup &eventSetup) { hDigis *MuonDTDigis::WheelHistos(int wheel) { switch (abs(wheel)) { + case 0: + return hDigis_W0.get(); - case 0: - return hDigis_W0.get(); - - case 1: - return hDigis_W1.get(); + case 1: + return hDigis_W1.get(); - case 2: - return hDigis_W2.get(); + case 2: + return hDigis_W2.get(); - default: - return nullptr; + default: + return nullptr; } } #include "DQMServices/Core/interface/DQMStore.h" diff --git a/Validation/MuonDTDigis/src/MuonDTDigis.h b/Validation/MuonDTDigis/src/MuonDTDigis.h index ade600d6f70d6..c1464919eecad 100644 --- a/Validation/MuonDTDigis/src/MuonDTDigis.h +++ b/Validation/MuonDTDigis/src/MuonDTDigis.h @@ -41,13 +41,12 @@ class PSimHit; class hDigis; namespace edm { -class ParameterSet; -class Event; -class EventSetup; -} // namespace edm + class ParameterSet; + class Event; + class EventSetup; +} // namespace edm class MuonDTDigis : public DQMEDAnalyzer { - public: // Constructor explicit MuonDTDigis(const edm::ParameterSet &pset); @@ -56,11 +55,9 @@ class MuonDTDigis : public DQMEDAnalyzer { ~MuonDTDigis() override; protected: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, - edm::EventSetup const &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; // Analysis - void analyze(const edm::Event &event, - const edm::EventSetup &eventSetup) override; + void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override; hDigis *WheelHistos(int wheel);