Skip to content

Commit

Permalink
Merge branch 'master' into DTVDriftFormat2_120X
Browse files Browse the repository at this point in the history
  • Loading branch information
namapane authored Jul 28, 2021
2 parents 1a94dfd + f904c81 commit e98692d
Show file tree
Hide file tree
Showing 1,799 changed files with 283,729 additions and 245,643 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "Geometry/CommonTopologies/interface/GeometryAligner.h"
#include "CondFormats/GeometryObjects/interface/PTrackerParameters.h"
#include "Geometry/Records/interface/PTrackerParametersRcd.h"
#include "Geometry/Records/interface/PTrackerAdditionalParametersPerDetRcd.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "CondFormats/AlignmentRecord/interface/TrackerAlignmentRcd.h"
#include "CondFormats/AlignmentRecord/interface/TrackerAlignmentErrorExtendedRcd.h"
Expand Down Expand Up @@ -88,6 +89,7 @@ class AlignmentMonitorAsAnalyzer : public edm::one::EDAnalyzer<> {
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> esTokenTTopo_;
const edm::ESGetToken<GeometricDet, IdealGeometryRecord> esTokenGeomDet_;
const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> esTokenPTP_;
const edm::ESGetToken<PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd> esTokenPtitp_;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> esTokenDT_;
const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> esTokenCSC_;
const edm::ESGetToken<GEMGeometry, MuonGeometryRecord> esTokenGEM_;
Expand Down Expand Up @@ -120,6 +122,7 @@ AlignmentMonitorAsAnalyzer::AlignmentMonitorAsAnalyzer(const edm::ParameterSet&
esTokenTTopo_(esConsumes()),
esTokenGeomDet_(esConsumes()),
esTokenPTP_(esConsumes()),
esTokenPtitp_(esConsumes()),
esTokenDT_(esConsumes(edm::ESInputTag("", "idealForAlignmentMonitorAsAnalyzer"))),
esTokenCSC_(esConsumes(edm::ESInputTag("", "idealForAlignmentMonitorAsAnalyzer"))),
esTokenGEM_(esConsumes(edm::ESInputTag("", "idealForAlignmentMonitorAsAnalyzer"))),
Expand Down Expand Up @@ -155,8 +158,9 @@ void AlignmentMonitorAsAnalyzer::analyze(const edm::Event& iEvent, const edm::Ev

const GeometricDet* geom = &iSetup.getData(esTokenGeomDet_);
const PTrackerParameters& ptp = iSetup.getData(esTokenPTP_);
const PTrackerAdditionalParametersPerDet* ptitp = &iSetup.getData(esTokenPtitp_);
TrackerGeomBuilderFromGeometricDet trackerBuilder;
std::shared_ptr<TrackerGeometry> theTracker(trackerBuilder.build(geom, ptp, tTopo));
std::shared_ptr<TrackerGeometry> theTracker(trackerBuilder.build(geom, ptitp, ptp, tTopo));

edm::ESHandle<DTGeometry> theMuonDT = iSetup.getHandle(esTokenDT_);
edm::ESHandle<CSCGeometry> theMuonCSC = iSetup.getHandle(esTokenCSC_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "CondFormats/AlignmentRecord/interface/TrackerSurveyRcd.h"
#include "CondFormats/AlignmentRecord/interface/TrackerSurveyErrorExtendedRcd.h"
#include "CondFormats/GeometryObjects/interface/PTrackerParameters.h"
#include "CondFormats/GeometryObjects/interface/PTrackerAdditionalParametersPerDet.h"
#include "CondFormats/Common/interface/Time.h"

#include "FWCore/Framework/interface/ESHandle.h"
Expand All @@ -59,6 +60,7 @@
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "Geometry/Records/interface/PTrackerAdditionalParametersPerDetRcd.h"

#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"

Expand Down Expand Up @@ -248,12 +250,12 @@ class AlignmentProducerBase {
const bool saveToDB_, saveApeToDB_, saveDeformationsToDB_;
const bool useSurvey_;
const bool enableAlignableUpdates_;
std::string idealGeometryLabel;

/*** ESTokens ***/
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> ttopoToken_;
const edm::ESGetToken<GeometricDet, IdealGeometryRecord> geomDetToken_;
const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> ptpToken_;
const edm::ESGetToken<PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd> ptitpToken_;
const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeomToken_;
const edm::ESGetToken<GEMGeometry, MuonGeometryRecord> gemGeomToken_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,12 @@
# update alignables if triggered by corresponding input IOV boundary
enableAlignableUpdates = cms.bool(False),
)
DTGeometryAlignmentProducerAsAnalyzer = cms.ESProducer("DTGeometryESModule",
appendToDataLabel = cms.string('idealForAlignmentProducerBase'),
applyAlignment = cms.bool(False),
alignmentsLabel = cms.string(''),
fromDDD = cms.bool(True)
)
CSCGeometryAlignmentProducerAsAnalyzer = cms.ESProducer("CSCGeometryESModule",
appendToDataLabel = cms.string('idealForAlignmentProducerBase'),
debugV = cms.untracked.bool(False),
useGangedStripsInME1a = cms.bool(False),
alignmentsLabel = cms.string(''),
useOnlyWiresInME1a = cms.bool(False),
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)
GEMGeometryAlignmentProducerAsAnalyzer = cms.ESProducer("GEMGeometryESModule",
appendToDataLabel = cms.string('idealForAlignmentProducerBase'),
applyAlignment = cms.bool(False),
alignmentsLabel = cms.string(''),
fromDDD = cms.bool(True),
fromDD4Hep = cms.bool(False)
)
import Geometry.DTGeometryBuilder.dtGeometryDB_cfi
DTGeometryAlignmentProducerAsAnalyzer = Geometry.DTGeometryBuilder.dtGeometryDB_cfi.DTGeometryESModule.clone()
DTGeometryAlignmentProducerAsAnalyzer.appendToDataLabel = 'idealForAlignmentProducerBase'
import Geometry.CSCGeometryBuilder.cscGeometryDB_cfi
CSCGeometryAlignmentProducerAsAnalyzer = Geometry.CSCGeometryBuilder.cscGeometryDB_cfi.CSCGeometryESModule.clone()
CSCGeometryAlignmentProducerAsAnalyzer.appendToDataLabel = 'idealForAlignmentProducerBase'
import Geometry.GEMGeometryBuilder.gemGeometryDB_cfi
GEMGeometryAlignmentProducerAsAnalyzer = Geometry.GEMGeometryBuilder.gemGeometryDB_cfi.GEMGeometryESModule.clone()
GEMGeometryAlignmentProducerAsAnalyzer.appendToDataLabel = 'idealForAlignmentProducerBase'
35 changes: 10 additions & 25 deletions Alignment/CommonAlignmentProducer/python/AlignmentProducer_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,13 @@
# update alignables if triggered by corresponding input IOV boundary
enableAlignableUpdates = cms.bool(False),
)
DTGeometryAlignmentProducer = cms.ESProducer("DTGeometryESModule",
appendToDataLabel = cms.string('idealForAlignmentProducerBase'),
applyAlignment = cms.bool(False), ## to be abondoned (?)
alignmentsLabel = cms.string(''),
fromDDD = cms.bool(True)
)
CSCGeometryAlignmentProducer = cms.ESProducer("CSCGeometryESModule",
appendToDataLabel = cms.string('idealForAlignmentProducerBase'),
debugV = cms.untracked.bool(False),
useGangedStripsInME1a = cms.bool(False),
alignmentsLabel = cms.string(''),
useOnlyWiresInME1a = cms.bool(False),
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False), ## GF: to be abandoned
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)
GEMGeometryAlignmentProducer = cms.ESProducer("GEMGeometryESModule",
appendToDataLabel = cms.string('idealForAlignmentProducerBase'),
applyAlignment = cms.bool(False),
alignmentsLabel = cms.string(''),
fromDDD = cms.bool(True),
fromDD4Hep = cms.bool(False)
)

import Geometry.DTGeometryBuilder.dtGeometryDB_cfi
DTGeometryAlignmentProducerAsAnalyzer = Geometry.DTGeometryBuilder.dtGeometryDB_cfi.DTGeometryESModule.clone()
DTGeometryAlignmentProducerAsAnalyzer.appendToDataLabel = 'idealForAlignmentProducerBase'
import Geometry.CSCGeometryBuilder.cscGeometryDB_cfi
CSCGeometryAlignmentProducerAsAnalyzer = Geometry.CSCGeometryBuilder.cscGeometryDB_cfi.CSCGeometryESModule.clone()
CSCGeometryAlignmentProducerAsAnalyzer.appendToDataLabel = 'idealForAlignmentProducerBase'
import Geometry.GEMGeometryBuilder.gemGeometryDB_cfi
GEMGeometryAlignmentProducerAsAnalyzer = Geometry.GEMGeometryBuilder.gemGeometryDB_cfi.GEMGeometryESModule.clone()
GEMGeometryAlignmentProducerAsAnalyzer.appendToDataLabel = 'idealForAlignmentProducerBase'
20 changes: 9 additions & 11 deletions Alignment/CommonAlignmentProducer/src/AlignmentProducerBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ AlignmentProducerBase::AlignmentProducerBase(const edm::ParameterSet& config, ed
saveDeformationsToDB_{config.getParameter<bool>("saveDeformationsToDB")},
useSurvey_{config.getParameter<bool>("useSurvey")},
enableAlignableUpdates_{config.getParameter<bool>("enableAlignableUpdates")},
idealGeometryLabel("idealForAlignmentProducerBase"),
ttopoToken_(iC.esConsumes<edm::Transition::BeginRun>()),
geomDetToken_(iC.esConsumes<edm::Transition::BeginRun>()),
ptpToken_(iC.esConsumes<edm::Transition::BeginRun>()),
//dtGeomToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "idealForAlignmentProducerBase"))),
//cscGeomToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "idealForAlignmentProducerBase"))),
//gemGeomToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "idealForAlignmentProducerBase"))),
ptitpToken_(iC.esConsumes<edm::Transition::BeginRun>()),
dtGeomToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "idealForAlignmentProducerBase"))),
cscGeomToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "idealForAlignmentProducerBase"))),
gemGeomToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "idealForAlignmentProducerBase"))),
tkAliToken_(iC.esConsumes<edm::Transition::BeginRun>()),
dtAliToken_(iC.esConsumes<edm::Transition::BeginRun>()),
cscAliToken_(iC.esConsumes<edm::Transition::BeginRun>()),
Expand Down Expand Up @@ -431,17 +431,15 @@ void AlignmentProducerBase::createGeometries(const edm::EventSetup& iSetup, cons
if (doTracker_) {
const GeometricDet* geometricDet = &iSetup.getData(geomDetToken_);
const PTrackerParameters* ptp = &iSetup.getData(ptpToken_);
const PTrackerAdditionalParametersPerDet* ptitp = &iSetup.getData(ptitpToken_);
TrackerGeomBuilderFromGeometricDet trackerBuilder;
trackerGeometry_ = std::shared_ptr<TrackerGeometry>(trackerBuilder.build(geometricDet, *ptp, tTopo));
trackerGeometry_ = std::shared_ptr<TrackerGeometry>(trackerBuilder.build(geometricDet, ptitp, *ptp, tTopo));
}

if (doMuon_) {
iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, muonDTGeometry_);
iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, muonCSCGeometry_);
iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, muonGEMGeometry_);
//muonDTGeometry_ = iSetup.getHandle(dtGeomToken_);
//muonCSCGeometry_ = iSetup.getHandle(cscGeomToken_);
//muonGEMGeometry_ = iSetup.getHandle(gemGeomToken_);
muonDTGeometry_ = iSetup.getHandle(dtGeomToken_);
muonCSCGeometry_ = iSetup.getHandle(cscGeomToken_);
muonGEMGeometry_ = iSetup.getHandle(gemGeomToken_);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from copy import deepcopy
import FWCore.ParameterSet.Config as cms
import FWCore.PythonUtilities.LumiList as LumiList
import six

