Skip to content

Commit

Permalink
Merge branch 'master' into L1TRemoveTag
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami committed Dec 19, 2021
2 parents 9afe3b1 + 0e96354 commit 5120c82
Show file tree
Hide file tree
Showing 89 changed files with 3,642 additions and 1,060 deletions.
Expand Up @@ -3431,9 +3431,9 @@ void GlobalTrackerMuonAlignment::writeGlPosRcd(CLHEP::HepVector& paramVec) {
throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";

// if (poolDbService->isNewTagRequest("GlobalPositionRcd")) {
// poolDbService->createNewIOV<Alignments>(&(*globalPositions), poolDbService->endOfTime(), "GlobalPositionRcd");
// poolDbService->createOneIOV<Alignments>(globalPositions, poolDbService->endOfTime(), "GlobalPositionRcd");
// } else {
// poolDbService->appendSinceTime<Alignments>(&(*globalPositions), poolDbService->currentTime(), "GlobalPositionRcd");
// poolDbService->appendOneIOV<Alignments>(globalPositions, poolDbService->currentTime(), "GlobalPositionRcd");
// }
poolDbService->writeOneIOV<Alignments>(globalPositions, poolDbService->currentTime(), "GlobalPositionRcd");
std::cout << "done!" << std::endl;
Expand Down
8 changes: 4 additions & 4 deletions Alignment/LaserAlignment/plugins/LaserAlignment.cc
Expand Up @@ -909,18 +909,18 @@ void LaserAlignment::endRunProduce(edm::Run& theRun, const edm::EventSetup& theS
// Store

// if ( poolDbService->isNewTagRequest(theAlignRecordName) ) {
// poolDbService->createNewIOV<Alignments>( alignments, poolDbService->currentTime(), poolDbService->endOfTime(), theAlignRecordName );
// poolDbService->createOneIOV<Alignments>( alignments, poolDbService->currentTime(), theAlignRecordName );
// }
// else {
// poolDbService->appendSinceTime<Alignments>( alignments, poolDbService->currentTime(), theAlignRecordName );
// poolDbService->appendOneIOV<Alignments>( alignments, poolDbService->currentTime(), theAlignRecordName );
// }
poolDbService->writeOneIOV<Alignments>(alignments, poolDbService->beginOfTime(), theAlignRecordName);

// if ( poolDbService->isNewTagRequest(theErrorRecordName) ) {
// poolDbService->createNewIOV<AlignmentErrorsExtended>( alignmentErrors, poolDbService->currentTime(), poolDbService->endOfTime(), theErrorRecordName );
// poolDbService->createOneIOV<AlignmentErrorsExtended>( alignmentErrors, poolDbService->currentTime(), poolDbService->endOfTime(), theErrorRecordName );
// }
// else {
// poolDbService->appendSinceTime<AlignmentErrorsExtended>( alignmentErrors, poolDbService->currentTime(), theErrorRecordName );
// poolDbService->appendOneIOV<AlignmentErrorsExtended>( alignmentErrors, poolDbService->currentTime(), theErrorRecordName );
// }
poolDbService->writeOneIOV<AlignmentErrorsExtended>(
alignmentErrors, poolDbService->beginOfTime(), theErrorRecordName);
Expand Down
8 changes: 4 additions & 4 deletions Alignment/TrackerAlignment/src/TrackerAlignment.cc
Expand Up @@ -242,19 +242,19 @@ void TrackerAlignment::saveToDB(void) {
AlignmentErrorsExtended alignmentErrors = *(theAlignableTracker->alignmentErrors());

// if ( poolDbService->isNewTagRequest(theAlignRecordName) )
// poolDbService->createNewIOV<Alignments>( alignments, poolDbService->endOfTime(),
// poolDbService->createOneIOV<Alignments>( alignments, poolDbService->endOfTime(),
// theAlignRecordName );
// else
// poolDbService->appendSinceTime<Alignments>( alignments, poolDbService->currentTime(),
// poolDbService->appendOneIOV<Alignments>( alignments, poolDbService->currentTime(),
// theAlignRecordName );
// In the two calls below it is assumed that the delete of "theAlignableTracker" is also deleting the two concerned payloads...
poolDbService->writeOneIOV<Alignments>(alignments, poolDbService->currentTime(), theAlignRecordName);
// if ( poolDbService->isNewTagRequest(theErrorRecordName) )
// poolDbService->createNewIOV<AlignmentErrorsExtended>( alignmentErrors,
// poolDbService->createOneIOV<AlignmentErrorsExtended>( alignmentErrors,
// poolDbService->endOfTime(),
// theErrorRecordName );
// else
// poolDbService->appendSinceTime<AlignmentErrorsExtended>( alignmentErrors,
// poolDbService->appendOneIOV<AlignmentErrorsExtended>( alignmentErrors,
// poolDbService->currentTime(),
// theErrorRecordName );
poolDbService->writeOneIOV<AlignmentErrorsExtended>(
Expand Down
6 changes: 6 additions & 0 deletions CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc
Expand Up @@ -544,6 +544,12 @@ void HcaluLUTTPGCoder::update(const HcalDbService& conditions) {
else if (adc >= mipMax)
lut[adc] |= QIE11_LUT_MSB1;
}

//Zeroing the 4th depth in the trigger towers where |ieta| = 16 to match the behavior in the uHTR firmware in Run3, where the 4th depth is not included in the sum over depths when constructing the TP energy for this tower.
if (abs(cell.ieta()) == 16 && cell.depth() == 4 &&
topo_->triggerMode() >= HcalTopologyMode::TriggerMode_2021) {
lut[adc] = 0;
}
}
}
} else if (subdet == HcalForward) {
Expand Down
5 changes: 1 addition & 4 deletions CalibMuon/DTCalibration/plugins/DTMapGenerator.cc
Expand Up @@ -28,8 +28,6 @@ DTMapGenerator::DTMapGenerator(const ParameterSet& pset) {
}
}

DTMapGenerator::~DTMapGenerator() {}

void DTMapGenerator::endJob() {
cout << "DTMapGenerator: Output Map: " << outputMapName << " ROS Type: " << rosType << endl;

Expand Down Expand Up @@ -130,8 +128,7 @@ void DTMapGenerator::endJob() {
} else {
outRob = robCounter + 21;
}
}
if (sector == 4) {
} else if (sector == 4) {
if (robCounter == 3 || robCounter == 4) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion CalibMuon/DTCalibration/plugins/DTMapGenerator.h
Expand Up @@ -20,7 +20,7 @@ class DTMapGenerator : public edm::one::EDAnalyzer<> {
DTMapGenerator(const edm::ParameterSet& pset);

/// Destructor
~DTMapGenerator() override;
~DTMapGenerator() override = default;

// Operations

Expand Down
3 changes: 0 additions & 3 deletions CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.cc
Expand Up @@ -57,7 +57,6 @@ void DTTTrigCorrectionFirst::endJob() {
double rms = 0.;
double averageSigma = 0.;
double average2Sigma = 0.;
double rmsSigma = 0.;
double counter = 0.;
double averagekfactor = 0;
float kfactor = 0;
Expand Down Expand Up @@ -92,9 +91,7 @@ void DTTTrigCorrectionFirst::endJob() {
} //End of loop on superlayers

rms = average2 / (counter - 1);
rmsSigma = average2Sigma / (counter - 1);
rms = sqrt(rms);
rmsSigma = sqrt(rmsSigma);
cout << "average averageSigma counter rms " << average << " " << averageSigma << " " << counter << " " << rms << endl;

for (auto sl = dtSupLylist.begin(); sl != dtSupLylist.end(); sl++) {
Expand Down
20 changes: 16 additions & 4 deletions CommonTools/Utils/src/MethodSetter.cc
Expand Up @@ -120,10 +120,22 @@ bool MethodSetter::push(const string& name, const vector<AnyMethodArgument>& arg
if (!bool(member)) {
// Not a data member either, fatal error, throw.
switch (error) {
case reco::parser::kNameDoesNotExist:
throw Exception(begin) << "no method or data member named \"" << name << "\" found for type \"" << type.name()
<< "\"";
break;
case reco::parser::kNameDoesNotExist: {
Exception ex(begin);
ex << "no method or data member named \"" << name << "\" found for type \"" << type.name() << "\"\n";
// The following information is for temporary debugging only, intended to be removed later
ex << "It has the following methods\n";
edm::TypeFunctionMembers functions(type);
for (auto const& f : functions) {
ex << " " << f->GetName() << "\n";
}
ex << "and the following data members\n";
edm::TypeDataMembers members(type);
for (auto const& m : members) {
ex << " " << m->GetName() << "\n";
}
throw ex;
} break;
case reco::parser::kIsNotPublic:
throw Exception(begin) << "data member named \"" << name << "\" for type \"" << type.name()
<< "\" is not publically accessible.";
Expand Down
3 changes: 2 additions & 1 deletion CommonTools/Utils/src/cutParser.cc
Expand Up @@ -24,7 +24,8 @@ bool reco::parser::cutParser(const edm::TypeWithDict& t, const std::string& cut,
returnValue = parse(startingFrom, grammar.use_parser<0>() >> end_p, space_p).full;
} catch (BaseException& e) {
throw edm::Exception(edm::errors::Configuration)
<< "Cut parser error:" << baseExceptionWhat(e) << " (char " << e.where - startingFrom << ")\n";
<< "Cut parser error:" << baseExceptionWhat(e) << " (char " << e.where - startingFrom << ")\n"
<< "Cut string was " << cut;
}
return returnValue;
}
Expand Down
10 changes: 5 additions & 5 deletions CondFormats/SiPixelObjects/src/SiPixelDynamicInefficiency.cc
Expand Up @@ -7,7 +7,7 @@ bool SiPixelDynamicInefficiency::putPixelGeomFactor(const uint32_t& detid, doubl
std::map<unsigned int, double>::const_iterator id = m_PixelGeomFactors.find(detid);
if (id != m_PixelGeomFactors.end()) {
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PixelGeomFactor for DetID " << detid
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
} else
m_PixelGeomFactors[detid] = value;
Expand All @@ -29,7 +29,7 @@ bool SiPixelDynamicInefficiency::putColGeomFactor(const uint32_t& detid, double&
std::map<unsigned int, double>::const_iterator id = m_ColGeomFactors.find(detid);
if (id != m_ColGeomFactors.end()) {
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ColGeomFactor for DetID " << detid
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
} else
m_ColGeomFactors[detid] = value;
Expand All @@ -51,7 +51,7 @@ bool SiPixelDynamicInefficiency::putChipGeomFactor(const uint32_t& detid, double
std::map<unsigned int, double>::const_iterator id = m_ChipGeomFactors.find(detid);
if (id != m_ChipGeomFactors.end()) {
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ChipGeomFactor for DetID " << detid
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
} else
m_ChipGeomFactors[detid] = value;
Expand All @@ -73,7 +73,7 @@ bool SiPixelDynamicInefficiency::putPUFactor(const uint32_t& detid, std::vector<
std::map<unsigned int, std::vector<double> >::const_iterator id = m_PUFactors.find(detid);
if (id != m_PUFactors.end()) {
edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PUFactor for DetID " << detid
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
} else
m_PUFactors[detid] = v_value;
Expand Down Expand Up @@ -111,7 +111,7 @@ uint32_t SiPixelDynamicInefficiency::getDetIdmask(unsigned int& i) const {
bool SiPixelDynamicInefficiency::puttheInstLumiScaleFactor(double& theInstLumiScaleFactor) {
if (theInstLumiScaleFactor_ != -9999) {
edm::LogError("SiPixelDynamicInefficiency")
<< "SiPixelDynamicInefficiency theInstLumiScaleFactor is already stored! Skippig this put!" << std::endl;
<< "SiPixelDynamicInefficiency theInstLumiScaleFactor is already stored! Skipping this put!" << std::endl;
return false;
} else {
theInstLumiScaleFactor_ = theInstLumiScaleFactor;
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/SiPixelObjects/src/SiPixelLorentzAngle.cc
Expand Up @@ -5,7 +5,7 @@ bool SiPixelLorentzAngle::putLorentzAngle(const uint32_t& detid, float& value) {
std::map<unsigned int, float>::const_iterator id = m_LA.find(detid);
if (id != m_LA.end()) {
edm::LogError("SiPixelLorentzAngle") << "SiPixelLorentzAngle for DetID " << detid
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
} else
m_LA[detid] = value;
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/SiPixelObjects/src/SiPixelVCal.cc
Expand Up @@ -6,7 +6,7 @@
bool SiPixelVCal::putSlopeAndOffset(const uint32_t& pixid, float& slopeValue, float& offsetValue) {
std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
if (id != m_vcal.end()) {
edm::LogError("SiPixelVCal") << "SiPixelVCal for pixid " << pixid << " is already stored. Skippig this put"
edm::LogError("SiPixelVCal") << "SiPixelVCal for pixid " << pixid << " is already stored. Skipping this put"
<< std::endl;
return false;
} else {
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/SiStripObjects/src/SiStripApvGain.cc
Expand Up @@ -10,7 +10,7 @@ bool SiStripApvGain::put(const uint32_t& DetId, Range input) {
RegistryIterator p = std::lower_bound(v_detids.begin(), v_detids.end(), DetId);
if (p != v_detids.end() && *p == DetId) {
edm::LogError("SiStripApvGain") << "[" << __PRETTY_FUNCTION__ << "] SiStripApvGain for DetID " << DetId
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
}

Expand Down
Expand Up @@ -6,7 +6,7 @@ bool SiStripBackPlaneCorrection::putBackPlaneCorrection(const uint32_t& detid, f
std::map<unsigned int, float>::const_iterator id = m_BPC.find(detid);
if (id != m_BPC.end()) {
edm::LogError("SiStripBackPlaneCorrection")
<< "SiStripBackPlaneCorrection for DetID " << detid << " is already stored. Skippig this put" << std::endl;
<< "SiStripBackPlaneCorrection for DetID " << detid << " is already stored. Skipping this put" << std::endl;
return false;
} else
m_BPC[detid] = value;
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/SiStripObjects/src/SiStripBadStrip.cc
Expand Up @@ -9,7 +9,7 @@ bool SiStripBadStrip::put(const uint32_t& DetId, Range input) {
Registry::iterator p = std::lower_bound(indexes.begin(), indexes.end(), DetId, SiStripBadStrip::StrictWeakOrdering());
if (p != indexes.end() && p->detid == DetId) {
edm::LogError("SiStripBadStrip") << "[" << __PRETTY_FUNCTION__ << "] SiStripBadStrip for DetID " << DetId
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion CondFormats/SiStripObjects/src/SiStripLorentzAngle.cc
Expand Up @@ -6,7 +6,7 @@ bool SiStripLorentzAngle::putLorentzAngle(const uint32_t& detid, float value) {
std::map<unsigned int, float>::const_iterator id = m_LA.find(detid);
if (id != m_LA.end()) {
edm::LogError("SiStripLorentzAngle") << "SiStripLorentzAngle for DetID " << detid
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
} else
m_LA[detid] = value;
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/SiStripObjects/src/SiStripThreshold.cc
Expand Up @@ -12,7 +12,7 @@ bool SiStripThreshold::put(const uint32_t& DetId, const InputVector& _vect) {
std::lower_bound(indexes.begin(), indexes.end(), DetId, SiStripThreshold::StrictWeakOrdering());
if (p != indexes.end() && p->detid == DetId) {
edm::LogError("SiStripThreshold") << "[" << __PRETTY_FUNCTION__ << "] SiStripThreshold for DetID " << DetId
<< " is already stored. Skippig this put" << std::endl;
<< " is already stored. Skipping this put" << std::endl;
return false;
}

Expand Down
6 changes: 2 additions & 4 deletions CondTools/L1Trigger/plugins/L1CondDBPayloadWriter.cc
Expand Up @@ -45,10 +45,8 @@ L1CondDBPayloadWriter::L1CondDBPayloadWriter(const edm::ParameterSet& iConfig)
m_writeConfigData(iConfig.getParameter<bool>("writeConfigData")),
m_overwriteKeys(iConfig.getParameter<bool>("overwriteKeys")),
m_logTransactions(iConfig.getParameter<bool>("logTransactions")),
m_newL1TriggerKeyList(iConfig.getParameter<bool>("newL1TriggerKeyList")) {
//now do what ever initialization is needed
l1TriggerKeyToken_ = esConsumes();
}
m_newL1TriggerKeyList(iConfig.getParameter<bool>("newL1TriggerKeyList")),
l1TriggerKeyToken_(esConsumes()) {}

L1CondDBPayloadWriter::~L1CondDBPayloadWriter() {
// do anything here that needs to be done at desctruction time
Expand Down
54 changes: 46 additions & 8 deletions CondTools/L1TriggerExt/plugins/L1CondDBPayloadWriterExt.cc
@@ -1,21 +1,59 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "CondTools/L1TriggerExt/plugins/L1CondDBPayloadWriterExt.h"

#include "CondFormats/L1TObjects/interface/L1TriggerKeyExt.h"
#include "CondFormats/DataRecord/interface/L1TriggerKeyExtRcd.h"
#include "CondFormats/L1TObjects/interface/L1TriggerKeyListExt.h"
#include "CondFormats/DataRecord/interface/L1TriggerKeyListExtRcd.h"

#include <memory>

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "CondTools/L1TriggerExt/interface/DataWriterExt.h"

class L1CondDBPayloadWriterExt : public edm::one::EDAnalyzer<> {
public:
explicit L1CondDBPayloadWriterExt(const edm::ParameterSet&);
~L1CondDBPayloadWriterExt() override;

private:
void beginJob() override;
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override;

// ----------member data ---------------------------
l1t::DataWriterExt m_writer;
// std::string m_tag ; // tag is known by PoolDBOutputService

// set to false to write config data without valid TSC key
bool m_writeL1TriggerKeyExt;

// set to false to write config data only
bool m_writeConfigData;

// substitute new payload tokens for existing keys in L1TriggerKeyListExt
bool m_overwriteKeys;

bool m_logTransactions;

// if true, do not retrieve L1TriggerKeyListExt from EventSetup
bool m_newL1TriggerKeyListExt;

// Token to access L1TriggerKeyExt data in the event setup
edm::ESGetToken<L1TriggerKeyExt, L1TriggerKeyExtRcd> theL1TriggerKeyExtToken_;
};

L1CondDBPayloadWriterExt::L1CondDBPayloadWriterExt(const edm::ParameterSet& iConfig)
: m_writeL1TriggerKeyExt(iConfig.getParameter<bool>("writeL1TriggerKeyExt")),
m_writeConfigData(iConfig.getParameter<bool>("writeConfigData")),
m_overwriteKeys(iConfig.getParameter<bool>("overwriteKeys")),
m_logTransactions(iConfig.getParameter<bool>("logTransactions")),
m_newL1TriggerKeyListExt(iConfig.getParameter<bool>("newL1TriggerKeyListExt")) {
//now do what ever initialization is needed
key_token = esConsumes<L1TriggerKeyExt, L1TriggerKeyExtRcd>();
}
m_newL1TriggerKeyListExt(iConfig.getParameter<bool>("newL1TriggerKeyListExt")),
theL1TriggerKeyExtToken_(esConsumes()) {}

L1CondDBPayloadWriterExt::~L1CondDBPayloadWriterExt() {
// do anything here that needs to be done at desctruction time
Expand Down Expand Up @@ -46,7 +84,7 @@ void L1CondDBPayloadWriterExt::analyze(const edm::Event& iEvent, const edm::Even
bool triggerKeyOK = true;
try {
// Get L1TriggerKeyExt
key = iSetup.get<L1TriggerKeyExtRcd>().get(key_token);
key = iSetup.getData(theL1TriggerKeyExtToken_);
if (!m_overwriteKeys) {
triggerKeyOK = oldKeyList.token(key.tscKey()).empty();
}
Expand Down Expand Up @@ -142,4 +180,4 @@ void L1CondDBPayloadWriterExt::beginJob() {}
void L1CondDBPayloadWriterExt::endJob() {}

//define this as a plug-in
//DEFINE_FWK_MODULE(L1CondDBPayloadWriterExt);
DEFINE_FWK_MODULE(L1CondDBPayloadWriterExt);

0 comments on commit 5120c82

Please sign in to comment.