00001 #ifndef TREEUTILITY_HH_
00002 #define TREEUTILITY_HH_
00003 #include "RecoParticleFlow/PFClusterTools/interface/DetectorElement.h"
00004 #include "RecoParticleFlow/PFClusterTools/interface/ParticleDeposit.h"
00005 #include "RecoParticleFlow/PFClusterTools/interface/Calibratable.h"
00006 #include "RecoParticleFlow/PFClusterTools/interface/CalibrationTarget.h"
00007
00008 #include <boost/shared_ptr.hpp>
00009 #include <TFile.h>
00010 #include <TChain.h>
00011 #include <vector>
00012 #include <string>
00013 #include <map>
00014 namespace pftools {
00025 class TreeUtility {
00026 public:
00027
00028 TreeUtility();
00029 virtual ~TreeUtility();
00030
00031 void recreateFromRootFile(TFile& file,
00032 std::vector<DetectorElementPtr >& elements,
00033 std::vector<ParticleDepositPtr >& toBeFilled);
00034
00035 void recreateFromRootFile(TFile& f);
00036
00037 unsigned getCalibratablesFromRootFile(TChain& tree,
00038 std::vector<Calibratable>& toBeFilled);
00039
00040 unsigned convertCalibratablesToParticleDeposits(
00041 const std::vector<Calibratable>& input,
00042 std::vector<ParticleDepositPtr>& toBeFilled,
00043 CalibrationTarget target, DetectorElementPtr offset,
00044 DetectorElementPtr ecal, DetectorElementPtr hcal, bool includeOffset = false);
00045
00046 std::vector<ParticleDepositPtr> extractParticles(TFile& f);
00047
00048 private:
00049 std::map<std::string, unsigned> vetos_;
00050 };
00051 }
00052 #endif