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

code-format, llvm-ccdb and clang-tidy #103

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions DataFormats/L1TrackTrigger/interface/TTBV.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ class TTBV {
double val(double base) const { return (this->val() + .5) * base; }

// conversion: range based to double for given precision assuming biased (floor) representation, reinterpret sign
double val(double base, int start, int end = 0, bool twos = false) const { return (this->val(start, end, twos) + .5) * base; }
double val(double base, int start, int end = 0, bool twos = false) const {
return (this->val(start, end, twos) + .5) * base;
}

// maniplulation and conversion: extracts range based to double reinterpret sign and removes these bits
double extract(double base, int size, bool twos = false) {
Expand Down Expand Up @@ -332,7 +334,7 @@ class TTBV {
std::vector<int> ids(bool b = true, bool singed = false) const {
std::vector<int> v;
v.reserve(bs_.count());
for(int i = 0; i < size_; i++)
for (int i = 0; i < size_; i++)
if (bs_[i] == b)
v.push_back(singed ? i + size_ / 2 : i);
return v;
Expand All @@ -356,6 +358,4 @@ class TTBV {
}
};



#endif
16 changes: 8 additions & 8 deletions DataFormats/L1TrackTrigger/interface/TTTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@

/// Templated aliases
template <typename T>
using TTClusterDetSetVecT = edmNew::DetSetVector<TTCluster<T> >;
using TTClusterDetSetVecT = edmNew::DetSetVector<TTCluster<T>>;
template <typename T>
using TTStubDetSetVecT = edmNew::DetSetVector<TTStub<T> >;
using TTStubDetSetVecT = edmNew::DetSetVector<TTStub<T>>;

template <typename T>
using TTClusterRefT = edm::Ref<TTClusterDetSetVecT<T>, TTCluster<T> >;
using TTClusterRefT = edm::Ref<TTClusterDetSetVecT<T>, TTCluster<T>>;
template <typename T>
using TTStubRefT = edm::Ref<TTStubDetSetVecT<T>, TTStub<T> >;
using TTStubRefT = edm::Ref<TTStubDetSetVecT<T>, TTStub<T>>;

template <typename T>
using TTTrackPtrT = edm::Ptr<TTTrack<T> >;
using TTTrackPtrT = edm::Ptr<TTTrack<T>>;

/// Specialized aliases
typedef edm::Ref<edm::DetSetVector<Phase2TrackerDigi>, Phase2TrackerDigi> Ref_Phase2TrackerDigi_;
Expand All @@ -45,8 +45,8 @@ typedef TTStubDetSetVecT<Ref_Phase2TrackerDigi_> TTStubDetSetVec;
typedef TTClusterRefT<Ref_Phase2TrackerDigi_> TTClusterRef;
typedef TTStubRefT<Ref_Phase2TrackerDigi_> TTStubRef;

typedef edmNew::DetSet<TTStub<Ref_Phase2TrackerDigi_> > TTStubDetSet;
typedef edmNew::DetSet<TTCluster<Ref_Phase2TrackerDigi_> > TTClusterDetSet;
typedef edmNew::DetSet<TTStub<Ref_Phase2TrackerDigi_>> TTStubDetSet;
typedef edmNew::DetSet<TTCluster<Ref_Phase2TrackerDigi_>> TTClusterDetSet;

typedef edm::Ref<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>, TTTrack<Ref_Phase2TrackerDigi_>> TTTrackRef;
typedef TTTrackPtrT<Ref_Phase2TrackerDigi_> TTTrackPtr;
Expand All @@ -66,6 +66,6 @@ namespace tt {
typedef std::vector<StreamTrack> StreamsTrack;
typedef std::map<TTTrackRef, TTTrackRef> TTTrackRefMap;
typedef std::vector<TTTrack<Ref_Phase2TrackerDigi_>> TTTracks;
} // namespace tt
} // namespace tt

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ namespace trackFindingTracklet {
public:
TrackBuilderChannel() {}
TrackBuilderChannel(const edm::ParameterSet& iConfig);
~TrackBuilderChannel(){}
~TrackBuilderChannel() {}
// sets channelId of given TTTrack, return false if track outside pt range
bool channelId(const TTTrack<Ref_Phase2TrackerDigi_>& ttTrack, int& channelId);
// number of used channels
int numChannels() const { return numChannels_; }

private:
// use tracklet seed type as channel id if False, binned track pt used if True
bool useDuplicateRemoval_;
Expand All @@ -34,7 +35,7 @@ namespace trackFindingTracklet {
int numChannels_;
};

} // namespace trackFindingTracklet
} // namespace trackFindingTracklet

EVENTSETUP_DATA_DEFAULT_RECORD(trackFindingTracklet::TrackBuilderChannel, trackFindingTracklet::TrackBuilderChannelRcd);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace trackFindingTracklet {

typedef edm::mpl::Vector<tt::SetupRcd> RcdsTrackBuilderChannel;

class TrackBuilderChannelRcd : public edm::eventsetup::DependentRecordImplementation<TrackBuilderChannelRcd, RcdsTrackBuilderChannel> {};
class TrackBuilderChannelRcd
: public edm::eventsetup::DependentRecordImplementation<TrackBuilderChannelRcd, RcdsTrackBuilderChannel> {};

} // namespace trackFindingTracklet

Expand Down
6 changes: 2 additions & 4 deletions L1Trigger/TrackFindingTracklet/plugins/ProducerAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ namespace trackFindingTracklet {
const Setup* setup_;
};

ProducerAS::ProducerAS(const ParameterSet& iConfig) :
iConfig_(iConfig)
{
ProducerAS::ProducerAS(const ParameterSet& iConfig) : iConfig_(iConfig) {
const string& labelKF = iConfig.getParameter<string>("LabelKF");
const string& labelTT = iConfig.getParameter<string>("LabelTT");
const string& branch = iConfig.getParameter<string>("BranchAcceptedTracks");
Expand Down Expand Up @@ -96,6 +94,6 @@ namespace trackFindingTracklet {
iEvent.emplace(edPutToken_, move(ttTrackMap));
}

} // namespace trackFindingTracklet
} // namespace trackFindingTracklet

DEFINE_FWK_MODULE(trackFindingTracklet::ProducerAS);
14 changes: 7 additions & 7 deletions L1Trigger/TrackFindingTracklet/plugins/ProducerKFin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ namespace trackFindingTracklet {
bool enableTruncation_;
};

ProducerKFin::ProducerKFin(const ParameterSet& iConfig) :
iConfig_(iConfig)
{
ProducerKFin::ProducerKFin(const ParameterSet& iConfig) : iConfig_(iConfig) {
const InputTag& inputTag = iConfig.getParameter<InputTag>("InputTag");
const string& branchAcceptedStubs = iConfig.getParameter<string>("BranchAcceptedStubs");
const string& branchAcceptedTracks = iConfig.getParameter<string>("BranchAcceptedTracks");
Expand Down Expand Up @@ -180,13 +178,15 @@ namespace trackFindingTracklet {
// get rphi parameter
double inv2R = dfinv2R.digi(-ttTrackRef->rInv() / 2.);
// calculcate track phi at radius hybridChosenRofPhi with respect to phi sector centre
double phiT = dfphiT.digi(deltaPhi(ttTrackRef->phi() + dataFormats_->chosenRofPhi() * inv2R - ttTrackRef->phiSector() * setup_->baseRegion()));
const int sectorPhi = phiT < 0. ? 0 : 1; // dirty hack
double phiT = dfphiT.digi(deltaPhi(ttTrackRef->phi() + dataFormats_->chosenRofPhi() * inv2R -
ttTrackRef->phiSector() * setup_->baseRegion()));
const int sectorPhi = phiT < 0. ? 0 : 1; // dirty hack
phiT -= (sectorPhi - .5) * setup_->baseSector();
// cut on nonant size and pt
if (!dfphiT.inRange(phiT) || !dfinv2R.inRange(inv2R))
continue;
const double offsetPhi = (ttTrackRef->phiSector() * setup_->numSectorsPhi() + sectorPhi - .5) * setup_->baseSector();
const double offsetPhi =
(ttTrackRef->phiSector() * setup_->numSectorsPhi() + sectorPhi - .5) * setup_->baseSector();
// check hitPattern
TTBV hitPattern(0, setup_->numLayers());
static constexpr double scalePhi = 4.0;
Expand Down Expand Up @@ -279,6 +279,6 @@ namespace trackFindingTracklet {
iEvent.emplace(edPutTokenLostTracks_, move(streamLostTracks));
}

} // namespace trackFindingTracklet
} // namespace trackFindingTracklet

DEFINE_FWK_MODULE(trackFindingTracklet::ProducerKFin);
Loading