-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation FixMissingStreamerInfos service
- Loading branch information
Showing
4 changed files
with
234 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Build a working release including the desired class versions in the | ||
// class definitions and classes_def.xml files. You might need to add or | ||
// remove lines below to get the StreamerInfo objects for the desired classes. | ||
// Then run the following to execute this script: | ||
// | ||
// root -l -b -q makeFileContainingStreamerInfos.C | ||
// | ||
// Then rename the output file as appropriate. If it is of general use | ||
// you might want to reposit the file in the IOPool/Input data repository. | ||
// This output file can be used by the service named FixMissingStreamerInfos. | ||
|
||
#include <iostream> | ||
|
||
void makeFileContainingStreamerInfos() { | ||
std::cout << "Executing makeFileContainingStreamerInfos()" << std::endl; | ||
auto f = TFile::Open("fileContainingStreamerInfos.root", "NEW"); | ||
|
||
TClass::GetClass("BeamSpotOnline")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("CTPPSLocalTrackLite")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("CTPPSPixelDataError")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("CTPPSPixelDigi")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("CorrMETData")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("DcsStatus")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("EcalTriggerPrimitiveSample")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("HaloTowerStrip")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("HcalElectronicsId")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1AcceptBunchCrossing")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctEmCand")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctEtHad")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctEtMiss")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctEtTotal")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctHFBitCounts")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctHFRingEtSums")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctHtMiss")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctJetCand")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GctJetCounts")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GtFdlWord")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1GtPsbWord")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1MuGMTReadoutRecord")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("L1TriggerScalers")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("Level1TriggerScalers")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("LumiScalers")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("Measurement1DFloat")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("PixelFEDChannel")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("Run3ScoutingParticle")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("Run3ScoutingTrack")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("Run3ScoutingVertex")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("TotemFEDInfo")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("ZDCDataFrame")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("ZDCRecHit")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<CTPPSDiamondDigi>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<CTPPSDiamondLocalTrack>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<CTPPSDiamondRecHit>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<CTPPSPixelLocalTrack>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemRPCluster>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemRPDigi>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemRPLocalTrack>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemRPRecHit>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemRPUVPattern>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemTimingDigi>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemTimingLocalTrack>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::DetSet<TotemTimingRecHit>")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::HLTPathStatus")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::IndexIntoFile::RunOrLumiEntry")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::RefCoreWithIndex")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::StoredMergeableRunProductMetadata::SingleRunEntry")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::StoredMergeableRunProductMetadata::SingleRunEntryAndProcess") | ||
->GetStreamerInfo() | ||
->ForceWriteInfo(f); | ||
TClass::GetClass("edm::StoredProductProvenance")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("edm::ThinnedAssociationBranches")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("l1t::CaloTower")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("l1t::RegionalMuonShower")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::DeDxData")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::ElectronSeed::PMVars")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::ForwardProton")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::JetID")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::MuonCosmicCompatibility")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::MuonGEMHitMatch")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::MuonMETCorrectionData")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::MuonRPCHitMatch")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::MuonTimeExtra")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::PhiWedge")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("reco::RecoEcalCandidate")->GetStreamerInfo()->ForceWriteInfo(f); | ||
TClass::GetClass("trigger::TriggerObject")->GetStreamerInfo()->ForceWriteInfo(f); | ||
|
||
TClass::GetClass("l1t::MuonShower")->GetStreamerInfo()->ForceWriteInfo(f); | ||
|
||
delete f; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: Services | ||
// Class : FixMissingStreamerInfos | ||
// | ||
// Implementation: | ||
|
||
/** \class edm::service::FixMissingStreamerInfos | ||
This service is used to open and close a ROOT file that contains | ||
StreamerInfo objects causing them to be saved in memory. It is | ||
used when reading a file written with a version of ROOT with a | ||
bug that caused it to fail to write out StreamerInfo objects. | ||
(see Issue 41246). | ||
CMSSW_13_0_0 had such a problem and files were written with | ||
this problem. When using this service to read files written | ||
with this release set the "fileInPath" parameter to the string | ||
"IOPool/Input/data/fileContainingStreamerInfos_13_0_0.root". | ||
This file is saved in the cms-data repository for IOPool/Input. | ||
Note that it was difficult to identify all the problem classes | ||
and we might have missed some. If there are additional problem | ||
classes a new version of this file can be generated with script | ||
IOPool/Input/scripts/makeFileContainingStreamerInfos.C. If the | ||
problem ever recurs in ROOT with a different release, one could | ||
use that script to generate a file containing StreamerInfos for | ||
other releases. | ||
\author W. David Dagenhart, created 30 October, 2023 | ||
*/ | ||
|
||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" | ||
#include "FWCore/ServiceRegistry/interface/ServiceMaker.h" | ||
#include "FWCore/Utilities/interface/EDMException.h" | ||
#include "FWCore/Utilities/interface/FileInPath.h" | ||
|
||
#include "TFile.h" | ||
|
||
namespace edm { | ||
namespace service { | ||
|
||
class FixMissingStreamerInfos { | ||
public: | ||
FixMissingStreamerInfos(ParameterSet const&, ActivityRegistry&); | ||
static void fillDescriptions(ConfigurationDescriptions&); | ||
|
||
private: | ||
FileInPath fileInPath_; | ||
}; | ||
|
||
FixMissingStreamerInfos::FixMissingStreamerInfos(ParameterSet const& pset, edm::ActivityRegistry&) | ||
: fileInPath_(pset.getUntrackedParameter<FileInPath>("fileInPath")) { | ||
auto tFile = TFile::Open(fileInPath_.fullPath().c_str()); | ||
if (!tFile || tFile->IsZombie()) { | ||
throw cms::Exception("FixMissingStreamerInfo") | ||
<< "Failed opening file containing missing StreamerInfos: " << fileInPath_.fullPath(); | ||
} | ||
tFile->Close(); | ||
} | ||
|
||
void FixMissingStreamerInfos::fillDescriptions(ConfigurationDescriptions& descriptions) { | ||
ParameterSetDescription desc; | ||
desc.addUntracked<FileInPath>("fileInPath"); | ||
descriptions.add("FixMissingStreamerInfos", desc); | ||
} | ||
} // namespace service | ||
} // namespace edm | ||
|
||
using namespace edm::service; | ||
DEFINE_FWK_SERVICE(FixMissingStreamerInfos); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters