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/02/08 15:47:28 $
5  * $Revision: 1.1 $
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 
64  std::string
65  rosMap = "expand_";
66  rosMap += compMap.mapRobRos();
67  std::string
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  std::vector<DTReadOutGeometryLink>::const_iterator itdc = entryList.end();
95  while ( iter != iend ) {
96  const DTReadOutGeometryLink& rosEntry( *iter++ );
97  if ( rosEntry.dduId > 0x3fffffff ) continue;
98  ddu = rosEntry.dduId;
99  ros = rosEntry.rosId;
100  whe = rosEntry.wheelId;
101  def = rosEntry.stationId;
102  sec = rosEntry.sectorId;
103  rob = rosEntry.slId;
104  mt1 = rosEntry.layerId;
105  mi1 = rosEntry.cellId;
106  iros = entryList.begin();
107  while ( iros != iend ) {
108  wha = whe;
109  sea = sec;
110  const DTReadOutGeometryLink& rchEntry( *iros++ );
111  if ( ( rchEntry.dduId != mt1 ) ||
112  ( rchEntry.rosId != mi1 ) ) continue;
113  rch = rchEntry.robId;
114  if ( rchEntry.wheelId != def ) wha = rchEntry.wheelId;
115  sta = rchEntry.stationId;
116  if ( rchEntry.sectorId != def ) sea = rchEntry.sectorId;
117  rob = rchEntry.slId;
118  mt2 = rchEntry.layerId;
119  mi2 = rchEntry.cellId;
120  irob = entryList.begin();
121  while ( irob != iend ) {
122  const DTReadOutGeometryLink& robEntry( *irob++ );
123  if ( ( robEntry.dduId != mt2 ) ||
124  ( robEntry.rosId != mi2 ) ) continue;
125  if ( robEntry.robId != rob ) {
126  std::cout << "ROB mismatch " << rob << " "
127  << robEntry.robId << std::endl;
128  }
129  tdc = robEntry.tdcId;
130  tch = robEntry.channelId;
131  qua = robEntry.slId;
132  lay = robEntry.layerId;
133  cel = robEntry.cellId;
134  fullMap->insertReadOutGeometryLink( ddu, ros, rob, tdc, tch,
135  wha, sta, sea,
136  qua, lay, cel );
137 
138  }
139  }
140  }
141  return fullMap;
142 }
143 
144 
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:41
static DTCompactMapAbstractHandler * instance
JetCorrectorParameters::Definitions def
Definition: classes.h:10