45 size_t subStringPos = myString.find(mySubstring);
46 if(subStringPos != std::string::npos){
47 myString = myString.substr(subStringPos + mySubstring.length(), std::string::npos);
56 payload->
data.clear();
60 TVectorT<float> *etaBins; f->GetObject(
"etaBins", etaBins);
61 TVectorT<float> *ptBinsC; f->GetObject(
"ptBinsC", ptBinsC);
62 TVectorT<float> *ptBinsF; f->GetObject(
"ptBinsF", ptBinsF);
63 TVectorT<float> *rhoBins; f->GetObject(
"rhoBins", rhoBins);
66 TList *
keys = f->GetListOfKeys();
68 edm::LogError(
"NoKeys") <<
"There are no keys in the input file." << std::endl;
75 while((keydir = (TKey*)nextdir())){
76 if(!keydir->IsFolder())
continue;
77 TDirectory *
dir = (TDirectory*)keydir->ReadObj() ;
78 TIter nexthist(dir->GetListOfKeys());
80 while((keyhist = (TKey*)nexthist())){
82 int varIndex, qgIndex;
97 int etaBin = std::atoi(histname.substr(0, histname.find(
"_")).c_str());
99 int ptBin = std::atoi(histname.substr(0, histname.find(
"_")).c_str());
101 int rhoBin = std::atoi(histname.substr(0, histname.find(
"_")).c_str());
103 float etaMin = (*etaBins)[etaBin];
104 float etaMax = (*etaBins)[etaBin+1];
105 TVectorT<float> *ptBins = (etaBin == 0? ptBinsC : ptBinsF);
106 float ptMin = (*ptBins)[ptBin];
107 float ptMax = (*ptBins)[ptBin+1];
108 float rhoMin = (*rhoBins)[rhoBin];
109 float rhoMax = (*rhoBins)[rhoBin+1];
113 sprintf(buff,
"%50s : var=%1d, qg=%1d, etaMin=%6.2f, etaMax=%6.2f, ptMin=%8.2f, ptMax=%8.2f, rhoMin=%6.2f, rhoMax=%6.2f", keyhist->GetName(), varIndex, qgIndex, etaMin, etaMax,
ptMin, ptMax, rhoMin, rhoMax );
121 category.
PtMax = ptMax;
128 TH1* th1hist = (TH1*) keyhist->ReadObj();
131 QGLikelihoodObject::Histogram histogram(th1hist->GetNbinsX(), th1hist->GetXaxis()->GetBinLowEdge(1), th1hist->GetXaxis()->GetBinUpEdge(th1hist->GetNbinsX()));
132 for(
int ibin = 0; ibin <= th1hist->GetNbinsX() + 1; ++ibin){
140 entry.
mean = th1hist->GetMean();
141 payload->
data.push_back(entry);
155 edm::LogInfo(
"UserOutput") <<
"Opening PoolDBOutputService" << std::endl;
159 edm::LogInfo(
"UserOutput") <<
"Setting up payload with " << payload->
data.size() <<
" entries and tag " <<
payloadTag << std::endl;
T getParameter(std::string const &) const
QGLikelihoodCategory category
#define DEFINE_FWK_MODULE(type)
QGLikelihoodCategory qgValidRange
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
QGLikelihoodDBWriter(const edm::ParameterSet &)
QGLikelihoodObject containing valid range and entries with category, histogram and mean...
bool isNewTagRequest(const std::string &recordName)
std::string inputRootFile
cond::Time_t beginOfTime() const
bool extractString(std::string, std::string &)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Category structure: ranges associated with QGLikelihood histograms.
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
cond::Time_t endOfTime() const
std::vector< Entry > data
virtual void beginJob() override
virtual void endJob() override