Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-23 03:24:47

0001 // -*- C++ -*-
0002 //
0003 // Package:    IsolatedGenParticles
0004 // Class:      IsolatedGenParticles
0005 //
0006 /**\class IsolatedGenParticles IsolatedGenParticles.cc Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Seema Sharma
0015 //         Created:  Tue Oct 27 09:46:41 CDT 2009
0016 //
0017 //
0018 
0019 #include "Calibration/IsolatedParticles/interface/CaloPropagateTrack.h"
0020 #include "Calibration/IsolatedParticles/interface/ChargeIsolation.h"
0021 #include "Calibration/IsolatedParticles/interface/GenSimInfo.h"
0022 
0023 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
0024 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
0025 
0026 #include "DataFormats/DetId/interface/DetId.h"
0027 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0028 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0029 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0030 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0031 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0032 #include "DataFormats/GeometrySurface/interface/GloballyPositioned.h"
0033 //L1 objects
0034 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0035 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0036 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0037 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
0038 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapFwd.h"
0039 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h"
0040 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
0041 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
0042 #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
0043 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
0044 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
0045 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
0046 
0047 #include "DataFormats/Math/interface/deltaPhi.h"
0048 #include "DataFormats/Math/interface/LorentzVector.h"
0049 
0050 #include "FWCore/Framework/interface/Frameworkfwd.h"
0051 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0052 #include "FWCore/Framework/interface/EventSetup.h"
0053 #include "FWCore/Framework/interface/Event.h"
0054 #include "FWCore/Framework/interface/MakerMacros.h"
0055 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0056 //TFile Service
0057 #include "FWCore/ServiceRegistry/interface/Service.h"
0058 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0059 
0060 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0061 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0062 #include "Geometry/Records/interface/CaloTopologyRecord.h"
0063 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
0064 #include "Geometry/CaloTopology/interface/HcalTopology.h"
0065 #include "Geometry/CaloTopology/interface/CaloTopology.h"
0066 
0067 #include "MagneticField/Engine/interface/MagneticField.h"
0068 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0069 
0070 #include "RecoCaloTools/Navigation/interface/CaloNavigator.h"
0071 
0072 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0073 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0074 // track associator
0075 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0076 
0077 // root objects
0078 #include "TROOT.h"
0079 #include "TSystem.h"
0080 #include "TFile.h"
0081 #include "TH1I.h"
0082 #include "TH2D.h"
0083 #include "TProfile.h"
0084 #include "TDirectory.h"
0085 #include "TTree.h"
0086 
0087 #include <cmath>
0088 #include <iostream>
0089 #include <iomanip>
0090 #include <list>
0091 #include <vector>
0092 
0093 namespace {
0094   class ParticlePtGreater {
0095   public:
0096     int operator()(const HepMC::GenParticle *p1, const HepMC::GenParticle *p2) const {
0097       return p1->momentum().perp() > p2->momentum().perp();
0098     }
0099   };
0100 
0101   class ParticlePGreater {
0102   public:
0103     int operator()(const HepMC::GenParticle *p1, const HepMC::GenParticle *p2) const {
0104       return p1->momentum().rho() > p2->momentum().rho();
0105     }
0106   };
0107 }  // namespace
0108 
0109 class IsolatedGenParticles : public edm::one::EDAnalyzer<edm::one::SharedResources> {
0110 public:
0111   explicit IsolatedGenParticles(const edm::ParameterSet &);
0112   ~IsolatedGenParticles() override {}
0113 
0114   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
0115 
0116 private:
0117   void beginJob() override;
0118   void analyze(const edm::Event &, const edm::EventSetup &) override;
0119   void endJob() override {}
0120 
0121   void fillTrack(
0122       GlobalPoint &posVec, math::XYZTLorentzVector &momVec, GlobalPoint &posECAL, int pdgId, bool okECAL, bool accpet);
0123   void fillIsolatedTrack(math::XYZTLorentzVector &momVec, GlobalPoint &posECAL, int pdgId);
0124   void bookHistograms();
0125   void clearTreeVectors();
0126   int particleCode(int);
0127 
0128   static constexpr int NPBins_ = 3;
0129   static constexpr int NEtaBins_ = 4;
0130   static constexpr int PBins_ = 32, EtaBins_ = 60, Particles = 12;
0131   int nEventProc;
0132   double genPartPBins_[NPBins_ + 1], genPartEtaBins_[NEtaBins_ + 1];
0133   double ptMin_, etaMax_, pCutIsolate_;
0134   bool a_Isolation_;
0135   std::string genSrc_;
0136 
0137   edm::EDGetTokenT<edm::HepMCProduct> tok_hepmc_;
0138   edm::EDGetTokenT<reco::GenParticleCollection> tok_genParticles_;
0139 
0140   bool initL1, useHepMC_;
0141   static const size_t nL1BitsMax_ = 128;
0142   std::string algoBitToName_[nL1BitsMax_];
0143   double a_coneR_, a_charIsoR_, a_neutIsoR_, a_mipR_;
0144   bool debugL1Info_;
0145   int verbosity_;
0146 
0147   edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> tok_L1GTrorsrc_;
0148   edm::EDGetTokenT<L1GlobalTriggerObjectMapRecord> tok_L1GTobjmap_;
0149   edm::EDGetTokenT<l1extra::L1MuonParticleCollection> tok_L1extMusrc_;
0150   edm::EDGetTokenT<l1extra::L1EmParticleCollection> tok_L1Em_;
0151   edm::EDGetTokenT<l1extra::L1EmParticleCollection> tok_L1extNonIsoEm_;
0152   edm::EDGetTokenT<l1extra::L1JetParticleCollection> tok_L1extTauJet_;
0153   edm::EDGetTokenT<l1extra::L1JetParticleCollection> tok_L1extCenJet_;
0154   edm::EDGetTokenT<l1extra::L1JetParticleCollection> tok_L1extFwdJet_;
0155 
0156   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_;
0157   edm::ESGetToken<CaloTopology, CaloTopologyRecord> tok_caloTopology_;
0158   edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_topo_;
0159   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_;
0160   edm::ESGetToken<HepPDT::ParticleDataTable, PDTRecord> tok_pdt_;
0161 
0162   TH1I *h_L1AlgoNames;
0163   TH1I *h_NEventProc;
0164   TH2D *h_pEta[Particles];
0165 
0166   TTree *tree_;
0167 
0168   std::vector<double> *t_isoTrkPAll;
0169   std::vector<double> *t_isoTrkPtAll;
0170   std::vector<double> *t_isoTrkPhiAll;
0171   std::vector<double> *t_isoTrkEtaAll;
0172   std::vector<double> *t_isoTrkPdgIdAll;
0173   std::vector<double> *t_isoTrkDEtaAll;
0174   std::vector<double> *t_isoTrkDPhiAll;
0175 
0176   std::vector<double> *t_isoTrkP;
0177   std::vector<double> *t_isoTrkPt;
0178   std::vector<double> *t_isoTrkEne;
0179   std::vector<double> *t_isoTrkEta;
0180   std::vector<double> *t_isoTrkPhi;
0181   std::vector<double> *t_isoTrkEtaEC;
0182   std::vector<double> *t_isoTrkPhiEC;
0183   std::vector<double> *t_isoTrkPdgId;
0184 
0185   std::vector<double> *t_maxNearP31x31;
0186   std::vector<double> *t_cHadronEne31x31, *t_cHadronEne31x31_1, *t_cHadronEne31x31_2, *t_cHadronEne31x31_3;
0187   std::vector<double> *t_nHadronEne31x31;
0188   std::vector<double> *t_photonEne31x31;
0189   std::vector<double> *t_eleEne31x31;
0190   std::vector<double> *t_muEne31x31;
0191 
0192   std::vector<double> *t_maxNearP25x25;
0193   std::vector<double> *t_cHadronEne25x25, *t_cHadronEne25x25_1, *t_cHadronEne25x25_2, *t_cHadronEne25x25_3;
0194   std::vector<double> *t_nHadronEne25x25;
0195   std::vector<double> *t_photonEne25x25;
0196   std::vector<double> *t_eleEne25x25;
0197   std::vector<double> *t_muEne25x25;
0198 
0199   std::vector<double> *t_maxNearP21x21;
0200   std::vector<double> *t_cHadronEne21x21, *t_cHadronEne21x21_1, *t_cHadronEne21x21_2, *t_cHadronEne21x21_3;
0201   std::vector<double> *t_nHadronEne21x21;
0202   std::vector<double> *t_photonEne21x21;
0203   std::vector<double> *t_eleEne21x21;
0204   std::vector<double> *t_muEne21x21;
0205 
0206   std::vector<double> *t_maxNearP15x15;
0207   std::vector<double> *t_cHadronEne15x15, *t_cHadronEne15x15_1, *t_cHadronEne15x15_2, *t_cHadronEne15x15_3;
0208   std::vector<double> *t_nHadronEne15x15;
0209   std::vector<double> *t_photonEne15x15;
0210   std::vector<double> *t_eleEne15x15;
0211   std::vector<double> *t_muEne15x15;
0212 
0213   std::vector<double> *t_maxNearP11x11;
0214   std::vector<double> *t_cHadronEne11x11, *t_cHadronEne11x11_1, *t_cHadronEne11x11_2, *t_cHadronEne11x11_3;
0215   std::vector<double> *t_nHadronEne11x11;
0216   std::vector<double> *t_photonEne11x11;
0217   std::vector<double> *t_eleEne11x11;
0218   std::vector<double> *t_muEne11x11;
0219 
0220   std::vector<double> *t_maxNearP9x9;
0221   std::vector<double> *t_cHadronEne9x9, *t_cHadronEne9x9_1, *t_cHadronEne9x9_2, *t_cHadronEne9x9_3;
0222   std::vector<double> *t_nHadronEne9x9;
0223   std::vector<double> *t_photonEne9x9;
0224   std::vector<double> *t_eleEne9x9;
0225   std::vector<double> *t_muEne9x9;
0226 
0227   std::vector<double> *t_maxNearP7x7;
0228   std::vector<double> *t_cHadronEne7x7, *t_cHadronEne7x7_1, *t_cHadronEne7x7_2, *t_cHadronEne7x7_3;
0229   std::vector<double> *t_nHadronEne7x7;
0230   std::vector<double> *t_photonEne7x7;
0231   std::vector<double> *t_eleEne7x7;
0232   std::vector<double> *t_muEne7x7;
0233 
0234   std::vector<double> *t_maxNearP3x3;
0235   std::vector<double> *t_cHadronEne3x3, *t_cHadronEne3x3_1, *t_cHadronEne3x3_2, *t_cHadronEne3x3_3;
0236   std::vector<double> *t_nHadronEne3x3;
0237   std::vector<double> *t_photonEne3x3;
0238   std::vector<double> *t_eleEne3x3;
0239   std::vector<double> *t_muEne3x3;
0240 
0241   std::vector<double> *t_maxNearP1x1;
0242   std::vector<double> *t_cHadronEne1x1, *t_cHadronEne1x1_1, *t_cHadronEne1x1_2, *t_cHadronEne1x1_3;
0243   std::vector<double> *t_nHadronEne1x1;
0244   std::vector<double> *t_photonEne1x1;
0245   std::vector<double> *t_eleEne1x1;
0246   std::vector<double> *t_muEne1x1;
0247 
0248   std::vector<double> *t_maxNearPHC1x1;
0249   std::vector<double> *t_cHadronEneHC1x1, *t_cHadronEneHC1x1_1, *t_cHadronEneHC1x1_2, *t_cHadronEneHC1x1_3;
0250   std::vector<double> *t_nHadronEneHC1x1;
0251   std::vector<double> *t_photonEneHC1x1;
0252   std::vector<double> *t_eleEneHC1x1;
0253   std::vector<double> *t_muEneHC1x1;
0254 
0255   std::vector<double> *t_maxNearPHC3x3;
0256   std::vector<double> *t_cHadronEneHC3x3, *t_cHadronEneHC3x3_1, *t_cHadronEneHC3x3_2, *t_cHadronEneHC3x3_3;
0257   std::vector<double> *t_nHadronEneHC3x3;
0258   std::vector<double> *t_photonEneHC3x3;
0259   std::vector<double> *t_eleEneHC3x3;
0260   std::vector<double> *t_muEneHC3x3;
0261 
0262   std::vector<double> *t_maxNearPHC5x5;
0263   std::vector<double> *t_cHadronEneHC5x5, *t_cHadronEneHC5x5_1, *t_cHadronEneHC5x5_2, *t_cHadronEneHC5x5_3;
0264   std::vector<double> *t_nHadronEneHC5x5;
0265   std::vector<double> *t_photonEneHC5x5;
0266   std::vector<double> *t_eleEneHC5x5;
0267   std::vector<double> *t_muEneHC5x5;
0268 
0269   std::vector<double> *t_maxNearPHC7x7;
0270   std::vector<double> *t_cHadronEneHC7x7, *t_cHadronEneHC7x7_1, *t_cHadronEneHC7x7_2, *t_cHadronEneHC7x7_3;
0271   std::vector<double> *t_nHadronEneHC7x7;
0272   std::vector<double> *t_photonEneHC7x7;
0273   std::vector<double> *t_eleEneHC7x7;
0274   std::vector<double> *t_muEneHC7x7;
0275 
0276   std::vector<double> *t_maxNearPR;
0277   std::vector<double> *t_cHadronEneR, *t_cHadronEneR_1, *t_cHadronEneR_2, *t_cHadronEneR_3;
0278   std::vector<double> *t_nHadronEneR;
0279   std::vector<double> *t_photonEneR;
0280   std::vector<double> *t_eleEneR;
0281   std::vector<double> *t_muEneR;
0282 
0283   std::vector<double> *t_maxNearPIsoR;
0284   std::vector<double> *t_cHadronEneIsoR, *t_cHadronEneIsoR_1, *t_cHadronEneIsoR_2, *t_cHadronEneIsoR_3;
0285   std::vector<double> *t_nHadronEneIsoR;
0286   std::vector<double> *t_photonEneIsoR;
0287   std::vector<double> *t_eleEneIsoR;
0288   std::vector<double> *t_muEneIsoR;
0289 
0290   std::vector<double> *t_maxNearPHCR;
0291   std::vector<double> *t_cHadronEneHCR, *t_cHadronEneHCR_1, *t_cHadronEneHCR_2, *t_cHadronEneHCR_3;
0292   std::vector<double> *t_nHadronEneHCR;
0293   std::vector<double> *t_photonEneHCR;
0294   std::vector<double> *t_eleEneHCR;
0295   std::vector<double> *t_muEneHCR;
0296 
0297   std::vector<double> *t_maxNearPIsoHCR;
0298   std::vector<double> *t_cHadronEneIsoHCR, *t_cHadronEneIsoHCR_1, *t_cHadronEneIsoHCR_2, *t_cHadronEneIsoHCR_3;
0299   std::vector<double> *t_nHadronEneIsoHCR;
0300   std::vector<double> *t_photonEneIsoHCR;
0301   std::vector<double> *t_eleEneIsoHCR;
0302   std::vector<double> *t_muEneIsoHCR;
0303 
0304   std::vector<int> *t_L1Decision;
0305   std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
0306   std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
0307   std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
0308   std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
0309   std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
0310   std::vector<double> *t_L1NonIsoEMPt, *t_L1NonIsoEMEta, *t_L1NonIsoEMPhi;
0311   std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
0312 
0313   spr::genSimInfo isoinfo1x1, isoinfo3x3, isoinfo7x7, isoinfo9x9, isoinfo11x11;
0314   spr::genSimInfo isoinfo15x15, isoinfo21x21, isoinfo25x25, isoinfo31x31;
0315   spr::genSimInfo isoinfoHC1x1, isoinfoHC3x3, isoinfoHC5x5, isoinfoHC7x7;
0316   spr::genSimInfo isoinfoR, isoinfoIsoR, isoinfoHCR, isoinfoIsoHCR;
0317 };
0318 
0319 IsolatedGenParticles::IsolatedGenParticles(const edm::ParameterSet &iConfig)
0320     : ptMin_(iConfig.getUntrackedParameter<double>("PTMin", 1.0)),
0321       etaMax_(iConfig.getUntrackedParameter<double>("MaxChargedHadronEta", 2.5)),
0322       pCutIsolate_(iConfig.getUntrackedParameter<double>("PMaxIsolation", 20.0)),
0323       a_Isolation_(iConfig.getUntrackedParameter<bool>("UseConeIsolation", false)),
0324       genSrc_(iConfig.getUntrackedParameter("GenSrc", std::string("generatorSmeared"))),
0325       useHepMC_(iConfig.getUntrackedParameter<bool>("UseHepMC", false)),
0326       a_coneR_(iConfig.getUntrackedParameter<double>("ConeRadius", 34.98)),
0327       a_mipR_(iConfig.getUntrackedParameter<double>("ConeRadiusMIP", 14.0)),
0328       debugL1Info_(iConfig.getUntrackedParameter<bool>("DebugL1Info", false)),
0329       verbosity_(iConfig.getUntrackedParameter<int>("Verbosity", 0)) {
0330   usesResource(TFileService::kSharedResource);
0331 
0332   a_charIsoR_ = a_coneR_ + 28.9;
0333   a_neutIsoR_ = a_charIsoR_ * 0.726;
0334 
0335   tok_hepmc_ = consumes<edm::HepMCProduct>(edm::InputTag(genSrc_));
0336   tok_genParticles_ = consumes<reco::GenParticleCollection>(edm::InputTag(genSrc_));
0337 
0338   edm::InputTag L1extraTauJetSource_ = iConfig.getParameter<edm::InputTag>("L1extraTauJetSource");
0339   edm::InputTag L1extraCenJetSource_ = iConfig.getParameter<edm::InputTag>("L1extraCenJetSource");
0340   edm::InputTag L1extraFwdJetSource_ = iConfig.getParameter<edm::InputTag>("L1extraFwdJetSource");
0341   edm::InputTag L1extraMuonSource_ = iConfig.getParameter<edm::InputTag>("L1extraMuonSource");
0342   edm::InputTag L1extraIsoEmSource_ = iConfig.getParameter<edm::InputTag>("L1extraIsoEmSource");
0343   edm::InputTag L1extraNonIsoEmSource_ = iConfig.getParameter<edm::InputTag>("L1extraNonIsoEmSource");
0344   edm::InputTag L1GTReadoutRcdSource_ = iConfig.getParameter<edm::InputTag>("L1GTReadoutRcdSource");
0345   edm::InputTag L1GTObjectMapRcdSource_ = iConfig.getParameter<edm::InputTag>("L1GTObjectMapRcdSource");
0346   tok_L1GTrorsrc_ = consumes<L1GlobalTriggerReadoutRecord>(L1GTReadoutRcdSource_);
0347   tok_L1GTobjmap_ = consumes<L1GlobalTriggerObjectMapRecord>(L1GTObjectMapRcdSource_);
0348   tok_L1extMusrc_ = consumes<l1extra::L1MuonParticleCollection>(L1extraMuonSource_);
0349   tok_L1Em_ = consumes<l1extra::L1EmParticleCollection>(L1extraIsoEmSource_);
0350   tok_L1extNonIsoEm_ = consumes<l1extra::L1EmParticleCollection>(L1extraNonIsoEmSource_);
0351   tok_L1extTauJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraTauJetSource_);
0352   tok_L1extCenJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraCenJetSource_);
0353   tok_L1extFwdJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraFwdJetSource_);
0354 
0355   if (!strcmp("Dummy", genSrc_.c_str())) {
0356     if (useHepMC_)
0357       genSrc_ = "generatorSmeared";
0358     else
0359       genSrc_ = "genParticles";
0360   }
0361   edm::LogVerbatim("IsoTrack") << "Generator Source " << genSrc_ << " Use HepMC " << useHepMC_ << " ptMin " << ptMin_
0362                                << " etaMax " << etaMax_ << "\n a_coneR " << a_coneR_ << " a_charIsoR " << a_charIsoR_
0363                                << " a_neutIsoR " << a_neutIsoR_ << " a_mipR " << a_mipR_ << " debug " << verbosity_
0364                                << " debugL1Info " << debugL1Info_ << "\n"
0365                                << " Isolation Flag " << a_Isolation_ << " with cut " << pCutIsolate_ << " GeV";
0366 
0367   tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
0368   tok_caloTopology_ = esConsumes<CaloTopology, CaloTopologyRecord>();
0369   tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
0370   tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
0371   tok_pdt_ = esConsumes<HepPDT::ParticleDataTable, PDTRecord>();
0372 }
0373 
0374 void IsolatedGenParticles::fillDescriptions(edm::ConfigurationDescriptions &descriptions) {
0375   edm::ParameterSetDescription desc;
0376   desc.addUntracked<std::string>("GenSrc", "genParticles");
0377   desc.addUntracked<bool>("UseHepMC", false);
0378   desc.addUntracked<double>("ChargedHadronSeedP", 1.0);
0379   desc.addUntracked<double>("PTMin", 1.0);
0380   desc.addUntracked<double>("MaxChargedHadronEta", 2.5);
0381   desc.addUntracked<double>("ConeRadius", 34.98);
0382   desc.addUntracked<double>("ConeRadiusMIP", 14.0);
0383   desc.addUntracked<bool>("UseConeIsolation", true);
0384   desc.addUntracked<double>("PMaxIsolation", 5.0);
0385   desc.addUntracked<int>("Verbosity", 0);
0386   desc.addUntracked<bool>("DebugL1Info", false);
0387   desc.addUntracked<edm::InputTag>("L1extraTauJetSource", edm::InputTag("l1extraParticles", "Tau"));
0388   desc.addUntracked<edm::InputTag>("L1extraCenJetSource", edm::InputTag("l1extraParticles", "Central"));
0389   desc.addUntracked<edm::InputTag>("L1extraFwdJetSource", edm::InputTag("l1extraParticles", "Forward"));
0390   desc.addUntracked<edm::InputTag>("L1extraMuonSource", edm::InputTag("l1extraParticles"));
0391   desc.addUntracked<edm::InputTag>("L1extraIsoEmSource", edm::InputTag("l1extraParticles", "Isolated"));
0392   desc.addUntracked<edm::InputTag>("L1extraNonIsoEmSource", edm::InputTag("l1extraParticles", "NonIsolated"));
0393   desc.addUntracked<edm::InputTag>("L1GTReadoutRcdSource", edm::InputTag("gtDigis"));
0394   desc.addUntracked<edm::InputTag>("L1GTObjectMapRcdSource", edm::InputTag("hltL1GtObjectMap"));
0395   descriptions.add("isolatedGenParticles", desc);
0396 }
0397 
0398 void IsolatedGenParticles::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0399   clearTreeVectors();
0400 
0401   nEventProc++;
0402   const MagneticField *bField = &iSetup.getData(tok_magField_);
0403 
0404   // get particle data table
0405   const HepPDT::ParticleDataTable *pdt = &iSetup.getData(tok_pdt_);
0406 
0407   // get handle to HEPMCProduct
0408   edm::Handle<edm::HepMCProduct> hepmc;
0409   edm::Handle<reco::GenParticleCollection> genParticles;
0410   if (useHepMC_)
0411     iEvent.getByToken(tok_hepmc_, hepmc);
0412   else
0413     iEvent.getByToken(tok_genParticles_, genParticles);
0414 
0415   const CaloGeometry *geo = &iSetup.getData(tok_geom_);
0416   const CaloTopology *caloTopology = &iSetup.getData(tok_caloTopology_);
0417   const HcalTopology *theHBHETopology = &iSetup.getData(tok_topo_);
0418 
0419   //===================== save L1 Trigger information =======================
0420   // get L1TriggerReadout records
0421   edm::Handle<L1GlobalTriggerReadoutRecord> gtRecord;
0422   iEvent.getByToken(tok_L1GTrorsrc_, gtRecord);
0423 
0424   edm::Handle<L1GlobalTriggerObjectMapRecord> gtOMRec;
0425   iEvent.getByToken(tok_L1GTobjmap_, gtOMRec);
0426 
0427   // sanity check on L1 Trigger Records
0428   if (!gtRecord.isValid()) {
0429     edm::LogVerbatim("IsoTrack") << "\nL1GlobalTriggerReadoutRecord with \n\n"
0430                                  << "not found\n  --> returning false by "
0431                                  << "default!\n";
0432   }
0433   if (!gtOMRec.isValid()) {
0434     edm::LogVerbatim("IsoTrack") << "\nL1GlobalTriggerObjectMapRecord with \n\n"
0435                                  << "not found\n  --> returning false by "
0436                                  << "default!\n";
0437   }
0438 
0439   // L1 decision word
0440   const DecisionWord dWord = gtRecord->decisionWord();
0441   unsigned int numberTriggerBits = dWord.size();
0442 
0443   // just print the L1Bit number and AlgoName in first event
0444   if (!initL1) {
0445     initL1 = true;
0446     edm::LogVerbatim("IsoTrack") << "\nNumber of Trigger bits " << numberTriggerBits << "\n";
0447     edm::LogVerbatim("IsoTrack") << "\tBit \t L1 Algorithm ";
0448 
0449     // get ObjectMaps from ObjectMapRecord
0450     const std::vector<L1GlobalTriggerObjectMap> &objMapVec = gtOMRec->gtObjectMap();
0451     for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin(); itMap != objMapVec.end();
0452          ++itMap) {
0453       // Get trigger bits
0454       int itrig = (*itMap).algoBitNumber();
0455 
0456       // Get trigger names
0457       algoBitToName_[itrig] = (*itMap).algoName();
0458 
0459       edm::LogVerbatim("IsoTrack") << "\t" << itrig << "\t" << algoBitToName_[itrig];
0460 
0461       // store the algoNames as bin labels of a histogram
0462       h_L1AlgoNames->GetXaxis()->SetBinLabel(itrig + 1, algoBitToName_[itrig].c_str());
0463 
0464     }  // end of for loop
0465   }    // end of initL1
0466 
0467   // save L1 decision for each event
0468   for (unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
0469     bool accept = dWord[iBit];
0470     t_L1Decision->push_back(accept);
0471     // fill the trigger map
0472     if (debugL1Info_)
0473       edm::LogVerbatim("IsoTrack") << "Bit " << iBit << " " << algoBitToName_[iBit] << " " << accept;
0474 
0475     if (accept)
0476       h_L1AlgoNames->Fill(iBit);
0477   }
0478 
0479   //===================
0480   // L1Taus
0481   edm::Handle<l1extra::L1JetParticleCollection> l1TauHandle;
0482   iEvent.getByToken(tok_L1extTauJet_, l1TauHandle);
0483   l1extra::L1JetParticleCollection::const_iterator itr;
0484   for (itr = l1TauHandle->begin(); itr != l1TauHandle->end(); ++itr) {
0485     t_L1TauJetPt->push_back(itr->pt());
0486     t_L1TauJetEta->push_back(itr->eta());
0487     t_L1TauJetPhi->push_back(itr->phi());
0488     if (debugL1Info_) {
0489       edm::LogVerbatim("IsoTrack") << "tauJ p/pt  " << itr->momentum() << " " << itr->pt() << "  eta/phi " << itr->eta()
0490                                    << " " << itr->phi();
0491     }
0492   }
0493 
0494   // L1 Central Jets
0495   edm::Handle<l1extra::L1JetParticleCollection> l1CenJetHandle;
0496   iEvent.getByToken(tok_L1extCenJet_, l1CenJetHandle);
0497   for (itr = l1CenJetHandle->begin(); itr != l1CenJetHandle->end(); ++itr) {
0498     t_L1CenJetPt->push_back(itr->pt());
0499     t_L1CenJetEta->push_back(itr->eta());
0500     t_L1CenJetPhi->push_back(itr->phi());
0501     if (debugL1Info_) {
0502       edm::LogVerbatim("IsoTrack") << "cenJ p/pt     " << itr->momentum() << " " << itr->pt() << "  eta/phi "
0503                                    << itr->eta() << " " << itr->phi();
0504     }
0505   }
0506   // L1 Forward Jets
0507   edm::Handle<l1extra::L1JetParticleCollection> l1FwdJetHandle;
0508   iEvent.getByToken(tok_L1extFwdJet_, l1FwdJetHandle);
0509   for (itr = l1FwdJetHandle->begin(); itr != l1FwdJetHandle->end(); ++itr) {
0510     t_L1FwdJetPt->push_back(itr->pt());
0511     t_L1FwdJetEta->push_back(itr->eta());
0512     t_L1FwdJetPhi->push_back(itr->phi());
0513     if (debugL1Info_) {
0514       edm::LogVerbatim("IsoTrack") << "fwdJ p/pt     " << itr->momentum() << " " << itr->pt() << "  eta/phi "
0515                                    << itr->eta() << " " << itr->phi();
0516     }
0517   }
0518   // L1 Isolated EM onjects
0519   l1extra::L1EmParticleCollection::const_iterator itrEm;
0520   edm::Handle<l1extra::L1EmParticleCollection> l1IsoEmHandle;
0521   iEvent.getByToken(tok_L1Em_, l1IsoEmHandle);
0522   for (itrEm = l1IsoEmHandle->begin(); itrEm != l1IsoEmHandle->end(); ++itrEm) {
0523     t_L1IsoEMPt->push_back(itrEm->pt());
0524     t_L1IsoEMEta->push_back(itrEm->eta());
0525     t_L1IsoEMPhi->push_back(itrEm->phi());
0526     if (debugL1Info_) {
0527       edm::LogVerbatim("IsoTrack") << "isoEm p/pt    " << itrEm->momentum() << " " << itrEm->pt() << "  eta/phi "
0528                                    << itrEm->eta() << " " << itrEm->phi();
0529     }
0530   }
0531   // L1 Non-Isolated EM onjects
0532   edm::Handle<l1extra::L1EmParticleCollection> l1NonIsoEmHandle;
0533   iEvent.getByToken(tok_L1extNonIsoEm_, l1NonIsoEmHandle);
0534   for (itrEm = l1NonIsoEmHandle->begin(); itrEm != l1NonIsoEmHandle->end(); ++itrEm) {
0535     t_L1NonIsoEMPt->push_back(itrEm->pt());
0536     t_L1NonIsoEMEta->push_back(itrEm->eta());
0537     t_L1NonIsoEMPhi->push_back(itrEm->phi());
0538     if (debugL1Info_) {
0539       edm::LogVerbatim("IsoTrack") << "nonIsoEm p/pt " << itrEm->momentum() << " " << itrEm->pt() << "  eta/phi "
0540                                    << itrEm->eta() << " " << itrEm->phi();
0541     }
0542   }
0543 
0544   // L1 Muons
0545   l1extra::L1MuonParticleCollection::const_iterator itrMu;
0546   edm::Handle<l1extra::L1MuonParticleCollection> l1MuHandle;
0547   iEvent.getByToken(tok_L1extMusrc_, l1MuHandle);
0548   for (itrMu = l1MuHandle->begin(); itrMu != l1MuHandle->end(); ++itrMu) {
0549     t_L1MuonPt->push_back(itrMu->pt());
0550     t_L1MuonEta->push_back(itrMu->eta());
0551     t_L1MuonPhi->push_back(itrMu->phi());
0552     if (debugL1Info_) {
0553       edm::LogVerbatim("IsoTrack") << "l1muon p/pt   " << itrMu->momentum() << " " << itrMu->pt() << "  eta/phi "
0554                                    << itrMu->eta() << " " << itrMu->phi();
0555     }
0556   }
0557   //=====================================================================
0558 
0559   GlobalPoint posVec, posECAL;
0560   math::XYZTLorentzVector momVec;
0561   if (verbosity_ > 0)
0562     edm::LogVerbatim("IsoTrack") << "event number " << iEvent.id().event();
0563   if (useHepMC_) {
0564     const HepMC::GenEvent *myGenEvent = hepmc->GetEvent();
0565     std::vector<spr::propagatedGenTrackID> trackIDs = spr::propagateCALO(myGenEvent, pdt, geo, bField, etaMax_, false);
0566 
0567     for (unsigned int indx = 0; indx < trackIDs.size(); ++indx) {
0568       int charge = trackIDs[indx].charge;
0569       HepMC::GenEvent::particle_const_iterator p = trackIDs[indx].trkItr;
0570       momVec = math::XYZTLorentzVector(
0571           (*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
0572       if (verbosity_ > 1)
0573         edm::LogVerbatim("IsoTrack") << "trkIndx " << indx << " pdgid " << trackIDs[indx].pdgId << " charge " << charge
0574                                      << " momVec " << momVec;
0575       // only stable particles avoiding electrons and muons
0576       if (trackIDs[indx].ok && (std::abs(trackIDs[indx].pdgId) < 11 || std::abs(trackIDs[indx].pdgId) >= 21)) {
0577         // consider particles within a phased space
0578         if (momVec.Pt() > ptMin_ && std::abs(momVec.eta()) < etaMax_) {
0579           posVec = GlobalPoint(0.1 * (*p)->production_vertex()->position().x(),
0580                                0.1 * (*p)->production_vertex()->position().y(),
0581                                0.1 * (*p)->production_vertex()->position().z());
0582           posECAL = trackIDs[indx].pointECAL;
0583           fillTrack(posVec, momVec, posECAL, trackIDs[indx].pdgId, trackIDs[indx].okECAL, true);
0584           if (verbosity_ > 1)
0585             edm::LogVerbatim("IsoTrack") << "posECAL " << posECAL << " okECAL " << trackIDs[indx].okECAL << "okHCAL "
0586                                          << trackIDs[indx].okHCAL;
0587           if (trackIDs[indx].okECAL) {
0588             if (std::abs(charge) > 0) {
0589               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 0, 0, isoinfo1x1, false);
0590               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 1, 1, isoinfo3x3, false);
0591               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 3, 3, isoinfo7x7, false);
0592               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 4, 4, isoinfo9x9, false);
0593               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 5, 5, isoinfo11x11, false);
0594               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 7, 7, isoinfo15x15, false);
0595               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 10, 10, isoinfo21x21, false);
0596               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 12, 12, isoinfo25x25, false);
0597               spr::eGenSimInfo(trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 15, 15, isoinfo31x31, false);
0598               spr::eGenSimInfo(trackIDs[indx].detIdECAL,
0599                                p,
0600                                trackIDs,
0601                                geo,
0602                                caloTopology,
0603                                a_mipR_,
0604                                trackIDs[indx].directionECAL,
0605                                isoinfoR,
0606                                false);
0607               spr::eGenSimInfo(trackIDs[indx].detIdECAL,
0608                                p,
0609                                trackIDs,
0610                                geo,
0611                                caloTopology,
0612                                a_neutIsoR_,
0613                                trackIDs[indx].directionECAL,
0614                                isoinfoIsoR,
0615                                false);
0616               if (trackIDs[indx].okHCAL) {
0617                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 0, 0, isoinfoHC1x1, false);
0618                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 1, 1, isoinfoHC3x3, false);
0619                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 2, 2, isoinfoHC5x5, false);
0620                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 3, 3, isoinfoHC7x7, false);
0621                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL,
0622                                  p,
0623                                  trackIDs,
0624                                  geo,
0625                                  theHBHETopology,
0626                                  a_coneR_,
0627                                  trackIDs[indx].directionHCAL,
0628                                  isoinfoHCR,
0629                                  false);
0630                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL,
0631                                  p,
0632                                  trackIDs,
0633                                  geo,
0634                                  theHBHETopology,
0635                                  a_charIsoR_,
0636                                  trackIDs[indx].directionHCAL,
0637                                  isoinfoIsoHCR,
0638                                  false);
0639               }
0640 
0641               bool saveTrack = true;
0642               if (a_Isolation_)
0643                 saveTrack = (isoinfoR.maxNearP < pCutIsolate_);
0644               else
0645                 saveTrack = (isoinfo7x7.maxNearP < pCutIsolate_);
0646               if (saveTrack)
0647                 fillIsolatedTrack(momVec, posECAL, trackIDs[indx].pdgId);
0648             }
0649           }
0650         } else {  // stabale particles within |eta|=2.5
0651           fillTrack(posVec, momVec, posECAL, 0, false, false);
0652         }
0653       }
0654     }
0655 
0656     unsigned int indx;
0657     HepMC::GenEvent::particle_const_iterator p;
0658     for (p = myGenEvent->particles_begin(), indx = 0; p != myGenEvent->particles_end(); ++p, ++indx) {
0659       int pdgId = ((*p)->pdg_id());
0660       int ix = particleCode(pdgId);
0661       if (ix >= 0) {
0662         double pp = (*p)->momentum().rho();
0663         double eta = (*p)->momentum().eta();
0664         h_pEta[ix]->Fill(pp, eta);
0665       }
0666     }
0667   } else {  // loop over gen particles
0668     std::vector<spr::propagatedGenParticleID> trackIDs =
0669         spr::propagateCALO(genParticles, pdt, geo, bField, etaMax_, (verbosity_ > 0));
0670 
0671     for (unsigned int indx = 0; indx < trackIDs.size(); ++indx) {
0672       int charge = trackIDs[indx].charge;
0673       reco::GenParticleCollection::const_iterator p = trackIDs[indx].trkItr;
0674 
0675       momVec = math::XYZTLorentzVector(p->momentum().x(), p->momentum().y(), p->momentum().z(), p->energy());
0676       if (verbosity_ > 1)
0677         edm::LogVerbatim("IsoTrack") << "trkIndx " << indx << " pdgid " << trackIDs[indx].pdgId << " charge " << charge
0678                                      << " momVec " << momVec;
0679       // only stable particles avoiding electrons and muons
0680       if (trackIDs[indx].ok && std::abs(trackIDs[indx].pdgId) > 21) {
0681         // consider particles within a phased space
0682         if (verbosity_ > 1)
0683           edm::LogVerbatim("IsoTrack") << " pt " << momVec.Pt() << " eta " << momVec.eta();
0684         if (momVec.Pt() > ptMin_ && std::abs(momVec.eta()) < etaMax_) {
0685           posVec = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
0686           posECAL = trackIDs[indx].pointECAL;
0687           if (verbosity_ > 0)
0688             edm::LogVerbatim("IsoTrack") << "posECAL " << posECAL << " okECAL " << trackIDs[indx].okECAL << "okHCAL "
0689                                          << trackIDs[indx].okHCAL;
0690           fillTrack(posVec, momVec, posECAL, trackIDs[indx].pdgId, trackIDs[indx].okECAL, true);
0691           if (trackIDs[indx].okECAL) {
0692             if (std::abs(charge) > 0) {
0693               spr::eGenSimInfo(
0694                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 0, 0, isoinfo1x1, verbosity_ > 1);
0695               spr::eGenSimInfo(
0696                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 1, 1, isoinfo3x3, verbosity_ > 0);
0697               spr::eGenSimInfo(
0698                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 3, 3, isoinfo7x7, verbosity_ > 1);
0699               spr::eGenSimInfo(
0700                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 4, 4, isoinfo9x9, verbosity_ > 1);
0701               spr::eGenSimInfo(
0702                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 5, 5, isoinfo11x11, verbosity_ > 1);
0703               spr::eGenSimInfo(
0704                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 7, 7, isoinfo15x15, verbosity_ > 1);
0705               spr::eGenSimInfo(
0706                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 10, 10, isoinfo21x21, verbosity_ > 1);
0707               spr::eGenSimInfo(
0708                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 12, 12, isoinfo25x25, verbosity_ > 1);
0709               spr::eGenSimInfo(
0710                   trackIDs[indx].detIdECAL, p, trackIDs, geo, caloTopology, 15, 15, isoinfo31x31, verbosity_ > 1);
0711               spr::eGenSimInfo(trackIDs[indx].detIdECAL,
0712                                p,
0713                                trackIDs,
0714                                geo,
0715                                caloTopology,
0716                                a_mipR_,
0717                                trackIDs[indx].directionECAL,
0718                                isoinfoR,
0719                                verbosity_ > 1);
0720               spr::eGenSimInfo(trackIDs[indx].detIdECAL,
0721                                p,
0722                                trackIDs,
0723                                geo,
0724                                caloTopology,
0725                                a_neutIsoR_,
0726                                trackIDs[indx].directionECAL,
0727                                isoinfoIsoR,
0728                                verbosity_ > 1);
0729               if (trackIDs[indx].okHCAL) {
0730                 spr::hGenSimInfo(
0731                     trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 0, 0, isoinfoHC1x1, verbosity_ > 1);
0732                 spr::hGenSimInfo(
0733                     trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 1, 1, isoinfoHC3x3, verbosity_ > 1);
0734                 spr::hGenSimInfo(
0735                     trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 2, 2, isoinfoHC5x5, verbosity_ > 1);
0736                 spr::hGenSimInfo(
0737                     trackIDs[indx].detIdHCAL, p, trackIDs, theHBHETopology, 3, 3, isoinfoHC7x7, verbosity_ > 1);
0738                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL,
0739                                  p,
0740                                  trackIDs,
0741                                  geo,
0742                                  theHBHETopology,
0743                                  a_coneR_,
0744                                  trackIDs[indx].directionHCAL,
0745                                  isoinfoHCR,
0746                                  verbosity_ > 1);
0747                 spr::hGenSimInfo(trackIDs[indx].detIdHCAL,
0748                                  p,
0749                                  trackIDs,
0750                                  geo,
0751                                  theHBHETopology,
0752                                  a_charIsoR_,
0753                                  trackIDs[indx].directionHCAL,
0754                                  isoinfoIsoHCR,
0755                                  verbosity_ > 1);
0756               }
0757 
0758               bool saveTrack = true;
0759               if (a_Isolation_)
0760                 saveTrack = (isoinfoIsoR.maxNearP < pCutIsolate_);
0761               else
0762                 saveTrack = (isoinfo7x7.maxNearP < pCutIsolate_);
0763               if (saveTrack)
0764                 fillIsolatedTrack(momVec, posECAL, trackIDs[indx].pdgId);
0765             }
0766           }
0767         } else {  // stabale particles within |eta|=2.5
0768           fillTrack(posVec, momVec, posECAL, 0, false, false);
0769         }
0770       }
0771     }  // loop over gen particles
0772 
0773     unsigned int indx;
0774     reco::GenParticleCollection::const_iterator p;
0775     for (p = genParticles->begin(), indx = 0; p != genParticles->end(); ++p, ++indx) {
0776       int pdgId = (p->pdgId());
0777       int ix = particleCode(pdgId);
0778       if (ix >= 0) {
0779         double pp = (p->momentum()).R();
0780         double eta = (p->momentum()).Eta();
0781         h_pEta[ix]->Fill(pp, eta);
0782       }
0783     }
0784   }
0785 
0786   //t_nEvtProc->push_back(nEventProc);
0787   h_NEventProc->SetBinContent(1, nEventProc);
0788   tree_->Fill();
0789 }
0790 
0791 void IsolatedGenParticles::beginJob() {
0792   nEventProc = 0;
0793 
0794   initL1 = false;
0795 
0796   double tempgen_TH[NPBins_ + 1] = {0.0, 5.0, 12.0, 300.0};
0797   for (int i = 0; i <= NPBins_; i++)
0798     genPartPBins_[i] = tempgen_TH[i];
0799 
0800   double tempgen_Eta[NEtaBins_ + 1] = {0.0, 0.5, 1.1, 1.7, 2.3};
0801   for (int i = 0; i <= NEtaBins_; i++)
0802     genPartEtaBins_[i] = tempgen_Eta[i];
0803 
0804   bookHistograms();
0805 }
0806 
0807 void IsolatedGenParticles::fillTrack(
0808     GlobalPoint &posVec, math::XYZTLorentzVector &momVec, GlobalPoint &posECAL, int pdgId, bool okECAL, bool accept) {
0809   if (accept) {
0810     t_isoTrkPAll->push_back(momVec.P());
0811     t_isoTrkPtAll->push_back(momVec.Pt());
0812     t_isoTrkPhiAll->push_back(momVec.phi());
0813     t_isoTrkEtaAll->push_back(momVec.eta());
0814     t_isoTrkPdgIdAll->push_back(pdgId);
0815     if (okECAL) {
0816       double phi1 = momVec.phi();
0817       double phi2 = (posECAL - posVec).phi();
0818       double dphi = reco::deltaPhi(phi1, phi2);
0819       double deta = momVec.eta() - (posECAL - posVec).eta();
0820       t_isoTrkDPhiAll->push_back(dphi);
0821       t_isoTrkDEtaAll->push_back(deta);
0822     } else {
0823       t_isoTrkDPhiAll->push_back(999.0);
0824       t_isoTrkDEtaAll->push_back(999.0);
0825     }
0826   } else {
0827     t_isoTrkDPhiAll->push_back(-999.0);
0828     t_isoTrkDEtaAll->push_back(-999.0);
0829   }
0830 }
0831 
0832 void IsolatedGenParticles::fillIsolatedTrack(math::XYZTLorentzVector &momVec, GlobalPoint &posECAL, int pdgId) {
0833   t_isoTrkP->push_back(momVec.P());
0834   t_isoTrkPt->push_back(momVec.Pt());
0835   t_isoTrkEne->push_back(momVec.E());
0836   t_isoTrkEta->push_back(momVec.eta());
0837   t_isoTrkPhi->push_back(momVec.phi());
0838   t_isoTrkEtaEC->push_back(posECAL.eta());
0839   t_isoTrkPhiEC->push_back(posECAL.phi());
0840   t_isoTrkPdgId->push_back(pdgId);
0841 
0842   t_maxNearP31x31->push_back(isoinfo31x31.maxNearP);
0843   t_cHadronEne31x31->push_back(isoinfo31x31.cHadronEne);
0844   t_cHadronEne31x31_1->push_back(isoinfo31x31.cHadronEne_[0]);
0845   t_cHadronEne31x31_2->push_back(isoinfo31x31.cHadronEne_[1]);
0846   t_cHadronEne31x31_3->push_back(isoinfo31x31.cHadronEne_[2]);
0847   t_nHadronEne31x31->push_back(isoinfo31x31.nHadronEne);
0848   t_photonEne31x31->push_back(isoinfo31x31.photonEne);
0849   t_eleEne31x31->push_back(isoinfo31x31.eleEne);
0850   t_muEne31x31->push_back(isoinfo31x31.muEne);
0851 
0852   t_maxNearP25x25->push_back(isoinfo25x25.maxNearP);
0853   t_cHadronEne25x25->push_back(isoinfo25x25.cHadronEne);
0854   t_cHadronEne25x25_1->push_back(isoinfo25x25.cHadronEne_[0]);
0855   t_cHadronEne25x25_2->push_back(isoinfo25x25.cHadronEne_[1]);
0856   t_cHadronEne25x25_3->push_back(isoinfo25x25.cHadronEne_[2]);
0857   t_nHadronEne25x25->push_back(isoinfo25x25.nHadronEne);
0858   t_photonEne25x25->push_back(isoinfo25x25.photonEne);
0859   t_eleEne25x25->push_back(isoinfo25x25.eleEne);
0860   t_muEne25x25->push_back(isoinfo25x25.muEne);
0861 
0862   t_maxNearP21x21->push_back(isoinfo21x21.maxNearP);
0863   t_cHadronEne21x21->push_back(isoinfo21x21.cHadronEne);
0864   t_cHadronEne21x21_1->push_back(isoinfo21x21.cHadronEne_[0]);
0865   t_cHadronEne21x21_2->push_back(isoinfo21x21.cHadronEne_[1]);
0866   t_cHadronEne21x21_3->push_back(isoinfo21x21.cHadronEne_[2]);
0867   t_nHadronEne21x21->push_back(isoinfo21x21.nHadronEne);
0868   t_photonEne21x21->push_back(isoinfo21x21.photonEne);
0869   t_eleEne21x21->push_back(isoinfo21x21.eleEne);
0870   t_muEne21x21->push_back(isoinfo21x21.muEne);
0871 
0872   t_maxNearP15x15->push_back(isoinfo15x15.maxNearP);
0873   t_cHadronEne15x15->push_back(isoinfo15x15.cHadronEne);
0874   t_cHadronEne15x15_1->push_back(isoinfo15x15.cHadronEne_[0]);
0875   t_cHadronEne15x15_2->push_back(isoinfo15x15.cHadronEne_[1]);
0876   t_cHadronEne15x15_3->push_back(isoinfo15x15.cHadronEne_[2]);
0877   t_nHadronEne15x15->push_back(isoinfo15x15.nHadronEne);
0878   t_photonEne15x15->push_back(isoinfo15x15.photonEne);
0879   t_eleEne15x15->push_back(isoinfo15x15.eleEne);
0880   t_muEne15x15->push_back(isoinfo15x15.muEne);
0881 
0882   t_maxNearP11x11->push_back(isoinfo11x11.maxNearP);
0883   t_cHadronEne11x11->push_back(isoinfo11x11.cHadronEne);
0884   t_cHadronEne11x11_1->push_back(isoinfo11x11.cHadronEne_[0]);
0885   t_cHadronEne11x11_2->push_back(isoinfo11x11.cHadronEne_[1]);
0886   t_cHadronEne11x11_3->push_back(isoinfo11x11.cHadronEne_[2]);
0887   t_nHadronEne11x11->push_back(isoinfo11x11.nHadronEne);
0888   t_photonEne11x11->push_back(isoinfo11x11.photonEne);
0889   t_eleEne11x11->push_back(isoinfo11x11.eleEne);
0890   t_muEne11x11->push_back(isoinfo11x11.muEne);
0891 
0892   t_maxNearP9x9->push_back(isoinfo9x9.maxNearP);
0893   t_cHadronEne9x9->push_back(isoinfo9x9.cHadronEne);
0894   t_cHadronEne9x9_1->push_back(isoinfo9x9.cHadronEne_[0]);
0895   t_cHadronEne9x9_2->push_back(isoinfo9x9.cHadronEne_[1]);
0896   t_cHadronEne9x9_3->push_back(isoinfo9x9.cHadronEne_[2]);
0897   t_nHadronEne9x9->push_back(isoinfo9x9.nHadronEne);
0898   t_photonEne9x9->push_back(isoinfo9x9.photonEne);
0899   t_eleEne9x9->push_back(isoinfo9x9.eleEne);
0900   t_muEne9x9->push_back(isoinfo9x9.muEne);
0901 
0902   t_maxNearP7x7->push_back(isoinfo7x7.maxNearP);
0903   t_cHadronEne7x7->push_back(isoinfo7x7.cHadronEne);
0904   t_cHadronEne7x7_1->push_back(isoinfo7x7.cHadronEne_[0]);
0905   t_cHadronEne7x7_2->push_back(isoinfo7x7.cHadronEne_[1]);
0906   t_cHadronEne7x7_3->push_back(isoinfo7x7.cHadronEne_[2]);
0907   t_nHadronEne7x7->push_back(isoinfo7x7.nHadronEne);
0908   t_photonEne7x7->push_back(isoinfo7x7.photonEne);
0909   t_eleEne7x7->push_back(isoinfo7x7.eleEne);
0910   t_muEne7x7->push_back(isoinfo7x7.muEne);
0911 
0912   t_maxNearP3x3->push_back(isoinfo3x3.maxNearP);
0913   t_cHadronEne3x3->push_back(isoinfo3x3.cHadronEne);
0914   t_cHadronEne3x3_1->push_back(isoinfo3x3.cHadronEne_[0]);
0915   t_cHadronEne3x3_2->push_back(isoinfo3x3.cHadronEne_[1]);
0916   t_cHadronEne3x3_3->push_back(isoinfo3x3.cHadronEne_[2]);
0917   t_nHadronEne3x3->push_back(isoinfo3x3.nHadronEne);
0918   t_photonEne3x3->push_back(isoinfo3x3.photonEne);
0919   t_eleEne3x3->push_back(isoinfo3x3.eleEne);
0920   t_muEne3x3->push_back(isoinfo3x3.muEne);
0921 
0922   t_maxNearP1x1->push_back(isoinfo1x1.maxNearP);
0923   t_cHadronEne1x1->push_back(isoinfo1x1.cHadronEne);
0924   t_cHadronEne1x1_1->push_back(isoinfo1x1.cHadronEne_[0]);
0925   t_cHadronEne1x1_2->push_back(isoinfo1x1.cHadronEne_[1]);
0926   t_cHadronEne1x1_3->push_back(isoinfo1x1.cHadronEne_[2]);
0927   t_nHadronEne1x1->push_back(isoinfo1x1.nHadronEne);
0928   t_photonEne1x1->push_back(isoinfo1x1.photonEne);
0929   t_eleEne1x1->push_back(isoinfo1x1.eleEne);
0930   t_muEne1x1->push_back(isoinfo1x1.muEne);
0931 
0932   t_maxNearPHC1x1->push_back(isoinfoHC1x1.maxNearP);
0933   t_cHadronEneHC1x1->push_back(isoinfoHC1x1.cHadronEne);
0934   t_cHadronEneHC1x1_1->push_back(isoinfoHC1x1.cHadronEne_[0]);
0935   t_cHadronEneHC1x1_2->push_back(isoinfoHC1x1.cHadronEne_[1]);
0936   t_cHadronEneHC1x1_3->push_back(isoinfoHC1x1.cHadronEne_[2]);
0937   t_nHadronEneHC1x1->push_back(isoinfoHC1x1.nHadronEne);
0938   t_photonEneHC1x1->push_back(isoinfoHC1x1.photonEne);
0939   t_eleEneHC1x1->push_back(isoinfoHC1x1.eleEne);
0940   t_muEneHC1x1->push_back(isoinfoHC1x1.muEne);
0941 
0942   t_maxNearPHC3x3->push_back(isoinfoHC3x3.maxNearP);
0943   t_cHadronEneHC3x3->push_back(isoinfoHC3x3.cHadronEne);
0944   t_cHadronEneHC3x3_1->push_back(isoinfoHC3x3.cHadronEne_[0]);
0945   t_cHadronEneHC3x3_2->push_back(isoinfoHC3x3.cHadronEne_[1]);
0946   t_cHadronEneHC3x3_3->push_back(isoinfoHC3x3.cHadronEne_[2]);
0947   t_nHadronEneHC3x3->push_back(isoinfoHC3x3.nHadronEne);
0948   t_photonEneHC3x3->push_back(isoinfoHC3x3.photonEne);
0949   t_eleEneHC3x3->push_back(isoinfoHC3x3.eleEne);
0950   t_muEneHC3x3->push_back(isoinfoHC3x3.muEne);
0951 
0952   t_maxNearPHC5x5->push_back(isoinfoHC5x5.maxNearP);
0953   t_cHadronEneHC5x5->push_back(isoinfoHC5x5.cHadronEne);
0954   t_cHadronEneHC5x5_1->push_back(isoinfoHC5x5.cHadronEne_[0]);
0955   t_cHadronEneHC5x5_2->push_back(isoinfoHC5x5.cHadronEne_[1]);
0956   t_cHadronEneHC5x5_3->push_back(isoinfoHC5x5.cHadronEne_[2]);
0957   t_nHadronEneHC5x5->push_back(isoinfoHC5x5.nHadronEne);
0958   t_photonEneHC5x5->push_back(isoinfoHC5x5.photonEne);
0959   t_eleEneHC5x5->push_back(isoinfoHC5x5.eleEne);
0960   t_muEneHC5x5->push_back(isoinfoHC5x5.muEne);
0961 
0962   t_maxNearPHC7x7->push_back(isoinfoHC7x7.maxNearP);
0963   t_cHadronEneHC7x7->push_back(isoinfoHC7x7.cHadronEne);
0964   t_cHadronEneHC7x7_1->push_back(isoinfoHC7x7.cHadronEne_[0]);
0965   t_cHadronEneHC7x7_2->push_back(isoinfoHC7x7.cHadronEne_[1]);
0966   t_cHadronEneHC7x7_3->push_back(isoinfoHC7x7.cHadronEne_[2]);
0967   t_nHadronEneHC7x7->push_back(isoinfoHC7x7.nHadronEne);
0968   t_photonEneHC7x7->push_back(isoinfoHC7x7.photonEne);
0969   t_eleEneHC7x7->push_back(isoinfoHC7x7.eleEne);
0970   t_muEneHC7x7->push_back(isoinfoHC7x7.muEne);
0971 
0972   t_maxNearPR->push_back(isoinfoR.maxNearP);
0973   t_cHadronEneR->push_back(isoinfoR.cHadronEne);
0974   t_cHadronEneR_1->push_back(isoinfoR.cHadronEne_[0]);
0975   t_cHadronEneR_2->push_back(isoinfoR.cHadronEne_[1]);
0976   t_cHadronEneR_3->push_back(isoinfoR.cHadronEne_[2]);
0977   t_nHadronEneR->push_back(isoinfoR.nHadronEne);
0978   t_photonEneR->push_back(isoinfoR.photonEne);
0979   t_eleEneR->push_back(isoinfoR.eleEne);
0980   t_muEneR->push_back(isoinfoR.muEne);
0981 
0982   t_maxNearPIsoR->push_back(isoinfoIsoR.maxNearP);
0983   t_cHadronEneIsoR->push_back(isoinfoIsoR.cHadronEne);
0984   t_cHadronEneIsoR_1->push_back(isoinfoIsoR.cHadronEne_[0]);
0985   t_cHadronEneIsoR_2->push_back(isoinfoIsoR.cHadronEne_[1]);
0986   t_cHadronEneIsoR_3->push_back(isoinfoIsoR.cHadronEne_[2]);
0987   t_nHadronEneIsoR->push_back(isoinfoIsoR.nHadronEne);
0988   t_photonEneIsoR->push_back(isoinfoIsoR.photonEne);
0989   t_eleEneIsoR->push_back(isoinfoIsoR.eleEne);
0990   t_muEneIsoR->push_back(isoinfoIsoR.muEne);
0991 
0992   t_maxNearPHCR->push_back(isoinfoHCR.maxNearP);
0993   t_cHadronEneHCR->push_back(isoinfoHCR.cHadronEne);
0994   t_cHadronEneHCR_1->push_back(isoinfoHCR.cHadronEne_[0]);
0995   t_cHadronEneHCR_2->push_back(isoinfoHCR.cHadronEne_[1]);
0996   t_cHadronEneHCR_3->push_back(isoinfoHCR.cHadronEne_[2]);
0997   t_nHadronEneHCR->push_back(isoinfoHCR.nHadronEne);
0998   t_photonEneHCR->push_back(isoinfoHCR.photonEne);
0999   t_eleEneHCR->push_back(isoinfoHCR.eleEne);
1000   t_muEneHCR->push_back(isoinfoHCR.muEne);
1001 
1002   t_maxNearPIsoHCR->push_back(isoinfoIsoHCR.maxNearP);
1003   t_cHadronEneIsoHCR->push_back(isoinfoIsoHCR.cHadronEne);
1004   t_cHadronEneIsoHCR_1->push_back(isoinfoIsoHCR.cHadronEne_[0]);
1005   t_cHadronEneIsoHCR_2->push_back(isoinfoIsoHCR.cHadronEne_[1]);
1006   t_cHadronEneIsoHCR_3->push_back(isoinfoIsoHCR.cHadronEne_[2]);
1007   t_nHadronEneIsoHCR->push_back(isoinfoIsoHCR.nHadronEne);
1008   t_photonEneIsoHCR->push_back(isoinfoIsoHCR.photonEne);
1009   t_eleEneIsoHCR->push_back(isoinfoIsoHCR.eleEne);
1010   t_muEneIsoHCR->push_back(isoinfoIsoHCR.muEne);
1011 }
1012 
1013 void IsolatedGenParticles::bookHistograms() {
1014   edm::Service<TFileService> fs;
1015   //char hname[100], htit[100];
1016 
1017   h_NEventProc = fs->make<TH1I>("h_NEventProc", "h_NEventProc", 2, -0.5, 0.5);
1018   h_L1AlgoNames = fs->make<TH1I>("h_L1AlgoNames", "h_L1AlgoNames:Bin Labels", 128, -0.5, 127.5);
1019 
1020   double pBin[PBins_ + 1] = {0.0,   2.0,   4.0,   6.0,   8.0,   10.0,  20.0,  30.0,  40.0,  50.0,  60.0,
1021                              70.0,  80.0,  90.0,  100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0,
1022                              500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0, 850.0, 900.0, 950.0, 1000.0};
1023   double etaBin[EtaBins_ + 1] = {-3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8,
1024                                  -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5,
1025                                  -0.4, -0.3, -0.2, -0.1, 0.0,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,
1026                                  0.9,  1.0,  1.1,  1.2,  1.3,  1.4,  1.5,  1.6,  1.7,  1.8,  1.9,  2.0,  2.1,
1027                                  2.2,  2.3,  2.4,  2.5,  2.6,  2.7,  2.8,  2.9,  3.0};
1028   std::string particle[Particles] = {
1029       "electron", "positron", "#gamma", "#pi^+", "#pi^-", "K^+", "K^-", "p", "n", "pbar", "nbar", "K^0_L"};
1030   TFileDirectory dir1 = fs->mkdir("pEta");
1031   char name[20], title[50];
1032   for (int i = 0; i < Particles; ++i) {
1033     sprintf(name, "pEta%d", i);
1034     sprintf(title, "#eta vs momentum for %s", particle[i].c_str());
1035     h_pEta[i] = dir1.make<TH2D>(name, title, PBins_, pBin, EtaBins_, etaBin);
1036   }
1037 
1038   // build the tree
1039   tree_ = fs->make<TTree>("tree_", "tree");
1040 
1041   t_isoTrkPAll = new std::vector<double>();
1042   t_isoTrkPtAll = new std::vector<double>();
1043   t_isoTrkPhiAll = new std::vector<double>();
1044   t_isoTrkEtaAll = new std::vector<double>();
1045   t_isoTrkDPhiAll = new std::vector<double>();
1046   t_isoTrkDEtaAll = new std::vector<double>();
1047   t_isoTrkPdgIdAll = new std::vector<double>();
1048 
1049   t_isoTrkP = new std::vector<double>();
1050   t_isoTrkPt = new std::vector<double>();
1051   t_isoTrkEne = new std::vector<double>();
1052   t_isoTrkEta = new std::vector<double>();
1053   t_isoTrkPhi = new std::vector<double>();
1054   t_isoTrkEtaEC = new std::vector<double>();
1055   t_isoTrkPhiEC = new std::vector<double>();
1056   t_isoTrkPdgId = new std::vector<double>();
1057 
1058   t_maxNearP31x31 = new std::vector<double>();
1059   t_cHadronEne31x31 = new std::vector<double>();
1060   t_cHadronEne31x31_1 = new std::vector<double>();
1061   t_cHadronEne31x31_2 = new std::vector<double>();
1062   t_cHadronEne31x31_3 = new std::vector<double>();
1063   t_nHadronEne31x31 = new std::vector<double>();
1064   t_photonEne31x31 = new std::vector<double>();
1065   t_eleEne31x31 = new std::vector<double>();
1066   t_muEne31x31 = new std::vector<double>();
1067 
1068   t_maxNearP25x25 = new std::vector<double>();
1069   t_cHadronEne25x25 = new std::vector<double>();
1070   t_cHadronEne25x25_1 = new std::vector<double>();
1071   t_cHadronEne25x25_2 = new std::vector<double>();
1072   t_cHadronEne25x25_3 = new std::vector<double>();
1073   t_nHadronEne25x25 = new std::vector<double>();
1074   t_photonEne25x25 = new std::vector<double>();
1075   t_eleEne25x25 = new std::vector<double>();
1076   t_muEne25x25 = new std::vector<double>();
1077 
1078   t_maxNearP21x21 = new std::vector<double>();
1079   t_cHadronEne21x21 = new std::vector<double>();
1080   t_cHadronEne21x21_1 = new std::vector<double>();
1081   t_cHadronEne21x21_2 = new std::vector<double>();
1082   t_cHadronEne21x21_3 = new std::vector<double>();
1083   t_nHadronEne21x21 = new std::vector<double>();
1084   t_photonEne21x21 = new std::vector<double>();
1085   t_eleEne21x21 = new std::vector<double>();
1086   t_muEne21x21 = new std::vector<double>();
1087 
1088   t_maxNearP15x15 = new std::vector<double>();
1089   t_cHadronEne15x15 = new std::vector<double>();
1090   t_cHadronEne15x15_1 = new std::vector<double>();
1091   t_cHadronEne15x15_2 = new std::vector<double>();
1092   t_cHadronEne15x15_3 = new std::vector<double>();
1093   t_nHadronEne15x15 = new std::vector<double>();
1094   t_photonEne15x15 = new std::vector<double>();
1095   t_eleEne15x15 = new std::vector<double>();
1096   t_muEne15x15 = new std::vector<double>();
1097 
1098   t_maxNearP11x11 = new std::vector<double>();
1099   t_cHadronEne11x11 = new std::vector<double>();
1100   t_cHadronEne11x11_1 = new std::vector<double>();
1101   t_cHadronEne11x11_2 = new std::vector<double>();
1102   t_cHadronEne11x11_3 = new std::vector<double>();
1103   t_nHadronEne11x11 = new std::vector<double>();
1104   t_photonEne11x11 = new std::vector<double>();
1105   t_eleEne11x11 = new std::vector<double>();
1106   t_muEne11x11 = new std::vector<double>();
1107 
1108   t_maxNearP9x9 = new std::vector<double>();
1109   t_cHadronEne9x9 = new std::vector<double>();
1110   t_cHadronEne9x9_1 = new std::vector<double>();
1111   t_cHadronEne9x9_2 = new std::vector<double>();
1112   t_cHadronEne9x9_3 = new std::vector<double>();
1113   t_nHadronEne9x9 = new std::vector<double>();
1114   t_photonEne9x9 = new std::vector<double>();
1115   t_eleEne9x9 = new std::vector<double>();
1116   t_muEne9x9 = new std::vector<double>();
1117 
1118   t_maxNearP7x7 = new std::vector<double>();
1119   t_cHadronEne7x7 = new std::vector<double>();
1120   t_cHadronEne7x7_1 = new std::vector<double>();
1121   t_cHadronEne7x7_2 = new std::vector<double>();
1122   t_cHadronEne7x7_3 = new std::vector<double>();
1123   t_nHadronEne7x7 = new std::vector<double>();
1124   t_photonEne7x7 = new std::vector<double>();
1125   t_eleEne7x7 = new std::vector<double>();
1126   t_muEne7x7 = new std::vector<double>();
1127 
1128   t_maxNearP3x3 = new std::vector<double>();
1129   t_cHadronEne3x3 = new std::vector<double>();
1130   t_cHadronEne3x3_1 = new std::vector<double>();
1131   t_cHadronEne3x3_2 = new std::vector<double>();
1132   t_cHadronEne3x3_3 = new std::vector<double>();
1133   t_nHadronEne3x3 = new std::vector<double>();
1134   t_photonEne3x3 = new std::vector<double>();
1135   t_eleEne3x3 = new std::vector<double>();
1136   t_muEne3x3 = new std::vector<double>();
1137 
1138   t_maxNearP1x1 = new std::vector<double>();
1139   t_cHadronEne1x1 = new std::vector<double>();
1140   t_cHadronEne1x1_1 = new std::vector<double>();
1141   t_cHadronEne1x1_2 = new std::vector<double>();
1142   t_cHadronEne1x1_3 = new std::vector<double>();
1143   t_nHadronEne1x1 = new std::vector<double>();
1144   t_photonEne1x1 = new std::vector<double>();
1145   t_eleEne1x1 = new std::vector<double>();
1146   t_muEne1x1 = new std::vector<double>();
1147 
1148   t_maxNearPHC1x1 = new std::vector<double>();
1149   t_cHadronEneHC1x1 = new std::vector<double>();
1150   t_cHadronEneHC1x1_1 = new std::vector<double>();
1151   t_cHadronEneHC1x1_2 = new std::vector<double>();
1152   t_cHadronEneHC1x1_3 = new std::vector<double>();
1153   t_nHadronEneHC1x1 = new std::vector<double>();
1154   t_photonEneHC1x1 = new std::vector<double>();
1155   t_eleEneHC1x1 = new std::vector<double>();
1156   t_muEneHC1x1 = new std::vector<double>();
1157 
1158   t_maxNearPHC3x3 = new std::vector<double>();
1159   t_cHadronEneHC3x3 = new std::vector<double>();
1160   t_cHadronEneHC3x3_1 = new std::vector<double>();
1161   t_cHadronEneHC3x3_2 = new std::vector<double>();
1162   t_cHadronEneHC3x3_3 = new std::vector<double>();
1163   t_nHadronEneHC3x3 = new std::vector<double>();
1164   t_photonEneHC3x3 = new std::vector<double>();
1165   t_eleEneHC3x3 = new std::vector<double>();
1166   t_muEneHC3x3 = new std::vector<double>();
1167 
1168   t_maxNearPHC5x5 = new std::vector<double>();
1169   t_cHadronEneHC5x5 = new std::vector<double>();
1170   t_cHadronEneHC5x5_1 = new std::vector<double>();
1171   t_cHadronEneHC5x5_2 = new std::vector<double>();
1172   t_cHadronEneHC5x5_3 = new std::vector<double>();
1173   t_nHadronEneHC5x5 = new std::vector<double>();
1174   t_photonEneHC5x5 = new std::vector<double>();
1175   t_eleEneHC5x5 = new std::vector<double>();
1176   t_muEneHC5x5 = new std::vector<double>();
1177 
1178   t_maxNearPHC7x7 = new std::vector<double>();
1179   t_cHadronEneHC7x7 = new std::vector<double>();
1180   t_cHadronEneHC7x7_1 = new std::vector<double>();
1181   t_cHadronEneHC7x7_2 = new std::vector<double>();
1182   t_cHadronEneHC7x7_3 = new std::vector<double>();
1183   t_nHadronEneHC7x7 = new std::vector<double>();
1184   t_photonEneHC7x7 = new std::vector<double>();
1185   t_eleEneHC7x7 = new std::vector<double>();
1186   t_muEneHC7x7 = new std::vector<double>();
1187 
1188   t_maxNearPR = new std::vector<double>();
1189   t_cHadronEneR = new std::vector<double>();
1190   t_cHadronEneR_1 = new std::vector<double>();
1191   t_cHadronEneR_2 = new std::vector<double>();
1192   t_cHadronEneR_3 = new std::vector<double>();
1193   t_nHadronEneR = new std::vector<double>();
1194   t_photonEneR = new std::vector<double>();
1195   t_eleEneR = new std::vector<double>();
1196   t_muEneR = new std::vector<double>();
1197 
1198   t_maxNearPIsoR = new std::vector<double>();
1199   t_cHadronEneIsoR = new std::vector<double>();
1200   t_cHadronEneIsoR_1 = new std::vector<double>();
1201   t_cHadronEneIsoR_2 = new std::vector<double>();
1202   t_cHadronEneIsoR_3 = new std::vector<double>();
1203   t_nHadronEneIsoR = new std::vector<double>();
1204   t_photonEneIsoR = new std::vector<double>();
1205   t_eleEneIsoR = new std::vector<double>();
1206   t_muEneIsoR = new std::vector<double>();
1207 
1208   t_maxNearPHCR = new std::vector<double>();
1209   t_cHadronEneHCR = new std::vector<double>();
1210   t_cHadronEneHCR_1 = new std::vector<double>();
1211   t_cHadronEneHCR_2 = new std::vector<double>();
1212   t_cHadronEneHCR_3 = new std::vector<double>();
1213   t_nHadronEneHCR = new std::vector<double>();
1214   t_photonEneHCR = new std::vector<double>();
1215   t_eleEneHCR = new std::vector<double>();
1216   t_muEneHCR = new std::vector<double>();
1217 
1218   t_maxNearPIsoHCR = new std::vector<double>();
1219   t_cHadronEneIsoHCR = new std::vector<double>();
1220   t_cHadronEneIsoHCR_1 = new std::vector<double>();
1221   t_cHadronEneIsoHCR_2 = new std::vector<double>();
1222   t_cHadronEneIsoHCR_3 = new std::vector<double>();
1223   t_nHadronEneIsoHCR = new std::vector<double>();
1224   t_photonEneIsoHCR = new std::vector<double>();
1225   t_eleEneIsoHCR = new std::vector<double>();
1226   t_muEneIsoHCR = new std::vector<double>();
1227 
1228   //----- L1Trigger
1229   t_L1Decision = new std::vector<int>();
1230   t_L1CenJetPt = new std::vector<double>();
1231   t_L1CenJetEta = new std::vector<double>();
1232   t_L1CenJetPhi = new std::vector<double>();
1233   t_L1FwdJetPt = new std::vector<double>();
1234   t_L1FwdJetEta = new std::vector<double>();
1235   t_L1FwdJetPhi = new std::vector<double>();
1236   t_L1TauJetPt = new std::vector<double>();
1237   t_L1TauJetEta = new std::vector<double>();
1238   t_L1TauJetPhi = new std::vector<double>();
1239   t_L1MuonPt = new std::vector<double>();
1240   t_L1MuonEta = new std::vector<double>();
1241   t_L1MuonPhi = new std::vector<double>();
1242   t_L1IsoEMPt = new std::vector<double>();
1243   t_L1IsoEMEta = new std::vector<double>();
1244   t_L1IsoEMPhi = new std::vector<double>();
1245   t_L1NonIsoEMPt = new std::vector<double>();
1246   t_L1NonIsoEMEta = new std::vector<double>();
1247   t_L1NonIsoEMPhi = new std::vector<double>();
1248   t_L1METPt = new std::vector<double>();
1249   t_L1METEta = new std::vector<double>();
1250   t_L1METPhi = new std::vector<double>();
1251 
1252   //tree_->Branch("t_nEvtProc",          "std::vector<int>",    &t_nEvtProc);
1253 
1254   tree_->Branch("t_isoTrkPAll", "std::vector<double>", &t_isoTrkPAll);
1255   tree_->Branch("t_isoTrkPtAll", "std::vector<double>", &t_isoTrkPtAll);
1256   tree_->Branch("t_isoTrkPhiAll", "std::vector<double>", &t_isoTrkPhiAll);
1257   tree_->Branch("t_isoTrkEtaAll", "std::vector<double>", &t_isoTrkEtaAll);
1258   tree_->Branch("t_isoTrkDPhiAll", "std::vector<double>", &t_isoTrkDPhiAll);
1259   tree_->Branch("t_isoTrkDEtaAll", "std::vector<double>", &t_isoTrkDEtaAll);
1260   tree_->Branch("t_isoTrkPdgIdAll", "std::vector<double>", &t_isoTrkPdgIdAll);
1261 
1262   tree_->Branch("t_isoTrkP", "std::vector<double>", &t_isoTrkP);
1263   tree_->Branch("t_isoTrkPt", "std::vector<double>", &t_isoTrkPt);
1264   tree_->Branch("t_isoTrkEne", "std::vector<double>", &t_isoTrkEne);
1265   tree_->Branch("t_isoTrkEta", "std::vector<double>", &t_isoTrkEta);
1266   tree_->Branch("t_isoTrkPhi", "std::vector<double>", &t_isoTrkPhi);
1267   tree_->Branch("t_isoTrkEtaEC", "std::vector<double>", &t_isoTrkEtaEC);
1268   tree_->Branch("t_isoTrkPhiEC", "std::vector<double>", &t_isoTrkPhiEC);
1269   tree_->Branch("t_isoTrkPdgId", "std::vector<double>", &t_isoTrkPdgId);
1270 
1271   tree_->Branch("t_maxNearP31x31", "std::vector<double>", &t_maxNearP31x31);
1272   tree_->Branch("t_cHadronEne31x31", "std::vector<double>", &t_cHadronEne31x31);
1273   tree_->Branch("t_cHadronEne31x31_1", "std::vector<double>", &t_cHadronEne31x31_1);
1274   tree_->Branch("t_cHadronEne31x31_2", "std::vector<double>", &t_cHadronEne31x31_2);
1275   tree_->Branch("t_cHadronEne31x31_3", "std::vector<double>", &t_cHadronEne31x31_3);
1276   tree_->Branch("t_nHadronEne31x31", "std::vector<double>", &t_nHadronEne31x31);
1277   tree_->Branch("t_photonEne31x31", "std::vector<double>", &t_photonEne31x31);
1278   tree_->Branch("t_eleEne31x31", "std::vector<double>", &t_eleEne31x31);
1279   tree_->Branch("t_muEne31x31", "std::vector<double>", &t_muEne31x31);
1280 
1281   tree_->Branch("t_maxNearP25x25", "std::vector<double>", &t_maxNearP25x25);
1282   tree_->Branch("t_cHadronEne25x25", "std::vector<double>", &t_cHadronEne25x25);
1283   tree_->Branch("t_cHadronEne25x25_1", "std::vector<double>", &t_cHadronEne25x25_1);
1284   tree_->Branch("t_cHadronEne25x25_2", "std::vector<double>", &t_cHadronEne25x25_2);
1285   tree_->Branch("t_cHadronEne25x25_3", "std::vector<double>", &t_cHadronEne25x25_3);
1286   tree_->Branch("t_nHadronEne25x25", "std::vector<double>", &t_nHadronEne25x25);
1287   tree_->Branch("t_photonEne25x25", "std::vector<double>", &t_photonEne25x25);
1288   tree_->Branch("t_eleEne25x25", "std::vector<double>", &t_eleEne25x25);
1289   tree_->Branch("t_muEne25x25", "std::vector<double>", &t_muEne25x25);
1290 
1291   tree_->Branch("t_maxNearP21x21", "std::vector<double>", &t_maxNearP21x21);
1292   tree_->Branch("t_cHadronEne21x21", "std::vector<double>", &t_cHadronEne21x21);
1293   tree_->Branch("t_cHadronEne21x21_1", "std::vector<double>", &t_cHadronEne21x21_1);
1294   tree_->Branch("t_cHadronEne21x21_2", "std::vector<double>", &t_cHadronEne21x21_2);
1295   tree_->Branch("t_cHadronEne21x21_3", "std::vector<double>", &t_cHadronEne21x21_3);
1296   tree_->Branch("t_nHadronEne21x21", "std::vector<double>", &t_nHadronEne21x21);
1297   tree_->Branch("t_photonEne21x21", "std::vector<double>", &t_photonEne21x21);
1298   tree_->Branch("t_eleEne21x21", "std::vector<double>", &t_eleEne21x21);
1299   tree_->Branch("t_muEne21x21", "std::vector<double>", &t_muEne21x21);
1300 
1301   tree_->Branch("t_maxNearP15x15", "std::vector<double>", &t_maxNearP15x15);
1302   tree_->Branch("t_cHadronEne15x15", "std::vector<double>", &t_cHadronEne15x15);
1303   tree_->Branch("t_cHadronEne15x15_1", "std::vector<double>", &t_cHadronEne15x15_1);
1304   tree_->Branch("t_cHadronEne15x15_2", "std::vector<double>", &t_cHadronEne15x15_2);
1305   tree_->Branch("t_cHadronEne15x15_3", "std::vector<double>", &t_cHadronEne15x15_3);
1306   tree_->Branch("t_nHadronEne15x15", "std::vector<double>", &t_nHadronEne15x15);
1307   tree_->Branch("t_photonEne15x15", "std::vector<double>", &t_photonEne15x15);
1308   tree_->Branch("t_eleEne15x15", "std::vector<double>", &t_eleEne15x15);
1309   tree_->Branch("t_muEne15x15", "std::vector<double>", &t_muEne15x15);
1310 
1311   tree_->Branch("t_maxNearP11x11", "std::vector<double>", &t_maxNearP11x11);
1312   tree_->Branch("t_cHadronEne11x11", "std::vector<double>", &t_cHadronEne11x11);
1313   tree_->Branch("t_cHadronEne11x11_1", "std::vector<double>", &t_cHadronEne11x11_1);
1314   tree_->Branch("t_cHadronEne11x11_2", "std::vector<double>", &t_cHadronEne11x11_2);
1315   tree_->Branch("t_cHadronEne11x11_3", "std::vector<double>", &t_cHadronEne11x11_3);
1316   tree_->Branch("t_nHadronEne11x11", "std::vector<double>", &t_nHadronEne11x11);
1317   tree_->Branch("t_photonEne11x11", "std::vector<double>", &t_photonEne11x11);
1318   tree_->Branch("t_eleEne11x11", "std::vector<double>", &t_eleEne11x11);
1319   tree_->Branch("t_muEne11x11", "std::vector<double>", &t_muEne11x11);
1320 
1321   tree_->Branch("t_maxNearP9x9", "std::vector<double>", &t_maxNearP9x9);
1322   tree_->Branch("t_cHadronEne9x9", "std::vector<double>", &t_cHadronEne9x9);
1323   tree_->Branch("t_cHadronEne9x9_1", "std::vector<double>", &t_cHadronEne9x9_1);
1324   tree_->Branch("t_cHadronEne9x9_2", "std::vector<double>", &t_cHadronEne9x9_2);
1325   tree_->Branch("t_cHadronEne9x9_3", "std::vector<double>", &t_cHadronEne9x9_3);
1326   tree_->Branch("t_nHadronEne9x9", "std::vector<double>", &t_nHadronEne9x9);
1327   tree_->Branch("t_photonEne9x9", "std::vector<double>", &t_photonEne9x9);
1328   tree_->Branch("t_eleEne9x9", "std::vector<double>", &t_eleEne9x9);
1329   tree_->Branch("t_muEne9x9", "std::vector<double>", &t_muEne9x9);
1330 
1331   tree_->Branch("t_maxNearP7x7", "std::vector<double>", &t_maxNearP7x7);
1332   tree_->Branch("t_cHadronEne7x7", "std::vector<double>", &t_cHadronEne7x7);
1333   tree_->Branch("t_cHadronEne7x7_1", "std::vector<double>", &t_cHadronEne7x7_1);
1334   tree_->Branch("t_cHadronEne7x7_2", "std::vector<double>", &t_cHadronEne7x7_2);
1335   tree_->Branch("t_cHadronEne7x7_3", "std::vector<double>", &t_cHadronEne7x7_3);
1336   tree_->Branch("t_nHadronEne7x7", "std::vector<double>", &t_nHadronEne7x7);
1337   tree_->Branch("t_photonEne7x7", "std::vector<double>", &t_photonEne7x7);
1338   tree_->Branch("t_eleEne7x7", "std::vector<double>", &t_eleEne7x7);
1339   tree_->Branch("t_muEne7x7", "std::vector<double>", &t_muEne7x7);
1340 
1341   tree_->Branch("t_maxNearP3x3", "std::vector<double>", &t_maxNearP3x3);
1342   tree_->Branch("t_cHadronEne3x3", "std::vector<double>", &t_cHadronEne3x3);
1343   tree_->Branch("t_cHadronEne3x3_1", "std::vector<double>", &t_cHadronEne3x3_1);
1344   tree_->Branch("t_cHadronEne3x3_2", "std::vector<double>", &t_cHadronEne3x3_2);
1345   tree_->Branch("t_cHadronEne3x3_3", "std::vector<double>", &t_cHadronEne3x3_3);
1346   tree_->Branch("t_nHadronEne3x3", "std::vector<double>", &t_nHadronEne3x3);
1347   tree_->Branch("t_photonEne3x3", "std::vector<double>", &t_photonEne3x3);
1348   tree_->Branch("t_eleEne3x3", "std::vector<double>", &t_eleEne3x3);
1349   tree_->Branch("t_muEne3x3", "std::vector<double>", &t_muEne3x3);
1350 
1351   tree_->Branch("t_maxNearP1x1", "std::vector<double>", &t_maxNearP1x1);
1352   tree_->Branch("t_cHadronEne1x1", "std::vector<double>", &t_cHadronEne1x1);
1353   tree_->Branch("t_cHadronEne1x1_1", "std::vector<double>", &t_cHadronEne1x1_1);
1354   tree_->Branch("t_cHadronEne1x1_2", "std::vector<double>", &t_cHadronEne1x1_2);
1355   tree_->Branch("t_cHadronEne1x1_3", "std::vector<double>", &t_cHadronEne1x1_3);
1356   tree_->Branch("t_nHadronEne1x1", "std::vector<double>", &t_nHadronEne1x1);
1357   tree_->Branch("t_photonEne1x1", "std::vector<double>", &t_photonEne1x1);
1358   tree_->Branch("t_eleEne1x1", "std::vector<double>", &t_eleEne1x1);
1359   tree_->Branch("t_muEne1x1", "std::vector<double>", &t_muEne1x1);
1360 
1361   tree_->Branch("t_maxNearPHC1x1", "std::vector<double>", &t_maxNearPHC1x1);
1362   tree_->Branch("t_cHadronEneHC1x1", "std::vector<double>", &t_cHadronEneHC1x1);
1363   tree_->Branch("t_cHadronEneHC1x1_1", "std::vector<double>", &t_cHadronEneHC1x1_1);
1364   tree_->Branch("t_cHadronEneHC1x1_2", "std::vector<double>", &t_cHadronEneHC1x1_2);
1365   tree_->Branch("t_cHadronEneHC1x1_3", "std::vector<double>", &t_cHadronEneHC1x1_3);
1366   tree_->Branch("t_nHadronEneHC1x1", "std::vector<double>", &t_nHadronEneHC1x1);
1367   tree_->Branch("t_photonEneHC1x1", "std::vector<double>", &t_photonEneHC1x1);
1368   tree_->Branch("t_eleEneHC1x1", "std::vector<double>", &t_eleEneHC1x1);
1369   tree_->Branch("t_muEneHC1x1", "std::vector<double>", &t_muEneHC1x1);
1370 
1371   tree_->Branch("t_maxNearPHC3x3", "std::vector<double>", &t_maxNearPHC3x3);
1372   tree_->Branch("t_cHadronEneHC3x3", "std::vector<double>", &t_cHadronEneHC3x3);
1373   tree_->Branch("t_cHadronEneHC3x3_1", "std::vector<double>", &t_cHadronEneHC3x3_1);
1374   tree_->Branch("t_cHadronEneHC3x3_2", "std::vector<double>", &t_cHadronEneHC3x3_2);
1375   tree_->Branch("t_cHadronEneHC3x3_3", "std::vector<double>", &t_cHadronEneHC3x3_3);
1376   tree_->Branch("t_nHadronEneHC3x3", "std::vector<double>", &t_nHadronEneHC3x3);
1377   tree_->Branch("t_photonEneHC3x3", "std::vector<double>", &t_photonEneHC3x3);
1378   tree_->Branch("t_eleEneHC3x3", "std::vector<double>", &t_eleEneHC3x3);
1379   tree_->Branch("t_muEneHC3x3", "std::vector<double>", &t_muEneHC3x3);
1380 
1381   tree_->Branch("t_maxNearPHC5x5", "std::vector<double>", &t_maxNearPHC5x5);
1382   tree_->Branch("t_cHadronEneHC5x5", "std::vector<double>", &t_cHadronEneHC5x5);
1383   tree_->Branch("t_cHadronEneHC5x5_1", "std::vector<double>", &t_cHadronEneHC5x5_1);
1384   tree_->Branch("t_cHadronEneHC5x5_2", "std::vector<double>", &t_cHadronEneHC5x5_2);
1385   tree_->Branch("t_cHadronEneHC5x5_3", "std::vector<double>", &t_cHadronEneHC5x5_3);
1386   tree_->Branch("t_nHadronEneHC5x5", "std::vector<double>", &t_nHadronEneHC5x5);
1387   tree_->Branch("t_photonEneHC5x5", "std::vector<double>", &t_photonEneHC5x5);
1388   tree_->Branch("t_eleEneHC5x5", "std::vector<double>", &t_eleEneHC5x5);
1389   tree_->Branch("t_muEneHC5x5", "std::vector<double>", &t_muEneHC5x5);
1390 
1391   tree_->Branch("t_maxNearPHC7x7", "std::vector<double>", &t_maxNearPHC7x7);
1392   tree_->Branch("t_cHadronEneHC7x7", "std::vector<double>", &t_cHadronEneHC7x7);
1393   tree_->Branch("t_cHadronEneHC7x7_1", "std::vector<double>", &t_cHadronEneHC7x7_1);
1394   tree_->Branch("t_cHadronEneHC7x7_2", "std::vector<double>", &t_cHadronEneHC7x7_2);
1395   tree_->Branch("t_cHadronEneHC7x7_3", "std::vector<double>", &t_cHadronEneHC7x7_3);
1396   tree_->Branch("t_nHadronEneHC7x7", "std::vector<double>", &t_nHadronEneHC7x7);
1397   tree_->Branch("t_photonEneHC7x7", "std::vector<double>", &t_photonEneHC7x7);
1398   tree_->Branch("t_eleEneHC7x7", "std::vector<double>", &t_eleEneHC7x7);
1399   tree_->Branch("t_muEneHC7x7", "std::vector<double>", &t_muEneHC7x7);
1400 
1401   tree_->Branch("t_maxNearPR", "std::vector<double>", &t_maxNearPR);
1402   tree_->Branch("t_cHadronEneR", "std::vector<double>", &t_cHadronEneR);
1403   tree_->Branch("t_cHadronEneR_1", "std::vector<double>", &t_cHadronEneR_1);
1404   tree_->Branch("t_cHadronEneR_2", "std::vector<double>", &t_cHadronEneR_2);
1405   tree_->Branch("t_cHadronEneR_3", "std::vector<double>", &t_cHadronEneR_3);
1406   tree_->Branch("t_nHadronEneR", "std::vector<double>", &t_nHadronEneR);
1407   tree_->Branch("t_photonEneR", "std::vector<double>", &t_photonEneR);
1408   tree_->Branch("t_eleEneR", "std::vector<double>", &t_eleEneR);
1409   tree_->Branch("t_muEneR", "std::vector<double>", &t_muEneR);
1410 
1411   tree_->Branch("t_maxNearPIsoR", "std::vector<double>", &t_maxNearPIsoR);
1412   tree_->Branch("t_cHadronEneIsoR", "std::vector<double>", &t_cHadronEneIsoR);
1413   tree_->Branch("t_cHadronEneIsoR_1", "std::vector<double>", &t_cHadronEneIsoR_1);
1414   tree_->Branch("t_cHadronEneIsoR_2", "std::vector<double>", &t_cHadronEneIsoR_2);
1415   tree_->Branch("t_cHadronEneIsoR_3", "std::vector<double>", &t_cHadronEneIsoR_3);
1416   tree_->Branch("t_nHadronEneIsoR", "std::vector<double>", &t_nHadronEneIsoR);
1417   tree_->Branch("t_photonEneIsoR", "std::vector<double>", &t_photonEneIsoR);
1418   tree_->Branch("t_eleEneIsoR", "std::vector<double>", &t_eleEneIsoR);
1419   tree_->Branch("t_muEneIsoR", "std::vector<double>", &t_muEneIsoR);
1420 
1421   tree_->Branch("t_maxNearPHCR", "std::vector<double>", &t_maxNearPHCR);
1422   tree_->Branch("t_cHadronEneHCR", "std::vector<double>", &t_cHadronEneHCR);
1423   tree_->Branch("t_cHadronEneHCR_1", "std::vector<double>", &t_cHadronEneHCR_1);
1424   tree_->Branch("t_cHadronEneHCR_2", "std::vector<double>", &t_cHadronEneHCR_2);
1425   tree_->Branch("t_cHadronEneHCR_3", "std::vector<double>", &t_cHadronEneHCR_3);
1426   tree_->Branch("t_nHadronEneHCR", "std::vector<double>", &t_nHadronEneHCR);
1427   tree_->Branch("t_photonEneHCR", "std::vector<double>", &t_photonEneHCR);
1428   tree_->Branch("t_eleEneHCR", "std::vector<double>", &t_eleEneHCR);
1429   tree_->Branch("t_muEneHCR", "std::vector<double>", &t_muEneHCR);
1430 
1431   tree_->Branch("t_maxNearPIsoHCR", "std::vector<double>", &t_maxNearPIsoHCR);
1432   tree_->Branch("t_cHadronEneIsoHCR", "std::vector<double>", &t_cHadronEneIsoHCR);
1433   tree_->Branch("t_cHadronEneIsoHCR_1", "std::vector<double>", &t_cHadronEneIsoHCR_1);
1434   tree_->Branch("t_cHadronEneIsoHCR_2", "std::vector<double>", &t_cHadronEneIsoHCR_2);
1435   tree_->Branch("t_cHadronEneIsoHCR_3", "std::vector<double>", &t_cHadronEneIsoHCR_3);
1436   tree_->Branch("t_nHadronEneIsoHCR", "std::vector<double>", &t_nHadronEneIsoHCR);
1437   tree_->Branch("t_photonEneIsoHCR", "std::vector<double>", &t_photonEneIsoHCR);
1438   tree_->Branch("t_eleEneIsoHCR", "std::vector<double>", &t_eleEneIsoHCR);
1439   tree_->Branch("t_muEneIsoHCR", "std::vector<double>", &t_muEneIsoHCR);
1440 
1441   tree_->Branch("t_L1Decision", "std::vector<int>", &t_L1Decision);
1442   tree_->Branch("t_L1CenJetPt", "std::vector<double>", &t_L1CenJetPt);
1443   tree_->Branch("t_L1CenJetEta", "std::vector<double>", &t_L1CenJetEta);
1444   tree_->Branch("t_L1CenJetPhi", "std::vector<double>", &t_L1CenJetPhi);
1445   tree_->Branch("t_L1FwdJetPt", "std::vector<double>", &t_L1FwdJetPt);
1446   tree_->Branch("t_L1FwdJetEta", "std::vector<double>", &t_L1FwdJetEta);
1447   tree_->Branch("t_L1FwdJetPhi", "std::vector<double>", &t_L1FwdJetPhi);
1448   tree_->Branch("t_L1TauJetPt", "std::vector<double>", &t_L1TauJetPt);
1449   tree_->Branch("t_L1TauJetEta", "std::vector<double>", &t_L1TauJetEta);
1450   tree_->Branch("t_L1TauJetPhi", "std::vector<double>", &t_L1TauJetPhi);
1451   tree_->Branch("t_L1MuonPt", "std::vector<double>", &t_L1MuonPt);
1452   tree_->Branch("t_L1MuonEta", "std::vector<double>", &t_L1MuonEta);
1453   tree_->Branch("t_L1MuonPhi", "std::vector<double>", &t_L1MuonPhi);
1454   tree_->Branch("t_L1IsoEMPt", "std::vector<double>", &t_L1IsoEMPt);
1455   tree_->Branch("t_L1IsoEMEta", "std::vector<double>", &t_L1IsoEMEta);
1456   tree_->Branch("t_L1IsoEMPhi", "std::vector<double>", &t_L1IsoEMPhi);
1457   tree_->Branch("t_L1NonIsoEMPt", "std::vector<double>", &t_L1NonIsoEMPt);
1458   tree_->Branch("t_L1NonIsoEMEta", "std::vector<double>", &t_L1NonIsoEMEta);
1459   tree_->Branch("t_L1NonIsoEMPhi", "std::vector<double>", &t_L1NonIsoEMPhi);
1460   tree_->Branch("t_L1METPt", "std::vector<double>", &t_L1METPt);
1461   tree_->Branch("t_L1METEta", "std::vector<double>", &t_L1METEta);
1462   tree_->Branch("t_L1METPhi", "std::vector<double>", &t_L1METPhi);
1463 }
1464 
1465 void IsolatedGenParticles::clearTreeVectors() {
1466   // t_maxNearP31x31     ->clear();
1467   // t_nEvtProc          ->clear();
1468 
1469   t_isoTrkPAll->clear();
1470   t_isoTrkPtAll->clear();
1471   t_isoTrkPhiAll->clear();
1472   t_isoTrkEtaAll->clear();
1473   t_isoTrkDPhiAll->clear();
1474   t_isoTrkDEtaAll->clear();
1475   t_isoTrkPdgIdAll->clear();
1476 
1477   t_isoTrkP->clear();
1478   t_isoTrkPt->clear();
1479   t_isoTrkEne->clear();
1480   t_isoTrkEta->clear();
1481   t_isoTrkPhi->clear();
1482   t_isoTrkEtaEC->clear();
1483   t_isoTrkPhiEC->clear();
1484   t_isoTrkPdgId->clear();
1485 
1486   t_maxNearP31x31->clear();
1487   t_cHadronEne31x31->clear();
1488   t_cHadronEne31x31_1->clear();
1489   t_cHadronEne31x31_2->clear();
1490   t_cHadronEne31x31_3->clear();
1491   t_nHadronEne31x31->clear();
1492   t_photonEne31x31->clear();
1493   t_eleEne31x31->clear();
1494   t_muEne31x31->clear();
1495 
1496   t_maxNearP25x25->clear();
1497   t_cHadronEne25x25->clear();
1498   t_cHadronEne25x25_1->clear();
1499   t_cHadronEne25x25_2->clear();
1500   t_cHadronEne25x25_3->clear();
1501   t_nHadronEne25x25->clear();
1502   t_photonEne25x25->clear();
1503   t_eleEne25x25->clear();
1504   t_muEne25x25->clear();
1505 
1506   t_maxNearP21x21->clear();
1507   t_cHadronEne21x21->clear();
1508   t_cHadronEne21x21_1->clear();
1509   t_cHadronEne21x21_2->clear();
1510   t_cHadronEne21x21_3->clear();
1511   t_nHadronEne21x21->clear();
1512   t_photonEne21x21->clear();
1513   t_eleEne21x21->clear();
1514   t_muEne21x21->clear();
1515 
1516   t_maxNearP15x15->clear();
1517   t_cHadronEne15x15->clear();
1518   t_cHadronEne15x15_1->clear();
1519   t_cHadronEne15x15_2->clear();
1520   t_cHadronEne15x15_3->clear();
1521   t_nHadronEne15x15->clear();
1522   t_photonEne15x15->clear();
1523   t_eleEne15x15->clear();
1524   t_muEne15x15->clear();
1525 
1526   t_maxNearP11x11->clear();
1527   t_cHadronEne11x11->clear();
1528   t_cHadronEne11x11_1->clear();
1529   t_cHadronEne11x11_2->clear();
1530   t_cHadronEne11x11_3->clear();
1531   t_nHadronEne11x11->clear();
1532   t_photonEne11x11->clear();
1533   t_eleEne11x11->clear();
1534   t_muEne11x11->clear();
1535 
1536   t_maxNearP9x9->clear();
1537   t_cHadronEne9x9->clear();
1538   t_cHadronEne9x9_1->clear();
1539   t_cHadronEne9x9_2->clear();
1540   t_cHadronEne9x9_3->clear();
1541   t_nHadronEne9x9->clear();
1542   t_photonEne9x9->clear();
1543   t_eleEne9x9->clear();
1544   t_muEne9x9->clear();
1545 
1546   t_maxNearP7x7->clear();
1547   t_cHadronEne7x7->clear();
1548   t_cHadronEne7x7_1->clear();
1549   t_cHadronEne7x7_2->clear();
1550   t_cHadronEne7x7_3->clear();
1551   t_nHadronEne7x7->clear();
1552   t_photonEne7x7->clear();
1553   t_eleEne7x7->clear();
1554   t_muEne7x7->clear();
1555 
1556   t_maxNearP3x3->clear();
1557   t_cHadronEne3x3->clear();
1558   t_cHadronEne3x3_1->clear();
1559   t_cHadronEne3x3_2->clear();
1560   t_cHadronEne3x3_3->clear();
1561   t_nHadronEne3x3->clear();
1562   t_photonEne3x3->clear();
1563   t_eleEne3x3->clear();
1564   t_muEne3x3->clear();
1565 
1566   t_maxNearP1x1->clear();
1567   t_cHadronEne1x1->clear();
1568   t_cHadronEne1x1_1->clear();
1569   t_cHadronEne1x1_2->clear();
1570   t_cHadronEne1x1_3->clear();
1571   t_nHadronEne1x1->clear();
1572   t_photonEne1x1->clear();
1573   t_eleEne1x1->clear();
1574   t_muEne1x1->clear();
1575 
1576   t_maxNearPHC1x1->clear();
1577   t_cHadronEneHC1x1->clear();
1578   t_cHadronEneHC1x1_1->clear();
1579   t_cHadronEneHC1x1_2->clear();
1580   t_cHadronEneHC1x1_3->clear();
1581   t_nHadronEneHC1x1->clear();
1582   t_photonEneHC1x1->clear();
1583   t_eleEneHC1x1->clear();
1584   t_muEneHC1x1->clear();
1585 
1586   t_maxNearPHC3x3->clear();
1587   t_cHadronEneHC3x3->clear();
1588   t_cHadronEneHC3x3_1->clear();
1589   t_cHadronEneHC3x3_2->clear();
1590   t_cHadronEneHC3x3_3->clear();
1591   t_nHadronEneHC3x3->clear();
1592   t_photonEneHC3x3->clear();
1593   t_eleEneHC3x3->clear();
1594   t_muEneHC3x3->clear();
1595 
1596   t_maxNearPHC5x5->clear();
1597   t_cHadronEneHC5x5->clear();
1598   t_cHadronEneHC5x5_1->clear();
1599   t_cHadronEneHC5x5_2->clear();
1600   t_cHadronEneHC5x5_3->clear();
1601   t_nHadronEneHC5x5->clear();
1602   t_photonEneHC5x5->clear();
1603   t_eleEneHC5x5->clear();
1604   t_muEneHC5x5->clear();
1605 
1606   t_maxNearPHC7x7->clear();
1607   t_cHadronEneHC7x7->clear();
1608   t_cHadronEneHC7x7_1->clear();
1609   t_cHadronEneHC7x7_2->clear();
1610   t_cHadronEneHC7x7_3->clear();
1611   t_nHadronEneHC7x7->clear();
1612   t_photonEneHC7x7->clear();
1613   t_eleEneHC7x7->clear();
1614   t_muEneHC7x7->clear();
1615 
1616   t_maxNearPR->clear();
1617   t_cHadronEneR->clear();
1618   t_cHadronEneR_1->clear();
1619   t_cHadronEneR_2->clear();
1620   t_cHadronEneR_3->clear();
1621   t_nHadronEneR->clear();
1622   t_photonEneR->clear();
1623   t_eleEneR->clear();
1624   t_muEneR->clear();
1625 
1626   t_maxNearPIsoR->clear();
1627   t_cHadronEneIsoR->clear();
1628   t_cHadronEneIsoR_1->clear();
1629   t_cHadronEneIsoR_2->clear();
1630   t_cHadronEneIsoR_3->clear();
1631   t_nHadronEneIsoR->clear();
1632   t_photonEneIsoR->clear();
1633   t_eleEneIsoR->clear();
1634   t_muEneIsoR->clear();
1635 
1636   t_maxNearPHCR->clear();
1637   t_cHadronEneHCR->clear();
1638   t_cHadronEneHCR_1->clear();
1639   t_cHadronEneHCR_2->clear();
1640   t_cHadronEneHCR_3->clear();
1641   t_nHadronEneHCR->clear();
1642   t_photonEneHCR->clear();
1643   t_eleEneHCR->clear();
1644   t_muEneHCR->clear();
1645 
1646   t_maxNearPIsoHCR->clear();
1647   t_cHadronEneIsoHCR->clear();
1648   t_cHadronEneIsoHCR_1->clear();
1649   t_cHadronEneIsoHCR_2->clear();
1650   t_cHadronEneIsoHCR_3->clear();
1651   t_nHadronEneIsoHCR->clear();
1652   t_photonEneIsoHCR->clear();
1653   t_eleEneIsoHCR->clear();
1654   t_muEneIsoHCR->clear();
1655 
1656   t_L1Decision->clear();
1657   t_L1CenJetPt->clear();
1658   t_L1CenJetEta->clear();
1659   t_L1CenJetPhi->clear();
1660   t_L1FwdJetPt->clear();
1661   t_L1FwdJetEta->clear();
1662   t_L1FwdJetPhi->clear();
1663   t_L1TauJetPt->clear();
1664   t_L1TauJetEta->clear();
1665   t_L1TauJetPhi->clear();
1666   t_L1MuonPt->clear();
1667   t_L1MuonEta->clear();
1668   t_L1MuonPhi->clear();
1669   t_L1IsoEMPt->clear();
1670   t_L1IsoEMEta->clear();
1671   t_L1IsoEMPhi->clear();
1672   t_L1NonIsoEMPt->clear();
1673   t_L1NonIsoEMEta->clear();
1674   t_L1NonIsoEMPhi->clear();
1675   t_L1METPt->clear();
1676   t_L1METEta->clear();
1677   t_L1METPhi->clear();
1678 }
1679 
1680 int IsolatedGenParticles::particleCode(int pdgId) {
1681   int partID[Particles] = {11, -11, 21, 211, -211, 321, -321, 2212, 2112, -2212, -2112, 130};
1682   int ix = -1;
1683   for (int ik = 0; ik < Particles; ++ik) {
1684     if (pdgId == partID[ik]) {
1685       ix = ik;
1686       break;
1687     }
1688   }
1689   return ix;
1690 }
1691 
1692 //define this as a plug-in
1693 DEFINE_FWK_MODULE(IsolatedGenParticles);