CMS 3D CMS Logo

EcalListOfFEDSProducer Class Reference

#include <RecoEgamma/EgammaHLTProducers/interface/EcalListOfFEDSProducer.h>

Inheritance diagram for EcalListOfFEDSProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

void beginJob (const edm::EventSetup &c)
 EcalListOfFEDSProducer (const edm::ParameterSet &pset)
void Egamma (edm::Event &e, const edm::EventSetup &es, std::vector< int > &done, std::vector< int > &FEDs)
void endJob (void)
void Jets (edm::Event &e, const edm::EventSetup &es, std::vector< int > &done, std::vector< int > &FEDs)
void Muon (edm::Event &e, const edm::EventSetup &es, std::vector< int > &done, std::vector< int > &FEDs)
void produce (edm::Event &e, const edm::EventSetup &c)
virtual ~EcalListOfFEDSProducer ()

Private Member Functions

std::vector< intListOfFEDS (double etaLow, double etaHigh, double phiLow, double phiHigh, double etamargin, double phimargin)

Private Attributes

edm::InputTag CentralSource_
bool debug_
bool EGamma_
bool EMdoIsolated_
bool EMdoNonIsolated_
edm::InputTag EMl1TagIsolated_
edm::InputTag EMl1TagNonIsolated_
double EMregionEtaMargin_
double EMregionPhiMargin_
bool first_
edm::InputTag ForwardSource_
bool Jets_
bool JETSdoCentral_
bool JETSdoForward_
bool JETSdoTau_
double JETSregionEtaMargin_
double JETSregionPhiMargin_
bool Muon_
edm::InputTag MuonSource_
double MUregionEtaMargin_
double MUregionPhiMargin_
std::string OutputLabel_
edm::InputTag Pi0ListToIgnore_
double Ptmin_iso_
double Ptmin_jets_
double Ptmin_muon_
double Ptmin_noniso_
edm::InputTag TauSource_
EcalElectronicsMappingTheMapping


Detailed Description

Definition at line 19 of file EcalListOfFEDSProducer.h.


Constructor & Destructor Documentation

EcalListOfFEDSProducer::EcalListOfFEDSProducer ( const edm::ParameterSet pset  ) 

Definition at line 41 of file EcalListOfFEDSProducer.cc.

References CentralSource_, debug_, EGamma_, EMdoIsolated_, EMdoNonIsolated_, EMl1TagIsolated_, EMl1TagNonIsolated_, EMregionEtaMargin_, EMregionPhiMargin_, Exception, first_, ForwardSource_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), Jets_, JETSdoCentral_, JETSdoForward_, JETSdoTau_, JETSregionEtaMargin_, JETSregionPhiMargin_, Muon_, MuonSource_, MUregionEtaMargin_, MUregionPhiMargin_, OutputLabel_, Pi0ListToIgnore_, Ptmin_iso_, Ptmin_jets_, Ptmin_muon_, Ptmin_noniso_, TauSource_, and TheMapping.

