Skip to content
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
64 changes: 33 additions & 31 deletions DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,39 @@

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

class Phase2TrackerCluster1D {
public:
Phase2TrackerCluster1D() : data_(0) {}
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size)
: firstDigi_(row, col), data_((size & 0x7fff)) {}
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold)
: firstDigi_(row, col), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {}
Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size)
: firstDigi_(firstDigi), data_((size & 0x7fff)) {}
Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size, unsigned int threshold)
: firstDigi_(firstDigi), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {}

const Phase2TrackerDigi& firstDigi() const { return firstDigi_; }
unsigned int firstStrip() const { return firstDigi_.strip(); }
unsigned int firstRow() const { return firstDigi_.row(); }
unsigned int edge() const { return firstDigi_.edge(); }
unsigned int column() const { return firstDigi_.column(); }
uint16_t size() const { return (data_ & 0x7fff); }
uint16_t threshold() const { return ((data_ >> 15) & 0x1); }
float center() const { return float(firstStrip()) + 0.5f * size(); }
std::pair<float, float> barycenter() const { return std::make_pair(column(), center()); }

private:
Phase2TrackerDigi firstDigi_;
uint16_t data_;
};

inline bool operator<(const Phase2TrackerCluster1D& one, const Phase2TrackerCluster1D& other) {
return one.firstStrip() < other.firstStrip();
}

namespace io_v1 {
class Phase2TrackerCluster1D {
public:
Phase2TrackerCluster1D() : data_(0) {}
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size)
: firstDigi_(row, col), data_((size & 0x7fff)) {}
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold)
: firstDigi_(row, col), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {}
Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size)
: firstDigi_(firstDigi), data_((size & 0x7fff)) {}
Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size, unsigned int threshold)
: firstDigi_(firstDigi), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {}

const Phase2TrackerDigi& firstDigi() const { return firstDigi_; }
unsigned int firstStrip() const { return firstDigi_.strip(); }
unsigned int firstRow() const { return firstDigi_.row(); }
unsigned int edge() const { return firstDigi_.edge(); }
unsigned int column() const { return firstDigi_.column(); }
uint16_t size() const { return (data_ & 0x7fff); }
uint16_t threshold() const { return ((data_ >> 15) & 0x1); }
float center() const { return float(firstStrip()) + 0.5f * size(); }
std::pair<float, float> barycenter() const { return std::make_pair(column(), center()); }

private:
Phase2TrackerDigi firstDigi_;
uint16_t data_;
};

inline bool operator<(const Phase2TrackerCluster1D& one, const Phase2TrackerCluster1D& other) {
return one.firstStrip() < other.firstStrip();
}
} // namespace io_v1
using Phase2TrackerCluster1D = io_v1::Phase2TrackerCluster1D;
typedef edmNew::DetSetVector<Phase2TrackerCluster1D> Phase2TrackerCluster1DCollectionNew;

#endif
28 changes: 14 additions & 14 deletions DataFormats/Phase2TrackerCluster/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<lcgdict>
<class name="Phase2TrackerCluster1D" ClassVersion="3">
<version ClassVersion="3" checksum="612125678"/>
<class name="io_v1::Phase2TrackerCluster1D" ClassVersion="3">
<version ClassVersion="3" checksum="221774958"/>
</class>
<class name="std::vector< Phase2TrackerCluster1D >"/>
<class name="std::vector< edmNew::DetSet< Phase2TrackerCluster1D > >"/>
<class name="edmNew::DetSet< Phase2TrackerCluster1D >"/>
<class name="edmNew::DetSetVector< Phase2TrackerCluster1D >"/>
<class name="edm::Ref< edmNew::DetSetVector< Phase2TrackerCluster1D >, Phase2TrackerCluster1D >"/>
<class name="edm::Wrapper< edmNew::DetSet< Phase2TrackerCluster1D > >" splitLevel="0"/>
<class name="edm::Wrapper< std::vector< edmNew::DetSet< Phase2TrackerCluster1D > > >" splitLevel="0"/>
<class name="edm::Wrapper< edmNew::DetSetVector< Phase2TrackerCluster1D > >"/>
<class name="edm::Wrapper< edm::Ref< edmNew::DetSetVector< Phase2TrackerCluster1D >, Phase2TrackerCluster1D > >"/>
<class name="edm::ContainerMask<edmNew::DetSetVector<Phase2TrackerCluster1D> >"/>
<class name="edm::RefProd<edmNew::DetSetVector<Phase2TrackerCluster1D> >" />
<class name="edm::Wrapper<edm::ContainerMask<edmNew::DetSetVector<Phase2TrackerCluster1D> > >"/>
<class name="std::vector< io_v1::Phase2TrackerCluster1D >"/>
<class name="std::vector< edmNew::DetSet< io_v1::Phase2TrackerCluster1D > >"/>
<class name="edmNew::DetSet< io_v1::Phase2TrackerCluster1D >"/>
<class name="edmNew::DetSetVector< io_v1::Phase2TrackerCluster1D >"/>
<class name="edm::Ref< edmNew::DetSetVector< io_v1::Phase2TrackerCluster1D >, io_v1::Phase2TrackerCluster1D >"/>
<class name="edm::Wrapper< edmNew::DetSet< io_v1::Phase2TrackerCluster1D > >" splitLevel="0"/>
<class name="edm::Wrapper< std::vector< edmNew::DetSet< io_v1::Phase2TrackerCluster1D > > >" splitLevel="0"/>
<class name="edm::Wrapper< edmNew::DetSetVector< io_v1::Phase2TrackerCluster1D > >"/>
<class name="edm::Wrapper< edm::Ref< edmNew::DetSetVector< io_v1::Phase2TrackerCluster1D >, io_v1::Phase2TrackerCluster1D > >"/>
<class name="edm::ContainerMask<edmNew::DetSetVector<io_v1::Phase2TrackerCluster1D> >"/>
<class name="edm::RefProd<edmNew::DetSetVector<io_v1::Phase2TrackerCluster1D> >" />
<class name="edm::Wrapper<edm::ContainerMask<edmNew::DetSetVector<io_v1::Phase2TrackerCluster1D> > >"/>
</lcgdict>
2 changes: 1 addition & 1 deletion DataFormats/TrackerRecHit2D/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<class name="edm::Wrapper<edmNew::DetSetVector<SiPixelRecHit> >"/>

<class name="reco::ClusterRemovalInfo" ClassVersion="3">
<version ClassVersion="3" checksum="2739546420"/>
<version ClassVersion="3" checksum="2001758756"/>
</class>
<class name="reco::ClusterRemovalInfo::SiPixelClusterRefProd" />
<class name="reco::ClusterRemovalInfo::SiStripClusterRefProd" />
Expand Down