Go to the documentation of this file.00001 #ifndef HLTALCA_H
00002 #define HLTALCA_H
00003
00004 #include "TH1.h"
00005 #include "TH2.h"
00006 #include "TFile.h"
00007 #include "TNamed.h"
00008 #include <vector>
00009 #include <map>
00010 #include "TROOT.h"
00011 #include "TChain.h"
00012
00013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00014 #include "FWCore/Framework/interface/ESHandle.h"
00015 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
00016 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
00017 #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
00018 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
00019 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
00020 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
00021 #include "DataFormats/Candidate/interface/Candidate.h"
00022 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
00023 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00024 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00025 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00026 #include "CondFormats/L1TObjects/interface/L1CaloGeometry.h"
00027
00028 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00029 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00030 #include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h"
00031 #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"
00032 #include "Geometry/EcalMapping/interface/EcalMappingRcd.h"
00033 #include <DataFormats/FEDRawData/interface/FEDNumbering.h>
00034
00036 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00037 #include "RecoEcal/EgammaCoreTools/interface/EcalEtaPhiRegion.h"
00038
00039 typedef std::vector<std::string> MyStrings;
00040
00048 typedef std::map<DetId, EcalRecHit> RecHitsMap;
00049
00050
00051 class eecalRecHitLess : public std::binary_function<EcalRecHit, EcalRecHit, bool>
00052 {
00053 public:
00054 bool operator()(EcalRecHit x, EcalRecHit y)
00055 {
00056 return (x.energy() > y.energy());
00057 }
00058 };
00059
00060
00061 class HLTAlCa {
00062 public:
00063 HLTAlCa();
00064
00065 void setup(const edm::ParameterSet& pSet, TTree* tree);
00066
00068 void analyze(const edm::Handle<EBRecHitCollection> & ebrechits,
00069 const edm::Handle<EERecHitCollection> & eerechits,
00070 const edm::Handle<HBHERecHitCollection> & hbherechits,
00071 const edm::Handle<HORecHitCollection> & horechits,
00072 const edm::Handle<HFRecHitCollection> & hfrechits,
00073 const edm::Handle<EBRecHitCollection> & pi0ebrechits,
00074 const edm::Handle<EERecHitCollection> & pi0eerechits,
00075 const edm::Handle<l1extra::L1EmParticleCollection> & l1extemi,
00076 const edm::Handle<l1extra::L1EmParticleCollection> & l1extemn,
00077 const edm::Handle<l1extra::L1JetParticleCollection> & l1extjetc,
00078 const edm::Handle<l1extra::L1JetParticleCollection> & l1extjetf,
00079 const edm::Handle<l1extra::L1JetParticleCollection> & l1exttaujet,
00080 const edm::ESHandle< EcalElectronicsMapping > & ecalmapping,
00081 const edm::ESHandle<CaloGeometry> & geoHandle,
00082 const edm::ESHandle<CaloTopology> & pTopology,
00083 const edm::ESHandle<L1CaloGeometry> & l1CaloGeom,
00084 TTree* tree);
00085
00086 private:
00087
00088
00089 edm::InputTag barrelHits_;
00090 edm::InputTag endcapHits_;
00091 std::string pi0BarrelHits_;
00092 std::string pi0EndcapHits_;
00093 int gammaCandEtaSize_;
00094 int gammaCandPhiSize_;
00095 double clusSeedThr_;
00096 int clusEtaSize_;
00097 int clusPhiSize_;
00098 double clusSeedThrEndCap_;
00099 double selePtGammaOne_;
00100 double selePtGammaTwo_;
00101 double selePtPi0_;
00102 double seleMinvMaxPi0_;
00103 double seleMinvMinPi0_;
00104 double seleXtalMinEnergy_;
00105 double selePtGammaEndCap_;
00106 double selePtPi0EndCap_;
00107 double seleMinvMaxPi0EndCap_;
00108 double seleMinvMinPi0EndCap_;
00109 int seleNRHMax_;
00110 double seleS4S9GammaOne_;
00111 double seleS4S9GammaTwo_;
00112 double seleS4S9GammaEndCap_;
00113 double selePi0BeltDR_;
00114 double selePi0BeltDeta_;
00115 double selePi0Iso_;
00116 bool ParameterLogWeighted_;
00117 double ParameterX0_;
00118 double ParameterT0_barl_;
00119 double ParameterT0_endc_;
00120 double ParameterT0_endcPresh_;
00121 double ParameterW0_;
00122 double selePi0IsoEndCap_;
00123 edm::InputTag l1IsolatedTag_;
00124 edm::InputTag l1NonIsolatedTag_;
00125 edm::InputTag l1SeedFilterTag_;
00126 std::vector<EBDetId> detIdEBRecHits;
00127 std::vector<EcalRecHit> EBRecHits;
00128 std::vector<EEDetId> detIdEERecHits;
00129 std::vector<EcalRecHit> EERecHits;
00130 double ptMinForIsolation_;
00131 bool storeIsoClusRecHit_;
00132 double ptMinForIsolationEndCap_;
00133 bool useEndCapEG_;
00134 bool Jets_;
00135 edm::InputTag CentralSource_;
00136 edm::InputTag ForwardSource_;
00137 edm::InputTag TauSource_;
00138 bool JETSdoCentral_ ;
00139 bool JETSdoForward_ ;
00140 bool JETSdoTau_ ;
00141 double Ptmin_jets_;
00142 double Ptmin_taujets_;
00143 double JETSregionEtaMargin_;
00144 double JETSregionPhiMargin_;
00145 int debug_;
00146 bool first_;
00147 double EMregionEtaMargin_;
00148 double EMregionPhiMargin_;
00149 std::map<std::string,double> providedParameters;
00150 std::vector<int> FEDListUsed;
00151 std::vector<int> FEDListUsedBarrel;
00152 std::vector<int> FEDListUsedEndcap;
00153 bool RegionalMatch_;
00154 double ptMinEMObj_ ;
00155 bool doSelForEtaBarrel_;
00156 double selePtGammaEta_;
00157 double selePtEta_;
00158 double seleS4S9GammaEta_;
00159 double seleMinvMaxEta_;
00160 double seleMinvMinEta_;
00161 double ptMinForIsolationEta_;
00162 double seleIsoEta_;
00163 double seleEtaBeltDR_;
00164 double seleEtaBeltDeta_;
00165 bool storeIsoClusRecHitEta_;
00166 bool removePi0CandidatesForEta_;
00167 double massLowPi0Cand_;
00168 double massHighPi0Cand_;
00169
00170 EcalElectronicsMapping* TheMapping;
00171
00172 const CaloSubdetectorGeometry *geometry_eb;
00173 const CaloSubdetectorGeometry *geometry_ee;
00174 const CaloSubdetectorGeometry *geometry_es;
00175 const CaloSubdetectorTopology *topology_eb;
00176 const CaloSubdetectorTopology *topology_ee;
00177 PositionCalc posCalculator_;
00178 static const int MAXCLUS = 2000;
00179 static const int MAXPI0S = 200;
00180 long int nEBRHSavedTotal ;
00181 long int nEERHSavedTotal ;
00182 long int nEvtPassedTotal;
00183 long int nEvtPassedEETotal;
00184 long int nEvtPassedEBTotal;
00185 long int nEvtProcessedTotal;
00186 int nClusAll;
00187
00188
00189 float ohHighestEnergyEERecHit, ohHighestEnergyEBRecHit;
00190 float ohHighestEnergyHBHERecHit, ohHighestEnergyHORecHit, ohHighestEnergyHFRecHit;
00191
00192 int Nalcapi0clusters;
00193 float *ptClusAll, *etaClusAll, *phiClusAll, *s4s9ClusAll;
00194
00195
00196 bool _Monte,_Debug;
00197
00198 int evtCounter;
00199
00200 std::vector<int> ListOfFEDS(double etaLow, double etaHigh, double phiLow,
00201 double phiHigh, double etamargin, double phimargin);
00202
00203 int convertSmToFedNumbBarrel(int ieta, int smId);
00204
00205 void convxtalid(Int_t &nphi,Int_t &neta);
00206
00207 int diff_neta_s(Int_t neta1, Int_t neta2);
00208
00209 int diff_nphi_s(Int_t nphi1,Int_t nphi2);
00210
00211 };
00212
00213 #endif