CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/RecoMET/METAlgorithms/interface/HcalNoiseRBXArray.h

Go to the documentation of this file.
00001 #ifndef _RECOMET_METALGORITHMS_HCALNOISERBXARRAY_H_
00002 #define _RECOMET_METALGORITHMS_HCALNOISERBXARRAY_H_
00003 
00004 //
00005 // HcalNoiseRBXArray.h
00006 //
00007 //   description: A boost::array of 72 HcalNoiseRBXs designed to simply search/sorting of elements
00008 //                Automatically labels each RBX individually, and provides O(1) searching tools
00009 //
00010 //
00011 //   author: J.P. Chou, Brown
00012 //
00013 //
00014 
00015 #include "boost/array.hpp"
00016 
00017 #include "DataFormats/METReco/interface/HcalNoiseHPD.h"
00018 #include "DataFormats/METReco/interface/HcalNoiseRBX.h"
00019 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
00020 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
00021 #include "DataFormats/CaloTowers/interface/CaloTower.h"
00022 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00023 #include "RecoMET/METAlgorithms/interface/HcalHPDRBXMap.h"
00024 
00025 namespace reco {
00026 
00027   class HcalNoiseRBXArray : public boost::array<HcalNoiseRBX, HcalHPDRBXMap::NUM_RBXS>
00028     {
00029     public:
00030       // constructor/destructor
00031       HcalNoiseRBXArray();
00032       virtual ~HcalNoiseRBXArray();
00033       
00034       // one past the "last" HPD
00035       // provides the same functionality as HcalNoiseRBXArray::iterator end()
00036       // defined already by the base class, to denote that the HPD was not found
00037       std::vector<HcalNoiseHPD>::iterator endHPD(void);
00038       std::vector<HcalNoiseHPD>::const_iterator endHPD(void) const;
00039       
00040       // endRBX() and end() are identical
00041       // added for symmetry with endHPD()
00042       inline HcalNoiseRBXArray::iterator endRBX(void) { return end(); }
00043       inline HcalNoiseRBXArray::const_iterator endRBX(void) const { return end(); }
00044       
00045       // search tools to get the appropriate HPD/RBX in the array
00046       // if input is invalid, returns endHPD() or endRBX() when appropriate
00047       std::vector<HcalNoiseHPD>::iterator       findHPD(int hpdindex);
00048       std::vector<HcalNoiseHPD>::const_iterator findHPD(int hpdindex) const;
00049       HcalNoiseRBXArray::iterator       findRBX(int rbxindex);
00050       HcalNoiseRBXArray::const_iterator findRBX(int rbxindex) const;
00051       std::vector<HcalNoiseHPD>::iterator       findHPD(const HcalDetId&);
00052       std::vector<HcalNoiseHPD>::const_iterator findHPD(const HcalDetId&) const;
00053       HcalNoiseRBXArray::iterator       findRBX(const HcalDetId&);
00054       HcalNoiseRBXArray::const_iterator findRBX(const HcalDetId&) const;
00055       std::vector<HcalNoiseHPD>::iterator       findHPD(const HBHEDataFrame&);
00056       std::vector<HcalNoiseHPD>::const_iterator findHPD(const HBHEDataFrame&) const;
00057       HcalNoiseRBXArray::iterator       findRBX(const HBHEDataFrame&);
00058       HcalNoiseRBXArray::const_iterator findRBX(const HBHEDataFrame&) const;
00059       std::vector<HcalNoiseHPD>::iterator       findHPD(const HBHERecHit&);
00060       std::vector<HcalNoiseHPD>::const_iterator findHPD(const HBHERecHit&) const;
00061       HcalNoiseRBXArray::iterator       findRBX(const HBHERecHit&);
00062       HcalNoiseRBXArray::const_iterator findRBX(const HBHERecHit&) const;
00063       
00064       // same as above but, multiple HPDs/RBXs are possible within one calotower
00065       void findHPD(const CaloTower&, std::vector<std::vector<HcalNoiseHPD>::iterator>&);
00066       void findHPD(const CaloTower&, std::vector<std::vector<HcalNoiseHPD>::const_iterator>&) const;
00067       void findRBX(const CaloTower&, std::vector<HcalNoiseRBXArray::iterator>&);
00068       void findRBX(const CaloTower&, std::vector<HcalNoiseRBXArray::const_iterator>&) const;
00069   
00070     private:
00071       
00072     };
00073 
00074 } // end of namespace
00075 
00076 #endif