diff --git a/LArCalorimeter/LArROD/LArROD/LArSuperCellBuilderDriver.h b/LArCalorimeter/LArROD/LArROD/LArSuperCellBuilderDriver.h index 0f7249bc896eed529b88de935ef88305c8b26cef..bb64aff962ccd13a76d0f093be1aea0e0506d70d 100755 --- a/LArCalorimeter/LArROD/LArROD/LArSuperCellBuilderDriver.h +++ b/LArCalorimeter/LArROD/LArROD/LArSuperCellBuilderDriver.h @@ -105,6 +105,9 @@ class LArSuperCellBuilderDriver : public AthAlgorithm int m_defaultShiftTimeSamples; int m_bcs; int m_counter; + std::vector<float> m_bcidLowLim; + std::vector<float> m_bcidUpLim; + std::vector<float> m_bcidBands; }; #include "LArROD/LArSuperCellBuilderDriver.icc" diff --git a/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx b/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx index c9b57dffb6614924fd09d230911306f4483a662f..6998c94aa8554c602f02ac44099b2e85c047b7f9 100755 --- a/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx +++ b/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx @@ -52,6 +52,9 @@ LArSuperCellBuilderDriver::LArSuperCellBuilderDriver (const std::string& name, declareProperty("BuildDiscChannel", m_buildDiscChannel=false); declareProperty("DefaultShiftTimeSample", m_defaultShiftTimeSamples=0); declareProperty("BCID_Iter", m_bcs=2); + declareProperty("bCIDLowLim", m_bcidLowLim={8,-2,-8}); + declareProperty("bCIDUpLim", m_bcidUpLim={-8,2,8}); + declareProperty("bCIDbands", m_bcidBands={-1e4,0,10,1e4}); } LArSuperCellBuilderDriver::~LArSuperCellBuilderDriver() @@ -190,6 +193,18 @@ StatusCode LArSuperCellBuilderDriver::execute() { Identifier id = cabling->cnvToIdentifier((*cont_it)->channelID()); IdentifierHash idhash = sem_mgr->getCaloCell_ID()->calo_cell_hash(id); const CaloDetDescrElement* dde = sem_mgr->get_element (idhash); + float et_calc = energy*dde->sinTh()*1e-3; // in GeV + float et_calc_t = et_calc * time; + bool passBCID=false; + for(unsigned int i=0;i<m_bcidBands.size()-1;i++){ + if ( (et_calc > m_bcidBands[i]) && (et_calc< m_bcidBands[i+1]) ){ + if ( (et_calc_t > m_bcidLowLim[i]*et_calc) && (et_calc_t < m_bcidUpLim[i]*et_calc) ) passBCID=true; + break; + } + } + + prov = prov & (~0x200); + if ( passBCID ) prov |= 0x200; CaloCell* cell = new CaloCell( dde, (float)energy, (float)time, (uint16_t)0, (uint16_t)prov, gain ); caloCell->push_back( cell ); }