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()) {
91 iOriginal->Add(iToAdd);
93 edm::LogError(
"MergeFailure")<<
"Found histograms with different axis limits '"<<iOriginal->GetName()<<
"' not merged.";
99 mergeTogether(iElement->
getTH1F(),iHist);
102 return iStore.
book1S(iName, iHist);
105 mergeTogether(iElement->
getTH1S(),iHist);
108 return iStore.
book1DD(iName, iHist);
111 mergeTogether(iElement->
getTH1D(),iHist);
114 return iStore.
book2D(iName, iHist);
117 mergeTogether(iElement->
getTH2F(),iHist);
120 return iStore.
book2S(iName, iHist);
123 mergeTogether(iElement->
getTH2S(),iHist);
126 return iStore.
book2DD(iName, iHist);
129 mergeTogether(iElement->
getTH2D(),iHist);
132 return iStore.
book3D(iName, iHist);
135 mergeTogether(iElement->
getTH3F(),iHist);
140 void mergeWithElement(
MonitorElement* iElement, TProfile* iHist) {
146 void mergeWithElement(
MonitorElement* iElement, TProfile2D* iHist) {
157 void mergeWithElement(
MonitorElement* iElement, Long64_t& iValue) {
159 if(name.find(
"EventInfo/processedEvents") != std::string::npos) {
162 if(name.find(
"EventInfo/iEvent") != std::string::npos ||
163 name.find(
"EventInfo/iLumiSection") != std::string::npos) {
165 iElement->
Fill(iValue);
188 size_t index = oPath.find_last_of(
'/');
189 if(index == std::string::npos) {
191 oName = iFullName.c_str();
194 oName = iFullName.c_str()+index+1;
198 struct RunLumiToRange {
199 unsigned int m_run, m_lumi,m_historyIDIndex;
200 ULong64_t m_beginTime;
202 ULong64_t m_firstIndex, m_lastIndex;
206 class TreeReaderBase {
209 virtual ~TreeReaderBase() {}
212 return doRead(iIndex,iStore,iIsLumi);
214 virtual void setTree(TTree* iTree) =0;
222 class TreeObjectReader:
public TreeReaderBase {
224 TreeObjectReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
227 m_tree->GetEntry(iIndex);
232 splitName(*m_fullName, path,name);
234 element = createElement(iStore,name,m_buffer);
237 mergeWithElement(element,m_buffer);
240 iStore.
tag(element,m_tag);
244 virtual void setTree(TTree* iTree)
override {
258 class TreeSimpleReader :
public TreeReaderBase {
260 TreeSimpleReader():m_tree(0),m_fullName(0),m_buffer(),m_tag(0){
263 m_tree->GetEntry(iIndex);
268 splitName(*m_fullName, path,name);
270 element = createElement(iStore,name,m_buffer);
273 mergeWithElement(element, m_buffer);
276 iStore.
tag(element,m_tag);
280 virtual void setTree(TTree* iTree)
override {
360 virtual std::unique_ptr<edm::FileBlock>
readFile_()
override;
418 desc.
addUntracked<std::vector<std::string> >(
"fileNames")
419 ->setComment(
"Names of files to be processed.");
421 ->setComment(
"Just limit the process to the selected run.");
423 ->setComment(
"Skip the file if it is not valid");
425 ->setComment(
"An alternate file catalog to use instead of the standard site one.");
426 std::vector<edm::LuminosityBlockRange> defaultLumis;
427 desc.
addUntracked<std::vector<edm::LuminosityBlockRange> >(
"lumisToProcess",defaultLumis)
428 ->setComment(
"Skip any lumi inside the specified run:lumi range.");
437 m_catalog(iPSet.getUntrackedParameter<std::vector<std::
string> >(
"fileNames"),
438 iPSet.getUntrackedParameter<std::
string>(
"overrideCatalog")),
441 m_presentlyOpenFileIndex(0),
443 m_treeReaders(
kNIndicies,boost::shared_ptr<TreeReaderBase>()),
444 m_lastSeenReducedPHID(),
446 m_lastSeenReducedPHID2(),
449 m_filterOnRun(iPSet.getUntrackedParameter<unsigned int>(
"filterOnRun", 0)),
450 m_skipBadFiles(iPSet.getUntrackedParameter<bool>(
"skipBadFiles",
false)),
452 m_justOpenedFileSoNeedToGenerateRunTransition(
false),
453 m_shouldReadMEs(
true)
522 assert(
m_historyIDs.size() > runLumiRange.m_historyIDIndex);
528 boost::shared_ptr<edm::LuminosityBlockAuxiliary>
537 assert(
m_historyIDs.size() > runLumiRange.m_historyIDIndex);
551 unsigned int runID =rpCache.
id().
run();
552 assert(runID == runLumiRange.m_run);
574 std::vector<MonitorElement*> allMEs = (*store).getAllContents(
"");
575 for(
auto const&
ME : allMEs) {
578 if (
ME->getLumiFlag())
continue;
579 if ( !(*store).isCollate() )
590 if(runLumiRange.m_lumi == 0) {
606 assert(runLumiRange.m_run == lbCache.
id().
run());
616 std::vector<MonitorElement*> allMEs = (*store).getAllContents(
"");
617 for(
auto const&
ME : allMEs) {
619 if (
ME->getLumiFlag()) {
638 std::unique_ptr<edm::FileBlock>
646 if(
m_file.get() ==
nullptr) {
661 m_file->GetUUID().AsString(),
662 std::vector<std::string>()
670 if(
m_file.get()==
nullptr) {
return; }
678 bool shouldContinue =
false;
681 shouldContinue =
false;
685 ULong64_t index = runLumiRange.m_firstIndex;
686 ULong64_t endIndex = runLumiRange.m_lastIndex+1;
687 for (; index != endIndex; ++
index)
689 bool isLumi = runLumiRange.m_lumi !=0;
691 reader->read(index,*store,isLumi);
709 (nextRunLumiRange.m_run == runLumiRange.m_run) &&
710 (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) )
712 shouldContinue=
true;
713 runLumiRange = nextRunLumiRange;
716 }
while(shouldContinue);
737 runLumiRange.m_run=0;
740 bool shouldContinue =
false;
743 shouldContinue =
false;
762 (nextRunLumiRange.m_run == runLumiRange.m_run) &&
763 (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) ) {
764 shouldContinue=
true;
768 }
while(shouldContinue);
784 if(
m_file.get() != 0 && iIndex > 0) {
791 std::auto_ptr<TFile> newFile;
798 ex <<
"\nInput file " <<
m_catalog.
fileNames()[iIndex] <<
" was not found, could not be opened, or is corrupted.\n";
803 if(not newFile->IsZombie()) {
815 if(0 != strcmp(newFile->GetTitle(),
"1")) {
817 ex<<
"Input file "<<
m_catalog.
fileNames()[iIndex].c_str() <<
" does not appear to be a DQM Root file.\n";
825 ex<<
"Input file "<<
m_catalog.
fileNames()[iIndex].c_str() <<
" appears to be corrupted since it does not have the proper internal structure.\n"
826 " Check to see if the file was closed properly.\n";
834 assert(0!=parameterSetTree);
842 for(
unsigned int index = 0; index != parameterSetTree->GetEntries();++
index)
844 parameterSetTree->GetEntry(index);
851 assert(0!=processHistoryTree);
852 unsigned int phIndex = 0;
858 std::string* pParameterSetIDBlob = ¶meterSetIDBlob;
868 std::vector<edm::ProcessConfiguration>
configs;
872 for(
unsigned int i=0;
i != processHistoryTree->GetEntries(); ++
i) {
873 processHistoryTree->GetEntry(
i);
875 if(not configs.empty()) {
885 configs.push_back(pc);
887 if(not configs.empty()) {
898 assert(0!=indicesTree);
905 indicesTree->SetBranchAddress(
kRunBranch,&temp.m_run);
906 indicesTree->SetBranchAddress(
kLumiBranch,&temp.m_lumi);
910 indicesTree->SetBranchAddress(
kTypeBranch,&temp.m_type);
911 indicesTree->SetBranchAddress(
kFirstIndex,&temp.m_firstIndex);
912 indicesTree->SetBranchAddress(
kLastIndex,&temp.m_lastIndex);
923 typedef std::map<RunLumiPHIDKey, std::list<unsigned int>::iterator > RunLumiToLastEntryMap;
924 RunLumiToLastEntryMap runLumiToLastEntryMap;
928 typedef std::map<RunPHIDKey, std::pair< std::list<unsigned int>::iterator, std::list<unsigned int>::iterator> > RunToFirstLastEntryMap;
929 RunToFirstLastEntryMap runToFirstLastEntryMap;
931 for (Long64_t index = 0; index != indicesTree->GetEntries(); ++
index)
933 indicesTree->GetEntry(index);
946 RunLumiToLastEntryMap::iterator itFind = runLumiToLastEntryMap.find(runLumi);
947 if (itFind == runLumiToLastEntryMap.end())
953 RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
954 bool needNewEntryInRunFirstLastEntryMap =
true;
955 if (itRunFirstLastEntryFind != runToFirstLastEntryMap.end())
957 needNewEntryInRunFirstLastEntryMap=
false;
961 itLastOfRun = itRunFirstLastEntryFind->second.second;
968 itLastOfRun = itRunFirstLastEntryFind->second.first;
971 std::list<unsigned int>::iterator iter =
m_orderedIndices.insert(itLastOfRun,index);
972 runLumiToLastEntryMap[runLumi]=iter;
973 if (needNewEntryInRunFirstLastEntryMap)
974 runToFirstLastEntryMap[runKey]=std::make_pair(iter,iter);
980 runToFirstLastEntryMap[runKey].second = iter;
986 runToFirstLastEntryMap[runKey].first = iter;
994 std::list<unsigned int>::iterator itNext = itFind->second;
996 std::list<unsigned int>::iterator iter =
m_orderedIndices.insert(itNext,index);
997 RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
998 if (itRunFirstLastEntryFind->second.second == itFind->second)
1001 itRunFirstLastEntryFind->second.second = iter;
1003 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.
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< 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 boost::shared_ptr< edm::LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
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
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
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)
virtual boost::shared_ptr< edm::RunAuxiliary > readRunAuxiliary_() override
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
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)
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")