ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/TreeFiller/interface/FillerPFTaus.h
Revision: 1.15
Committed: Wed Dec 26 16:07:07 2012 UTC (12 years, 4 months ago) by mhchan
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, HEAD
Changes since 1.14: +23 -24 lines
Log Message:
Fill MVA2ElectronRejection, MVA3ElectronRejection, and CombinedIsolationDBSumPtCorr3Hits.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 mhchan 1.15 // $Id: FillerPFTaus.h,v 1.14 2012/03/26 15:27:15 mhchan Exp $
3 bendavid 1.1 //
4     // FillerPFTaus
5     //
6     // Implementation of a filler to fill EDM pf taus into our mithep::PFTau data structure.
7     //
8     // Authors: C.Loizides, J.Bendavid
9     //--------------------------------------------------------------------------------------------------
10    
11     #ifndef MITPROD_TREEFILLER_FILLERPFTAUS_H
12     #define MITPROD_TREEFILLER_FILLERPFTAUS_H
13    
14 loizides 1.3 #include "MitAna/DataTree/interface/PFTauFwd.h"
15 bendavid 1.8 #include "DataFormats/Common/interface/RefToPtr.h"
16 mhchan 1.15 #include "DataFormats/TauReco/interface/PFTauDiscriminator.h"
17 loizides 1.3 #include "MitProd/TreeFiller/interface/AssociationMaps.h"
18 bendavid 1.1 #include "MitProd/TreeFiller/interface/BaseFiller.h"
19    
20 mhchan 1.15 namespace mithep
21 bendavid 1.1 {
22     class FillerPFTaus : public BaseFiller
23 mhchan 1.15 {
24 bendavid 1.1 public:
25 mhchan 1.15 struct PFTauDiscHandle
26     {
27     std::string name; // EDM name
28     edm::Handle<reco::PFTauDiscriminator> handle;
29    
30     Double32_t value(reco::PFTauRef tauRef)
31     {
32     if(handle.isValid())
33     return (*handle)[tauRef];
34     else
35     return 0;
36     }
37     };
38    
39 bendavid 1.1 FillerPFTaus(const edm::ParameterSet &cfg, const char *name, bool active=1);
40     ~FillerPFTaus();
41    
42 bendavid 1.5 void BookDataBlock(TreeWriter &tws);
43 loizides 1.2 void FillDataBlock(const edm::Event &e, const edm::EventSetup &es);
44 mhchan 1.15
45 bendavid 1.1 private:
46 bendavid 1.8 //template <typename C> edm::Ptr<typename C::value_type> refToPtrHack(edm::Ref<typename C, edm::refhelper::FindUsingAdvance<C, typename C::value_type> > const &ref) { return edm::Ptr<typename C::value_type>(ref.id(), ref.get(), ref.key()); }
47 mhchan 1.15
48 bendavid 1.11 const mithep::Track *getMitTrack(mitedm::TrackPtr ptr, bool allowmissing) const;
49    
50    
51 mhchan 1.6 bool hpsActive_; //=true if HPS discriminants are filled
52 loizides 1.2 std::string edmName_; //edm name of jets collection
53     std::string mitName_; //mit name of jets collection
54 mhchan 1.15 std::map<string, PFTauDiscHandle> hpsHandles_; // handles for HPS discriminators
55 bendavid 1.11 std::vector<std::string> trackMapNames_; //name of imported TrackMap
56 loizides 1.2 std::string jetMapName_; //name of imported PFJetMap
57     std::string pfCandMapName_; //name of imported PFCandidateMap
58 pharris 1.12 std::string tauMapName_; //name of exported PFTau Map
59 bendavid 1.9 bool allowMissingTrackRef_; //allow missing track reference (needed for tau embedding samples)
60 bendavid 1.11 std::vector<const mithep::TrackMap*> trackMaps_; //map wrt Tracks
61 loizides 1.2 const mithep::PFJetMap *jetMap_; //map wrt pfjets
62     const mithep::PFCandidateMap *pfCandMap_; //map wrt pf candidates
63 pharris 1.12 mithep::PFTauMap *tauMap_; //exported PFTau map
64 loizides 1.2 mithep::PFTauArr *taus_; //array of taus
65 mhchan 1.15
66 bendavid 1.8 template <typename C>
67     edm::Ptr<typename C::value_type> refToPtrHack(edm::Ref<C, typename C::value_type, edm::refhelper::FindUsingAdvance<C, typename C::value_type> > const& ref) {
68     typedef typename C::value_type T;
69     return edm::Ptr<T>(ref.id(), ref.get(), ref.key());
70 mhchan 1.15 }
71 mhchan 1.6
72 bendavid 1.1 };
73     }
74     #endif