00041                                                                           {
00042 
00043  debug_ = pset.getUntrackedParameter<bool>("debug");
00044 
00045  Pi0ListToIgnore_ = pset.getParameter<edm::InputTag>("Pi0ListToIgnore");
00046 
00047  EGamma_ = pset.getUntrackedParameter<bool>("EGamma",false);
00048  Muon_ = pset.getUntrackedParameter<bool>("Muon",false);
00049  Jets_ = pset.getUntrackedParameter<bool>("Jets",false);
00050 
00051  if (EGamma_ && Muon_) {
00052   throw cms::Exception("EcalListOfFEDSProducer") << 
00053         " Wrong configuration : EGamma and Muon should not be true at the same time." ;
00054  }
00055 
00056 
00057  if (EGamma_) {
00058         
00059         EMl1TagIsolated_ = pset.getUntrackedParameter<edm::InputTag>("EM_l1TagIsolated");
00060         EMl1TagNonIsolated_ = pset.getUntrackedParameter<edm::InputTag>("EM_l1TagNonIsolated");
00061         EMdoIsolated_ = pset.getUntrackedParameter<bool>("EM_doIsolated",true);
00062         EMdoNonIsolated_ = pset.getUntrackedParameter<bool>("EM_doNonIsolated",true);
00063         EMregionEtaMargin_ = pset.getUntrackedParameter<double>("EM_regionEtaMargin",0.25);
00064         EMregionPhiMargin_ = pset.getUntrackedParameter<double>("EM_regionPhiMargin",0.40);
00065         Ptmin_iso_ = pset.getUntrackedParameter<double>("Ptmin_iso",0.);
00066         Ptmin_noniso_ = pset.getUntrackedParameter<double>("Ptmin_noniso",0.);
00067  }
00068 
00069  if (Muon_) {
00070         MUregionEtaMargin_ = pset.getUntrackedParameter<double>("MU_regionEtaMargin",1.0);
00071         MUregionPhiMargin_ = pset.getUntrackedParameter<double>("MU_regionPhiMargin",1.0);
00072         Ptmin_muon_ = pset.getUntrackedParameter<double>("Ptmin_muon",0.);
00073         MuonSource_ = pset.getUntrackedParameter<edm::InputTag>("MuonSource");
00074  }
00075 
00076  if (Jets_) {
00077         JETSregionEtaMargin_ = pset.getUntrackedParameter<double>("JETS_regionEtaMargin",1.0);
00078         JETSregionPhiMargin_ = pset.getUntrackedParameter<double>("JETS_regionPhiMargin",1.0);
00079         Ptmin_jets_ = pset.getUntrackedParameter<double>("Ptmin_jets",0.);
00080         CentralSource_ = pset.getUntrackedParameter<edm::InputTag>("CentralSource");
00081         ForwardSource_ = pset.getUntrackedParameter<edm::InputTag>("ForwardSource");
00082         TauSource_ = pset.getUntrackedParameter<edm::InputTag>("TauSource");
00083         JETSdoCentral_ = pset.getUntrackedParameter<bool>("JETS_doCentral",true);
00084         JETSdoForward_ = pset.getUntrackedParameter<bool>("JETS_doForward",true);
00085         JETSdoTau_ = pset.getUntrackedParameter<bool>("JETS_doTau",true);
00086  }
00087 
00088 
00089  OutputLabel_ = pset.getUntrackedParameter<std::string>("OutputLabel");
00090 
00091  TheMapping = new EcalElectronicsMapping();
00092  first_ = true;
00093 
00094  produces<EcalListOfFEDS>(OutputLabel_);
00095 }

EcalListOfFEDSProducer::~EcalListOfFEDSProducer (  )  [virtual]

Definition at line 99 of file EcalListOfFEDSProducer.cc.

References TheMapping.

00099                                                 {
00100  delete TheMapping;
00101 }


Member Function Documentation

void EcalListOfFEDSProducer::beginJob ( const edm::EventSetup c  )  [virtual]

Reimplemented from edm::EDProducer.

Definition at line 104 of file EcalListOfFEDSProducer.cc.

00104                                                            {
00105 }

void EcalListOfFEDSProducer::Egamma ( edm::Event e,
const edm::EventSetup es,
std::vector< int > &  done,
std::vector< int > &  FEDs 
)

Definition at line 184 of file EcalListOfFEDSProducer.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, EMdoIsolated_, EMdoNonIsolated_, EMl1TagIsolated_, EMl1TagNonIsolated_, EMregionEtaMargin_, EMregionPhiMargin_, lat::endl(), find(), edm::EventSetup::get(), edm::Event::getByLabel(), i, int, ListOfFEDS(), Ptmin_iso_, and Ptmin_noniso_.

Referenced by produce().

