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
include pilot blade stuff to pixel rawdigi, 2nd attempt #5961
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,22 +28,26 @@ namespace { | |
constexpr int DCOL_bits = 5; | ||
constexpr int PXID_bits = 8; | ||
constexpr int ADC_bits = 8; | ||
|
||
constexpr int ADC_shift = 0; | ||
constexpr int PXID_shift = ADC_shift + ADC_bits; | ||
constexpr int DCOL_shift = PXID_shift + PXID_bits; | ||
constexpr int ROC_shift = DCOL_shift + DCOL_bits; | ||
constexpr int LINK_shift = ROC_shift + ROC_bits; | ||
|
||
constexpr PixelDataFormatter::Word32 LINK_mask = ~(~PixelDataFormatter::Word32(0) << LINK_bits); | ||
constexpr PixelDataFormatter::Word32 ROC_mask = ~(~PixelDataFormatter::Word32(0) << ROC_bits); | ||
constexpr PixelDataFormatter::Word32 DCOL_mask = ~(~PixelDataFormatter::Word32(0) << DCOL_bits); | ||
constexpr PixelDataFormatter::Word32 PXID_mask = ~(~PixelDataFormatter::Word32(0) << PXID_bits); | ||
constexpr PixelDataFormatter::Word32 ADC_mask = ~(~PixelDataFormatter::Word32(0) << ADC_bits); | ||
|
||
// For phase1 | ||
constexpr int LINK_bits1 = 7; | ||
constexpr int ROC_bits1 = 4; | ||
|
||
// Moved to the header file, keep commented out unti the final version is done/ | ||
// constexpr int ADC_shift = 0; | ||
// constexpr int PXID_shift = ADC_shift + ADC_bits; | ||
// constexpr int DCOL_shift = PXID_shift + PXID_bits; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove this commented out code There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please do not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, fair enough |
||
// constexpr int ROC_shift = DCOL_shift + DCOL_bits; | ||
// constexpr int LINK_shift = ROC_shift + ROC_bits; | ||
// constexpr PixelDataFormatter::Word32 LINK_mask = ~(~PixelDataFormatter::Word32(0) << LINK_bits); | ||
// constexpr PixelDataFormatter::Word32 ROC_mask = ~(~PixelDataFormatter::Word32(0) << ROC_bits); | ||
// constexpr PixelDataFormatter::Word32 DCOL_mask = ~(~PixelDataFormatter::Word32(0) << DCOL_bits); | ||
// constexpr PixelDataFormatter::Word32 PXID_mask = ~(~PixelDataFormatter::Word32(0) << PXID_bits); | ||
// constexpr PixelDataFormatter::Word32 ADC_mask = ~(~PixelDataFormatter::Word32(0) << ADC_bits); | ||
|
||
} | ||
|
||
PixelDataFormatter::PixelDataFormatter( const SiPixelFedCabling* map) | ||
PixelDataFormatter::PixelDataFormatter( const SiPixelFedCabling* map, bool phase1) | ||
: theDigiCounter(0), theWordCounter(0), theCablingTree(map), badPixelInfo(0), modulesToUnpack(0) | ||
{ | ||
int s32 = sizeof(Word32); | ||
|
@@ -61,6 +65,29 @@ PixelDataFormatter::PixelDataFormatter( const SiPixelFedCabling* map) | |
useQualityInfo = false; | ||
allDetDigis = 0; | ||
hasDetDigis = 0; | ||
|
||
ADC_shift = 0; | ||
PXID_shift = ADC_shift + ADC_bits; | ||
DCOL_shift = PXID_shift + PXID_bits; | ||
ROC_shift = DCOL_shift + DCOL_bits; | ||
|
||
if(phase1) { // for phase 1 | ||
LINK_shift = ROC_shift + ROC_bits1; | ||
LINK_mask = ~(~PixelDataFormatter::Word32(0) << LINK_bits1); | ||
ROC_mask = ~(~PixelDataFormatter::Word32(0) << ROC_bits1); | ||
maxROCIndex=8; | ||
} else { // for phase 0 | ||
LINK_shift = ROC_shift + ROC_bits; | ||
LINK_mask = ~(~PixelDataFormatter::Word32(0) << LINK_bits); | ||
ROC_mask = ~(~PixelDataFormatter::Word32(0) << ROC_bits); | ||
maxROCIndex=25; | ||
} | ||
|
||
|
||
DCOL_mask = ~(~PixelDataFormatter::Word32(0) << DCOL_bits); | ||
PXID_mask = ~(~PixelDataFormatter::Word32(0) << PXID_bits); | ||
ADC_mask = ~(~PixelDataFormatter::Word32(0) << ADC_bits); | ||
|
||
} | ||
|
||
void PixelDataFormatter::setErrorStatus(bool ErrorStatus) | ||
|
@@ -142,7 +169,7 @@ void PixelDataFormatter::interpretRawData(bool& errorsInEvent, int fedId, const | |
|
||
if ( (nlink!=link) | (nroc!=roc) ) { // new roc | ||
link = nlink; roc=nroc; | ||
skipROC = likely(roc<25) ? false : !errorcheck.checkROC(errorsInEvent, fedId, &converter, ww, errors); | ||
skipROC = likely(roc<maxROCIndex) ? false : !errorcheck.checkROC(errorsInEvent, fedId, &converter, ww, errors); | ||
if (skipROC) continue; | ||
rocp = converter.toRoc(link,roc); | ||
if unlikely(!rocp) { | ||
|
@@ -188,21 +215,23 @@ void PixelDataFormatter::interpretRawData(bool& errorsInEvent, int fedId, const | |
|
||
} | ||
|
||
void doVectorize(int const * __restrict__ w, int * __restrict__ row, int * __restrict__ col, int * __restrict__ valid, int N, PixelROC const * rocp) { | ||
for (int i=0; i<N; ++i) { | ||
auto ww = w[i]; | ||
int dcol = (ww >> DCOL_shift) & DCOL_mask; | ||
int pxid = (ww >> PXID_shift) & PXID_mask; | ||
// int adc = (ww >> ADC_shift) & ADC_mask; | ||
// I do not know what this was for or if it is needed? d.k. 10.14 | ||
// Keep it commented out until we are sure that it is not needed. | ||
// void doVectorize(int const * __restrict__ w, int * __restrict__ row, int * __restrict__ col, int * __restrict__ valid, int N, PixelROC const * rocp) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove the commented out code, please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leave this code where it is! |
||
// for (int i=0; i<N; ++i) { | ||
// auto ww = w[i]; | ||
// int dcol = (ww >> DCOL_shift) & DCOL_mask; | ||
// int pxid = (ww >> PXID_shift) & PXID_mask; | ||
// // int adc = (ww >> ADC_shift) & ADC_mask; | ||
|
||
LocalPixel::DcolPxid local = { dcol, pxid }; | ||
valid[i] = local.valid(); | ||
GlobalPixel global = rocp->toGlobal( LocalPixel(local) ); | ||
row[i]=global.row; col[i]=global.col; | ||
// LocalPixel::DcolPxid local = { dcol, pxid }; | ||
// valid[i] = local.valid(); | ||
// GlobalPixel global = rocp->toGlobal( LocalPixel(local) ); | ||
// row[i]=global.row; col[i]=global.col; | ||
|
||
} | ||
// } | ||
|
||
} | ||
// } | ||
|
||
|
||
void PixelDataFormatter::formatRawData(unsigned int lvl1_ID, RawData & fedRawData, const Digis & digis) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMS style is to have all class members to start from a lower case;
upper case is reserved for type names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALL Tracker code in EventFilter use this type of notation. It is historical. Make no sense to change it 20 year after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's OK for constants (and they were for 20 years and we are changing them)
They are not constants anymore here.
I would not insist though.