CondFormats
SiPixelObjects
src
SiPixelFrameConverter.cc
Go to the documentation of this file.
1
#include "
CondFormats/SiPixelObjects/interface/SiPixelFrameConverter.h
"
2
#include "
CondFormats/SiPixelObjects/interface/SiPixelFedCabling.h
"
3
4
#include "
CondFormats/SiPixelObjects/interface/PixelROC.h
"
5
#include "
CondFormats/SiPixelObjects/interface/CablingPathToDetUnit.h
"
6
7
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
8
9
#include <sstream>
10
11
using namespace
std
;
12
using namespace
sipixelobjects
;
13
14
SiPixelFrameConverter::SiPixelFrameConverter
(
const
SiPixelFedCabling
*
map
,
int
fedId
)
15
: theFedId(
fedId
),
16
theMap(
map
),
17
theTree(dynamic_cast<
SiPixelFedCablingTree
const
*>(
map
)),
18
theFed(theTree ? theTree->fed(
fedId
) : nullptr) {}
19
20
bool
SiPixelFrameConverter::hasDetUnit
(uint32_t rawId)
const
{
21
return
theMap
->
pathToDetUnitHasDetUnit
(rawId, static_cast<unsigned int>(
theFedId
));
22
}
23
24
PixelROC
const
*
SiPixelFrameConverter::toRoc
(
int
link
,
int
roc
)
const
{
25
CablingPathToDetUnit
path
= {
26
static_cast<unsigned int>(
theFedId
), static_cast<unsigned int>(
link
), static_cast<unsigned int>(
roc
)};
27
const
PixelROC
* rocp = (
theFed
) ?
theTree
->
findItemInFed
(
path
,
theFed
) :
theMap
->
findItem
(
path
);
28
if
29
UNLIKELY
(!rocp) {
30
stringstream stm;
31
stm <<
"Map shows no fed="
<<
theFedId
<<
", link="
<<
link
<<
", roc="
<<
roc
;
32
edm::LogWarning
(
"SiPixelFrameConverter"
) << stm.str();
33
}
34
return
rocp;
35
}
36
37
int
SiPixelFrameConverter::toCabling
(
ElectronicIndex
& cabling,
const
DetectorIndex
&
detector
)
const
{
38
std::vector<CablingPathToDetUnit>
path
=
theMap
->
pathToDetUnit
(
detector
.rawId);
39
typedef
std::vector<CablingPathToDetUnit>::const_iterator
IT
;
40
for
(
IT
it =
path
.begin(); it !=
path
.end(); ++it) {
41
const
PixelROC
*
roc
=
theMap
->
findItem
(*it);
42
if
(!
roc
)
43
return
2;
44
if
(
roc
->rawId() !=
detector
.rawId)
45
return
3;
46
47
GlobalPixel
global = {
detector
.row,
detector
.col};
48
//LogTrace("")<<"GLOBAL PIXEL: row=" << global.row <<" col="<< global.col;
49
50
LocalPixel
local
=
roc
->toLocal(global);
51
// LogTrace("")<<"LOCAL PIXEL: dcol ="
52
//<< local.dcol()<<" pxid="<< local.pxid()<<" inside: " <<local.valid();
53
54
if
(!
local
.valid())
55
continue
;
56
ElectronicIndex
cabIdx = {static_cast<int>(it->link), static_cast<int>(it->roc),
local
.dcol(),
local
.pxid()};
57
cabling = cabIdx;
58
return
0;
59
}
60
return
1;
61
}
MessageLogger.h
MainPageGenerator.link
link
Definition:
MainPageGenerator.py:271
SiPixelFedCabling::findItem
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
SiPixelFrameConverter::theFed
const PixelFEDCabling * theFed
Definition:
SiPixelFrameConverter.h:50
SiPixelFedCabling::pathToDetUnit
virtual std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const =0
SiPixelFedCabling
Definition:
SiPixelFedCabling.h:10
watchdog.const
const
Definition:
watchdog.py:83
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition:
LocalPixel.h:7
UNLIKELY
#define UNLIKELY(x)
Definition:
Likely.h:21
sipixelobjects::GlobalPixel
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition:
GlobalPixel.h:6
sipixelobjects
Definition:
CablingPathToDetUnit.h:4
sipixelobjects::CablingPathToDetUnit
Definition:
CablingPathToDetUnit.h:5
SiPixelFrameConverter::theMap
const SiPixelFedCabling * theMap
Definition:
SiPixelFrameConverter.h:48
SiPixelFrameConverter::toCabling
int toCabling(sipixelobjects::ElectronicIndex &cabling, const sipixelobjects::DetectorIndex &detector) const
Definition:
SiPixelFrameConverter.cc:37
SiPixelFedCabling.h
sipixelobjects::ElectronicIndex
Definition:
ElectronicIndex.h:5
edm::LogWarning
Definition:
MessageLogger.h:141
SiPixelFrameConverter.h
PixelROC.h
CablingPathToDetUnit.h
SiPixelFedCablingTree::findItemInFed
const sipixelobjects::PixelROC * findItemInFed(const sipixelobjects::CablingPathToDetUnit &path, const PixelFEDCabling *aFed) const
Definition:
SiPixelFedCablingTree.cc:141
SiPixelFrameConverter::theTree
SiPixelFedCablingTree const * theTree
Definition:
SiPixelFrameConverter.h:49
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition:
l1tstage2_dqm_sourceclient-live_cfg.py:88
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition:
TriggerBoardSpec.cc:5
sipixelobjects::PixelROC
Definition:
PixelROC.h:23
std
Definition:
JetResolutionObject.h:76
SiPixelFrameConverter::toRoc
sipixelobjects::PixelROC const * toRoc(int link, int roc) const
Definition:
SiPixelFrameConverter.cc:24
PixelMapPlotter.roc
roc
Definition:
PixelMapPlotter.py:498
SiPixelFrameConverter::SiPixelFrameConverter
SiPixelFrameConverter(const SiPixelFedCabling *map, int fedId)
Definition:
SiPixelFrameConverter.cc:14
SiPixelFedCabling::pathToDetUnitHasDetUnit
virtual bool pathToDetUnitHasDetUnit(uint32_t rawDetId, unsigned int fedId) const =0
hgcalTestNeighbor_cfi.detector
detector
Definition:
hgcalTestNeighbor_cfi.py:6
castor_dqm_sourceclient_file_cfg.path
path
Definition:
castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition:
DTRecHitClients_cfi.py:10
genParticles_cff.map
map
Definition:
genParticles_cff.py:11
SiPixelFrameConverter::theFedId
int theFedId
Definition:
SiPixelFrameConverter.h:47
SiPixelFedCablingTree
Definition:
SiPixelFedCablingTree.h:13
SiPixelFrameConverter::hasDetUnit
bool hasDetUnit(uint32_t radId) const
Definition:
SiPixelFrameConverter.cc:20
sipixelobjects::DetectorIndex
Definition:
DetectorIndex.h:6
Generated for CMSSW Reference Manual by
1.8.16