CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1TStage2CaloLayer2Comp Class Reference
Inheritance diagram for L1TStage2CaloLayer2Comp:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1TStage2CaloLayer2Comp (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

void accuSort (std::vector< l1t::Jet > *jets)
 
void accuSort (std::vector< l1t::Tau > *taus)
 
void accuSort (std::vector< l1t::EGamma > *egs)
 
void accuSort (std::vector< l1t::L1Candidate > &jets)
 
bool compareEGs (const edm::Handle< l1t::EGammaBxCollection > &dataCol, const edm::Handle< l1t::EGammaBxCollection > &emulCol)
 
bool compareJets (const edm::Handle< l1t::JetBxCollection > &dataCol, const edm::Handle< l1t::JetBxCollection > &emulCol)
 
bool compareSums (const edm::Handle< l1t::EtSumBxCollection > &dataCol, const edm::Handle< l1t::EtSumBxCollection > &emulCol)
 
bool compareTaus (const edm::Handle< l1t::TauBxCollection > &dataCol, const edm::Handle< l1t::TauBxCollection > &emulCol)
 
void dumpEventToEDM (edm::Event &e)
 
void dumpEventToFile ()
 

Private Attributes

edm::EDGetToken calol2CaloTowerCollectionData
 
edm::EDGetToken calol2CaloTowerCollectionEmul
 
edm::EDGetToken calol2EGammaCollectionData
 
edm::EDGetToken calol2EGammaCollectionEmul
 
edm::EDGetToken calol2EtSumCollectionData
 
edm::EDGetToken calol2EtSumCollectionEmul
 
edm::EDGetToken calol2JetCollectionData
 
edm::EDGetToken calol2JetCollectionEmul
 
edm::EDGetToken calol2TauCollectionData
 
edm::EDGetToken calol2TauCollectionEmul
 
edm::Handle< l1t::CaloTowerBxCollectioncaloTowerDataCol
 
edm::Handle< l1t::CaloTowerBxCollectioncaloTowerEmulCol
 
const unsigned int currBx = 0
 
bool dumpTowers = false
 
bool dumpWholeEvent = false
 
edm::Handle< l1t::EGammaBxCollectionegDataCol
 
edm::Handle< l1t::EGammaBxCollectionegEmulCol
 
edm::Handle< l1t::JetBxCollectionjetDataCol
 
edm::Handle< l1t::JetBxCollectionjetEmulCol
 
edm::Handle< l1t::EtSumBxCollectionsumDataCol
 
edm::Handle< l1t::EtSumBxCollectionsumEmulCol
 
edm::Handle< l1t::TauBxCollectiontauDataCol
 
edm::Handle< l1t::TauBxCollectiontauEmulCol
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Short class description.

Longer class description... ... desc continued.

Definition at line 67 of file L1TStage2CaloLayer2Comp.cc.

Constructor & Destructor Documentation

L1TStage2CaloLayer2Comp::L1TStage2CaloLayer2Comp ( const edm::ParameterSet ps)

Class constructor

Receives the set of parameters, specified by the python configuration file used to initialise the module as a part of a sequence. The contents of the set is used to configure the internal state of the objects of this class. Values from the parameter set are extracted and used to initialise bxcollections for jet, e/g, tau and sum objects reconstructed by firmware (data) and emulator. These collections are the basis of the comparisons performed by this module.

Parameters
edm::ParamterSet& ps A pointer to the parameter set used

Definition at line 243 of file L1TStage2CaloLayer2Comp.cc.

References dumpTowers, dumpWholeEvent, and edm::ParameterSet::getParameter().

244  : calol2JetCollectionData(consumes <l1t::JetBxCollection>(
246  "calol2JetCollectionData"))),
247  calol2JetCollectionEmul(consumes <l1t::JetBxCollection>(
249  "calol2JetCollectionEmul"))),
250  calol2EGammaCollectionData(consumes <l1t::EGammaBxCollection>(
252  "calol2EGammaCollectionData"))),
253  calol2EGammaCollectionEmul(consumes <l1t::EGammaBxCollection>(
255  "calol2EGammaCollectionEmul"))),
256  calol2TauCollectionData(consumes <l1t::TauBxCollection>(
258  "calol2TauCollectionData"))),
259  calol2TauCollectionEmul(consumes <l1t::TauBxCollection>(
261  "calol2TauCollectionEmul"))),
262  calol2EtSumCollectionData(consumes <l1t::EtSumBxCollection>(
264  "calol2EtSumCollectionData"))),
265  calol2EtSumCollectionEmul(consumes <l1t::EtSumBxCollection>(
267  "calol2EtSumCollectionEmul"))),
268  calol2CaloTowerCollectionData(consumes <l1t::CaloTowerBxCollection>(
270  "calol2CaloTowerCollectionData"))),
271  calol2CaloTowerCollectionEmul(consumes <l1t::CaloTowerBxCollection>(
273  "calol2CaloTowerCollectionEmul")))
274 {
275  produces<l1t::JetBxCollection> ("dataJet").setBranchAlias("dataJets");
276  produces<l1t::JetBxCollection> ("emulJet").setBranchAlias("emulJets");
277  produces<l1t::EGammaBxCollection> ("dataEg").setBranchAlias("dataEgs");
278  produces<l1t::EGammaBxCollection> ("emulEg").setBranchAlias("emulEgs");
279  produces<l1t::TauBxCollection> ("dataTau").setBranchAlias("dataTaus");
280  produces<l1t::TauBxCollection> ("emulTau").setBranchAlias("emulTaus");
281  produces<l1t::EtSumBxCollection> ("dataEtSum").setBranchAlias("dataEtSums");
282  produces<l1t::EtSumBxCollection> ("emulEtSum").setBranchAlias("emulEtSums");
283  produces<l1t::CaloTowerBxCollection> ("dataCaloTower").setBranchAlias("dataCaloTowers");
284  produces<l1t::CaloTowerBxCollection> ("emulCaloTower").setBranchAlias("emulCaloTowers");
285 
286  dumpTowers = ps.getParameter<bool>("dumpTowers");
287  dumpWholeEvent = ps.getParameter<bool>("dumpWholeEvent");
288 }
T getParameter(std::string const &) const
edm::EDGetToken calol2EGammaCollectionEmul
edm::EDGetToken calol2EGammaCollectionData
edm::EDGetToken calol2CaloTowerCollectionData
edm::EDGetToken calol2CaloTowerCollectionEmul

Member Function Documentation

void L1TStage2CaloLayer2Comp::accuSort ( std::vector< l1t::Jet > *  jets)
private

Definition at line 755 of file L1TStage2CaloLayer2Comp.cc.

References down, and AccumulatingSort< T >::Merge().

Referenced by compareEGs(), compareJets(), and compareTaus().

