00001
00002
00003
00004
00005
00006
00007
00008 #include "AtlfastAlgs/Calorimeter.h"
00009 #include "FastShowerUtils/ParticleInfo.h"
00010 #include "FastShowerUtils/Gridlet.h"
00011 #include "FastShowerUtils/GridletForger.h"
00012 #include "GaudiKernel/MsgStream.h"
00013 namespace Atlfast{
00014
00015 using FastShower::ParticleInfo;
00016 using FastShower::Gridlet;
00017 using FastShower::GridletForger;
00018
00019 TryToShower::TryToShower(Calorimeter* c):m_calorimeter(c){
00020 }
00021 bool TryToShower::operator()(const TransportedParticle* tp){
00022
00023 MsgStream& log = m_calorimeter->msgStream();
00024
00025 const GridletForger* gf = m_calorimeter->gridletForger();
00026 if(gf == 0) return false;
00027
00028 const HepMC::GenParticle* particle = tp->particle();
00029 ParticleInfo pi( tp->phi(),
00030 particle->momentum().pseudoRapidity(),
00031 particle->momentum().e(),
00032 particle->pdg_id()
00033 );
00034 Gridlet* gridlet = gf->makeGridlet(pi);
00035
00036 if(!gridlet) {
00037
00038 return false;
00039 }
00040
00041
00042
00043
00044
00045 std::vector<GridletElement*> e = gridlet->eElements();
00046 m_calorimeter->addEelements( e.begin(), e.end() );
00047 std::vector<GridletElement*> h = gridlet->hElements();
00048 m_calorimeter->addHelements( h.begin(), h.end() );
00049
00050 return true;
00051 }
00052 }
00053
00054
00055
00056
00057
00058
00059