Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TryToShower.cxx

Go to the documentation of this file.
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       //      log<<MSG::DEBUG<<"Particle refused by Showerer "<<endl;
00038       return false;
00039     }
00040     //    else{
00041       //      log<<MSG::DEBUG<<"Particle accepted by Showerer : gridlet:"<<endl;
00042       //      log<<MSG::DEBUG<<gridlet<<endl;
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 }//namespace
00053 
00054 
00055 
00056 
00057 
00058 
00059 

Generated on Tue Mar 18 11:18:25 2003 for AtlfastAlgs by doxygen1.3-rc1