ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/IPHCalignment2/RecoTracker/TransientTrackingRecHit/src/TSiPixelRecHit.cc
Revision: 1.1
Committed: Fri Nov 25 17:05:36 2011 UTC (13 years, 5 months ago) by econte
Content type: text/plain
Branch: MAIN
CVS Tags: TBD2011, TBD_2011, HEAD
Log Message:
new IPHC alignment

File Contents

# User Rev Content
1 econte 1.1 #include "RecoTracker/TransientTrackingRecHit/interface/TSiPixelRecHit.h"
2     #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
3     #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h"
4     #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
5     #include<typeinfo>
6    
7     TSiPixelRecHit::RecHitPointer TSiPixelRecHit::clone (const TrajectoryStateOnSurface& ts) const
8     {
9     if (theCPE == 0){
10     return new TSiPixelRecHit( det(), &theHitData, 0, weight(), getAnnealingFactor(),false);
11     }else{
12     const SiPixelCluster& clust = *specificHit()->cluster();
13     PixelClusterParameterEstimator::LocalValues lv =
14     theCPE->localParameters( clust, *detUnit(), ts);
15     return TSiPixelRecHit::build( lv.first, lv.second, det(), specificHit()->cluster(), theCPE, weight(), getAnnealingFactor());
16     }
17     }
18    
19     const GeomDetUnit* TSiPixelRecHit::detUnit() const
20     {
21     return static_cast<const GeomDetUnit*>(det());
22     }
23    
24    
25    
26     // This private constructor copies the TrackingRecHit. It should be used when the
27     // TrackingRecHit exist already in some collection.
28     TSiPixelRecHit::TSiPixelRecHit(const GeomDet * geom, const SiPixelRecHit* rh,
29     const PixelClusterParameterEstimator* cpe,
30     float weight, float annealing,
31     bool computeCoarseLocalPosition) :
32     TransientTrackingRecHit(geom, *rh, weight, annealing), theHitData(*rh), theCPE(cpe)
33     {
34     if (! (rh->hasPositionAndError() || !computeCoarseLocalPosition)) {
35     const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(geom);
36     if (gdu){
37     PixelClusterParameterEstimator::LocalValues lval= theCPE->localParameters(*rh->cluster(), *gdu);
38     LogDebug("TSiPixelRecHit")<<"calculating coarse position/error.";
39     theHitData = SiPixelRecHit(lval.first, lval.second,geom->geographicalId(),rh->cluster());
40     }else{
41     edm::LogError("TSiPixelRecHit") << " geomdet does not cast into geomdet unit. cannot create pixel local parameters.";
42     }
43     }
44    
45     // Additionally, fill the SiPixeRecHitQuality from the PixelCPE.
46     theHitData.setRawQualityWord( cpe->rawQualityWord() );
47     theClusterProbComputationFlag = cpe->clusterProbComputationFlag();
48    
49     }
50    
51    
52    
53     // Another private constructor. It creates the TrackingRecHit internally,
54     // avoiding redundent cloning.
55     TSiPixelRecHit::TSiPixelRecHit( const LocalPoint& pos, const LocalError& err,
56     const GeomDet* det,
57     // const SiPixelCluster& clust,
58     clusterRef clust,
59     const PixelClusterParameterEstimator* cpe,
60     float weight, float annealing) :
61     TransientTrackingRecHit(det,weight, annealing),
62     theHitData( pos, err, det->geographicalId(), clust),
63     theCPE(cpe)
64     {
65     // Additionally, fill the SiPixeRecHitQuality from the PixelCPE.
66     theHitData.setRawQualityWord( cpe->rawQualityWord() );
67     theClusterProbComputationFlag = cpe->clusterProbComputationFlag();
68     }
69    
70    
71    
72    
73     /*
74     SiPixelRecHit( const LocalPoint&, const LocalError&,
75     const DetId&,
76     const SiPixelCluster * cluster);
77     */