CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DumpScObjects Class Reference
Inheritance diagram for DumpScObjects:
edm::stream::EDAnalyzer<> edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 DumpScObjects (const edm::ParameterSet &)
 
 ~DumpScObjects () override
 
- Public Member Functions inherited from edm::stream::EDAnalyzer<>
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
 EDAnalyzerBase (const EDAnalyzerBase &)=delete
 
ModuleDescription const & moduleDescription () const
 
const EDAnalyzerBaseoperator= (const EDAnalyzerBase &)=delete
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void printBx (unsigned bx)
 

Private Attributes

edm::EDGetTokenT< EGammaOrbitCollectioncaloEGammasToken_
 
edm::EDGetTokenT< BxSumsOrbitCollectioncaloEtSumsToken_
 
edm::EDGetTokenT< JetOrbitCollectioncaloJetsToken_
 
edm::EDGetTokenT< TauOrbitCollectioncaloTausToken_
 
bool checkEGammas_
 
bool checkEtSums_
 
bool checkJets_
 
bool checkMuons_
 
bool checkTaus_
 
edm::Handle< EGammaOrbitCollectioneGammaHandle_
 
edm::Handle< BxSumsOrbitCollectionetSumHandle_
 
edm::EDGetTokenT< MuonOrbitCollectiongmtMuonsToken_
 
edm::Handle< JetOrbitCollectionjetHandle_
 
unsigned maxBx_
 
unsigned minBx_
 
edm::Handle< MuonOrbitCollectionmuonHandle_
 
unsigned orbitNum_
 
bool searchEvent_
 
unsigned searchStartBx_
 
unsigned searchStopBx_
 
bool skipEmptyBx_
 
edm::Handle< TauOrbitCollectiontauHandle_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 28 of file DumpScObjects.cc.

Constructor & Destructor Documentation

◆ DumpScObjects()

DumpScObjects::DumpScObjects ( const edm::ParameterSet iConfig)
explicit

Definition at line 78 of file DumpScObjects.cc.

References caloEGammasToken_, caloEtSumsToken_, caloJetsToken_, caloTausToken_, checkEGammas_, checkEtSums_, checkJets_, checkMuons_, checkTaus_, edm::ParameterSet::getParameter(), and gmtMuonsToken_.

