CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/DataFormats/METReco/interface/HcalNoiseRBX.h

Go to the documentation of this file.
00001 #ifndef _DATAFORMATS_METRECO_HCALNOISERBX_H_
00002 #define _DATAFORMATS_METRECO_HCALNOISERBX_H_
00003 
00004 //
00005 // HcalNoiseRBX.h
00006 //
00007 //   description: Container class of RBX information to study anomalous noise in the HCAL.
00008 //                The information for HcalNoiseHPD's are filled in RecoMET/METProducers/HcalNoiseInfoProducer,
00009 //                but the idnumber is managed by DataFormats/METReco/HcalNoiseRBXArray.
00010 //                Essentially contains 4 HcalNoiseHPDs.
00011 //
00012 //   author: J.P. Chou, Brown
00013 //
00014 //
00015 
00016 #include "boost/array.hpp"
00017 
00018 #include "DataFormats/METReco/interface/HcalNoiseHPD.h"
00019 
00020 namespace reco {
00021 
00022   //
00023   // forward declarations
00024   //
00025   
00026   class HcalNoiseRBX;
00027   
00028   //
00029   // typedefs
00030   //
00031   
00032   typedef std::vector<HcalNoiseRBX> HcalNoiseRBXCollection;
00033   
00034   
00035   class HcalNoiseRBX {
00036     
00037     friend class HcalNoiseInfoProducer; // allows this class the fill the HPDs with info
00038     friend class HcalNoiseRBXArray;     // allows this class to manage the idnumber
00039     
00040   public:
00041     // constructors
00042     HcalNoiseRBX();
00043     
00044     // destructor
00045     virtual ~HcalNoiseRBX();
00046 
00047     //
00048     // Detector ID accessors
00049     //
00050     
00051     // accessors
00052     int idnumber(void) const;
00053     
00054     //
00055     // other accessors
00056     //
00057 
00058     // returns a vector of HcalNoiseHPDs
00059     // this is expensive and deprecated.  One should use the iterator accessor method instead (provided below)
00060     const std::vector<HcalNoiseHPD> HPDs(void) const;
00061     inline std::vector<HcalNoiseHPD>::const_iterator HPDsBegin(void) const { return hpds_.begin(); }
00062     inline std::vector<HcalNoiseHPD>::const_iterator HPDsEnd(void) const { return hpds_.end(); }
00063 
00064     // return HPD with the highest rechit energy in the RBX
00065     // individual rechits only contribute if they have E>threshold
00066     std::vector<HcalNoiseHPD>::const_iterator maxHPD(double threshold=1.5) const;
00067 
00068     // pedestal subtracted fC information for all of the pixels in the RBX
00069     const std::vector<float> allCharge(void) const;
00070     float allChargeTotal(void) const;
00071     float allChargeHighest2TS(unsigned int firstts=4) const;
00072     float allChargeHighest3TS(unsigned int firstts=4) const;
00073 
00074     // total number of adc zeros in the RBX
00075     int totalZeros(void) const;
00076     
00077     // largest number of adc zeros from a single channel in the RBX
00078     int maxZeros(void) const;
00079     
00080     // sum of the energy of rechits in the RBX with E>threshold
00081     double recHitEnergy(double theshold=1.5) const;
00082 
00083     // minimum and maximum time for rechits in the RBX with E>threshold
00084     double minRecHitTime(double threshold=20.0) const;
00085     double maxRecHitTime(double threshold=20.0) const;
00086 
00087     // total number of rechits above some threshold in the RBX
00088     int numRecHits(double threshold=1.5) const;
00089     
00090     // calotower properties integrated over the entire RBX
00091     double caloTowerHadE(void) const;
00092     double caloTowerEmE(void) const;
00093     double caloTowerTotalE(void) const;
00094     double caloTowerEmFraction(void) const;
00095     
00096   private:
00097     
00098     // members
00099     int idnumber_;
00100     
00101     // the hpds
00102     std::vector<HcalNoiseHPD> hpds_;
00103 
00104     // the charge
00105     std::vector<float> allCharge_;
00106 
00107     // helper function to get the unique calotowers
00108     struct twrcomp {
00109       inline bool operator() ( const CaloTower & t1, const CaloTower & t2 ) {
00110         return t1.id() < t2.id();
00111       }
00112     };
00113     typedef std::set<CaloTower, twrcomp> towerset_t;
00114 
00115     void uniqueTowers(towerset_t& twrs_) const;
00116   };
00117   
00118 } // end of namespace
00119 
00120 #endif