755  {
756 
758  l1t::Jet tempJet (emptyP4, 0, 0, 0, 0);
759  std::vector< std::vector<l1t::Jet> > jetEtaPos( 41 , std::vector<l1t::Jet>(18, tempJet));
760  std::vector< std::vector<l1t::Jet> > jetEtaNeg( 41 , std::vector<l1t::Jet>(18, tempJet));
761 
762  for (unsigned int iJet = 0; iJet < jets->size(); iJet++) {
763  if (jets->at(iJet).hwEta() > 0) jetEtaPos.at(jets->at(iJet).hwEta()-1).at((jets->at(iJet).hwPhi()-1)/4) = jets->at(iJet);
764  else jetEtaNeg.at(-(jets->at(iJet).hwEta()+1)).at((jets->at(iJet).hwPhi()-1)/4) = jets->at(iJet);
765  }
766 
767  AccumulatingSort <l1t::Jet> etaPosSorter(7);
768  AccumulatingSort <l1t::Jet> etaNegSorter(7);
769  std::vector<l1t::Jet> accumEtaPos;
770  std::vector<l1t::Jet> accumEtaNeg;
771 
772  for( int ieta = 0 ; ieta < 41 ; ++ieta) {
773  // eta +
774  std::vector<l1t::Jet>::iterator start_, end_;
775  start_ = jetEtaPos.at(ieta).begin();
776  end_ = jetEtaPos.at(ieta).end();
777  BitonicSort<l1t::Jet>(down, start_, end_);
778  etaPosSorter.Merge( jetEtaPos.at(ieta) , accumEtaPos );
779 
780  // eta -
781  start_ = jetEtaNeg.at(ieta).begin();
782  end_ = jetEtaNeg.at(ieta).end();
783  BitonicSort<l1t::Jet>(down, start_, end_);
784  etaNegSorter.Merge( jetEtaNeg.at(ieta) , accumEtaNeg );
785 
786  }
787 
788  //check for 6 & 7th jets with same et and eta. Keep jet with larger phi
789  if(accumEtaPos.at(6).hwPt()==accumEtaPos.at(5).hwPt() && accumEtaPos.at(6).hwEta()==accumEtaPos.at(5).hwEta()
790  && accumEtaPos.at(6).hwPhi() > accumEtaPos.at(5).hwPhi()){
791  accumEtaPos.at(5)=accumEtaPos.at(6);
792  }
793  if(accumEtaNeg.at(6).hwPt()==accumEtaNeg.at(5).hwPt() && accumEtaNeg.at(6).hwEta()==accumEtaNeg.at(5).hwEta()
794  && accumEtaNeg.at(6).hwPhi() > accumEtaNeg.at(5).hwPhi()){
795  accumEtaNeg.at(5)=accumEtaNeg.at(6);
796  }
797 
798  //truncate
799  accumEtaPos.resize(6);
800  accumEtaNeg.resize(6);
801 
802  // put all 12 candidates in the original jet vector, removing zero energy ones
803  jets->clear();
804  for (l1t::Jet accjet : accumEtaPos) {
805  if (accjet.hwPt() > 0) jets->push_back(accjet);
806  }
807  for (l1t::Jet accjet : accumEtaNeg) {
808  if (accjet.hwPt() > 0) jets->push_back(accjet);
809  }
810 }
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
Definition: Jet.h:21
vector< PseudoJet > jets
void L1TStage2CaloLayer2Comp::accuSort ( std::vector< l1t::Tau > *  taus)
private

Definition at line 872 of file L1TStage2CaloLayer2Comp.cc.

References down, and AccumulatingSort< T >::Merge().

872  {
873 
875  l1t::Tau tempTau (emptyP4, 0, 0, 0, 0);
876  std::vector< std::vector<l1t::Tau> > jetEtaPos( 41 , std::vector<l1t::Tau>(18, tempTau));
877  std::vector< std::vector<l1t::Tau> > jetEtaNeg( 41 , std::vector<l1t::Tau>(18, tempTau));
878 
879  for (unsigned int iTau = 0; iTau < taus->size(); iTau++) {
880  if (taus->at(iTau).hwEta() > 0) jetEtaPos.at(taus->at(iTau).hwEta()-1).at((taus->at(iTau).hwPhi()-1)/4) = taus->at(iTau);
881  else jetEtaNeg.at(-(taus->at(iTau).hwEta()+1)).at((taus->at(iTau).hwPhi()-1)/4) = taus->at(iTau);
882  }
883 
884  AccumulatingSort <l1t::Tau> etaPosSorter(7);
885  AccumulatingSort <l1t::Tau> etaNegSorter(7);
886  std::vector<l1t::Tau> accumEtaPos;
887  std::vector<l1t::Tau> accumEtaNeg;
888 
889  for( int ieta = 0 ; ieta < 41 ; ++ieta) {
890  // eta +
891  std::vector<l1t::Tau>::iterator start_, end_;
892  start_ = jetEtaPos.at(ieta).begin();
893  end_ = jetEtaPos.at(ieta).end();
894  BitonicSort<l1t::Tau>(down, start_, end_);
895  etaPosSorter.Merge( jetEtaPos.at(ieta) , accumEtaPos );
896 
897  // eta -
898  start_ = jetEtaNeg.at(ieta).begin();
899  end_ = jetEtaNeg.at(ieta).end();
900  BitonicSort<l1t::Tau>(down, start_, end_);
901  etaNegSorter.Merge( jetEtaNeg.at(ieta) , accumEtaNeg );
902 
903  }
904 
905  //check for 6 & 7th taus with same et and eta. Keep jet with larger phi
906  if(accumEtaPos.at(6).hwPt()==accumEtaPos.at(5).hwPt() && accumEtaPos.at(6).hwEta()==accumEtaPos.at(5).hwEta()
907  && accumEtaPos.at(6).hwPhi() > accumEtaPos.at(5).hwPhi()){
908  accumEtaPos.at(5)=accumEtaPos.at(6);
909  }
910  if(accumEtaNeg.at(6).hwPt()==accumEtaNeg.at(5).hwPt() && accumEtaNeg.at(6).hwEta()==accumEtaNeg.at(5).hwEta()
911  && accumEtaNeg.at(6).hwPhi() > accumEtaNeg.at(5).hwPhi()){
912  accumEtaNeg.at(5)=accumEtaNeg.at(6);
913  }
914 
915  //truncate
916  accumEtaPos.resize(6);
917  accumEtaNeg.resize(6);
918 
919  // put all 12 candidates in the original jet vector, removing zero energy ones
920  taus->clear();
921  for (l1t::Tau accjet : accumEtaPos) {
922  if (accjet.hwPt() > 0) taus->push_back(accjet);
923  }
924  for (l1t::Tau accjet : accumEtaNeg) {
925  if (accjet.hwPt() > 0) taus->push_back(accjet);
926  }
927 }
Definition: Tau.h:21
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
void L1TStage2CaloLayer2Comp::accuSort ( std::vector< l1t::EGamma > *  egs)
private

Definition at line 813 of file L1TStage2CaloLayer2Comp.cc.

References down, and AccumulatingSort< T >::Merge().

