Skip to content

Commit

Permalink
Clang-Format
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed May 20, 2019
1 parent 864f4f6 commit 6684288
Show file tree
Hide file tree
Showing 485 changed files with 37,177 additions and 43,594 deletions.
15 changes: 6 additions & 9 deletions Fireworks/Candidates/interface/CandidateUtils.h
@@ -1,5 +1,5 @@
#ifndef CANDIDATES_CANDIDATE_UTILS_H
# define CANDIDATES_CANDIDATE_UTILS_H
#define CANDIDATES_CANDIDATE_UTILS_H

#include "DataFormats/Candidate/interface/Candidate.h"

Expand All @@ -8,13 +8,10 @@ class TEveTrackPropagator;
class TEveStraightLineSet;

namespace fireworks {

TEveTrack* prepareCandidate( const reco::Candidate& track,
TEveTrackPropagator* propagator);

void addStraightLineSegment( TEveStraightLineSet* marker,
reco::Candidate const* cand,
double scale_factor = 2);
}
TEveTrack* prepareCandidate(const reco::Candidate& track, TEveTrackPropagator* propagator);

#endif // CANDIDATES_CANDIDATE_UTILS_H
void addStraightLineSegment(TEveStraightLineSet* marker, reco::Candidate const* cand, double scale_factor = 2);
} // namespace fireworks

#endif // CANDIDATES_CANDIDATE_UTILS_H
16 changes: 8 additions & 8 deletions Fireworks/Candidates/interface/FWCandidateTowerSliceSelector.h
Expand Up @@ -4,16 +4,16 @@
#include "Fireworks/Calo/interface/FWHistSliceSelector.h"
class FWSimpleProxyHelper;