00184                                                                                                                      {
00185 
00186  // std::vector<int> FEDs;
00187 
00188  if (debug_) std::cout << std::endl << std::endl << " enter in EcalListOfFEDSProducer::Egamma" << std::endl;
00189 
00190   //Get the L1 EM Particle Collection
00191   //Get the L1 EM Particle Collection
00192   edm::Handle< l1extra::L1EmParticleCollection > emIsolColl ;
00193   if(EMdoIsolated_)
00194     e.getByLabel(EMl1TagIsolated_, emIsolColl);
00195   //Get the L1 EM Particle Collection
00196   edm::Handle< l1extra::L1EmParticleCollection > emNonIsolColl ;
00197   if (EMdoNonIsolated_)
00198     e.getByLabel(EMl1TagNonIsolated_, emNonIsolColl);
00199 
00200   // Get the CaloGeometry
00201   edm::ESHandle<L1CaloGeometry> l1CaloGeom ;
00202   es.get<L1CaloGeometryRecord>().get(l1CaloGeom) ;
00203 
00204   if(EMdoIsolated_) {
00205 
00206     for( l1extra::L1EmParticleCollection::const_iterator emItr = emIsolColl->begin();
00207                         emItr != emIsolColl->end() ;++emItr ){
00208 
00209         float pt = emItr -> pt();
00210         if (pt < Ptmin_iso_ ) continue;
00211         if (debug_) std::cout << " Here is an L1 isoEM candidate of pt " << pt << std::endl;
00212         // Access the GCT hardware object corresponding to the L1Extra EM object.
00213         int etaIndex = emItr->gctEmCand()->etaIndex() ;
00214         int phiIndex = emItr->gctEmCand()->phiIndex() ;
00215         // Use the L1CaloGeometry to find the eta, phi bin boundaries.
00216         double etaLow  = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
00217         double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
00218         double phiLow  = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
00219         double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
00220 
00221         std::vector<int> feds = ListOfFEDS(etaLow, etaHigh, phiLow, phiHigh, EMregionEtaMargin_, EMregionPhiMargin_);
00222         for (int i=0; i < (int)feds.size(); i++) {
00223                 if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
00224                      std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
00225         }
00226 
00227     } // end loop on L1EmParticleCollection
00228 
00229   }  // endif doIsolated_
00230 
00231 
00232   if (EMdoNonIsolated_) {
00233 
00234     for( l1extra::L1EmParticleCollection::const_iterator emItr = emNonIsolColl->begin();
00235                         emItr != emNonIsolColl->end() ;++emItr ){
00236 
00237         float pt = emItr -> pt();
00238         if (debug_) std::cout << " Here is an L1 nonisoEM candidate of pt " << pt << std::endl;
00239         if (pt < Ptmin_noniso_ ) continue;
00240         // Access the GCT hardware object corresponding to the L1Extra EM object.
00241         int etaIndex = emItr->gctEmCand()->etaIndex() ;
00242         int phiIndex = emItr->gctEmCand()->phiIndex() ;
00243         // std::cout << " etaIndex phiIndex " << etaIndex << " " << phiIndex << std::endl;
00244         // Use the L1CaloGeometry to find the eta, phi bin boundaries.
00245         double etaLow  = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
00246         double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
00247         double phiLow  = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
00248         double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
00249 
00250         std::vector<int> feds = ListOfFEDS(etaLow, etaHigh, phiLow, phiHigh, EMregionEtaMargin_, EMregionPhiMargin_);
00251         for (int i=0; i < (int)feds.size(); i++) {
00252                 if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
00253                      std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
00254 
00255         }
00256 
00257     } // end loop on L1EmParticleCollection
00258   }
00259 
00260  // std::cout << "end of get list of feds " << std::endl;
00261 
00262  if (debug_) {
00263         std::cout << std::endl;
00264         for (int i=0; i < (int)FEDs.size(); i++) {
00265           std::cout << "Egamma: unpack FED " << FEDs[i] << std::endl;
00266         }
00267         std::cout << "Number of FEDS is " << FEDs.size() << std::endl;
00268  }
00269 
00270  // return FEDs;
00271 
00272 }

void EcalListOfFEDSProducer::endJob ( void   )  [virtual]

Reimplemented from edm::EDProducer.

Definition at line 107 of file EcalListOfFEDSProducer.cc.

00107                                    {
00108 }

void EcalListOfFEDSProducer::Jets ( edm::Event e,
const edm::EventSetup es,
std::vector< int > &  done,
std::vector< int > &  FEDs 
)

Definition at line 323 of file EcalListOfFEDSProducer.cc.

References CentralSource_, GenMuonPlsPt100GeV_cfg::cout, debug_, lat::endl(), geometryDiff::epsilon, eta, find(), ForwardSource_, edm::Event::getByLabel(), i, int, it, jetColl, JETSdoCentral_, JETSdoForward_, JETSdoTau_, JETSregionEtaMargin_, JETSregionPhiMargin_, ListOfFEDS(), phi, Ptmin_jets_, and TauSource_.

Referenced by produce().

