00001 #include <iostream>
00002 #include "PHNode.h"
00003 #include "PHCompositeNode.h"
00004 #include "PHIODataNode.h"
00005 #include "PHNodeIterator.h"
00006 #include "PHTable.hh"
00007 #include "mEmcGeaClusterEvalModule.h"
00008
00009 #include "dEmcEventWrapper.h"
00010
00011 #include "dEmcGeaTrackWrapper.h"
00012
00013 #include "dEmcGeaTowerTrackWrapper.h"
00014
00015 #include "dEmcClusterLocalExtWrapper.h"
00016
00017 #include "dEmcGeaTrackClusterWrapper.h"
00018
00019 #include "dEmcGeaClusterTrackWrapper.h"
00020 typedef PHIODataNode<PHTable> TableNode_t;
00021
00022 #include "phool.h"
00023
00024 using namespace std;
00025
00026
00027 mEmcGeaClusterEvalModule::mEmcGeaClusterEvalModule(){}
00028
00029 mEmcGeaClusterEvalModule::~mEmcGeaClusterEvalModule(){}
00030
00031 PHBoolean
00032 mEmcGeaClusterEvalModule::event(PHCompositeNode *root) {
00033 PHPointerList<PHNode> nodes;
00034 PHNodeIterator i(root), *j;
00035 PHNode *n;
00036 TableNode_t *d;
00037 PHTable *w;
00038 PHCompositeNode *emcNode, *dstNode, *evaNode, *outNode;
00039
00040 emcNode = static_cast<PHCompositeNode*>(i.findFirst("PHCompositeNode", "EMC"));
00041 if (!emcNode) {
00042 cerr << PHWHERE << " Could not find EMC node" << endl;
00043 return False;
00044
00045
00046 }
00047
00048 dstNode = static_cast<PHCompositeNode*>(i.findFirst("PHCompositeNode", "DST"));
00049 if (!dstNode) {
00050 cerr << PHWHERE << " Could not find DST node " << endl;
00051 return False;
00052
00053
00054 }
00055
00056 evaNode = static_cast<PHCompositeNode*>(i.findFirst("PHCompositeNode", "EVA"));
00057 if (!evaNode) {
00058 cerr << PHWHERE << " Could not find EVA node " << endl;
00059 return False;
00060
00061
00062 }
00063
00064
00065
00066
00067
00068 outNode = emcNode;
00069 n = i.findFirst("PHIODataNode", "dEmcEvent");
00070 if (!n) {
00071 cerr<< PHWHERE << "ERROR: 'in' parameter dEmcEvent not found" << endl;
00072
00073
00074
00075
00076
00077
00078 return False;
00079 }
00080 nodes.append(n);
00081
00082 outNode = evaNode;
00083 n = i.findFirst("PHIODataNode", "dEmcGeaTrack");
00084 if (!n) {
00085 cerr << PHWHERE << "ERROR: 'in' parameter dEmcGeaTrack not found" << endl;
00086
00087
00088
00089
00090
00091
00092 }
00093 nodes.append(n);
00094
00095 outNode = evaNode;
00096 n = i.findFirst("PHIODataNode", "dEmcGeaTowerTrack");
00097 if (!n) {
00098 cerr << PHWHERE << "ERROR: 'in' parameter dEmcGeaTowerTrack not found" << endl;
00099
00100
00101
00102
00103
00104
00105 return False;
00106 }
00107 nodes.append(n);
00108
00109 outNode = dstNode;
00110 n = i.findFirst("PHIODataNode", "dEmcClusterLocalExt");
00111 if (!n) {
00112 cerr << PHWHERE << "ERROR: 'in' parameter dEmcClusterLocalExt not found" << endl;
00113
00114
00115
00116
00117
00118
00119 return False;
00120 }
00121 nodes.append(n);
00122
00123 outNode = evaNode;
00124 j = new PHNodeIterator(outNode);
00125 if (!(d = static_cast<TableNode_t*>(j->findFirst("PHIODataNode","dEmcGeaTrackCluster")))) {
00126 cerr << PHWHERE << " Could not find dEmcGeaTrackCluster node" << endl;
00127 return False;
00128
00129
00130
00131
00132
00133
00134 }
00135 delete j;
00136 nodes.append(d);
00137
00138 outNode = evaNode;
00139 j = new PHNodeIterator(outNode);
00140 if (!(d = static_cast<TableNode_t*>(j->findFirst("PHIODataNode","dEmcGeaClusterTrack")))) {
00141 cerr << PHWHERE << " Could not find dEmcGeaClusterTrack" << endl;
00142 return False;
00143
00144
00145
00146
00147
00148
00149
00150 }
00151 delete j;
00152 nodes.append(d);
00153
00154 return callPAM(nodes);
00155 }