CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
GEMPackingTester Class Reference
Inheritance diagram for GEMPackingTester:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 GEMPackingTester (const edm::ParameterSet &)
 
 ~GEMPackingTester () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

int b_ge0
 
int b_ge1
 
int b_ge2
 
edm::EDGetTokenT< FEDRawDataCollectionfedToken_
 
edm::EDGetTokenT< GEMDigiCollectiongemDigiToken_
 
edm::EDGetTokenT< GEMDigiCollectiongemSimDigiToken_
 
bool readMultiBX_
 
TTree * tree_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 21 of file GEMPackingTester.cc.

Constructor & Destructor Documentation

◆ GEMPackingTester()

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

Definition at line 42 of file GEMPackingTester.cc.

References b_ge0, b_ge1, b_ge2, make_classfiles::fs, and tree_.

43  : fedToken_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("fed"))),
44  gemDigiToken_(consumes<GEMDigiCollection>(iConfig.getParameter<edm::InputTag>("gemDigi"))),
45  gemSimDigiToken_(consumes<GEMDigiCollection>(iConfig.getParameter<edm::InputTag>("gemSimDigi"))),
46  readMultiBX_(iConfig.getParameter<bool>("readMultiBX")) {
47  usesResource("TFileService");
49  tree_ = fs->make<TTree>("fed", "fed");
50  tree_->Branch("ge0", &b_ge0, "ge0/I");
51  tree_->Branch("ge1", &b_ge1, "ge1/I");
52  tree_->Branch("ge2", &b_ge2, "ge2/I");
53 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< GEMDigiCollection > gemDigiToken_
edm::EDGetTokenT< FEDRawDataCollection > fedToken_
edm::EDGetTokenT< GEMDigiCollection > gemSimDigiToken_

◆ ~GEMPackingTester()

GEMPackingTester::~GEMPackingTester ( )
override

Definition at line 55 of file GEMPackingTester.cc.

55 {}

Member Function Documentation

◆ analyze()

void GEMPackingTester::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 57 of file GEMPackingTester.cc.

References b_ge0, b_ge1, b_ge2, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedToken_, gemDigiToken_, gemSimDigiToken_, iEvent, FEDNumbering::MAXGEMFEDID, FEDNumbering::MINGEMFEDID, or, readMultiBX_, FEDRawData::size(), and tree_.

57  {
58  using namespace edm;
59 
60  b_ge0 = 0;
61  b_ge1 = 0;
62  b_ge2 = 0;
63 
64  auto const& fed_buffers = iEvent.get(fedToken_);
65 
67  const FEDRawData& fedData = fed_buffers.FEDData(fedId);
68 
69  if (fedId == 1473 or fedId == 1474)
70  b_ge0 += fedData.size();
71  if (fedId == 1467 or fedId == 1468)
72  b_ge1 += fedData.size();
73  if (fedId == 1469 or fedId == 1470)
74  b_ge2 += fedData.size();
75  }
76 
77  auto const& gemDigis = iEvent.get(gemDigiToken_);
78  auto const& gemSimDigis = iEvent.get(gemSimDigiToken_);
79 
80  for (auto const& simDigi : gemSimDigis) {
81  const GEMDetId& gemId = simDigi.first;
82  const GEMDigiCollection::Range& sim = simDigi.second;
83  const GEMDigiCollection::Range& packed = gemDigis.get(gemId);
84 
85  for (auto digi = sim.first; digi != sim.second; ++digi) {
86  if (!readMultiBX_ && digi->bx() != 0)
87  continue;
88 
89  bool foundDigi = false;
90  for (auto unpackeddigi = packed.first; unpackeddigi != packed.second; ++unpackeddigi) {
91  if ((digi->strip() == unpackeddigi->strip()) && (digi->bx() == unpackeddigi->bx()))
92  foundDigi = true;
93  }
94  if (!foundDigi) {
95  edm::LogInfo("GEMPackingTester") << "simMuonGEMDigi NOT found " << gemId << " " << digi->strip() << " "
96  << digi->bx();
97  for (auto unpackeddigi = packed.first; unpackeddigi != packed.second; ++unpackeddigi) {
98  edm::LogInfo("GEMPackingTester") << "rec " << unpackeddigi->strip() << " " << unpackeddigi->bx();
99  }
100  }
101  }
102  }
103 
104  tree_->Fill();
105 }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
edm::EDGetTokenT< GEMDigiCollection > gemDigiToken_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< FEDRawDataCollection > fedToken_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::EDGetTokenT< GEMDigiCollection > gemSimDigiToken_
Log< level::Info, false > LogInfo
std::pair< const_iterator, const_iterator > Range
HLT enums.

◆ beginJob()

void GEMPackingTester::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 107 of file GEMPackingTester.cc.

107 {}

◆ endJob()

void GEMPackingTester::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 109 of file GEMPackingTester.cc.

109 {}

◆ fillDescriptions()

void GEMPackingTester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 111 of file GEMPackingTester.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

111  {
113  desc.add<edm::InputTag>("fed", edm::InputTag("rawDataCollector"));
114  desc.add<edm::InputTag>("gemDigi", edm::InputTag("muonGEMDigis"));
115  desc.add<edm::InputTag>("gemSimDigi", edm::InputTag("simMuonGEMDigis"));
116  desc.add<bool>("readMultiBX", false);
117  descriptions.add("GEMPackingTester", desc);
118 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ b_ge0

int GEMPackingTester::b_ge0
private

Definition at line 39 of file GEMPackingTester.cc.

Referenced by analyze(), and GEMPackingTester().

◆ b_ge1

int GEMPackingTester::b_ge1
private

Definition at line 39 of file GEMPackingTester.cc.

Referenced by analyze(), and GEMPackingTester().

◆ b_ge2

int GEMPackingTester::b_ge2
private

Definition at line 39 of file GEMPackingTester.cc.

Referenced by analyze(), and GEMPackingTester().

◆ fedToken_

edm::EDGetTokenT<FEDRawDataCollection> GEMPackingTester::fedToken_
private

Definition at line 33 of file GEMPackingTester.cc.

Referenced by analyze().

◆ gemDigiToken_

edm::EDGetTokenT<GEMDigiCollection> GEMPackingTester::gemDigiToken_
private

Definition at line 34 of file GEMPackingTester.cc.

Referenced by analyze().

◆ gemSimDigiToken_

edm::EDGetTokenT<GEMDigiCollection> GEMPackingTester::gemSimDigiToken_
private

Definition at line 35 of file GEMPackingTester.cc.

Referenced by analyze().

◆ readMultiBX_

bool GEMPackingTester::readMultiBX_
private

Definition at line 36 of file GEMPackingTester.cc.

Referenced by analyze().

◆ tree_

TTree* GEMPackingTester::tree_
private

Definition at line 38 of file GEMPackingTester.cc.

Referenced by analyze(), and GEMPackingTester().