813  {
814 
816  l1t::EGamma tempEGamma (emptyP4, 0, 0, 0, 0);
817  std::vector< std::vector<l1t::EGamma> > jetEtaPos( 41 , std::vector<l1t::EGamma>(18, tempEGamma));
818  std::vector< std::vector<l1t::EGamma> > jetEtaNeg( 41 , std::vector<l1t::EGamma>(18, tempEGamma));
819 
820  for (unsigned int iEGamma = 0; iEGamma < egs->size(); iEGamma++) {
821  if (egs->at(iEGamma).hwEta() > 0) jetEtaPos.at(egs->at(iEGamma).hwEta()-1).at((egs->at(iEGamma).hwPhi()-1)/4) = egs->at(iEGamma);
822  else jetEtaNeg.at(-(egs->at(iEGamma).hwEta()+1)).at((egs->at(iEGamma).hwPhi()-1)/4) = egs->at(iEGamma);
823  }
824 
825  AccumulatingSort <l1t::EGamma> etaPosSorter(7);
826  AccumulatingSort <l1t::EGamma> etaNegSorter(7);
827  std::vector<l1t::EGamma> accumEtaPos;
828  std::vector<l1t::EGamma> accumEtaNeg;
829 
830  for( int ieta = 0 ; ieta < 41 ; ++ieta) {
831  // eta +
832  std::vector<l1t::EGamma>::iterator start_, end_;
833  start_ = jetEtaPos.at(ieta).begin();
834  end_ = jetEtaPos.at(ieta).end();
835  BitonicSort<l1t::EGamma>(down, start_, end_);
836  etaPosSorter.Merge( jetEtaPos.at(ieta) , accumEtaPos );
837 
838  // eta -
839  start_ = jetEtaNeg.at(ieta).begin();
840  end_ = jetEtaNeg.at(ieta).end();
841  BitonicSort<l1t::EGamma>(down, start_, end_);
842  etaNegSorter.Merge( jetEtaNeg.at(ieta) , accumEtaNeg );
843 
844  }
845 
846  //check for 6 & 7th egs with same et and eta. Keep jet with larger phi
847  if(accumEtaPos.at(6).hwPt()==accumEtaPos.at(5).hwPt() && accumEtaPos.at(6).hwEta()==accumEtaPos.at(5).hwEta()
848  && accumEtaPos.at(6).hwPhi() > accumEtaPos.at(5).hwPhi()){
849  accumEtaPos.at(5)=accumEtaPos.at(6);
850  }
851  if(accumEtaNeg.at(6).hwPt()==accumEtaNeg.at(5).hwPt() && accumEtaNeg.at(6).hwEta()==accumEtaNeg.at(5).hwEta()
852  && accumEtaNeg.at(6).hwPhi() > accumEtaNeg.at(5).hwPhi()){
853  accumEtaNeg.at(5)=accumEtaNeg.at(6);
854  }
855 
856  //truncate
857  accumEtaPos.resize(6);
858  accumEtaNeg.resize(6);
859 
860  // put all 12 candidates in the original jet vector, removing zero energy ones
861  egs->clear();
862  for (l1t::EGamma accjet : accumEtaPos) {
863  if (accjet.hwPt() > 0) egs->push_back(accjet);
864  }
865  for (l1t::EGamma accjet : accumEtaNeg) {
866  if (accjet.hwPt() > 0) egs->push_back(accjet);
867  }
868 }
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
void L1TStage2CaloLayer2Comp::accuSort ( std::vector< l1t::L1Candidate > &  jets)
private
bool L1TStage2CaloLayer2Comp::compareEGs ( const edm::Handle< l1t::EGammaBxCollection > &  dataCol,
const edm::Handle< l1t::EGammaBxCollection > &  emulCol 
)
private

Encapsulates the code required for performing a comparison of the e/gs contained in a given event.

Method is called once per each event with the e/g collections associated with the event being extracted for bx = 0 as the RAW information required to run the emulator is only available for bx 0. The implementation checks if the size of collections is the same and when so, compares the e/gs in the same positions within the data/emul collections. When a discrepancy is found, the properties (Et, eta, phi) of the problematic data/emul objects are stored in dedicated histograms. In cases of differences, a distinction is made between objects whose energy or position are in disagremeent. Another distinction is made between isolated and non-isolated e/g candidates and problematic objects are handled accordingly. When the length of data/emul collections is different, all of the objects are "stored" in the histograms dedicated to problematic objects.

Parameters
edm::Handle<l1t::EGammaBXCollection>&dataCol Reference to e/gamma collection from data
edm::Handle<l1t::EGammaBXCollection>&emulCol Reference to e/gamma collection from emulation
Returns
bool Flag of whether the agreement was perfect

Definition at line 467 of file L1TStage2CaloLayer2Comp.cc.

References accuSort(), BXVector< T >::begin(), currBx, SoftLeptonByDistance_cfi::distance, BXVector< T >::end(), and BXVector< T >::size().

Referenced by produce().

