71 applyCorr_(iConfig.getParameter<
edm::
ParameterSet>(
"RawPCCProducerParameters")
72 .getUntrackedParameter<
bool>(
"ApplyCorrections",
false)),
73 takeAverageValue_(iConfig.getParameter<
edm::
ParameterSet>(
"RawPCCProducerParameters")
77 .getUntrackedParameter<
std::
string>(
"outputProductName",
"alcaLumi"))),
78 saveCSVFile_(iConfig.getParameter<
edm::
ParameterSet>(
"RawPCCProducerParameters")
79 .getUntrackedParameter<
bool>(
"saveCSVFile",
false)),
80 csvOutLabel_(iConfig.getParameter<
edm::
ParameterSet>(
"RawPCCProducerParameters")
93 float totalLumi = 0.0;
95 float statErrOnLumi = 0.0;
112 auto clustersPerBXInput = inputPcc.
readCounts();
117 std::vector<int> goodMods;
118 for (
unsigned int i = 0;
i < modID.size();
i++) {
120 goodMods.push_back(
i);
124 for (
unsigned int i = 0;
i < goodMods.size();
i++) {
132 std::vector<float> correctionScaleFactors;
135 correctionScaleFactors = pccCorrections->getCorrectionsBX();
140 for (
unsigned int i = 0;
i < clustersPerBXOutput.size();
i++) {
142 corrClustersPerBXOutput[
i] = clustersPerBXOutput[
i] * correctionScaleFactors[
i];
144 corrClustersPerBXOutput[
i] = 0.0;
146 totalLumi += corrClustersPerBXOutput[
i];
150 std::vector<float> errorPerBX;
157 unsigned int NActiveBX = 0;
165 if (statErrOnLumi != 0) {
166 totalLumi = totalLumi / statErrOnLumi *
float(NActiveBX);
167 statErrOnLumi = 1 /
sqrt(statErrOnLumi) * totalLumi;
const edm::ESGetToken< LumiCorrections, LumiCorrectionsRcd > lumiCorrectionsToken_
std::vector< int > const & readModID() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const std::string csvOutLabel_
T const * product() const
static const unsigned int numBX
std::string to_string(const V &value)
void setInstLumiAllBX(std::vector< float > &instLumiByBX)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const std::string takeAverageValue_
std::vector< int > const & readEvents() const
void setTotalInstLumi(float totalLumi)
#define DEFINE_FWK_MODULE(type)
std::vector< int > const & readCounts() const
const edm::EDPutTokenT< LumiInfo > putToken_
void globalEndLuminosityBlockProduce(edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup) const final
void emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
~RawPCCProducer() override
void setTotalInstStatError(float statError)
const std::vector< int > modVeto_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
void setErrorLumiAllBX(std::vector< float > &errLumiByBX)
RawPCCProducer(const edm::ParameterSet &)
LuminosityBlockNumber_t luminosityBlock() const
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const final
edm::EDGetTokenT< reco::PixelClusterCounts > pccToken_