Skip to content

Commit

Permalink
code-checks fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mbluj committed May 19, 2020
1 parent d1e19f2 commit 407f38c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class TauDiscriminationAgainstElectronDeadECAL : public TauDiscriminationProduce
double discriminate(const TauRef& tau) const override {
if (verbosity_) {
edm::LogPrint(TauDiscriminationProducerBase<TauType, TauDiscriminator>::getTauTypeString() + "AgainstEleDeadECAL")
<< "<" + TauDiscriminationProducerBase<TauType, TauDiscriminator>::getTauTypeString() + "AgainstElectronDeadECAL::discriminate>:";
edm::LogPrint(TauDiscriminationProducerBase<TauType, TauDiscriminator>::getTauTypeString() + "AgainstEleDeadECAL") << " moduleLabel = " << moduleLabel_;
<< "<" + TauDiscriminationProducerBase<TauType, TauDiscriminator>::getTauTypeString() +
"AgainstElectronDeadECAL::discriminate>:";
edm::LogPrint(TauDiscriminationProducerBase<TauType, TauDiscriminator>::getTauTypeString() + "AgainstEleDeadECAL")
<< " moduleLabel = " << moduleLabel_;
edm::LogPrint(TauDiscriminationProducerBase<TauType, TauDiscriminator>::getTauTypeString() + "AgainstEleDeadECAL")
<< " tau: Pt = " << tau->pt() << ", eta = " << tau->eta() << ", phi = " << tau->phi();
}
Expand Down
16 changes: 9 additions & 7 deletions RecoTauTag/RecoTau/src/TauDiscriminationProducerBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TauDiscriminationProducerBase<TauType, TauDiscriminator, TauDiscriminatorDataTyp
TauDiscriminationProducerBase(const edm::ParameterSet& iConfig)
: moduleLabel_(iConfig.getParameter<std::string>("@module_label")) {
// tau collection to discriminate
TauProducer_ = iConfig.getParameter<edm::InputTag>(getTauTypeString()+"Producer");
TauProducer_ = iConfig.getParameter<edm::InputTag>(getTauTypeString() + "Producer");
Tau_token = consumes<TauCollection>(TauProducer_);

// prediscriminant operator
Expand Down Expand Up @@ -172,7 +172,7 @@ template <class TauType, class TauDiscriminator, class TauDiscriminatorDataType,
void TauDiscriminationProducerBase<TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType>::
fillProducerDescriptions(edm::ParameterSetDescription& desc) {
// helper function, it fills the description of the Producers parameter
desc.add<edm::InputTag>(getTauTypeString()+"Producer", edm::InputTag("fixme"));
desc.add<edm::InputTag>(getTauTypeString() + "Producer", edm::InputTag("fixme"));
{
edm::ParameterSetDescription pset_prediscriminants;
pset_prediscriminants.add<std::string>("BooleanOperator", "AND");
Expand All @@ -192,12 +192,14 @@ void TauDiscriminationProducerBase<TauType, TauDiscriminator, TauDiscriminatorDa
}

template <class TauType, class TauDiscriminator, class TauDiscriminatorDataType, class ConsumeType>
std::string TauDiscriminationProducerBase<TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType>::
getTauTypeString() {
if(std::is_same<TauType, reco::PFTau>::value) return "PFTau";
if(std::is_same<TauType, pat::Tau>::value) return "PATTau";
std::string
TauDiscriminationProducerBase<TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType>::getTauTypeString() {
if (std::is_same<TauType, reco::PFTau>::value)
return "PFTau";
if (std::is_same<TauType, pat::Tau>::value)
return "PATTau";
throw cms::Exception("TauDiscriminationProducerBase")
<< "Unsupported TauType used. You must use either PFTau or PATTau.";
<< "Unsupported TauType used. You must use either PFTau or PATTau.";
}

// compile our desired types and make available to linker
Expand Down

0 comments on commit 407f38c

Please sign in to comment.