CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KalmanAlignmentSetup.cc
Go to the documentation of this file.
1 
3 
6 
7 #include <algorithm>
8 #include <iostream>
9 
11  const TrajectoryFitter* fitter,
12  const Propagator* propagator,
13  const std::vector< SubDetId >& trackingIds,
14  const unsigned int minTrackingHits,
15  const SortingDirection sortingDir,
16  const TrajectoryFitter* externalFitter,
17  const Propagator* externalPropagator,
18  const std::vector< SubDetId >& externalIds,
19  const unsigned int minExternalHits,
20  const SortingDirection externalSortingDir,
21  TrajectoryFactoryBase* trajectoryFactory,
22  KalmanAlignmentUpdator* alignmentUpdator,
23  KalmanAlignmentMetricsUpdator* metricsUpdator ) :
24  theId( id ),
25  theFitter( fitter->clone() ),
26  thePropagator( propagator->clone() ),
27  theTrackingSubDetIds( trackingIds ),
28  theMinTrackingHits( minTrackingHits ),
29  theSortingDir( sortingDir ),
30  theExternalFitter( externalFitter->clone() ),
31  theExternalPropagator( externalPropagator->clone() ),
32  theExternalTrackingSubDetIds( externalIds ),
33  theMinExternalHits( minExternalHits ),
34  theExternalSortingDir( externalSortingDir ),
35  theTrajectoryFactory( trajectoryFactory ),
36  theAlignmentUpdator( alignmentUpdator ),
37  theMetricsUpdator( metricsUpdator )
38 {}
39 
40 
42  theId( setup.id() ),
43  theFitter( setup.fitter()->clone() ),
44  thePropagator( setup.propagator()->clone() ),
45  theTrackingSubDetIds( setup.getTrackingSubDetIds() ),
46  theMinTrackingHits( setup.minTrackingHits() ),
47  theSortingDir( setup.sortingDirection() ),
48  theExternalFitter( setup.externalFitter()->clone() ),
49  theExternalPropagator( setup.externalPropagator()->clone() ),
50  theExternalTrackingSubDetIds( setup.getExternalTrackingSubDetIds() ),
51  theMinExternalHits( setup.minExternalHits() ),
52  theExternalSortingDir( setup.externalSortingDirection() ),
53  theTrajectoryFactory( setup.trajectoryFactory() ),
54  theAlignmentUpdator( setup.alignmentUpdator() ),
55  theMetricsUpdator( setup.metricsUpdator() )
56 {}
57 
58 
60 {
61  if ( theFitter ) delete theFitter;
63 
64  if ( thePropagator ) delete thePropagator;
66 }
67 
68 
70 {
71  const DetId detId( recHit->det()->geographicalId() );
72  const SubDetId subdetId( detId.subdetId() );
73 
74 // const GlobalPoint position( recHit->det()->position() );
75 // if ( ( position.phi() < 0.785 ) || ( position.phi() > 2.356 ) ) return false;
76 
77  std::vector< SubDetId >::const_iterator itFindSubDetId =
78  std::find( theTrackingSubDetIds.begin(), theTrackingSubDetIds.end(), subdetId );
79 
80 // bool doubleSided = false;
81 // if ( subdetId == 3 )
82 // {
83 // TIBDetId tibid( detId.rawId() );
84 // if ( tibid.layer() < 3 ) doubleSided = true;
85 // }
86 // else if ( subdetId == 5 )
87 // {
88 // TOBDetId tobid( detId.rawId() );
89 // if ( tobid.layer() < 3 ) doubleSided = true;
90 // }
91 
92  return ( itFindSubDetId != theTrackingSubDetIds.end() );// && doubleSided;
93 
94 }
95 
96 
98 {
99 
100  const DetId detId( recHit->det()->geographicalId() );
101  const SubDetId subdetId( detId.subdetId() );
102 
103 // const GlobalPoint position( recHit->det()->position() );
104 // if ( ( position.phi() < 0.785 ) || ( position.phi() > 2.356 ) ) return false;
105 
106  std::vector< SubDetId >::const_iterator itFindSubDetId =
108 
109 // bool doubleSided = false;
110 // if ( subdetId == 3 )
111 // {
112 // TIBDetId tibid( detId.rawId() );
113 // if ( tibid.layer() < 3 ) doubleSided = true;
114 // }
115 // else if ( subdetId == 5 )
116 // {
117 // TOBDetId tobid( detId.rawId() );
118 // if ( tobid.layer() < 3 ) doubleSided = true;
119 // }
120 
121  return ( itFindSubDetId != theExternalTrackingSubDetIds.end() );// && !doubleSided;
122 }
KalmanAlignmentSetup(const std::string &id, const TrajectoryFitter *fitter, const Propagator *propagator, const std::vector< SubDetId > &trackingIds, const unsigned int minTrackingHits, const SortingDirection sortingDir, const TrajectoryFitter *externalFitter, const Propagator *externalPropagator, const std::vector< SubDetId > &externalIds, const unsigned int minExternalHits, const SortingDirection externalSortingDir, TrajectoryFactoryBase *trajectoryFactory, KalmanAlignmentUpdator *alignmentUpdator, KalmanAlignmentMetricsUpdator *metricsUpdator)
Propagator * theExternalPropagator
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool useForExternalTracking(const ConstRecHitPointer &recHit) const
std::vector< SubDetId > theExternalTrackingSubDetIds
Definition: DetId.h:20
T * clone(const T *tp)
Definition: Ptr.h:42
TrajectoryFitter * theFitter
TrajectoryFitter * theExternalFitter
bool useForTracking(const ConstRecHitPointer &recHit) const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
std::vector< SubDetId > theTrackingSubDetIds