Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:06

0001 #ifndef _DATAFORMATS_METRECO_HCALNOISERBX_H_
0002 #define _DATAFORMATS_METRECO_HCALNOISERBX_H_
0003 
0004 //
0005 // HcalNoiseRBX.h
0006 //
0007 //   description: Container class of RBX information to study anomalous noise in the HCAL.
0008 //                The information for HcalNoiseHPD's are filled in RecoMET/METProducers/HcalNoiseInfoProducer,
0009 //                but the idnumber is managed by DataFormats/METReco/HcalNoiseRBXArray.
0010 //                Essentially contains 4 HcalNoiseHPDs.
0011 //
0012 //   author: J.P. Chou, Brown
0013 //
0014 //
0015 
0016 #include "DataFormats/METReco/interface/HcalNoiseHPD.h"
0017 
0018 namespace reco {
0019 
0020   //
0021   // forward declarations
0022   //
0023 
0024   class HcalNoiseRBX;
0025 
0026   //
0027   // typedefs
0028   //
0029 
0030   typedef std::vector<HcalNoiseRBX> HcalNoiseRBXCollection;
0031 
0032   class HcalNoiseRBX {
0033     friend class HcalNoiseInfoProducer;  // allows this class the fill the HPDs with info
0034     friend class HcalNoiseRBXArray;      // allows this class to manage the idnumber
0035 
0036   public:
0037     // constructors
0038     HcalNoiseRBX();
0039 
0040     // destructor
0041     ~HcalNoiseRBX();
0042 
0043     //
0044     // Detector ID accessors
0045     //
0046 
0047     // accessors
0048     int idnumber(void) const;
0049 
0050     //
0051     // other accessors
0052     //
0053 
0054     // returns a vector of HcalNoiseHPDs
0055     // this is expensive and deprecated.  One should use the iterator accessor method instead (provided below)
0056     const std::vector<HcalNoiseHPD> HPDs(void) const;
0057     inline std::vector<HcalNoiseHPD>::const_iterator HPDsBegin(void) const { return hpds_.begin(); }
0058     inline std::vector<HcalNoiseHPD>::const_iterator HPDsEnd(void) const { return hpds_.end(); }
0059 
0060     // return HPD with the highest rechit energy in the RBX
0061     // individual rechits only contribute if they have E>threshold
0062     std::vector<HcalNoiseHPD>::const_iterator maxHPD(double threshold = 1.5) const;
0063 
0064     // pedestal subtracted fC information for all of the pixels in the RBX
0065     const std::vector<float> allCharge(void) const;
0066     float allChargeTotal(void) const;
0067     float allChargeHighest2TS(unsigned int firstts = 4) const;
0068     float allChargeHighest3TS(unsigned int firstts = 4) const;
0069 
0070     // total number of adc zeros in the RBX
0071     int totalZeros(void) const;
0072 
0073     // largest number of adc zeros from a single channel in the RBX
0074     int maxZeros(void) const;
0075 
0076     // sum of the energy of rechits in the RBX with E>threshold
0077     double recHitEnergy(double theshold = 1.5) const;
0078     double recHitEnergyFailR45(double threshold = 1.5) const;
0079 
0080     // minimum and maximum time for rechits in the RBX with E>threshold
0081     double minRecHitTime(double threshold = 20.0) const;
0082     double maxRecHitTime(double threshold = 20.0) const;
0083 
0084     // total number of rechits above some threshold in the RBX
0085     int numRecHits(double threshold = 1.5) const;
0086     int numRecHitsFailR45(double threshold = 1.5) const;
0087 
0088     // calotower properties integrated over the entire RBX
0089     double caloTowerHadE(void) const;
0090     double caloTowerEmE(void) const;
0091     double caloTowerTotalE(void) const;
0092     double caloTowerEmFraction(void) const;
0093 
0094     // helper function to get the unique calotowers
0095     struct twrcomp {
0096       inline bool operator()(const CaloTower& t1, const CaloTower& t2) const { return t1.id() < t2.id(); }
0097     };
0098     typedef std::set<CaloTower, twrcomp> towerset_t;
0099 
0100   private:
0101     // members
0102     int idnumber_;
0103 
0104     // the hpds
0105     std::vector<HcalNoiseHPD> hpds_;
0106 
0107     // the charge
0108     std::vector<float> allCharge_;
0109 
0110     void uniqueTowers(towerset_t& twrs_) const;
0111   };
0112 
0113 }  // namespace reco
0114 
0115 #endif