class FWCandidateTowerSliceSelector : public FWHistSliceSelector
{
class FWCandidateTowerSliceSelector : public FWHistSliceSelector {
public:
FWCandidateTowerSliceSelector(TH2F* h, const FWEventItem* i, FWSimpleProxyHelper* m_helper);
~FWCandidateTowerSliceSelector() override;
FWCandidateTowerSliceSelector(TH2F* h, const FWEventItem* i, FWSimpleProxyHelper* m_helper);
~FWCandidateTowerSliceSelector() override;

bool aggregatePhiCells() const override { return false; }
protected:
void getItemEntryEtaPhi(int itemIdx, float& eta, float& phi) const override;
FWSimpleProxyHelper* m_helper;
bool aggregatePhiCells() const override { return false; }

protected:
void getItemEntryEtaPhi(int itemIdx, float& eta, float& phi) const override;
FWSimpleProxyHelper* m_helper;
};

#endif
53 changes: 28 additions & 25 deletions Fireworks/Candidates/interface/FWLegoCandidate.h
Expand Up @@ -18,36 +18,39 @@
// Forward declarations
class FWViewContext;

namespace fireworks
{
class Context;
namespace fireworks {
class Context;
}

//-----------------------------------------------------------------------------
// FWLegoCandidate
//-----------------------------------------------------------------------------
class FWLegoCandidate : public TEveStraightLineSet
{
public:
// ---------------- Constructor(s)/Destructor ----------------------
FWLegoCandidate( const FWViewContext *vc, const fireworks::Context &context,
float et, float energy, float pt, float eta, float phi );
FWLegoCandidate(){}
~FWLegoCandidate() override{}

// --------------------- Member Functions --------------------------
void updateScale( const FWViewContext *vc, const fireworks::Context& );

private:
FWLegoCandidate( const FWLegoCandidate& ) = delete; // Disable default copy constructor
const FWLegoCandidate& operator=( const FWLegoCandidate& ) = delete; // Disable default assignment operator

// ----------------------- Data Members ----------------------------
float m_energy;
float m_et;
float m_pt;
float m_eta;
float m_phi;
class FWLegoCandidate : public TEveStraightLineSet {
public:
// ---------------- Constructor(s)/Destructor ----------------------
FWLegoCandidate(const FWViewContext* vc,
const fireworks::Context& context,
float et,
float energy,
float pt,
float eta,
float phi);
FWLegoCandidate() {}
~FWLegoCandidate() override {}

// --------------------- Member Functions --------------------------
void updateScale(const FWViewContext* vc, const fireworks::Context&);

private:
FWLegoCandidate(const FWLegoCandidate&) = delete; // Disable default copy constructor
const FWLegoCandidate& operator=(const FWLegoCandidate&) = delete; // Disable default assignment operator

// ----------------------- Data Members ----------------------------
float m_energy;
float m_et;
float m_pt;
float m_eta;
float m_phi;
};
#endif
//=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
14 changes: 5 additions & 9 deletions Fireworks/Candidates/plugins/FWCandidateECALDetailView.cc
@@ -1,17 +1,14 @@
#include "Fireworks/Calo/interface/FWECALDetailViewBase.h"
#include "DataFormats/Candidate/interface/Candidate.h"

class FWCandidateECALDetailView: public FWECALDetailViewBase<reco::Candidate>
{
class FWCandidateECALDetailView : public FWECALDetailViewBase<reco::Candidate> {
public:
FWCandidateECALDetailView() {}
~FWCandidateECALDetailView() override {}
FWCandidateECALDetailView() {}
~FWCandidateECALDetailView() override {}

private:
FWCandidateECALDetailView(const FWCandidateECALDetailView&) = delete; // stop default
const FWCandidateECALDetailView& operator=(const FWCandidateECALDetailView&) = delete; // stop default


FWCandidateECALDetailView(const FWCandidateECALDetailView&) = delete; // stop default
const FWCandidateECALDetailView& operator=(const FWCandidateECALDetailView&) = delete; // stop default
};

REGISTER_FWDETAILVIEW(FWCandidateECALDetailView, ECAL);
Expand All @@ -24,4 +21,3 @@ REGISTER_FWDETAILVIEW(FWCandidateECALDetailView, ECAL,reducedEcalRecHitsEB);
// miniaod
REGISTER_FWDETAILVIEW(FWCandidateECALDetailView, ECAL,reducedEgamma);
*/

128 changes: 60 additions & 68 deletions Fireworks/Candidates/plugins/FWCandidateHGCalLegoProxyBuilder.cc
Expand Up @@ -21,85 +21,77 @@
//-----------------------------------------------------------------------------
// FWCandidateHGCalLegoProxyBuilder
//-----------------------------------------------------------------------------
class FWCandidateHGCalLegoProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::HGCalMultiCluster>
{
public:
// ---------------- Constructor(s)/Destructor ----------------------
FWCandidateHGCalLegoProxyBuilder(){}
~FWCandidateHGCalLegoProxyBuilder() override{}

// --------------------- Member Functions --------------------------
bool havePerViewProduct( FWViewType::EType ) const override { return true; }
void scaleProduct( TEveElementList*, FWViewType::EType, const FWViewContext* ) override;
void localModelChanges( const FWModelId&, TEveElement*, FWViewType::EType,
const FWViewContext* ) override;

REGISTER_PROXYBUILDER_METHODS();

private:
// ----------------------- Data Members ----------------------------
FWCandidateHGCalLegoProxyBuilder( const FWCandidateHGCalLegoProxyBuilder& ) = delete;
const FWCandidateHGCalLegoProxyBuilder& operator=( const FWCandidateHGCalLegoProxyBuilder& ) = delete;

// --------------------- Member Functions --------------------------
using FWSimpleProxyBuilderTemplate<reco::HGCalMultiCluster>::build;
void build( const reco::HGCalMultiCluster&, unsigned int, TEveElement&, const FWViewContext* ) override;
class FWCandidateHGCalLegoProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::HGCalMultiCluster> {
public:
// ---------------- Constructor(s)/Destructor ----------------------
FWCandidateHGCalLegoProxyBuilder() {}
~FWCandidateHGCalLegoProxyBuilder() override {}

// --------------------- Member Functions --------------------------
bool havePerViewProduct(FWViewType::EType) const override { return true; }
void scaleProduct(TEveElementList *, FWViewType::EType, const FWViewContext *) override;
void localModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *) override;

REGISTER_PROXYBUILDER_METHODS();

private:
// ----------------------- Data Members ----------------------------
FWCandidateHGCalLegoProxyBuilder(const FWCandidateHGCalLegoProxyBuilder &) = delete;
const FWCandidateHGCalLegoProxyBuilder &operator=(const FWCandidateHGCalLegoProxyBuilder &) = delete;

// --------------------- Member Functions --------------------------
using FWSimpleProxyBuilderTemplate<reco::HGCalMultiCluster>::build;
void build(const reco::HGCalMultiCluster &, unsigned int, TEveElement &, const FWViewContext *) override;
};
#endif
//=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_


//______________________________________________________________________________
void
FWCandidateHGCalLegoProxyBuilder::scaleProduct( TEveElementList *parent, FWViewType::EType type,
const FWViewContext *vc )
{
for( TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i )
{
if( (*i)->HasChildren() )
{
TEveElement *el = (*i)->FirstChild(); // There is only one child
FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate*> (el);
candidate->updateScale( vc, context() );
}
}
void FWCandidateHGCalLegoProxyBuilder::scaleProduct(TEveElementList *parent,
FWViewType::EType type,
const FWViewContext *vc) {
for (TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i) {
if ((*i)->HasChildren()) {
TEveElement *el = (*i)->FirstChild(); // There is only one child
FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate *>(el);
candidate->updateScale(vc, context());
}
}
}

//______________________________________________________________________________
void
FWCandidateHGCalLegoProxyBuilder::localModelChanges( const FWModelId &iId, TEveElement *parent,
FWViewType::EType type, const FWViewContext *vc )
{
// Line set marker is nto the same color as line, have to fix it here
if( (parent)->HasChildren() )
{
TEveElement *el = (parent)->FirstChild(); // There is only one child
FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate*> (el);
candidate->SetMarkerColor( item()->modelInfo( iId.index() ).displayProperties().color() );
candidate->ElementChanged();
}
void FWCandidateHGCalLegoProxyBuilder::localModelChanges(const FWModelId &iId,
TEveElement *parent,
FWViewType::EType type,
const FWViewContext *vc) {
// Line set marker is nto the same color as line, have to fix it here
if ((parent)->HasChildren()) {
TEveElement *el = (parent)->FirstChild(); // There is only one child
FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate *>(el);
candidate->SetMarkerColor(item()->modelInfo(iId.index()).displayProperties().color());
candidate->ElementChanged();
}
}

//______________________________________________________________________________
void
FWCandidateHGCalLegoProxyBuilder::build( const reco::HGCalMultiCluster &iData, unsigned int iIndex,
TEveElement &oItemHolder, const FWViewContext *vc )
{
const auto & clusters = iData.clusters();

for (const auto & c : clusters)
{
auto pt = c->energy()/std::cosh(c->eta());
FWLegoCandidate *candidate = new FWLegoCandidate( vc, context(), c->energy(),
pt, pt,
c->eta(), c->phi() );

candidate->SetMarkerColor( item()->defaultDisplayProperties().color() );
context().voteMaxEtAndEnergy( pt, c->energy() );
setupAddElement( candidate, &oItemHolder );
}
void FWCandidateHGCalLegoProxyBuilder::build(const reco::HGCalMultiCluster &iData,
unsigned int iIndex,
TEveElement &oItemHolder,
const FWViewContext *vc) {
const auto &clusters = iData.clusters();

for (const auto &c : clusters) {
auto pt = c->energy() / std::cosh(c->eta());
FWLegoCandidate *candidate = new FWLegoCandidate(vc, context(), c->energy(), pt, pt, c->eta(), c->phi());

candidate->SetMarkerColor(item()->defaultDisplayProperties().color());
context().voteMaxEtAndEnergy(pt, c->energy());
setupAddElement(candidate, &oItemHolder);
}
}

//______________________________________________________________________________
REGISTER_FWPROXYBUILDER( FWCandidateHGCalLegoProxyBuilder, reco::HGCalMultiCluster, "HGCal Multiclusters Lego",
FWViewType::kLegoBit | FWViewType::kLegoHF );
REGISTER_FWPROXYBUILDER(FWCandidateHGCalLegoProxyBuilder,
reco::HGCalMultiCluster,
"HGCal Multiclusters Lego",
FWViewType::kLegoBit | FWViewType::kLegoHF);

0 comments on commit 6684288

Please sign in to comment.