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