18 using namespace dqmTnP;
31 void findAllSubdirectories (std::string
dir, std::set<std::string> * myList, TString
pattern);
44 subDirs( pset.getUntrackedParameter<
vstring>(
"subDirs",
vstring()) ),
45 myDQMrootFolder( pset.getUntrackedParameter<std::string>(
"MyDQMrootFolder",
"") ),
46 verbose( pset.getUntrackedParameter<bool>(
"Verbose",
false) ),
47 efficiencies( pset.getUntrackedParameter<
VParameterSet>(
"Efficiencies") )
50 plots = savePlotsInRootFileName!=
"" ?
new TFile(savePlotsInRootFileName,
"recreate") : 0;
57 TPRegexp
metacharacters(
"[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]");
61 LogError(
"DQMGenericTnPClient")<<
"Could not find DQMStore service\n";
66 set<std::string> subDirSet;
71 for(vstring::const_iterator iSubDir =
subDirs.begin();
72 iSubDir !=
subDirs.end(); ++iSubDir) {
73 std::string subDir = *iSubDir;
74 if ( subDir[subDir.size()-1] ==
'/' ) subDir.erase(subDir.size()-1);
75 if ( TString(subDir).Contains(metacharacters) ) {
77 const string searchPath = subDir.substr(0, shiftPos);
78 const string pattern = subDir.substr(shiftPos + 1, subDir.length());
82 subDirSet.insert(subDir);
87 for(set<string>::const_iterator iSubDir = subDirSet.begin();
88 iSubDir != subDirSet.end(); ++iSubDir) {
89 const string&
dirName = *iSubDir;
90 for(VParameterSet::const_iterator pset =
efficiencies.begin();
104 if(allME==0 || passME==0){
105 LogDebug(
"DQMGenericTnPClient")<<
"Could not find MEs: "<<allMEname<<
" or "<<passMEname<<endl;
108 TH1 *
all = allME->getTH1();
109 TH1 *pass = passME->
getTH1();
113 if(fitFunction==
"GaussianPlusLinear"){
121 }
else if(fitFunction==
"VoigtianPlusExponential"){
131 LogError(
"DQMGenericTnPClient")<<
"Fit function: "<<fitFunction<<
" does not exist"<<endl;
135 int dimensions = all->GetDimension();
137 if(massDimension>dimensions){
138 LogError(
"DQMGenericTnPClient")<<
"Monitoring Element "<<allMEname<<
" has smaller dimension than "<<massDimension<<endl;
145 if ( string::npos != slashPos ) {
146 effDir +=
"/"+effName.substr(0, slashPos);
147 effName.erase(0, slashPos+1);
150 TString
prefix(effDir.c_str());
151 prefix.ReplaceAll(
'/',
'_');
155 TProfile* effChi2 = 0;
156 TString
error = fitter->calculateEfficiency((TH2*)pass, (TH2*)all, massDimension, eff, effChi2,
plots?
prefix+effName.c_str():
"");
158 LogError(
"DQMGenericTnPClient")<<error<<endl;
165 }
else if(dimensions==3){
167 TProfile2D* effChi2 = 0;
168 TString
error = fitter->calculateEfficiency((TH3*)pass, (TH3*)all, massDimension, eff, effChi2,
plots?
prefix+effName.c_str():
"");
170 LogError(
"DQMGenericTnPClient")<<error<<endl;
190 LogError(
"DQMGenericTnPClient") <<
" DQMGenericTnPClient::findAllSubdirectories ==> Missing folder " << dir <<
" !!!";
195 if (
pattern.Contains(nonPerlWildcard))
pattern.ReplaceAll(
"*",
".*");
199 for(vector<string>::const_iterator iDir = foundDirs.begin();
200 iDir != foundDirs.end(); ++iDir) {
201 TString
dirName = iDir->substr(iDir->rfind(
'/') + 1, iDir->length());
202 if (dirName.Contains(regexp))
212 LogInfo (
"DQMGenericClient") <<
"Trying to find sub-directories of " << dir
213 <<
" failed because " << dir <<
" does not exist";
T getUntrackedParameter(std::string const &, T const &) const
GaussianPlusLinearFitter * GPLfitter
std::vector< std::string > getSubdirs(void) const
std::vector< std::string > vstring
void cd(void)
go to top directory (ie. root)
#define DEFINE_FWK_MODULE(type)
std::vector< ParameterSet > VParameterSet
TPRegexp metacharacters("[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]")
void setup(double expectedMean_, double massLow, double massHigh, double expectedSigma_)
void setup(double expectedMean_, double massLow, double massHigh, double expectedSigma_, double width_)
DQMGenericTnPClient(const edm::ParameterSet &pset)
VoigtianPlusExponentialFitter * VPEfitter
tuple DQMGenericTnPClient
virtual ~DQMGenericTnPClient()
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
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 but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::string myDQMrootFolder
virtual void endRun(const edm::Run &run, const edm::EventSetup &setup)
bool dirExists(const std::string &path) const
true if directory exists
virtual void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
TPRegexp nonPerlWildcard("\\w\\*|^\\*")
std::vector< std::string > vstring
void calculateEfficiency(std::string dirName, const ParameterSet &pset)
const VParameterSet efficiencies
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setCurrentFolder(const std::string &fullpath)
void findAllSubdirectories(std::string dir, std::set< std::string > *myList, TString pattern)
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")