Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:26

0001 #ifndef _RECOMET_METALGORITHMS_HCALNOISERBXARRAY_H_
0002 #define _RECOMET_METALGORITHMS_HCALNOISERBXARRAY_H_
0003 
0004 //
0005 // HcalNoiseRBXArray.h
0006 //
0007 //   description: A boost::array of 72 HcalNoiseRBXs designed to simply search/sorting of elements
0008 //                Automatically labels each RBX individually, and provides O(1) searching tools
0009 //
0010 //
0011 //   author: J.P. Chou, Brown
0012 //
0013 //
0014 
0015 #include <array>
0016 
0017 #include "DataFormats/METReco/interface/HcalNoiseHPD.h"
0018 #include "DataFormats/METReco/interface/HcalNoiseRBX.h"
0019 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
0020 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
0021 #include "DataFormats/CaloTowers/interface/CaloTower.h"
0022 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0023 #include "RecoMET/METAlgorithms/interface/HcalHPDRBXMap.h"
0024 
0025 namespace reco {
0026 
0027   class HcalNoiseRBXArray : public std::array<HcalNoiseRBX, HcalHPDRBXMap::NUM_RBXS> {
0028   public:
0029     // constructor/destructor
0030     HcalNoiseRBXArray();
0031     virtual ~HcalNoiseRBXArray();
0032 
0033     // one past the "last" HPD
0034     // provides the same functionality as HcalNoiseRBXArray::iterator end()
0035     // defined already by the base class, to denote that the HPD was not found
0036     std::vector<HcalNoiseHPD>::iterator endHPD(void);
0037     std::vector<HcalNoiseHPD>::const_iterator endHPD(void) const;
0038 
0039     // endRBX() and end() are identical
0040     // added for symmetry with endHPD()
0041     inline HcalNoiseRBXArray::iterator endRBX(void) { return end(); }
0042     inline HcalNoiseRBXArray::const_iterator endRBX(void) const { return end(); }
0043 
0044     // search tools to get the appropriate HPD/RBX in the array
0045     // if input is invalid, returns endHPD() or endRBX() when appropriate
0046     std::vector<HcalNoiseHPD>::iterator findHPD(int hpdindex);
0047     std::vector<HcalNoiseHPD>::const_iterator findHPD(int hpdindex) const;
0048     HcalNoiseRBXArray::iterator findRBX(int rbxindex);
0049     HcalNoiseRBXArray::const_iterator findRBX(int rbxindex) const;
0050     std::vector<HcalNoiseHPD>::iterator findHPD(const HcalDetId&);
0051     std::vector<HcalNoiseHPD>::const_iterator findHPD(const HcalDetId&) const;
0052     HcalNoiseRBXArray::iterator findRBX(const HcalDetId&);
0053     HcalNoiseRBXArray::const_iterator findRBX(const HcalDetId&) const;
0054     std::vector<HcalNoiseHPD>::iterator findHPD(const HBHEDataFrame&);
0055     std::vector<HcalNoiseHPD>::const_iterator findHPD(const HBHEDataFrame&) const;
0056     HcalNoiseRBXArray::iterator findRBX(const HBHEDataFrame&);
0057     HcalNoiseRBXArray::const_iterator findRBX(const HBHEDataFrame&) const;
0058     std::vector<HcalNoiseHPD>::iterator findHPD(const HBHERecHit&);
0059     std::vector<HcalNoiseHPD>::const_iterator findHPD(const HBHERecHit&) const;
0060     HcalNoiseRBXArray::iterator findRBX(const HBHERecHit&);
0061     HcalNoiseRBXArray::const_iterator findRBX(const HBHERecHit&) const;
0062 
0063     // same as above but, multiple HPDs/RBXs are possible within one calotower
0064     void findHPD(const CaloTower&, std::vector<std::vector<HcalNoiseHPD>::iterator>&);
0065     void findHPD(const CaloTower&, std::vector<std::vector<HcalNoiseHPD>::const_iterator>&) const;
0066     void findRBX(const CaloTower&, std::vector<HcalNoiseRBXArray::iterator>&);
0067     void findRBX(const CaloTower&, std::vector<HcalNoiseRBXArray::const_iterator>&) const;
0068 
0069   private:
0070   };
0071 
0072 }  // namespace reco
0073 
0074 #endif