#include <Clust2D.h>
Inheritance diagram for clust::Clust2D:

Public Member Functions | |
| Clust2D (const char *version) | |
| void | Update (const cfg::Config &c) |
| ~Clust2D () | |
| jobc::Result | Reco (edm::EventHandle &evt) |
Private Attributes | |
| std::vector< std::string > | fInFolder |
| std::vector< std::string > | fOutFolder |
|
|
Definition at line 25 of file Clust2D.cxx. References jobc::Module::SetCfgVersion(). 00025 : 00026 jobc::Module("clust::Clust2D") 00027 { 00028 // Set the configuration version tag 00029 this->SetCfgVersion(version); 00030 }
|
|
|
Definition at line 60 of file Clust2D.cxx. 00061 {
00062
00063 }
|
|
|
Reimplemented from jobc::Module. Definition at line 67 of file Clust2D.cxx. References recobase::Cluster::Add(), edm::EventHandle::Cal(), fInFolder, fOutFolder, and edm::EventHandle::Reco(). 00068 {
00069
00070 for (unsigned int iFld=0; iFld < fInFolder.size(); ++iFld) {
00071
00072 vector<const CellHit*> cell(0);
00073 try { evt.Cal().Get(fInFolder[iFld].c_str(),cell); }
00074 catch (edm::Exception e) {
00075 continue;
00076 }
00077
00078 vector<Cluster*> clust(0);
00079 typedef map<int, vector<const CellHit*> > CellMap;
00080 typedef CellMap::iterator CMItr;
00081
00082 CellMap mapCell;
00083 for (unsigned int i=0; i<cell.size(); ++i) {
00084 int plane = cell[i]->Plane();
00085 mapCell[plane].push_back(cell[i]);
00086 }
00087
00088 CMItr itr = mapCell.begin();
00089 CMItr itrEnd = mapCell.end();
00090
00091 for (; itr != itrEnd; ++itr) {
00092 vector<const CellHit*>& chvec = itr->second;
00093 Cluster* cl = new Cluster();
00094 for (unsigned int j=0; j<chvec.size(); ++j) {
00095 recobase::CellHit* cell = new recobase::CellHit(*chvec[j]);
00096 cl->Add(cell);
00097 }
00098 clust.push_back(cl);
00099 }
00100
00101 evt.Reco().MakeFolder(fOutFolder[iFld].c_str());
00102
00103 evt.Reco().PutVector(clust,fOutFolder[iFld].c_str());
00104
00105 // now clean up...
00106 for (unsigned int i=0; i<clust.size(); ++i) delete clust[i];
00107 }
00108
00109 return jobc::kPassed; // kFailed if you want to fail the event
00110 }
|
|
|
Implements cfg::Observer. Definition at line 34 of file Clust2D.cxx. References assert_jobc, fInFolder, and fOutFolder. 00035 {
00036 fInFolder.clear();
00037 fOutFolder.clear();
00038
00039 try { c("InFolder").Get(fInFolder); }
00040 catch (cfg::Exception e) {
00041 string s;
00042 c("InFolder").Get(s);
00043 fInFolder.push_back(s);
00044 }
00045
00046 try { c("OutFolder").Get(fOutFolder); }
00047 catch (cfg::Exception e) {
00048 string s;
00049 c("OutFolder").Get(s);
00050 fOutFolder.push_back(s);
00051 }
00052
00053 assert_jobc(fOutFolder.size() == fInFolder.size(),
00054 "Clust2D::Update error: Num. Input Folders does not equal Num. Output Folders");
00055
00056 }
|
|
|
|
|
|
|
1.3.9.1