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

ECAL Phase 2 Development WF 28234.61 fix #36748

Merged
merged 6 commits into from Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Configuration/EventContent/python/EventContent_cff.py
Expand Up @@ -213,6 +213,7 @@ def SwapKeepAndDrop(l):
RECOEventContent.outputCommands.extend(EITopPAGEventContent.outputCommands)

from Configuration.Eras.Modifier_ctpps_cff import ctpps
from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon
Expand Down Expand Up @@ -622,6 +623,10 @@ def SwapKeepAndDrop(l):
'keep *_*_GEMStripDigiSimLink_*',
'keep *_*_ME0DigiSimLink_*',
'keep *_*_ME0StripDigiSimLink_*'])

phase2_ecal_devel.toModify(FEVTDEBUGHLTEventContent,
outputCommands = FEVTDEBUGHLTEventContent.outputCommands+[
'keep *_ecal*_*_*'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big of the eventcontent we are adding here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not checked the size. This is a catch all mainly to keep all ECAL reco products, in particular the uncalibrated RecHits. But they are only kept if the phase2_ecal_devel modifier is given so all other WFs except 28234.61 should see no change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can modifications in this file be avoided?
Individual detectors or producer categories should be defined already in their corresponding areas and simply included in this file.
I see that this is already not followed from the cases above, but it should not be a case to pollute this file.

#
#
# RECOSIMDEBUG Data Tier definition
Expand Down
Expand Up @@ -852,7 +852,13 @@ def setup_(self, step, stepName, stepDict, k, properties):
# temporarily remove trigger & downstream steps
mods = {'--era': stepDict[step][k]['--era']+',phase2_ecal_devel'}
if 'Digi' in step:
mods['-s'] = 'DIGI:pdigi_valid'
mods['-s'] = 'DIGI:pdigi_valid,DIGI2RAW'
elif 'Reco' in step:
mods['-s'] = 'RAW2DIGI,RECO:reconstruction_ecalOnly,VALIDATION:@ecalOnlyValidation,DQM:@ecalOnly'
mods['--datatier'] = 'GEN-SIM-RECO,DQMIO'
mods['--eventcontent'] = 'FEVTDEBUGHLT,DQM'
elif 'HARVEST' in step:
mods['-s'] = 'HARVESTING:@ecalOnlyValidation+@ecal'
stepDict[stepName][k] = merge([mods, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return fragment=="TTbar_14TeV" and '2026' in key
Expand Down
2 changes: 1 addition & 1 deletion Configuration/StandardSequences/python/DigiToRaw_cff.py
Expand Up @@ -57,4 +57,4 @@
fastSim.toReplaceWith(DigiToRawTask, DigiToRawTask.copyAndExclude([siPixelRawData,SiStripDigiToRaw,castorRawData,ctppsRawData]))

from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
phase2_ecal_devel.toReplaceWith(DigiToRawTask, DigiToRawTask.copyAndExclude([esDigiToRaw]))
phase2_ecal_devel.toReplaceWith(DigiToRawTask, DigiToRawTask.copyAndExclude([L1TDigiToRawTask, ecalPacker, esDigiToRaw, cscpacker]))
4 changes: 4 additions & 0 deletions Configuration/StandardSequences/python/Reconstruction_cff.py
Expand Up @@ -231,6 +231,10 @@
)
reconstruction_ecalOnly = cms.Sequence(reconstruction_ecalOnlyTask)

from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
phase2_ecal_devel.toReplaceWith(ecalRecHitNoTPTask, ecalRecHitNoTPTask.copyAndExclude([ecalPreshowerRecHit]))
thomreis marked this conversation as resolved.
Show resolved Hide resolved
phase2_ecal_devel.toReplaceWith(reconstruction_ecalOnlyTask, reconstruction_ecalOnlyTask.copyAndExclude([pfClusteringPSTask, pfClusteringECALTask, particleFlowSuperClusterECALOnly]))

reconstruction_hcalOnlyTask = cms.Task(
bunchSpacingProducer,
offlineBeamSpot,
Expand Down
3 changes: 3 additions & 0 deletions DQMOffline/Configuration/python/DQMOffline_cff.py
Expand Up @@ -46,6 +46,9 @@
ecal_dqm_source_offline +
es_dqm_source_offline )

from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
phase2_ecal_devel.toReplaceWith(DQMOfflineEcalOnly, DQMOfflineEcalOnly.copyAndExclude([es_dqm_source_offline]))

#offline version of the online DQM: used in validation/certification
DQMOfflineHcal = cms.Sequence( hcalOfflineSourceSequence )

Expand Down
Expand Up @@ -48,6 +48,10 @@
_phase2_timing_ecalRecHitTask = cms.Task( ecalRecHitTask.copy() , ecalDetailedTimeRecHit )
from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
phase2_timing.toReplaceWith( ecalRecHitTask, _phase2_timing_ecalRecHitTask )
from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitPhase2_cff import *
phase2_ecal_devel.toReplaceWith(ecalUncalibRecHitTask, ecalUncalibRecHitPhase2Task)
phase2_ecal_devel.toReplaceWith(ecalRecHitNoTPTask, ecalRecHitNoTPTask.copyAndExclude([ecalPreshowerRecHit]))

# FastSim modifications
_fastSim_ecalRecHitTask = ecalRecHitTask.copyAndExclude([ecalCompactTrigPrim,ecalTPSkim])
Expand Down
73 changes: 46 additions & 27 deletions RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducer.cc
Expand Up @@ -24,36 +24,51 @@
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

EcalRecHitProducer::EcalRecHitProducer(const edm::ParameterSet& ps) {
ebRechitCollection_ = ps.getParameter<std::string>("EBrechitCollection");
eeRechitCollection_ = ps.getParameter<std::string>("EErechitCollection");

recoverEBIsolatedChannels_ = ps.getParameter<bool>("recoverEBIsolatedChannels");
recoverEEIsolatedChannels_ = ps.getParameter<bool>("recoverEEIsolatedChannels");
recoverEBVFE_ = ps.getParameter<bool>("recoverEBVFE");
recoverEEVFE_ = ps.getParameter<bool>("recoverEEVFE");
recoverEBFE_ = ps.getParameter<bool>("recoverEBFE");
recoverEEFE_ = ps.getParameter<bool>("recoverEEFE");
killDeadChannels_ = ps.getParameter<bool>("killDeadChannels");

EcalRecHitProducer::EcalRecHitProducer(const edm::ParameterSet& ps)
: ebRechitCollection_(ps.getParameter<std::string>("EBrechitCollection")),
eeRechitCollection_(ps.getParameter<std::string>("EErechitCollection")),
doEB_(ps.getParameter<edm::InputTag>("EBuncalibRecHitCollection").label() != "none"),
thomreis marked this conversation as resolved.
Show resolved Hide resolved
doEE_(ps.getParameter<edm::InputTag>("EEuncalibRecHitCollection").label() != "none"),
recoverEBIsolatedChannels_(ps.getParameter<bool>("recoverEBIsolatedChannels")),
recoverEEIsolatedChannels_(ps.getParameter<bool>("recoverEEIsolatedChannels")),
recoverEBVFE_(ps.getParameter<bool>("recoverEBVFE")),
recoverEEVFE_(ps.getParameter<bool>("recoverEEVFE")),
recoverEBFE_(ps.getParameter<bool>("recoverEBFE")),
recoverEEFE_(ps.getParameter<bool>("recoverEEFE")),
killDeadChannels_(ps.getParameter<bool>("killDeadChannels")) {
produces<EBRecHitCollection>(ebRechitCollection_);
produces<EERecHitCollection>(eeRechitCollection_);

ebUncalibRecHitToken_ =
consumes<EBUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EBuncalibRecHitCollection"));
if (doEB_) {
ebUncalibRecHitToken_ =
consumes<EBUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EBuncalibRecHitCollection"));

eeUncalibRecHitToken_ =
consumes<EEUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EEuncalibRecHitCollection"));
if (recoverEBIsolatedChannels_ || recoverEBFE_ || killDeadChannels_) {
ebDetIdToBeRecoveredToken_ = consumes<std::set<EBDetId>>(ps.getParameter<edm::InputTag>("ebDetIdToBeRecovered"));
}

ebDetIdToBeRecoveredToken_ = consumes<std::set<EBDetId>>(ps.getParameter<edm::InputTag>("ebDetIdToBeRecovered"));
if (recoverEBFE_ || killDeadChannels_) {
ebFEToBeRecoveredToken_ =
consumes<std::set<EcalTrigTowerDetId>>(ps.getParameter<edm::InputTag>("ebFEToBeRecovered"));
}
}

eeDetIdToBeRecoveredToken_ = consumes<std::set<EEDetId>>(ps.getParameter<edm::InputTag>("eeDetIdToBeRecovered"));
if (doEE_) {
eeUncalibRecHitToken_ =
consumes<EEUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EEuncalibRecHitCollection"));

ebFEToBeRecoveredToken_ = consumes<std::set<EcalTrigTowerDetId>>(ps.getParameter<edm::InputTag>("ebFEToBeRecovered"));
if (recoverEEIsolatedChannels_ || recoverEEFE_ || killDeadChannels_) {
eeDetIdToBeRecoveredToken_ = consumes<std::set<EEDetId>>(ps.getParameter<edm::InputTag>("eeDetIdToBeRecovered"));
}

eeFEToBeRecoveredToken_ = consumes<std::set<EcalScDetId>>(ps.getParameter<edm::InputTag>("eeFEToBeRecovered"));
if (recoverEEFE_ || killDeadChannels_) {
eeFEToBeRecoveredToken_ = consumes<std::set<EcalScDetId>>(ps.getParameter<edm::InputTag>("eeFEToBeRecovered"));
}
}

ecalChannelStatusToken_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>();
if (recoverEBIsolatedChannels_ || recoverEBFE_ || recoverEEIsolatedChannels_ || recoverEEFE_ || killDeadChannels_) {
ecalChannelStatusToken_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>();
}

std::string componentType = ps.getParameter<std::string>("algo");
edm::ConsumesCollector c{consumesCollector()};
Expand All @@ -80,13 +95,17 @@ void EcalRecHitProducer::produce(edm::Event& evt, const edm::EventSetup& es) {

// get the barrel uncalib rechit collection

evt.getByToken(ebUncalibRecHitToken_, pEBUncalibRecHits);
ebUncalibRecHits = pEBUncalibRecHits.product();
LogDebug("EcalRecHitDebug") << "total # EB uncalibrated rechits: " << ebUncalibRecHits->size();
if (doEB_) {
evt.getByToken(ebUncalibRecHitToken_, pEBUncalibRecHits);
ebUncalibRecHits = pEBUncalibRecHits.product();
thomreis marked this conversation as resolved.
Show resolved Hide resolved
LogDebug("EcalRecHitDebug") << "total # EB uncalibrated rechits: " << ebUncalibRecHits->size();
}

evt.getByToken(eeUncalibRecHitToken_, pEEUncalibRecHits);
eeUncalibRecHits = pEEUncalibRecHits.product(); // get a ptr to the product
LogDebug("EcalRecHitDebug") << "total # EE uncalibrated rechits: " << eeUncalibRecHits->size();
if (doEE_) {
evt.getByToken(eeUncalibRecHitToken_, pEEUncalibRecHits);
eeUncalibRecHits = pEEUncalibRecHits.product(); // get a ptr to the product
LogDebug("EcalRecHitDebug") << "total # EE uncalibrated rechits: " << eeUncalibRecHits->size();
}

// collection of rechits to put in the event
auto ebRecHits = std::make_unique<EBRecHitCollection>();
Expand Down
22 changes: 12 additions & 10 deletions RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducer.h
Expand Up @@ -33,16 +33,18 @@ class EcalRecHitProducer : public edm::stream::EDProducer<> {
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
std::string ebRechitCollection_; // secondary name to be given to EB collection of hits
std::string eeRechitCollection_; // secondary name to be given to EE collection of hits

bool recoverEBIsolatedChannels_;
bool recoverEEIsolatedChannels_;
bool recoverEBVFE_;
bool recoverEEVFE_;
bool recoverEBFE_;
bool recoverEEFE_;
bool killDeadChannels_;
const std::string ebRechitCollection_; // secondary name to be given to EB collection of hits
const std::string eeRechitCollection_; // secondary name to be given to EE collection of hits

const bool doEB_; // consume and use the EB uncalibrated RecHits. An EB collection is produced even if this is false
const bool doEE_; // consume and use the EE uncalibrated RecHits. An EE collection is produced even if this is false
const bool recoverEBIsolatedChannels_;
const bool recoverEEIsolatedChannels_;
const bool recoverEBVFE_;
const bool recoverEEVFE_;
const bool recoverEBFE_;
const bool recoverEEFE_;
const bool killDeadChannels_;

std::unique_ptr<EcalRecHitWorkerBaseClass> worker_;
std::unique_ptr<EcalRecHitWorkerBaseClass> workerRecover_;
Expand Down
15 changes: 14 additions & 1 deletion RecoLocalCalo/EcalRecProducers/python/ecalRecHit_cfi.py
Expand Up @@ -93,4 +93,17 @@
recoverEBFE = False,
recoverEEFE = False,
recoverEBIsolatedChannels = False
)
)

# Phase 2 modifications
from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
phase2_ecal_devel.toModify(ecalRecHit,
EBuncalibRecHitCollection = cms.InputTag("ecalUncalibRecHitPhase2", "EcalUncalibRecHitsEB"),
EEuncalibRecHitCollection = cms.InputTag("none"),
killDeadChannels = cms.bool(False),
recoverEBFE = cms.bool(False),
recoverEEFE = cms.bool(False),
recoverEBIsolatedChannels = cms.bool(False),
recoverEEIsolatedChannels = cms.bool(False)
)

2 changes: 2 additions & 0 deletions Validation/Configuration/python/globalValidation_cff.py
Expand Up @@ -172,6 +172,8 @@
+ ecalRecHitsValidationSequence
+ pfClusterCaloOnlyValidationSequence
)
from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
phase2_ecal_devel.toReplaceWith(ecalRecHitsValidationSequence, ecalRecHitsValidationSequencePhase2)

# HCAL local reconstruction
globalPrevalidationHCAL = cms.Sequence()
Expand Down