Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cms-sw/cmssw into from-CM…
Browse files Browse the repository at this point in the history
…SSW_14_1_0_pre2
  • Loading branch information
jonamotta committed Apr 18, 2024
2 parents d3b3214 + 6e82cc8 commit 171f711
Show file tree
Hide file tree
Showing 505 changed files with 85,744 additions and 83,320 deletions.
2 changes: 0 additions & 2 deletions Alignment/Geners/interface/CPP11_type_traits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

#ifdef CPP11_STD_AVAILABLE
#include <type_traits>
#define CPP11_is_pod std::is_pod
#define CPP11_is_pointer std::is_pointer
#else
#include <tr1/type_traits>
#define CPP11_is_pod std::tr1::is_pod
#define CPP11_is_pointer std::tr1::is_pointer
#endif

Expand Down
2 changes: 1 addition & 1 deletion Alignment/Geners/interface/IOIsPOD.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace gs {
// at compile time if T belongs to one of the known POD types.
template <typename T>
struct IOIsPOD {
enum { value = CPP11_is_pod<T>::value };
enum { value = std::is_standard_layout<T>::value && std::is_trivial<T>::value };
};
} // namespace gs

Expand Down
32 changes: 16 additions & 16 deletions Alignment/Geners/interface/IOTraits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace gs {
template <class T>
struct IOTraits {
static const bool IsClass = IOIsClassType<T>::value;
enum { ISCLASS = 1 };
static constexpr int ISCLASS = 1;

// Pointers are not PODs for I/O purposes.
//
Expand All @@ -30,59 +30,59 @@ namespace gs {
// that we need to avoid.
static const bool IsPOD =
(IOIsPOD<T>::value && !IOIsContainer<T>::value && !CPP11_is_pointer<T>::value && !IOIsExternal<T>::value);
enum { ISPOD = 2 };
static constexpr int ISPOD = 2;

static const bool IsWritable = (IOIsWritable<T>::value && !IOIsExternal<T>::value);
enum { ISWRITABLE = 4 };
static constexpr int ISWRITABLE = 4;

static const bool IsStdContainer = (IOIsContainer<T>::value && !IOIsWritable<T>::value && !IOIsExternal<T>::value);
enum { ISSTDCONTAINER = 8 };
static constexpr int ISSTDCONTAINER = 8;

// Readable objects are required to be writable
static const bool IsPlaceReadable = (IOIsPlaceReadable<T>::value && IOIsWritable<T>::value);
enum { ISPLACEREADABLE = 16 };
static constexpr int ISPLACEREADABLE = 16;

// Prefer place readability to heap readability
static const bool IsHeapReadable =
(IOIsHeapReadable<T>::value && !IOIsPlaceReadable<T>::value && IOIsWritable<T>::value);
enum { ISHEAPREADABLE = 32 };
static constexpr int ISHEAPREADABLE = 32;

static const bool IsPointer = (CPP11_is_pointer<T>::value && !IOIsExternal<T>::value);
enum { ISPOINTER = 64 };
static constexpr int ISPOINTER = 64;

static const bool IsSharedPtr = (IOIsSharedPtr<T>::value && !IOIsExternal<T>::value);
enum { ISSHAREDPTR = 128 };
static constexpr int ISSHAREDPTR = 128;

static const bool IsPair = IOIsPair<T>::value;
enum { ISPAIR = 256 };
static constexpr int ISPAIR = 256;

static const bool IsString = IOIsString<T>::value;
enum { ISSTRING = 512 };
static constexpr int ISSTRING = 512;

// The following trait is relevant for containers only
static const bool IsContiguous = IOIsContiguous<T>::value;
enum { ISCONTIGUOUS = 1024 };
static constexpr int ISCONTIGUOUS = 1024;

static const bool IsTuple = IOIsTuple<T>::value;
enum { ISTUPLE = 2048 };
static constexpr int ISTUPLE = 2048;

static const bool IsIOPtr = IOIsIOPtr<T>::value;
enum { ISIOPTR = 4096 };
static constexpr int ISIOPTR = 4096;

// A catch-all definition for externally defined types which
// want to use the template-based I/O within this system but
// do not want to implement the standard "read/write" mechanism.
// The user has to declare the external type by modifying the
// "IOIsExternal" template.
static const bool IsExternal = IOIsExternal<T>::value;
enum { ISEXTERNAL = 8192 };
static constexpr int ISEXTERNAL = 8192;

// Special enums for heap-readable objects known
// to be called with zero pointer as an argument.
// In this case we will avoid compiling an assignment
// operator for the object.
enum { ISNULLPOINTER = 16384 };
enum { ISPUREHEAPREADABLE = 32768 };
static constexpr int ISNULLPOINTER = 16384;
static constexpr int ISPUREHEAPREADABLE = 32768;

static const int Signature = IsClass * ISCLASS + IsPOD * ISPOD + IsWritable * ISWRITABLE +
IsStdContainer * ISSTDCONTAINER + IsPlaceReadable * ISPLACEREADABLE +
Expand Down
4 changes: 4 additions & 0 deletions Alignment/MillePedeAlignmentAlgorithm/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
<test name="test-pede" command="pede -t">
<use name="millepede"/>
</test>

<test name="test_MilleZmm" command="test_mille.sh"/>
<test name="test_PedeCampaign" command="test_pede.sh"/>
<test name="test_PedeConversion" command="test_pedeConversion.sh">
<flags PRE_TEST="test_PedeCampaign"/>
</test>
<test name="test_PayloadSanity" command="test_payload_sanity.sh">
<flags PRE_TEST="test_PedeCampaign"/>
</test>
Expand Down
12 changes: 12 additions & 0 deletions Alignment/MillePedeAlignmentAlgorithm/test/align_params_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import FWCore.ParameterSet.Config as cms

_alignParams = cms.PSet(
alignParams = cms.vstring(
"TrackerP1PXBHalfBarrel,111111",
"TrackerP1PXECHalfCylinder,111111",
"TrackerTIBHalfBarrel,111111",
"TrackerTOBHalfBarrel,rrrrrr",
"TrackerTIDEndcap,111111",
"TrackerTECEndcap,111111",
)
)
111 changes: 111 additions & 0 deletions Alignment/MillePedeAlignmentAlgorithm/test/convertMPresToDB_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process("Alignment", Run3)

process.options = cms.untracked.PSet(
Rethrow = cms.untracked.vstring("ProductNotFound") # do not accept this exception
)

######################################################
# initialize MessageLogger
######################################################
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.files.alignment = cms.untracked.PSet(
DEBUG = cms.untracked.PSet(
limit = cms.untracked.int32(-1)
),
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(5),
reportEvery = cms.untracked.int32(5)
),
WARNING = cms.untracked.PSet(
limit = cms.untracked.int32(10)
),
ERROR = cms.untracked.PSet(
limit = cms.untracked.int32(-1)
),
Alignment = cms.untracked.PSet(
limit = cms.untracked.int32(-1),
reportEvery = cms.untracked.int32(1)
),
enableStatistics = cms.untracked.bool(True)
)

######################################################
# Design GT (in order to fetch the design geometry)
######################################################
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2024_design', '') # take your favourite

######################################################
# Starting alignment of the campaign
######################################################
from CondCore.CondDB.CondDB_cfi import *
CondDBConnection = CondDB.clone( connect = cms.string( 'sqlite_file:alignment_input.db' ) )
process.trackerAlignment = cms.ESSource("PoolDBESSource",
CondDBConnection,
toGet = cms.VPSet(cms.PSet(record = cms.string("TrackerAlignmentRcd"),
tag = cms.string("TrackerAlignment_PCL_byRun_v2_express_348155")
)
))

process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource", "trackerAlignment")

######################################################
# Alignment producer
######################################################
process.load("Configuration.Geometry.GeometryRecoDB_cff")
process.load("Alignment.CommonAlignmentProducer.AlignmentProducer_cff")

######################################################
#
# !!! This has to match the alignable selection
# of the pede configuration !!!
#
######################################################
from align_params_cff import _alignParams
process.AlignmentProducer.ParameterBuilder.Selector = _alignParams

######################################################
# Alignment Producer options
######################################################
process.AlignmentProducer.doMisalignmentScenario = False #True
process.AlignmentProducer.applyDbAlignment = True # either globalTag or trackerAlignment

######################################################
# assign by reference (i.e. could change MillePedeAlignmentAlgorithm as well):
######################################################
process.AlignmentProducer.algoConfig = process.MillePedeAlignmentAlgorithm
process.AlignmentProducer.algoConfig.mode = 'pedeRead' # reads millepede.res
process.AlignmentProducer.algoConfig.pedeReader.readFile = 'millepede.res'
process.AlignmentProducer.algoConfig.treeFile = 'my_treeFile.root'

######################################################
# Source
######################################################
process.source = cms.Source("EmptySource",
firstRun = cms.untracked.uint32(1) # choose your run!
)
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1) )

