Skip to content

Commit

Permalink
Merge tag 'CMSSW_14_2_0_pre3' into CMSSW_14_1_0_pre3_LST_X_LSTCore_re…
Browse files Browse the repository at this point in the history
…alfiles
  • Loading branch information
ariostas committed Oct 29, 2024
2 parents 04d02b4 + b96fd02 commit 4d603ca
Show file tree
Hide file tree
Showing 1,318 changed files with 109,782 additions and 77,952 deletions.
2 changes: 1 addition & 1 deletion Alignment/CommonAlignment/src/Utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ align::PositionType align::motherPosition(const std::vector<const PositionType*>

Scalar inv = 1. / static_cast<Scalar>(nDau);

return PositionType(posX *= inv, posY *= inv, posZ *= inv);
return PositionType(posX * inv, posY * inv, posZ * inv);
}

align::RotationType align::diffRot(const GlobalVectors& current, const GlobalVectors& nominal) {
Expand Down
4 changes: 0 additions & 4 deletions Alignment/LaserAlignment/src/LASGlobalData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@
#ifndef __LASGLOBALDATA_C
#define __LASGLOBALDATA_C





#endif
4 changes: 3 additions & 1 deletion Alignment/MillePedeAlignmentAlgorithm/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<use name="Alignment/CommonAlignmentParametrization"/>
<use name="Alignment/MuonAlignment"/>
<use name="Alignment/ReferenceTrajectories"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/PCLConfig"/>
<use name="CondFormats/SiPixelObjects"/>
<use name="DataFormats/CLHEP"/>
<use name="DataFormats/SiStripDetId"/>
<use name="DataFormats/GeometryVector"/>
<use name="DataFormats/SiStripDetId"/>
<use name="DataFormats/TrackReco"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
/*** core framework functionality ***/
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

/*** Alignment ***/
#include "Alignment/MillePedeAlignmentAlgorithm/interface/PedeLabelerBase.h"
#include "CondFormats/PCLConfig/interface/AlignPCLThresholdsHG.h"
#include "Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h"

/*** Quality ****/
#include "CondFormats/SiPixelObjects/interface/SiPixelQuality.h"

struct mpPCLresults {
private:
bool m_isHG;
Expand Down Expand Up @@ -65,10 +69,13 @@ class MillePedeFileReader {
explicit MillePedeFileReader(const edm::ParameterSet&,
const std::shared_ptr<const PedeLabelerBase>&,
const std::shared_ptr<const AlignPCLThresholdsHG>&,
const std::shared_ptr<const PixelTopologyMap>&);
const std::shared_ptr<const PixelTopologyMap>&,
const std::shared_ptr<const SiPixelQuality>&);

virtual ~MillePedeFileReader() = default;

static void fillPSetDescription(edm::ParameterSetDescription& desc);

void read();
bool storeAlignments();

Expand Down Expand Up @@ -148,6 +155,7 @@ class MillePedeFileReader {
std::string getStringFromHLS(PclHLS HLS);
int getIndexForHG(align::ID id, PclHLS HLS);
void initializeIndexHelper();
bool isAlignableActive(const Alignable* alignable, const std::shared_ptr<const SiPixelQuality>& pixelQual);

//========================== PRIVATE DATA ====================================
//============================================================================
Expand All @@ -161,6 +169,12 @@ class MillePedeFileReader {
// PixelTopologyMap
const std::shared_ptr<const PixelTopologyMap> pixelTopologyMap_;

// switch to ignor inactive alignables when vetoing
const bool ignoreInactiveAlignables_;

// SiPixelQuality
const std::shared_ptr<const SiPixelQuality> quality_;

// input directory name
std::string dirName_;

Expand Down
12 changes: 7 additions & 5 deletions Alignment/MillePedeAlignmentAlgorithm/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<use name="Alignment/MillePedeAlignmentAlgorithm"/>
<use name="Alignment/SurveyAnalysis"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="CommonTools/UtilAlgos"/>
<use name="CondFormats/Common"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/GeometryObjects"/>
<use name="CondFormats/SiPixelObjects"/>
<use name="DQMServices/Core"/>
<use name="DataFormats/HepMCCandidate"/>
<use name="DataFormats/TrackerCommon"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="DQMServices/Core"/>
<use name="Alignment/MillePedeAlignmentAlgorithm"/>
<flags EDM_PLUGIN="1"/>
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ MillePedeAlignmentAlgorithm::MillePedeAlignmentAlgorithm(const edm::ParameterSet
: AlignmentAlgorithmBase(cfg, iC),
topoToken_(iC.esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()),
aliThrToken_(iC.esConsumes<AlignPCLThresholdsHG, AlignPCLThresholdsHGRcd, edm::Transition::BeginRun>()),
siPixelQualityToken_(iC.esConsumes<SiPixelQuality, SiPixelQualityFromDbRcd, edm::Transition::BeginRun>()),
geomToken_(iC.esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
theConfig(cfg),
theMode(this->decodeMode(theConfig.getUntrackedParameter<std::string>("mode"))),
Expand All @@ -113,6 +114,7 @@ MillePedeAlignmentAlgorithm::MillePedeAlignmentAlgorithm(const edm::ParameterSet
cond::timeTypeSpecs[cond::runnumber].beginValue)),
enforceSingleIOVInput_(!(enableAlignableUpdates_ && areIOVsSpecified())),
lastProcessedRun_(cond::timeTypeSpecs[cond::runnumber].beginValue) {
pixelQuality = nullptr;
if (!theDir.empty() && theDir.find_last_of('/') != theDir.size() - 1)
theDir += '/'; // may need '/'
edm::LogInfo("Alignment") << "@SUB=MillePedeAlignmentAlgorithm"
Expand Down Expand Up @@ -187,6 +189,11 @@ void MillePedeAlignmentAlgorithm::initialize(const edm::EventSetup &setup,
theThresholds = std::make_shared<AlignPCLThresholdsHG>();
storeThresholds(th->getNrecords(), th->getThreshold_Map(), th->getFloatMap());

// Retrieve the SiPixelQuality object from setup
const SiPixelQuality &qual = setup.getData(siPixelQualityToken_);
// Create a new SiPixelQuality object on the heap using the copy constructor
pixelQuality = std::make_shared<SiPixelQuality>(qual);

//Retrieve tracker geometry
const TrackerGeometry *tGeom = &setup.getData(geomToken_);
//Retrieve PixelTopologyMap
Expand Down Expand Up @@ -330,7 +337,8 @@ bool MillePedeAlignmentAlgorithm::storeAlignments() {
MillePedeFileReader mpReader(theConfig.getParameter<edm::ParameterSet>("MillePedeFileReader"),
thePedeLabels,
theThresholds,
pixelTopologyMap);
pixelTopologyMap,
pixelQuality);
mpReader.read();
return mpReader.storeAlignments();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#include "CondFormats/PCLConfig/interface/AlignPCLThresholdsHG.h"
#include "CondFormats/DataRecord/interface/AlignPCLThresholdsHGRcd.h"

#include "CondFormats/SiPixelObjects/interface/SiPixelQuality.h"
#include "CondFormats/DataRecord/interface/SiPixelQualityFromDbRcd.h"

#include <vector>
#include <string>
#include <memory>
Expand Down Expand Up @@ -275,6 +278,7 @@ class MillePedeAlignmentAlgorithm : public AlignmentAlgorithmBase {

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
const edm::ESGetToken<AlignPCLThresholdsHG, AlignPCLThresholdsHGRcd> aliThrToken_;
const edm::ESGetToken<SiPixelQuality, SiPixelQualityFromDbRcd> siPixelQualityToken_;
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;

enum EModeBit { myMilleBit = 1 << 0, myPedeRunBit = 1 << 1, myPedeSteerBit = 1 << 2, myPedeReadBit = 1 << 3 };
Expand All @@ -297,6 +301,7 @@ class MillePedeAlignmentAlgorithm : public AlignmentAlgorithmBase {
std::vector<IntegratedCalibrationBase *> theCalibrations;
std::shared_ptr<AlignPCLThresholdsHG> theThresholds;
std::shared_ptr<PixelTopologyMap> pixelTopologyMap;
std::shared_ptr<SiPixelQuality> pixelQuality;
unsigned int theMinNumHits;
double theMaximalCor2D; /// maximal correlation allowed for 2D hit in TID/TEC.
/// If larger, the 2D measurement gets diagonalized!!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ MillePedeDQMModule ::MillePedeDQMModule(const edm::ParameterSet& config)
ptpToken_(esConsumes<edm::Transition::BeginRun>()),
ptitpToken_(esConsumes<edm::Transition::BeginRun>()),
aliThrToken_(esConsumes<edm::Transition::BeginRun>()),
siPixelQualityToken_(esConsumes<edm::Transition::BeginRun>()),
geomToken_(esConsumes<edm::Transition::BeginRun>()),
outputFolder_(config.getParameter<std::string>("outputFolder")),
mpReaderConfig_(config.getParameter<edm::ParameterSet>("MillePedeFileReader")),
isHG_(mpReaderConfig_.getParameter<bool>("isHG")) {
consumes<AlignmentToken, edm::InProcess>(config.getParameter<edm::InputTag>("alignmentTokenSrc"));
}

MillePedeDQMModule ::~MillePedeDQMModule() {}

//=============================================================================
//=== INTERFACE IMPLEMENTATION ===
//=============================================================================
Expand Down Expand Up @@ -181,6 +180,11 @@ void MillePedeDQMModule ::beginRun(const edm::Run&, const edm::EventSetup& setup
const PTrackerAdditionalParametersPerDet* ptitp = &setup.getData(ptitpToken_);
const TrackerGeometry* geom = &setup.getData(geomToken_);

// Retrieve the SiPixelQuality object from setup
const SiPixelQuality& qual = setup.getData(siPixelQualityToken_);
// Create a new SiPixelQuality object on the heap using the copy constructor
pixelQuality_ = std::make_shared<SiPixelQuality>(qual);

pixelTopologyMap_ = std::make_shared<PixelTopologyMap>(geom, tTopo);

// take the thresholds from DB
Expand All @@ -203,8 +207,11 @@ void MillePedeDQMModule ::beginRun(const edm::Run&, const edm::EventSetup& setup
std::shared_ptr<PedeLabelerBase> pedeLabeler{PedeLabelerPluginFactory::get()->create(
labelerPlugin, PedeLabelerBase::TopLevelAlignables(tracker_.get(), nullptr, nullptr), labelerConfig)};

mpReader_ = std::make_unique<MillePedeFileReader>(
mpReaderConfig_, pedeLabeler, std::shared_ptr<const AlignPCLThresholdsHG>(myThresholds), pixelTopologyMap_);
mpReader_ = std::make_unique<MillePedeFileReader>(mpReaderConfig_,
pedeLabeler,
std::shared_ptr<const AlignPCLThresholdsHG>(myThresholds),
pixelTopologyMap_,
pixelQuality_);
}

void MillePedeDQMModule ::fillStatusHisto(MonitorElement* statusHisto) {
Expand Down Expand Up @@ -531,3 +538,15 @@ int MillePedeDQMModule ::getIndexFromString(const std::string& alignableId) {
<< "Retrieving conversion for not supported Alignable partition" << alignableId;
}
}

void MillePedeDQMModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::string>("outputFolder", "AlCaReco/SiPixelAli");
{
edm::ParameterSetDescription mpFileReaderPSet;
MillePedeFileReader::fillPSetDescription(mpFileReaderPSet);
desc.add<edm::ParameterSetDescription>("MillePedeFileReader", mpFileReaderPSet);
}
desc.add<edm::InputTag>("alignmentTokenSrc", edm::InputTag("SiPixelAliPedeAlignmentProducer"));
descriptions.addWithDefaultLabel(desc);
}
16 changes: 13 additions & 3 deletions Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
#include <memory>

/*** core framework functionality ***/
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Framework/interface/ESWatcher.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/ServiceRegistry/interface/Service.h"

/*** Geometry ***/
#include "CondFormats/GeometryObjects/interface/PTrackerParameters.h"
Expand All @@ -34,6 +36,10 @@
/*** Thresholds from DB ***/
#include "CondFormats/DataRecord/interface/AlignPCLThresholdsHGRcd.h"

/*** Quality from DB ***/
#include "CondFormats/SiPixelObjects/interface/SiPixelQuality.h"
#include "CondFormats/DataRecord/interface/SiPixelQualityFromDbRcd.h"

/*** DQM ***/
#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "DQMServices/Core/interface/DQMStore.h"
Expand All @@ -52,10 +58,12 @@ class MillePedeDQMModule : public DQMEDHarvester {
//========================== PUBLIC METHODS ==================================
public: //====================================================================
MillePedeDQMModule(const edm::ParameterSet&);
~MillePedeDQMModule() override;
~MillePedeDQMModule() override = default;

void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

enum { SIZE_LG_STRUCTS = 6, SIZE_HG_STRUCTS = 820, SIZE_INDEX = 8 };

//========================= PRIVATE METHODS ==================================
Expand Down Expand Up @@ -100,13 +108,15 @@ class MillePedeDQMModule : public DQMEDHarvester {
const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> ptpToken_;
const edm::ESGetToken<PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd> ptitpToken_;
const edm::ESGetToken<AlignPCLThresholdsHG, AlignPCLThresholdsHGRcd> aliThrToken_;
const edm::ESGetToken<SiPixelQuality, SiPixelQualityFromDbRcd> siPixelQualityToken_;
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;

const std::string outputFolder_;
const edm::ParameterSet mpReaderConfig_;
std::unique_ptr<AlignableTracker> tracker_;
std::unique_ptr<MillePedeFileReader> mpReader_;
std::shared_ptr<PixelTopologyMap> pixelTopologyMap_;
std::shared_ptr<SiPixelQuality> pixelQuality_;

std::vector<std::pair<std::string, int>> layerVec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

import Alignment.MillePedeAlignmentAlgorithm.MillePedeFileReader_cfi as MillePedeFileReader_cfi
import Alignment.MillePedeAlignmentAlgorithm.MillePedeFileReader_cfi as MillePedeFileReader_cfi

SiPixelAliDQMModule = DQMEDHarvester("MillePedeDQMModule",
outputFolder = cms.string("AlCaReco/SiPixelAli"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import FWCore.ParameterSet.Config as cms

MillePedeFileReader = cms.PSet(
fileDir = cms.string(''),

millePedeEndFile = cms.string('millepede.end'),
millePedeLogFile = cms.string('millepede.log'),
millePedeResFile = cms.string('millepede.res'),

isHG = cms.bool(False)
)
fileDir = cms.string(''),
ignoreInactiveAlignables = cms.bool(True),
millePedeEndFile = cms.string('millepede.end'),
millePedeLogFile = cms.string('millepede.log'),
millePedeResFile = cms.string('millepede.res'),
isHG = cms.bool(False)
)
Loading

0 comments on commit 4d603ca

Please sign in to comment.