CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
L1TauRecoTreeProducer Class Reference
Inheritance diagram for L1TauRecoTreeProducer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1TauRecoTreeProducer (const edm::ParameterSet &)
 
 ~L1TauRecoTreeProducer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

L1Analysis::L1AnalysisRecoTautau
 
L1Analysis::L1AnalysisRecoTauDataFormattau_data
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void endJob ()
 

Private Attributes

bool caloJetsMissing_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
DMFindingOldToken_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
DMFindingToken_
 
edm::Service< TFileServicefs_
 
double jetptThreshold_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
LooseAntiElectronToken_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
LooseAntiMuonToken_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
LooseIsoToken_
 
unsigned int maxCl_
 
unsigned int maxTau_
 
unsigned int maxTrk_
 
unsigned int maxVtx_
 
edm::EDGetTokenT
< reco::PFTauCollection
TauToken_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
TightAntiElectronToken_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
TightAntiMuonToken_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
TightIsoToken_
 
TTree * tree_
 
edm::EDGetTokenT
< reco::PFTauDiscriminator
VLooseAntiElectronToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 65 of file L1TauRecoTreeProducer.cc.

Constructor & Destructor Documentation

L1TauRecoTreeProducer::L1TauRecoTreeProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 116 of file L1TauRecoTreeProducer.cc.

References DMFindingOldToken_, DMFindingToken_, fs_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LooseAntiElectronToken_, LooseAntiMuonToken_, LooseIsoToken_, TFileService::make(), maxTau_, tau, tau_data, TauToken_, TightAntiElectronToken_, TightAntiMuonToken_, TightIsoToken_, tree_, and VLooseAntiElectronToken_.

116  :
117  caloJetsMissing_(false)
118 {
119 
120  maxTau_ = iConfig.getParameter<unsigned int>("maxTau");
121  TauToken_ = consumes<reco::PFTauCollection>(iConfig.getUntrackedParameter("TauToken",edm::InputTag("hpsPFTauProducer")));
122  DMFindingToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("DMFindingToken",edm::InputTag("hpsPFTauDiscriminationByDecayModeFindingNewDMs")));
123  DMFindingOldToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("DMFindingOldToken",edm::InputTag("hpsPFTauDiscriminationByDecayModeFindingOldDMs")));
124  TightIsoToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("TightIsoToken",edm::InputTag("hpsPFTauDiscriminationByTightIsolation")));
125  LooseIsoToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("LooseIsoToken",edm::InputTag("hpsPFTauDiscriminationByLooseIsolation")));
126  LooseAntiMuonToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("LooseAntiMuonToken",edm::InputTag("hpsPFTauDiscriminationByLooseMuonRejection")));
127  TightAntiMuonToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("TightAntiMuonToken",edm::InputTag("hpsPFTauDiscriminationByTightMuonRejection")));
128  VLooseAntiElectronToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("VLooseAntiElectronToken",edm::InputTag("hpsPFTauDiscriminationByMVA5VLooseElectronRejection")));
129  LooseAntiElectronToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("LooseAntiElectronToken",edm::InputTag("hpsPFTauDiscriminationByMVA5LooseElectronRejection")));
130  TightAntiElectronToken_ = consumes<reco::PFTauDiscriminator>(iConfig.getUntrackedParameter("TightAntiElectronToken",edm::InputTag("hpsPFTauDiscriminationByMVA5TightElectronRejection")));
131 
132  /*
133  caloJetToken_ = consumes<reco::CaloJetCollection>(iConfig.getUntrackedParameter("caloJetToken",edm::InputTag("ak4CaloJets")));
134  // caloJetIdToken_ = consumes<edm::ValueMap<reco::JetID> >(iConfig.getUntrackedParameter("jetIdToken",edm::InputTag("ak4JetID")));
135  jetCorrectorToken_ = consumes<reco::JetCorrector>(iConfig.getUntrackedParameter<edm::InputTag>("jetCorrToken"));
136 
137  jetptThreshold_ = iConfig.getParameter<double> ("jetptThreshold");
138  maxTau_ = iConfig.getParameter<unsigned int>("maxTau");
139  */
140 
142  tau_data = tau->getData();
143 
144  /*
145  // set up output
146  */
147  tree_=fs_->make<TTree>("TauRecoTree", "TauRecoTree");
148  //tree_=fs_->make<TTree>("JetRecoTree", "JetRecoTree");
149  tree_->Branch("Tau", "L1Analysis::L1AnalysisRecoTauDataFormat", &tau_data, 32000, 3);
150 
151 }
edm::EDGetTokenT< reco::PFTauDiscriminator > TightAntiMuonToken_
T getParameter(std::string const &) const
L1Analysis::L1AnalysisRecoTauDataFormat * tau_data
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::PFTauDiscriminator > VLooseAntiElectronToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > LooseIsoToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > TightIsoToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::EDGetTokenT< reco::PFTauDiscriminator > DMFindingToken_
L1Analysis::L1AnalysisRecoTau * tau
edm::EDGetTokenT< reco::PFTauDiscriminator > DMFindingOldToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > TightAntiElectronToken_
edm::EDGetTokenT< reco::PFTauCollection > TauToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > LooseAntiElectronToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > LooseAntiMuonToken_
edm::Service< TFileService > fs_
L1TauRecoTreeProducer::~L1TauRecoTreeProducer ( )

