Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:18

0001 #include "PhysicsTools/UtilAlgos/interface/StringBasedNTupler.h"
0002 
0003 #include "DataFormats/PatCandidates/interface/Jet.h"
0004 #include "DataFormats/PatCandidates/interface/Muon.h"
0005 #include "DataFormats/PatCandidates/interface/MET.h"
0006 #include "DataFormats/PatCandidates/interface/Electron.h"
0007 #include "DataFormats/PatCandidates/interface/Photon.h"
0008 #include "DataFormats/PatCandidates/interface/Tau.h"
0009 #include "DataFormats/PatCandidates/interface/Hemisphere.h"
0010 #include "DataFormats/PatCandidates/interface/GenericParticle.h"
0011 
0012 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0013 #include "SimDataFormats/Track/interface/SimTrack.h"
0014 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0015 #include "DataFormats/L1Trigger/interface/L1ParticleMap.h"
0016 #include "DataFormats/METReco/interface/MET.h"
0017 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0018 
0019 #include "DataFormats/METReco/interface/HcalNoiseSummary.h"
0020 #include "DataFormats/METReco/interface/HcalNoiseRBX.h"
0021 
0022 #include "DataFormats/JetReco/interface/BasicJet.h"
0023 #include "DataFormats/JetReco/interface/CaloJet.h"
0024 #include "DataFormats/JetReco/interface/GenJet.h"
0025 #include <DataFormats/CaloRecHit/interface/CaloCluster.h>
0026 
0027 #include <DataFormats/PatCandidates/interface/TriggerPath.h>
0028 
0029 #include <DataFormats/PatCandidates/interface/PFParticle.h>
0030 #include <SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h>
0031 
0032 #include <memory>
0033 
0034 //--------------------------------------------------------------------------------
0035 //just define here a list of objects you would like to be able to have a branch of
0036 //--------------------------------------------------------------------------------
0037 #define ANOTHER_VECTOR_CLASS(C) \
0038   if (class_ == #C)             \
0039   return StringBranchHelper<C>(*this, iEvent)()
0040 #define ANOTHER_CLASS(C) \
0041   if (class_ == #C)      \
0042   return StringLeaveHelper<C>(*this, iEvent)()
0043 
0044 TreeBranch::value TreeBranch::branch(const edm::Event& iEvent) {
0045   ANOTHER_VECTOR_CLASS(pat::Jet);
0046   else ANOTHER_VECTOR_CLASS(pat::Muon);
0047   else ANOTHER_VECTOR_CLASS(reco::GenParticle);
0048   else ANOTHER_VECTOR_CLASS(pat::Electron);
0049   else ANOTHER_VECTOR_CLASS(pat::MET);
0050   else ANOTHER_VECTOR_CLASS(pat::Tau);
0051   else ANOTHER_VECTOR_CLASS(pat::Hemisphere);
0052   else ANOTHER_VECTOR_CLASS(pat::Photon);
0053   else ANOTHER_VECTOR_CLASS(reco::Muon);
0054   else ANOTHER_VECTOR_CLASS(reco::Track);
0055   else ANOTHER_VECTOR_CLASS(reco::GsfElectron);
0056   else ANOTHER_VECTOR_CLASS(SimTrack);
0057   else ANOTHER_VECTOR_CLASS(l1extra::L1ParticleMap);
0058   else ANOTHER_VECTOR_CLASS(reco::Vertex);
0059   else ANOTHER_VECTOR_CLASS(pat::GenericParticle);
0060   else ANOTHER_VECTOR_CLASS(reco::MET);
0061   else ANOTHER_CLASS(edm::HepMCProduct);
0062   else ANOTHER_CLASS(reco::BeamSpot);
0063   else ANOTHER_CLASS(HcalNoiseSummary);
0064   else ANOTHER_CLASS(GenEventInfoProduct);
0065   else ANOTHER_VECTOR_CLASS(reco::HcalNoiseRBX);
0066   else ANOTHER_VECTOR_CLASS(reco::BasicJet);
0067   else ANOTHER_VECTOR_CLASS(reco::CaloJet);
0068   else ANOTHER_VECTOR_CLASS(reco::GenJet);
0069   else ANOTHER_VECTOR_CLASS(pat::TriggerPath);
0070   else ANOTHER_VECTOR_CLASS(reco::PFCandidate);
0071   else ANOTHER_VECTOR_CLASS(reco::CaloCluster);
0072   else {
0073     edm::LogError("TreeBranch") << branchName() << " failed to recognized class type: " << class_;
0074     return std::make_unique<std::vector<float>>();
0075   }
0076 }
0077 #undef ANOTHER_CLASS