00323                                                                                                                   {
00324 
00325  // std::vector<int> FEDs;
00326 
00327  if (debug_) std::cout << std::endl << std::endl << " enter in EcalListOfFEDSProducer::Jets" << std::endl;
00328  double epsilon = 0.01;
00329 
00330   // Get the CaloGeometry
00331   // edm::ESHandle<L1CaloGeometry> l1CaloGeom ;
00332   // es.get<L1CaloGeometryRecord>().get(l1CaloGeom) ;
00333 
00334   if (JETSdoCentral_) {
00335 
00336         edm::Handle<L1JetParticleCollection> jetColl;
00337         e.getByLabel(CentralSource_,jetColl);
00338 
00339         for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) {
00340 
00341                 double pt    =  it -> pt();
00342                 double eta   =  it -> eta();
00343                 double phi   =  it -> phi();
00344 
00345                 if (debug_) std::cout << " here is a L1 CentralJet Seed  with (eta,phi) = " <<
00346                         eta << " " << phi << " and pt " << pt << std::endl;
00347                 // int etaIndex = it->gctJetCand()->etaIndex() ;
00348                 // int phiIndex = it->gctJetCand()->phiIndex() ;
00349                 // double etaLow  = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
00350                 // double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
00351                 // double phiLow  = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
00352                 // double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
00353                 // if (debug_) cout << " etaLow .. " << etaLow << " " << etaHigh << " " << phiLow << " " << phiHigh << endl;
00354 
00355                 if (pt < Ptmin_jets_ ) continue;
00356 
00357                 std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, JETSregionEtaMargin_, JETSregionPhiMargin_);
00358         
00359                 for (int i=0; i < (int)feds.size(); i++) {
00360                         if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
00361                              std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
00362                 }
00363         }
00364   }
00365 
00366   if (JETSdoForward_) {
00367 
00368         edm::Handle<L1JetParticleCollection> jetColl;
00369         e.getByLabel(ForwardSource_,jetColl);
00370 
00371         for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) {
00372 
00373                 double pt    =  it -> pt();
00374                 double eta   =  it -> eta();
00375                 double phi   =  it -> phi();
00376 
00377                 if (debug_) std::cout << " here is a L1 ForwardJet Seed  with (eta,phi) = " <<
00378                         eta << " " << phi << " and pt " << pt << std::endl;
00379                 if (pt < Ptmin_jets_ ) continue;
00380 
00381                 std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, JETSregionEtaMargin_, JETSregionPhiMargin_);
00382 
00383                 for (int i=0; i < (int)feds.size(); i++) {
00384                         if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
00385                              std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
00386                 }
00387         }
00388    }
00389 
00390   if (JETSdoTau_) {
00391 
00392         edm::Handle<L1JetParticleCollection> jetColl;
00393         e.getByLabel(TauSource_,jetColl);
00394 
00395         for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) {
00396 
00397                 double pt    =  it -> pt();
00398                 double eta   =  it -> eta();
00399                 double phi   =  it -> phi();
00400 
00401                 if (debug_) std::cout << " here is a L1 TauJet Seed  with (eta,phi) = " <<
00402                         eta << " " << phi << " and pt " << pt << std::endl;
00403                 if (pt < Ptmin_jets_ ) continue;
00404 
00405                 std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, JETSregionEtaMargin_, JETSregionPhiMargin_);
00406 
00407                 for (int i=0; i < (int)feds.size(); i++) {
00408                         if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
00409                              std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
00410                 }
00411         }
00412    }
00413 
00414 
00415 
00416  if (debug_) {
00417         std::cout << std::endl;
00418         for (int i=0; i < (int)FEDs.size(); i++) {
00419           std::cout << "Jets: unpack FED " << FEDs[i] << std::endl;
00420         }
00421         std::cout << "Number of FEDS is " << FEDs.size() << std::endl;
00422  }
00423 
00424 
00425  // return FEDs;
00426 
00427 }

std::vector< int > EcalListOfFEDSProducer::ListOfFEDS ( double  etaLow,
double  etaHigh,
double  phiLow,
double  phiHigh,
double  etamargin,
double  phimargin 
) [private]

Definition at line 430 of file EcalListOfFEDSProducer.cc.

