Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:34

0001 #ifndef HcalHitMaker_h
0002 #define HcalHitMaker_h
0003 
0004 #include "FastSimulation/Event/interface/FSimTrack.h"
0005 #include "FastSimulation/CaloHitMakers/interface/CaloHitMaker.h"
0006 #include "FastSimulation/CaloHitMakers/interface/EcalHitMaker.h"
0007 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0008 
0009 //#include "Math/GenVector/Transform3D.h"
0010 #include "FastSimulation/CaloGeometryTools/interface/Transform3DPJ.h"
0011 
0012 //#include <boost/cstdint.hpp>
0013 
0014 class CaloGeometryHelper;
0015 
0016 class HcalHitMaker : public CaloHitMaker {
0017 public:
0018   typedef math::XYZVector XYZVector;
0019   typedef math::XYZVector XYZPoint;
0020   typedef ROOT::Math::Transform3DPJ Transform3D;
0021 
0022   HcalHitMaker(EcalHitMaker&, unsigned);
0023   ~HcalHitMaker() override { ; }
0024 
0025   /// Set the spot energy
0026   inline void setSpotEnergy(double e) override { spotEnergy = e; }
0027 
0028   /// add the hit in the HCAL in local coordinates
0029   bool addHit(double r, double phi, unsigned layer = 0) override;
0030 
0031   /// add the hit in the HCAL in global coordinates
0032   bool addHit(const XYZPoint& point, unsigned layer = 0);
0033 
0034   // get the hits
0035   const std::map<CaloHitID, float>& getHits() override { return hitMap_; };
0036 
0037   /// set the depth in X0 or Lambda0 units depending on showerType
0038   bool setDepth(double, bool inCm = false);
0039 
0040 private:
0041   EcalHitMaker& myGrid;
0042 
0043   const FSimTrack* myTrack;
0044   XYZPoint ecalEntrance_;
0045   XYZVector particleDirection;
0046   int onHcal;
0047 
0048   double currentDepth_;
0049   Transform3D locToGlobal_;
0050   double radiusFactor_;
0051   bool mapCalculated_;
0052 
0053 public:
0054   static int getSubHcalDet(const FSimTrack* t) {
0055     //  std::cout << " getSubHcalDet " << std::endl;
0056     // According to  DataFormats/ HcalDetId/ interface/ HcalSubdetector.h
0057     //  std::cout << " onHcal " << t->onHcal() << " onVFcal " << t->onVFcal() << std::endl;
0058     if (t->onHcal() == 1)
0059       return HcalBarrel;
0060     if (t->onHcal() == 2)
0061       return HcalEndcap;
0062     if (t->onVFcal() == 2)
0063       return HcalForward;
0064     return -1;
0065   }
0066 };
0067 #endif