CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DataFormats/HcalDigi/interface/HcalTriggerPrimitiveDigi.h

Go to the documentation of this file.
00001 #ifndef HCALTRIGGERPRIMITIVEDIGI_H
00002 #define HCALTRIGGERPRIMITIVEDIGI_H 1
00003 
00004 #include <ostream>
00005 #include <vector>
00006 #include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h"
00007 #include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveSample.h"
00008 
00015 class HcalTriggerPrimitiveDigi {
00016 public:
00017   typedef HcalTrigTowerDetId key_type; 
00018 
00019   HcalTriggerPrimitiveDigi(); // for persistence
00020   explicit HcalTriggerPrimitiveDigi(const HcalTrigTowerDetId& id);
00021   
00022   const HcalTrigTowerDetId& id() const { return id_; }
00023   int size() const { return (size_&0xF); }
00024   int presamples() const { return hcalPresamples_&0xF; }
00025 
00027   bool zsMarkAndPass() const { return (hcalPresamples_&0x10); }
00029   bool zsUnsuppressed() const { return (hcalPresamples_&0x20); }
00030 
00031   void setZSInfo(bool unsuppressed, bool markAndPass);
00032 
00033   const HcalTriggerPrimitiveSample& operator[](int i) const { return data_[i]; }
00034   const HcalTriggerPrimitiveSample& sample(int i) const { return data_[i]; }
00035 
00037   const HcalTriggerPrimitiveSample& t0() const { return data_[presamples()]; }  
00039   bool SOI_fineGrain() const { return t0().fineGrain(); }
00041   int SOI_compressedEt() const { return t0().compressedEt(); }
00042 
00043   void setSize(int size);
00044   void setPresamples(int ps);
00045   void setSample(int i, const HcalTriggerPrimitiveSample& sam) { data_[i]=sam; }
00046   
00047   static const int MAXSAMPLES = 10;
00048 private:
00049   HcalTrigTowerDetId id_;
00050   int size_;
00051   int hcalPresamples_;
00052   HcalTriggerPrimitiveSample data_[MAXSAMPLES];
00053 };
00054 
00055 std::ostream& operator<<(std::ostream& s, const HcalTriggerPrimitiveDigi& digi);
00056 
00057 
00058 #endif