CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/FastSimulation/CaloHitMakers/interface/HcalHitMaker.h

Go to the documentation of this file.
00001 #ifndef HcalHitMaker_h
00002 #define HcalHitMaker_h
00003 
00004 #include "FastSimulation/Event/interface/FSimTrack.h"
00005 #include "FastSimulation/CaloHitMakers/interface/CaloHitMaker.h"
00006 #include "FastSimulation/CaloHitMakers/interface/EcalHitMaker.h"
00007 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00008 
00009 //#include "Math/GenVector/Transform3D.h"
00010 #include "FastSimulation/CaloGeometryTools/interface/Transform3DPJ.h"
00011 
00012 //#include <boost/cstdint.hpp>
00013 
00014 class CaloGeometryHelper;
00015 
00016 class HcalHitMaker : public CaloHitMaker
00017 {
00018  public:
00019  
00020   typedef math::XYZVector XYZVector;
00021   typedef math::XYZVector XYZPoint;
00022   typedef ROOT::Math::Transform3DPJ Transform3D;
00023 
00024   HcalHitMaker(EcalHitMaker &, unsigned );
00025   ~HcalHitMaker() {;}
00026   
00028   inline void setSpotEnergy(double e) { spotEnergy=e;} 
00029   
00031   bool addHit(double r,double phi,unsigned layer=0);
00032   
00034   bool addHit(const XYZPoint & point ,unsigned layer=0);
00035 
00036   // get the hits
00037   const std::map<uint32_t,float>& getHits() { return hitMap_ ;} ;
00038 
00040   bool setDepth(double,bool inCm=false); 
00041 
00042  private:
00043     EcalHitMaker& myGrid;
00044     
00045     const FSimTrack * myTrack;
00046     XYZPoint ecalEntrance_;
00047     XYZVector particleDirection;
00048     int onHcal;
00049     
00050     double currentDepth_;
00051     Transform3D locToGlobal_;
00052     double radiusFactor_;
00053     bool mapCalculated_;
00054     
00055  public:
00056     static int getSubHcalDet(const FSimTrack* t)
00057       {
00058         //      std::cout << " getSubHcalDet " << std::endl;
00059         // According to  DataFormats/ HcalDetId/ interface/ HcalSubdetector.h
00060         //      std::cout << " onHcal " << t->onHcal() << " onVFcal " << t->onVFcal() << std::endl;
00061         if(t->onHcal()==1) return HcalBarrel;
00062         if(t->onHcal()==2) return HcalEndcap;
00063         if(t->onVFcal()==2) return HcalForward;
00064         return -1;
00065       } 
00066 
00067 };
00068 #endif