470 {
471  bool eventGood = true;
472 
473  std::vector<l1t::EGamma> *egs = new std::vector<l1t::EGamma>;
474  std::vector<l1t::EGamma>::iterator dataIt;
477 
478  if (dataCol->size(currBx) > 0) {
479  // sort data egs
480  while (true) {
481 
482  egs->emplace_back(*dataBxIt);
483 
484  dataBxIt++;
485  if (dataBxIt == dataCol->end(currBx))
486  break;
487  }
488  accuSort(egs);
489  dataIt = egs->begin();
490  }
491 
492  // check length of collections
493  if (egs->size() != emulCol->size(currBx)) {
494  edm::LogProblem("l1tcalol2ebec")
495  << "EG collection size difference: "
496  << "data = " << egs->size()
497  << " emul = " << emulCol->size(currBx)
498  << std::endl;
499  return false;
500  }
501 
502  // processing continues only of length of data collections is the same
503  if (dataIt != egs->end() ||
504  emulBxIt != emulCol->end(currBx)) {
505 
506  int nPos=0;
507  int nNeg=0;
508 
509  while(true) {
510 
511  bool posGood = true;
512  bool etGood = true;
513 
514  // object pt mismatch
515  if (dataIt->hwPt() != emulBxIt->hwPt()) {
516  etGood = false;
517  eventGood = false;
518  }
519 
520  // object position mismatch (phi)
521  if (dataIt->hwPhi() != emulBxIt->hwPhi()) {
522  posGood = false;
523  }
524 
525  // object position mismatch (eta)
526  if (dataIt->hwEta() != emulBxIt->hwEta()) {
527  posGood = false;
528  }
529 
530  //bypass sorting bug
531  if(etGood && !posGood){
534  for(emulItCheckSort = emulCol->begin(currBx); emulItCheckSort != emulCol->end(currBx); ++emulItCheckSort) {
535  for (dataItCheckSort = egs->begin(); dataItCheckSort != egs->end(); ++dataItCheckSort){
536 
537  if(dataItCheckSort->hwEta() > 0) ++nPos;
538  if(dataItCheckSort->hwEta() < 0) ++nNeg;
539 
540  if(dataIt->hwPt() == emulItCheckSort->hwPt()
541  && dataIt->hwPhi() == emulItCheckSort->hwPhi()
542  && dataIt->hwEta() == emulItCheckSort->hwEta())
543  posGood = true;
544  }
545  }
546  }
547 
548  if(etGood && dataIt->hwEta() > 0 && ((distance(dataIt, egs->end())-nNeg) < 5))
549  posGood = true;
550  if(etGood && dataIt->hwEta() < 0 && (distance(dataIt, egs->end()) < 5))
551  posGood = true;
552 
553  if(!posGood) eventGood = false;
554 
555  // if both position and energy agree, object is good
556  if (!posGood || !etGood) {
557  edm::LogProblem("l1tcalol2ebec")
558  << "EG Problem (data emul): "
559  << "\tEt = " << dataIt->hwPt() << " " << emulBxIt->hwPt()
560  << "\teta = " << dataIt->hwEta() << " " << emulBxIt->hwEta()
561  << "\tphi = " << dataIt->hwPhi() << " " << emulBxIt->hwPhi()
562  << std::endl;
563  }
564 
565  // increment position of pointers
566  ++dataIt;
567  ++emulBxIt;
568 
569  if (dataIt == egs->end() ||
570  emulBxIt == emulCol->end(currBx))
571  break;
572  }
573  } else {
574  if (!egs->empty() || emulCol->size(currBx) != 0)
575  return false;
576  }
577 
578  // return a boolean that states whether the eg data in the event are in
579  // agreement
580  return eventGood;
581 }
void accuSort(std::vector< l1t::Jet > *jets)
const_iterator end(int bx) const
unsigned size(int bx) const
const_iterator begin(int bx) const
std::vector< T >::const_iterator const_iterator
Definition: BXVector.h:20
bool L1TStage2CaloLayer2Comp::compareJets ( const edm::Handle< l1t::JetBxCollection > &  dataCol,
const edm::Handle< l1t::JetBxCollection > &  emulCol 
)
private

Encapsulates the code required for performing a comparison of the jets contained in a given event.

Method is called once per each event with the jet collections associated with the event being extracted for bx = 0 as the RAW information required to run the emulator is only available for bx 0. The implementation checks if the size of collections is the same and when so, compares the jets in the same positions within the data/emul collections. When a discrepancy is found, the properties (Et, eta, phi) of the problematic data/emul objects are stored in dedicated histograms. In cases of differences, a distinction is made between objects whose energy or position are in disagremeent.When the length of data/emul collections is different, all of the objects are "stored" in the histograms dedicated to problematic objects.

Parameters
edm::Handle<l1t::JetBXCollection>&dataCol Reference to jet collection from data
edm::Handle<l1t::JetBXCollection>&emulCol Reference to jet collection from emulation
Returns
bool Flag of whether the agreement was perfect

Definition at line 350 of file L1TStage2CaloLayer2Comp.cc.

References accuSort(), BXVector< T >::begin(), currBx, SoftLeptonByDistance_cfi::distance, BXVector< T >::end(), fwrapper::jets, and BXVector< T >::size().

Referenced by produce().

353 {
354  bool eventGood = true;
355 
356  std::vector<l1t::Jet> *jets = new std::vector<l1t::Jet>;
357  std::vector<l1t::Jet>::iterator dataIt;
360 
361  if (dataCol->size(currBx) > 0) {
362  // sort data jets
363  while (true) {
364 
365  jets->emplace_back(*dataBxIt);
366 
367  dataBxIt++;
368  if (dataBxIt == dataCol->end(currBx))
369  break;
370  }
371 
372  accuSort(jets);
373  dataIt = jets->begin();
374  }
375 
376  // process jets
377  if (jets->size() != emulCol->size(currBx)) {
378  edm::LogProblem("l1tcalol2ebec")
379  << "Jet collection size difference: "
380  << "data = " << jets->size()
381  << " emul = " << emulCol->size(currBx)
382  << std::endl;
383  return false;
384  }
385 
386  if (dataIt != jets->end() ||
387  emulBxIt != emulCol->end(currBx)) {
388 
389  int nPos=0;
390  int nNeg=0;
391 
392  while(true) {
393 
394  bool posGood = true;
395  bool etGood = true;
396 
397  // object pt mismatch
398  if (dataIt->hwPt() != emulBxIt->hwPt()) {
399  etGood = false;
400  eventGood = false;
401  }
402 
403  // object position mismatch (phi)
404  if (dataIt->hwPhi() != emulBxIt->hwPhi()){
405  posGood = false;
406  }
407 
408  // object position mismatch (eta)
409  if (dataIt->hwEta() != emulBxIt->hwEta()) {
410  posGood = false;
411  }
412 
413  //bypass sorting bug
414  if(etGood && !posGood){
415  l1t::JetBxCollection::const_iterator emulItCheckSort;
416  l1t::JetBxCollection::const_iterator dataItCheckSort;
417  for(emulItCheckSort = emulCol->begin(currBx) ; emulItCheckSort != emulCol->end(currBx) ; ++emulItCheckSort) {
418  for (dataItCheckSort = jets->begin(); dataItCheckSort != jets->end(); ++dataItCheckSort){
419 
420  if(dataItCheckSort->hwEta() > 0) ++nPos;
421  if(dataItCheckSort->hwEta() < 0) ++nNeg;
422 
423  if(dataIt->hwPt() == emulItCheckSort->hwPt()
424  && dataIt->hwPhi() == emulItCheckSort->hwPhi()
425  && dataIt->hwEta() == emulItCheckSort->hwEta())
426  posGood = true;
427  }
428  }
429  }
430 
431  if(etGood && dataIt->hwEta() > 0 && ((distance(dataIt, jets->end())-nNeg) < 5))
432  posGood = true;
433  if(etGood && dataIt->hwEta() < 0 && (distance(dataIt, jets->end()) < 5))
434  posGood = true;
435 
436  if(!posGood) eventGood = false;
437 
438  // if both position and energy agree, object is good
439  if (!etGood || !posGood) {
440  edm::LogProblem("l1tcalol2ebec")
441  << "Jet Problem (data emul): "
442  << "\tEt = " << dataIt->hwPt() << " " << emulBxIt->hwPt()
443  << "\teta = " << dataIt->hwEta() << " " << emulBxIt->hwEta()
444  << "\tphi = " << dataIt->hwPhi() << " " << emulBxIt->hwPhi()
445  << std::endl;
446  }
447 
448  // increment position of pointers
449  ++dataIt;
450  ++emulBxIt;
451 
452  if (dataIt == jets->end() ||
453  emulBxIt == emulCol->end(currBx))
454  break;
455  }
456  } else {
457  if (!jets->empty() || emulCol->size(currBx) != 0)
458  return false;
459  }
460 
461  // return a boolean that states whether the jet data in the event are in
462  // agreement
463  return eventGood;
464 }
void accuSort(std::vector< l1t::Jet > *jets)
const_iterator end(int bx) const
unsigned size(int bx) const
vector< PseudoJet > jets
const_iterator begin(int bx) const
std::vector< T >::const_iterator const_iterator
Definition: BXVector.h:20
bool L1TStage2CaloLayer2Comp::compareSums ( const edm::Handle< l1t::EtSumBxCollection > &  dataCol,
const edm::Handle< l1t::EtSumBxCollection > &  emulCol 
)
private

