ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/TreeFiller/interface/FillerPFTaus.h
Revision: 1.11.2.2
Committed: Fri Jun 21 05:03:50 2013 UTC (11 years, 10 months ago) by paus
Content type: text/plain
Branch: Mit_025c_branch
CVS Tags: Mit_025c_branch2
Changes since 1.11.2.1: +17 -18 lines
Log Message:
Backport 3 fine tuning.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 paus 1.11.2.2 // $Id: FillerPFTaus.h,v 1.11.2.1 2012/05/23 03:24:07 paus 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 paus 1.11.2.2 #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     namespace mithep
21     {
22     class FillerPFTaus : public BaseFiller
23     {
24     public:
25 paus 1.11.2.2 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 bendavid 1.1
45     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    
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 paus 1.11.2.2 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 paus 1.11.2.1 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 paus 1.11.2.1 mithep::PFTauMap *tauMap_; //exported PFTau map
64 loizides 1.2 mithep::PFTauArr *taus_; //array of taus
65 bendavid 1.8
66     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     }
71 mhchan 1.6
72 bendavid 1.1 };
73     }
74     #endif