-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7305 from thomaslenzi/phase2clusters-dataformat
Create Data Format for Phase2TrackerCluster1D
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<use name="DataFormats/Common"/> | ||
<use name="rootrflx"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
43 changes: 43 additions & 0 deletions
43
DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef DATAFORMATS_PHASE2TRACKERCLUSTER_PHASE2TRACKERCLUSTER1D_H | ||
#define DATAFORMATS_PHASE2TRACKERCLUSTER_PHASE2TRACKERCLUSTER1D_H | ||
|
||
#include <stdint.h> | ||
|
||
#include "DataFormats/Common/interface/DetSetVectorNew.h" | ||
|
||
#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 firstStrip() + (data_ & 0x7fff) / 2.; } | ||
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(); | ||
} | ||
|
||
typedef edmNew::DetSetVector< Phase2TrackerCluster1D > Phase2TrackerCluster1DCollectionNew; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef DATAFORMATS_PHASE2TRACKERCLUSTER_CLASSES_H | ||
#define DATAFORMATS_PHASE2TRACKERCLUSTER_CLASSES_H | ||
|
||
#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" | ||
#include "DataFormats/Common/interface/Wrapper.h" | ||
#include "DataFormats/Common/interface/DetSetNew.h" | ||
|
||
namespace { | ||
struct dictionary { | ||
edm::Wrapper< Phase2TrackerCluster1D > cl0; | ||
edm::Wrapper< std::vector< Phase2TrackerCluster1D > > cl1; | ||
edm::Wrapper< edmNew::DetSet< Phase2TrackerCluster1D > > cl2; | ||
edm::Wrapper< std::vector< edmNew::DetSet< Phase2TrackerCluster1D > > > cl3; | ||
edm::Wrapper< Phase2TrackerCluster1DCollectionNew > cl4; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<lcgdict> | ||
<class name="Phase2TrackerCluster1D" ClassVersion="10"> | ||
<version ClassVersion="10" checksum="1003486686"/> | ||
</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::Wrapper< edmNew::DetSet< Phase2TrackerCluster1D > >" splitLevel="0"/> | ||
<class name="edm::Wrapper< std::vector< edmNew::DetSet< Phase2TrackerCluster1D > > >" splitLevel="0"/> | ||
<class name="edm::Wrapper< edmNew::DetSetVector< Phase2TrackerCluster1D > >"/> | ||
</lcgdict> |