CMS 3D CMS Logo

Phase2OTtiltedBarrelLayer.cc
Go to the documentation of this file.
2 
4 
5 #include "DetGroupMerger.h"
7 
12 
13 using namespace std;
14 
16 
17 Phase2OTtiltedBarrelLayer::Phase2OTtiltedBarrelLayer(std::vector<const Phase2OTBarrelRod*>& innerRods,
18  std::vector<const Phase2OTBarrelRod*>& outerRods,
19  vector<const Phase2EndcapRing*>& negRings,
20  vector<const Phase2EndcapRing*>& posRings) :
21  Phase2OTBarrelLayer(innerRods,outerRods),
22  theNegativeRingsComps(negRings.begin(),negRings.end()),
23  thePositiveRingsComps(posRings.begin(),posRings.end())
24 {
25 
26  std::vector<const GeometricSearchDet*> theComps;
28  theComps.insert(theComps.end(),negRings.begin(),negRings.end());
29  theComps.insert(theComps.end(),posRings.begin(),posRings.end());
30 
31  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
32  it!=theComps.end();it++){
33  theBasicComps.insert(theBasicComps.end(),
34  (**it).basicComponents().begin(),
35  (**it).basicComponents().end());
36  }
37 
39  theCylinder = cylinder( theComps );
40 
41 #ifdef EDM_ML_DEBUG
42  //--------- DEBUG INFO --------------
43  LogDebug("TkDetLayers") << "==== DEBUG Phase2OTtiltedBarrelLayer =====" ;
44  LogTrace("TkDetLayers") << "Phase2OTtiltedBarrelLayer Cyl r,lenght: "
45  << theCylinder->radius() << " , "
46  << theCylinder->bounds().length();
47 
48  for (vector<const GeometricSearchDet*>::const_iterator i=theNegativeRingsComps.begin();
49  i != theNegativeRingsComps.end(); i++){
50  LogTrace("TkDetLayers") << "negative rings in Phase2OT tilted barrel pos z,perp,eta,phi: "
51  << (**i).position().z() << " , "
52  << (**i).position().perp() << " , "
53  << (**i).position().eta() << " , "
54  << (**i).position().phi() ;
55  }
56 
57  for (vector<const GeometricSearchDet*>::const_iterator i=Phase2OTBarrelLayer::components().begin();
58  i != Phase2OTBarrelLayer::components().end(); i++){
59  LogTrace("TkDetLayers") << "rods in Phase2OT tilted barrel pos z,perp,eta,phi: "
60  << (**i).position().z() << " , "
61  << (**i).position().perp() << " , "
62  << (**i).position().eta() << " , "
63  << (**i).position().phi() ;
64  }
65 
66  for (vector<const GeometricSearchDet*>::const_iterator i=thePositiveRingsComps.begin();
67  i != thePositiveRingsComps.end(); i++){
68  LogTrace("TkDetLayers") << "positive rings in Phase2OT tilted barrel pos z,perp,eta,phi: "
69  << (**i).position().z() << " , "
70  << (**i).position().perp() << " , "
71  << (**i).position().eta() << " , "
72  << (**i).position().phi() ;
73  }
74  LogTrace("TkDetLayers") << "==== end DEBUG Phase2OTtiltedBarrelLayer =====" ;
75  //-----------------------------------
76 #endif
77 }
78 
80 
81  vector<const GeometricSearchDet*>::const_iterator i;
82  for (i=theNegativeRingsComps.begin(); i!=theNegativeRingsComps.end(); i++) {
83  delete *i;
84  }
85  for (i=thePositiveRingsComps.begin(); i!=thePositiveRingsComps.end(); i++) {
86  delete *i;
87  }
88 
89 }
90 
91 void
93  const Propagator& prop,
94  const MeasurementEstimator& est,
95  std::vector<DetGroup> & result) const {
96  vector<DetGroup> closestResultRods;
97  vector<DetGroup> closestResultNeg;
98  vector<DetGroup> closestResultPos;
99  Phase2OTBarrelLayer::groupedCompatibleDetsV(tsos, prop, est, closestResultRods);
100  for(auto ring : theNegativeRingsComps){
101  ring->groupedCompatibleDetsV(tsos, prop, est, closestResultNeg);
102  }
103  for(auto ring : thePositiveRingsComps){
104  ring->groupedCompatibleDetsV(tsos, prop, est, closestResultPos);
105  }
106 
107  result.assign(closestResultRods.begin(),closestResultRods.end());
108  result.insert(result.end(),closestResultPos.begin(),closestResultPos.end());
109  result.insert(result.end(),closestResultNeg.begin(),closestResultNeg.end());
110 
111 #ifdef EDM_ML_DEBUG
112  LogDebug("TkDetLayers") << "==== output di Phase2OTtiltedBarrelLayer =====" ;
113  if(closestResultRods.size() != 0){
114  for (auto gr : closestResultRods) {
115  LogTrace("TkDetLayers") << "New Rod group:";
116  for (auto dge : gr) {
117  LogTrace("TkDetLayers") << "new det with geom det at r:"<<dge.det()->position().perp()<<" id:"<<dge.det()->geographicalId().rawId()<<" tsos at:" <<dge.trajectoryState().globalPosition();
118  }
119  }
120  }
121  if(closestResultNeg.size() != 0){
122  for (auto gr : closestResultNeg) {
123  LogTrace("TkDetLayers") << "New negative group:";
124  for (auto dge : gr) {
125  LogTrace("TkDetLayers") << "new det with geom det at r:"<<dge.det()->position().perp()<<" id:"<<dge.det()->geographicalId().rawId()<<" tsos at:" <<dge.trajectoryState().globalPosition();
126  }
127  }
128  }
129  if(closestResultPos.size() != 0){
130  for (auto gr : closestResultPos) {
131  LogTrace("TkDetLayers") << "New positive group:";
132  for (auto dge : gr) {
133  LogTrace("TkDetLayers") << "new det with geom det at r:"<<dge.det()->position().perp()<<" id:"<<dge.det()->geographicalId().rawId()<<" tsos at:" <<dge.trajectoryState().globalPosition();
134  }
135  }
136  }
137 
138  if(result.size() != 0){
139  for (auto gr : result) {
140  LogTrace("TkDetLayers") << "Total group:";
141  for (auto dge : gr) {
142  LogTrace("TkDetLayers") << "new det with geom det at r:"<<dge.det()->position().perp()<<" id:"<<dge.det()->geographicalId().rawId()<<" tsos at:" <<dge.trajectoryState().globalPosition();
143  }
144  }
145  } else {
146  LogTrace("TkDetLayers") << "result size is zero";
147  }
148 #endif
149 
150 }
#define LogDebug(id)
std::vector< const GeometricSearchDet * > thePositiveRingsComps
virtual void initialize()
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet * > &rods) const __attribute__((cold))
Definition: TBPLayer.cc:87
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:83
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
Definition: TBLayer.cc:18
std::vector< const GeometricSearchDet * > theNegativeRingsComps
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const final
Phase2OTtiltedBarrelLayer(std::vector< const Phase2OTBarrelRod * > &innerRods, std::vector< const Phase2OTBarrelRod * > &outerRods, std::vector< const Phase2EndcapRing * > &negRings, std::vector< const Phase2EndcapRing * > &posRings)
#define end
Definition: vmac.h:37
#define LogTrace(id)
ReferenceCountingPointer< BoundCylinder > theCylinder
virtual const std::vector< const GeometricSearchDet * > & components() const final __attribute__((cold))
Returns basic components, if any.
Definition: TBLayer.h:30
#define begin
Definition: vmac.h:30
GeometricSearchDet::DetWithState DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
std::vector< const GeomDet * > theBasicComps
Definition: TBLayer.h:86