CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/RecoLocalTracker/SiPixelRecHits/interface/PixelCPEGeneric.h

Go to the documentation of this file.
00001 #ifndef RecoLocalTracker_SiPixelRecHits_PixelCPEGeneric_H
00002 #define RecoLocalTracker_SiPixelRecHits_PixelCPEGeneric_H
00003 
00004 // \class PixelCPEGeneric  -- a generalized CPE reco for the idealized detector
00005 //
00006 // The basic idea of this class is to use generic formulae in order
00007 // to achieve clean and minimal code.  It should work for
00008 // - both normal and big pixels
00009 // - both barrel and forward
00010 // - both "FromDetPosition" and "FromTrackAngles" (i.e. by the track fit)
00011 //
00012 // This is possible since, in its nature, the original "ORCA" algorithm by 
00013 // Danek and Susana is the same in both X and Y directions, provided that
00014 // one correctly computes angles alpha_ and beta_ up front.  Thus, all
00015 // geometrical and special corrections are dropped, since the presumption
00016 // is that alpha_ and beta_ are determined as best as possible.  That means
00017 // that they either come from the track, or, if they come from the 
00018 // position of the DetUnit, they include all geometrical information 
00019 // possible for this DetUnit:
00020 // - for both the barrel and the forward, we use the cluster position 
00021 //   instead of the center of the module/plaquette
00022 // - for the forward, the tilt of the blades is included too
00023 //
00024 // In addtion, anything which is special for the computation of the lorentz
00025 // angle is done in setTheDet() method.  So the algorithm per se does not
00026 // need to worry about it.  This includes extra E*B term (a.k.a. "alpha2Order")
00027 // and extra tilt in the forward.
00028 //
00029 // Thus, the formula for the computation of the hit position is very
00030 // simple, and is described in Morris's note (IN ???) on the generalizaton
00031 // of the pixel algorithm.
00032 
00033 #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPEBase.h"
00034 #include "CalibTracker/SiPixelESProducers/interface/SiPixelCPEGenericDBErrorParametrization.h"
00035 
00036 // Already defined in the base class
00037 //#include "Geometry/CommonDetUnit/interface/GeomDetType.h"
00038 //#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
00039 //#include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h"
00040 //#include "Geometry/CommonDetAlgo/interface/MeasurementPoint.h"
00041 //#include "Geometry/CommonDetAlgo/interface/MeasurementError.h"
00042 //#include "Geometry/Surface/interface/GloballyPositioned.h"
00043 //#include "FWCore/ParameterSet/interface/ParameterSet.h"
00044 
00045 // The template header files
00046 #include "RecoLocalTracker/SiPixelRecHits/interface/SiPixelTemplateReco.h"
00047 #include "RecoLocalTracker/SiPixelRecHits/interface/SiPixelTemplate.h"
00048 
00049 
00050 #include <utility>
00051 #include <vector>
00052 
00053 
00054 #if 0
00055 
00059 #endif
00060 
00061 class MagneticField;
00062 class PixelCPEGeneric : public PixelCPEBase
00063 {
00064  public:
00065   // PixelCPEGeneric( const DetUnit& det );
00066   PixelCPEGeneric(edm::ParameterSet const& conf, const MagneticField *, const SiPixelLorentzAngle *, const SiPixelCPEGenericErrorParm *, const SiPixelTemplateDBObject *);
00067   ~PixelCPEGeneric() {;}
00068 
00069   LocalPoint localPosition (const SiPixelCluster& cluster, const GeomDetUnit & det) const; 
00070   
00071   // However, we do need to implement localError().
00072   LocalError localError   (const SiPixelCluster& cl, const GeomDetUnit & det) const;
00073   
00074   MeasurementPoint measurementPosition ( const SiPixelCluster&, 
00075                                          const GeomDetUnit & det) const;
00076 /*   MeasurementError measurementError    ( const SiPixelCluster&,  */
00077 /*                                        const GeomDetUnit & det) const; */
00078 
00079 
00080  private:
00081   //--------------------------------------------------------------------
00082   //  Methods.
00083   //------------------------------------------------------------------
00084   double
00085     generic_position_formula( int size,                
00086                               double Q_f,              
00087                               double Q_l,              
00088                               double upper_edge_first_pix, 
00089                               double lower_edge_last_pix,  
00090                               double half_lorentz_shift,   
00091                               double cot_angle,            
00092                               double pitch,            
00093                               bool first_is_big,       
00094                               bool last_is_big,        
00095                               double eff_charge_cut_low, 
00096                               double eff_charge_cut_high,
00097                               double size_cut           
00098                               ) const;
00099 
00100   void
00101     collect_edge_charges(const SiPixelCluster& cluster,  
00102                          float & Q_f_X,              
00103                          float & Q_l_X,              
00104                          float & Q_m_X,              
00105                          float & Q_f_Y,              
00106                          float & Q_l_Y,              
00107                          float & Q_m_Y               
00108                          ) const;
00109   
00110   
00111   //--- Errors squared in x and y.  &&& Need to be revisited.
00112   float err2X(bool&, int&) const;
00113   float err2Y(bool&, int&) const;
00114 
00115   //--- Cuts made externally settable
00116   double the_eff_charge_cut_lowX;
00117   double the_eff_charge_cut_lowY;
00118   double the_eff_charge_cut_highX;
00119   double the_eff_charge_cut_highY;
00120   double the_size_cutX;
00121   double the_size_cutY;
00122 
00123   bool inflate_errors;
00124   bool inflate_all_errors_no_trk_angle;
00125 
00126   bool UseErrorsFromTemplates_;
00127   bool DoCosmics_;
00128   bool LoadTemplatesFromDB_;
00129   bool TruncatePixelCharge_;
00130   bool IrradiationBiasCorrection_;
00131 
00132   double EdgeClusterErrorX_;
00133   double EdgeClusterErrorY_;
00134 
00135   //--- DB Error Parametrization object
00136   SiPixelCPEGenericDBErrorParametrization * genErrorsFromDB_;
00137 
00138   mutable SiPixelTemplate templ_;
00139   mutable int templID_; 
00140 
00141         // The truncation value pix_maximum is an angle-dependent cutoff on the
00142         // individual pixel signals. It should be applied to all pixels in the
00143         // cluster [signal_i = fminf(signal_i, pixmax)] before the column and row
00144         // sums are made. Morris
00145         mutable float pixmx;
00146 
00147         // These are errors predicted by PIXELAV
00148         mutable float sigmay; // CPE Generic y-error for multi-pixel cluster
00149         mutable float sigmax; // CPE Generic x-error for multi-pixel cluster
00150         mutable float sy1   ; // CPE Generic y-error for single single-pixel
00151         mutable float sy2   ; // CPE Generic y-error for single double-pixel cluster
00152         mutable float sx1   ; // CPE Generic x-error for single single-pixel cluster
00153         mutable float sx2   ; // CPE Generic x-error for single double-pixel cluster
00154 
00155         // These are irradiation bias corrections
00156         mutable float deltay; // CPE Generic y-bias for multi-pixel cluster
00157         mutable float deltax; // CPE Generic x-bias for multi-pixel cluster
00158         mutable float dy1   ; // CPE Generic y-bias for single single-pixel cluster
00159         mutable float dy2   ; // CPE Generic y-bias for single double-pixel cluster
00160         mutable float dx1   ; // CPE Generic x-bias for single single-pixel cluster
00161         mutable float dx2   ; // CPE Generic x-bias for single double-pixel cluster
00162 
00163          
00164  protected:
00165   //--- These functions are no longer needed, yet they are declared 
00166   //--- pure virtual in the base class.
00167   float xpos( const SiPixelCluster& ) const { return -999000.0; }  // &&& should abort
00168   float ypos( const SiPixelCluster& ) const { return -999000.0; }  // &&& should abort
00169 
00170 };
00171 
00172 #endif
00173 
00174 
00175 
00176