CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/L1Trigger/GlobalCaloTrigger/src/L1GctRegion.cc

Go to the documentation of this file.
00001 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctRegion.h" 
00002 
00003 L1GctRegion::L1GctRegion() : L1CaloRegion() {}
00004 
00005 L1GctRegion::~L1GctRegion() {}
00006 
00007 L1GctRegion L1GctRegion::makeJfInputRegion(const L1CaloRegion& r_in)
00008 {
00009   bool of = ( r_in.isHf() ? (r_in.et() == 0xff) : r_in.overFlow() );
00010   L1GctRegion r( r_in.et(), of, r_in.fineGrain(), r_in.gctEta(), r_in.gctPhi(), r_in.bx() );
00011   return r;
00012 }
00013 
00014 L1GctRegion L1GctRegion::makeProtoJetRegion(const unsigned et, const bool overFlow, const bool fineGrain, const bool tauIsolationVeto,
00015                                             const unsigned ieta, const unsigned iphi, const int16_t bx)
00016 {
00017   L1GctRegion r( et, overFlow, fineGrain, ieta, iphi, bx );
00018   if (tauIsolationVeto) {
00019     r.setFeatureBit0();
00020   } else {
00021     r.clrFeatureBit0();
00022   }
00023   return r;
00024 }
00025 
00026 L1GctRegion L1GctRegion::makeFinalJetRegion(const unsigned et, const bool overFlow, const bool fineGrain,
00027                                             const unsigned ieta, const unsigned iphi, const int16_t bx)
00028 {
00029   L1GctRegion r( et, overFlow, fineGrain, ieta, iphi, bx );
00030   return r;
00031 }
00032 
00033 // constructor for internal use
00034 L1GctRegion::L1GctRegion(const unsigned et,
00035               const bool overFlow, 
00036               const bool fineGrain,
00037               const unsigned ieta, 
00038               const unsigned iphi,
00039               const int16_t bx) :
00040   L1CaloRegion( L1CaloRegion::makeGctJetRegion( ((overFlow || et>kGctRegionMaxValue) ? kGctRegionMaxValue : (et & kGctRegionMaxValue) ),
00041                                                  (overFlow || et>kGctRegionMaxValue), fineGrain, ieta, iphi, bx) ) { }
00042 
00043 void L1GctRegion::setBit(const unsigned bitNum, const bool onOff)
00044 {
00045   if ((bitNum==14) || (bitNum==15)) { 
00046     uint16_t data = raw();
00047     uint16_t mask = 1 << bitNum;
00048     data &= ~mask;
00049     if (onOff) data |= mask;
00050     setRawData(data);
00051   } 
00052 }