From a0a362c917c56c5df545e080169548457e2bb6a0 Mon Sep 17 00:00:00 2001 From: Dmitrijus Bugelskis Date: Fri, 4 Apr 2014 15:58:53 +0200 Subject: [PATCH] Preparation for EcalUnpackerWorker removal, try #2. --- .../plugins/EcalRawToRecHitProducer.cc | 154 ------ .../plugins/EcalRawToRecHitProducer.h | 77 --- .../plugins/EcalRawToRecHitRoI.cc | 487 ------------------ .../plugins/EcalRawToRecHitRoI.h | 232 --------- .../EcalRawToDigi/plugins/SealModules.cc | 7 - .../python/EcalRawToRecHitFacility_cfi.py | 8 - .../python/EcalRawToRecHitProducer_cff.py | 26 - .../python/EcalRawToRecHitProducer_cfi.py | 15 - .../python/EcalRawToRecHitRoI_cff.py | 14 - .../python/EcalRawToRecHitRoI_cfi.py | 17 - .../python/ecalRegionalEgammaFEDs_cfi.py | 20 - .../python/ecalRegionalJetsFEDs_cfi.py | 26 - .../python/ecalRegionalMuonsFEDs_cfi.py | 14 - .../python/ecalRegionalRestFEDs_cfi.py | 8 - .../python/ecalRegionalTausFEDs_cfi.py | 14 - 15 files changed, 1119 deletions(-) delete mode 100644 EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.cc delete mode 100644 EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.h delete mode 100644 EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.cc delete mode 100644 EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.h delete mode 100644 EventFilter/EcalRawToDigi/python/EcalRawToRecHitFacility_cfi.py delete mode 100644 EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cff.py delete mode 100644 EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cfi.py delete mode 100644 EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cff.py delete mode 100644 EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cfi.py delete mode 100644 EventFilter/EcalRawToDigi/python/ecalRegionalEgammaFEDs_cfi.py delete mode 100644 EventFilter/EcalRawToDigi/python/ecalRegionalJetsFEDs_cfi.py delete mode 100644 EventFilter/EcalRawToDigi/python/ecalRegionalMuonsFEDs_cfi.py delete mode 100644 EventFilter/EcalRawToDigi/python/ecalRegionalRestFEDs_cfi.py delete mode 100644 EventFilter/EcalRawToDigi/python/ecalRegionalTausFEDs_cfi.py diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.cc b/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.cc deleted file mode 100644 index c144138fdc61c..0000000000000 --- a/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.cc +++ /dev/null @@ -1,154 +0,0 @@ -#include "EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.h" -#include "RecoLocalCalo/EcalRecAlgos/interface/EcalCleaningAlgo.h" - -EcalRawToRecHitProducer::EcalRawToRecHitProducer(const edm::ParameterSet& iConfig) -{ - lsourceTag_=iConfig.getParameter("lazyGetterTag"); - sourceTag_=iConfig.getParameter("sourceTag"); - - splitOutput_=iConfig.getParameter("splitOutput"); - if (splitOutput_){ - EBrechitCollection_=iConfig.getParameter("EBrechitCollection"); - EErechitCollection_=iConfig.getParameter("EErechitCollection"); - produces(EBrechitCollection_); - produces(EErechitCollection_); - LogDebug("EcalRawToRecHit|Producer")<<"ready to create rechits from lazy getter: "<("rechitCollection"); - produces(rechitCollection_); - LogDebug("EcalRawToRecHit|Producer")<<"ready to create rechits from lazy getter: "<("cleaningConfig"); - if (!cleaning.empty()) - cleaningAlgo_ = new EcalCleaningAlgo(cleaning); - } -} - - -EcalRawToRecHitProducer::~EcalRawToRecHitProducer() -{ - if (cleaningAlgo_) delete cleaningAlgo_; -} - - -// -// member functions -// - -// ------------ method called to produce the data ------------ -void -EcalRawToRecHitProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - -// MyWatcher watcher("Producer"); -// LogDebug("EcalRawToRecHit|Producer")< lgetter; - iEvent.getByLabel(lsourceTag_, lgetter); - LogDebug("EcalRawToRecHit|Producer")<<"lazy getter retreived from: "< rgetter; - iEvent.getByLabel(sourceTag_ ,rgetter); - LogDebug("EcalRawToRecHit|Producer")<<"ref getter retreived from: "< EBrechits( new EBRecHitCollection ); - std::auto_ptr EErechits( new EERecHitCollection ); - //loop the refgetter - unsigned int iR=0; - EcalRecHitRefGetter::const_iterator iRegion=rgetter->begin(); - EcalRecHitRefGetter::const_iterator iRegionEnd=rgetter->end(); - for (;iRegion!=iRegionEnd;++iRegion){ - LogDebug("EcalRawToRecHit|Producer")<<"looping over refgetter region: "<setEvent(iEvent); - std::vector::const_iterator iRecHit=lgetter->begin_record()+iRegion->start(); - std::vector::const_iterator iRecHitEnd =lgetter->begin_record()+iRegion->finish(); - for (;iRecHit!=iRecHitEnd;iRecHit++){ - DetId detid =iRecHit->id(); - //split barrel and endcap - int EcalNum=detid.subdetId(); //1 stands for Barrel, 2 for endcaps - LogDebug("EcalRawToRecHit|Producer")<<"subdetId is: "<push_back(*iRecHit); - else if (EcalNum==2) EErechits->push_back(*iRecHit); - else { - edm::LogError("IncorrectRecHit")<<" a subdetid is not recognized. recHit on :"<< iRecHit->id().rawId() - <<" is lost."; - }//subdetid - }//loop over things in region - LogDebug("EcalRawToRecHit|Producer")<<"looping over refgetter region: "<size()<<" EB recHits to be put with instance: "<size()<<" EE recHits to be put with instance: "<sort(); - EErechits->sort(); - cleaningAlgo_->setFlags(*EBrechits); - cleaningAlgo_->setFlags(*EErechits); - } - - iEvent.put(EBrechits, EBrechitCollection_); - iEvent.put(EErechits, EErechitCollection_); - LogDebug("EcalRawToRecHit|Producer")<<"collections uploaded."; -// << watcher.lap(); - } - else{ - //prepare the output collection - std::auto_ptr< EcalRecHitCollection > rechits( new EcalRecHitCollection); - //loop the refgetter - unsigned int iR=0; - EcalRecHitRefGetter::const_iterator iRegion=rgetter->begin(); - EcalRecHitRefGetter::const_iterator iRegionEnd=rgetter->end(); - for (;iRegion!=iRegionEnd;++iRegion){ - LogDebug("EcalRawToRecHit|Producer")<<"looping over refgetter region: "<setEvent(iEvent); - std::vector::const_iterator iRecHit=lgetter->begin_record()+iRegion->start(); - std::vector::const_iterator iRecHitEnd=lgetter->begin_record()+iRegion->finish(); - for (;iRecHit!=iRecHitEnd;iRecHit++){ - LogDebug("EcalRawToRecHit|Producer")<<"dereferencing rechit ref."; - DetId detid =iRecHit->id(); - int EcalNum=detid.subdetId(); //1 stands for Barrel, 2 for endcaps - LogDebug("EcalRawToRecHit|Producer")<<"subdetId is: "<push_back(*iRecHit); - }//loop over things in region - LogDebug("EcalRawToRecHit|Producer")<<"looping over refgetter region: "<sort(); - cleaningAlgo_->setFlags(*rechits); - } - LogDebug("EcalRawToRecHit|Producer")<size()<<" rechits to be put." ; -//<< watcher.lap(); - iEvent.put(rechits,rechitCollection_); - LogDebug("EcalRawToRecHit|Producer")<<"collections uploaded." ; -// << watcher.lap(); - } - -} - diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.h b/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.h deleted file mode 100644 index c3c3a927c82cc..0000000000000 --- a/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef EventFilter_EcalRawToDigi_EcalRawToRecHitProducer_H -#define EventFilter_EcalRawToDigi_EcalRawToRecHitProducer_H -// -*- C++ -*- -// -// Package: EcalRawToRecHitProducer -// Class: EcalRawToRecHitProducer -// -/**\class EcalRawToRecHitProducer EcalRawToRecHitProducer.cc EventFilter/EcalRawToRecHitProducer/src/EcalRawToRecHitProducer.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Jean-Roch Vlimant -// Created: Sat Oct 6 22:39:47 CEST 2007 -// -// - - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/LazyGetter.h" -#include "DataFormats/Common/interface/RefGetter.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -//#include "EventFilter/EcalRawToDigi/interface/EcalRegionCablingRecord.h" -//#include "EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h" - -#include "EventFilter/EcalRawToDigi/interface/MyWatcher.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitComparison.h" - -#include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "TStopwatch.h" - -class EcalCleaningAlgo; - -class EcalRawToRecHitProducer : public edm::EDProducer { - public: - - typedef edm::LazyGetter EcalRecHitLazyGetter; - typedef edm::RefGetter EcalRecHitRefGetter; - - explicit EcalRawToRecHitProducer(const edm::ParameterSet&); - ~EcalRawToRecHitProducer(); - -private: - virtual void produce(edm::Event&, const edm::EventSetup&); - - // ----------member data --------------------------- - edm::InputTag lsourceTag_; - edm::InputTag sourceTag_; - - bool splitOutput_; - std::string EBrechitCollection_; - std::string EErechitCollection_; - std::string rechitCollection_; - - EcalCleaningAlgo * cleaningAlgo_; -}; - -#endif diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.cc b/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.cc deleted file mode 100644 index 9a54deafacee6..0000000000000 --- a/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.cc +++ /dev/null @@ -1,487 +0,0 @@ - -//#include - -#include "EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.h" -#include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h" -#include "DataFormats/EcalRawData/interface/ESListOfFEDS.h" - -// Ecal Mapping -//#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" -#include - - -// Level 1 Trigger -#include "DataFormats/L1Trigger/interface/L1EmParticle.h" -#include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h" - -// EgammaCoreTools -//#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" -#include "RecoEcal/EgammaCoreTools/interface/EcalEtaPhiRegion.h" - -// Muon stuff -#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h" -#include "DataFormats/L1Trigger/interface/L1MuonParticle.h" -#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" - -// Jets stuff -#include "DataFormats/L1Trigger/interface/L1JetParticle.h" - -//candidate stuff -#include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h" -#include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h" - -#include "EventFilter/EcalRawToDigi/interface/EcalRegionCablingRecord.h" -#include "EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h" -//#include "EventFilter/EcalRawToDigi/interface/MyWatcher.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitComparison.h" - - -using namespace l1extra; - -EcalRawToRecHitRoI::CandJobPSet::CandJobPSet(edm::ParameterSet &cfg) : CalUnpackJobPSet(cfg) { - epsilon = cfg.getParameter("epsilon"); - bePrecise = cfg.getParameter("bePrecise"); - if (bePrecise){ propagatorNameToBePrecise = cfg.getParameter("propagatorNameToBePrecise");} - else propagatorNameToBePrecise=""; - std::string type = cfg.getParameter("cType"); - if (type == "view"){cType=view;} - else if (type == "candidate"){cType=candidate;} - else if (type == "chargedcandidate"){cType=chargedcandidate;} - else if (type == "l1muon"){cType=l1muon;} - else if (type == "l1jet"){cType=l1jet;} - else { - edm::LogWarning("IncorrectConfiguration")<<"\n\n could not interpret the cType: "< by default. expect your trigger path to be slow !\n\n"; - cType=view;} -} - - -EcalRawToRecHitRoI::EcalRawToRecHitRoI(const edm::ParameterSet& pset) : - EGamma_(false), Muon_(false), Jet_(false), Candidate_(false), All_(false){ - const std::string category = "EcalRawToRecHit|RoI"; - - sourceTag_=pset.getParameter("sourceTag"); - - std::string type = pset.getParameter("type"); - - if (type.find("candidate")!=std::string::npos){ - LogDebug(category)<<"configured for candidate-versatile input."; - Candidate_ = true; - std::vector emPSet = pset.getParameter >("CandJobPSet"); - for (std::vector::iterator iepset = emPSet.begin(); iepset!=emPSet.end();++iepset){ - CandSource_.push_back(CandJobPSet(*iepset)); - LogDebug(category)<dump(); - } - } - - if (type.find("muon")!=std::string::npos){ - LogDebug(category)<<"configured for L1MuonParticleCollection input."; - Muon_ = true; - edm::ParameterSet ps = pset.getParameter("MuJobPSet"); - MuonSource_ = MuJobPSet(ps); - LogDebug(category)< emPSet = pset.getParameter >("EmJobPSet"); - for (std::vector::iterator iepset = emPSet.begin(); iepset!=emPSet.end();++iepset){ - EmSource_.push_back(EmJobPSet(*iepset)); - LogDebug(category)<dump(); - } - } - - if (type.find("jet")!=std::string::npos){ - LogDebug(category)<<"configured for L1JetParticleCollection input."; - Jet_ =true; - std::vector jetPSet = pset.getParameter >("JetJobPSet"); - for (std::vector::iterator ijpset = jetPSet.begin(); ijpset!=jetPSet.end();++ijpset){ - JetSource_.push_back(JetJobPSet(*ijpset)); - LogDebug(category)<dump(); - } - } - - if (type.find("all")!=std::string::npos){ - LogDebug(category)<<"configured for ALL feds unpacking"; - All_ = true; - } - - if (!All_ && !Muon_ && !EGamma_ && !Jet_ && !Candidate_){ - edm::LogError("IncorrectConfiguration")<<"I have no specified type of work." - <<"\nI will produce empty list of FEDs." - <<"\nI will produce an empty EcalRecHitRefGetter." - <<"\n I am sure you don't want that."; - //throw. this is a typo/omittion in a cfg. - } - - produces(); - produces(); - - if (pset.exists("doES")) - do_es_ = pset.getParameter("doES"); - else - do_es_ = false; - - if (do_es_) { - LogDebug(category)<<"will also make the list of FEDs for the ES."; - sourceTag_es_=pset.getParameter("sourceTag_es"); - esinstance_=pset.getUntrackedParameter("esInstance","es"); - if (esinstance_=="") - edm::LogError("IncorrectConfiguration")<<" instance name for ES region and FED list cannot be empty. expect a fwk failure."; - produces(esinstance_); - produces(esinstance_); - } -} - - - -EcalRawToRecHitRoI::~EcalRawToRecHitRoI() { -} - - - -#include -std::string EcalRawToRecHitRoI::dumpFEDs(const std::vector & FEDs){ - std::stringstream ss; - ss<<"unpack FED: "; - for (unsigned int i=0; i < FEDs.size(); i++) { - ss<< FEDs[i] << ((i!= FEDs.size()-1)? ", ":"\n"); - } - ss<< "Number of FEDS is " << FEDs.size(); - return ss.str(); -} - -void EcalRawToRecHitRoI::produce(edm::Event & e, const edm::EventSetup& iSetup){ - const std::string category = "EcalRawToRecHit|RoI"; -// MyWatcher watcher("RoI"); -// LogDebug(category)< cabling; - iSetup.get().get(cabling); - LogDebug(category)<<"cabling retrieved."; -// <mapping(); - TheESMapping =cabling->es_mapping(); - - std::auto_ptr productAddress(new EcalListOfFEDS); - std::vector feds; // the list of FEDS produced by this module - - if (EGamma_) { Egamma(e, iSetup, feds); } - - if (Muon_) { Muon(e, iSetup, feds); } - - if (Jet_) { Jet(e, iSetup, feds); } - - if (Candidate_) { Cand(e, iSetup, feds); } - - if (All_) { for (int i=1; i <= 54; feds.push_back(i++)){} } - - unsigned int nf = feds.size(); - for (unsigned int i=0; i SetList(feds); - e.put(productAddress); - LogDebug(category)<< "list of ECAL fed put in the event." ; -// < lgetter; - e.getByLabel(sourceTag_, lgetter); - if (lgetter.failedToGet()) - { - edm::LogError("IncorrectConfiguration")<<" could not retrieve the lazy getter from: "< rgetter(new EcalRecHitRefGetter); - LogDebug(category)<<"ECal ref getter ready to be updated." ; -// <updateEcalRefGetterWithFedIndex(*rgetter, lgetter, feds[i]); - //cabling->updateEcalRefGetterWithElementIndex(*rgetter, lgetter, cabling->elementIndex(feds[i])); - } - - //put the refgetters in the event - LogDebug(category)<<"Ecal refGetter to be put in the event." ; -// << watcher.lap(); - e.put(rgetter); - LogDebug(category)<<"Ecal refGetter loaded." ; -// << watcher.lap(); - - //further process the ES if required - if (do_es_){ - LogDebug(category)<< "Will make the ES list of FEDs at the same time." ; -// < productAddressES(new ESListOfFEDS); - std::vector es_feds = TheESMapping->GetListofFEDs(feds); - - LogDebug(category)<< "Will unpack ES FED\n" <SetList(es_feds); - e.put(productAddressES,esinstance_); - - - LogDebug(category)<< "list of ES fed put in the event." ; -// < lgetter_es; - e.getByLabel(sourceTag_es_, lgetter_es); - if (lgetter_es.failedToGet()) - { - edm::LogError("IncorrectConfiguration")<<" could not retrieve the lazy getter from: "< rgetter_es(new EcalRecHitRefGetter); - LogDebug(category)<<"ES ref getter ready to be updated." ; -// <updateEcalRefGetterWithElementIndex(*rgetter_es, lgetter_es, cabling->esElementIndex(es_feds[i])); - } - - LogDebug(category)<<"ES refGetter to be put in the event." ; -// << watcher.lap(); - e.put(rgetter_es,esinstance_); - LogDebug(category)<<"ES refGetter loaded." ; -// << watcher.lap(); - } - -} - -void EcalRawToRecHitRoI::Cand(edm::Event& e, const edm::EventSetup& es , std::vector & FEDs) { - const std::string category ="EcalRawToRecHit|Cand"; - - unsigned int nc=CandSource_.size(); - for (unsigned int ic=0;ic!=nc;++ic){ - switch (CandSource_[ic].cType){ - case CandJobPSet::view : - OneCandCollection< edm::View >(e, es, CandSource_[ic], FEDs); - break; - - case CandJobPSet::candidate : - OneCandCollection(e, es, CandSource_[ic], FEDs); - break; - - case CandJobPSet::chargedcandidate : - OneCandCollection(e, es, CandSource_[ic], FEDs); - break; - - case CandJobPSet::l1muon : - OneCandCollection(e, es, CandSource_[ic], FEDs); - break; - - case CandJobPSet::l1jet : - OneCandCollection(e, es, CandSource_[ic], FEDs); - break; - - default: - edm::LogError("IncorrectRecHit")<<"cType not recognised: "< emColl, - const EmJobPSet &ejpset, - const edm::ESHandle & l1CaloGeom, - std::vector & FEDs){ - const std::string category = "EcalRawToRecHit|Egamma"; - for( l1extra::L1EmParticleCollection::const_iterator emItr = emColl->begin(); - emItr != emColl->end() ;++emItr ){ - float pt = emItr -> pt(); - if (pt < ejpset.Ptmin ) continue; - LogDebug(category)<<" Here is an L1 isoEM candidate of pt " << pt; - // Access the GCT hardware object corresponding to the L1Extra EM object. - int etaIndex = emItr->gctEmCand()->etaIndex() ; - int phiIndex = emItr->gctEmCand()->phiIndex() ; - // Use the L1CaloGeometry to find the eta, phi bin boundaries. - double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ; - double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ; - double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ; - double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ; - - ListOfFEDS(etaLow, etaHigh, phiLow, phiHigh, ejpset.regionEtaMargin, ejpset.regionPhiMargin,FEDs); - } -} - -void EcalRawToRecHitRoI::Egamma(edm::Event& e, const edm::EventSetup& es , std::vector & FEDs) { - const std::string category = "EcalRawToRecHit|Egamma"; - - LogDebug(category)<< " enter in EcalRawToRecHitRoI::Egamma"; - - // Get the CaloGeometry - edm::ESHandle l1CaloGeom ; - es.get().get(l1CaloGeom) ; - - edm::Handle< l1extra::L1EmParticleCollection > emColl; - unsigned int ne=EmSource_.size(); - for (unsigned int ie=0;ie!=ne;++ie){ - e.getByLabel(EmSource_[ie].Source,emColl); - if (!emColl.isValid()){edm::LogError("IncorrectConfiguration")<<"L1Em Collection: "<& FEDs) { - const std::string category = "EcalRawToRecHit|Muon"; - - LogDebug(category)<< " enter in EcalRawToRecHitRoI::Muon"; - - edm::Handle muColl; - e.getByLabel(MuonSource_.Source, muColl); - if (muColl.failedToGet()) - { - edm::LogError("IncorrectConfiguration")<<" could not retrieve the l1 muon collection from: "<begin(); it != muColl->end(); it++) { - - const L1MuGMTExtendedCand muonCand = (*it).gmtMuonCand(); - double pt = (*it).pt(); - double eta = (*it).eta(); - double phi = (*it).phi(); - - LogDebug(category)<<" here is a L1 muon Seed with (eta,phi) = " - < jetColl, - const JetJobPSet & jjpset, - std::vector & feds){ - const std::string category ="EcalRawToRecHit|Jet"; - for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) { - double pt = it -> pt(); - double eta = it -> eta(); - double phi = it -> phi(); - - LogDebug(category) << " here is a L1 CentralJet Seed with (eta,phi) = " - << eta << " " << phi << " and pt " << pt; - - if (pt < jjpset.Ptmin ) continue; - - ListOfFEDS(eta, eta, phi-jjpset.epsilon, phi+jjpset.epsilon, jjpset.regionEtaMargin, jjpset.regionPhiMargin,feds); - } -} - -void EcalRawToRecHitRoI::Jet(edm::Event& e, const edm::EventSetup& es, std::vector & FEDs) { - const std::string category = "EcalRawToRecHit|Jet"; - - edm::Handle jetColl; - unsigned int nj=JetSource_.size(); - for (unsigned int ij=0;ij!=nj;++ij){ - e.getByLabel(JetSource_[ij].Source,jetColl); - if (!jetColl.isValid()) { - edm::LogError("IncorrectConfiguration") << "L1Jet collection: " << JetSource_[ij].Source << " is not valid."; - continue; - } - - Jet_OneL1JetCollection(jetColl,JetSource_[ij],FEDs); - } - - unique(FEDs); - LogDebug(category)<<"unpack FED\n"< & FEDs) -{ - const std::string category = "EcalRawToRecHit|ListOfFEDS"; - - if (phimargin > Geom::pi()) phimargin = Geom::pi() ; - - - LogDebug(category)<< " etaLow etaHigh phiLow phiHigh " << etaLow << " " - < GetFED(etaHigh,phiMinus*180./Geom::pi()); - int fed_hi2 = TheMapping -> GetFED(etaHigh,phiPlus*180./Geom::pi()); - LogDebug(category) << "fed_hi1 fed_hi2 " << fed_hi1 << " " << fed_hi2; - if (fed_hi1 == fed_hi2) all = true; - } - - - if (all) { - LogDebug(category)<< " unpack everything in phi ! "; - phiMinus = -20 * Geom::pi() / 180.; // -20 deg - phiPlus = -40 * Geom::pi() / 180.; // -20 deg - } - - LogDebug(category) << " with margins : " << etaLow << " " << etaHigh << " " - << phiMinus << " " << phiPlus; - - - const EcalEtaPhiRegion ecalregion(etaLow,etaHigh,phiMinus,phiPlus); - - TheMapping -> GetListofFEDs(ecalregion, FEDs); - LogDebug(category)<<"unpack fed:\n"< - -#include -#include -#include -#include -#include -#include - -#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" -#include "Geometry/EcalMapping/interface/ESElectronicsMapper.h" - -#include "CondFormats/L1TObjects/interface/L1CaloGeometry.h" -#include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h" -#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/Common/interface/View.h" - -#include -#include -#include - -#include "DataFormats/Common/interface/LazyGetter.h" -#include "DataFormats/Common/interface/RefGetter.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" - -//additionnal stuff to be more precise with candidates -//#include "MagneticField/Engine/interface/MagneticField.h" -#include "TrackingTools/Records/interface/TrackingComponentsRecord.h" -#include "TrackingTools/GeomPropagators/interface/Propagator.h" -#include "TrackingTools/GeomPropagators/interface/StateOnTrackerBound.h" -#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" -#include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" -#include - -class EcalRawToRecHitRoI : public edm::EDProducer { - - typedef edm::LazyGetter EcalRecHitLazyGetter; - typedef edm::RefGetter EcalRecHitRefGetter; - -public: - - EcalRawToRecHitRoI(const edm::ParameterSet& pset); - virtual ~EcalRawToRecHitRoI(); - void produce(edm::Event & e, const edm::EventSetup& c); - - private: - - void Egamma(edm::Event& e, const edm::EventSetup& es, std::vector& FEDs); - void Muon(edm::Event& e, const edm::EventSetup& es, std::vector& FEDs); - void Jet(edm::Event& e, const edm::EventSetup& es, std::vector& FEDs); - void Cand(edm::Event& e, const edm::EventSetup& es, std::vector& FEDs); - - - /// input tag for the lazy getter - edm::InputTag sourceTag_; - bool do_es_; - edm::InputTag sourceTag_es_; - std::string esinstance_; - - /// tools - const EcalElectronicsMapping* TheMapping; - const ESElectronicsMapper *TheESMapping; - - /// generic class to drive the job - class CalUnpackJobPSet { - public: - CalUnpackJobPSet(){} - CalUnpackJobPSet(edm::ParameterSet &cfg){ - Source = cfg.getParameter("Source"); - Ptmin = cfg.getParameter("Ptmin"); - regionEtaMargin = cfg.getParameter("regionEtaMargin"); - regionPhiMargin = cfg.getParameter("regionPhiMargin"); - } - edm::InputTag Source; - double Ptmin; - double regionEtaMargin; - double regionPhiMargin; - }; - - ///Egamma part flag - bool EGamma_; - /// class to drive the job on L1Em - class EmJobPSet : public CalUnpackJobPSet { - public: - EmJobPSet(edm::ParameterSet &cfg) : CalUnpackJobPSet(cfg){} - ~EmJobPSet(){} - }; - /// process one collection of L1Em - void Egamma_OneL1EmCollection(const edm::Handle< l1extra::L1EmParticleCollection > emColl, - const EmJobPSet & ejpset, - const edm::ESHandle< L1CaloGeometry > & l1CaloGeom, - std::vector & FEDs); - /// what drive the job on L1Em collection - std::vector< EmJobPSet > EmSource_; - - ///Muon part flag - bool Muon_ ; - /// class to drive the job on L1Muon - class MuJobPSet : public CalUnpackJobPSet { - public: - MuJobPSet(){} - MuJobPSet(edm::ParameterSet &cfg) : CalUnpackJobPSet(cfg), epsilon(0.01) {} - ~MuJobPSet(){} - double epsilon; - }; - /// what drives the job from ONE L1Muon collection - MuJobPSet MuonSource_; - - ///jet part flag - bool Jet_ ; - /// class to drive the job on L1Jet - class JetJobPSet :public CalUnpackJobPSet { - public: - JetJobPSet(edm::ParameterSet &cfg) : CalUnpackJobPSet(cfg), epsilon(0.01) {} - ~JetJobPSet(){} - double epsilon; - }; - /// process on collection of L1Jets - void Jet_OneL1JetCollection(const edm::Handle< l1extra::L1JetParticleCollection > jetColl, - const JetJobPSet & jjpset, - std::vector & feds); - /// what drive the job on L1Jet collection - std::vector< JetJobPSet > JetSource_; - - ///Candidate-versatile objects part flag - bool Candidate_; - /// class to drive the job on Candidate-inheriting object - class CandJobPSet : public CalUnpackJobPSet { - public: - enum CTYPE { view, candidate, chargedcandidate, l1muon, l1jet }; - CandJobPSet(edm::ParameterSet &cfg); - ~CandJobPSet(){} - double epsilon; - bool bePrecise; - std::string propagatorNameToBePrecise; - CTYPE cType; - }; - /// process one collection of Candidate-versatile objects - template void OneCandCollection(const edm::Event& e, - const edm::EventSetup& es, - const CandJobPSet & cjpset, - std::vector & feds); - - /// what drives the job from candidate - std::vector< CandJobPSet > CandSource_; - - ///if all need to be done - bool All_; - - /// actually fill the vector with FED numbers - void ListOfFEDS(double etaLow, double etaHigh, double phiLow, - double phiHigh, double etamargin, double phimargin, - std::vector& FEDs); - - /// remove duplicates - void unique(std::vector& FEDs){ - std::sort(FEDs.begin(),FEDs.end()); - std::vector::iterator n_end = std::unique(FEDs.begin(),FEDs.end()); - FEDs.erase(n_end,FEDs.end());} - std::string dumpFEDs(const std::vector& FEDs); -}; - -template void EcalRawToRecHitRoI::OneCandCollection(const edm::Event& e, - const edm::EventSetup& es, - const CandJobPSet & cjpset, - std::vector & feds){ - const std::string category ="EcalRawToRecHit|Cand"; - - edm::Handle candColl; - e.getByLabel(cjpset.Source, candColl); - if (candColl.failedToGet()) { - edm::LogError("IncorrectConfiguration")<<"could not get: "<begin(); - typename CollectionType::const_iterator end= candColl->end(); - - StateOnTrackerBound * onBounds=0; - edm::ESHandle propH; - if (cjpset.bePrecise){ - // grab a propagator from ES - es.get().get(cjpset.propagatorNameToBePrecise, propH); - // make the extrapolator object - onBounds = new StateOnTrackerBound(propH.product()); - } - - for (; it!=end;++it){ - double pt = it->pt(); - double eta = it->eta(); - double phi = it->phi(); - if (cjpset.bePrecise){ - // starting FTS - GlobalPoint point(it->vx(),it->vy(),it->vz()); - GlobalVector vector(it->px(),it->py(),it->pz()); - - if (point.mag()==0 && vector.mag()==0){ - edm::LogWarning("IncorrectRecHit")<<" state of candidate is not valid. skipping."; - continue; - } - - FreeTrajectoryState fts(point, vector, it->charge(), propH->magneticField()); - // final TSOS - TrajectoryStateOnSurface out = (*onBounds)(fts); - if (out.isValid()){ - vector=out.globalMomentum(); - point=out.globalPosition(); - // be more precise - pt= vector.perp(); - eta= point.eta(); - phi= point.phi(); - } - else{edm::LogWarning("IncorrectRecHit")<<"I tried to be precise, but propagation failed. from:\n"< - -#include "EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.h" -DEFINE_FWK_MODULE(EcalRawToRecHitRoI); - -#include "EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitProducer.h" -DEFINE_FWK_MODULE(EcalRawToRecHitProducer); - #include "FWCore/Framework/interface/ModuleFactory.h" #include "EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.h" DEFINE_FWK_EVENTSETUP_MODULE(EcalRegionCablingESProducer); diff --git a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitFacility_cfi.py b/EventFilter/EcalRawToDigi/python/EcalRawToRecHitFacility_cfi.py deleted file mode 100644 index 65f23949a2e6f..0000000000000 --- a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitFacility_cfi.py +++ /dev/null @@ -1,8 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -EcalRawToRecHitFacility = cms.EDProducer("EcalRawToRecHitFacility", - sourceTag = cms.InputTag("rawDataCollector"), - workerName = cms.string('') -) - - diff --git a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cff.py b/EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cff.py deleted file mode 100644 index f1aef84839bc6..0000000000000 --- a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cff.py +++ /dev/null @@ -1,26 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -import copy -from EventFilter.EcalRawToDigi.EcalRawToRecHitProducer_cfi import * -ecalRegionalEgammaRecHit = copy.deepcopy(EcalRawToRecHitProducer) -import copy -from EventFilter.EcalRawToDigi.EcalRawToRecHitProducer_cfi import * -ecalRegionalMuonsRecHit = copy.deepcopy(EcalRawToRecHitProducer) -import copy -from EventFilter.EcalRawToDigi.EcalRawToRecHitProducer_cfi import * -ecalRegionalJetsRecHit = copy.deepcopy(EcalRawToRecHitProducer) -import copy -from EventFilter.EcalRawToDigi.EcalRawToRecHitProducer_cfi import * -# a second on to se if things are unpcaked twice. -#module ecalRegionalJetsRecHitBIS = EcalRawToRecHitProducer from "EventFilter/EcalRawToDigi/data/EcalRawToRecHitProducer.cfi" -#replace ecalRegionalJetsRecHitBIS.sourceTag=ecalRegionalJetsFEDs -ecalRegionalTausRecHit = copy.deepcopy(EcalRawToRecHitProducer) -import copy -from EventFilter.EcalRawToDigi.EcalRawToRecHitProducer_cfi import * -ecalRecHitAll = copy.deepcopy(EcalRawToRecHitProducer) -ecalRegionalEgammaRecHit.sourceTag = 'ecalRegionalEgammaFEDs' -ecalRegionalMuonsRecHit.sourceTag = 'ecalRegionalMuonsFEDs' -ecalRegionalJetsRecHit.sourceTag = 'ecalRegionalJetsFEDs' -ecalRegionalTausRecHit.sourceTag = 'ecalRegionalTausFEDs' -ecalRecHitAll.sourceTag = 'ecalRegionalRestFEDs' - diff --git a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cfi.py b/EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cfi.py deleted file mode 100644 index 795dc15388dff..0000000000000 --- a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitProducer_cfi.py +++ /dev/null @@ -1,15 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from RecoLocalCalo.EcalRecAlgos.ecalCleaningAlgo import cleaningAlgoConfig - -EcalRawToRecHitProducer = cms.EDProducer("EcalRawToRecHitProducer", - cleaningConfig=cleaningAlgoConfig, - lazyGetterTag = cms.InputTag("EcalRawToRecHitFacility"), - sourceTag = cms.InputTag("EcalRawToRecHitRoI"), - splitOutput = cms.bool(True), - EBrechitCollection = cms.string('EcalRecHitsEB'), - EErechitCollection = cms.string('EcalRecHitsEE'), - rechitCollection = cms.string('') -) - - diff --git a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cff.py b/EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cff.py deleted file mode 100644 index bd3acc8cf2b52..0000000000000 --- a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cff.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# geometry tools -from L1TriggerConfig.L1GeometryProducers.l1CaloGeometry_cfi import * -from L1TriggerConfig.L1GeometryProducers.l1CaloGeomRecordSource_cff import * -#cabling tools -from EventFilter.EcalRawToDigi.EcalRegionCablingESProducer_cff import * -#region of interest FEDS + RefGetter -from EventFilter.EcalRawToDigi.ecalRegionalEgammaFEDs_cfi import * -from EventFilter.EcalRawToDigi.ecalRegionalMuonsFEDs_cfi import * -from EventFilter.EcalRawToDigi.ecalRegionalJetsFEDs_cfi import * -from EventFilter.EcalRawToDigi.ecalRegionalTausFEDs_cfi import * -from EventFilter.EcalRawToDigi.ecalRegionalRestFEDs_cfi import * - diff --git a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cfi.py b/EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cfi.py deleted file mode 100644 index 8fa18619e427a..0000000000000 --- a/EventFilter/EcalRawToDigi/python/EcalRawToRecHitRoI_cfi.py +++ /dev/null @@ -1,17 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -EcalRawToRecHitRoI = cms.EDProducer("EcalRawToRecHitRoI", - JetJobPSet = cms.VPSet(), - CandJobPSet = cms.VPSet(), - sourceTag = cms.InputTag("EcalRawToRecHitFacility"), - EmJobPSet = cms.VPSet(), - type = cms.string('muon egamma jet candidate all'), - MuonJobPSet = cms.PSet( - - ), - doES = cms.bool(False), - sourceTag_es = cms.InputTag(''), - esInstance = cms.untracked.string('es') -) - - diff --git a/EventFilter/EcalRawToDigi/python/ecalRegionalEgammaFEDs_cfi.py b/EventFilter/EcalRawToDigi/python/ecalRegionalEgammaFEDs_cfi.py deleted file mode 100644 index 95b5339c0dc0f..0000000000000 --- a/EventFilter/EcalRawToDigi/python/ecalRegionalEgammaFEDs_cfi.py +++ /dev/null @@ -1,20 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -ecalRegionalEgammaFEDs = cms.EDProducer("EcalRawToRecHitRoI", - sourceTag = cms.InputTag("EcalRawToRecHitFacility"), - EmJobPSet = cms.VPSet(cms.PSet( - Source = cms.InputTag("l1extraParticles","Isolated"), - regionPhiMargin = cms.double(0.4), - Ptmin = cms.double(5.0), - regionEtaMargin = cms.double(0.25) - ), - cms.PSet( - Source = cms.InputTag("l1extraParticles","NonIsolated"), - regionPhiMargin = cms.double(0.4), - Ptmin = cms.double(5.0), - regionEtaMargin = cms.double(0.25) - )), - type = cms.string('egamma') -) - - diff --git a/EventFilter/EcalRawToDigi/python/ecalRegionalJetsFEDs_cfi.py b/EventFilter/EcalRawToDigi/python/ecalRegionalJetsFEDs_cfi.py deleted file mode 100644 index 41e7b2d2a971f..0000000000000 --- a/EventFilter/EcalRawToDigi/python/ecalRegionalJetsFEDs_cfi.py +++ /dev/null @@ -1,26 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -ecalRegionalJetsFEDs = cms.EDProducer("EcalRawToRecHitRoI", - sourceTag = cms.InputTag("EcalRawToRecHitFacility"), - JetJobPSet = cms.VPSet(cms.PSet( - Source = cms.InputTag("l1extraParticles","Central"), - regionPhiMargin = cms.double(1.0), - Ptmin = cms.double(50.0), - regionEtaMargin = cms.double(1.0) - ), - cms.PSet( - Source = cms.InputTag("l1extraParticles","Forward"), - regionPhiMargin = cms.double(1.0), - Ptmin = cms.double(50.0), - regionEtaMargin = cms.double(1.0) - ), - cms.PSet( - Source = cms.InputTag("l1extraParticles","Tau"), - regionPhiMargin = cms.double(1.0), - Ptmin = cms.double(50.0), - regionEtaMargin = cms.double(1.0) - )), - type = cms.string('jet') -) - - diff --git a/EventFilter/EcalRawToDigi/python/ecalRegionalMuonsFEDs_cfi.py b/EventFilter/EcalRawToDigi/python/ecalRegionalMuonsFEDs_cfi.py deleted file mode 100644 index e70fb239f504c..0000000000000 --- a/EventFilter/EcalRawToDigi/python/ecalRegionalMuonsFEDs_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -ecalRegionalMuonsFEDs = cms.EDProducer("EcalRawToRecHitRoI", - sourceTag = cms.InputTag("EcalRawToRecHitFacility"), - MuJobPSet = cms.PSet( - Source = cms.InputTag("l1extraParticles"), - regionPhiMargin = cms.double(1.0), - Ptmin = cms.double(0.0), - regionEtaMargin = cms.double(1.0) - ), - type = cms.string('muon') -) - - diff --git a/EventFilter/EcalRawToDigi/python/ecalRegionalRestFEDs_cfi.py b/EventFilter/EcalRawToDigi/python/ecalRegionalRestFEDs_cfi.py deleted file mode 100644 index b8b0d4223b431..0000000000000 --- a/EventFilter/EcalRawToDigi/python/ecalRegionalRestFEDs_cfi.py +++ /dev/null @@ -1,8 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -ecalRegionalRestFEDs = cms.EDProducer("EcalRawToRecHitRoI", - sourceTag = cms.InputTag("EcalRawToRecHitFacility"), - type = cms.string('all') -) - - diff --git a/EventFilter/EcalRawToDigi/python/ecalRegionalTausFEDs_cfi.py b/EventFilter/EcalRawToDigi/python/ecalRegionalTausFEDs_cfi.py deleted file mode 100644 index ea97b8c4e84e5..0000000000000 --- a/EventFilter/EcalRawToDigi/python/ecalRegionalTausFEDs_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -ecalRegionalTausFEDs = cms.EDProducer("EcalRawToRecHitRoI", - sourceTag = cms.InputTag("EcalRawToRecHitFacility"), - JetJobPSet = cms.VPSet(cms.PSet( - Source = cms.InputTag("l1extraParticles","Tau"), - regionPhiMargin = cms.double(1.0), - Ptmin = cms.double(20.0), - regionEtaMargin = cms.double(1.0) - )), - type = cms.string('jet') -) - -