mEmcGeaPatchSimulatedCluster.C

Go to the documentation of this file.
00001 #include "mEmcGeaPatchSimulatedCluster.h"
00002 #include "emcNodeHelper.h"
00003 #include "emcClusterContainer.h"
00004 #include "emcClusterContent.h"
00005 #include <iostream>
00006 #include <cassert>
00007 #include "phool.h"
00008 
00009 using std::cerr;
00010 using std::cout;
00011 using std::endl;
00012 
00013 //_____________________________________________________________________________
00014 mEmcGeaPatchSimulatedCluster::mEmcGeaPatchSimulatedCluster()
00015 {
00016   name = "mEmcGeaPatchSimulatedCluster";
00017 }
00018 
00019 //_____________________________________________________________________________
00020 mEmcGeaPatchSimulatedCluster::~mEmcGeaPatchSimulatedCluster()
00021 {
00022 }
00023 
00024 //_____________________________________________________________________________
00025 PHBoolean
00026 mEmcGeaPatchSimulatedCluster::event(PHCompositeNode* topNode)
00027 {
00028   emcNodeHelper nh;
00029 
00030   PHCompositeNode* dstNode = emcNodeHelper::findCompositeNode(topNode,"DST");
00031 
00032   if (!dstNode)
00033     {
00034       cerr << PHWHERE << " Could not find DST node !" << endl;
00035       return False;
00036     }
00037 
00038   emcClusterContainer* clusters = 
00039     nh.getObject<emcClusterContainer>("emcClusterContainer",dstNode);
00040 
00041   if (!clusters)
00042     {
00043       cerr << PHWHERE << " Could not find emcClusterContainer !" << endl;
00044       return False;
00045     }
00046   
00047   for ( size_t i = 0; i < clusters->size(); ++i )
00048     {
00049       emcClusterContent* c = clusters->getCluster(i);
00050       assert(c!=0);
00051       // indicate that clusters are simulated, i.e. Fraction of simulated
00052       // energy = 1 (100%)
00053       c->set_simfrac(1);    
00054     }
00055 
00056   return True;
00057 }