CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Calibration/IsolatedParticles/plugins/IsolatedTracksHcalScale.h

Go to the documentation of this file.
00001 #ifndef CalibrationIsolatedParticlesIsolatedTracksHcalScale_h
00002 #define CalibrationIsolatedParticlesIsolatedTracksHcalScale_h
00003 
00004 // system include files
00005 #include <memory>
00006 #include <cmath>
00007 #include <string>
00008 #include <map>
00009 #include <vector>
00010 
00011 // user include files
00012 #include <Math/GenVector/VectorUtil.h>
00013 
00014 #include "FWCore/Framework/interface/Frameworkfwd.h"
00015 #include "FWCore/Framework/interface/EDAnalyzer.h"
00016 #include "FWCore/Framework/interface/Event.h"
00017 #include "FWCore/Framework/interface/ESHandle.h"
00018 #include "FWCore/Framework/interface/EventSetup.h"
00019 #include "FWCore/Framework/interface/MakerMacros.h"
00020 
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 
00023 // TFile Service
00024 #include "FWCore/ServiceRegistry/interface/Service.h"
00025 #include "CommonTools/UtilAlgos/interface/TFileService.h"
00026 
00027 #include "DataFormats/Common/interface/Ref.h"
00028 #include "DataFormats/Common/interface/Handle.h"
00029 #include "DataFormats/Math/interface/Point3D.h"
00030 #include "DataFormats/Candidate/interface/Candidate.h"
00031 
00032 // muons and tracks
00033 #include "DataFormats/TrackReco/interface/Track.h"
00034 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00035 #include "DataFormats/TrackReco/interface/HitPattern.h"
00036 // Vertices
00037 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00038 #include "DataFormats/VertexReco/interface/Vertex.h"
00039 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00040 // Calorimeters
00041 #include "DataFormats/DetId/interface/DetId.h"
00042 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00043 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00044 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00045 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00046 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00047 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00048 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
00049 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
00050 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
00051 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapFwd.h"
00052 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h"
00053 
00054 //L1 objects
00055 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
00056 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
00057 #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
00058 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
00059 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
00060 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
00061 
00062 // Jets in the event
00063 #include "DataFormats/JetReco/interface/CaloJet.h"
00064 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00065 #include "DataFormats/JetReco/interface/JetExtendedAssociation.h"
00066 
00067 // SimHit
00068 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00069 //simtrack
00070 #include "SimDataFormats/Track/interface/SimTrack.h"
00071 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00072 #include "SimDataFormats/Vertex/interface/SimVertex.h"
00073 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00074 
00075 // track associator
00076 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00077 #include "TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h"
00078 #include "SimTracker/Records/interface/TrackAssociatorRecord.h"
00079 // ecal / hcal
00080 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00081 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00082 #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
00083 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00084 #include "Geometry/CaloTopology/interface/HcalTopology.h"
00085 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00086 
00087 #include "RecoCaloTools/Navigation/interface/CaloNavigator.h"
00088 
00089 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00090 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
00091 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00092 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
00093 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
00094 
00095 #include "Calibration/IsolatedParticles/interface/FindCaloHit.h"
00096 #include "Calibration/IsolatedParticles/interface/eECALMatrix.h"
00097 #include "Calibration/IsolatedParticles/interface/eHCALMatrix.h"
00098 #include "Calibration/IsolatedParticles/interface/MatchingSimTrack.h"
00099 #include "Calibration/IsolatedParticles/interface/CaloSimInfo.h"
00100 #include "Calibration/IsolatedParticles/interface/TrackSelection.h"
00101 
00102 // root objects
00103 #include "TROOT.h"
00104 #include "TSystem.h"
00105 #include "TFile.h"
00106 #include "TH1F.h"
00107 #include "TH2F.h"
00108 #include "TProfile.h"
00109 #include "TDirectory.h"
00110 #include "TTree.h"
00111 
00112 class IsolatedTracksHcalScale : public edm::EDAnalyzer {
00113   
00114 public:
00115   explicit IsolatedTracksHcalScale(const edm::ParameterSet&);
00116   ~IsolatedTracksHcalScale();
00117   
00118 private:
00119   //void   beginJob(const edm::EventSetup&) ;
00120   void   beginJob() ;
00121   void   analyze(const edm::Event&, const edm::EventSetup&);
00122   void   endJob() ;
00123 
00124   void   clearTreeVectors();  
00125   
00126 private:
00127   
00128   bool        initL1, doMC;
00129   int         myverbose;
00130   std::string theTrackQuality, minQuality;
00131   spr::trackSelectionParameters selectionParameters;
00132   double      a_mipR, a_coneR, a_charIsoR, a_neutIsoR;
00133   double      tMinE_, tMaxE_;
00134   //   static const size_t nL1BitsMax=128;
00135   // std::string algoBitToName[nL1BitsMax];
00136   // std::map <std::string,bool> l1TriggerMap;
00137   // std::map<std::string,bool>::iterator trig_iter;
00138 
00139   // double pvTracksPtMin_;
00140   // bool   debugL1Info_;
00141   // int    debugTrks_;
00142   // bool   printTrkHitPattern_;
00143   // int    myverbose;
00144   //  edm::InputTag L1extraTauJetSource_,  L1extraCenJetSource_,    L1extraFwdJetSource_;
00145   //  edm::InputTag L1extraMuonSource_,    L1extraIsoEmSource_,     L1extraNonIsoEmSource_;
00146   //  edm::InputTag L1GTReadoutRcdSource_, L1GTObjectMapRcdSource_;
00147   //  edm::InputTag JetExtender_, JetSrc_;
00148 
00149   int    nEventProc;
00150 
00151   // track associator to detector parameters 
00152   //TrackAssociatorParameters parameters_;
00153   //mutable TrackDetectorAssociator* trackAssociator_;
00154 
00155   const MagneticField *bField;
00156 
00157   double genPartEtaBins[4];
00158 
00159   static const size_t NEtaBins = 3;
00160   
00161   TTree* tree;
00162 
00163   int  t_nTracks, t_RunNo, t_EvtNo, t_Lumi, t_Bunch;
00164   std::vector<double> *t_trackP,        *t_trackPt,        *t_trackEta,      *t_trackPhi;
00165   std::vector<double> *t_trackHcalEta,  *t_trackHcalPhi,   *t_eHCALDR;   
00166   std::vector<double> *t_hCone,         *t_conehmaxNearP,  *t_eMipDR,        *t_eECALDR;
00167   std::vector<double> *t_e11x11_20Sig,  *t_e15x15_20Sig;
00168   std::vector<double> *t_eMipDR_1,      *t_eECALDR_1,      *t_eMipDR_2,      *t_eECALDR_2;
00169   std::vector<double> *t_hsimInfoMatched,  *t_hsimInfoRest,     *t_hsimInfoPhoton;
00170   std::vector<double> *t_hsimInfoNeutHad,  *t_hsimInfoCharHad,  *t_hsimInfoPdgMatched;
00171   std::vector<double> *t_hsimInfoTotal,    *t_hsim;
00172   std::vector<int>    *t_hsimInfoNMatched, *t_hsimInfoNTotal,   *t_hsimInfoNNeutHad;
00173   std::vector<int>    *t_hsimInfoNCharHad, *t_hsimInfoNPhoton,  *t_hsimInfoNRest;
00174   std::vector<int>    *t_nSimHits;
00175   edm::Service<TFileService> fs;
00176 };
00177 
00178 #endif