Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pf migration #2928

Merged
merged 174 commits into from Mar 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
84d3f83
Thread safe changes
vkuznet Nov 1, 2013
dcf3b40
Applied patch https://twiki.cern.ch/twiki/pub/CMS/TkAlignmentLegacyTh…
Feb 6, 2014
dd2901c
added new tagging variables and new version of CombinedSVComputer
pvmulder Dec 17, 2013
3c2bfc7
minor fixes
pvmulder Feb 11, 2014
a9250c1
combined CSVV2+SL tagger
pvmulder Feb 24, 2014
6e37c56
changes needed or combined CSVV2_SL tagger
pvmulder Feb 24, 2014
77a2108
if-else instead of ifs and removing the unneeded exception
pvmulder Mar 3, 2014
e50bed0
New configuration for APVCyclePhaseProducerFromL1TS to be used for da…
venturia Mar 4, 2014
4458279
restore class definition using PF information
beaudett Mar 5, 2014
6e5095c
conversion EDAnalyzer --> DQMEDAnalyzer
mtosi Mar 5, 2014
8fd9f99
conversion EDAnalyzer --> DQMEDAnalyzer
mtosi Mar 5, 2014
6ae9f38
Implement and use the new interface of RecoCaloTools/Selectors.
Feb 12, 2014
59e149a
Make FastSimulation not dependant on MetaCollections.
Feb 12, 2014
521218a
Make DQMOffline/Trigger not dependant on MetaCollections.
Feb 12, 2014
4c4717d
TauAnalysis/MCEmbeddingTools/CaloRecHitMixer no longer requires EcalR…
Feb 13, 2014
83a8398
RecoJets/JetProducers/JetMatchingTools no longer requires EcalRecHit …
Feb 13, 2014
7177f24
Adding GT for CSA14 optimistic scenario (aka 25ns).
Mar 6, 2014
6ab2a07
RecoLocalCalo/CaloTowersCreator/CaloTowersCreationAlgo no longer requ…
Feb 13, 2014
374ca6c
EgammaCoreTools now uses EcalRecHit.checkFlag() instead of the deprec…
Feb 13, 2014
fc95ac9
Calibration/HcalCalibAlgos/GammaJetAnalysis no longer requires EcalRe…
Feb 13, 2014
5f2e0b5
Removal of MetaCollections and switching to a new EcalRecHit (no inhe…
Mar 4, 2014
ab1d0f7
Added the possibility to monitor SiStripAPVPhaseOffsets tags
venturia Mar 11, 2014
92a7f62
Adding new hits
bachtis Feb 16, 2014
e44523d
cleaning old code
bachtis Feb 16, 2014
df5ebb9
Changed RecHit
bachtis Feb 17, 2014
9cf2615
Removing stuff
bachtis Feb 17, 2014
75b8cd7
fixing also the hash
bachtis Feb 17, 2014
d25da46
Added forgotten file
bachtis Feb 18, 2014
fc9de23
Caching the 4 and 8 neighbours"
bachtis Feb 18, 2014
b2230ac
skeleton of PFClusterProducer Refactorization
lgray Feb 10, 2014
999200a
implement original PF topo cluster algorithm in new framework
lgray Feb 11, 2014
ae36912
Cleaner plugin and old PFlow cluster skeleton
lgray Feb 11, 2014
f6e4099
Finish implementation of old pf clusterizer
lgray Feb 12, 2014
911da7b
implement spike and double spike cleaning module
lgray Feb 12, 2014
6d24111
regular PF cluster position calculator
lgray Feb 12, 2014
b0b0892
ECAL position calc with depth correction
lgray Feb 13, 2014
8207ba7
complete implementation of new PF cluster scheme
lgray Feb 13, 2014
cf271d6
functions and gives equivalent results to old clustering on electron …
lgray Feb 13, 2014
5053675
agrees with PFClusterAlgo to 1e-5 tolerance.
lgray Feb 14, 2014
5af3b83
clean up python config, add in energy corrector plugin
lgray Feb 16, 2014
e851a4a
add aprticle flow clusters for PS, generate full ECAL PFCluster seque…
lgray Feb 16, 2014
5c1654d
RBX and HPD cleaner
lgray Feb 17, 2014
579e081
add remaining calorimeter clusterizers, all agree well
lgray Feb 17, 2014
2663420
normalize fraction calculations to rechit thresholds.
lgray Feb 20, 2014
2a36df7
Clean up naming conventions to make them more meaningful
lgray Feb 20, 2014
2737513
make numerical protection strength configurable, sync shower sigma fo…
lgray Feb 24, 2014
cda746a
switch to vdt math library remove modules not used
lgray Feb 24, 2014
f781c35
further speed optimizations
lgray Feb 24, 2014
36db2f1
properly fill the CaloCluster hitsAndFractions vector
lgray Feb 24, 2014
2f85b20
made memory access better
bachtis Feb 28, 2014
c2f83e1
Adding ECAL 3D
bachtis Feb 28, 2014
7394309
Added 3D ECAL Clustering
bachtis Mar 3, 2014
01f762b
adding cfg files for ECAL 3D
bachtis Mar 3, 2014
abc7673
adding timing clusterizer in py
bachtis Mar 3, 2014
be97867
speed up from not having to call PFLayer 8 billion times
lgray Feb 28, 2014
cb25ecf
improve PF RecHit producer timing, massive gains for larger rechit co…
lgray Feb 28, 2014
6d82908
updates to cluster comparator
lgray Feb 28, 2014
b6be100
factor config into each cluster type
lgray Mar 3, 2014
f5ceff0
rejigger locations of plugin defs
lgray Mar 3, 2014
1708511
remove PFRootEvent... for now...
lgray Mar 3, 2014
54d4555
update HLT config for FAMOS and dual navigators
lgray Mar 3, 2014
5973f2c
expand use of local max seed finder to > 2D
lgray Mar 4, 2014
b5ce95b
naming cleanup
lgray Mar 4, 2014
cabb6df
apply binary search to NavigatorWithTime
lgray Mar 4, 2014
81f6c36
add plots to cluster comparator
lgray Mar 5, 2014
e8284ba
Adding better timing info
bachtis Mar 4, 2014
25b191b
Caluculating time average using time resolution
bachtis Mar 5, 2014
e1b4a20
put time and layer in the appropriate place
lgray Mar 5, 2014
ea7faa4
add in iorule to make PFRecHit backwards compatible -- NOTE the read-…
lgray Mar 6, 2014
a70aa7a
remove deprecated parameters from configuration
lgray Mar 7, 2014
0bf0fcf
only use PS adjusted radiation length when we are under the PS (which…
lgray Mar 7, 2014
5074cbd
factorize python config for confDB
lgray Mar 11, 2014
523a30d
use empty parameter sets to indicate components not run in PFClusterP…
lgray Mar 11, 2014
9b63170
PF migration (2730) in HLT via ConfDB
Martin-Grunewald Mar 11, 2014
a3d73b5
Fix InputTags of PF RecHit modules
Martin-Grunewald Mar 11, 2014
f161dc6
More InputTag fixes
Martin-Grunewald Mar 11, 2014
166c993
Reorder PF modules
Martin-Grunewald Mar 11, 2014
9adf54d
More reordering
Martin-Grunewald Mar 11, 2014
a91b469
Fixes
bachtis Mar 9, 2014
547583e
Making a PFCluster with timing cut sequence
bachtis Mar 11, 2014
17e91d7
implemented comments from code review
lgray Mar 12, 2014
f1ae1b6
migration to consumes
dr4kan Mar 12, 2014
cd18871
migration to consumes
dr4kan Mar 12, 2014
ca75f58
consumes migration
hvanhaev Mar 12, 2014
d721552
consumes migration
hvanhaev Mar 12, 2014
113a0fe
complete transition from dqmStore to ibooker
mtosi Mar 12, 2014
4b9a7ee
resolve conflicts
dr4kan Mar 12, 2014
2136790
resolve conflicts
dr4kan Mar 12, 2014
f7e90bc
resolve conflicts
dr4kan Mar 12, 2014
3fa09dd
resolve conflicts
dr4kan Mar 12, 2014
6fc46b3
resolve conflicts
dr4kan Mar 12, 2014
63ee7d6
resolve conflicts
dr4kan Mar 12, 2014
306c3eb
resolve conflicts
dr4kan Mar 12, 2014
9cb9167
resolve conflicts
dr4kan Mar 12, 2014
796a365
resolve conflicts
dr4kan Mar 12, 2014
b5355a6
Adding HCAL Severity Cut in HO
bachtis Mar 12, 2014
14f8a81
fix
bachtis Mar 12, 2014
ee10806
Ecal DB Payload mods
mdhildreth Mar 12, 2014
caecf97
add new no-noise cfi
mdhildreth Mar 13, 2014
2a878f8
migration to consumes
dr4kan Mar 13, 2014
cda34e6
migration to consumes
dr4kan Mar 13, 2014
a778a76
migration to consumes
dr4kan Mar 13, 2014
08ae16c
migration to consumes
dr4kan Mar 13, 2014
6991296
migration to consumes
dr4kan Mar 13, 2014
6684609
migration to consumes
dr4kan Mar 13, 2014
10b37e0
migration to consumes
dr4kan Mar 13, 2014
bafcd74
migration to consumes
dr4kan Mar 13, 2014
1f581d6
migration to consumes
dr4kan Mar 13, 2014
5e7c8c7
migration to consumes
dr4kan Mar 13, 2014
f6beeab
migration to consumes
dr4kan Mar 13, 2014
ca91ce3
migration to consumes
dr4kan Mar 13, 2014
f9b07d5
resolving dependencies
dr4kan Mar 13, 2014
b7dd481
resolving dependencies
dr4kan Mar 13, 2014
6f4ead1
ConsumesPF A
bachtis Mar 13, 2014
6757e83
removing use of statics in reco
davidlange6 Mar 13, 2014
f15ce16
new producers and bug fixes
matteosan1 Mar 13, 2014
b62dabd
more consumes
bachtis Mar 13, 2014
3567b4b
set default to SR on
mdhildreth Mar 13, 2014
25f0f4b
Put EDAnalyzer SiPixelLorentzAngle in namespace
Dr15Jones Mar 13, 2014
c432e76
more consumes
bachtis Mar 13, 2014
2e301d6
more
bachtis Mar 13, 2014
03b8817
aaa
bachtis Mar 13, 2014
505a594
aaaa
bachtis Mar 13, 2014
c6e4e00
Implemented usage of streamerInfo in Root based persistency
ggovi Mar 11, 2014
8b76b93
Fix uninitialsed variables found by clang static analyser.
Mar 13, 2014
f6dbf33
Consumes more
bachtis Mar 13, 2014
f74faaa
cmsDriver infrastructure+EventContent+StandardSequences mods for PreM…
mdhildreth Mar 13, 2014
d85ee05
aaa
bachtis Mar 13, 2014
9281f0f
aaa
bachtis Mar 13, 2014
41c0bd9
PAT Trigger remaining consumes migration (GetterOfProducts).
Mar 13, 2014
113c7fd
Use 'callWhenNewProductsRegistered' properly.
Mar 13, 2014
1ea284d
PFProducer consumes
bachtis Mar 13, 2014
24f55af
Add header needed for clang compilation
Dr15Jones Mar 13, 2014
c9a0ab5
ClassChecker should only check data classes. Script to extract ESD cl…
gartung Mar 12, 2014
b5ed4a4
fix isDataClass to search for class '' and use more robust ifstream
gartung Mar 12, 2014
f57e2a6
Final fixes
bachtis Mar 13, 2014
cfb622f
Last set of changes for PreMixing
mdhildreth Mar 13, 2014
51c13ae
Construct InputTagMatch really from an InputTag.
Mar 13, 2014
75323b7
Consistent namespace usage.
Mar 14, 2014
371428d
Merge pull request #2730 from lgray/pfcluster_rebuild
ktf Mar 14, 2014
ba00d13
Merge pull request #2847 from matteosan1/topic_newproducers
nclopezo Mar 14, 2014
cbb6a89
Merge pull request #2848 from Dr15Jones/putSiPixelLorentzAngleAnalyze…
nclopezo Mar 14, 2014
b98d75b
Further code review from the end of #2730
lgray Mar 13, 2014
21b6252
Merge pull request #2622 from cms-btv-pog/CSVnewVars_from-CMSSW_7_1_0…
nclopezo Mar 14, 2014
0d40657
Merge pull request #2853 from vadler/71X-llvmFixes-uninitialisedVaria…
nclopezo Mar 14, 2014
9a5ed31
Merge pull request #2857 from mdhildreth/PreMixing_Modifications_for_…
nclopezo Mar 14, 2014
3e1362f
Merge pull request #2750 from diguida/autoCond-CSA14-25ns
nclopezo Mar 14, 2014
d031b8e
Merge pull request #2724 from venturia/dpganalysis_sistriptools-70x
nclopezo Mar 14, 2014
ede08db
Merge pull request #2591 from frmeier/patch_hierachyconstraints70X
nclopezo Mar 14, 2014
8c26c07
Updated CSA14 25ns GT including Ecal full readout for pre-mixing and …
Mar 14, 2014
f348a7d
Added CSA14 50ns GT, including pessimistic misalignment scenario, Eca…
Mar 14, 2014
678f5ca
Merge remote branch 'origin/CMSSW_7_0_X' into CMSSW_7_0_X
cmsbuild Mar 14, 2014
d52ec25
parameter improvements
hvanhaev Mar 14, 2014
3270220
Merge pull request #2855 from Dr15Jones/includeExceptionHeader
nclopezo Mar 14, 2014
1a40144
Merge pull request #2737 from mtosi/from-CMSSW_7_1_0_pre3_DQMEDAnalyzer
nclopezo Mar 14, 2014
c362c51
Merge pull request #2810 from venturia/tkdbmonitoring_70x
nclopezo Mar 14, 2014
c85c5d2
Merge pull request #2675 from vkuznet/ThreadSafe_DataFormats_TrackerC…
ktf Mar 14, 2014
35b2cd3
Ignore new nbinsy warning from ROOT
Dr15Jones Mar 14, 2014
169f31e
Merge pull request #2852 from ggovi/new-conddb-streamerinfo
ktf Mar 14, 2014
742c364
Merge pull request #2788 from dmitrijus/ecalrechit-no-inheritance-int…
nclopezo Mar 14, 2014
b16b6fd
Merge pull request #2868 from diguida/autoCond-CSA14
nclopezo Mar 14, 2014
60f01d3
Merge remote branch 'origin/CMSSW_7_0_X' into CMSSW_7_0_X
cmsbuild Mar 14, 2014
942cb23
Merge pull request #2870 from Dr15Jones/ignoreNbinsyWarningFromROOT
ktf Mar 14, 2014
cf287d3
Merge pull request #2854 from vadler/71X-consumesMigrationIIa
ktf Mar 14, 2014
6adf8fe
Merge pull request #2869 from hvanhaev/parameter-cleanup
ktf Mar 14, 2014
6379dd1
String returned by value must be stored
wmtan Mar 15, 2014
829fdf3
Merge pull request #2828 from gartung/clang-work-fix
ktf Mar 15, 2014
b09da1f
Merge pull request #2845 from davidlange6/static_Var_fixes_v2
ktf Mar 16, 2014
a649877
Merge pull request #2866 from lgray/pfcluster_rebuild_morecodereview
ktf Mar 17, 2014
d3d90b2
Merge pull request #2872 from beaudett/class-fix
nclopezo Mar 17, 2014
bd94f60
Merge pull request #2858 from bachtis/consumesPF
nclopezo Mar 17, 2014
71873e9
Merge pull request #2844 from dr4kan/GlobalTT_to_consumes
nclopezo Mar 17, 2014
c39d1f5
Merge pull request #2877 from wmtan/FixForValgrindInvalidRead
ktf Mar 17, 2014
59d7af9
Merge remote-tracking branch 'origin/CMSSW_7_1_X' into foo
ktf Mar 19, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 0 additions & 8 deletions CalibTracker/SiPixelLorentzAngle/src/SealModules.cc

This file was deleted.

8 changes: 7 additions & 1 deletion CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAngle.cc
Expand Up @@ -5,6 +5,9 @@
#include <fstream>
#include <TMath.h>

#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
Expand All @@ -26,12 +29,13 @@
#include "TrackingTools/TrackFitters/interface/TrajectoryStateCombiner.h"
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
#include "CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngle.h"
#include "SiPixelLorentzAngle.h"
int lower_bin_;

using namespace std;
using namespace edm;
using namespace reco;
using namespace analyzer;

SiPixelLorentzAngle::SiPixelLorentzAngle(edm::ParameterSet const& conf) :
conf_(conf), filename_(conf.getParameter<std::string>("fileName")), filenameFit_(conf.getParameter<std::string>("fileNameFit")), ptmin_(conf.getParameter<double>("ptMin")), simData_(conf.getParameter<bool>("simData")), normChi2Max_(conf.getParameter<double>("normChi2Max")), clustSizeYMin_(conf.getParameter<int>("clustSizeYMin")), residualMax_(conf.getParameter<double>("residualMax")), clustChargeMax_(conf.getParameter<double>("clustChargeMax")),hist_depth_(conf.getParameter<int>("binsDepth")), hist_drift_(conf.getParameter<int>("binsDrift"))
Expand Down Expand Up @@ -541,3 +545,5 @@ void SiPixelLorentzAngle::findMean(int i, int i_ring)
_h_mean_[i_ring]->SetBinError(i, error);

}

DEFINE_FWK_MODULE(SiPixelLorentzAngle);
Expand Up @@ -83,6 +83,8 @@
};
//}

