File indexing completed on 2024-04-06 12:11:12
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
0010 #include "FastSimulation/CaloGeometryTools/interface/Transform3DPJ.h"
0011
0012
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
0026 inline void setSpotEnergy(double e) override { spotEnergy = e; }
0027
0028
0029 bool addHit(double r, double phi, unsigned layer = 0) override;
0030
0031
0032 bool addHit(const XYZPoint& point, unsigned layer = 0);
0033
0034
0035 const std::map<CaloHitID, float>& getHits() override { return hitMap_; };
0036
0037
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
0056
0057
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