References python::cmstools::all(), GenMuonPlsPt100GeV_cfg::cout, dd, debug_, lat::endl(), reco_application_2006h2rawdata_ecalLocalReco_cfg::FEDs, Geom::pi(), and TheMapping.

Referenced by Egamma(), Jets(), and Muon().

00432 {
00433 
00434         std::vector<int> FEDs;
00435 
00436         if (phimargin > Geom::pi()) phimargin =  Geom::pi() ;
00437 
00438 
00439         if (debug_) std::cout << " etaLow etaHigh phiLow phiHigh " << etaLow << " " << 
00440                         etaHigh << " " << phiLow << " " << phiHigh << std::endl;
00441 
00442         etaLow -= etamargin;
00443         etaHigh += etamargin;
00444         double phiMinus = phiLow - phimargin;
00445         double phiPlus = phiHigh + phimargin;
00446 
00447         bool all = false;
00448         double dd = fabs(phiPlus-phiMinus);
00449         if (debug_) std::cout << " dd = " << dd << std::endl;
00450         if (dd > 2.*Geom::pi() ) all = true;
00451 
00452         while (phiPlus > Geom::pi()) { phiPlus -= 2.*Geom::pi() ; }
00453         while (phiMinus < 0) { phiMinus += 2.*Geom::pi() ; }
00454         if ( phiMinus > Geom::pi()) phiMinus -= 2.*Geom::pi() ;
00455 
00456         double dphi = phiPlus - phiMinus;
00457         if (dphi < 0) dphi += 2.*Geom::pi() ;
00458         if (debug_) std::cout << "dphi = " << dphi << std::endl;
00459         if (dphi > Geom::pi()) {
00460                 int fed_low1 = TheMapping -> GetFED(etaLow,phiMinus*180./Geom::pi());
00461                 int fed_low2 = TheMapping -> GetFED(etaLow,phiPlus*180./Geom::pi());
00462                 if (debug_) std::cout << "fed_low1 fed_low2 " << fed_low1 << " " << fed_low2 << std::endl;
00463                 if (fed_low1 == fed_low2) all = true;
00464                 int fed_hi1 = TheMapping -> GetFED(etaHigh,phiMinus*180./Geom::pi());
00465                 int fed_hi2 = TheMapping -> GetFED(etaHigh,phiPlus*180./Geom::pi());
00466                 if (debug_) std::cout << "fed_hi1 fed_hi2 " << fed_hi1 << " " << fed_hi2 << std::endl;
00467                 if (fed_hi1 == fed_hi2) all = true;
00468         }
00469 
00470 
00471         if (all) {
00472                 if (debug_) std::cout << " unpack everything in phi ! " << std::endl;
00473                 phiMinus = -20 * Geom::pi() / 180.;  // -20 deg
00474                 phiPlus = -40 * Geom::pi() / 180.;  // -20 deg
00475         }
00476 
00477         if (debug_) std::cout << " with margins : " << etaLow << " " << etaHigh << " " << 
00478                         phiMinus << " " << phiPlus << std::endl;
00479 
00480 
00481         const EcalEtaPhiRegion ecalregion(etaLow,etaHigh,phiMinus,phiPlus);
00482 
00483         FEDs = TheMapping -> GetListofFEDs(ecalregion);
00484 
00485 /*
00486         if (debug_) {
00487            int nn = (int)FEDs.size();
00488            for (int ii=0; ii < nn; ii++) {
00489                    std::cout << "unpack fed " << FEDs[ii] << std::endl;
00490            }
00491            }
00492 */
00493 
00494         return FEDs;
00495 
00496 }

void EcalListOfFEDSProducer::Muon ( edm::Event e,
const edm::EventSetup es,
std::vector< int > &  done,
std::vector< int > &  FEDs 
)

Definition at line 276 of file EcalListOfFEDSProducer.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, lat::endl(), geometryDiff::epsilon, eta, find(), edm::Event::getByLabel(), i, int, it, ListOfFEDS(), MuonSource_, MUregionEtaMargin_, MUregionPhiMargin_, phi, and Ptmin_muon_.

Referenced by produce().

