43 for (
unsigned i = 0;
i != nLabels;
i++)
47 produces<HBHERecHitCollection>(
"HBHERecHitCollectionFHN");
48 produces<HORecHitCollection>(
"HORecHitCollectionFHN");
49 produces<HFRecHitCollection>(
"HFRecHitCollectionFHN");
51 produces<EcalRecHitCollection>(
"EcalRecHitCollectionFHN");
52 produces<EcalRecHitCollection>(
"PSEcalRecHitCollectionFHN");
54 produces<FEDRawDataCollection>(
"HcalFEDsFHN");
61 bool acceptEvent =
false;
65 bool isAnomalous_BasedOnMET =
false;
66 bool isAnomalous_BasedOnEnergyFraction =
false;
75 isAnomalous_BasedOnMET =
true;
85 std::vector<CaloTower> TowerContainer;
86 std::vector<reco::CaloJet> JetContainer;
87 TowerContainer.clear();
91 for (reco::CaloJetCollection::const_iterator calojetIter = calojetHandle->begin();
92 calojetIter != calojetHandle->end();
94 if (((calojetIter->et()) * cosh(calojetIter->eta()) >
JetMinE_) &&
96 JetContainer.push_back(*calojetIter);
97 double maxTowerE = 0.0;
99 double dR =
deltaR((*calojetIter).eta(), (*calojetIter).phi(), (*kal).eta(), (*kal).phi());
100 if ((dR < 0.50) && (kal->p() > maxTowerE)) {
101 maxTowerE = kal->p();
105 TowerContainer.push_back(seedTower);
108 if (!JetContainer.empty()) {
110 isAnomalous_BasedOnEnergyFraction =
true;
114 acceptEvent = ((
useMet_ && isAnomalous_BasedOnMET) || (
useJet_ && isAnomalous_BasedOnEnergyFraction));
120 auto miniHBHERecHitCollection = std::make_unique<HBHERecHitCollection>();
121 auto miniHORecHitCollection = std::make_unique<HORecHitCollection>();
122 auto miniHFRecHitCollection = std::make_unique<HFRecHitCollection>();
124 auto outputEColl = std::make_unique<EcalRecHitCollection>();
125 auto outputESColl = std::make_unique<EcalRecHitCollection>();
127 auto outputFEDs = std::make_unique<FEDRawDataCollection>();
144 auto tmpEcalRecHitCollection = std::make_unique<EcalRecHitCollection>();
146 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator
i;
151 tmpEcalRecHitCollection->push_back(*
recHit);
160 miniHBHERecHitCollection->
push_back(*hbheItr);
164 miniHORecHitCollection->
push_back(*hoItr);
169 miniHFRecHitCollection->
push_back(*hfItr);
174 for (std::vector<EcalRecHit>::const_iterator ehit = tmpEcalRecHitCollection->begin();
175 ehit != tmpEcalRecHitCollection->end();
177 outputEColl->push_back(*ehit);
192 std::vector<int> selFEDs;
194 selFEDs.push_back(i);
205 bool rightFED =
false;
206 for (uint32_t
k = 0;
k < selFEDs.size();
k++) {
207 if (
j == selFEDs[
k]) {
219 if (fedDataProd.
size() != 0) {
225 unsigned char* dataProd = fedDataProd.
data();
226 const unsigned char*
data = fedData.
data();
227 for (
unsigned int k = 0;
k <
size; ++
k) {
228 dataProd[
k] = data[
k];
236 iEvent.
put(
std::move(miniHBHERecHitCollection),
"HBHERecHitCollectionFHN");
237 iEvent.
put(
std::move(miniHORecHitCollection),
"HORecHitCollectionFHN");
238 iEvent.
put(
std::move(miniHFRecHitCollection),
"HFRecHitCollectionFHN");
239 iEvent.
put(
std::move(outputEColl),
"EcalRecHitCollectionFHN");
240 iEvent.
put(
std::move(outputESColl),
"PSEcalRecHitCollectionFHN");
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
T getParameter(std::string const &) const
edm::EDGetTokenT< HORecHitCollection > tok_ho_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) 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)
double pt() const final
transverse momentum
edm::EDGetTokenT< EcalRecHitCollection > tok_ps_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
size_t size() const
Lenght of the data buffer in bytes.
std::vector< edm::InputTag > ecalLabels_
~AlCaHcalNoiseProducer() override
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize)
double JetHCALminEnergyFraction_
void produce(edm::Event &, const edm::EventSetup &) override
const_iterator end() const
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
AlCaHcalNoiseProducer(const edm::ParameterSet &)
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.
edm::EDGetTokenT< reco::CaloMETCollection > tok_met_
const_iterator begin() const