Definition at line 154 of file L1TauRecoTreeProducer.cc.

155 {
156 
157  // do anything here that needs to be done at desctruction time
158  // (e.g. close files, deallocate resources etc.)
159 
160 }

Member Function Documentation

void L1TauRecoTreeProducer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 168 of file L1TauRecoTreeProducer.cc.

References caloJetsMissing_, DMFindingOldToken_, DMFindingToken_, edm::Event::getByToken(), edm::HandleBase::isValid(), LooseAntiElectronToken_, LooseAntiMuonToken_, LooseIsoToken_, maxTau_, L1Analysis::L1AnalysisRecoTau::Reset(), L1Analysis::L1AnalysisRecoTau::SetTau(), tau, TauToken_, TightAntiElectronToken_, TightAntiMuonToken_, TightIsoToken_, tree_, and VLooseAntiElectronToken_.

169 {
170 
171  tau->Reset();
173  iEvent.getByToken(TauToken_, recoTaus);
174 
176  iEvent.getByToken(DMFindingToken_, DMFindingTaus);
177 
178  edm::Handle<reco::PFTauDiscriminator> DMFindingOldTaus;
179  iEvent.getByToken(DMFindingOldToken_, DMFindingOldTaus);
180 
182  iEvent.getByToken(TightIsoToken_, TightIsoTaus);
183 
185  iEvent.getByToken(LooseIsoToken_, LooseIsoTaus);
186 
188  iEvent.getByToken(LooseAntiMuonToken_, LooseAntiMuon);
189 
191  iEvent.getByToken(TightAntiMuonToken_, TightAntiMuon);
192 
193  edm::Handle<reco::PFTauDiscriminator> VLooseAntiElectron;
194  iEvent.getByToken(VLooseAntiElectronToken_, VLooseAntiElectron);
195 
196  edm::Handle<reco::PFTauDiscriminator> LooseAntiElectron;
197  iEvent.getByToken(LooseAntiElectronToken_, LooseAntiElectron);
198 
199  edm::Handle<reco::PFTauDiscriminator> TightAntiElectron;
200  iEvent.getByToken(TightAntiElectronToken_, TightAntiElectron);
201 
202  //std::cout<<"size of recoTaus = "<<recoTaus->size()<<std::endl;
203 
204  if (recoTaus.isValid()) {
205  //std::cout<<"passing here"<<std::endl;
206  tau->SetTau(iEvent, iSetup, recoTaus, DMFindingOldTaus, DMFindingTaus, TightIsoTaus, LooseIsoTaus, LooseAntiMuon, TightAntiMuon, VLooseAntiElectron, LooseAntiElectron, TightAntiElectron, maxTau_);
207  }
208  else {
209  if (!caloJetsMissing_) {edm::LogWarning("MissingProduct") << "CaloJets not found. Branch will not be filled" << std::endl;}
210  caloJetsMissing_ = true;
211  }
212 
213  /*
214  jet->Reset();
215 
216  // get jets & co...
217  edm::Handle<reco::CaloJetCollection> recoCaloJets;
218  edm::Handle<edm::ValueMap<reco::JetID> > jetsID;
219  edm::Handle<reco::JetCorrector> jetCorr;
220 
221  iEvent.getByToken(caloJetToken_, recoCaloJets);
222  //iEvent.getByLabel(jetIdTag_,jetsID);
223  //iEvent.getByToken(jetCorrectorToken_, jetCorr);
224 
225  if (recoCaloJets.isValid()) {
226  jet->SetCaloJet(iEvent, iSetup, recoCaloJets, maxTau_); //jetsID, maxTau_);
227  }
228  else {
229  if (!caloJetsMissing_) {edm::LogWarning("MissingProduct") << "CaloJets not found. Branch will not be filled" << std::endl;}
230  caloJetsMissing_ = true;
231  }
232  */
233 
234  tree_->Fill();
235 
236 }
edm::EDGetTokenT< reco::PFTauDiscriminator > TightAntiMuonToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > VLooseAntiElectronToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< reco::PFTauDiscriminator > LooseIsoToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > TightIsoToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > DMFindingToken_
L1Analysis::L1AnalysisRecoTau * tau
edm::EDGetTokenT< reco::PFTauDiscriminator > DMFindingOldToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > TightAntiElectronToken_
edm::EDGetTokenT< reco::PFTauCollection > TauToken_
edm::EDGetTokenT< reco::PFTauDiscriminator > LooseAntiElectronToken_
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< reco::PFTauDiscriminator > LooseAntiMuonToken_
void SetTau(const edm::Event &event, const edm::EventSetup &setup, const edm::Handle< reco::PFTauCollection > taus, const edm::Handle< reco::PFTauDiscriminator > DMFindingOldTaus, const edm::Handle< reco::PFTauDiscriminator > DMFindingTaus, const edm::Handle< reco::PFTauDiscriminator > TightIsoTaus, const edm::Handle< reco::PFTauDiscriminator > LooseIsoTaus, const edm::Handle< reco::PFTauDiscriminator > LooseAntiMuon, const edm::Handle< reco::PFTauDiscriminator > TightAntiMuon, const edm::Handle< reco::PFTauDiscriminator > VLooseAntiElectron, const edm::Handle< reco::PFTauDiscriminator > LooseAntiElectron, const edm::Handle< reco::PFTauDiscriminator > TightAntiElectron, unsigned maxTau)
void L1TauRecoTreeProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 240 of file L1TauRecoTreeProducer.cc.