00276                                                                                                                   {
00277 
00278  // std::vector<int> FEDs;
00279 
00280  if (debug_) std::cout << std::endl << std::endl << " enter in EcalListOfFEDSProducer::Muon" << std::endl;
00281 
00282   edm::Handle<L1MuonParticleCollection> muColl;
00283   e.getByLabel(MuonSource_, muColl);
00284 
00285 
00286   double epsilon = 0.01;
00287 
00288   for (L1MuonParticleCollection::const_iterator it=muColl->begin(); it != muColl->end(); it++) {
00289                                                                                                                        
00290         const L1MuGMTExtendedCand muonCand = (*it).gmtMuonCand();
00291         double pt    =  (*it).pt();
00292         double eta   =  (*it).eta();
00293         double phi   =  (*it).phi();
00294                                                                                                                        
00295         if (debug_) std::cout << " here is a L1 muon Seed  with (eta,phi) = " << 
00296                 eta << " " << phi << " and pt " << pt << std::endl;
00297         if (pt < Ptmin_muon_ ) continue;
00298                                                                                                                        
00299         std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, MUregionEtaMargin_, MUregionPhiMargin_);
00300 
00301         for (int i=0; i < (int)feds.size(); i++) {
00302                 if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
00303                      std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
00304         }
00305   }
00306                                                                                                                        
00307  if (debug_) {
00308         std::cout << std::endl;
00309         for (int i=0; i < (int)FEDs.size(); i++) {
00310           std::cout << "Muons: unpack FED " << FEDs[i] << std::endl;
00311         }
00312         std::cout << "Number of FEDS is " << FEDs.size() << std::endl;
00313  }
00314                                                                                                                        
00315 
00316  // return FEDs;
00317 
00318 }

void EcalListOfFEDSProducer::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 110 of file EcalListOfFEDSProducer.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, Egamma(), EGamma_, lat::endl(), find(), first_, edm::EventSetup::get(), FEDNumbering::getEcalFEDIds(), edm::Event::getManyByType(), i, id, edm::Event::id(), int, Jets(), Jets_, edm::InputTag::label(), Muon(), Muon_, OutputLabel_, Pi0ListToIgnore_, edm::ESHandle< T >::product(), edm::Event::put(), and TheMapping.

00110                                                                              {
00111 
00112  std::pair<int,int> ecalfeds = FEDNumbering::getEcalFEDIds();
00113  int first_fed = ecalfeds.first;
00114 
00115  if (first_) {
00116    edm::ESHandle< EcalElectronicsMapping > ecalmapping;
00117    iSetup.get< EcalMappingRcd >().get(ecalmapping);
00118    const EcalElectronicsMapping* TheMapping_ = ecalmapping.product();
00119    *TheMapping = *TheMapping_;
00120    first_ = false;
00121  }                                                                                              
00122 
00123  std::auto_ptr<EcalListOfFEDS> productAddress(new EcalListOfFEDS);
00124 
00125  std::vector<int> feds;         // the list of FEDS produced by this module
00126 
00127 
00128  // ---- First, get the list of ECAL FEDs which have already been unpacked
00129 
00130  std::vector< edm::Handle<EcalListOfFEDS> > FEDs_Done;
00131  std::vector<int> Done;
00132  e.getManyByType(FEDs_Done);
00133  unsigned int nDone = FEDs_Done.size();
00134  if (debug_) std::cout << " ECAL unpacking module has already run " << nDone << " times. " << std::endl;
00135  for (unsigned int id=0; id < nDone; id++) {
00136    // ignore the FEDs coming from unpacking in pi0 paths
00137    if( Pi0ListToIgnore_.label() == FEDs_Done[id].provenance()->moduleLabel() ){continue;}
00138    std::vector<int> done = FEDs_Done[id]-> GetList();
00139    for (int jd=0; jd < (int)done.size(); jd++) {
00140         Done.push_back(done[jd] -first_fed );
00141    }
00142  }
00143  if (debug_) std::cout << " For this event, " << Done.size() << " ECAL FEDs have already been unpacked." << std::endl;
00144 
00145 
00146  if (EGamma_) {
00147   // feds = Egamma(e, iSetup, Done);
00148   Egamma(e, iSetup, Done, feds);
00149  }
00150 
00151  if (Muon_) {
00152    // feds = Muon(e, iSetup, Done);
00153    Muon(e, iSetup, Done, feds);
00154  }
00155 
00156  if (Jets_) {
00157    // feds = Jets(e, iSetup, Done);
00158    Jets(e, iSetup, Done, feds);
00159  }
00160 
00161  if ( !EGamma_ && !Muon_ && ! Jets_)  {
00162    for (int i=1; i <= 54; i++) {
00163       if ( std::find(Done.begin(), Done.end(), i) == Done.end())
00164       feds.push_back(i);
00165    }
00166  }
00167 
00168  int nf = (int)feds.size();
00169  for (int i=0; i <nf; i++) {
00170   feds[i] += first_fed;
00171   if (debug_) std::cout << "Will unpack FED " << feds[i] << std::endl;
00172  }
00173 
00174  if (debug_ && nf < 1 ) 
00175     std::cout << " Warning : no ECAL FED to unpack for Run " << e.id().run() << "  Event " << e.id().event() << std::endl;
00176 
00177 
00178  productAddress.get() -> SetList(feds);
00179  e.put(productAddress,OutputLabel_);
00180 }


