CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTCompactMapPluginHandler.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2011/06/27 17:38:56 $
5  * $Revision: 1.3 $
6  * \author Paolo Ronchese INFN Padova
7  *
8  */
9 
10 //-----------------------
11 // This Class' Header --
12 //-----------------------
14 
15 //-------------------------------
16 // Collaborating Class Headers --
17 //-------------------------------
19 
20 //---------------
21 // C++ Headers --
22 //---------------
23 #include <iostream>
24 
25 //-------------------
26 // Initializations --
27 //-------------------
28 
29 
30 //----------------
31 // Constructors --
32 //----------------
34 // std::cout << "===================================" << std::endl;
35 // std::cout << "= =" << std::endl;
36 // std::cout << "= new DTCompactMapPluginHandler =" << std::endl;
37 // std::cout << "= =" << std::endl;
38 // std::cout << "===================================" << std::endl;
39 // if ( instance == 0 ) instance = this;
40 }
41 
42 
43 //--------------
44 // Destructor --
45 //--------------
47 }
48 
49 
50 //--------------
51 // Operations --
52 //--------------
55 }
56 
57 
59  std::vector<DTReadOutGeometryLink> entryList;
60  DTReadOutMapping::const_iterator compIter = compMap.begin();
61  DTReadOutMapping::const_iterator compIend = compMap.end();
62  while ( compIter != compIend ) entryList.push_back( *compIter++ );
63 
65  rosMap = "expand_";
66  rosMap += compMap.mapRobRos();
68  tdcMap = "expand_";
69  tdcMap += compMap.mapCellTdc();
70  DTReadOutMapping* fullMap = new DTReadOutMapping( tdcMap, rosMap );
71  int ddu;
72  int ros;
73  int rch;
74  int tdc;
75  int tch;
76  int whe;
77  int sta;
78  int sec;
79  int rob;
80  int qua;
81  int lay;
82  int cel;
83  int mt1;
84  int mi1;
85  int mt2;
86  int mi2;
87  int def;
88  int wha;
89  int sea;
90  std::vector<DTReadOutGeometryLink>::const_iterator iter = entryList.begin();
91  std::vector<DTReadOutGeometryLink>::const_iterator iend = entryList.end();
92  std::vector<DTReadOutGeometryLink>::const_iterator iros = entryList.end();
93  std::vector<DTReadOutGeometryLink>::const_iterator irob = entryList.end();
94  while ( iter != iend ) {
95  const DTReadOutGeometryLink& rosEntry( *iter++ );
96  if ( rosEntry.dduId > 0x3fffffff ) continue;
97  ddu = rosEntry.dduId;
98  ros = rosEntry.rosId;
99  whe = rosEntry.wheelId;
100  def = rosEntry.stationId;
101  sec = rosEntry.sectorId;
102  rob = rosEntry.slId;
103  mt1 = rosEntry.layerId;
104  mi1 = rosEntry.cellId;
105  iros = entryList.begin();
106  while ( iros != iend ) {
107  wha = whe;
108  sea = sec;
109  const DTReadOutGeometryLink& rchEntry( *iros++ );
110  if ( ( rchEntry.dduId != mt1 ) ||
111  ( rchEntry.rosId != mi1 ) ) continue;
112  rch = rchEntry.robId;
113  if ( rchEntry.wheelId != def ) wha = rchEntry.wheelId;
114  sta = rchEntry.stationId;
115  if ( rchEntry.sectorId != def ) sea = rchEntry.sectorId;
116  rob = rchEntry.slId;
117  mt2 = rchEntry.layerId;
118  mi2 = rchEntry.cellId;
119  irob = entryList.begin();
120  while ( irob != iend ) {
121  const DTReadOutGeometryLink& robEntry( *irob++ );
122  if ( ( robEntry.dduId != mt2 ) ||
123  ( robEntry.rosId != mi2 ) ) continue;
124  if ( robEntry.robId != rob ) {
125  std::cout << "ROB mismatch " << rob << " "
126  << robEntry.robId << std::endl;
127  }
128  tdc = robEntry.tdcId;
129  tch = robEntry.channelId;
130  qua = robEntry.slId;
131  lay = robEntry.layerId;
132  cel = robEntry.cellId;
133  fullMap->insertReadOutGeometryLink( ddu, ros, rch, tdc, tch,
134  wha, sta, sea,
135  qua, lay, cel );
136 
137  }
138  }
139  }
140  return fullMap;
141 }
142 
143 
int def(FILE *, FILE *, int)
const_iterator end() const
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
const std::string & mapCellTdc() const
access parent maps identifiers
static void build()
build static object
const_iterator begin() const
int insertReadOutGeometryLink(int dduId, int rosId, int robId, int tdcId, int channelId, int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId)
insert connection
const std::string & mapRobRos() const
virtual DTReadOutMapping * expandMap(const DTReadOutMapping &compMap)
expand compact map
tuple cout
Definition: gather_cfg.py:121
static DTCompactMapAbstractHandler * instance