File indexing completed on 2024-04-06 12:02:33
0001 #ifndef SiPixelObjects_PixelROC_H
0002 #define SiPixelObjects_PixelROC_H
0003
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005
0006 #include "CondFormats/SiPixelObjects/interface/FrameConversion.h"
0007 #include "CondFormats/SiPixelObjects/interface/LocalPixel.h"
0008 #include "CondFormats/SiPixelObjects/interface/GlobalPixel.h"
0009 #include <string>
0010 #include <cstdint>
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 namespace sipixelobjects {
0022
0023 class PixelROC {
0024 public:
0025
0026 PixelROC() : theDetUnit(0), theIdDU(0), theIdLk(0) {}
0027
0028
0029
0030
0031 PixelROC(uint32_t du, int idInDU, int idLk);
0032
0033
0034 uint32_t rawId() const { return theDetUnit; }
0035
0036
0037 unsigned int idInDetUnit() const { return theIdDU; }
0038
0039
0040 unsigned int idInLink() const { return theIdLk; }
0041
0042
0043
0044
0045 LocalPixel toLocal(const GlobalPixel& glo) const {
0046 int rocRow = theFrameConverter.row().inverse(glo.row);
0047 int rocCol = theFrameConverter.collumn().inverse(glo.col);
0048
0049 LocalPixel::RocRowCol rocRowCol = {rocRow, rocCol};
0050 return LocalPixel(rocRowCol);
0051 }
0052
0053
0054
0055 GlobalPixel toGlobal(const LocalPixel& loc) const {
0056 GlobalPixel result;
0057 result.col = theFrameConverter.collumn().convert(loc.rocCol());
0058 result.row = theFrameConverter.row().convert(loc.rocRow());
0059 return result;
0060 }
0061
0062
0063
0064
0065 int bpixSidePhase0(uint32_t rawId) const;
0066 int fpixSidePhase0(uint32_t rawId) const;
0067 int bpixSidePhase1(uint32_t rawId) const;
0068 int fpixSidePhase1(uint32_t rawId) const;
0069 static int bpixLayerPhase1(uint32_t rawId);
0070
0071
0072 std::string print(int depth = 0) const;
0073
0074 void initFrameConversion();
0075 void initFrameConversionPhase1();
0076
0077
0078 void initFrameConversionPhase1_CMSSW_9_0_X();
0079
0080 private:
0081 uint32_t theDetUnit;
0082 unsigned int theIdDU, theIdLk;
0083 FrameConversion theFrameConverter COND_TRANSIENT;
0084
0085 COND_SERIALIZABLE;
0086 };
0087
0088 }
0089
0090 #endif