test
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 
4 //#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
5 //#include "Geometry/Records/interface/IdealGeometryRecord.h"
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.theId ),
43  theFitter( setup.theFitter->clone() ),
44  thePropagator( setup.thePropagator->clone() ),
45  theTrackingSubDetIds( setup.getTrackingSubDetIds() ),
46  theMinTrackingHits( setup.theMinTrackingHits ),
47  theSortingDir( setup.theSortingDir ),
48  theExternalFitter( setup.theExternalFitter->clone() ),
49  theExternalPropagator( setup.theExternalPropagator->clone() ),
50  theExternalTrackingSubDetIds( setup.getExternalTrackingSubDetIds() ),
51  theMinExternalHits( setup.theMinExternalHits ),
52  theExternalSortingDir( setup.theExternalSortingDir ),
53  theTrajectoryFactory( setup.theTrajectoryFactory ),
54  theAlignmentUpdator( setup.theAlignmentUpdator ),
55  theMetricsUpdator( setup.theMetricsUpdator )
56 {}
57 
58 
60 {
61  if ( thePropagator ) delete thePropagator;
63 }
64 
65 
67 {
68  const DetId detId( recHit->det()->geographicalId() );
69  const SubDetId subdetId( detId.subdetId() );
70 
71  // const GlobalPoint position( recHit->det()->position() );
72  // if ( ( position.phi() < 0.785 ) || ( position.phi() > 2.356 ) ) return false;
73 
74  std::vector< SubDetId >::const_iterator itFindSubDetId =
75  std::find( theTrackingSubDetIds.begin(), theTrackingSubDetIds.end(), subdetId );
76 
77  // bool doubleSided = false;
78  // if ( subdetId == 3 )
79  // {
80  //
81  // if ( tTopo->tibLayer( detId.rawId) < 3 ) doubleSided = true;
82  // }
83  // else if ( subdetId == 5 )
84  // {
85  //
86  // if ( tTopo->tobLayer( detId.rawId) < 3 ) doubleSided = true;
87  // }
88 
89  return ( itFindSubDetId != theTrackingSubDetIds.end() );// && doubleSided;
90 
91 }
92 
93 
95 {
96 
97  const DetId detId( recHit->det()->geographicalId() );
98  const SubDetId subdetId( detId.subdetId() );
99 
100  // const GlobalPoint position( recHit->det()->position() );
101  // if ( ( position.phi() < 0.785 ) || ( position.phi() > 2.356 ) ) return false;
102 
103  std::vector< SubDetId >::const_iterator itFindSubDetId =
105 
106  // bool doubleSided = false;
107  // if ( subdetId == 3 )
108  // {
109  //
110  // if ( tTopo->tibLayer( detId.rawId) < 3 ) doubleSided = true;
111  // }
112  // else if ( subdetId == 5 )
113  // {
114  //
115  // if ( tTopo->tobLayer( detId.rawId) < 3 ) doubleSided = true;
116  // }
117 
118  return ( itFindSubDetId != theExternalTrackingSubDetIds.end() );// && !doubleSided;
119 }
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:18
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
bool useForTracking(const ConstRecHitPointer &recHit) const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
std::vector< SubDetId > theTrackingSubDetIds