18 using namespace dqmTnP;
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) {
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;
162 dqmStore->bookProfile(effName+
"Chi2",effChi2);
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;
173 dqmStore->bookProfile2D(effName,eff);
174 dqmStore->bookProfile2D(effName+
"Chi2",effChi2);
189 LogError(
"DQMGenericTnPClient") <<
" DQMGenericTnPClient::findAllSubdirectories ==> Missing folder " << dir <<
" !!!";
194 if (
pattern.Contains(nonPerlWildcard))
pattern.ReplaceAll(
"*",
".*");
197 vector <string> foundDirs =
dqmStore->getSubdirs();
198 for(vector<string>::const_iterator iDir = foundDirs.begin();
199 iDir != foundDirs.end(); ++iDir) {
200 TString
dirName = iDir->substr(iDir->rfind(
'/') + 1, iDir->length());
201 if (dirName.Contains(regexp))
211 LogInfo (
"DQMGenericClient") <<
"Trying to find sub-directories of " << dir
212 <<
" failed because " << dir <<
" does not exist";
T getUntrackedParameter(std::string const &, T const &) const
GaussianPlusLinearFitter * GPLfitter
#define DEFINE_FWK_MODULE(type)
std::vector< ParameterSet > VParameterSet
virtual void endRun(const edm::Run &run, const edm::EventSetup &setup) override
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()
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
TPRegexp nonPerlWildcard("\\w\\*|^\\*")
void calculateEfficiency(std::string dirName, const ParameterSet &pset)
volatile std::atomic< bool > shutdown_flag false
const VParameterSet efficiencies
virtual void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
std::vector< std::string > vstring
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void findAllSubdirectories(std::string dir, std::set< std::string > *myList, TString pattern)