Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
8a32284
Remove EventSetup dependency from CosmicLayerPairs
Dr15Jones Sep 13, 2021
e9f86b5
Remove EventSetup use in CosmicHitPairGeneratorFromLayerPair
Dr15Jones Sep 13, 2021
aa435c0
Removed EventSetup use in CosmicLayerTriplets
Dr15Jones Sep 13, 2021
bd47432
Removed Eventsetup dependency from CosmicHitTripletGenerator
Dr15Jones Sep 13, 2021
f13a105
Added esConsumes calls to SeedGeneratorForCosmics
Dr15Jones Sep 13, 2021
cc07c62
add GPU to runTheMatrix
Sep 14, 2021
7d8f062
add GPU to runTheMatrix
Sep 14, 2021
5cec229
update runTheMatrix following comments
Sep 14, 2021
282edcf
update lowercase for option
Sep 14, 2021
ce3f561
Simplify optional dict
Sep 14, 2021
9c75ded
Use esConsumes in ParticleGun base classes
Dr15Jones Sep 14, 2021
b7862c5
migrate to argparse
Sep 15, 2021
7f17b26
add branch
Sep 15, 2021
6135782
update
Sep 15, 2021
69f81ed
Update HcalDDDRecConstants.cc
iarspider Sep 15, 2021
1734e7f
bring back wmcontrol default
Sep 15, 2021
6707ba0
remove unnecessary const,nargs from revertDqmio
Sep 15, 2021
bfdc428
code clean up
Sep 15, 2021
de6a246
small clean up on default value
Sep 15, 2021
9954e5c
reassembling files from branch geoFix121X
diemort Sep 16, 2021
59686e6
correcting Vaccum entries for new materials
diemort Sep 16, 2021
069dc6c
Better handling of commented out code
Dr15Jones Sep 16, 2021
fc16ab2
Move MessageLogger default configuration to be part of Process
makortel Sep 15, 2021
deafbcc
Print warning from python if non-default MessageLogger is used in a S…
makortel Sep 17, 2021
e0a7781
Add support for the gpu modifier at HLT
fwyzard Aug 23, 2021
84155b6
Make the Patatrack workflows apply the 'gpu' modifier to the HLT step
fwyzard Sep 8, 2021
dd84d38
Simplify the GPU pixel local reconstruction
fwyzard Sep 15, 2021
4a33d57
Fix #35225
lecriste Sep 17, 2021
148a7a5
Add protection for multiple subProcesses
lecriste Sep 17, 2021
59fc337
Add missing #include to 3 other files
iarspider Sep 17, 2021
f0a7089
Merge branch 'master' into patch-1
iarspider Sep 17, 2021
c85ee6e
Print warning for empty PlotterFolder
lecriste Sep 17, 2021
5b7ec18
Removed unnecessary includes
Dr15Jones Sep 17, 2021
daaa11d
Use esConsumes in FastTSGFromPropagation
Dr15Jones Sep 17, 2021
d1a2075
Add esConsumes to TSGForRoadSearch
Dr15Jones Sep 17, 2021
a3783c8
Added esConsumes to TSGFromPropagation
Dr15Jones Sep 17, 2021
e44a0d4
Added esConsumes to TrackerSeedCleaner
Dr15Jones Sep 17, 2021
002868b
Fixed incorrect use of consumesCollector in FastTSGFromL2Muon
Dr15Jones Sep 17, 2021
7c96d7e
Added esConsumes to TSGFromL2Muon
Dr15Jones Sep 17, 2021
2f5b4ea
fixed undefined behavior in PixelDigi::pixelToChannel(int row, int col)
ferencek Sep 18, 2021
21cbd1d
migrate DTNoiseCalibration
swagata87 Sep 19, 2021
4d2c277
migrate DTTPDeadWriter
swagata87 Sep 19, 2021
a9643a4
migrate DTT0Correction
swagata87 Sep 19, 2021
bf0a6dd
DTTTrigCorrectionFirst
swagata87 Sep 19, 2021
82317dd
migrate DTT0CalibrationRMS
swagata87 Sep 19, 2021
a918e9b
migrate DTTTrigWriter, DTVDriftWriter
swagata87 Sep 19, 2021
ddc4c6e
migrate DTT0FEBPathCorrection
swagata87 Sep 19, 2021
ca12a01
migrate DTT0ChamberReferenceCorrection
swagata87 Sep 19, 2021
c4c13de
migrate DTT0Calibration
swagata87 Sep 19, 2021
6ea557b
migrate DTResidualCalibration
swagata87 Sep 19, 2021
2dc9e5e
DTNoiseComputation
swagata87 Sep 19, 2021
9a9bf61
migrate DTFakeT0ESProducer
swagata87 Sep 19, 2021
93237cb
migrate DTVDriftSegmentCalibration
swagata87 Sep 19, 2021
dc2424e
migrate DTTTrigOffsetCalibration
swagata87 Sep 19, 2021
1abbf70
Trying to add a new AlCaReco package forHcal IsoTrack to reduce datav…
Sep 16, 2021
57a1191
code checks
swagata87 Sep 19, 2021
edbcee9
Small fix to the debug statement
Sep 20, 2021
0800172
Code check
Sep 20, 2021
ed5ce8f
Migration of CSCCommissioning/CSCFileDumper module to thread safe edm…
barvic Sep 20, 2021
ff2ea8e
Merge pull request #35258 from Dr15Jones/esConsumesCosmicSeedGenerator
cmsbuild Sep 20, 2021
53b8d1f
Merge pull request #35336 from swagata87/dev_migrateDT
cmsbuild Sep 20, 2021
9b78054
Merge pull request #35343 from barvic/CSCCommissioning_migrate_to_thr…
cmsbuild Sep 20, 2021
6a33ae6
introducing loop boundaries instead of doing if comparisons in each i…
ferencek Sep 20, 2021
4b97950
Fix -t option for python3
makortel Sep 20, 2021
5f07f09
Take care of Sim Geometry definition
Sep 21, 2021
6a1fe83
Merge pull request #35319 from lecriste/parallelValidation
cmsbuild Sep 21, 2021
5292fac
Merge pull request #35298 from makortel/messageLoggerProcess
cmsbuild Sep 21, 2021
87fa9df
Merge pull request #35286 from iarspider/patch-1
cmsbuild Sep 21, 2021
de26e11
Merge pull request #35312 from bsunanda/Run3-alca201
cmsbuild Sep 21, 2021
0c0614e
Merge pull request #35273 from Dr15Jones/esConsumesParticleGuns
cmsbuild Sep 21, 2021
3cec5df
deleted FastSimulation/EventProducer
sbein Sep 21, 2021
c63368f
removing dead assignment
ferencek Sep 21, 2021
8029159
removed config file using depricated FamosManager/Producer
sbein Sep 21, 2021
0ec8e62
Merge pull request #34978 from fwyzard/HLT_customisation_for_GPU_121x
cmsbuild Sep 21, 2021
5d10e5e
Merge pull request #35263 from srimanob/121_runTheMatrixGPUWorkflow
cmsbuild Sep 21, 2021
788116d
Merge pull request #35349 from bsunanda/Run3-hcx322
cmsbuild Sep 21, 2021
721c5bb
Add the tree maker for IsoTrack analysis using the new calibration ob…
Sep 20, 2021
a787d33
correcting dict2021 to comply with master
diemort Sep 21, 2021
d5d0c6e
TrackToTrackComparisonHists :use correct handle to check if collectio…
mmusich Sep 21, 2021
b493773
Merge pull request #35327 from Dr15Jones/esConsumesTSGFromL2Muon
cmsbuild Sep 21, 2021
eaae714
removed FastSimulation/EventProducer from CMSSWReleaseDependency.rules
sbein Sep 21, 2021
5a417ca
Merge pull request #35348 from makortel/addOnTestOptionT
cmsbuild Sep 21, 2021
e9a68e6
Merge pull request #35337 from CMSTrackerDPG/siPixChRwghtUBSAN
cmsbuild Sep 21, 2021
941ccdb
Merge pull request #35352 from sbein/from-CMSSW_12_1_X_2021-09-20-2300
cmsbuild Sep 21, 2021
067a5ad
Merge pull request #35353 from mmusich/fixTrackToTrackComparisonHists
cmsbuild Sep 21, 2021
7e3086e
Merge pull request #35339 from bsunanda/Run3-alca201X
cmsbuild Sep 21, 2021
14e2db4
reassembling files from branch geoFix121X
diemort Sep 16, 2021
368fe9a
correcting Vaccum entries for new materials
diemort Sep 16, 2021
b01073e
correcting dict2021 to comply with master
diemort Sep 21, 2021
25f5ba2
Merge branch 'geoFix121pre2' of https://github.com/CTPPS/cmssw into g…
diemort Sep 23, 2021
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
13 changes: 6 additions & 7 deletions CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ using namespace std;

