Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b014949
first step: most often called getByLabel to getByToken
Jul 13, 2017
b58f1f2
KTowerProducer
Jul 13, 2017
39e169a
KTaupairVerticesMapProducer
Jul 13, 2017
a6817f9
Muon Producer, dropping the srcMuonIsolationPF support since not used…
Jul 13, 2017
ef2895e
removed producer that is already deactivated for a long time
Jul 13, 2017
2d6f40f
remove sigma from pileup density
Jul 14, 2017
bb76266
deactivate Producer that is not used any more
Jul 14, 2017
c5b1b71
FilterSummary Producer. Deactivating parts that probably have not bee…
Jul 14, 2017
293f8e2
KBasicTauProducer
Jul 14, 2017
12b9ed9
TriggerObjectStandaloneProducer
Jul 14, 2017
64e78fe
deactivate JetID from CaloJetProducer -> was disfunctional anyway sin…
Jul 14, 2017
c0bc437
deactivate ExtendedTauProducer -> no analysis is using it atm
Jul 14, 2017
058de04
remove precompiler statements for KDataInfoProducer
Jul 14, 2017
0833945
KInfoProducer
Jul 14, 2017
a76a500
remove non-functional and hardly configurable code parts
Jul 17, 2017
bbf5ae1
ElectronProducer
Jul 17, 2017
0dca32a
KGenInfoProducer
Jul 17, 2017
ccaee49
move from local to global settings
Jul 17, 2017
3637028
switch to usual reco::VertexCollection like in KElectronProducer
Jul 18, 2017
ac5816b
reconfigure muons
Jul 18, 2017
f06d7da
change to proper tree
Jul 18, 2017
52b3783
Merge branch 'master' into getByToken
Jul 19, 2017
b94d675
change path
Jul 20, 2017
2a8d654
use the inputTag class member
Jul 21, 2017
7cf3e8d
merge
Jul 21, 2017
c158652
Merge branch 'master' into getByToken
Jul 25, 2017
fe90386
deactivate non-used collectio
Jul 26, 2017
8b2e37f
renaming _run_tree to _lumi_tree because that's what it actually is.
Jul 26, 2017
24f1a45
adding a Run Tree, able to be filled within endRun
Jul 26, 2017
bb9bae6
introducing the run tree
Jul 26, 2017
34c0f7b
changing the Info producers to write to the run tree. Necessary to be…
Jul 26, 2017
919aad3
Merge branch 'master' into getByToken
Jul 26, 2017
35bdce5
merge commit
Jul 27, 2017
619111d
manual adjustements to merge commit
Jul 27, 2017
897b30a
Merge branch 'dictchanges' into getByToken
Jul 28, 2017
1d3a0f0
additional changes
Jul 28, 2017
c06d7b8
merge commit
Jul 31, 2017
77f3914
automatically determine the branch from Travis
Aug 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ language: cpp
services:
- docker
env:
- TEST_CMSSW_VERSION=CMSSW_9_2_4 SCRAM_ARCH=slc6_amd64_gcc530 KAPPA_BRANCH=dictchanges CHECKOUTSCRIPT=checkoutCmssw92xPackagesForSkimming.sh SKIMMING_SCRIPT=Kappa/Skimming/higgsTauTau/kSkimming_run2_cfg.py ADDITIONAL_OUTPUT=false
- TEST_CMSSW_VERSION=CMSSW_8_0_26_patch1 SCRAM_ARCH=slc6_amd64_gcc530 KAPPA_BRANCH=dictchanges CHECKOUTSCRIPT=checkoutCmssw80xPackagesForSkimming.sh SKIMMING_SCRIPT=Kappa/Skimming/higgsTauTau/kSkimming_run2_cfg.py ADDITIONAL_OUTPUT=false
- TEST_CMSSW_VERSION=CMSSW_7_6_3 SCRAM_ARCH=slc6_amd64_gcc493 KAPPA_BRANCH=dictchanges CHECKOUTSCRIPT=checkoutCmssw76xPackagesForSkimming.sh SKIMMING_SCRIPT=Kappa/Skimming/higgsTauTau/kSkimming_run2_cfg.py ADDITIONAL_OUTPUT=true
- TEST_CMSSW_VERSION=CMSSW_9_2_4 SCRAM_ARCH=slc6_amd64_gcc530 KAPPA_BRANCH=${TRAVIS_BRANCH} CHECKOUTSCRIPT=checkoutCmssw92xPackagesForSkimming.sh SKIMMING_SCRIPT=Kappa/Skimming/higgsTauTau/kSkimming_run2_cfg.py ADDITIONAL_OUTPUT=false
- TEST_CMSSW_VERSION=CMSSW_8_0_26_patch1 SCRAM_ARCH=slc6_amd64_gcc530 KAPPA_BRANCH=${TRAVIS_BRANCH} CHECKOUTSCRIPT=checkoutCmssw80xPackagesForSkimming.sh SKIMMING_SCRIPT=Kappa/Skimming/higgsTauTau/kSkimming_run2_cfg.py ADDITIONAL_OUTPUT=false
- TEST_CMSSW_VERSION=CMSSW_7_6_3 SCRAM_ARCH=slc6_amd64_gcc493 KAPPA_BRANCH=${TRAVIS_BRANCH} CHECKOUTSCRIPT=checkoutCmssw76xPackagesForSkimming.sh SKIMMING_SCRIPT=Kappa/Skimming/higgsTauTau/kSkimming_run2_cfg.py ADDITIONAL_OUTPUT=true
#- TEST_CMSSW_VERSION=CMSSW_5_3_29 SCRAM_ARCH=slc6_amd64_gcc472 CHECKOUTSCRIPT=checkoutCmssw76xPackagesForSkimming.sh SKIMMING_SCRIPT=Kappa/Skimming/higgsTauTau/kSkimming_run2_cfg.py ADDITIONAL_OUTPUT=false
# skim_tutorial1_basic.py - checkoutDummy.sh and checkoutTauRefit.py are not available
#- CHECKOUTSCRIPT=checkoutTauRefit.py SKIMMING_SCRIPT=Kappa/Skimming/examples/skim_tutorial1_basic.py ADDITIONAL_OUTPUT=false
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/interface/KDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ std::ostream &operator<<(std::ostream &os, const KMuon &mu);
std::ostream &operator<<(std::ostream &os, const KMuonTriggerCandidate &cand);
std::ostream &operator<<(std::ostream &os, const KProvenance &p);
std::ostream &operator<<(std::ostream &os, const KLumiInfo &info);
std::ostream &operator<<(std::ostream &os, const KGenLumiInfo &info);
std::ostream &operator<<(std::ostream &os, const KGenRunInfo &info);
std::ostream &operator<<(std::ostream &os, const KDataLumiInfo &info);
std::ostream &operator<<(std::ostream &os, const KEventInfo &i);
std::ostream &operator<<(std::ostream &os, const KTauMetadata &m);
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/interface/KInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ struct KLumiInfo
};