# Helper functions
def getPSetDict(thePSet):
Expand All @@ -14,7 +13,7 @@ def insertValToPSet(name,val,thePSet):
setattr(thePSet,name,val)

def insertPSetToPSet(inPSet, outPSet):
for key,val in getPSetDict(six.iteritems(inPSet)):
for key,val in getPSetDict(inPSet.items()):
insertValToPSet(key,val,outPSet)

def insertPSetToVPSet(inPSet, outVPSet):
Expand Down Expand Up @@ -112,7 +111,7 @@ def parseOptions(self):

def interpretOptions(self):
gttogetpsets=[]
for key,val in six.iteritems(self.optdict):
for key,val in self.optdict.items():
# Get GT name
if key=="gt":
autofind=val.find("auto")
Expand Down
6 changes: 5 additions & 1 deletion Alignment/LaserAlignment/plugins/LaserAlignment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include "FWCore/Framework/interface/Run.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "CondFormats/GeometryObjects/interface/PTrackerParameters.h"
#include "CondFormats/GeometryObjects/interface/PTrackerAdditionalParametersPerDet.h"
#include "Geometry/Records/interface/PTrackerParametersRcd.h"
#include "Geometry/Records/interface/PTrackerAdditionalParametersPerDetRcd.h"

///
///
Expand All @@ -21,6 +23,7 @@ LaserAlignment::LaserAlignment(edm::ParameterSet const& theConf)
geomToken_(esConsumes()),
geomDetToken_(esConsumes()),
ptpToken_(esConsumes()),
ptitpToken_(esConsumes()),
gprToken_(esConsumes()),
stripPedestalsToken_(esConsumes()),
theEvents(0),
Expand Down Expand Up @@ -298,9 +301,10 @@ void LaserAlignment::produce(edm::Event& theEvent, edm::EventSetup const& theSet
// the AlignableTracker object is initialized with the ideal geometry
const GeometricDet* theGeometricDet = &theSetup.getData(geomDetToken_);
const PTrackerParameters* ptp = &theSetup.getData(ptpToken_);
const PTrackerAdditionalParametersPerDet* ptitp = &theSetup.getData(ptitpToken_);

TrackerGeomBuilderFromGeometricDet trackerBuilder;
TrackerGeometry* theRefTracker = trackerBuilder.build(&*theGeometricDet, *ptp, tTopo);
TrackerGeometry* theRefTracker = trackerBuilder.build(&*theGeometricDet, &*ptitp, *ptp, tTopo);

theAlignableTracker = new AlignableTracker(&(*theRefTracker), tTopo);
} else {
Expand Down
1 change: 1 addition & 0 deletions Alignment/LaserAlignment/plugins/LaserAlignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class LaserAlignment : public edm::one::EDProducer<edm::EndRunProducer> {
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
const edm::ESGetToken<GeometricDet, IdealGeometryRecord> geomDetToken_;
const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> ptpToken_;
const edm::ESGetToken<PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd> ptitpToken_;
const edm::ESGetToken<Alignments, GlobalPositionRcd> gprToken_;
const edm::ESGetToken<SiStripPedestals, SiStripPedestalsRcd> stripPedestalsToken_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ MillePedeDQMModule ::MillePedeDQMModule(const edm::ParameterSet& config)
: tTopoToken_(esConsumes<edm::Transition::BeginRun>()),
gDetToken_(esConsumes<edm::Transition::BeginRun>()),
ptpToken_(esConsumes<edm::Transition::BeginRun>()),
ptitpToken_(esConsumes<edm::Transition::BeginRun>()),
aliThrToken_(esConsumes<edm::Transition::BeginRun>()),
mpReaderConfig_(config.getParameter<edm::ParameterSet>("MillePedeFileReader")) {
consumes<AlignmentToken, edm::InProcess>(config.getParameter<edm::InputTag>("alignmentTokenSrc"));
Expand Down Expand Up @@ -87,6 +88,7 @@ void MillePedeDQMModule ::beginRun(const edm::Run&, const edm::EventSetup& setup
const TrackerTopology* const tTopo = &setup.getData(tTopoToken_);
const GeometricDet* geometricDet = &setup.getData(gDetToken_);
const PTrackerParameters* ptp = &setup.getData(ptpToken_);
const PTrackerAdditionalParametersPerDet* ptitp = &setup.getData(ptitpToken_);

// take the thresholds from DB
const auto& thresholds_ = &setup.getData(aliThrToken_);
Expand All @@ -96,7 +98,7 @@ void MillePedeDQMModule ::beginRun(const edm::Run&, const edm::EventSetup& setup

TrackerGeomBuilderFromGeometricDet builder;

const auto trackerGeometry = builder.build(geometricDet, *ptp, tTopo);
const auto trackerGeometry = builder.build(geometricDet, ptitp, *ptp, tTopo);
tracker_ = std::make_unique<AlignableTracker>(trackerGeometry, tTopo);

const std::string labelerPlugin{"PedeLabeler"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
/*** Records for ESWatcher ***/
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/Records/interface/PTrackerParametersRcd.h"
#include "Geometry/Records/interface/PTrackerAdditionalParametersPerDetRcd.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"

/*** MillePede ***/
Expand Down Expand Up @@ -80,6 +81,7 @@ class MillePedeDQMModule : public DQMEDHarvester {
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
const edm::ESGetToken<GeometricDet, IdealGeometryRecord> gDetToken_;
const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> ptpToken_;
const edm::ESGetToken<PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd> ptitpToken_;
const edm::ESGetToken<AlignPCLThresholds, AlignPCLThresholdsRcd> aliThrToken_;

const edm::ParameterSet mpReaderConfig_;
Expand Down
5 changes: 2 additions & 3 deletions Alignment/MillePedeAlignmentAlgorithm/python/mpslib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import CondCore.Utilities.conddblib as conddb
from functools import reduce

import six

def create_single_iov_db(inputs, run_number, output_db):
"""Create an sqlite file with single-IOV tags for alignment payloads.
Expand All @@ -22,7 +21,7 @@ def create_single_iov_db(inputs, run_number, output_db):
"""

# find the IOV containing `run_number`
for record,tag in six.iteritems(inputs):
for record,tag in inputs.items():
run_is_covered = False
for iov in reversed(tag["iovs"]):
if iov <= run_number:
Expand All @@ -40,7 +39,7 @@ def create_single_iov_db(inputs, run_number, output_db):
result = {}
remove_existing_object(output_db)

for record,tag in six.iteritems(inputs):
for record,tag in inputs.items():
result[record] = {"connect": "sqlite_file:"+output_db,
"tag": "_".join([tag["tag"], tag["since"]])}

Expand Down
Loading

0 comments on commit e98692d

Please sign in to comment.