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
Error occurred while calculating annotation data.
Log Message:
Fill MVA2ElectronRejection, MVA3ElectronRejection, and CombinedIsolationDBSumPtCorr3Hits.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: FillerPFTaus.h,v 1.14 2012/03/26 15:27:15 mhchan Exp $
3 //
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 #include "MitAna/DataTree/interface/PFTauFwd.h"
15 #include "DataFormats/Common/interface/RefToPtr.h"
16 #include "DataFormats/TauReco/interface/PFTauDiscriminator.h"
17 #include "MitProd/TreeFiller/interface/AssociationMaps.h"
18 #include "MitProd/TreeFiller/interface/BaseFiller.h"
19
20 namespace mithep
21 {
22 class FillerPFTaus : public BaseFiller
23 {
24 public:
25 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 FillerPFTaus(const edm::ParameterSet &cfg, const char *name, bool active=1);
40 ~FillerPFTaus();
41
42 void BookDataBlock(TreeWriter &tws);
43 void FillDataBlock(const edm::Event &e, const edm::EventSetup &es);
44
45 private:
46 //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 const mithep::Track *getMitTrack(mitedm::TrackPtr ptr, bool allowmissing) const;
49
50
51 bool hpsActive_; //=true if HPS discriminants are filled
52 std::string edmName_; //edm name of jets collection
53 std::string mitName_; //mit name of jets collection
54 std::map<string, PFTauDiscHandle> hpsHandles_; // handles for HPS discriminators
55 std::vector<std::string> trackMapNames_; //name of imported TrackMap
56 std::string jetMapName_; //name of imported PFJetMap
57 std::string pfCandMapName_; //name of imported PFCandidateMap
58 std::string tauMapName_; //name of exported PFTau Map
59 bool allowMissingTrackRef_; //allow missing track reference (needed for tau embedding samples)
60 std::vector<const mithep::TrackMap*> trackMaps_; //map wrt Tracks
61 const mithep::PFJetMap *jetMap_; //map wrt pfjets
62 const mithep::PFCandidateMap *pfCandMap_; //map wrt pf candidates
63 mithep::PFTauMap *tauMap_; //exported PFTau map
64 mithep::PFTauArr *taus_; //array of taus
65
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
72 };
73 }
74 #endif