Encapsulates the code required for performing a comparison of the taus contained in a given event.

Method is called once per each event with the sum collections associated with the event being extracted for bx = 0 as the RAW information required to run the emulator is only available for bx 0. The implementation loops over the collection and depending of the sum type, each variant is compared independently. If any disagreement is found, the event is marked a bad and the properties of the sum are stored in the data/emulator problematic histograms.

Parameters
edm::Handle<l1t::TauBXCollection>&dataCol Reference to tau collection from data
edm::Handle<l1t::TauBXCollection>&emulCol Reference to tau collection from emulation
Returns
bool Flag of whether the agreement was perfect

Definition at line 701 of file L1TStage2CaloLayer2Comp.cc.

References BXVector< T >::at(), currBx, l1t::CaloTools::emul_to_data_sum_index_map, l1t::EtSum::getType(), l1t::L1Candidate::hwPt(), mps_fire::i, BXVector< T >::isEmpty(), and BXVector< T >::size().

Referenced by produce().

704 {
705  bool eventGood = true;
706 
707  double dataEt = 0;
708  double emulEt = 0;
709 
710  // if either data or emulator collections are empty, or they have different
711  // size, mark the event as bad (this should never occur in normal running)
712  if ((dataCol->isEmpty(currBx)) || (emulCol->isEmpty(currBx)) ||
713  (dataCol->size(currBx) != emulCol->size(currBx))) {
714  edm::LogProblem("l1tcalol2ebec")
715  << "EtSum collection size difference: "
716  << "data = " << dataCol->size(currBx)
717  << " emul = " << emulCol->size(currBx)
718  << std::endl;
719 
720  return false;
721  }
722 
723  l1t::EtSum dataSum;
724  l1t::EtSum emulSum;
725  for (unsigned int i = 0; i < emulCol->size(currBx); i++) {
726 
727  emulSum = emulCol->at(currBx, i);
729 
730  if (emulSum.getType() != dataSum.getType()) {
731  edm::LogProblem("l1tcalol2ebec")
732  << "EtSum type problem (data emul): "
733  << dataSum.getType() << " " << emulSum.getType()
734  << std::endl;
735  }
736 
737  dataEt = dataSum.hwPt();
738  emulEt = emulSum.hwPt();
739 
740  if (dataEt != emulEt) {
741  eventGood = false;
742  edm::LogProblem("l1tcalol2ebec")
743  << "EtSum problem (data emul):\tType = " << emulSum.getType()
744  << "\tEt = " << dataEt << " " << emulEt
745  << std::endl;
746  }
747  }
748 
749  // return a boolean that states whether the sum data in the event are in
750  // agreement
751  return eventGood;
752 }
unsigned size(int bx) const
static const int emul_to_data_sum_index_map[31]
Definition: CaloTools.h:124
bool isEmpty(int bx) const
int hwPt() const
Definition: L1Candidate.h:48
EtSumType getType() const
Definition: EtSum.cc:37
const T & at(int bx, unsigned i) const
bool L1TStage2CaloLayer2Comp::compareTaus ( const edm::Handle< l1t::TauBxCollection > &  dataCol,
const edm::Handle< l1t::TauBxCollection > &  emulCol 
)
private

Encapsulates the code required for performing a comparison of the taus contained in a given event.

Method is called once per each event with the tau collections associated with the event being extracted for bx = 0 as the RAW information required to run the emulator is only available for bx 0. The implementation checks if the size of collections is the same and when so, compares the taus in the same positions within the data/emul collections. When a discrepancy is found, the properties (Et, eta, phi) of the problematic data/emul objects are stored in dedicated histograms. In cases of differences, a distinction is made between objects whose energy or position are in disagremeent. Another distinction is made between isolated and non-isolated tau candidates and problematic objects are handled accordingly. When the length of data/emul collections is different, all of the objects are "stored" in the histograms dedicated to problematic objects.

Parameters
edm::Handle<l1t::TauBXCollection>&dataCol Reference to tau collection from data
edm::Handle<l1t::TauBXCollection>&emulCol Reference to tau collection from emulation
Returns
bool Flag of whether the agreement was perfect

Definition at line 584 of file L1TStage2CaloLayer2Comp.cc.

References accuSort(), BXVector< T >::begin(), currBx, SoftLeptonByDistance_cfi::distance, BXVector< T >::end(), BXVector< T >::size(), and nano_cff::taus.

Referenced by produce().

