Commit c843a1dd authored by Juan Lieber Marin's avatar Juan Lieber Marin Committed by Frank Winklmeier
Browse files

include ringer cells info into AOD file using ringerReFexFlags

parent 2fa1afd0
......@@ -40,6 +40,11 @@ jobproperties.RingerReFexFlags.add_JobProperty(DumpCells)
ringerReFexFlags = jobproperties.RingerReFexFlags
#=======================================================================
def enableDumpCells():
from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import ringerReFexFlags
ringerReFexFlags.DumpCells.set_Value_and_Lock(True)
from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTListRun3, addExtraCollectionsToEDMList
addExtraCollectionsToEDMList(TriggerHLTListRun3,[['xAOD::TrigRingerRingsAuxContainer#HLT_FastCaloRingerAux.cells_eta.cells_phi.cells_et.cells_sampling.cells_size.rings_sum']])
class RingerReFexConfig( CompFactory.RingerReFex ):
......@@ -79,12 +84,10 @@ class RingerReFexConfig( CompFactory.RingerReFex ):
# NOTE: This properties should be test soon
#self.DoQuarter = same( ringerReFexFlags.DoQuarter )
#self.DumpCells = ringerReFexFlags.DumpCells
self.DumpCells = ringerReFexFlags.DumpCells.get_Value()
self.DoQuarter = same( False )
self.DoEtaAxesDivision = same(True)
self.DoPhiAxesDivision = same(True)
from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
monTool = GenericMonitoringTool('MonTool')
monTool.defineHistogram( "TIME_total", title="Total Time;time [us]",xbins=100, xmin=0, xmax=500,type='TH1F', path='EXPERT')
......
......@@ -261,6 +261,23 @@ StatusCode RingerReFex::execute( xAOD::TrigEMCluster &emCluster,
ringsCollection->push_back( ptrigRingerRings );
ptrigRingerRings->setRings(ref_rings);
//ptrigRingerRings->auxdecor<int>("type") = 1;
if (m_decorateWithCells){
std::vector<float> cells_eta;
std::vector<float> cells_et;
std::vector<float> cells_phi;
std::vector<int> cells_sampling;
std::vector<int> cells_size;
std::vector<double> rings_sum;
for( auto& rs : vec_rs )
rs.fill_cells_info(cells_eta, cells_phi, cells_et, cells_sampling, cells_size, rings_sum);
ptrigRingerRings->auxdecor< std::vector<float> >("cells_eta") = cells_eta;
ptrigRingerRings->auxdecor< std::vector<float> >("cells_et") = cells_et;
ptrigRingerRings->auxdecor< std::vector<float> >("cells_phi") = cells_phi;
ptrigRingerRings->auxdecor< std::vector<int> >("cells_sampling") = cells_sampling;
ptrigRingerRings->auxdecor< std::vector<int> >("cells_size") = cells_size;
if (m_doQuarter[0]) ptrigRingerRings->auxdecor< std::vector< double > >("asym_rings_sum") = rings_sum;
else ptrigRingerRings->auxdecor< std::vector< double > >("rings_sum") = rings_sum;
}
auto clusLink = ElementLink<xAOD::TrigEMClusterContainer>(m_clusterContainerKey.key(),0,context);
ptrigRingerRings->setEmClusterLink( clusLink );
......@@ -275,6 +292,19 @@ StatusCode RingerReFex::execute( xAOD::TrigEMCluster &emCluster,
//!=================================================================================
void RingerReFex::RingSet::fill_cells_info(std::vector<float> &cells_eta, std::vector<float> &cells_phi, std::vector<float> &cells_et, std::vector<int> &cells_sampling, std::vector<int> &cells_size, std::vector<double> &rings_sum){
for (std::vector<const CaloCell*>::const_iterator it=m_cells.begin(); it!=m_cells.end(); ++it) {
cells_eta.push_back((*it)->eta());
cells_phi.push_back((*it)->phi());
cells_et.push_back((*it)->energy());
auto sampling = (*it)->caloDDE()->getSampling();
cells_sampling.push_back((int) sampling);
}
cells_size.push_back(m_cells.size());
double sum = 0;
for (auto ring : m_rings) sum+=ring;
rings_sum.push_back(sum);
}
inline bool RingerReFex::maxCell ( const CaloCell* cell, double &energy, const double eta_ref, const double phi_ref ) const
{
......
......@@ -44,7 +44,8 @@ class RingerReFex : public IReAlgToolCalo
bool isValid( const CaloCell * ) const;
void push_back( const CaloCell * );
void clear();
void fill_cells_info(std::vector<float> &cells_eta, std::vector<float> &cells_phi, std::vector<float> &cells_et, std::vector<int> &cells_sampling, std::vector<int> &cells_size, std::vector < double > &rings_sum);
private:
double m_deltaEta, m_deltaPhi;
......@@ -97,6 +98,7 @@ class RingerReFex : public IReAlgToolCalo
Gaudi::Property<std::vector<std::vector<int>>> m_samples {this, "Samples" , {} , "samples per layer" };
Gaudi::Property<bool> m_useTile {this, "UseTile" , true , "Use tile cells" };
Gaudi::Property<bool> m_decorateWithCells {this, "DumpCells" , false , "Dump Ringer Cells Information" };
Gaudi::Property<bool> m_globalCenter{this, "GlobalCenter", false, "Use cluster position as center" };
Gaudi::Property<std::vector<bool>> m_doQuarter {this, "DoQuarter", {} , "Do Quarter Rings" };
Gaudi::Property<std::vector<bool>> m_doEtaAxesDivision{this, "DoEtaAxesDivision", {} , "Do Eta axes division" };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment