63 return iStore.
book1D(iName, iHist);
66 void mergeTogether(TH1* iOriginal,TH1* iToAdd) {
67 if(iOriginal->TestBit(TH1::kCanRebin)==
true && iToAdd->TestBit(TH1::kCanRebin) ==
true) {
70 if( -1 == iOriginal->Merge(&list)) {
71 edm::LogError(
"MergeFailure")<<
"Failed to merge DQM element "<<iOriginal->GetName();
74 if (iOriginal->GetNbinsX() == iToAdd->GetNbinsX() &&
75 iOriginal->GetXaxis()->GetXmin() == iToAdd->GetXaxis()->GetXmin() &&
76 iOriginal->GetXaxis()->GetXmax() == iToAdd->GetXaxis()->GetXmax() &&
77 iOriginal->GetNbinsY() == iToAdd->GetNbinsY() &&
78 iOriginal->GetYaxis()->GetXmin() == iToAdd->GetYaxis()->GetXmin() &&
79 iOriginal->GetYaxis()->GetXmax() == iToAdd->GetYaxis()->GetXmax() &&
80 iOriginal->GetNbinsZ() == iToAdd->GetNbinsZ() &&
81 iOriginal->GetZaxis()->GetXmin() == iToAdd->GetZaxis()->GetXmin() &&
82 iOriginal->GetZaxis()->GetXmax() == iToAdd->GetZaxis()->GetXmax()) {
83 iOriginal->Add(iToAdd);
85 edm::LogError(
"MergeFailure")<<
"Found histograms with different axis limitsm '"<<iOriginal->GetName()<<
"' not merged.";
91 mergeTogether(iElement->
getTH1F(),iHist);
94 return iStore.
book1S(iName, iHist);
97 mergeTogether(iElement->
getTH1S(),iHist);
100 return iStore.
book1DD(iName, iHist);
103 mergeTogether(iElement->
getTH1D(),iHist);
106 return iStore.
book2D(iName, iHist);
109 mergeTogether(iElement->
getTH2F(),iHist);
112 return iStore.
book2S(iName, iHist);
115 mergeTogether(iElement->
getTH2S(),iHist);
118 return iStore.
book2DD(iName, iHist);
121 mergeTogether(iElement->
getTH2D(),iHist);
124 return iStore.
book3D(iName, iHist);
127 mergeTogether(iElement->
getTH3F(),iHist);
132 void mergeWithElement(
MonitorElement* iElement, TProfile* iHist) {
138 void mergeWithElement(
MonitorElement* iElement, TProfile2D* iHist) {
149 void mergeWithElement(
MonitorElement* iElement, Long64_t& iValue) {
151 if(name.find(
"EventInfo/processedEvents") != std::string::npos) {
154 if(name.find(
"EventInfo/iEvent") != std::string::npos ||
155 name.find(
"EventInfo/iLumiSection") != std::string::npos) {
157 iElement->
Fill(iValue);
178 void splitName(
const std::string& iFullName, std::string& oPath,
const char*& oName) {
180 size_t index = oPath.find_last_of(
'/');
181 if(index == std::string::npos) {
182 oPath = std::string();
183 oName = iFullName.c_str();
186 oName = iFullName.c_str()+index+1;
190 struct RunLumiToRange {
191 unsigned int m_run, m_lumi,m_historyIDIndex;
192 ULong64_t m_beginTime;
194 ULong64_t m_firstIndex, m_lastIndex;
198 class TreeReaderBase {
201 virtual ~TreeReaderBase() {}
204 return doRead(iIndex,iStore,iIsLumi);
206 virtual void setTree(TTree* iTree) =0;
214 class TreeObjectReader:
public TreeReaderBase {
216 TreeObjectReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
219 m_tree->GetEntry(iIndex);
224 splitName(*m_fullName, path,name);
226 element = createElement(iStore,name,m_buffer);
229 mergeWithElement(element,m_buffer);
232 iStore.
tag(element,m_tag);
236 virtual void setTree(TTree* iTree) {
244 std::string* m_fullName;
250 class TreeSimpleReader :
public TreeReaderBase {
252 TreeSimpleReader():m_tree(0),m_fullName(0),m_buffer(),m_tag(0){
255 m_tree->GetEntry(iIndex);
260 splitName(*m_fullName, path,name);
262 element = createElement(iStore,name,m_buffer);
265 mergeWithElement(element, m_buffer);
268 iStore.
tag(element,m_tag);
272 virtual void setTree(TTree* iTree) {
280 std::string* m_fullName;
311 virtual boost::shared_ptr<edm::RunPrincipal>
readRun_(boost::shared_ptr<edm::RunPrincipal> rpCache);
312 virtual boost::shared_ptr<edm::LuminosityBlockPrincipal>
readLuminosityBlock_( boost::shared_ptr<edm::LuminosityBlockPrincipal> lbCache);
315 virtual boost::shared_ptr<edm::FileBlock>
readFile_();
360 desc.
addUntracked<std::vector<std::string> >(
"fileNames")
361 ->setComment(
"Names of files to be processed.");
362 desc.
addUntracked<std::string>(
"overrideCatalog",std::string())
363 ->setComment(
"An alternate file catalog to use instead of the standard site one.");
371 m_catalog(iPSet.getUntrackedParameter<std::vector<std::string> >(
"fileNames"),
372 iPSet.getUntrackedParameter<std::string>(
"overrideCatalog")),
376 m_treeReaders(
kNIndicies,boost::shared_ptr<TreeReaderBase>()),
378 m_justOpenedFileSoNeedToGenerateRunTransition(
false),
379 m_doNotReadRemainingPartsOfFileSinceFrameworkTerminating(
false)
426 void operator()(
void*) {}
442 boost::shared_ptr<edm::RunAuxiliary>
453 if(runLumiRange.m_run == next.m_run) {
463 assert(
m_historyIDs.size() > runLumiRange.m_historyIDIndex);
468 boost::shared_ptr<edm::LuminosityBlockAuxiliary>
477 assert(
m_historyIDs.size() > runLumiRange.m_historyIDIndex);
483 boost::shared_ptr<edm::RunPrincipal>
487 unsigned int runID =rpCache->id().run();
494 if(lastRunID != runID) {
503 rpCache->addToProcessHistory();
508 if(runLumiRange.m_lumi == 0 &&
509 runLumiRange.m_run == rpCache->id().run()) {
518 boost::shared_ptr<edm::LuminosityBlockPrincipal>
531 if(runLumiRange.m_run == lbCache->id().run() &&
532 runLumiRange.m_lumi == lbCache->id().luminosityBlock()) {
542 boost::shared_ptr<edm::FileBlock>
556 m_file->GetUUID().AsString(),
557 std::vector<std::string>()
597 bool shouldContinue =
false;
599 shouldContinue =
false;
601 boost::shared_ptr<TreeReaderBase> reader =
m_treeReaders[runLumiRange.m_type];
602 for(ULong64_t index = runLumiRange.m_firstIndex, endIndex=runLumiRange.m_lastIndex+1;
605 bool isLumi = runLumiRange.m_lumi !=0;
620 if( (nextRunLumiRange.m_run == runLumiRange.m_run) &&
621 (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) ) {
622 shouldContinue=
true;
623 runLumiRange = nextRunLumiRange;
626 }
while(shouldContinue);
638 if(runLumiRange.m_lumi ==0) {
655 runLumiRange.m_run=0;
658 bool shouldContinue =
false;
660 shouldContinue =
false;
672 if( (nextRunLumiRange.m_run == runLumiRange.m_run) && (
673 nextRunLumiRange.m_lumi == runLumiRange.m_lumi) ) {
674 shouldContinue=
true;
675 runLumiRange = nextRunLumiRange;
680 }
while(shouldContinue);
705 assert(0==strcmp(
m_file->GetTitle(),
"1"));
711 assert(0!=parameterSetTree);
717 std::string* pBlob = &blob;
719 for(
unsigned int index = 0; index != parameterSetTree->GetEntries();++
index) {
720 parameterSetTree->GetEntry(index);
729 assert(0!=processHistoryTree);
730 unsigned int phIndex = 0;
732 std::string processName;
733 std::string* pProcessName = &processName;
735 std::string parameterSetIDBlob;
736 std::string* pParameterSetIDBlob = ¶meterSetIDBlob;
738 std::string releaseVersion;
739 std::string* pReleaseVersion = &releaseVersion;
742 std::string* pPassID = &passID;
749 std::vector<edm::ProcessConfiguration>
configs;
751 for(
unsigned int i=0;
i != processHistoryTree->GetEntries(); ++
i) {
752 processHistoryTree->GetEntry();
754 if(not configs.empty()) {
764 configs.push_back(pc);
766 if(not configs.empty()) {
776 assert(0!=indicesTree);
783 indicesTree->SetBranchAddress(
kRunBranch,&temp.m_run);
784 indicesTree->SetBranchAddress(
kLumiBranch,&temp.m_lumi);
788 indicesTree->SetBranchAddress(
kTypeBranch,&temp.m_type);
789 indicesTree->SetBranchAddress(
kFirstIndex,&temp.m_firstIndex);
790 indicesTree->SetBranchAddress(
kLastIndex,&temp.m_lastIndex);
799 typedef std::map<std::pair<unsigned int, unsigned int>, std::list<unsigned int>::iterator > RunLumiToLastEntryMap;
800 RunLumiToLastEntryMap runLumiToLastEntryMap;
803 typedef std::map<unsigned int, std::pair<std::list<unsigned int>::iterator,std::list<unsigned int>::iterator> > RunToFirstLastEntryMap;
804 RunToFirstLastEntryMap runToFirstLastEntryMap;
806 for(Long64_t index = 0; index != indicesTree->GetEntries();++
index) {
807 indicesTree->GetEntry(index);
811 std::pair<unsigned int, unsigned int> runLumi(temp.m_run,temp.m_lumi);
813 RunLumiToLastEntryMap::iterator itFind = runLumiToLastEntryMap.find(runLumi);
814 if(itFind == runLumiToLastEntryMap.end()) {
819 RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(temp.m_run);
820 bool needNewEntryInRunFirstLastEntryMap =
true;
821 if(itRunFirstLastEntryFind != runToFirstLastEntryMap.end()) {
822 needNewEntryInRunFirstLastEntryMap=
false;
825 itLastOfRun = itRunFirstLastEntryFind->second.second;
830 itLastOfRun = itRunFirstLastEntryFind->second.first;
834 std::list<unsigned int>::iterator iter =
m_orderedIndices.insert(itLastOfRun,index);
835 runLumiToLastEntryMap[runLumi]=iter;
836 if(needNewEntryInRunFirstLastEntryMap) {
837 runToFirstLastEntryMap[temp.m_run]=std::make_pair(iter,iter);
841 runToFirstLastEntryMap[temp.m_run].second = iter;
845 runToFirstLastEntryMap[temp.m_run].first = iter;
851 std::list<unsigned int>::iterator itNext = itFind->second;
853 std::list<unsigned int>::iterator iter =
m_orderedIndices.insert(itNext,index);
854 RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(temp.m_run);
855 if(itRunFirstLastEntryFind->second.second == itFind->second) {
857 itRunFirstLastEntryFind->second.second = iter;
859 itFind->second = iter;
const DQMRootSource & operator=(const DQMRootSource &)
virtual boost::shared_ptr< edm::LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
TH2S * getTH2S(void) const
TH1S * getTH1S(void) const
edm::InputSource::ItemType m_nextItemType
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
virtual boost::shared_ptr< edm::RunPrincipal > readRun_(boost::shared_ptr< edm::RunPrincipal > rpCache)
bool m_doNotReadRemainingPartsOfFileSinceFrameworkTerminating
virtual boost::shared_ptr< edm::LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< edm::LuminosityBlockPrincipal > lbCache)
edm::JobReport::Token m_jrToken
virtual void closeFile_()
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
TProfile2D * getTProfile2D(void) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::RunAuxiliary m_runAux
std::vector< boost::shared_ptr< TreeReaderBase > > m_treeReaders
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.
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)
std::set< MonitorElement * > m_lumiElements
virtual boost::shared_ptr< edm::RunAuxiliary > readRunAuxiliary_()
TH3F * getTH3F(void) const
TH1D * getTH1D(void) const
std::list< unsigned int >::iterator m_presentIndexItr
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.
bool insertMapped(value_type const &v)
MonitorElement * bookFloat(const char *name)
Book float.
void tag(MonitorElement *me, unsigned int myTag)
virtual edm::InputSource::ItemType getNextItemType()
std::vector< RunLumiToRange > m_runlumiToRange
virtual void endLuminosityBlock(edm::LuminosityBlock &)
void addDefault(ParameterSetDescription const &psetDescription)
edm::LuminosityBlockAuxiliary m_lumiAux
std::vector< edm::ProcessHistoryID > m_historyIDs
void inputFileClosed(Token fileToken)
MonitorElement * bookString(const char *name, const char *value)
Book string.
bool m_justOpenedFileSoNeedToGenerateRunTransition
edm::InputFileCatalog m_catalog
std::list< unsigned int > m_orderedIndices
std::auto_ptr< TFile > m_file
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")
const std::string getFullname(void) const
get full name of ME including Pathname
void reportInputRunNumber(unsigned int run)
std::vector< TTree * > m_trees
int64_t getIntValue(void) const
std::string toString() const
TH1F * getTH1F(void) const
TProfile * getTProfile(void) const
void reportInputLumiSection(unsigned int run, unsigned int lumiSectId)
void setupFile(unsigned int iIndex)
std::list< unsigned int >::iterator m_nextIndexItr
void setProcessHistoryID(ProcessHistoryID const &phid)
static ThreadSafeRegistry * instance()
virtual edm::EventPrincipal * readEvent_()
DQMRootSource(edm::ParameterSet const &, const edm::InputSourceDescription &)
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.
ProcessHistoryID id() const
unsigned int m_lastSeenRun
virtual boost::shared_ptr< edm::FileBlock > readFile_()
virtual void endRun(edm::Run &)
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void setCurrentFolder(const std::string &fullpath)
LuminosityBlockID const & id() const
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
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")