79  : minBx_(iConfig.getUntrackedParameter<unsigned>("minBx", 0)),
80  maxBx_(iConfig.getUntrackedParameter<unsigned>("maxBx", 3564)),
81 
82  checkMuons_(iConfig.getUntrackedParameter<bool>("checkMuons", true)),
83  checkJets_(iConfig.getUntrackedParameter<bool>("checkJets", true)),
84  checkEGammas_(iConfig.getUntrackedParameter<bool>("checkEGammas", true)),
85  checkTaus_(iConfig.getUntrackedParameter<bool>("checkTaus", true)),
86  checkEtSums_(iConfig.getUntrackedParameter<bool>("checkEtSums", true)),
87 
88  searchEvent_(iConfig.getUntrackedParameter<bool>("searchEvent", false)),
89  orbitNum_(iConfig.getUntrackedParameter<unsigned>("orbitNumber", 0)),
90  searchStartBx_(iConfig.getUntrackedParameter<unsigned>("searchStartBx", 0)),
91  searchStopBx_(iConfig.getUntrackedParameter<unsigned>("searchStopBx", 0)),
92 
93  skipEmptyBx_(iConfig.getUntrackedParameter<bool>("skipEmptyBx", true)) {
94  if (checkMuons_)
95  gmtMuonsToken_ = consumes<MuonOrbitCollection>(iConfig.getParameter<edm::InputTag>("gmtMuonsTag"));
96  if (checkJets_)
97  caloJetsToken_ = consumes<JetOrbitCollection>(iConfig.getParameter<edm::InputTag>("caloJetsTag"));
98  if (checkEGammas_)
99  caloEGammasToken_ = consumes<EGammaOrbitCollection>(iConfig.getParameter<edm::InputTag>("caloEGammasTag"));
100  if (checkTaus_)
101  caloTausToken_ = consumes<TauOrbitCollection>(iConfig.getParameter<edm::InputTag>("caloTausTag"));
102  if (checkEtSums_)
103  caloEtSumsToken_ = consumes<BxSumsOrbitCollection>(iConfig.getParameter<edm::InputTag>("caloEtSumsTag"));
104 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
unsigned searchStartBx_
edm::EDGetTokenT< MuonOrbitCollection > gmtMuonsToken_
edm::EDGetTokenT< EGammaOrbitCollection > caloEGammasToken_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< TauOrbitCollection > caloTausToken_
edm::EDGetTokenT< JetOrbitCollection > caloJetsToken_
unsigned searchStopBx_
edm::EDGetTokenT< BxSumsOrbitCollection > caloEtSumsToken_
unsigned maxBx_
unsigned minBx_
unsigned orbitNum_

◆ ~DumpScObjects()

DumpScObjects::~DumpScObjects ( )
inlineoverride

Definition at line 32 of file DumpScObjects.cc.

32 {}

Member Function Documentation

◆ analyze()

void DumpScObjects::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
overridevirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 108 of file DumpScObjects.cc.

References nano_mu_digi_cff::bx, caloEGammasToken_, caloEtSumsToken_, caloJetsToken_, caloTausToken_, checkEGammas_, checkEtSums_, checkJets_, checkMuons_, checkTaus_, eGammaHandle_, etSumHandle_, OrbitCollection< T >::getFilledBxs(), gmtMuonsToken_, iEvent, jetHandle_, maxBx_, minBx_, muonHandle_, orbitNum_, printBx(), searchEvent_, searchStartBx_, searchStopBx_, skipEmptyBx_, and tauHandle_.

108  {
109  if (checkMuons_)
110  iEvent.getByToken(gmtMuonsToken_, muonHandle_);
111  if (checkJets_)
112  iEvent.getByToken(caloJetsToken_, jetHandle_);
113  if (checkEGammas_)
115  if (checkTaus_)
116  iEvent.getByToken(caloTausToken_, tauHandle_);
117  if (checkEtSums_)
118  iEvent.getByToken(caloEtSumsToken_, etSumHandle_);
119 
120  // get the orbit number
121  unsigned currOrbit = iEvent.id().event();
122 
123  // if we are looking for a specific orbit
124  if (searchEvent_) {
125  if (currOrbit != orbitNum_)
126  return;
127 
128  // found the orbit
129  for (unsigned bx = searchStartBx_; bx <= searchStopBx_; bx++) {
130  printBx(bx);
131  }
132  } else {
133  if (skipEmptyBx_) {
134  // create a set of non empty BXs
135  std::set<unsigned> uniqueBx;
136 
137  if (checkMuons_) {
138  for (const unsigned& bx : muonHandle_->getFilledBxs()) {
139  if ((bx >= minBx_) || (bx <= maxBx_))
140  uniqueBx.insert(bx);
141  }
142  }
143  if (checkJets_) {
144  for (const unsigned& bx : jetHandle_->getFilledBxs()) {
145  if ((bx >= minBx_) || (bx <= maxBx_))
146  uniqueBx.insert(bx);
147  }
148  }
149  if (checkEGammas_) {
150  for (const unsigned& bx : eGammaHandle_->getFilledBxs()) {
151  if ((bx >= minBx_) || (bx <= maxBx_))
152  uniqueBx.insert(bx);
153  }
154  }
155  if (checkTaus_) {
156  for (const unsigned& bx : tauHandle_->getFilledBxs()) {
157  if ((bx >= minBx_) || (bx <= maxBx_))
158  uniqueBx.insert(bx);
159  }
160  }
161  if (checkEtSums_) {
162  for (const unsigned& bx : etSumHandle_->getFilledBxs()) {
163  if ((bx >= minBx_) || (bx <= maxBx_))
164  uniqueBx.insert(bx);
165  }
166  }
167 
168  // process bx
169  for (const unsigned& bx : uniqueBx) {
170  printBx(bx);
171  }
172 
173  } else {
174  // dump all objects
175  for (unsigned bx = minBx_; bx <= maxBx_; bx++) {
176  printBx(bx);
177  }
178  }
179  }
180 }
std::vector< unsigned > getFilledBxs() const
edm::Handle< EGammaOrbitCollection > eGammaHandle_
void printBx(unsigned bx)
unsigned searchStartBx_
edm::EDGetTokenT< MuonOrbitCollection > gmtMuonsToken_
edm::EDGetTokenT< EGammaOrbitCollection > caloEGammasToken_
edm::EDGetTokenT< TauOrbitCollection > caloTausToken_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< JetOrbitCollection > caloJetsToken_
edm::Handle< JetOrbitCollection > jetHandle_
unsigned searchStopBx_
edm::EDGetTokenT< BxSumsOrbitCollection > caloEtSumsToken_
unsigned maxBx_
edm::Handle< BxSumsOrbitCollection > etSumHandle_
unsigned minBx_
unsigned orbitNum_
edm::Handle< TauOrbitCollection > tauHandle_
edm::Handle< MuonOrbitCollection > muonHandle_

◆ printBx()

void DumpScObjects::printBx ( unsigned  bx)
private

Definition at line 183 of file DumpScObjects.cc.

References nano_mu_digi_cff::bx, OrbitCollection< T >::bxIterator(), checkEGammas_, checkEtSums_, checkJets_, checkMuons_, checkTaus_, gather_cfg::cout, eGammaHandle_, etSumHandle_, mps_fire::i, edm::HandleBase::isValid(), metsig::jet, jetHandle_, PDWG_EXODelayedJetMET_cff::jets, muonHandle_, DiMuonV_cfg::muons, l1ScoutingRun3::printBxSums(), l1ScoutingRun3::printEGamma(), l1ScoutingRun3::printJet(), l1ScoutingRun3::printMuon(), l1ScoutingRun3::printTau(), tauHandle_, and Tau3MuMonitor_cff::taus.

Referenced by analyze().

183  {
184  std::cout << "BX = " << bx << " ****" << std::endl;
185 
186  if (checkMuons_ && muonHandle_.isValid()) {
187  int i = 0;
188  const auto& muons = muonHandle_->bxIterator(bx);
189  for (const auto& muon : muons) {
190  std::cout << "--- Muon " << i << " ---\n";
191  printMuon(muon);
192  i++;
193  }
194  }
195 
196  if (checkJets_ && jetHandle_.isValid()) {
197  int i = 0;
198  const auto& jets = jetHandle_->bxIterator(bx);
199  for (const auto& jet : jets) {
200  std::cout << "--- Jet " << i << " ---\n";
201  printJet(jet);
202  i++;
203  }
204  }
205 
206  if (checkEGammas_ && jetHandle_.isValid()) {
207  int i = 0;
208  const auto& eGammas = eGammaHandle_->bxIterator(bx);
209  for (const auto& egamma : eGammas) {
210  std::cout << "--- E/Gamma " << i << " ---\n";
212  i++;
213  }
214  }
215 
216  if (checkTaus_ && tauHandle_.isValid()) {
217  int i = 0;
218  const auto& taus = tauHandle_->bxIterator(bx);
219  for (const auto& tau : taus) {
220  std::cout << "--- Tau " << i << " ---\n";
221  printTau(tau);
222  i++;
223  }
224  }
225 
226  if (checkEtSums_ && etSumHandle_.isValid()) {
227  const auto& sums = etSumHandle_->bxIterator(bx);
228  for (const auto& sum : sums) {
229  std::cout << "--- Calo Sums ---\n";
230  printBxSums(sum);
231  }
232  }
233 }
edm::Handle< EGammaOrbitCollection > eGammaHandle_
void printMuon(const Muon &muon, std::ostream &outs=std::cout)
void printJet(const Jet &jet, std::ostream &outs=std::cout)
void printEGamma(const EGamma &eGamma, std::ostream &outs=std::cout)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
void printBxSums(const BxSums &sums, std::ostream &outs=std::cout)
edm::Span< const_iterator > bxIterator(unsigned bx) const
edm::Handle< JetOrbitCollection > jetHandle_
void printTau(const Tau &tau, std::ostream &outs=std::cout)
bool isValid() const
Definition: HandleBase.h:70
edm::Handle< BxSumsOrbitCollection > etSumHandle_
edm::Handle< TauOrbitCollection > tauHandle_
edm::Handle< MuonOrbitCollection > muonHandle_

Member Data Documentation

◆ caloEGammasToken_

edm::EDGetTokenT<EGammaOrbitCollection> DumpScObjects::caloEGammasToken_
private

Definition at line 44 of file DumpScObjects.cc.

Referenced by analyze(), and DumpScObjects().

◆ caloEtSumsToken_

edm::EDGetTokenT<BxSumsOrbitCollection> DumpScObjects::caloEtSumsToken_
private

Definition at line 46 of file DumpScObjects.cc.

Referenced by analyze(), and DumpScObjects().

◆ caloJetsToken_

edm::EDGetTokenT<JetOrbitCollection> DumpScObjects::caloJetsToken_
private

Definition at line 43 of file DumpScObjects.cc.

Referenced by analyze(), and DumpScObjects().

◆ caloTausToken_

edm::EDGetTokenT<TauOrbitCollection> DumpScObjects::caloTausToken_
private

Definition at line 45 of file DumpScObjects.cc.

Referenced by analyze(), and DumpScObjects().

◆ checkEGammas_

bool DumpScObjects::checkEGammas_
private

Definition at line 61 of file DumpScObjects.cc.

Referenced by analyze(), DumpScObjects(), and printBx().

◆ checkEtSums_

bool DumpScObjects::checkEtSums_
private

Definition at line 63 of file DumpScObjects.cc.

Referenced by analyze(), DumpScObjects(), and printBx().

◆ checkJets_

bool DumpScObjects::checkJets_
private

Definition at line 60 of file DumpScObjects.cc.

Referenced by analyze(), DumpScObjects(), and printBx().

◆ checkMuons_

bool DumpScObjects::checkMuons_
private

Definition at line 59 of file DumpScObjects.cc.

Referenced by analyze(), DumpScObjects(), and printBx().

◆ checkTaus_

bool DumpScObjects::checkTaus_
private

Definition at line 62 of file DumpScObjects.cc.

Referenced by analyze(), DumpScObjects(), and printBx().

◆ eGammaHandle_

edm::Handle<EGammaOrbitCollection> DumpScObjects::eGammaHandle_
private

Definition at line 50 of file DumpScObjects.cc.

Referenced by analyze(), and printBx().

◆ etSumHandle_

edm::Handle<BxSumsOrbitCollection> DumpScObjects::etSumHandle_
private

Definition at line 52 of file DumpScObjects.cc.

Referenced by analyze(), and printBx().

◆ gmtMuonsToken_

edm::EDGetTokenT<MuonOrbitCollection> DumpScObjects::gmtMuonsToken_
private

Definition at line 42 of file DumpScObjects.cc.

Referenced by analyze(), and DumpScObjects().

◆ jetHandle_

edm::Handle<JetOrbitCollection> DumpScObjects::jetHandle_
private

Definition at line 49 of file DumpScObjects.cc.

Referenced by analyze(), and printBx().

◆ maxBx_

unsigned DumpScObjects::maxBx_
private

Definition at line 56 of file DumpScObjects.cc.

Referenced by analyze().

◆ minBx_

unsigned DumpScObjects::minBx_
private

Definition at line 55 of file DumpScObjects.cc.

Referenced by analyze().

◆ muonHandle_

edm::Handle<MuonOrbitCollection> DumpScObjects::muonHandle_
private

Definition at line 48 of file DumpScObjects.cc.

Referenced by analyze(), and printBx().

◆ orbitNum_

unsigned DumpScObjects::orbitNum_
private

Definition at line 67 of file DumpScObjects.cc.

Referenced by analyze().

◆ searchEvent_

bool DumpScObjects::searchEvent_
private

Definition at line 66 of file DumpScObjects.cc.

Referenced by analyze().

◆ searchStartBx_

unsigned DumpScObjects::searchStartBx_
private

Definition at line 68 of file DumpScObjects.cc.

Referenced by analyze().

◆ searchStopBx_

unsigned DumpScObjects::searchStopBx_
private

Definition at line 69 of file DumpScObjects.cc.

Referenced by analyze().

◆ skipEmptyBx_

bool DumpScObjects::skipEmptyBx_
private

Definition at line 72 of file DumpScObjects.cc.

Referenced by analyze().

◆ tauHandle_

edm::Handle<TauOrbitCollection> DumpScObjects::tauHandle_
private

Definition at line 51 of file DumpScObjects.cc.

Referenced by analyze(), and printBx().