71 return iStore.
book1D(iName, iHist);
74 void mergeTogether(TH1* iOriginal,TH1* iToAdd) {
75 if(iOriginal->TestBit(TH1::kCanRebin)==
true && iToAdd->TestBit(TH1::kCanRebin) ==
true) {
78 if( -1 == iOriginal->Merge(&list)) {
79 edm::LogError(
"MergeFailure")<<
"Failed to merge DQM element "<<iOriginal->GetName();
82 if (iOriginal->GetNbinsX() == iToAdd->GetNbinsX() &&
83 iOriginal->GetXaxis()->GetXmin() == iToAdd->GetXaxis()->GetXmin() &&
84 iOriginal->GetXaxis()->GetXmax() == iToAdd->GetXaxis()->GetXmax() &&
85 iOriginal->GetNbinsY() == iToAdd->GetNbinsY() &&
86 iOriginal->GetYaxis()->GetXmin() == iToAdd->GetYaxis()->GetXmin() &&
87 iOriginal->GetYaxis()->GetXmax() == iToAdd->GetYaxis()->GetXmax() &&
88 iOriginal->GetNbinsZ() == iToAdd->GetNbinsZ() &&
89 iOriginal->GetZaxis()->GetXmin() == iToAdd->GetZaxis()->GetXmin() &&
90 iOriginal->GetZaxis()->GetXmax() == iToAdd->GetZaxis()->GetXmax() &&
94 iOriginal->Add(iToAdd);
96 edm::LogError(
"MergeFailure")<<
"Found histograms with different axis limits or different labels'"<<iOriginal->GetName()<<
"' not merged.";
103 mergeTogether(iElement->
getTH1F(),iHist);
106 return iStore.
book1S(iName, iHist);
109 mergeTogether(iElement->
getTH1S(),iHist);
112 return iStore.
book1DD(iName, iHist);
115 mergeTogether(iElement->
getTH1D(),iHist);
118 return iStore.
book2D(iName, iHist);
121 mergeTogether(iElement->
getTH2F(),iHist);
124 return iStore.
book2S(iName, iHist);
127 mergeTogether(iElement->
getTH2S(),iHist);
130 return iStore.
book2DD(iName, iHist);
133 mergeTogether(iElement->
getTH2D(),iHist);
136 return iStore.
book3D(iName, iHist);
139 mergeTogether(iElement->
getTH3F(),iHist);
144 void mergeWithElement(
MonitorElement* iElement, TProfile* iHist) {
150 void mergeWithElement(
MonitorElement* iElement, TProfile2D* iHist) {
161 void mergeWithElement(
MonitorElement* iElement, Long64_t& iValue) {
163 if(name.find(
"EventInfo/processedEvents") != std::string::npos) {
165 }
else if(name.find(
"EventInfo/iEvent") != std::string::npos ||
166 name.find(
"EventInfo/iLumiSection") != std::string::npos) {
168 iElement->
Fill(iValue);
172 iElement->
Fill(iValue);
183 iElement->
Fill(iValue);
190 iElement->
Fill(*iValue);
195 size_t index = oPath.find_last_of(
'/');
196 if(index == std::string::npos) {
198 oName = iFullName.c_str();
201 oName = iFullName.c_str()+index+1;
205 struct RunLumiToRange {
206 unsigned int m_run, m_lumi,m_historyIDIndex;
207 ULong64_t m_beginTime;
209 ULong64_t m_firstIndex, m_lastIndex;
213 class TreeReaderBase {
216 virtual ~TreeReaderBase() {}
219 return doRead(iIndex,iStore,iIsLumi);
221 virtual void setTree(TTree* iTree) =0;
229 class TreeObjectReader:
public TreeReaderBase {
231 TreeObjectReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
234 m_tree->GetEntry(iIndex);
239 splitName(*m_fullName, path,name);
241 element = createElement(iStore,name,m_buffer);
244 mergeWithElement(element,m_buffer);
247 iStore.
tag(element,m_tag);
251 virtual void setTree(TTree* iTree)
override {
265 class TreeSimpleReader :
public TreeReaderBase {
267 TreeSimpleReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
270 m_tree->GetEntry(iIndex);
275 splitName(*m_fullName, path,name);
277 element = createElement(iStore,name,m_buffer);
280 mergeWithElement(element, m_buffer);
283 iStore.
tag(element,m_tag);
287 virtual void setTree(TTree* iTree)
override {
367 virtual std::unique_ptr<edm::FileBlock>
readFile_()
override;
426 desc.
addUntracked<std::vector<std::string> >(
"fileNames")
427 ->setComment(
"Names of files to be processed.");
429 ->setComment(
"Just limit the process to the selected run.");
431 ->setComment(
"Skip the file if it is not valid");
433 ->setComment(
"An alternate file catalog to use instead of the standard site one.");
434 std::vector<edm::LuminosityBlockRange> defaultLumis;
435 desc.
addUntracked<std::vector<edm::LuminosityBlockRange> >(
"lumisToProcess",defaultLumis)
436 ->setComment(
"Skip any lumi inside the specified run:lumi range.");
445 m_catalog(iPSet.getUntrackedParameter<std::vector<std::
string> >(
"fileNames"),
446 iPSet.getUntrackedParameter<std::
string>(
"overrideCatalog")),
449 m_presentlyOpenFileIndex(0),
451 m_treeReaders(
kNIndicies,boost::shared_ptr<TreeReaderBase>()),
452 m_lastSeenReducedPHID(),
454 m_lastSeenReducedPHID2(),
457 m_filterOnRun(iPSet.getUntrackedParameter<unsigned int>(
"filterOnRun", 0)),
458 m_skipBadFiles(iPSet.getUntrackedParameter<bool>(
"skipBadFiles",
false)),
460 m_justOpenedFileSoNeedToGenerateRunTransition(
false),
461 m_shouldReadMEs(
true)
536 return std::make_shared<edm::RunAuxiliary>(
m_runAux);
539 std::shared_ptr<edm::LuminosityBlockAuxiliary>
552 return std::make_shared<edm::LuminosityBlockAuxiliary>(
m_lumiAux);
562 unsigned int runID =rpCache.
id().
run();
563 assert(runID == runLumiRange.m_run);
585 std::vector<MonitorElement*> allMEs = (*store).getAllContents(
"");
586 for(
auto const&
ME : allMEs) {
589 if (
ME->getLumiFlag())
continue;
590 if ( !(*store).isCollate() )
601 if(runLumiRange.m_lumi == 0) {
628 std::vector<MonitorElement*> allMEs = (*store).getAllContents(
"");
629 for(
auto const&
ME : allMEs) {
631 if (
ME->getLumiFlag()) {
650 std::unique_ptr<edm::FileBlock>
655 if(
m_file.get() ==
nullptr) {
672 m_file->GetUUID().AsString(),
673 std::vector<std::string>()
681 if(
m_file.get()==
nullptr) {
return; }
689 bool shouldContinue =
false;
692 shouldContinue =
false;
699 ULong64_t index = runLumiRange.m_firstIndex;
700 ULong64_t endIndex = runLumiRange.m_lastIndex+1;
701 for (; index != endIndex; ++
index)
703 bool isLumi = runLumiRange.m_lumi !=0;
705 reader->read(index,*store,isLumi);
715 (nextRunLumiRange.m_run == runLumiRange.m_run) &&
716 (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) )
718 shouldContinue=
true;
719 runLumiRange = nextRunLumiRange;
722 }
while(shouldContinue);
743 runLumiRange.m_run=0;
746 bool shouldContinue =
false;
749 shouldContinue =
false;
766 (nextRunLumiRange.m_run == runLumiRange.m_run) &&
767 (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) ) {
768 shouldContinue=
true;
772 }
while(shouldContinue);
788 if(
m_file.get() != 0 && iIndex > 0) {
795 std::auto_ptr<TFile> newFile;
802 ex <<
"\nInput file " <<
m_catalog.
fileNames()[iIndex] <<
" was not found, could not be opened, or is corrupted.\n";
807 if(not newFile->IsZombie()) {
819 if(0 != strcmp(newFile->GetTitle(),
"1")) {
821 ex<<
"Input file "<<
m_catalog.
fileNames()[iIndex].c_str() <<
" does not appear to be a DQM Root file.\n";
829 ex<<
"Input file "<<
m_catalog.
fileNames()[iIndex].c_str() <<
" appears to be corrupted since it does not have the proper internal structure.\n"
830 " Check to see if the file was closed properly.\n";
838 assert(0!=parameterSetTree);
846 for(
unsigned int index = 0; index != parameterSetTree->GetEntries();++
index)
848 parameterSetTree->GetEntry(index);
855 assert(0!=processHistoryTree);
856 unsigned int phIndex = 0;
862 std::string* pParameterSetIDBlob = ¶meterSetIDBlob;
872 std::vector<edm::ProcessConfiguration>
configs;
876 for(
unsigned int i=0;
i != processHistoryTree->GetEntries(); ++
i) {
877 processHistoryTree->GetEntry(
i);
879 if(not configs.empty()) {
889 configs.push_back(pc);
891 if(not configs.empty()) {
909 indicesTree->SetBranchAddress(
kRunBranch,&temp.m_run);
910 indicesTree->SetBranchAddress(
kLumiBranch,&temp.m_lumi);
914 indicesTree->SetBranchAddress(
kTypeBranch,&temp.m_type);
915 indicesTree->SetBranchAddress(
kFirstIndex,&temp.m_firstIndex);
916 indicesTree->SetBranchAddress(
kLastIndex,&temp.m_lastIndex);
927 typedef std::map<RunLumiPHIDKey, std::list<unsigned int>::iterator > RunLumiToLastEntryMap;
928 RunLumiToLastEntryMap runLumiToLastEntryMap;
932 typedef std::map<RunPHIDKey, std::pair< std::list<unsigned int>::iterator, std::list<unsigned int>::iterator> > RunToFirstLastEntryMap;
933 RunToFirstLastEntryMap runToFirstLastEntryMap;
935 for (Long64_t index = 0; index != indicesTree->GetEntries(); ++
index)
937 indicesTree->GetEntry(index);
950 RunLumiToLastEntryMap::iterator itFind = runLumiToLastEntryMap.find(runLumi);
951 if (itFind == runLumiToLastEntryMap.end())
957 RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
958 bool needNewEntryInRunFirstLastEntryMap =
true;
959 if (itRunFirstLastEntryFind != runToFirstLastEntryMap.end())
961 needNewEntryInRunFirstLastEntryMap=
false;
965 itLastOfRun = itRunFirstLastEntryFind->second.second;
972 itLastOfRun = itRunFirstLastEntryFind->second.first;
976 runLumiToLastEntryMap[runLumi]=
iter;
977 if (needNewEntryInRunFirstLastEntryMap)
978 runToFirstLastEntryMap[runKey]=std::make_pair(iter,iter);
984 runToFirstLastEntryMap[runKey].second =
iter;
990 runToFirstLastEntryMap[runKey].first =
iter;
998 std::list<unsigned int>::iterator itNext = itFind->second;
1001 RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
1002 if (itRunFirstLastEntryFind->second.second == itFind->second)
1005 itRunFirstLastEntryFind->second.second =
iter;
1007 itFind->second =
iter;
const DQMRootSource & operator=(const DQMRootSource &)
TH2S * getTH2S(void) const
TH1S * getTH1S(void) const
edm::InputSource::ItemType m_nextItemType
unsigned int m_lastSeenRun2
unsigned int lumi() const
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
virtual std::shared_ptr< edm::RunAuxiliary > readRunAuxiliary_() override
edm::JobReport::Token m_jrToken
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
virtual void closeFile_() override
TProfile2D * getTProfile2D(void) const
void logFileAction(char const *msg, char const *fileName) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::RunAuxiliary m_runAux
void reportInputRunNumber(unsigned int run)
std::vector< edm::RunNumber_t > m_runsToProcess
std::vector< boost::shared_ptr< TreeReaderBase > > m_treeReaders
edm::ProcessHistoryID const & processHistoryID() const
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
bool registerProcessHistory(ProcessHistory const &processHistory)
std::set< MonitorElement * > m_lumiElements
TH3F * getTH3F(void) const
TH1D * getTH1D(void) const
size_t m_presentlyOpenFileIndex
std::list< unsigned int >::iterator m_presentIndexItr
unsigned int m_filterOnRun
bool operator<(RunPHIDKey const &right) const
std::set< MonitorElement * > m_runElements
TH2D * getTH2D(void) const
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
unsigned int LuminosityBlockNumber_t
std::vector< edm::ProcessHistoryID > m_reducedHistoryIDs
MonitorElement * bookFloat(const char *name)
Book float.
Token inputFileOpened(std::string const &physicalFileName, std::string const &logicalFileName, std::string const &catalog, std::string const &inputType, std::string const &inputSourceClassName, std::string const &moduleLabel, std::string const &guid, std::vector< std::string > const &branchNames)
void tag(MonitorElement *me, unsigned int myTag)
virtual edm::InputSource::ItemType getNextItemType() override
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
std::vector< RunLumiToRange > m_runlumiToRange
void addDefault(ParameterSetDescription const &psetDescription)
edm::LuminosityBlockAuxiliary m_lumiAux
tuple path
else: Piece not in the list, fine.
std::vector< edm::ProcessHistoryID > m_historyIDs
edm::ProcessHistoryID const & processHistoryID() const
MonitorElement * bookString(const char *name, const char *value)
Book string.
edm::ProcessHistoryID processHistoryID_
void reportInputLumiSection(unsigned int run, unsigned int lumiSectId)
bool m_justOpenedFileSoNeedToGenerateRunTransition
virtual std::shared_ptr< edm::LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
edm::InputFileCatalog m_catalog
edm::ProcessHistoryID m_lastSeenReducedPHID2
std::list< unsigned int > m_orderedIndices
std::auto_ptr< TFile > m_file
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setProcessHistoryID(ProcessHistoryID const &phid)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
virtual std::unique_ptr< edm::FileBlock > readFile_() override
const std::string getFullname(void) const
get full name of ME including Pathname
std::vector< TTree * > m_trees
static void registerFromString(std::string const &rep)
unsigned int m_lastSeenLumi2
int64_t getIntValue(void) const
std::vector< edm::LuminosityBlockRange > m_lumisToProcess
bool operator<(RunLumiPHIDKey const &right) const
bool search_all(ForwardSequence const &s, Datum const &d)
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
void addContext(std::string const &context)
virtual void readRun_(edm::RunPrincipal &rpCache) override
edm::ProcessHistoryID m_lastSeenReducedPHID
bool skipIt(edm::RunNumber_t, edm::LuminosityBlockNumber_t) const
< trclass="colgroup">< tdclass="colgroup"colspan=5 > DT local reconstruction</td ></tr >< tr >< td >< ahref="classDTRecHit1DPair.html"> DTRecHit1DPair</a ></td >< td >< ahref="DataFormats_DTRecHit.html"> edm::RangeMap & lt
TProfile * getTProfile(void) const
std::vector< EventRange > & sortAndRemoveOverlaps(std::vector< EventRange > &eventRange)
RunPHIDKey(edm::ProcessHistoryID const &phid, unsigned int run)
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
bool lessThan(EventRange const &lh, EventRange const &rh)
RunLumiPHIDKey(edm::ProcessHistoryID const &phid, unsigned int run, unsigned int lumi)
std::list< unsigned int >::iterator m_nextIndexItr
void setProcessHistoryID(ProcessHistoryID const &phid)
DQMRootSource(edm::ParameterSet const &, const edm::InputSourceDescription &)
volatile std::atomic< bool > shutdown_flag false
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TH2F * getTH2F(void) const
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
virtual void readEvent_(edm::EventPrincipal &) override
virtual void readLuminosityBlock_(edm::LuminosityBlockPrincipal &lbCache) override
ProcessHistoryID id() const
unsigned int m_lastSeenRun
void inputFileClosed(InputType inputType, Token fileToken)
edm::ProcessHistoryID processHistoryID_
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void setCurrentFolder(const std::string &fullpath)
static Registry * instance()
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
LuminosityBlockID id() const
bool setupFile(unsigned int iIndex)
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")