DTFakeT0ESProducer::DTFakeT0ESProducer(const edm::ParameterSet& pset) {
//framework
setWhatProduced(this, &DTFakeT0ESProducer::produce);
auto cc = setWhatProduced(this, &DTFakeT0ESProducer::produce);
// setWhatProduced(this,dependsOn(& DTGeometryESModule::parseDDD()));
findingRecord<DTT0Rcd>();

//read constant value for t0 from cfg
t0Mean = pset.getParameter<double>("t0Mean");
t0Sigma = pset.getParameter<double>("t0Sigma");
cpvTokenDDD_ = cc.consumesFrom<DDCompactView, IdealGeometryRecord>(edm::ESInputTag());
mdcToken_ = cc.consumes();
}

DTFakeT0ESProducer::~DTFakeT0ESProducer() {}
Expand All @@ -59,13 +61,10 @@ std::unique_ptr<DTT0> DTFakeT0ESProducer::produce(const DTT0Rcd& iRecord) {
}

void DTFakeT0ESProducer::parseDDD(const DTT0Rcd& iRecord) {
edm::ESTransientHandle<DDCompactView> cpv;
edm::ESHandle<MuonGeometryConstants> mdc;
edm::ESTransientHandle<DDCompactView> cpv = iRecord.getTransientHandle(cpvTokenDDD_);
const auto& mdc = iRecord.get(mdcToken_);

iRecord.getRecord<IdealGeometryRecord>().get(cpv);
iRecord.getRecord<IdealGeometryRecord>().get(mdc);

DTGeometryParserFromDDD parser(&(*cpv), *mdc, theLayerIdWiresMap);
DTGeometryParserFromDDD parser(&(*cpv), mdc, theLayerIdWiresMap);
}

