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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const 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
 
bool wantsStreamRuns () const
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

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.

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 }

References b_ge0, b_ge1, b_ge2, TFileService::make(), and tree_.

◆ ~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.

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 }

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_.

◆ 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.

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 }

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

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().

FEDNumbering::MAXGEMFEDID
Definition: FEDNumbering.h:126
GEMPackingTester::gemSimDigiToken_
edm::EDGetTokenT< GEMDigiCollection > gemSimDigiToken_
Definition: GEMPackingTester.cc:35
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
FEDRawData
Definition: FEDRawData.h:19
GEMPackingTester::tree_
TTree * tree_
Definition: GEMPackingTester.cc:38
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
sim
Definition: GeometryProducer.h:20
GEMDetId
Definition: GEMDetId.h:18
edm::Service< TFileService >
iEvent
int iEvent
Definition: GenABIO.cc:224
GEMPackingTester::b_ge0
int b_ge0
Definition: GEMPackingTester.cc:39
GEMPackingTester::readMultiBX_
bool readMultiBX_
Definition: GEMPackingTester.cc:36
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
GEMPackingTester::b_ge1
int b_ge1
Definition: GEMPackingTester.cc:39
TFileService::make
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
GEMPackingTester::b_ge2
int b_ge2
Definition: GEMPackingTester.cc:39
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
or
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
FEDNumbering::MINGEMFEDID
Definition: FEDNumbering.h:123
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GEMPackingTester::gemDigiToken_
edm::EDGetTokenT< GEMDigiCollection > gemDigiToken_
Definition: GEMPackingTester.cc:34
edm::InputTag
Definition: InputTag.h:15
GEMPackingTester::fedToken_
edm::EDGetTokenT< FEDRawDataCollection > fedToken_
Definition: GEMPackingTester.cc:33