587 {
588  bool eventGood = true;
589 
590  std::vector<l1t::Tau> *taus = new std::vector<l1t::Tau>;
591  std::vector<l1t::Tau>::iterator dataIt;
594 
595  if (dataCol->size(currBx) > 0) {
596  // sort data taus
597  while (true) {
598 
599  taus->emplace_back(*dataBxIt);
600 
601  dataBxIt++;
602  if (dataBxIt == dataCol->end(currBx))
603  break;
604  }
605  accuSort(taus);
606  dataIt = taus->begin();
607  }
608 
609  // check length of collections
610  if (taus->size() != emulCol->size(currBx)) {
611  edm::LogProblem("l1tcalol2ebec")
612  << "Tau collection size difference: "
613  << "data = " << taus->size()
614  << " emul = " << emulCol->size(currBx)
615  << std::endl;
616  return false;
617  }
618 
619  // processing continues only of length of data collections is the same
620  if (dataIt != taus->end() ||
621  emulBxIt != emulCol->end(currBx)) {
622 
623  int nPos=0;
624  int nNeg=0;
625 
626  while(true) {
627 
628  bool posGood = true;
629  bool etGood = true;
630 
631  // object Et mismatch
632  if (dataIt->hwPt() != emulBxIt->hwPt()) {
633  etGood = false;
634  eventGood = false;
635  }
636 
637  // object position mismatch (phi)
638  if (dataIt->hwPhi() != emulBxIt->hwPhi()) {
639  posGood = false;
640  }
641 
642  // object position mismatch (eta)
643  if (dataIt->hwEta() != emulBxIt->hwEta()) {
644  posGood = false;
645  }
646 
647  //bypass sorting bug
648  if(etGood && !posGood){
649  l1t::TauBxCollection::const_iterator emulItCheckSort;
650  l1t::TauBxCollection::const_iterator dataItCheckSort;
651  for(emulItCheckSort = emulCol->begin(currBx); emulItCheckSort != emulCol->end(currBx); ++emulItCheckSort) {
652  for (dataItCheckSort = taus->begin(); dataItCheckSort != taus->end(); ++dataItCheckSort){
653 
654  if(dataItCheckSort->hwEta() > 0) ++nPos;
655  if(dataItCheckSort->hwEta() < 0) ++nNeg;
656 
657  if(dataIt->hwPt() == emulItCheckSort->hwPt()
658  && dataIt->hwPhi() == emulItCheckSort->hwPhi()
659  && dataIt->hwEta() == emulItCheckSort->hwEta())
660  posGood = true;
661  }
662  }
663  }
664 
665  if(etGood && dataIt->hwEta() > 0 && ((distance(dataIt, taus->end())-nNeg) < 5))
666  posGood = true;
667  if(etGood && dataIt->hwEta() < 0 && (distance(dataIt, taus->end()) < 5))
668  posGood = true;
669 
670  if(!posGood) eventGood = false;
671 
672  // if both position and energy agree, object is good
673  if (!posGood || !etGood) {
674  edm::LogProblem("l1tcalol2ebec")
675  << "Tau Problem (data emul): "
676  << "\tEt = " << dataIt->hwPt() << " " << emulBxIt->hwPt()
677  << "\teta = " << dataIt->hwEta() << " " << emulBxIt->hwEta()
678  << "\tphi = " << dataIt->hwPhi() << " " << emulBxIt->hwPhi()
679  << std::endl;
680  }
681 
682  // increment position of pointers
683  ++dataIt;
684  ++emulBxIt;
685 
686  if (dataIt == taus->end() ||
687  emulBxIt == emulCol->end(currBx))
688  break;
689  }
690  } else {
691  if (!taus->empty() || emulCol->size(currBx) != 0)
692  return false;
693  }
694 
695  // return a boolean that states whether the tau data in the event are in
696  // agreement
697  return eventGood;
698 }
void accuSort(std::vector< l1t::Jet > *jets)
const_iterator end(int bx) const
unsigned size(int bx) const
const_iterator begin(int bx) const
std::vector< T >::const_iterator const_iterator
Definition: BXVector.h:20
void L1TStage2CaloLayer2Comp::dumpEventToEDM ( edm::Event e)
private

Definition at line 1031 of file L1TStage2CaloLayer2Comp.cc.

References BXVector< T >::begin(), caloTowerDataCol, caloTowerEmulCol, currBx, DEFINE_FWK_MODULE, egDataCol, egEmulCol, BXVector< T >::end(), metsig::jet, jetDataCol, jetEmulCol, eostools::move(), edm::Event::put(), sumDataCol, sumEmulCol, metsig::tau, tauDataCol, and tauEmulCol.

Referenced by produce().

1032 {
1033  // store all jets to an edm file
1034  std::unique_ptr<l1t::JetBxCollection> mpjets_data (new l1t::JetBxCollection(0, currBx, currBx));
1035  std::unique_ptr<l1t::JetBxCollection> mpjets_emul (new l1t::JetBxCollection(0, currBx, currBx));
1036 
1037  for (auto jet = jetDataCol->begin(currBx); jet != jetDataCol->end(currBx); ++jet)
1038  mpjets_data->push_back(0, (*jet));
1039  for (auto jet = jetEmulCol->begin(currBx); jet != jetEmulCol->end(currBx); ++jet)
1040  mpjets_emul->push_back(0, (*jet));
1041 
1042  e.put(std::move(mpjets_data), "dataJet");
1043  e.put(std::move(mpjets_emul), "emulJet");
1044 
1045  // store all egs to an edm file
1046  std::unique_ptr<l1t::EGammaBxCollection> mpEGammas_data (new l1t::EGammaBxCollection(0, currBx, currBx));
1047  std::unique_ptr<l1t::EGammaBxCollection> mpEGammas_emul (new l1t::EGammaBxCollection(0, currBx, currBx));
1048 
1049  for (auto eg = egDataCol->begin(currBx); eg != egDataCol->end(currBx); ++eg)
1050  mpEGammas_data->push_back(0, (*eg));
1051  for (auto eg = egEmulCol->begin(currBx); eg != egEmulCol->end(currBx); ++eg)
1052  mpEGammas_emul->push_back(0, (*eg));
1053 
1054  e.put(std::move(mpEGammas_data), "dataEg");
1055  e.put(std::move(mpEGammas_emul), "emulEg");
1056 
1057  // store all taus to an edm file
1058  std::unique_ptr<l1t::TauBxCollection> mptaus_data (new l1t::TauBxCollection(0, currBx, currBx));
1059  std::unique_ptr<l1t::TauBxCollection> mptaus_emul (new l1t::TauBxCollection(0, currBx, currBx));
1060 
1061  for (auto tau = tauDataCol->begin(currBx); tau != tauDataCol->end(currBx); ++tau)
1062  mptaus_data->push_back(0, (*tau));
1063  for (auto tau = tauEmulCol->begin(currBx); tau != tauEmulCol->end(currBx); ++tau)
1064  mptaus_emul->push_back(0, (*tau));
1065 
1066  e.put(std::move(mptaus_data), "dataTau");
1067  e.put(std::move(mptaus_emul), "emulTau");
1068 
1069  // store all sums to an edm file
1070  std::unique_ptr<l1t::EtSumBxCollection> mpsums_data (new l1t::EtSumBxCollection(0, currBx, currBx));
1071  std::unique_ptr<l1t::EtSumBxCollection> mpsums_emul (new l1t::EtSumBxCollection(0, currBx, currBx));
1072 
1073  for (auto sum = sumDataCol->begin(currBx); sum != sumDataCol->end(currBx); ++sum)
1074  mpsums_data->push_back(0, (*sum));
1075  for (auto sum = sumEmulCol->begin(currBx); sum != sumEmulCol->end(currBx); ++sum)
1076  mpsums_emul->push_back(0, (*sum));
1077 
1078  e.put(std::move(mpsums_data), "dataEtSum");
1079  e.put(std::move(mpsums_emul), "emulEtSum");
1080 
1081  // store calorimeter towers
1082  std::unique_ptr<l1t::CaloTowerBxCollection> mptowers_data (new l1t::CaloTowerBxCollection(0, currBx, currBx));
1083  std::unique_ptr<l1t::CaloTowerBxCollection> mptowers_emul (new l1t::CaloTowerBxCollection(0, currBx, currBx));
1084 
1085  for (auto tower = caloTowerDataCol->begin(currBx); tower != caloTowerDataCol->end(currBx); ++tower)
1086  mptowers_data->push_back(0, (*tower));
1087  for (auto tower = caloTowerEmulCol->begin(currBx); tower != caloTowerEmulCol->end(currBx); ++tower)
1088  mptowers_emul->push_back(0, (*tower));
1089 
1090  e.put(std::move(mptowers_data), "dataCaloTower");
1091  e.put(std::move(mptowers_emul), "emulCaloTower");
1092 }
edm::Handle< l1t::EGammaBxCollection > egDataCol
const_iterator end(int bx) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
edm::Handle< l1t::EtSumBxCollection > sumDataCol
edm::Handle< l1t::EtSumBxCollection > sumEmulCol
edm::Handle< l1t::JetBxCollection > jetDataCol
edm::Handle< l1t::TauBxCollection > tauDataCol
edm::Handle< l1t::CaloTowerBxCollection > caloTowerEmulCol
edm::Handle< l1t::EGammaBxCollection > egEmulCol
edm::Handle< l1t::TauBxCollection > tauEmulCol
edm::Handle< l1t::CaloTowerBxCollection > caloTowerDataCol
const_iterator begin(int bx) const
edm::Handle< l1t::JetBxCollection > jetEmulCol
def move(src, dest)
Definition: eostools.py:511
void L1TStage2CaloLayer2Comp::dumpEventToFile ( )
private

