-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ZDCPacker files: ZDCPacker.cc and ZDCPacker.h Updated GTSetup.cc, GTTokens.cc and CommonTokens.h to work with ZDC Packer. Updated gtStage2Raw_cfi.py to include ZDCPacker info. Added test_RawToDigiToRawToDigi_GT.py to test the new ZDC Packer
- Loading branch information
Showing
7 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
EventFilter/L1TRawToDigi/plugins/implementations_stage2/ZDCPacker.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "EventFilter/L1TRawToDigi/plugins/PackerFactory.h" | ||
|
||
#include "CaloTokens.h" | ||
|
||
#include "L1TStage2Layer2Constants.h" | ||
#include "ZDCPacker.h" | ||
#include "GTSetup.h" | ||
|
||
namespace l1t { | ||
namespace stage2 { | ||
Blocks ZDCPacker::pack(const edm::Event& event, const PackerTokens* toks) { | ||
edm::Handle<EtSumBxCollection> ZDCSums; | ||
event.getByToken(static_cast<const CommonTokens*>(toks)->getEtSumZDCToken(), ZDCSums); | ||
|
||
std::vector<uint32_t> load; | ||
int nBx = 0; | ||
|
||
for (int i = ZDCSums->getFirstBX(); i <= ZDCSums->getLastBX(); ++i) { | ||
int zdc_mask = 0x3FF; | ||
uint32_t empty_word = 0; | ||
uint32_t zdcm_word = 0; | ||
uint32_t zdcp_word = 0; | ||
|
||
for (auto j = ZDCSums->begin(i); j != ZDCSums->end(i); ++j) { | ||
uint32_t word = std::min(j->hwPt(), zdc_mask); | ||
|
||
if (j->getType() == l1t::EtSum::kZDCM) | ||
zdcm_word |= word; | ||
if (j->getType() == l1t::EtSum::kZDCP) | ||
zdcp_word |= word; | ||
} | ||
load.push_back(empty_word); | ||
load.push_back(zdcm_word); | ||
load.push_back(zdcp_word); | ||
|
||
//pad with zeros to fill out block; must do this for each BX | ||
while (load.size() - nBx * zdc::nOutputFramePerBX < zdc::nOutputFramePerBX) | ||
load.push_back(0); | ||
nBx++; | ||
} | ||
|
||
return {Block(b1_, load)}; | ||
} | ||
} // namespace stage2 | ||
} // namespace l1t | ||
|
||
// DEFINE_L1T_PACKER(l1t::stage2::CaloEtSumZDCPacker); | ||
DEFINE_L1T_PACKER(l1t::stage2::GTEtSumZDCPacker); |
26 changes: 26 additions & 0 deletions
26
EventFilter/L1TRawToDigi/plugins/implementations_stage2/ZDCPacker.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef L1T_PACKER_STAGE2_ETSUMPACKER_H | ||
#define L1T_PACKER_STAGE2_ETSUMPACKER_H | ||
|
||
#include "EventFilter/L1TRawToDigi/interface/Packer.h" | ||
|
||
namespace l1t { | ||
namespace stage2 { | ||
class ZDCPacker : public Packer { | ||
public: | ||
ZDCPacker(int b1) : b1_(b1) {} | ||
Blocks pack(const edm::Event&, const PackerTokens*) override; | ||
int b1_; | ||
}; | ||
class GTEtSumZDCPacker : public ZDCPacker { | ||
public: | ||
GTEtSumZDCPacker() : ZDCPacker(142) {} | ||
}; | ||
// class CaloEtSumZDCPacker : public ZDCPacker { | ||
// public: | ||
// CaloEtSumZDCPacker() : ZDCPacker(143) {} | ||
// }; | ||
|
||
} // namespace stage2 | ||
} // namespace l1t | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
EventFilter/L1TRawToDigi/test/test_RawToDigiToRawToDigi_GT.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process('L1') | ||
|
||
# import of standard configurations | ||
process.load('Configuration.StandardSequences.Services_cff') | ||
process.load('FWCore.MessageService.MessageLogger_cfi') | ||
process.load('Configuration.StandardSequences.GeometryRecoDB_cff') | ||
process.load('Configuration.Geometry.GeometryDB_cff') | ||
process.load('Configuration.StandardSequences.MagneticField_38T_cff') | ||
process.load('Configuration.StandardSequences.SimL1Emulator_cff') | ||
process.load('Configuration.StandardSequences.EndOfProcess_cff') | ||
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(100) | ||
) | ||
|
||
# Input source | ||
process.source = cms.Source( | ||
"PoolSource", | ||
fileNames = cms.untracked.vstring([ | ||
"/store/hidata/HIRun2023A/HIMinimumBias1/RAW/v1/000/374/345/00000/1332e7ef-bf52-4bc4-b6e2-aae1be281411.root", | ||
"/store/hidata/HIRun2023A/HIMinimumBias1/RAW/v1/000/374/345/00000/6b72b001-db9b-4490-aec8-29eb1de07108.root", | ||
"/store/hidata/HIRun2023A/HIMinimumBias1/RAW/v1/000/374/345/00000/1859b208-0daf-4382-a2fc-444a8e7628aa.root", | ||
"/store/hidata/HIRun2023A/HIMinimumBias1/RAW/v1/000/374/345/00000/77101f68-bc1b-4ca6-a8ba-f48bef24b8de.root", | ||
"/store/hidata/HIRun2023A/HIMinimumBias1/RAW/v1/000/374/345/00000/1fc90d44-5798-4eb1-a3c0-2c2e2e9a9df6.root" | ||
]), | ||
eventsToProcess = cms.untracked.VEventRange('374345:1-374345:MAX') | ||
) | ||
|
||
process.options = cms.untracked.PSet( | ||
SkipEvent = cms.untracked.vstring('ProductNotFound') | ||
) | ||
|
||
|
||
# Output definition | ||
|
||
process.output = cms.OutputModule( | ||
"PoolOutputModule", | ||
splitLevel = cms.untracked.int32(0), | ||
eventAutoFlushCompressedSize = cms.untracked.int32(5242880), | ||
outputCommands = cms.untracked.vstring("keep *", | ||
"drop *_mix_*_*"), | ||
fileName = cms.untracked.string('L1T_EDM.root'), | ||
dataset = cms.untracked.PSet( | ||
filterName = cms.untracked.string(''), | ||
dataTier = cms.untracked.string('') | ||
) | ||
) | ||
|
||
# Additional output definition | ||
|
||
# Other statements | ||
from Configuration.AlCa.GlobalTag import GlobalTag | ||
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '') | ||
|
||
|
||
# # TTree output file | ||
# process.load("CommonTools.UtilAlgos.TFileService_cfi") | ||
# process.TFileService.fileName = cms.string('l1t.root') | ||
|
||
|
||
process.load('EventFilter.L1TRawToDigi.gtStage2Digis_cfi') | ||
process.gtStage2Digis.InputLabel = cms.InputTag('rawDataRepacker') | ||
process.gtStage2Digis.debug = cms.untracked.bool(False) | ||
|
||
process.load('EventFilter.L1TRawToDigi.gtStage2Raw_cfi') | ||
process.gtStage2Raw.InputLabel = cms.InputTag("gtStage2Digis","GT") | ||
|
||
process.gtStage2Raw.GtInputTag = cms.InputTag("gtStage2Digis","") | ||
process.gtStage2Raw.ExtInputTag = cms.InputTag("gtStage2Digis") | ||
process.gtStage2Raw.MuonInputTag = cms.InputTag("gtStage2Digis","Muon") | ||
process.gtStage2Raw.EGammaInputTag = cms.InputTag("gtStage2Digis","EGamma") | ||
process.gtStage2Raw.TauInputTag = cms.InputTag("gtStage2Digis","Tau") | ||
process.gtStage2Raw.JetInputTag = cms.InputTag("gtStage2Digis","Jet") | ||
process.gtStage2Raw.EtSumInputTag = cms.InputTag("gtStage2Digis","EtSum") | ||
process.gtStage2Raw.EtSumZDCInputTag = cms.InputTag("gtStage2Digis","EtSumZDC") | ||
|
||
|
||
# dump raw data | ||
process.dumpRaw = cms.EDAnalyzer( | ||
"DumpFEDRawDataProduct", | ||
token = cms.untracked.InputTag('gtStage2Raw'), | ||
label = cms.untracked.InputTag('gtStage2Raw'), | ||
feds = cms.untracked.vint32 ( 1404 ), | ||
dumpPayload = cms.untracked.bool ( False ) | ||
) | ||
process.unpackGtStage2 = process.gtStage2Digis.clone() | ||
process.unpackGtStage2.InputLabel = cms.InputTag('gtStage2Raw') | ||
process.unpackGtStage2.debug = cms.untracked.bool(False) | ||
|
||
|
||
# Path and EndPath definitions | ||
process.path = cms.Path( | ||
process.gtStage2Digis | ||
+ process.gtStage2Raw | ||
# + process.dumpRaw | ||
+ process.unpackGtStage2 | ||
) | ||
|
||
process.out = cms.EndPath( | ||
process.output | ||
) |