void DTFakeT0ESProducer::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
Expand Down
9 changes: 9 additions & 0 deletions CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DetectorDescription/Core/interface/DDCompactView.h"
#include "DetectorDescription/DDCMS/interface/DDCompactView.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/MuonNumbering/interface/MuonGeometryConstants.h"

//#include <pair>
#include <map>

Expand Down Expand Up @@ -48,5 +54,8 @@ class DTFakeT0ESProducer : public edm::ESProducer, public edm::EventSetupRecordI
//t0 mean and sigma values read from cfg
double t0Mean;
double t0Sigma;

edm::ESGetToken<DDCompactView, IdealGeometryRecord> cpvTokenDDD_;
edm::ESGetToken<MuonGeometryConstants, IdealGeometryRecord> mdcToken_;
};
#endif
10 changes: 5 additions & 5 deletions CalibMuon/DTCalibration/plugins/DTNoiseCalibration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ DTNoiseCalibration::DTNoiseCalibration(const edm::ParameterSet& pset)
dbLabel_(pset.getUntrackedParameter<string>("dbLabel", "")),
//fastAnalysis_( pset.getParameter<bool>("fastAnalysis", true) ),
wireIdWithHisto_(std::vector<DTWireId>()),
lumiMax_(3000) {
lumiMax_(3000),
dtGeomToken_(esConsumes()),
ttrigToken_(esConsumes(edm::ESInputTag("", pset.getParameter<string>("dbLabel")))) {
// Get the debug parameter for verbose output
//debug = ps.getUntrackedParameter<bool>("debug");
/*// The analysis type
Expand Down Expand Up @@ -96,12 +98,10 @@ void DTNoiseCalibration::beginJob() {

void DTNoiseCalibration::beginRun(const edm::Run& run, const edm::EventSetup& setup) {
// Get the DT Geometry
setup.get<MuonGeometryRecord>().get(dtGeom_);

dtGeom_ = setup.getHandle(dtGeomToken_);
// tTrig
if (readDB_)
setup.get<DTTtrigRcd>().get(dbLabel_, tTrigMap_);

tTrigMap_ = &setup.getData(ttrigToken_);
runBeginTime_ = time_t(run.beginTime().value() >> 32);
runEndTime_ = time_t(run.endTime().value() >> 32);
/*
Expand Down
5 changes: 5 additions & 0 deletions CalibMuon/DTCalibration/plugins/DTNoiseCalibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "CondFormats/DataRecord/interface/DTTtrigRcd.h"

#include <string>
#include <vector>
Expand Down Expand Up @@ -74,8 +76,11 @@ class DTNoiseCalibration : public edm::EDAnalyzer {

// Get the DT Geometry
edm::ESHandle<DTGeometry> dtGeom_;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;

// tTrig map
edm::ESHandle<DTTtrig> tTrigMap_;
const edm::ESGetToken<DTTtrig, DTTtrigRcd> ttrigToken_;

TFile* rootFile_;
// TDC digi distribution
Expand Down
4 changes: 2 additions & 2 deletions CalibMuon/DTCalibration/plugins/DTNoiseComputation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
using namespace edm;
using namespace std;

DTNoiseComputation::DTNoiseComputation(const edm::ParameterSet &ps) {
DTNoiseComputation::DTNoiseComputation(const edm::ParameterSet &ps) : dtGeomToken_(esConsumes()) {
cout << "[DTNoiseComputation]: Constructor" << endl;

// Get the debug parameter for verbose output
Expand All @@ -61,7 +61,7 @@ DTNoiseComputation::DTNoiseComputation(const edm::ParameterSet &ps) {

void DTNoiseComputation::beginRun(const edm::Run &, const EventSetup &setup) {
// Get the DT Geometry
setup.get<MuonGeometryRecord>().get(dtGeom);
dtGeom = setup.getHandle(dtGeomToken_);

static int count = 0;

Expand Down
2 changes: 2 additions & 0 deletions CalibMuon/DTCalibration/plugins/DTNoiseComputation.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "DataFormats/MuonDetId/interface/DTWireId.h"
#include "DataFormats/MuonDetId/interface/DTChamberId.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

#include <string>
#include <map>
Expand Down Expand Up @@ -57,6 +58,7 @@ class DTNoiseComputation : public edm::EDAnalyzer {

// Get the DT Geometry
edm::ESHandle<DTGeometry> dtGeom;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;

// The file which contain the occupancy plot and the digi event plot
TFile* theFile;
Expand Down
5 changes: 3 additions & 2 deletions CalibMuon/DTCalibration/plugins/DTResidualCalibration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ DTResidualCalibration::DTResidualCalibration(const edm::ParameterSet& pset)
: histRange_(pset.getParameter<double>("histogramRange")),
segment4DLabel_(pset.getParameter<edm::InputTag>("segment4DLabel")),
rootBaseDir_(pset.getUntrackedParameter<std::string>("rootBaseDir", "DT/Residuals")),
detailedAnalysis_(pset.getUntrackedParameter<bool>("detailedAnalysis", false)) {
detailedAnalysis_(pset.getUntrackedParameter<bool>("detailedAnalysis", false)),
dtGeomToken_(esConsumes()) {
edm::ConsumesCollector collector(consumesCollector());
select_ = new DTSegmentSelector(pset, collector);

Expand Down Expand Up @@ -63,7 +64,7 @@ void DTResidualCalibration::beginJob() { TH1::SetDefaultSumw2(true); }
void DTResidualCalibration::beginRun(const edm::Run& run, const edm::EventSetup& setup) {
// get the geometry
edm::ESHandle<DTGeometry> dtGeomH;
setup.get<MuonGeometryRecord>().get(dtGeomH);
dtGeomH = setup.getHandle(dtGeomToken_);
dtGeom_ = dtGeomH.product();

// Loop over all the chambers
Expand Down
3 changes: 3 additions & 0 deletions CalibMuon/DTCalibration/plugins/DTResidualCalibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "FWCore/Framework/interface/ESHandle.h"

#include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

#include <string>
#include <vector>
Expand Down Expand Up @@ -59,6 +60,8 @@ class DTResidualCalibration : public edm::EDAnalyzer {
TFile* rootFile_;
// Geometry
const DTGeometry* dtGeom_;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;

// Histograms per super-layer
std::map<DTSuperLayerId, TH1F*> histoMapTH1F_;
std::map<DTSuperLayerId, TH2F*> histoMapTH2F_;
Expand Down
7 changes: 3 additions & 4 deletions CalibMuon/DTCalibration/plugins/DTT0Calibration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ DTT0Calibration::DTT0Calibration(const edm::ParameterSet& pset)
tpPeakWidthPerLayer(pset.getParameter<double>("tpPeakWidthPerLayer")),
rejectDigiFromPeak(pset.getParameter<unsigned int>("rejectDigiFromPeak")),
hLayerPeaks("hLayerPeaks", "", 3000, 0, 3000),
spectrum(20)

{
spectrum(20),
dtGeomToken_(esConsumes()) {
// Get the debug parameter for verbose output
if (debug)
cout << "[DTT0Calibration]Constructor called!" << endl;
Expand Down Expand Up @@ -99,7 +98,7 @@ void DTT0Calibration::analyze(const edm::Event& event, const edm::EventSetup& ev

// Get the DT Geometry
if (nevents == 1)
eventSetup.get<MuonGeometryRecord>().get(dtGeom);
dtGeom = eventSetup.getHandle(dtGeomToken_);

// Iterate through all digi collections ordered by LayerId
for (const auto& digis_per_layer : *digis) {
Expand Down
2 changes: 2 additions & 0 deletions CalibMuon/DTCalibration/plugins/DTT0Calibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "DataFormats/MuonDetId/interface/DTWireId.h"
#include "DataFormats/DTDigi/interface/DTDigiCollection.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

#include <string>
#include <vector>
Expand Down Expand Up @@ -122,5 +123,6 @@ class DTT0Calibration : public edm::one::EDAnalyzer<> {

//DTGeometry used to loop on the SL in the endJob
edm::ESHandle<DTGeometry> dtGeom;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
};
#endif
4 changes: 2 additions & 2 deletions CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace edm;
// using namespace cond;

// Constructor
DTT0CalibrationRMS::DTT0CalibrationRMS(const edm::ParameterSet& pset) {
DTT0CalibrationRMS::DTT0CalibrationRMS(const edm::ParameterSet& pset) : dtGeomToken_(esConsumes()) {
// Get the debug parameter for verbose output
debug = pset.getUntrackedParameter<bool>("debug");
if (debug)
Expand Down Expand Up @@ -102,7 +102,7 @@ void DTT0CalibrationRMS::analyze(const edm::Event& event, const edm::EventSetup&
event.getByLabel(digiLabel, digis);

// Get the DT Geometry
eventSetup.get<MuonGeometryRecord>().get(dtGeom);
dtGeom = eventSetup.getHandle(dtGeomToken_);

// Iterate through all digi collections ordered by LayerId
DTDigiCollection::DigiRangeIterator dtLayerIt;
Expand Down
2 changes: 2 additions & 0 deletions CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Geometry/DTGeometry/interface/DTGeometry.h"
#include "DataFormats/MuonDetId/interface/DTWireId.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

#include <string>
#include <vector>
Expand Down Expand Up @@ -105,5 +106,6 @@ class DTT0CalibrationRMS : public edm::EDAnalyzer {

//DTGeometry used to loop on the SL in the endJob
edm::ESHandle<DTGeometry> dtGeom;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
};
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"

#include "DataFormats/MuonDetId/interface/DTWireId.h"
#include "CondFormats/DTObjects/interface/DTT0.h"
Expand All @@ -21,8 +22,8 @@ using namespace edm;

namespace dtCalibration {

DTT0ChamberReferenceCorrection::DTT0ChamberReferenceCorrection(const ParameterSet& pset)
: calibChamber_(pset.getParameter<string>("calibChamber")) {
DTT0ChamberReferenceCorrection::DTT0ChamberReferenceCorrection(const ParameterSet& pset, edm::ConsumesCollector cc)
: calibChamber_(pset.getParameter<string>("calibChamber")), t0Token_(cc.esConsumes()) {
//DTChamberId chosenChamberId;
if (!calibChamber_.empty() && calibChamber_ != "None" && calibChamber_ != "All") {
stringstream linestr;
Expand All @@ -40,8 +41,8 @@ namespace dtCalibration {
void DTT0ChamberReferenceCorrection::setES(const EventSetup& setup) {
// Get t0 record from DB
ESHandle<DTT0> t0H;
setup.get<DTT0Rcd>().get(t0H);
t0Map_ = &*t0H;
t0H = setup.getHandle(t0Token_);
t0Map_ = &setup.getData(t0Token_);
LogVerbatim("Calibration") << "[DTT0ChamberReferenceCorrection] T0 version: " << t0H->version();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

#include "CalibMuon/DTCalibration/interface/DTT0BaseCorrection.h"
#include "DataFormats/MuonDetId/interface/DTChamberId.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "CondFormats/DataRecord/interface/DTT0Rcd.h"
#include "CondFormats/DTObjects/interface/DTT0.h"

#include <string>

Expand All @@ -25,7 +29,7 @@ namespace dtCalibration {
class DTT0ChamberReferenceCorrection : public DTT0BaseCorrection {
public:
// Constructor
DTT0ChamberReferenceCorrection(const edm::ParameterSet&);
DTT0ChamberReferenceCorrection(const edm::ParameterSet&, edm::ConsumesCollector);

// Destructor
~DTT0ChamberReferenceCorrection() override;
Expand All @@ -40,6 +44,7 @@ namespace dtCalibration {

DTChamberId chosenChamberId_;
const DTT0* t0Map_;
edm::ESGetToken<DTT0, DTT0Rcd> t0Token_;
};

} // namespace dtCalibration
Expand Down
10 changes: 6 additions & 4 deletions CalibMuon/DTCalibration/plugins/DTT0Correction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ using namespace std;

DTT0Correction::DTT0Correction(const ParameterSet& pset)
: correctionAlgo_{DTT0CorrectionFactory::get()->create(pset.getParameter<string>("correctionAlgo"),
pset.getParameter<ParameterSet>("correctionAlgoConfig"))} {
pset.getParameter<ParameterSet>("correctionAlgoConfig"))},
dtGeomToken_(esConsumes()),
t0Token_(esConsumes()) {
LogVerbatim("Calibration") << "[DTT0Correction] Constructor called" << endl;
}

Expand All @@ -38,12 +40,12 @@ DTT0Correction::~DTT0Correction() { LogVerbatim("Calibration") << "[DTT0Correcti
void DTT0Correction::beginRun(const edm::Run& run, const edm::EventSetup& setup) {
// Get t0 record from DB
ESHandle<DTT0> t0H;
setup.get<DTT0Rcd>().get(t0H);
t0Map_ = &*t0H;
t0H = setup.getHandle(t0Token_);
t0Map_ = &setup.getData(t0Token_);
LogVerbatim("Calibration") << "[DTT0Correction]: T0 version: " << t0H->version() << endl;

// Get geometry from Event Setup
setup.get<MuonGeometryRecord>().get(muonGeom_);
muonGeom_ = setup.getHandle(dtGeomToken_);

// Pass EventSetup to correction Algo
correctionAlgo_->setES(setup);
Expand Down
10 changes: 8 additions & 2 deletions CalibMuon/DTCalibration/plugins/DTT0Correction.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "CondFormats/DTObjects/interface/DTT0.h"
#include "CondFormats/DataRecord/interface/DTT0Rcd.h"

#include <string>

Expand All @@ -34,9 +37,12 @@ class DTT0Correction : public edm::EDAnalyzer {

protected:
private:
const DTT0* t0Map_;
std::unique_ptr<dtCalibration::DTT0BaseCorrection> correctionAlgo_;

edm::ESHandle<DTGeometry> muonGeom_;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;

std::unique_ptr<dtCalibration::DTT0BaseCorrection> correctionAlgo_;
const DTT0* t0Map_;
edm::ESGetToken<DTT0, DTT0Rcd> t0Token_;
};
#endif
9 changes: 5 additions & 4 deletions CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "DataFormats/MuonDetId/interface/DTWireId.h"
#include "CondFormats/DTObjects/interface/DTT0.h"
#include "CondFormats/DataRecord/interface/DTT0Rcd.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"

#include <string>
#include <sstream>
Expand All @@ -24,8 +25,8 @@ using namespace edm;

namespace dtCalibration {

DTT0FEBPathCorrection::DTT0FEBPathCorrection(const ParameterSet& pset)
: calibChamber_(pset.getParameter<string>("calibChamber")) {
DTT0FEBPathCorrection::DTT0FEBPathCorrection(const ParameterSet& pset, edm::ConsumesCollector cc)
: calibChamber_(pset.getParameter<string>("calibChamber")), t0Token_(cc.esConsumes()) {
//DTChamberId chosenChamberId;
if (!calibChamber_.empty() && calibChamber_ != "None" && calibChamber_ != "All") {
stringstream linestr;
Expand All @@ -43,8 +44,8 @@ namespace dtCalibration {
void DTT0FEBPathCorrection::setES(const EventSetup& setup) {
// Get t0 record from DB
ESHandle<DTT0> t0H;
setup.get<DTT0Rcd>().get(t0H);
t0Map_ = &*t0H;
t0H = setup.getHandle(t0Token_);
t0Map_ = &setup.getData(t0Token_);
LogVerbatim("Calibration") << "[DTT0FEBPathCorrection] T0 version: " << t0H->version();
}

Expand Down
Loading