Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimGeneral/Debugging: add MTD to the digi dump #30441

Merged
merged 1 commit into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions SimGeneral/Debugging/test/SimDigiDumper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ SimDigiDumper::SimDigiDumper(const edm::ParameterSet& iPSet) {
MuCSCStripSrc_ = consumes<CSCStripDigiCollection>(iPSet.getParameter<edm::InputTag>("MuCSCStripSrc"));
MuCSCWireSrc_ = consumes<CSCWireDigiCollection>(iPSet.getParameter<edm::InputTag>("MuCSCWireSrc"));
MuRPCSrc_ = consumes<RPCDigiCollection>(iPSet.getParameter<edm::InputTag>("MuRPCSrc"));
BTLSrc_ = consumes<BTLDigiCollection>(iPSet.getParameter<edm::InputTag>("BTLSrc"));
ETLSrc_ = consumes<ETLDigiCollection>(iPSet.getParameter<edm::InputTag>("ETLSrc"));

// TODO(proper responsible): update the cout, for sure not my
// business.
Expand Down Expand Up @@ -148,6 +150,52 @@ void SimDigiDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe
}
}

// BTL
bool isBTL = true;
edm::Handle<BTLDigiCollection> BTLDigi;
const BTLDigiCollection* BTLdigis = 0;
iEvent.getByToken(BTLSrc_, BTLDigi);
if (!BTLDigi.isValid()) {
std::cout << "Unable to find BTLDigi in event!" << std::endl;
} else {
BTLdigis = BTLDigi.product();
if (BTLDigi->size() == 0)
isBTL = false;
std::cout << "Barrel Timing Layer, digi multiplicity = " << BTLDigi->size() << std::endl;

if (isBTL) {
// loop over digis
for (unsigned int digis = 0; digis < BTLDigi->size(); ++digis) {
BTLDataFrame btldf = (*BTLdigis)[digis];
std::cout << btldf.id().rawId() << std::endl;
btldf.print();
}
}
}

// ETL
bool isETL = true;
edm::Handle<ETLDigiCollection> ETLDigi;
const ETLDigiCollection* ETLdigis = 0;
iEvent.getByToken(ETLSrc_, ETLDigi);
if (!ETLDigi.isValid()) {
std::cout << "Unable to find ETLDigi in event!" << std::endl;
} else {
ETLdigis = ETLDigi.product();
if (ETLDigi->size() == 0)
isETL = false;
std::cout << "Endcap Timing Layer, digi multiplicity = " << ETLDigi->size() << std::endl;

if (isETL) {
// loop over digis
for (unsigned int digis = 0; digis < ETLDigi->size(); ++digis) {
ETLDataFrame etldf = (*ETLdigis)[digis];
std::cout << etldf.id().rawId() << std::endl;
etldf.print();
}
}
}

// HBHE
bool isHBHE = true;
edm::Handle<HBHEDigiCollection> hbhe;
Expand Down
5 changes: 5 additions & 0 deletions SimGeneral/Debugging/test/SimDigiDumper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
// muon RPC info
#include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
// BTL/ETL info
#include "DataFormats/FTLDigi/interface/FTLDigiCollections.h"

#include <vector>

Expand All @@ -43,6 +45,9 @@ class SimDigiDumper : public edm::EDAnalyzer {
edm::EDGetTokenT<EEDigiCollection> ECalEESrc_;
edm::EDGetTokenT<ESDigiCollection> ECalESSrc_;

edm::EDGetTokenT<BTLDigiCollection> BTLSrc_;
edm::EDGetTokenT<ETLDigiCollection> ETLSrc_;

edm::EDGetTokenT<HBHEDigiCollection> HCalDigi_;
edm::EDGetTokenT<HODigiCollection> HCalHODigi_;
edm::EDGetTokenT<HFDigiCollection> HCalHFDigi_;
Expand Down
6 changes: 4 additions & 2 deletions SimGeneral/Debugging/test/runSimDigiDumper_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
MuCSCStripSrc = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"),
MuDTSrc = cms.InputTag("simMuonDTDigis"),
HCalDigi = cms.InputTag("simHcalDigis"),
ZdcDigi = cms.InputTag("simHcalUnsuppressedDigis"),
ZdcDigi = cms.InputTag("simHcalUnsuppressedDigis"),
MuCSCWireSrc = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"),
ECalEESrc = cms.InputTag("simEcalDigis","eeDigis"),
SiStripSrc = cms.InputTag("simSiStripDigis","ZeroSuppressed"),
SiPxlSrc = cms.InputTag("simSiPixelDigis"),
ECalEBSrc = cms.InputTag("simEcalDigis","ebDigis"),
ECalESSrc = cms.InputTag("simEcalPreshowerDigis"),
MuRPCSrc = cms.InputTag("simMuonRPCDigis")
MuRPCSrc = cms.InputTag("simMuonRPCDigis"),
BTLSrc = cms.InputTag("mix","FTLBarrel"),
ETLSrc = cms.InputTag("mix","FTLEndcap"),
)

process.p1 = cms.Path(process.prod)
Expand Down