Definition at line 929 of file L1TStage2CaloLayer2Comp.cc.

References BXVector< T >::begin(), caloTowerDataCol, caloTowerEmulCol, currBx, dumpTowers, egDataCol, egEmulCol, BXVector< T >::end(), metsig::jet, jetDataCol, jetEmulCol, sumDataCol, sumEmulCol, metsig::tau, tauDataCol, and tauEmulCol.

Referenced by produce().

930 {
931  edm::LogProblem("l1tcalol2ebec")
932  << "==== Problems found, dumping full event contents ====" << std::endl;
933 
934  edm::LogProblem("l1tcalol2ebec")
935  << "==== Event contents in data: ====" << std::endl;
936 
937  if (dumpTowers) {
938  edm::LogProblem("l1tcalol2ebec")
939  << "==== Towers: ====" << std::endl;
940 
941  for (auto tower = caloTowerDataCol->begin(currBx); tower != caloTowerDataCol->end(currBx); ++tower)
942  edm::LogProblem("l1tcalol2ebec")
943  << "Tower: Et = " << tower->hwPt() << ", "
944  << "eta = " << tower->hwEta() << ", "
945  << "phi = " << tower->hwPhi() << std::endl;
946  }
947 
948  edm::LogProblem("l1tcalol2ebec")
949  << "==== Jets: ====" << std::endl;
950  for (auto jet = jetDataCol->begin(currBx); jet != jetDataCol->end(currBx); ++jet)
951  edm::LogProblem("l1tcalol2ebec")
952  << "Jet: Et = " << jet->hwPt() << ", "
953  << "eta = " << jet->hwEta() << ", "
954  << "phi = " << jet->hwPhi() << std::endl;
955 
956  edm::LogProblem("l1tcalol2ebec")
957  << "==== EGs: ====" << std::endl;
958  for (auto eg = egDataCol->begin(currBx); eg != egDataCol->end(currBx); ++eg)
959  edm::LogProblem("l1tcalol2ebec")
960  << "EG: Et = " << eg->hwPt() << ", "
961  << "eta = " << eg->hwEta() << ", "
962  << "phi = " << eg->hwPhi() << std::endl;
963 
964  edm::LogProblem("l1tcalol2ebec")
965  << "==== Taus: ====" << std::endl;
966  for (auto tau = tauDataCol->begin(currBx); tau != tauDataCol->end(currBx); ++tau)
967  edm::LogProblem("l1tcalol2ebec")
968  << "Tau: Et = " << tau->hwPt() << ", "
969  << "eta = " << tau->hwEta() << ", "
970  << "phi = " << tau->hwPhi() << std::endl;
971 
972  edm::LogProblem("l1tcalol2ebec")
973  << "==== Sums: ====" << std::endl;
974  for (auto sum = sumDataCol->begin(currBx); sum != sumDataCol->end(currBx); ++sum)
975  edm::LogProblem("l1tcalol2ebec")
976  << "Sum: type = " << sum->getType() << " "
977  << "Et = " << sum->hwPt() << ", "
978  << "eta = " << sum->hwEta() << ", "
979  << "phi = " << sum->hwPhi() << std::endl;
980 
981  edm::LogProblem("l1tcalol2ebec")
982  << "==== Event contents in emul: ====" << std::endl;
983 
984  if (dumpTowers) {
985  edm::LogProblem("l1tcalol2ebec")
986  << "==== Towers: ====" << std::endl;
987 
988  for (auto tower = caloTowerEmulCol->begin(currBx); tower != caloTowerEmulCol->end(currBx); ++tower)
989  edm::LogProblem("l1tcalol2ebec")
990  << "Tower: Et = " << tower->hwPt() << ", "
991  << "eta = " << tower->hwEta() << ", "
992  << "phi = " << tower->hwPhi() << std::endl;
993  }
994 
995  edm::LogProblem("l1tcalol2ebec")
996  << "==== Jets: ====" << std::endl;
997  for (auto jet = jetEmulCol->begin(currBx); jet != jetEmulCol->end(currBx); ++jet)
998  edm::LogProblem("l1tcalol2ebec")
999  << "Jet: Et = " << jet->hwPt() << ", "
1000  << "eta = " << jet->hwEta() << ", "
1001  << "phi = " << jet->hwPhi() << std::endl;
1002 
1003  edm::LogProblem("l1tcalol2ebec")
1004  << "==== EGs: ====" << std::endl;
1005  for (auto eg = egEmulCol->begin(currBx); eg != egEmulCol->end(currBx); ++eg)
1006  edm::LogProblem("l1tcalol2ebec")
1007  << "EG: Et = " << eg->hwPt() << ", "
1008  << "eta = " << eg->hwEta() << ", "
1009  << "phi = " << eg->hwPhi() << std::endl;
1010 
1011  edm::LogProblem("l1tcalol2ebec")
1012  << "==== Taus: ====" << std::endl;
1013  for (auto tau = tauEmulCol->begin(currBx); tau != tauEmulCol->end(currBx); ++tau)
1014  edm::LogProblem("l1tcalol2ebec")
1015  << "Tau: Et = " << tau->hwPt() << ", "
1016  << "eta = " << tau->hwEta() << ", "
1017  << "phi = " << tau->hwPhi() << std::endl;
1018 
1019  edm::LogProblem("l1tcalol2ebec")
1020  << "==== Sums: ====" << std::endl;
1021  for (auto sum = sumEmulCol->begin(currBx); sum != sumEmulCol->end(currBx); ++sum)
1022  edm::LogProblem("l1tcalol2ebec")
1023  << "Sum: type = " << sum->getType() << " "
1024  << "Et = " << sum->hwPt() << ", "
1025  << "eta = " << sum->hwEta() << ", "
1026  << "phi = " << sum->hwPhi() << std::endl;
1027 
1028 }
edm::Handle< l1t::EGammaBxCollection > egDataCol
const_iterator end(int bx) const
edm::Handle< l1t::EtSumBxCollection > sumDataCol
edm::Handle< l1t::EtSumBxCollection > sumEmulCol
edm::Handle< l1t::JetBxCollection > jetDataCol
edm::Handle< l1t::TauBxCollection > tauDataCol
edm::Handle< l1t::CaloTowerBxCollection > caloTowerEmulCol
edm::Handle< l1t::EGammaBxCollection > egEmulCol
edm::Handle< l1t::TauBxCollection > tauEmulCol
edm::Handle< l1t::CaloTowerBxCollection > caloTowerDataCol
const_iterator begin(int bx) const
edm::Handle< l1t::JetBxCollection > jetEmulCol
void L1TStage2CaloLayer2Comp::produce ( edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Main method where the analysis code resides, executed once for each run

The main body of the module code is contained in this method. The different object collections are extracted from the run and are passed to the respective comparison methods for processing of each object type.

Parameters
edm::Eventconst & Reference to event object
edm::EventSetupconst & Reference to event configuration object
Returns
void

Definition at line 290 of file L1TStage2CaloLayer2Comp.cc.

References calol2CaloTowerCollectionData, calol2CaloTowerCollectionEmul, calol2EGammaCollectionData, calol2EGammaCollectionEmul, calol2EtSumCollectionData, calol2EtSumCollectionEmul, calol2JetCollectionData, calol2JetCollectionEmul, calol2TauCollectionData, calol2TauCollectionEmul, caloTowerDataCol, caloTowerEmulCol, compareEGs(), compareJets(), compareSums(), compareTaus(), dumpEventToEDM(), dumpEventToFile(), dumpWholeEvent, egDataCol, egEmulCol, edm::Event::getByToken(), edm::EventBase::id(), jetDataCol, jetEmulCol, BXVector< T >::size(), sumDataCol, sumEmulCol, tauDataCol, and tauEmulCol.

292  {
293 
294  bool eventGood = true;
295 
296  // map event contents to above collections
307 
308  edm::LogProblem("l1tcalol2ebec")
309  << "Processing event " << e.id() << std::endl;
310 
311  if(caloTowerDataCol->size()==0){
312  edm::LogProblem("l1tcalol2ebec")
313  << "Empty caloTowers. Skipping event " << std::endl;
314  return;
315  }
316 
318  eventGood = false;
319  }
320 
321  if (!compareEGs(egDataCol, egEmulCol)) {
322  eventGood = false;
323  }
324 
326  eventGood = false;
327  }
328 
330  eventGood = false;
331  }
332 
333  if (!eventGood) {
334 
335  if (dumpWholeEvent) {
336  // store all contents of event to log file
337  dumpEventToFile();
338  }
339 
340  // store all contents of event to edm file:
341  dumpEventToEDM(e);
342 
343  edm::LogProblem("l1tcalol2ebec")
344  << "Bad event! " << std::endl;
345 
346  }
347 }
edm::Handle< l1t::EGammaBxCollection > egDataCol
unsigned size(int bx) const
bool compareSums(const edm::Handle< l1t::EtSumBxCollection > &dataCol, const edm::Handle< l1t::EtSumBxCollection > &emulCol)
edm::Handle< l1t::EtSumBxCollection > sumDataCol
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool compareJets(const edm::Handle< l1t::JetBxCollection > &dataCol, const edm::Handle< l1t::JetBxCollection > &emulCol)
edm::Handle< l1t::EtSumBxCollection > sumEmulCol
edm::EDGetToken calol2EGammaCollectionEmul
edm::Handle< l1t::JetBxCollection > jetDataCol
edm::Handle< l1t::TauBxCollection > tauDataCol
edm::Handle< l1t::CaloTowerBxCollection > caloTowerEmulCol
edm::EDGetToken calol2EGammaCollectionData
edm::Handle< l1t::EGammaBxCollection > egEmulCol
bool compareEGs(const edm::Handle< l1t::EGammaBxCollection > &dataCol, const edm::Handle< l1t::EGammaBxCollection > &emulCol)
edm::EDGetToken calol2CaloTowerCollectionData
edm::EventID id() const
Definition: EventBase.h:59
edm::EDGetToken calol2CaloTowerCollectionEmul
edm::Handle< l1t::TauBxCollection > tauEmulCol
edm::Handle< l1t::CaloTowerBxCollection > caloTowerDataCol
edm::Handle< l1t::JetBxCollection > jetEmulCol
bool compareTaus(const edm::Handle< l1t::TauBxCollection > &dataCol, const edm::Handle< l1t::TauBxCollection > &emulCol)

