Skip to content

Commit

Permalink
Merge pull request #30441 from fabiocos/fc-digidebug
Browse files Browse the repository at this point in the history
SimGeneral/Debugging: add MTD to the digi dump
  • Loading branch information
cmsbuild authored Jun 29, 2020
2 parents 518b6ef + df6536e commit 841eb9a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
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

0 comments on commit 841eb9a

Please sign in to comment.