CMS 3D CMS Logo

CaloGeometryHelper.h
Go to the documentation of this file.
1 #ifndef FastSimulation_CaloGeometryTools_CaloGeometryHelper
2 #define FastSimulation_CaloGeometryTools_CaloGeometryHelper
3 
7 
8 #include <vector>
9 #include <array>
10 
11 class DetId;
12 class Crystal;
13 
14 namespace edm {
15  class ParameterSet;
16 }
17 
19 public:
22 
24  CaloGeometryHelper(const edm::ParameterSet& fastCalo);
26 
27  // more user friendly getClosestCell
28  DetId getClosestCell(const XYZPoint& point, bool ecal, bool central) const;
29 
30  // more user friendly getWindow
31  void getWindow(const DetId& pivot, int s1, int s2, std::vector<DetId>&) const;
32 
33  double preshowerZPosition(int layer) const { return (layer == 1) ? psLayer1Z_ : psLayer2Z_; }
34 
35  // the Crystal constructor
36  void buildCrystal(const DetId& id, Crystal&) const;
37 
38  void initialize(double bField);
39 
40  // get the <=8 neighbours
41  typedef std::array<DetId, 8> NeiVect;
42  const NeiVect& getNeighbours(const DetId& det) const;
43 
44  inline double magneticField() const { return bfield_; }
45 
46  // temporary. Requires a missing geometry tool
47  bool borderCrossing(const DetId&, const DetId&) const;
48 
49  bool move(DetId& cell, const CaloDirection& dir, bool fast = true) const;
50 
51  inline bool preshowerPresent() const { return preshowerPresent_; };
52 
53 private:
54  void buildNeighbourArray();
55  void buildCrystalArray();
56  bool simplemove(DetId& cell, const CaloDirection& dir) const;
57  bool diagonalmove(DetId& cell, const CaloDirection& dir) const;
58 
59 private:
60  // Preshower layer positions
62 
63  // array of neighbours the hashed index is used for the first vector
64  std::vector<NeiVect> barrelNeighbours_;
65  std::vector<NeiVect> endcapNeighbours_;
66 
67  std::vector<BaseCrystal> barrelCrystals_;
68  std::vector<BaseCrystal> endcapCrystals_;
69 
71 
72  //mag field at 0,0,0
73  double bfield_;
75 };
76 #endif
CaloDirection
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
CaloDirection.h
CaloGeometryHelper::psLayer2Z_
double psLayer2Z_
Definition: CaloGeometryHelper.h:61
CaloGeometryHelper::preshowerPresent
bool preshowerPresent() const
Definition: CaloGeometryHelper.h:51
Crystal
Definition: Crystal.h:20
edm
HLT enums.
Definition: AlignableModifier.h:19
central
Definition: L1ECALPrefiringWeightProducer.cc:36
CaloGeometryHelper::diagonalmove
bool diagonalmove(DetId &cell, const CaloDirection &dir) const
Definition: CaloGeometryHelper.cc:318
indexGen.s2
s2
Definition: indexGen.py:107
CaloGeometryHelper::simplemove
bool simplemove(DetId &cell, const CaloDirection &dir) const
Definition: CaloGeometryHelper.cc:302
CaloGeometryHelper::~CaloGeometryHelper
~CaloGeometryHelper()
Definition: CaloGeometryHelper.cc:56
ecal
Definition: ElectronicsMappingGPU.h:13
BaseCrystal.h
CaloGeometryHelper::initialize
void initialize(double bField)
Definition: CaloGeometryHelper.cc:38
DetId
Definition: DetId.h:17
Calorimeter
Definition: Calorimeter.h:26
CaloGeometryHelper::getClosestCell
DetId getClosestCell(const XYZPoint &point, bool ecal, bool central) const
Definition: CaloGeometryHelper.cc:58
CaloGeometryHelper::XYZPoint
math::XYZVector XYZPoint
Definition: CaloGeometryHelper.h:21
CaloGeometryHelper::barrelCrystals_
std::vector< BaseCrystal > barrelCrystals_
Definition: CaloGeometryHelper.h:67
CaloGeometryHelper::buildCrystalArray
void buildCrystalArray()
Definition: CaloGeometryHelper.cc:390
CaloGeometryHelper::CaloGeometryHelper
CaloGeometryHelper()
Definition: CaloGeometryHelper.cc:26
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
edm::ParameterSet
Definition: ParameterSet.h:47
CaloGeometryHelper::XYZVector
math::XYZVector XYZVector
Definition: CaloGeometryHelper.h:20
ParameterSet
Definition: Functions.h:16
CaloGeometryHelper::endcapNeighbours_
std::vector< NeiVect > endcapNeighbours_
Definition: CaloGeometryHelper.h:65
CaloGeometryHelper::endcapCrystals_
std::vector< BaseCrystal > endcapCrystals_
Definition: CaloGeometryHelper.h:68
CaloGeometryHelper::buildCrystal
void buildCrystal(const DetId &id, Crystal &) const
Definition: CaloGeometryHelper.cc:157
CaloGeometryHelper::bfield_
double bfield_
Definition: CaloGeometryHelper.h:73
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
CaloGeometryHelper::getWindow
void getWindow(const DetId &pivot, int s1, int s2, std::vector< DetId > &) const
Definition: CaloGeometryHelper.cc:148
CaloGeometryHelper::borderCrossing
bool borderCrossing(const DetId &, const DetId &) const
Definition: CaloGeometryHelper.cc:370
CaloGeometryHelper::preshowerZPosition
double preshowerZPosition(int layer) const
Definition: CaloGeometryHelper.h:33
Calorimeter.h
CaloGeometryHelper::preshowerPresent_
bool preshowerPresent_
Definition: CaloGeometryHelper.h:74
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:284
CaloGeometryHelper::NeiVect
std::array< DetId, 8 > NeiVect
Definition: CaloGeometryHelper.h:41
CaloGeometryHelper::magneticField
double magneticField() const
Definition: CaloGeometryHelper.h:44
CaloGeometryHelper::move
bool move(DetId &cell, const CaloDirection &dir, bool fast=true) const
Definition: CaloGeometryHelper.cc:272
CaloGeometryHelper::barrelNeighbours_
std::vector< NeiVect > barrelNeighbours_
Definition: CaloGeometryHelper.h:64
CaloGeometryHelper::psLayer1Z_
double psLayer1Z_
Definition: CaloGeometryHelper.h:61
CaloGeometryHelper::getNeighbours
const NeiVect & getNeighbours(const DetId &det) const
Definition: CaloGeometryHelper.cc:267
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
CaloGeometryHelper
Definition: CaloGeometryHelper.h:18
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
CaloGeometryHelper::neighbourmapcalculated_
bool neighbourmapcalculated_
Definition: CaloGeometryHelper.h:70
CaloGeometryHelper::buildNeighbourArray
void buildNeighbourArray()
Definition: CaloGeometryHelper.cc:169