Member Data Documentation

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2CaloTowerCollectionData
private

Definition at line 222 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2CaloTowerCollectionEmul
private

Definition at line 223 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2EGammaCollectionData
private

Definition at line 216 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2EGammaCollectionEmul
private

Definition at line 217 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2EtSumCollectionData
private

Definition at line 220 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2EtSumCollectionEmul
private

Definition at line 221 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2JetCollectionData
private

Definition at line 214 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2JetCollectionEmul
private

Definition at line 215 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2TauCollectionData
private

Definition at line 218 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::EDGetToken L1TStage2CaloLayer2Comp::calol2TauCollectionEmul
private

Definition at line 219 of file L1TStage2CaloLayer2Comp.cc.

Referenced by produce().

edm::Handle<l1t::CaloTowerBxCollection> L1TStage2CaloLayer2Comp::caloTowerDataCol
private

Definition at line 234 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::CaloTowerBxCollection> L1TStage2CaloLayer2Comp::caloTowerEmulCol
private

Definition at line 235 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

const unsigned int L1TStage2CaloLayer2Comp::currBx = 0
private
bool L1TStage2CaloLayer2Comp::dumpTowers = false
private

Definition at line 239 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToFile(), and L1TStage2CaloLayer2Comp().

bool L1TStage2CaloLayer2Comp::dumpWholeEvent = false
private

Definition at line 240 of file L1TStage2CaloLayer2Comp.cc.

Referenced by L1TStage2CaloLayer2Comp(), and produce().

edm::Handle<l1t::EGammaBxCollection> L1TStage2CaloLayer2Comp::egDataCol
private

Definition at line 228 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::EGammaBxCollection> L1TStage2CaloLayer2Comp::egEmulCol
private

Definition at line 229 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::JetBxCollection> L1TStage2CaloLayer2Comp::jetDataCol
private

Definition at line 226 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::JetBxCollection> L1TStage2CaloLayer2Comp::jetEmulCol
private

Definition at line 227 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::EtSumBxCollection> L1TStage2CaloLayer2Comp::sumDataCol
private

Definition at line 232 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::EtSumBxCollection> L1TStage2CaloLayer2Comp::sumEmulCol
private

Definition at line 233 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::TauBxCollection> L1TStage2CaloLayer2Comp::tauDataCol
private

Definition at line 230 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().

edm::Handle<l1t::TauBxCollection> L1TStage2CaloLayer2Comp::tauEmulCol
private

Definition at line 231 of file L1TStage2CaloLayer2Comp.cc.

Referenced by dumpEventToEDM(), dumpEventToFile(), and produce().