CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/RecoParticleFlow/PFClusterTools/interface/DetectorElement.h

Go to the documentation of this file.
00001 #ifndef DETECTORELEMENT_HH_
00002 #define DETECTORELEMENT_HH_
00003 
00004 #include <vector>
00005 #include <boost/shared_ptr.hpp>
00006 /*
00007  * This is a dirty macro that allows you to make vectors of DetectorElements within CINT
00008  */
00009 //#ifdef __MAKECINT__
00010 //#pragma link C++ class std::vector<minimiser::DetectorElement>
00011 //#endif
00012 //
00013 //#ifdef __MAKECINT__
00014 //#pragma link C++ class std::vector<minimiser::DetectorElement*>
00015 //#endif
00016 
00017 #include "RecoParticleFlow/PFClusterTools/interface/DetectorElementType.h"
00018 #include "RecoParticleFlow/PFClusterTools/interface/PFToolsException.h"
00019 
00020 #include "TH2F.h"
00021 #include "TH1F.h"
00022 #include <iosfwd>
00023 
00024 namespace pftools {
00025 
00035 class DetectorElement {
00036 public:
00037 
00038         DetectorElement(DetectorElementType type, double calib = 1.0);
00039 
00040         inline DetectorElementType getType() const {
00041                 return myType;
00042         }
00043         ;
00044 
00045         virtual ~DetectorElement();
00046 
00047         /*
00048          * Returns a global detector element calibration.
00049          */
00050         double getCalib() const {
00051                 return getCalibCore();
00052         }
00053 
00054         /*
00055          * Returns the calibration for this detector element as a function
00056          * of eta and phi.
00057          */
00058         double getCalib(double eta, double phi) const {
00059                 return getCalibCore(eta, phi);
00060         }
00061 
00062         /*
00063          * Set the calibration of this detector element. Must be > 0.
00064          */
00065         void setCalib(double calib) throw(PFToolsException&) {
00066                 setCalibCore(calib);
00067         }
00068 
00069         friend std::ostream& operator<<(std::ostream& s, const DetectorElement& de);
00070 
00071 
00072 private:
00073         virtual double getCalibCore() const;
00074         virtual double getCalibCore(double eta, double phi) const;
00075         virtual void setCalibCore(double calib) throw(PFToolsException&);
00076         
00077         DetectorElement(const DetectorElement& de);
00078         DetectorElementType myType;
00079         double myCalib;
00080 
00081 };
00082 
00083 typedef boost::shared_ptr<DetectorElement> DetectorElementPtr;
00084 
00085 std::ostream& operator<<(std::ostream& s, const DetectorElement& de);
00086 
00087 }
00088 
00089 #endif /*DETECTORELEMENT_HH_*/