CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TreeUtility.h
Go to the documentation of this file.
1 #ifndef TREEUTILITY_HH_
2 #define TREEUTILITY_HH_
7 
8 #include <boost/shared_ptr.hpp>
9 #include <TFile.h>
10 #include <TChain.h>
11 #include <vector>
12 #include <string>
13 #include <map>
14 
15 namespace pftools {
26 typedef boost::shared_ptr<Calibratable> CalibratablePtr;
27 class TreeUtility {
28 public:
29 
30  TreeUtility();
31  virtual ~TreeUtility();
32 
33  unsigned getParticleDepositsDirectly(TChain& sourceChain,
34  std::vector<ParticleDepositPtr>& toBeFilled,
36  DetectorElementPtr ecal, DetectorElementPtr hcal, bool includeOffset = false);
37 
38  unsigned getCalibratablesFromRootFile(TChain& tree,
39  std::vector<Calibratable>& toBeFilled);
40 
42  const std::vector<Calibratable>& input,
43  std::vector<ParticleDepositPtr>& toBeFilled,
45  DetectorElementPtr ecal, DetectorElementPtr hcal, bool includeOffset = false);
46 
47  void dumpCaloDataToCSV(TChain& chain, std::string csvFilename, double range, bool gaus = false);
48 
49 
50 private:
51  std::map<std::string, unsigned> vetos_;
52 
53 };
54 }
55 #endif /*TREEUTILITY_HH_*/
unsigned convertCalibratablesToParticleDeposits(const std::vector< Calibratable > &input, std::vector< ParticleDepositPtr > &toBeFilled, CalibrationTarget target, DetectorElementPtr offset, DetectorElementPtr ecal, DetectorElementPtr hcal, bool includeOffset=false)
Definition: TreeUtility.cc:238
boost::shared_ptr< Calibratable > CalibratablePtr
Definition: TreeUtility.h:26
void dumpCaloDataToCSV(TChain &chain, std::string csvFilename, double range, bool gaus=false)
Definition: TreeUtility.cc:48
virtual ~TreeUtility()
Definition: TreeUtility.cc:14
unsigned getParticleDepositsDirectly(TChain &sourceChain, std::vector< ParticleDepositPtr > &toBeFilled, CalibrationTarget target, DetectorElementPtr offset, DetectorElementPtr ecal, DetectorElementPtr hcal, bool includeOffset=false)
Definition: TreeUtility.cc:116
static std::string const input
Definition: EdmProvDump.cc:44
std::map< std::string, unsigned > vetos_
Definition: TreeUtility.h:51
unsigned getCalibratablesFromRootFile(TChain &tree, std::vector< Calibratable > &toBeFilled)
Definition: TreeUtility.cc:21
unsigned int offset(bool)
boost::shared_ptr< DetectorElement > DetectorElementPtr
tuple chain
Definition: chain.py:105
Utility class to create particles and detector elements from a Root file.
Definition: TreeUtility.h:27