24 avgOcc_ =
_params.getUntrackedParameter<std::vector<double>>(
"avgOcc");
39 MESet& meMLQualitySummary(
MEs_.
at(
"MLQualitySummary"));
40 MESet& meEventsperMLImage(
MEs_.
at(
"EventsperMLImage"));
47 double pu = sPU.getFloatValue();
71 TH2F* hEbDigiMap((
sources_.
at(
"DigiAllByLumi")).getME(1)->getTH2F());
74 std::vector<float> ebOccMap1dCumulPad;
75 std::valarray<float> ebOccMap1d(
nTowers);
78 for (
int i = 0;
i < hEbDigiMap->GetNbinsY();
i++) {
79 for (
int j = 0;
j < hEbDigiMap->GetNbinsX();
j++) {
80 int bin = hEbDigiMap->GetBin(
j + 1,
i + 1);
82 ebOccMap1d[
k] = hEbDigiMap->GetBinContent(
bin);
99 for (
size_t i = 0;
i <
nLS;
i++) {
109 std::valarray<float> ebOccMap1dCumul(0.,
nTowers);
122 ebOccMap1dCumul = ebOccMap1dCumul * (500. / TNum);
125 ebOccMap1dCumulPad.assign(std::begin(ebOccMap1dCumul), std::end(ebOccMap1dCumul));
130 ebOccMap1dCumulPad.insert(ebOccMap1dCumulPad.begin(),
134 int size = ebOccMap1dCumulPad.size();
136 float val = ebOccMap1dCumulPad[
k];
137 ebOccMap1dCumulPad.push_back(
val);
160 Ort::SessionOptions sessionOptions;
161 sessionOptions.SetIntraOpNumThreads(1);
162 Ort::Env
env(OrtLoggingLevel::ORT_LOGGING_LEVEL_WARNING, instanceName.c_str());
163 Ort::Session session(
env, modelFilepath.c_str(), sessionOptions);
165 Ort::AllocatorWithDefaultOptions
allocator;
167 const char* inputName = session.GetInputName(0,
allocator);
169 Ort::TypeInfo inputTypeInfo = session.GetInputTypeInfo(0);
170 auto inputTensorInfo = inputTypeInfo.GetTensorTypeAndShapeInfo();
172 std::vector<int64_t> inputDims = inputTensorInfo.GetShape();
176 Ort::TypeInfo outputTypeInfo = session.GetOutputTypeInfo(0);
177 auto outputTensorInfo = outputTypeInfo.GetTensorTypeAndShapeInfo();
179 std::vector<int64_t> outputDims = outputTensorInfo.GetShape();
182 std::vector<float> ebRecoOccMap1dPad(TensorSize);
184 std::vector<const char*> inputNames{inputName};
186 std::vector<Ort::Value> inputTensors;
187 std::vector<Ort::Value> outputTensors;
189 Ort::MemoryInfo memoryInfo =
190 Ort::MemoryInfo::CreateCpu(OrtAllocatorType::OrtArenaAllocator, OrtMemType::OrtMemTypeDefault);
191 inputTensors.push_back(Ort::Value::CreateTensor<float>(
192 memoryInfo, ebOccMap1dCumulPad.data(), TensorSize, inputDims.data(), inputDims.size()));
194 outputTensors.push_back(Ort::Value::CreateTensor<float>(
195 memoryInfo, ebRecoOccMap1dPad.data(), TensorSize, outputDims.data(), outputDims.size()));
197 session.Run(Ort::RunOptions{
nullptr},
202 outputTensors.data(),
212 std::valarray<float> recoOcc1d(0.,
nPhiTowers);
213 std::valarray<float> inputOcc1d(0.,
nPhiTowers);
214 std::valarray<float> avgOcc1d(0.,
nPhiTowers);
215 std::valarray<float> loss_;
220 for (
int i = 1;
i < 35;
i++) {
223 recoOcc1d[
j] = ebRecoOccMap1dPad[
k];
224 inputOcc1d[
j] = ebOccMap1dCumulPad[
k];
228 loss_ =
std::pow((recoOcc1d / avgOcc1d - inputOcc1d / avgOcc1d), 2);
229 lossMap2d[
i - 1] = (loss_);
240 std::valarray<std::valarray<float>> lossMap2dMult(std::valarray<float>(1.,
nPhiTowers),
nEtaTowers);
250 TH2F* hLossMap2dMult(sAELoss.getME(1)->getTH2F());
251 for (
int i = 0;
i < hLossMap2dMult->GetNbinsY();
i++) {
252 for (
int j = 0;
j < hLossMap2dMult->GetNbinsX();
j++) {
253 int bin_ = hLossMap2dMult->GetBin(
j + 1,
i + 1);
255 hLossMap2dMult->SetBinContent(bin_,
content);
269 float entries(dItr->getBinContent());
static const int nEtaTowersPad
void setParams(edm::ParameterSet const &) override
#define DEFINE_ECALDQM_WORKER(TYPE)
edm::LuminosityBlockNumber_t iLumi
static const int PHYSICS_BAD_CHANNEL_WARNING
std::string fullPath() const
MESet & at(const std::string &key)
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
static const int PHYSICS_BAD_CHANNEL_ERROR
void producePlots(ProcessType) override
double getFloatValue() const
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
std::deque< std::valarray< std::valarray< float > > > lossMap2dQ
static const int nEtaTowers
EcalElectronicsMapping const * GetElectronicsMap()
EcalDQMSetupObjects const getEcalDQMSetupObjects()
std::deque< int > NEventQ
const_iterator & toNextChannel(EcalElectronicsMapping const *)
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
static const int nPhiTowers
void erase(const std::string &key)
std::deque< std::valarray< float > > ebOccMap1dQ
Power< A, B >::type pow(const A &a, const B &b)
std::vector< double > avgOcc_