Member Data Documentation

edm::InputTag EcalListOfFEDSProducer::CentralSource_ [private]

Definition at line 59 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

bool EcalListOfFEDSProducer::debug_ [private]

Definition at line 66 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), Egamma(), Jets(), ListOfFEDS(), Muon(), and produce().

bool EcalListOfFEDSProducer::EGamma_ [private]

Definition at line 36 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and produce().

bool EcalListOfFEDSProducer::EMdoIsolated_ [private]

Definition at line 39 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

bool EcalListOfFEDSProducer::EMdoNonIsolated_ [private]

Definition at line 40 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

edm::InputTag EcalListOfFEDSProducer::EMl1TagIsolated_ [private]

Definition at line 37 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

edm::InputTag EcalListOfFEDSProducer::EMl1TagNonIsolated_ [private]

Definition at line 38 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

double EcalListOfFEDSProducer::EMregionEtaMargin_ [private]

Definition at line 41 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

double EcalListOfFEDSProducer::EMregionPhiMargin_ [private]

Definition at line 42 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

bool EcalListOfFEDSProducer::first_ [private]

Definition at line 65 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and produce().

edm::InputTag EcalListOfFEDSProducer::ForwardSource_ [private]

Definition at line 60 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

bool EcalListOfFEDSProducer::Jets_ [private]

Definition at line 52 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and produce().

bool EcalListOfFEDSProducer::JETSdoCentral_ [private]

Definition at line 53 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

bool EcalListOfFEDSProducer::JETSdoForward_ [private]

Definition at line 54 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

bool EcalListOfFEDSProducer::JETSdoTau_ [private]

Definition at line 55 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

double EcalListOfFEDSProducer::JETSregionEtaMargin_ [private]

Definition at line 56 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

double EcalListOfFEDSProducer::JETSregionPhiMargin_ [private]

Definition at line 57 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

bool EcalListOfFEDSProducer::Muon_ [private]

Definition at line 46 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and produce().

edm::InputTag EcalListOfFEDSProducer::MuonSource_ [private]

Definition at line 50 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Muon().

double EcalListOfFEDSProducer::MUregionEtaMargin_ [private]

Definition at line 47 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Muon().

double EcalListOfFEDSProducer::MUregionPhiMargin_ [private]

Definition at line 48 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Muon().

std::string EcalListOfFEDSProducer::OutputLabel_ [private]

Definition at line 63 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and produce().

edm::InputTag EcalListOfFEDSProducer::Pi0ListToIgnore_ [private]

Definition at line 35 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and produce().

double EcalListOfFEDSProducer::Ptmin_iso_ [private]

Definition at line 43 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

double EcalListOfFEDSProducer::Ptmin_jets_ [private]

Definition at line 58 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

double EcalListOfFEDSProducer::Ptmin_muon_ [private]

Definition at line 49 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Muon().

double EcalListOfFEDSProducer::Ptmin_noniso_ [private]

Definition at line 44 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Egamma().

edm::InputTag EcalListOfFEDSProducer::TauSource_ [private]

Definition at line 61 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), and Jets().

EcalElectronicsMapping* EcalListOfFEDSProducer::TheMapping [private]

Definition at line 64 of file EcalListOfFEDSProducer.h.

Referenced by EcalListOfFEDSProducer(), ListOfFEDS(), produce(), and ~EcalListOfFEDSProducer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:44 2009 for CMSSW by  doxygen 1.5.4