241 {
242 }
void L1TauRecoTreeProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 246 of file L1TauRecoTreeProducer.cc.

246  {
247 }

Member Data Documentation

bool L1TauRecoTreeProducer::caloJetsMissing_
private

Definition at line 106 of file L1TauRecoTreeProducer.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::DMFindingOldToken_
private

Definition at line 92 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::DMFindingToken_
private

Definition at line 91 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::Service<TFileService> L1TauRecoTreeProducer::fs_
private

Definition at line 84 of file L1TauRecoTreeProducer.cc.

Referenced by L1TauRecoTreeProducer().

double L1TauRecoTreeProducer::jetptThreshold_
private

Definition at line 107 of file L1TauRecoTreeProducer.cc.

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::LooseAntiElectronToken_
private

Definition at line 98 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::LooseAntiMuonToken_
private

Definition at line 95 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::LooseIsoToken_
private

Definition at line 94 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

unsigned int L1TauRecoTreeProducer::maxCl_
private

Definition at line 108 of file L1TauRecoTreeProducer.cc.

unsigned int L1TauRecoTreeProducer::maxTau_
private

Definition at line 109 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

unsigned int L1TauRecoTreeProducer::maxTrk_
private

Definition at line 111 of file L1TauRecoTreeProducer.cc.

unsigned int L1TauRecoTreeProducer::maxVtx_
private

Definition at line 110 of file L1TauRecoTreeProducer.cc.

L1Analysis::L1AnalysisRecoTau* L1TauRecoTreeProducer::tau
L1Analysis::L1AnalysisRecoTauDataFormat* L1TauRecoTreeProducer::tau_data

Definition at line 79 of file L1TauRecoTreeProducer.cc.

Referenced by L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauCollection> L1TauRecoTreeProducer::TauToken_
private

Definition at line 90 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::TightAntiElectronToken_
private

Definition at line 99 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::TightAntiMuonToken_
private

Definition at line 96 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::TightIsoToken_
private

Definition at line 93 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

TTree* L1TauRecoTreeProducer::tree_
private

Definition at line 87 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TauRecoTreeProducer::VLooseAntiElectronToken_
private

Definition at line 97 of file L1TauRecoTreeProducer.cc.

Referenced by analyze(), and L1TauRecoTreeProducer().