struct KGenLumiInfo : public KLumiInfo
struct KGenRunInfo
{
virtual ~KGenLumiInfo() {};
virtual ~KGenRunInfo() {};

double filterEff; //< generator filter efficiency
double xSectionExt; //< external process cross section
Expand Down
2 changes: 0 additions & 2 deletions DataFormats/interface/KJetMET.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ struct KHCALNoiseSummary
struct KPileupDensity
{
virtual ~KPileupDensity() {};

double rho;
double sigma;
};

#endif
2 changes: 1 addition & 1 deletion DataFormats/interface/Kappa.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ REGISTER_NAME_OF_TYPE(KHCALNoiseSummary,KHCALNoiseSummary);
REGISTER_NAME_OF_TYPE(KTrackSummary,KTrackSummary);
REGISTER_NAME_OF_TYPE(KVertexSummary,KVertexSummary);
REGISTER_NAME_OF_TYPE(KLumiInfo,KLumiInfo);
REGISTER_NAME_OF_TYPE(KGenLumiInfo,KGenLumiInfo);
REGISTER_NAME_OF_TYPE(KGenRunInfo,KGenRunInfo);
REGISTER_NAME_OF_TYPE(KDataLumiInfo,KDataLumiInfo);
REGISTER_NAME_OF_TYPE(KElectronMetadata,KElectronMetadata);
REGISTER_NAME_OF_TYPE(KFilterMetadata,KFilterMetadata);
Expand Down
6 changes: 2 additions & 4 deletions DataFormats/src/KDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ std::ostream &operator<<(std::ostream &os, const KBeamSpot &bs)
{
os << bs.position << " beta*=" << bs.betaStar;
os << " beamWidth=(" << bs.beamWidthX << ", " << bs.beamWidthY << ")";
os << " dx/dz=" << bs.dxdz << " dy/dz=" << bs.dydz << " sigmaZ=" << bs.sigmaZ;
return os;
}

Expand Down Expand Up @@ -264,7 +263,7 @@ std::ostream &operator<<(std::ostream &os, const KTriggerObjects &to)

std::ostream &operator<<(std::ostream &os, const KPileupDensity &pu)
{
return os << "rho=" << pu.rho << " sigma=" << pu.sigma;
return os << "rho=" << pu.rho;
}

std::ostream &operator<<(std::ostream &os, const KHit &hit)
Expand Down Expand Up @@ -358,9 +357,8 @@ std::ostream &operator<<(std::ostream &os, const KLumiInfo &info)
return os;
}