//SiPixelLorentzAngle is already the name of a data product
namespace analyzer {
class SiPixelLorentzAngle : public edm::EDAnalyzer
{
public:
Expand Down Expand Up @@ -198,6 +200,6 @@ class SiPixelLorentzAngle : public edm::EDAnalyzer
edm::EDGetTokenT<TrajTrackAssociationCollection> t_trajTrack;

};

}

#endif
Expand Up @@ -2,8 +2,10 @@
#include <string>
#include <iostream>
#include <fstream>
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleDB.h"
#include "SiPixelLorentzAngleDB.h"
#include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
#include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
#include "CondFormats/SiPixelObjects/interface/SiPixelLorentzAngle.h"
Expand Down Expand Up @@ -175,3 +177,4 @@ void SiPixelLorentzAngleDB::endJob(){
}


DEFINE_FWK_MODULE(SiPixelLorentzAngleDB);
24 changes: 12 additions & 12 deletions Calibration/HcalCalibAlgos/src/GammaJetAnalysis.cc
Expand Up @@ -256,7 +256,7 @@ GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
// Load EcalRecHits

std::vector<edm::InputTag>::const_iterator i;
vector<CaloRecHit> theRecHits;
vector<std::pair<DetId, double> > theRecHits;

try {

Expand All @@ -269,7 +269,7 @@ GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
// EcalBarrel = 1, EcalEndcap = 2

GlobalPoint pos = geo->getPosition(recHit->detid());
theRecHits.push_back(*recHit);
theRecHits.push_back(std::pair<DetId, double>(recHit->detid(), recHit->energy()));

if( (*recHit).energy()> ecut[recHit->detid().subdetId()-1][0] )
(*myout_ecal)<<recHit->detid().subdetId()<<" "<<(*recHit).energy()<<" "<<pos.phi()<<" "<<pos.eta()
Expand Down Expand Up @@ -300,7 +300,7 @@ GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
GlobalPoint pos = geo->getPosition(hbheItr->detid());
(*myout_hcal)<<id.subdetId()<<" "<<(*hbheItr).energy()<<" "<<pos.phi()<<
" "<<pos.eta()<<" "<<iEvent.id().event()<<endl;
theRecHits.push_back(*hbheItr);
theRecHits.push_back(std::pair<DetId, double>(hbheItr->detid(), hbheItr->energy()));

}
} catch (cms::Exception& e) { // can't find it!
Expand Down Expand Up @@ -336,9 +336,9 @@ GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
if(vet>CutOnEgammaEnergy_) {
ij++;
float gammaiso_ecal[9] = {0.,0.,0.,0.,0.,0.,0.,0.,0.};
for(vector<CaloRecHit>::iterator it = theRecHits.begin(); it != theRecHits.end(); it++)
for(vector<std::pair<DetId, double> >::const_iterator it = theRecHits.begin(); it != theRecHits.end(); it++)
{
GlobalPoint pos = geo->getPosition(it->detid());
GlobalPoint pos = geo->getPosition(it->first);
double eta = pos.eta();
double phi = pos.phi();
double deta = fabs(eta-aClus->eta());
Expand All @@ -357,24 +357,24 @@ GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
for (int j = 0; j<3; j++)
{

if(it->detid().det() == DetId::Ecal )
if(it->first.det() == DetId::Ecal )
{
if(it->detid().subdetId() == 1) ecutn = ecut[0][j];
if(it->detid().subdetId() == 2) ecutn = ecut[1][j];
if(it->first.subdetId() == 1) ecutn = ecut[0][j];
if(it->first.subdetId() == 2) ecutn = ecut[1][j];
if( dr>rmin && dr<risol[i])
{
if((*it).energy() > ecutn) gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).energy()/cosh(eta);
if((*it).second > ecutn) gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).second/cosh(eta);
}
}

if(it->detid().det() == DetId::Hcal )
if(it->first.det() == DetId::Hcal )
{
ecutn = ecut[2][j];
if( dr>rmin && dr<risol[i])
{
if((*it).energy() > ecutn)
if((*it).first > ecutn)
{
gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).energy()/cosh(eta);
gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).second/cosh(eta);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions CondCore/CondDB/interface/IOVProxy.h
Expand Up @@ -87,6 +87,8 @@ namespace cond {

std::string payloadObjectType() const;

cond::SynchronizationType synchronizationType() const;

cond::Time_t endOfValidity() const;

cond::Time_t lastValidatedTime() const;
Expand Down
6 changes: 3 additions & 3 deletions CondCore/CondDB/interface/KeyList.h
Expand Up @@ -42,7 +42,7 @@ namespace cond {
if( !m_objects[n] ){
auto i = m_data.find( n );
if( i != m_data.end() ){
m_objects[n] = deserialize<T>( i->second.first, i->second.second, m_isOra );
m_objects[n] = deserialize<T>( i->second.first, i->second.second.first, i->second.second.second, m_isOra );
m_data.erase( n );
} else {
throwException( "Payload for index "+boost::lexical_cast<std::string>(n)+" has not been found.",
Expand All @@ -57,8 +57,8 @@ namespace cond {
private:
// the db session
IOVProxy m_proxy;
// the key selection
mutable std::map<size_t,std::pair<std::string,cond::Binary> > m_data;
// the key selection:
mutable std::map<size_t,std::pair<std::string,std::pair<cond::Binary,cond::Binary> > > m_data;
mutable std::vector<boost::shared_ptr<void> > m_objects;
bool m_isOra = false;

Expand Down
50 changes: 31 additions & 19 deletions CondCore/CondDB/interface/Serialization.h
Expand Up @@ -22,7 +22,7 @@
// temporarely
#include <boost/shared_ptr.hpp>

class TBufferFile;
class RootStreamBuffer;

namespace cond {

Expand All @@ -40,7 +40,7 @@ namespace cond {
// output
class RootOutputArchive {
public:
explicit RootOutputArchive( std::ostream& destination );
RootOutputArchive( std::ostream& dataDest, std::ostream& streamerInfoDest );

template <typename T>
RootOutputArchive& operator<<( const T& instance );
Expand All @@ -49,7 +49,8 @@ namespace cond {
void write( const std::type_info& sourceType, const void* sourceInstance);
private:
// here is where the write function will write on...
std::ostream& m_buffer;
std::ostream& m_dataBuffer;
std::ostream& m_streamerInfoBuffer;
};

template <typename T> inline RootOutputArchive& RootOutputArchive::operator<<( const T& instance ){
Expand All @@ -60,7 +61,7 @@ namespace cond {
// input
class RootInputArchive {
public:
explicit RootInputArchive( std::istream& source );
RootInputArchive( std::istream& binaryData, std::istream& binaryStreamerInfo );

virtual ~RootInputArchive();

Expand All @@ -71,8 +72,9 @@ namespace cond {
void read( const std::type_info& destinationType, void* destinationInstance);
private:
// copy of the input stream. is referenced by the TBufferFile.
std::string m_buffer;
TBufferFile* m_streamer = nullptr;
std::string m_dataBuffer;
std::string m_streamerInfoBuffer;
RootStreamBuffer* m_streamer = nullptr;
};

template <typename T> inline RootInputArchive& RootInputArchive::operator>>( T& instance ){
Expand All @@ -85,35 +87,45 @@ namespace cond {

// call for the serialization. Setting packingOnly = TRUE the data will stay in the original memory layout
// ( no serialization in this case ). This option is used by the ORA backend - will be dropped after the changeover
template <typename T> Binary serialize( const T& payload, bool packingOnly = false ){
Binary ret;
template <typename T> std::pair<Binary,Binary> serialize( const T& payload, bool packingOnly = false ){
std::pair<Binary,Binary> ret;
if( !packingOnly ){
// save data to buffer
std::ostringstream buffer;
CondOutputArchive oa( buffer );
// save data to buffers
std::ostringstream dataBuffer;
std::ostringstream streamerInfoBuffer;
CondOutputArchive oa( dataBuffer, streamerInfoBuffer );
oa << payload;
//TODO: avoid (2!!) copies
ret.copy( buffer.str() );
ret.first.copy( dataBuffer.str() );
ret.second.copy( streamerInfoBuffer.str() );
} else {
ret = Binary( payload );
// ORA objects case: nothing to serialize, the object is kept in memory in the original layout - the bare pointer is exchanged
ret.first = Binary( payload );
}
return ret;
}

// generates an instance of T from the binary serialized data. With unpackingOnly = true the memory is already storing the object in the final
// format. Only a cast is required in this case - Used by the ORA backed, will be dropped in the future.
template <typename T> boost::shared_ptr<T> deserialize( const std::string& payloadType, const Binary& payloadData, bool unpackingOnly = false){
template <typename T> boost::shared_ptr<T> deserialize( const std::string& payloadType,
const Binary& payloadData,
const Binary& streamerInfoData,
bool unpackingOnly = false){
// for the moment we fail if types don't match... later we will check for base types...
boost::shared_ptr<T> payload;
if( !unpackingOnly ){
std::stringbuf sbuf;
sbuf.pubsetbuf( static_cast<char*>(const_cast<void*>(payloadData.data())), payloadData.size() );

std::istream buffer( &sbuf );
CondInputArchive ia(buffer);
std::stringbuf sdataBuf;
sdataBuf.pubsetbuf( static_cast<char*>(const_cast<void*>(payloadData.data())), payloadData.size() );
std::stringbuf sstreamerInfoBuf;
sstreamerInfoBuf.pubsetbuf( static_cast<char*>(const_cast<void*>(streamerInfoData.data())), streamerInfoData.size() );

std::istream dataBuffer( &sdataBuf );
std::istream streamerInfoBuffer( &sstreamerInfoBuf );
CondInputArchive ia( dataBuffer, streamerInfoBuffer );
payload.reset( createPayload<T>(payloadType) );
ia >> (*payload);
} else {
// ORA objects case: nothing to de-serialize, the object is already in memory in the final layout, ready to be casted
payload = boost::static_pointer_cast<T>(payloadData.oraObject().makeShared());
}
return payload;
Expand Down
46 changes: 32 additions & 14 deletions CondCore/CondDB/interface/Session.h
Expand Up @@ -88,7 +88,8 @@ namespace cond {
// read access to the iov sequence.
// by default ( full=false ) the iovs are lazy-loaded in groups when required, with repeatable queries ( for FronTier )
// full=true will load the entire sequence in memory. Mainly for test/debugging.
IOVProxy readIov( const std::string& tag, bool full=false );//,const boost::posix_time::ptime& snapshottime )
IOVProxy readIov( const std::string& tag,
bool full=false );//,const boost::posix_time::ptime& snapshottime )

//
bool existsIov( const std::string& tag );
Expand All @@ -97,13 +98,17 @@ namespace cond {
// the type is required for consistency with the referenced payloads.
// fixme: add creation time - required for the migration
template <typename T>
IOVEditor createIov( const std::string& tag, cond::TimeType timeType,
IOVEditor createIov( const std::string& tag,
cond::TimeType timeType,
cond::SynchronizationType synchronizationType=cond::OFFLINE );
IOVEditor createIov( const std::string& payloadType, const std::string& tag, cond::TimeType timeType,
IOVEditor createIov( const std::string& payloadType,
const std::string& tag,
cond::TimeType timeType,
cond::SynchronizationType synchronizationType=cond::OFFLINE );

IOVEditor createIovForPayload( const Hash& payloadHash, const std::string& tag, cond::TimeType timeType,
cond::SynchronizationType synchronizationType=cond::OFFLINE );
IOVEditor createIovForPayload( const Hash& payloadHash,
const std::string& tag, cond::TimeType timeType,
cond::SynchronizationType synchronizationType=cond::OFFLINE );

// update an existing iov sequence with the specified tag.
// timeType and payloadType can't be modified.
Expand All @@ -114,9 +119,13 @@ namespace cond {
const boost::posix_time::ptime& creationTime = boost::posix_time::microsec_clock::universal_time() );
template <typename T> boost::shared_ptr<T> fetchPayload( const cond::Hash& payloadHash );

// low-level function to access the payload data as a blob. mainly used for the data migration and testing.
bool fetchPayloadData( const cond::Hash& payloadHash, std::string& payloadType, cond::Binary& payloadData );

// low-level function to access the payload data as a blob. mainly used for the data migration and testing.
// the version for ROOT
bool fetchPayloadData( const cond::Hash& payloadHash,
std::string& payloadType,
cond::Binary& payloadData,
cond::Binary& streamerInfoData );

// internal functions. creates proxies without loading a specific tag.
IOVProxy iovProxy();

Expand All @@ -125,11 +134,17 @@ namespace cond {

GTProxy readGlobalTag( const std::string& name );
// essentially for the bridge. useless where ORA disappears.
GTProxy readGlobalTag( const std::string& name, const std::string& preFix, const std::string& postFix );
GTProxy readGlobalTag( const std::string& name,
const std::string& preFix,
const std::string& postFix );
public:

bool checkMigrationLog( const std::string& sourceAccount, const std::string& sourceTag, std::string& destinationTag );
void addToMigrationLog( const std::string& sourceAccount, const std::string& sourceTag, const std::string& destinationTag );
bool checkMigrationLog( const std::string& sourceAccount,
const std::string& sourceTag,
std::string& destinationTag );
void addToMigrationLog( const std::string& sourceAccount,
const std::string& sourceTag,
const std::string& destinationTag );

std::string connectionString();

Expand All @@ -140,7 +155,9 @@ namespace cond {
bool isOraSession();

private:
cond::Hash storePayloadData( const std::string& payloadObjectType, const cond::Binary& payloadData, const boost::posix_time::ptime& creationTime );
cond::Hash storePayloadData( const std::string& payloadObjectType,
const std::pair<Binary,Binary>& payloadAndStreamerInfoData,
const boost::posix_time::ptime& creationTime );

private:

Expand All @@ -160,11 +177,12 @@ namespace cond {

template <typename T> inline boost::shared_ptr<T> Session::fetchPayload( const cond::Hash& payloadHash ){
cond::Binary payloadData;
cond::Binary streamerInfoData;
std::string payloadType;
if(! fetchPayloadData( payloadHash, payloadType, payloadData ) )
if(! fetchPayloadData( payloadHash, payloadType, payloadData, streamerInfoData ) )
throwException( "Payload with id="+payloadHash+" has not been found in the database.",
"Session::fetchPayload" );
return deserialize<T>( payloadType, payloadData, isOraSession() );
return deserialize<T>( payloadType, payloadData, streamerInfoData, isOraSession() );
}

class TransactionScope {
Expand Down