process.dump = cms.EDAnalyzer("EventContentAnalyzer")
process.p = cms.Path(process.dump)

# should not be needed, but is:
# otherwise AlignmentProducer does not call relevant algorithm part
process.AlignmentProducer.saveToDB = True

######################################################
# Output alignment payload from reading file
######################################################
CondDBConnectionOut = CondDB.clone( connect = cms.string( 'sqlite_file:convertedFromResFile.db' ) )
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
CondDBConnectionOut,
timetype = cms.untracked.string('runnumber'),
toPut = cms.VPSet(cms.PSet(record = cms.string('TrackerAlignmentRcd'),
tag = cms.string('Alignments')
)
)
)
15 changes: 3 additions & 12 deletions Alignment/MillePedeAlignmentAlgorithm/test/test_pede.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("Alignment")

################################################################################
Expand Down Expand Up @@ -36,7 +37,6 @@
import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.GeneralSetup as generalSetup
generalSetup.setup(process, setupGlobaltag, setupCosmicsZeroTesla)


################################################################################
# setup alignment producer
# ------------------------------------------------------------------------------
Expand All @@ -50,7 +50,6 @@
primaryWidth = setupPrimaryWidth,
cosmicsZeroTesla = setupCosmicsZeroTesla)


################################################################################
# Overwrite some conditions in global tag
# ------------------------------------------------------------------------------
Expand All @@ -69,16 +68,8 @@
]
#
# # Define the high-level structure alignables
process.AlignmentProducer.ParameterBuilder.SelectorRigid = cms.PSet(
alignParams = cms.vstring(
"TrackerP1PXBHalfBarrel,111111",
"TrackerP1PXECHalfCylinder,111111",
"TrackerTIBHalfBarrel,111111",
"TrackerTOBHalfBarrel,rrrrrr",
"TrackerTIDEndcap,111111",
"TrackerTECEndcap,111111",
)
)
from align_params_cff import _alignParams
process.AlignmentProducer.ParameterBuilder.SelectorRigid = _alignParams

#########################
## insert Pedesettings ##
Expand Down
2 changes: 1 addition & 1 deletion Alignment/MillePedeAlignmentAlgorithm/test/test_pede.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ clean_up(){
echo -e "\nCleaning the local test area"
rm -fr milleBinary00*
rm -fr pedeSteer*
rm -fr millepede.*
#rm -fr millepede.*
rm -fr *.root
rm -fr *.log
rm -fr *.dat
Expand Down
14 changes: 14 additions & 0 deletions Alignment/MillePedeAlignmentAlgorithm/test/test_pedeConversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
function die { echo $1: status $2; exit $2; }

LOCAL_TEST_DIR=${SCRAM_TEST_PATH}

echo "============== testing conversion to DB file from millepede.res"
(cmsRun ${LOCAL_TEST_DIR}/convertMPresToDB_cfg.py) || die 'failed running convertMPresToDB_cfg.py' $?

echo -e "Content of the current directory is: "`ls .`

INPUTFILE=convertedFromResFile.db

echo -e "\n\n============== testing converted file corresponds to input"
(cmsRun ${SCRAM_TEST_PATH}/AlignmentRcdChecker_cfg.py inputSqliteFile=${INPUTFILE}) || die 'failed running AlignmentRcdChecker' $?
27 changes: 14 additions & 13 deletions Alignment/OfflineValidation/interface/DiLeptonVertexHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,22 @@ namespace DiLeptonHelp {
continue;

if (((TObject*)histo)->InheritsFrom("TH2")) {
m_h2_map[etaReg] =
fs.make<TH2F>((name + "_" + m_etaRegionNames[etaReg]).c_str(),
(title + m_etaRegionNames[etaReg] + ";" + xTitle + ";" + yTitle + ";" + zTitle).c_str(),
m_h2_map[etaReg] = fs.make<TH2F>(
(name + "_" + m_etaRegionNames[etaReg]).c_str(),
(title + " (" + m_etaRegionNames[etaReg] + ");" + xTitle + ";" + yTitle + ";" + zTitle).c_str(),
histo->GetNbinsX(),
histo->GetXaxis()->GetXmin(),
histo->GetXaxis()->GetXmax(),
histo->GetNbinsY(),
histo->GetYaxis()->GetXmin(),
histo->GetYaxis()->GetXmax());
} else {
m_h1_map[etaReg] =
fs.make<TH1F>((name + "_" + m_etaRegionNames[etaReg]).c_str(),
(title + " (" + m_etaRegionNames[etaReg] + ");" + xTitle + ";" + yTitle).c_str(),
histo->GetNbinsX(),
histo->GetXaxis()->GetXmin(),
histo->GetXaxis()->GetXmax(),
histo->GetNbinsY(),
histo->GetYaxis()->GetXmin(),
histo->GetYaxis()->GetXmax());
} else {
m_h1_map[etaReg] = fs.make<TH1F>((name + "_" + m_etaRegionNames[etaReg]).c_str(),
(title + m_etaRegionNames[etaReg] + ";" + xTitle + ";" + yTitle).c_str(),
histo->GetNbinsX(),
histo->GetXaxis()->GetXmin(),
histo->GetXaxis()->GetXmax());
histo->GetXaxis()->GetXmax());
}
}

Expand Down
Loading

0 comments on commit 171f711

Please sign in to comment.