Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

clust::Clust2D Class Reference

#include <Clust2D.h>

Inheritance diagram for clust::Clust2D:

jobc::Module cfg::Observer List of all members.

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

Constructor & Destructor Documentation

Clust2D::Clust2D const char *  version  ) 
 

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 }

Clust2D::~Clust2D  ) 
 

Definition at line 60 of file Clust2D.cxx.

00061 {
00062 
00063 }


Member Function Documentation

jobc::Result Clust2D::Reco edm::EventHandle evt  )  [virtual]
 

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 }

void Clust2D::Update const cfg::Config c  )  [virtual]
 

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 }


Member Data Documentation

std::vector<std::string> clust::Clust2D::fInFolder [private]
 

Definition at line 32 of file Clust2D.h.

Referenced by Reco(), and Update().

std::vector<std::string> clust::Clust2D::fOutFolder [private]
 

Definition at line 33 of file Clust2D.h.

Referenced by Reco(), and Update().


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 04:45:30 2009 for NOvA Offline by  doxygen 1.3.9.1