88 std::vector<edm::EDGetTokenT<EcalRecHitCollection>>
toks_ecal_;
109 for (
unsigned i = 0;
i != nLabels;
i++)
113 produces<HBHERecHitCollection>(
"HBHERecHitCollectionFHN");
114 produces<HORecHitCollection>(
"HORecHitCollectionFHN");
115 produces<HFRecHitCollection>(
"HFRecHitCollectionFHN");
117 produces<EcalRecHitCollection>(
"EcalRecHitCollectionFHN");
118 produces<EcalRecHitCollection>(
"PSEcalRecHitCollectionFHN");
120 produces<FEDRawDataCollection>(
"HcalFEDsFHN");
125 bool acceptEvent =
false;
129 bool isAnomalous_BasedOnMET =
false;
130 bool isAnomalous_BasedOnEnergyFraction =
false;
138 isAnomalous_BasedOnMET =
true;
145 std::vector<CaloTower> TowerContainer;
146 std::vector<reco::CaloJet> JetContainer;
147 TowerContainer.clear();
148 JetContainer.clear();
151 for (reco::CaloJetCollection::const_iterator calojetIter = calojetHandle->begin();
152 calojetIter != calojetHandle->end();
154 if (((calojetIter->et()) * cosh(calojetIter->eta()) >
JetMinE_) &&
156 JetContainer.push_back(*calojetIter);
157 double maxTowerE = 0.0;
159 double dR =
deltaR((*calojetIter).eta(), (*calojetIter).phi(), (*kal).eta(), (*kal).phi());
160 if ((
dR < 0.50) && (kal->p() > maxTowerE)) {
161 maxTowerE = kal->p();
165 TowerContainer.push_back(seedTower);
168 if (!JetContainer.empty()) {
170 isAnomalous_BasedOnEnergyFraction =
true;
174 acceptEvent = ((
useMet_ && isAnomalous_BasedOnMET) || (
useJet_ && isAnomalous_BasedOnEnergyFraction));
180 auto miniHBHERecHitCollection = std::make_unique<HBHERecHitCollection>();
181 auto miniHORecHitCollection = std::make_unique<HORecHitCollection>();
182 auto miniHFRecHitCollection = std::make_unique<HFRecHitCollection>();
184 auto outputEColl = std::make_unique<EcalRecHitCollection>();
185 auto outputESColl = std::make_unique<EcalRecHitCollection>();
187 auto outputFEDs = std::make_unique<FEDRawDataCollection>();
199 auto tmpEcalRecHitCollection = std::make_unique<EcalRecHitCollection>();
201 std::vector<edm::EDGetTokenT<EcalRecHitCollection>>::const_iterator
i;
205 tmpEcalRecHitCollection->push_back(*
recHit);
214 miniHBHERecHitCollection->
push_back(*hbheItr);
218 miniHORecHitCollection->
push_back(*hoItr);
223 miniHFRecHitCollection->
push_back(*hfItr);
228 for (std::vector<EcalRecHit>::const_iterator ehit = tmpEcalRecHitCollection->begin();
229 ehit != tmpEcalRecHitCollection->end();
231 outputEColl->push_back(*ehit);
245 std::vector<int> selFEDs;
247 selFEDs.push_back(
i);
258 bool rightFED =
false;
259 for (uint32_t
k = 0;
k < selFEDs.size();
k++) {
260 if (
j == selFEDs[
k]) {
272 if (fedDataProd.
size() != 0) {
273 edm::LogWarning(
"HcalNoise") <<
" More than one FEDRawDataCollection with data in FED " <<
j 274 <<
" Skipping the 2nd\n";
278 unsigned char* dataProd = fedDataProd.
data();
279 const unsigned char*
data = fedData.
data();
280 for (
unsigned int k = 0;
k <
size; ++
k) {
289 iEvent.put(
std::move(miniHBHERecHitCollection),
"HBHERecHitCollectionFHN");
290 iEvent.put(
std::move(miniHORecHitCollection),
"HORecHitCollectionFHN");
291 iEvent.put(
std::move(miniHFRecHitCollection),
"HFRecHitCollectionFHN");
302 desc.add<
bool>(
"UseJet",
true);
303 desc.add<
bool>(
"UseMET",
false);
304 desc.add<
double>(
"MetCut", 0);
305 desc.add<
double>(
"JetMinE", 20);
306 desc.add<
double>(
"JetHCALminEnergyFraction", 0.98);
312 desc.add<std::vector<edm::InputTag>>(
"ecalInputs",
inputs);
315 descriptions.
add(
"alcaHcalNoiseProducer",
desc);
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
T getParameter(std::string const &) const
edm::EDGetTokenT< HORecHitCollection > tok_ho_
T const * product() const
std::vector< CaloTower >::const_iterator const_iterator
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
edm::EDGetTokenT< CaloTowerCollection > tok_tower_
void push_back(T const &t)
size_t size() const
Lenght of the data buffer in bytes.
edm::EDGetTokenT< EcalRecHitCollection > tok_ps_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
std::vector< edm::InputTag > ecalLabels_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void resize(size_t newsize)
double JetHCALminEnergyFraction_
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
const_iterator begin() const
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
const_iterator end() const
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
AlCaHcalNoiseProducer(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~AlCaHcalNoiseProducer() override=default
char data[epos_bytes_allocation]
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< reco::CaloMETCollection > tok_met_