std::ostream &operator<<(std::ostream &os, const KGenLumiInfo &info)
std::ostream &operator<<(std::ostream &os, const KGenRunInfo &info)
{
os << static_cast<const KLumiInfo>(info) << std::endl;
os << "\txSec(ext)=" << info.xSectionExt << " xSec(int)=" << info.xSectionInt;
os << " filterEff=" << info.filterEff;
return os;
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ namespace
KTrackSummary dict_KTrackSummary;
KVertexSummary dict_KVertexSummary;
KLumiInfo dict_KLumiInfo;
KGenLumiInfo dict_KGenLumiInfo;
KGenRunInfo dict_KGenRunInfo;
KDataLumiInfo dict_KDataLumiInfo;
KElectronMetadata dict_KElectronMetadata;
KFilterMetadata dict_KFilterMetadata;
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/src/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ These classes should be filled once per lumi section.

### Lumi section info
+ KLumiInfo
+ KGenLumiInfo
+ KGenRunInfo
+ KDataLumiInfo

### Object metadata
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<class name="KTrackSummary"/>
<class name="KVertexSummary"/>
<class name="KLumiInfo"/>
<class name="KGenLumiInfo"/>
<class name="KGenRunInfo"/>
<class name="KDataLumiInfo"/>
<class name="KElectronMetadata"/>
<class name="KFilterMetadata"/>
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/test/testDebug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main() {
cout << "* KTrackSummary: " << KTrackSummary() << endl << endl;
cout << "* KVertexSummary: " << KVertexSummary() << endl << endl;
cout << "* KLumiInfo: " << KLumiInfo() << endl << endl;
cout << "* KGenLumiInfo: " << KGenLumiInfo() << endl << endl;
cout << "* KGenRunInfo: " << KGenRunInfo() << endl << endl;
cout << "* KDataLumiInfo: " << KDataLumiInfo() << endl << endl;
cout << "* KElectronMetadata: " << KElectronMetadata() << endl << endl;
cout << "* KFilterMetadata: " << KFilterMetadata() << endl << endl;
Expand Down
4 changes: 2 additions & 2 deletions Producers/interface/KBaseMatchingProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ template<typename Tout>
class KBaseMatchingProducer : public KBaseProducerWP
{
public:
KBaseMatchingProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseProducerWP(cfg, _event_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
KBaseMatchingProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseProducerWP(cfg, _event_tree, _lumi_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
event_tree(_event_tree), matchingCounter(0), producerLabel(producerName),
viManual(cfg.getParameter<std::vector<edm::InputTag> >("manual")),

Expand Down
8 changes: 4 additions & 4 deletions Producers/interface/KBaseMultiLVProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class KBaseMultiVectorProducer : public KBaseMultiProducer<Tin, Tout>
typedef typename KBaseMultiProducer<Tin, Tout>::InputType::value_type SingleInputType;
typedef typename KBaseMultiProducer<Tin, Tout>::OutputType::value_type SingleOutputType;
public:
KBaseMultiVectorProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseMultiProducer<Tin, Tout>(cfg, _event_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
KBaseMultiVectorProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseMultiProducer<Tin, Tout>(cfg, _event_tree, _lumi_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
maxN(cfg.getParameter<int>("maxN")),
firstObject(true) {}

Expand Down Expand Up @@ -87,8 +87,8 @@ template<typename Tin, typename Tout>
class KBaseMultiLVProducer : public KBaseMultiVectorProducer<Tin, Tout>
{
public:
KBaseMultiLVProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseMultiVectorProducer<Tin, Tout>(cfg, _event_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
KBaseMultiLVProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseMultiVectorProducer<Tin, Tout>(cfg, _event_tree, _lumi_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
minPt(cfg.getParameter<double>("minPt")),
maxEta(cfg.getParameter<double>("maxEta")) {}

Expand Down
26 changes: 10 additions & 16 deletions Producers/interface/KBaseMultiProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,34 @@ template<typename Tin, typename Tout>
class KBaseMultiProducer : public KBaseMatchingProducer<Tout>
{
public:
KBaseMultiProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector, bool _justOutputName = false) :
KBaseMatchingProducer<Tout>(cfg, _event_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
KBaseMultiProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector, bool _justOutputName = false) :
KBaseMatchingProducer<Tout>(cfg, _event_tree, _lumi_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
event_tree(_event_tree), justOutputName(_justOutputName)
{
this->addPSetRequests();
for (typename std::map<Tout*, std::pair<const edm::ParameterSet, const edm::InputTag> >::iterator
it = targetSetupMap.begin(); it != targetSetupMap.end(); ++it)
{
const edm::InputTag &src = it->second.second;
consumescollector.consumes<Tin>(src);
}

}
typedef std::tuple<const edm::ParameterSet, const edm::InputTag, const edm::EDGetTokenT<Tin>> TargetSetupMapContent;
virtual ~KBaseMultiProducer() {}

virtual bool onEvent(const edm::Event &event, const edm::EventSetup &setup)
{
this->cEvent = &event;
this->cSetup = &setup;

for (typename std::map<Tout*, std::pair<const edm::ParameterSet, const edm::InputTag> >::iterator
for (typename std::map<Tout*, TargetSetupMapContent >::iterator
it = targetSetupMap.begin(); it != targetSetupMap.end(); ++it)
{
const edm::ParameterSet &pset = it->second.first;
const edm::InputTag &src = it->second.second;
const edm::ParameterSet &pset = std::get<0>(it->second);
const edm::InputTag &src = std::get<1>(it->second);
const std::pair<std::string, std::string> desc = this->nameMap[it->first];

// Clear previous collection
Tout &ref = *it->first;
clearProduct(ref);

// Try to get product via id
if (!event.getByLabel(src, this->handle))
if (!event.getByToken(std::get<2>(it->second), this->handle))
{
std::cout << "Could not get main product! " << desc.second << ".src = " << src.encode() << std::endl;
continue;
Expand Down Expand Up @@ -92,8 +87,7 @@ class KBaseMultiProducer : public KBaseMatchingProducer<Tout>
nameMap[target] = make_pair(targetName, inputName);

// Used for fast lookup of selector and lv collection
typedef std::pair<const edm::ParameterSet, const edm::InputTag> TmpType;
this->targetSetupMap.insert(std::pair<Tout*, TmpType>(target, TmpType(pset, tag)));
this->targetSetupMap.insert(std::pair<Tout*, TargetSetupMapContent>(target, TargetSetupMapContent(pset, tag, this->consumescollector_.template consumes<Tin>(tag))));
}

virtual void fillProduct(const InputType &input, OutputType &output,
Expand All @@ -105,8 +99,8 @@ class KBaseMultiProducer : public KBaseMatchingProducer<Tout>
TTree *event_tree;
const edm::Event *cEvent;
const edm::EventSetup *cSetup;

std::map<Tout*, std::pair<const edm::ParameterSet, const edm::InputTag> > targetSetupMap;
std::map<Tout*, TargetSetupMapContent > targetSetupMap;
std::map<Tout*, std::pair<std::string, std::string> > nameMap;

private:
Expand Down
4 changes: 3 additions & 1 deletion Producers/interface/KBaseProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class KBaseProducer
virtual bool onEvent(const edm::Event &event, const edm::EventSetup &setup);
virtual bool onFirstEvent(const edm::Event &event, const edm::EventSetup &setup);
virtual bool endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &setup);
virtual bool endRun(edm::Run const &run, edm::EventSetup const &setup);
virtual ~KBaseProducer() {};

protected:
Expand All @@ -49,10 +50,11 @@ class KBaseProducerWP : public KBaseProducer
{
public:
virtual ~KBaseProducerWP() {};
KBaseProducerWP(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector);
KBaseProducerWP(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector);
void addProvenance(std::string oldName, std::string newName);

protected:
edm::ConsumesCollector& consumescollector_;
const edm::ParameterSet psBase;
KProvenance *provenance;
};
Expand Down
4 changes: 2 additions & 2 deletions Producers/interface/KBasicJetProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
class KBasicJetProducer : public KBaseMultiLVProducer<reco::PFJetCollection, std::vector<KBasicJet> >
{
public:
KBasicJetProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_run_tree, edm::ConsumesCollector && consumescollector) :
KBaseMultiLVProducer<reco::PFJetCollection, KBasicJets>(cfg, _event_tree, _run_tree, getLabel(), std::forward<edm::ConsumesCollector>(consumescollector)) {}
KBasicJetProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, edm::ConsumesCollector && consumescollector) :
KBaseMultiLVProducer<reco::PFJetCollection, KBasicJets>(cfg, _event_tree, _lumi_tree, _run_tree, getLabel(), std::forward<edm::ConsumesCollector>(consumescollector)) {}

static const std::string getLabel() { return "BasicJets"; }

Expand Down
12 changes: 7 additions & 5 deletions Producers/interface/KBasicTauProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ template<typename TTau, typename TTauDiscriminator, typename TProduct>
class KBasicTauProducer : public KBaseMultiLVProducer<std::vector<TTau>, TProduct>
{
public:
KBasicTauProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseMultiLVProducer<std::vector<TTau>, TProduct>(cfg, _event_tree, _lumi_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector))
KBasicTauProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, const std::string &producerName, edm::ConsumesCollector && consumescollector) :
KBaseMultiLVProducer<std::vector<TTau>, TProduct>(cfg, _event_tree, _lumi_tree, _run_tree, producerName, std::forward<edm::ConsumesCollector>(consumescollector)),
VertexCollectionSource(cfg.getParameter<edm::InputTag>("vertexcollection"))
{
const edm::ParameterSet &psBase = this->psBase;
std::vector<std::string> names = psBase.getParameterNamesForType<edm::ParameterSet>();
Expand All @@ -47,7 +48,7 @@ class KBasicTauProducer : public KBaseMultiLVProducer<std::vector<TTau>, TProduc
floatDiscrWhitelist[names[i]] = pset.getParameter< std::vector<std::string> >("floatDiscrWhitelist");
floatDiscrBlacklist[names[i]] = pset.getParameter< std::vector<std::string> >("floatDiscrBlacklist");
tauDiscrProcessName[names[i]] = pset.getParameter< std::string >("tauDiscrProcessName");
if(pset.existsAs<edm::InputTag>("vertexcollection")) consumescollector.consumes<reco::VertexCollection>(pset.getParameter<edm::InputTag>("vertexcollection"));
this->VertexCollectionToken = consumescollector.consumes<reco::VertexCollection>(VertexCollectionSource);
}
}

Expand Down Expand Up @@ -124,8 +125,7 @@ class KBasicTauProducer : public KBaseMultiLVProducer<std::vector<TTau>, TProduc
const std::string &name, const edm::InputTag *tag, const edm::ParameterSet &pset)
{
// Get vertices from event
edm::InputTag VertexCollectionSource = pset.getParameter<edm::InputTag>("vertexcollection");
this->cEvent->getByLabel(VertexCollectionSource, VertexHandle);
this->cEvent->getByToken(this->VertexCollectionToken, VertexHandle);

// Get tau discriminators from event
this->cEvent->getManyByType(currentTauDiscriminators);
Expand Down Expand Up @@ -276,6 +276,8 @@ class KBasicTauProducer : public KBaseMultiLVProducer<std::vector<TTau>, TProduc
}

protected:
edm::InputTag VertexCollectionSource;
edm::EDGetTokenT<reco::VertexCollection> VertexCollectionToken;
std::map<std::string, std::vector<std::string> > preselectionDiscr;
std::map<std::string, std::vector<std::string> > binaryDiscrWhitelist, binaryDiscrBlacklist, floatDiscrWhitelist, floatDiscrBlacklist;
std::map<std::string, KTauMetadata *> discriminatorMap;
Expand Down
4 changes: 2 additions & 2 deletions Producers/interface/KBeamSpotProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
class KBeamSpotProducer : public KBaseMultiProducer<reco::BeamSpot, KBeamSpot>
{
public:
KBeamSpotProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_run_tree, edm::ConsumesCollector && consumescollector) :
KBaseMultiProducer<reco::BeamSpot, KBeamSpot>(cfg, _event_tree, _run_tree, getLabel(), std::forward<edm::ConsumesCollector>(consumescollector)) {}
KBeamSpotProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, edm::ConsumesCollector && consumescollector) :
KBaseMultiProducer<reco::BeamSpot, KBeamSpot>(cfg, _event_tree, _lumi_tree, _run_tree, getLabel(), std::forward<edm::ConsumesCollector>(consumescollector)) {}
virtual ~KBeamSpotProducer() {};

static const std::string getLabel() { return "BeamSpot"; }
Expand Down
32 changes: 16 additions & 16 deletions Producers/interface/KCaloJetProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
class KCaloJetProducer : public KBaseMultiLVProducer<reco::CaloJetCollection, KCaloJets>
{
public:
KCaloJetProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_run_tree, edm::ConsumesCollector && consumescollector) :
KBaseMultiLVProducer<reco::CaloJetCollection, KCaloJets>(cfg, _event_tree, _run_tree, getLabel(), std::forward<edm::ConsumesCollector>(consumescollector)) {}
KCaloJetProducer(const edm::ParameterSet &cfg, TTree *_event_tree, TTree *_lumi_tree, TTree *_run_tree, edm::ConsumesCollector && consumescollector) :
KBaseMultiLVProducer<reco::CaloJetCollection, KCaloJets>(cfg, _event_tree, _lumi_tree, _run_tree, getLabel(), std::forward<edm::ConsumesCollector>(consumescollector)) {}

static const std::string getLabel() { return "CaloJets"; }

virtual void fillProduct(const InputType &in, OutputType &out,
const std::string &name, const edm::InputTag *tag, const edm::ParameterSet &pset)
{
// Retrieve additional input products
tagJetID = pset.getParameter<edm::InputTag>("srcJetID");
if (tagJetID.label() != "")
cEvent->getByLabel(tagJetID, hJetID);
//tagJetID = pset.getParameter<edm::InputTag>("srcJetID");
//if (tagJetID.label() != "")
// cEvent->getByLabel(tagJetID, hJetID);

// Continue normally
KBaseMultiLVProducer<reco::CaloJetCollection, KCaloJets>::fillProduct(in, out, name, tag, pset);
Expand All @@ -46,20 +46,20 @@ class KCaloJetProducer : public KBaseMultiLVProducer<reco::CaloJetCollection, KC
out.fHPD = -2;
out.fRBX = -2;
out.fHO = -2;
if (tagJetID.label() != "")
{
edm::RefToBase<reco::Jet> jetRef(edm::Ref<reco::CaloJetCollection>(handle, this->nCursor));
const reco::JetID &jetID = (*hJetID)[jetRef];
out.n90Hits = static_cast<int>(jetID.n90Hits);
out.fHPD = jetID.fHPD;
out.fRBX = jetID.fRBX;
out.fHO = jetID.fHO;
}
//if (tagJetID.label() != "")
//{
// edm::RefToBase<reco::Jet> jetRef(edm::Ref<reco::CaloJetCollection>(handle, this->nCursor));
// const reco::JetID &jetID = (*hJetID)[jetRef];
// out.n90Hits = static_cast<int>(jetID.n90Hits);
// out.fHPD = jetID.fHPD;
// out.fRBX = jetID.fRBX;
// out.fHO = jetID.fHO;
//}
}

private:
edm::InputTag tagJetID;
edm::Handle<edm::ValueMap<reco::JetID> > hJetID;
//edm::InputTag tagJetID;
//edm::Handle<edm::ValueMap<reco::JetID> > hJetID;
};

#endif
Loading