39 using namespace l1extra;
53 edm::LogWarning(
"IncorrectConfiguration")<<
"\n\n could not interpret the cType: "<<type
54 <<
"\n using edm::View< reco::Candidate > by default. expect your trigger path to be slow !\n\n";
67 if (type.find(
"candidate")!=std::string::npos){
68 LogDebug(category)<<
"configured for candidate-versatile input.";
70 std::vector<edm::ParameterSet> emPSet = pset.
getParameter<std::vector<edm::ParameterSet> >(
"CandJobPSet");
71 for (std::vector<edm::ParameterSet>::iterator iepset = emPSet.begin(); iepset!=emPSet.end();++iepset){
77 if (type.find(
"muon")!=std::string::npos){
78 LogDebug(category)<<
"configured for L1MuonParticleCollection input.";
85 if (type.find(
"egamma")!=std::string::npos){
86 LogDebug(category)<<
"configured for L1EMParticleCollection input.";
88 std::vector<edm::ParameterSet> emPSet = pset.
getParameter<std::vector<edm::ParameterSet> >(
"EmJobPSet");
89 for (std::vector<edm::ParameterSet>::iterator iepset = emPSet.begin(); iepset!=emPSet.end();++iepset){
95 if (type.find(
"jet")!=std::string::npos){
96 LogDebug(category)<<
"configured for L1JetParticleCollection input.";
98 std::vector<edm::ParameterSet> jetPSet = pset.
getParameter<std::vector<edm::ParameterSet> >(
"JetJobPSet");
99 for (std::vector<edm::ParameterSet>::iterator ijpset = jetPSet.begin(); ijpset!=jetPSet.end();++ijpset){
105 if (type.find(
"all")!=std::string::npos){
106 LogDebug(category)<<
"configured for ALL feds unpacking";
111 edm::LogError(
"IncorrectConfiguration")<<
"I have no specified type of work."
112 <<
"\nI will produce empty list of FEDs."
113 <<
"\nI will produce an empty EcalRecHitRefGetter."
114 <<
"\n I am sure you don't want that.";
118 produces<EcalListOfFEDS>();
119 produces<EcalRecHitRefGetter>();
127 LogDebug(category)<<
"will also make the list of FEDs for the ES.";
131 edm::LogError(
"IncorrectConfiguration")<<
" instance name for ES region and FED list cannot be empty. expect a fwk failure.";
146 std::stringstream ss;
148 for (
unsigned int i=0;
i < FEDs.size();
i++) {
149 ss<< FEDs[
i] << ((
i!= FEDs.size()-1)?
", ":
"\n");
151 ss<<
"Number of FEDS is " << FEDs.size();
163 LogDebug(category)<<
"cabling retrieved.";
169 std::vector<int> feds;
175 if (
Jet_) {
Jet(e, iSetup, feds); }
179 if (
All_) {
for (
int i=1;
i <= 54; feds.push_back(
i++)){} }
181 unsigned int nf = feds.size();
189 productAddress->SetList(feds);
190 e.
put(productAddress);
191 LogDebug(category)<<
"list of ECAL fed put in the event." ;
213 LogDebug(category)<<
"ECal ref getter ready to be updated." ;
216 for (
unsigned int i=0;
i!=nf;
i++){
217 cabling->updateEcalRefGetterWithFedIndex(*rgetter, lgetter, feds[
i]);
222 LogDebug(category)<<
"Ecal refGetter to be put in the event." ;
225 LogDebug(category)<<
"Ecal refGetter loaded." ;
230 LogDebug(category)<<
"Will make the ES list of FEDs at the same time." ;
232 std::auto_ptr<ESListOfFEDS> productAddressES(
new ESListOfFEDS);
239 productAddressES->SetList(es_feds);
243 LogDebug(category)<<
"list of ES fed put in the event." ;
258 LogDebug(category)<<
"ES ref getter ready to be updated." ;
261 unsigned int nf_es=es_feds.size();
262 for (
unsigned int i=0;
i!=nf_es;
i++){
263 cabling->updateEcalRefGetterWithElementIndex(*rgetter_es, lgetter_es, cabling->esElementIndex(es_feds[
i]));
266 LogDebug(category)<<
"ES refGetter to be put in the event." ;
269 LogDebug(category)<<
"ES refGetter loaded." ;
279 for (
unsigned int ic=0;ic!=nc;++ic){
282 OneCandCollection< edm::View<reco::Candidate> >(
e, es,
CandSource_[ic],
FEDs);
286 OneCandCollection<reco::CandidateCollection>(
e, es, CandSource_[ic],
FEDs);
290 OneCandCollection<reco::RecoChargedCandidateCollection>(
e, es, CandSource_[ic],
FEDs);
294 OneCandCollection<L1MuonParticleCollection>(
e, es, CandSource_[ic],
FEDs);
298 OneCandCollection<L1JetParticleCollection>(
e, es, CandSource_[ic],
FEDs);
302 edm::LogError(
"IncorrectRecHit")<<
"cType not recognised: "<<CandSource_[ic].cType;
313 std::vector<int> &
FEDs){
315 for( l1extra::L1EmParticleCollection::const_iterator emItr = emColl->begin();
316 emItr != emColl->end() ;++emItr ){
317 float pt = emItr ->
pt();
318 if (pt < ejpset.
Ptmin )
continue;
319 LogDebug(category)<<
" Here is an L1 isoEM candidate of pt " <<
pt;
321 int etaIndex = emItr->gctEmCand()->etaIndex() ;
322 int phiIndex = emItr->gctEmCand()->phiIndex() ;
324 double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
325 double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
326 double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
327 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
336 LogDebug(category)<<
" enter in EcalRawToRecHitRoI::Egamma";
344 for (
unsigned int ie=0;ie!=
ne;++ie){
360 LogDebug(category)<<
" enter in EcalRawToRecHitRoI::Muon";
370 for (L1MuonParticleCollection::const_iterator it=muColl->begin(); it != muColl->end(); it++) {
373 double pt = (*it).pt();
374 double eta = (*it).eta();
375 double phi = (*it).phi();
377 LogDebug(category)<<
" here is a L1 muon Seed with (eta,phi) = "
378 <<eta <<
" " << phi <<
" and pt " <<
pt;
392 std::vector<int> & feds){
394 for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) {
395 double pt = it ->
pt();
399 LogDebug(category) <<
" here is a L1 CentralJet Seed with (eta,phi) = "
400 << eta <<
" " << phi <<
" and pt " <<
pt;
402 if (pt < jjpset.
Ptmin )
continue;
413 for (
unsigned int ij=0;ij!=nj;++ij){
431 double phiHigh,
double etamargin,
double phimargin,
432 std::vector<int> &
FEDs)
439 LogDebug(category)<<
" etaLow etaHigh phiLow phiHigh " << etaLow <<
" "
440 <<etaHigh <<
" " << phiLow <<
" " << phiHigh;
444 etaHigh += etamargin;
445 double phiMinus = phiLow - phimargin;
446 double phiPlus = phiHigh + phimargin;
449 double dd = fabs(phiPlus-phiMinus);
451 if (dd > 2.*
Geom::pi() ) all =
true;
454 while (phiMinus < 0) { phiMinus += 2.*
Geom::pi() ; }
457 double dphi = phiPlus - phiMinus;
458 if (dphi < 0) dphi += 2.*
Geom::pi() ;
459 LogDebug(category) <<
"dphi = " << dphi;
463 LogDebug(category) <<
"fed_low1 fed_low2 " << fed_low1 <<
" " << fed_low2;
464 if (fed_low1 == fed_low2) all =
true;
467 LogDebug(category) <<
"fed_hi1 fed_hi2 " << fed_hi1 <<
" " << fed_hi2;
468 if (fed_hi1 == fed_hi2) all =
true;
473 LogDebug(category)<<
" unpack everything in phi ! ";
478 LogDebug(category) <<
" with margins : " << etaLow <<
" " << etaHigh <<
" "
479 << phiMinus <<
" " << phiPlus;
484 TheMapping -> GetListofFEDs(ecalregion, FEDs);
bool Candidate_
Candidate-versatile objects part flag.
void Cand(edm::Event &e, const edm::EventSetup &es, std::vector< int > &FEDs)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
class to drive the job on L1Jet
std::string dump(unsigned int indent=0) const
void unique(std::vector< int > &FEDs)
remove duplicates
MuJobPSet MuonSource_
what drives the job from ONE L1Muon collection
const ESElectronicsMapper * TheESMapping
class to drive the job on Candidate-inheriting object
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool Muon_
Muon part flag.
std::vector< JetJobPSet > JetSource_
what drive the job on L1Jet collection
std::string dumpFEDs(const std::vector< int > &FEDs)
void Jet(edm::Event &e, const edm::EventSetup &es, std::vector< int > &FEDs)
std::vector< EmJobPSet > EmSource_
what drive the job on L1Em collection
void Muon(edm::Event &e, const edm::EventSetup &es, std::vector< int > &FEDs)
const EcalElectronicsMapping * TheMapping
tools
generic class to drive the job
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag sourceTag_es_
std::vector< CandJobPSet > CandSource_
what drives the job from candidate
class to drive the job on L1Em
void ListOfFEDS(double etaLow, double etaHigh, double phiLow, double phiHigh, double etamargin, double phimargin, std::vector< int > &FEDs)
actually fill the vector with FED numbers
std::string propagatorNameToBePrecise
virtual ~EcalRawToRecHitRoI()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void Egamma_OneL1EmCollection(const edm::Handle< l1extra::L1EmParticleCollection > emColl, const EmJobPSet &ejpset, const edm::ESHandle< L1CaloGeometry > &l1CaloGeom, std::vector< int > &FEDs)
process one collection of L1Em
class to drive the job on L1Muon
edm::InputTag sourceTag_
input tag for the lazy getter
void produce(edm::Event &e, const edm::EventSetup &c)
bool All_
if all need to be done
volatile std::atomic< bool > shutdown_flag false
void Egamma(edm::Event &e, const edm::EventSetup &es, std::vector< int > &FEDs)
bool EGamma_
Egamma part flag.
CandJobPSet(edm::ParameterSet &cfg)
std::vector< int > GetListofFEDs(const std::vector< int > &eeFEDs) const
EcalRawToRecHitRoI(const edm::ParameterSet &pset)
void Jet_OneL1JetCollection(const edm::Handle< l1extra::L1JetParticleCollection > jetColl, const JetJobPSet &jjpset, std::vector< int > &feds)
process on collection of L1Jets