Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:11

0001 #ifndef FastSimulation_CaloGeometryTools_CrystalWindowMap_h
0002 #define FastSimulation_CaloGeometryTools_CrystalWindowMap_h
0003 
0004 /** 
0005  *  This class is used by EcalHitMaker to determine quickly in which Pad each
0006  *  spots falls. 
0007  *  Each crystal is labelled by its number. Given a crystal number, several methods
0008  *  allow to get the ordered (by distance) list of the neighbouring crystals
0009  *  
0010  * \author Florian Beaudette
0011  * \date: 08-Jun-2004
0012  * \date: 05-Oct-2006
0013  */
0014 
0015 // FAMOS headers
0016 #include "FastSimulation/CaloGeometryTools/interface/Crystal.h"
0017 
0018 //C++ headers
0019 #include <vector>
0020 
0021 class CaloGeometryHelper;
0022 
0023 class CrystalWindowMap {
0024 public:
0025   /// Constructor from vector of Crystal
0026   CrystalWindowMap(const CaloGeometryHelper*, const std::vector<Crystal>& cw);
0027   ~CrystalWindowMap() { ; };
0028 
0029   /// get the ordered list of the crystals around the crystal given as a first argument
0030   bool getCrystalWindow(unsigned, std::vector<unsigned>&) const;
0031   /// same thing but with a different interface
0032   bool getCrystalWindow(unsigned iq, const std::vector<unsigned>* cw) const;
0033   /// same thing but with a different interface
0034   const std::vector<unsigned>& getCrystalWindow(unsigned, bool& status) const;
0035   inline unsigned size() const { return size_; }
0036 
0037 private:
0038   const CaloGeometryHelper* myCalorimeter_;
0039 
0040   unsigned size_;
0041   const std::vector<Crystal>& originalVector_;
0042 
0043   std::vector<std::vector<unsigned> > myNeighbours_;
0044 };
0045 
0046 #endif