1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#ifndef HcalHitMaker_h
#define HcalHitMaker_h
#include "FastSimulation/Event/interface/FSimTrack.h"
#include "FastSimulation/CaloHitMakers/interface/CaloHitMaker.h"
#include "FastSimulation/CaloHitMakers/interface/EcalHitMaker.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
//#include "Math/GenVector/Transform3D.h"
#include "FastSimulation/CaloGeometryTools/interface/Transform3DPJ.h"
//#include <boost/cstdint.hpp>
class CaloGeometryHelper;
class HcalHitMaker : public CaloHitMaker {
public:
typedef math::XYZVector XYZVector;
typedef math::XYZVector XYZPoint;
typedef ROOT::Math::Transform3DPJ Transform3D;
HcalHitMaker(EcalHitMaker&, unsigned);
~HcalHitMaker() override { ; }
/// Set the spot energy
inline void setSpotEnergy(double e) override { spotEnergy = e; }
/// add the hit in the HCAL in local coordinates
bool addHit(double r, double phi, unsigned layer = 0) override;
/// add the hit in the HCAL in global coordinates
bool addHit(const XYZPoint& point, unsigned layer = 0);
// get the hits
const std::map<CaloHitID, float>& getHits() override { return hitMap_; };
/// set the depth in X0 or Lambda0 units depending on showerType
bool setDepth(double, bool inCm = false);
private:
EcalHitMaker& myGrid;
const FSimTrack* myTrack;
XYZPoint ecalEntrance_;
XYZVector particleDirection;
int onHcal;
double currentDepth_;
Transform3D locToGlobal_;
double radiusFactor_;
bool mapCalculated_;
public:
static int getSubHcalDet(const FSimTrack* t) {
// std::cout << " getSubHcalDet " << std::endl;
// According to DataFormats/ HcalDetId/ interface/ HcalSubdetector.h
// std::cout << " onHcal " << t->onHcal() << " onVFcal " << t->onVFcal() << std::endl;
if (t->onHcal() == 1)
return HcalBarrel;
if (t->onHcal() == 2)
return HcalEndcap;
if (t->onVFcal() == 2)
return HcalForward;
return -1;
}
};
#endif
|