35 SiStripFedCabling_TrackerMap() :
cond::payloadInspector::PlotImage<
SiStripFedCabling>(
"Tracker Map SiStrip Fed Cabling" ){
39 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
40 auto iov = iovs.front();
43 std::unique_ptr<TrackerMap> tmap = std::unique_ptr<TrackerMap>(
new TrackerMap(
"SiStripFedCabling"));
45 std::string titleMap =
"TrackerMap of SiStrip Fed Cabling per module, IOV : "+std::to_string(std::get<0>(iov));
46 tmap->setTitle(titleMap);
49 std::unique_ptr<SiStripDetCabling> detCabling_ =std::unique_ptr<SiStripDetCabling>(
new SiStripDetCabling(*(payload.get()),&tTopo));
51 std::vector<uint32_t> activeDetIds;
52 detCabling_->addActiveDetectorsRawIds(activeDetIds);
54 for(
const auto &detId : activeDetIds){
56 for(uint32_t connDet_i=0; connDet_i<detCabling_->getConnections(detId).size(); connDet_i++){
57 if(detCabling_->getConnections(detId)[connDet_i]!=
nullptr && detCabling_->getConnections(detId)[connDet_i]->isConnected()!=0) n_conn++;
60 tmap->fill(detId,n_conn*2);
76 SiStripFedCabling_Summary() :
cond::payloadInspector::PlotImage<
SiStripFedCabling>(
"SiStrip Fed Cabling Summary" ){
80 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
81 auto iov = iovs.front();
82 std::shared_ptr<SiStripFedCabling> payload = fetchPayload( std::get<1>(iov) );
83 int IOV = std::get<0>(iov);
84 std::vector<uint32_t> activeDetIds;
87 std::unique_ptr<SiStripDetCabling> detCabling_ =std::unique_ptr<SiStripDetCabling>(
new SiStripDetCabling(*(payload.get()),&tTopo));
89 detCabling_->addActiveDetectorsRawIds(activeDetIds);
97 for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++){
99 if( it->first==0 || it->first==0xFFFFFFFF ) {
100 edm::LogError(
"DetIdNotGood") <<
"@SUB=analyze" <<
"Wrong det id: " << it->first
101 <<
" ... neglecting!" << std::endl;
104 updateCounters(it->first,allCounts,tTopo);
107 for(
const auto &detId : activeDetIds){
108 updateCounters(detId,myCont,tTopo);
111 TH2D*
ME =
new TH2D(
"SummaryOfCabling",
"SummaryOfCabling",6,0.5,6.5,9,0.5,9.5);
112 ME->GetXaxis()->SetTitle(
"Sub Det");
113 ME->GetYaxis()->SetTitle(
"Layer");
117 ME->GetXaxis()->SetBinLabel(1,
"TIB");
118 ME->GetXaxis()->SetBinLabel(2,
"TID F");
119 ME->GetXaxis()->SetBinLabel(3,
"TID B");
120 ME->GetXaxis()->SetBinLabel(4,
"TOB");
121 ME->GetXaxis()->SetBinLabel(5,
"TEC F");
122 ME->GetXaxis()->SetBinLabel(6,
"TEC B");
124 for(
int i=0;
i<4;
i++){
125 ME->Fill(1,
i+1,
float(myCont.counterTIB[
i])/allCounts.counterTIB[
i]);
128 for(
int i=0;
i<2;
i++){
129 for(
int j=0;j<3;j++){
130 ME->Fill(
i+2,j+1,
float(myCont.counterTID[
i][j])/allCounts.counterTID[
i][j]);
134 for(
int i=0;
i<6;
i++){
135 ME->Fill(4,
i+1,
float(myCont.counterTOB[
i])/allCounts.counterTOB[
i]);
138 for(
int i=0;
i<2;
i++){
139 for(
int j=0;j<9;j++){
140 ME->Fill(
i+5,j+1,
float(myCont.counterTEC[
i][j])/allCounts.counterTEC[
i][j]);
144 TCanvas
c1(
"SiStrip FED cabling summary",
"SiStrip FED cabling summary",800,600);
145 c1.SetTopMargin(0.07);
146 c1.SetBottomMargin(0.10);
147 c1.SetLeftMargin(0.07);
148 c1.SetRightMargin(0.10);
151 ME->Draw(
"TEXTsame");
152 ME->SetStats(kFALSE);
157 t1.SetTextSize(0.05);
158 t1.DrawLatex(0.5, 0.96, Form(
"SiStrip FedCabling, IOV %i", IOV));
169 int counterTIB[4]={0};
170 int counterTID[2][3]={{0}};
171 int counterTOB[6]={0};
172 int counterTEC[2][9]={{0}};
175 void updateCounters(
int detId,containers &cont,
const TrackerTopology& tTopo){
179 switch (subdet.subdetId()) {
183 cont.counterTIB[
i]++;
189 int side = tTopo.
tidSide(detId);
191 cont.counterTID[0][j]++;
192 }
else if (side == 1) {
193 cont.counterTID[1][j]++;
200 cont.counterTOB[
i]++;
206 int side = tTopo.
tecSide(detId);
208 cont.counterTEC[0][j]++;
209 }
else if (side == 1) {
210 cont.counterTEC[1][j]++;
unsigned int tibLayer(const DetId &id) const
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
unsigned int tidWheel(const DetId &id) const
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
const std::map< uint32_t, DetInfo > & getAllData() const
unsigned int tidSide(const DetId &id) const
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
void setSingleIov(bool flag)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
std::string fullPath() const
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const