CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ErsatzMEt.cc
Go to the documentation of this file.
3 
5 {
6  MCTruthCollection_ = ps.getParameter<edm::InputTag>("MCTruthCollection");
7  ElectronCollection_ = ps.getParameter<edm::InputTag>("ElectronCollection");
8  HybridScCollection_ = ps.getParameter<edm::InputTag>("HybridScCollection");
9  M5x5ScCollection_ = ps.getParameter<edm::InputTag>("M5x5ScCollection");
10  GenMEtCollection_ = ps.getParameter<edm::InputTag>("GenMEtCollection");
11  CaloMEtCollection_ = ps.getParameter<edm::InputTag>("CaloMEtCollection");
12  //T1MEtCollection_ = ps.getParameter<edm::InputTag>("T1MEtCollection");
13  PfMEtCollection_ = ps.getParameter<edm::InputTag>("PfMEtCollection");
14  TcMEtCollection_ = ps.getParameter<edm::InputTag>("TcMEtCollection");
15  TriggerEvent_ = ps.getParameter<edm::InputTag>("TriggerEvent");
16  TriggerPath_ = ps.getParameter<edm::InputTag>("TriggerPath");
17  TriggerResults_ = ps.getParameter<edm::InputTag>("TriggerResults");
18  TriggerName_ = ps.getParameter<std::string>("TriggerName");
19  HLTPathCheck_ = ps.getParameter<bool>("HLTPathCheck");
20 
21  Zevent_ = ps.getParameter<bool>("Zevent");
22  mW_ = ps.getParameter<double>("mW");
23  mZ_ = ps.getParameter<double>("mZ");
24  mTPmin_ = ps.getParameter<double>("mTPmin");
25  mTPmax_ = ps.getParameter<double>("mTPmax");
26  BarrelEtaMax_ = ps.getParameter<double>("BarrelEtaMax");
27  EndCapEtaMin_ = ps.getParameter<double>("EndCapEtaMin");
28  EndCapEtaMax_ = ps.getParameter<double>("EndCapEtaMax");
29 
30  hyb_fCorrPSet_ = ps.getParameter<edm::ParameterSet>("hyb_fCorrPSet");
31  m5x5_fCorrPSet_ = ps.getParameter<edm::ParameterSet>("m5x5_fCorrPSet");
32 
33  double CElecPtMin = ps.getParameter<double>("CElecPtMin");
34  double CEB_siEiE = ps.getParameter<double>("CEB_sigmaIEtaIEta");
35  double CEB_dPhiIn = ps.getParameter<double>("CEB_deltaPhiIn");
36  double CEB_dEtaIn = ps.getParameter<double>("CEB_deltaEtaIn");
37  double CEB_EcalIso = ps.getParameter<double>("CEB_EcalIso");
38  double CEB_HcalIso = ps.getParameter<double>("CEB_HcalIso");
39  double CEB_TrckIso = ps.getParameter<double>("CEB_TrckIso");
40  double CEE_siEiE = ps.getParameter<double>("CEE_sigmaIEtaIEta");
41  double CEE_dPhiIn = ps.getParameter<double>("CEE_deltaPhiIn");
42  double CEE_dEtaIn = ps.getParameter<double>("CEE_deltaEtaIn");
43  double CEE_EcalIso = ps.getParameter<double>("CEE_EcalIso");
44  double CEE_HcalIso = ps.getParameter<double>("CEE_HcalIso");
45  double CEE_TrckIso = ps.getParameter<double>("CEE_TrckIso");
46 
47  CutVector_.resize(13);
48  CutVector_[EtCut_] = CElecPtMin;
49  CutVector_[EB_sIhIh_] = CEB_siEiE;
50  CutVector_[EB_dPhiIn_] = CEB_dPhiIn;
51  CutVector_[EB_dEtaIn_] = CEB_dEtaIn;
52  CutVector_[EB_TrckIso_] = CEB_TrckIso;
53  CutVector_[EB_EcalIso_] = CEB_EcalIso;
54  CutVector_[EB_HcalIso_] = CEB_HcalIso;
55  CutVector_[EE_sIhIh_] = CEE_siEiE;
56  CutVector_[EE_dPhiIn_] = CEE_dPhiIn;
57  CutVector_[EE_dEtaIn_] = CEE_dEtaIn;
58  CutVector_[EE_TrckIso_] = CEE_TrckIso;
59  CutVector_[EE_EcalIso_] = CEE_EcalIso;
60  CutVector_[EE_HcalIso_] = CEE_HcalIso;
61 
62  for(std::vector<double>::const_iterator it = CutVector_.begin(); it != CutVector_.end(); ++it)
63  {
64  edm::LogDebug_("","",101)<<"CutVector_ = "<< *it;
65  }
66 }
67 
69 {
70 }
71 
72 // ------------ method called once each job just before starting event loop ------------
74 {
76 
77  t_ = fs->make<TTree>("ErsatzMEt", "Data on ErsatzMEt");
78 
79  edm::LogDebug_("","", 75)<<"Creating Ersatz MEt branches.";
80 
81  t_->Branch("nTags", &nTags_, "nTags/I");
82  t_->Branch("nProbes", &nProbes_, "nProbes/I");
83 
84  t_->Branch("ErsatzV1CaloMEt", ErsatzV1CaloMEt_, "ErsatzV1CaloMEt[4]/D");
85  t_->Branch("ErsatzV1CaloMt", ErsatzV1CaloMt_, "ErsatzV1CaloMt[4]/D");
86  t_->Branch("ErsatzV1CaloMEtPhi", ErsatzV1CaloMEtPhi_, "ErsatzV1CaloMEtPhi[4]/D");
87  t_->Branch("ErsatzV2CaloMEt", ErsatzV2CaloMEt_, "ErsatzV2CaloMEt[4]/D");
88  t_->Branch("ErsatzV2CaloMEtPhi", ErsatzV2CaloMEtPhi_, "ErsatzV2CaloMEtPhi[4]/D");
89  t_->Branch("ErsatzV2CaloMt", ErsatzV2CaloMt_, "ErsatzV2CaloMt[4]/D");
90  t_->Branch("ErsatzV3CaloMEt", ErsatzV3CaloMEt_, "ErsatzV3CaloMEt[4]/D");
91  t_->Branch("ErsatzV3CaloMEtPhi", ErsatzV3CaloMEtPhi_, "ErsatzV3CaloMEtPhi[4]/D");
92  t_->Branch("ErsatzV3CaloMt", ErsatzV3CaloMt_, "ErsatzV3CaloMt[4]/D");
93  t_->Branch("ErsatzV4CaloMEt", ErsatzV4CaloMEt_, "ErsatzV4CaloMEt[4]/D");
94  t_->Branch("ErsatzV4CaloMEtPhi", ErsatzV4CaloMEtPhi_, "ErsatzV4CaloMEtPhi[4]/D");
95  t_->Branch("ErsatzV4CaloMt", ErsatzV4CaloMt_, "ErsatzV4CaloMt[4]/D");
96  t_->Branch("ErsatzV1T1MEt", ErsatzV1T1MEt_, "ErsatzV1T1MEt[4]/D");
97  t_->Branch("ErsatzV1T1Mt", ErsatzV1T1Mt_, "ErsatzV1T1Mt[4]/D");
98  t_->Branch("ErsatzV1T1MEtPhi", ErsatzV1T1MEtPhi_, "ErsatzV1T1MEtPhi[4]/D");
99  t_->Branch("ErsatzV1PfMEt", ErsatzV1PfMEt_, "ErsatzV1PfMEt[4]/D");
100  t_->Branch("ErsatzV1PfMt", ErsatzV1PfMt_, "ErsatzV1PfMt[4]/D");
101  t_->Branch("ErsatzV1PfMEtPhi", ErsatzV1TcMEtPhi_, "ErsatzV1PfMEtPhi[4]/D");
102  t_->Branch("ErsatzV1TcMEt", ErsatzV1TcMEt_, "ErsatzV1TcMEt[4]/D");
103  t_->Branch("ErsatzV1TcMt", ErsatzV1TcMt_, "ErsatzV1TcMt[4]/D");
104  t_->Branch("ErsatzV1TcMEtPhi", ErsatzV1TcMEtPhi_, "ErsatzV1TcMEtPhi[4]/D");
105 
106  t_->Branch("CaloMEt", &CaloMEt_, "CaloMEt/D");
107  t_->Branch("CaloMEtphi", &CaloMEtphi_, "CaloMEtphi/D");
108  t_->Branch("T1MEt", &T1MEt_, "T1MEt/D");
109  t_->Branch("T1MEtphi", &T1MEtphi_, "T1MEtphi/D");
110  t_->Branch("PfMEt", &PfMEt_, "PfMEt/D");
111  t_->Branch("PfMEtphi", &PfMEtphi_, "PfMEtphi/D");
112  t_->Branch("TcMEt", &TcMEt_, "TcMEt/D");
113  t_->Branch("TcMEtphi", &TcMEtphi_, "TcMEtphi/D");
114 
115  edm::LogDebug_("","", 91)<<"Creating electron branches.";
116  t_->Branch("tag_q", tag_q_,"tag_q[4]/I");
117  t_->Branch("tag_pt", tag_pt_,"tag_pt[4]/D");
118  t_->Branch("tag_eta", tag_eta_,"tag_eta[4]/D");
119  t_->Branch("tag_phi", tag_phi_,"tag_phi[4]/D");
120  t_->Branch("tag_sIhIh", tag_sIhIh_, "tag_sIhIh[4]/D");
121  t_->Branch("tag_dPhiIn", tag_dPhiIn_, "tag_dPhiIn[4]/D");
122  t_->Branch("tag_dEtaIn", tag_dEtaIn_, "tag_dEtaIn[4]/D");
123  t_->Branch("tag_trckIso", tag_trckIso_,"tag_trckIso[4]/D");
124  t_->Branch("tag_ecalIso", tag_ecalIso_,"tag_ecalIso[4]/D");
125  t_->Branch("tag_hcalIso", tag_hcalIso_,"tag_hcalIso[4]/D");
126  t_->Branch("tag_e2x5Max", tag_e2x5Max_,"tag_e2x5Max[4]/D");
127  t_->Branch("tag_e1x5Max", tag_e1x5Max_,"tag_e1x5Max[4]/D");
128  t_->Branch("tag_e5x5", tag_e5x5_,"tag_e5x5[4]/D");
129  t_->Branch("tag_hoe", tag_hoe_,"tag_hoe[4]/D");
130  t_->Branch("tag_eop", tag_eop_,"tag_eop[4]/D");
131  t_->Branch("tag_pin", tag_pin_,"tag_pin[4]/D");
132  t_->Branch("tag_pout", tag_pout_,"tag_pout[4]/D");
133  t_->Branch("tag_rescPt", tag_rescPt_, "tag_rescPt[4]/D");
134  t_->Branch("tag_rescEta", tag_rescEta_, "tag_rescEta[4]/D");
135  t_->Branch("tag_rescPhi", tag_rescPhi_, "tag_rescPhi[4]/D");
136 
137  edm::LogDebug_("","", 103)<<"Creating ersatz neutrino branches.";
138  t_->Branch("probe_q", probe_q_,"probe_q[4]/I");
139  t_->Branch("probe_pt", probe_pt_,"probe_pt[4]/D");
140  t_->Branch("probe_eta", probe_eta_,"probe_eta[4]/D");
141  t_->Branch("probe_phi", probe_phi_,"probe_phi[4]/D");
142  t_->Branch("probe_sIhIh", probe_sIhIh_, "probe_sIhIh[4]/D");
143  t_->Branch("probe_dPhiIn", probe_dPhiIn_, "probe_dPhiIn[4]/D");
144  t_->Branch("probe_dEtaIn", probe_dEtaIn_, "probe_dEtaIn[4]/D");
145  t_->Branch("probe_trckIso", probe_trckIso_,"probe_trckIso[4]/D");
146  t_->Branch("probe_ecalIso", probe_ecalIso_,"probe_ecalIso[4]/D");
147  t_->Branch("probe_hcalIso", probe_hcalIso_,"probe_hcalIso[4]/D");
148  t_->Branch("probe_e2x5Max", probe_e2x5Max_,"probe_e2x5Max[4]/D");
149  t_->Branch("probe_e1x5Max", probe_e1x5Max_,"probe_e1x5Max[4]/D");
150  t_->Branch("probe_e5x5", probe_e5x5_,"probe_e5x5[4]/D");
151  t_->Branch("probe_hoe", probe_hoe_,"probe_hoe[4]/D");
152  t_->Branch("probe_eop", probe_eop_,"probe_eop[4]/D");
153  t_->Branch("probe_pin", probe_pin_,"probe_pin[4]/D");
154  t_->Branch("probe_pout", probe_pout_,"probe_pout[4]/D");
155  t_->Branch("probe_rescPt", probe_rescPt_, "probe_rescPt[4]/D");
156  t_->Branch("probe_rescEta", probe_rescEta_, "probe_rescEta[4]/D");
157  t_->Branch("probe_rescPhi", probe_rescPhi_, "probe_rescPhi[4]/D");
158 
159  t_->Branch("Z_m", Z_m_, "Z_m[4]/D");
160  t_->Branch("Z_pt", Z_pt_, "Z_pt[4]/D");
161  t_->Branch("Z_eta", Z_eta_, "Z_eta[4]/D");
162  t_->Branch("Z_y", Z_y_, "Z_y[4]/D");
163  t_->Branch("Z_phi", Z_phi_, "Z_phi[4]/D");
164  t_->Branch("Z_rescM", Z_rescM_, "Z_rescM[4]/D");
165  t_->Branch("Z_rescPt", Z_rescPt_, "Z_rescPt[4]/D");
166  t_->Branch("Z_rescEta", Z_rescEta_, "Z_rescEta[4]/D");
167  t_->Branch("Z_rescY", Z_rescY_, "Z_rescY[4]/D");
168  t_->Branch("Z_rescPhi", Z_rescPhi_, "Z_rescPhi[4]/D");
169  t_->Branch("Z_probe_dPhi",Z_probe_dPhi_,"Z_probe_dPhi[4]/D");
170 
171  t_->Branch("probe_sc_pt",probe_sc_pt_, "probe_sc_pt[4]/D");
172  t_->Branch("probe_sc_eta",probe_sc_eta_, "probe_sc_eta[4]/D");
173  t_->Branch("probe_sc_phi", probe_sc_phi_, "probe_sc_phi[4]/D");
174  t_->Branch("probe_sc_E",probe_sc_E_, "probe_sc_E[4]/D");
175  t_->Branch("probe_sc_rawE",probe_sc_rawE_, "probe_sc_rawE[4]/D");
176  t_->Branch("probe_sc_nClus", probe_sc_nClus_, "probe_sc_nClus[4]/D");
177  t_->Branch("probe_scV2_E",probe_scV2_E_, "probe_scV2_E[4]/D");
178  t_->Branch("probe_scV3_E",probe_scV3_E_, "probe_scV3_E[4]/D");
179  t_->Branch("probe_scV4_E",probe_scV4_E_, "probe_scV4_E[4]/D");
180  t_->Branch("probe_d_MCE_SCE", probe_d_MCE_SCE_, "probe_d_MCE_SCE[4]/D");
181 
182  t_->Branch("ErsatzV1_Mesc", ErsatzV1_Mesc_, "ErsatzV1_Mesc[4]/D");
183  t_->Branch("ErsatzV1_rescMesc", ErsatzV1_rescMesc_, "ErsatzV1_rescMesc[4]/D");
184 
185  t_->Branch("McElec_nFinal", &McElec_nFinal_, "McElec_nFinal/I");
186 
187  if(Zevent_){
188  t_->Branch("McZ_m", &McZ_m_, "McZ_m/D");
189  t_->Branch("McZ_rescM", &McZ_rescM_, "McZ_rescM/D");
190  t_->Branch("McZ_Pt", &McZ_pt_, "McZ_Pt/D");
191  t_->Branch("McZ_y", &McZ_y_, "McZ_y/D");
192  t_->Branch("McZ_Eta", &McZ_eta_, "McZ_Eta/D");
193  t_->Branch("McZ_Phi", &McZ_phi_, "McZ_Phi/D");
194  t_->Branch("McZ_rescPt", &McZ_rescPt_, "McZ_Pt/D");
195  t_->Branch("McZ_rescY", &McZ_rescY_, "McZ_rescY/D");
196  t_->Branch("McZ_rescEta", &McZ_rescEta_, "McZ_Eta/D");
197  t_->Branch("McZ_rescPhi", &McZ_rescPhi_, "McZ_Phi/D");
198  t_->Branch("McElec_nZmum", &McElec_nZmum_, "McElec_nZmum/I");
199  t_->Branch("McElec_eta", &McElec_eta_, "McElec_eta[4]/D");
200  t_->Branch("McElec_pt", &McElec_pt_, "McElec_pt[4]/D");
201  t_->Branch("McElec_phi", &McElec_phi_, "McElec_phi[4]/D");
202  t_->Branch("McElec_rescEta", &McElec_rescEta_, "McElec_rescEta[4]/D");
203  t_->Branch("McElec_rescPhi", &McElec_rescPhi_, "McElec_rescPhi[4]/D");
204  t_->Branch("McElec_rescPt", &McElec_rescPt_, "McElec_rescPt[4]/D");
205  t_->Branch("McProbe_eta", &McProbe_eta_, "McProbe_eta[4]/D");
206  t_->Branch("McProbe_pt", &McProbe_pt_, "McProbe_pt[4]/D");
207  t_->Branch("McProbe_phi", &McProbe_phi_, "McProbe_phi[4]/D");
208  t_->Branch("McProbe_rescEta", &McProbe_rescEta_, "McProbe_rescEta[4]/D");
209  t_->Branch("McProbe_rescPt", &McProbe_rescPt_, "McProbe_rescPt[4]/D");
210  t_->Branch("McProbe_rescPhi", &McProbe_rescPhi_, "McProbe_rescPhi[4]/D");
211  t_->Branch("McElecProbe_dPhi", &McElecProbe_dPhi_, "McElecProbe_dPhi/D");
212  t_->Branch("McElecProbe_dEta", &McElecProbe_dEta_, "McElecProbe_dEta/D");
213  t_->Branch("McElecProbe_dR", &McElecProbe_dR_, "McElecProbe_dR/D");
214  }
215 
216 }
217 
218 void ErsatzMEt::analyze(const edm::Event& evt, const edm::EventSetup& es)
219 {
220 
221  es.get<CaloGeometryRecord>().get(geoHandle_);
222  es.get<CaloTopologyRecord>().get(pTopology_);
223 
224  edm::LogDebug_("","", 151)<<"Initialising variables.";
225  nTags_ = -99; nProbes_ = -99;
226  CaloMEt_ = -99.; CaloMEtphi_ = -99.;
227  T1MEt_ = -99.; T1MEtphi_ = -99.;
228  PfMEt_ = -99.; PfMEtphi_ = -99.;
229  TcMEt_ = -99.; TcMEtphi_ = -99.;
230  if(Zevent_)
231  {
232  McZ_m_ = -99.; McZ_pt_ = -99.; McZ_y_ = -99.; McZ_eta_ = -99.; McZ_phi_ = -99.;
233  McZ_rescM_ = -99.; McZ_rescPt_ = -99.; McZ_rescY_ = -99.; McZ_rescEta_ = -99.; McZ_rescPhi_ = -99.;
234  McElec_nZmum_ = -99; McElec_nFinal_ = -99;
235  }
236 
237  for(int i = 0; i < nEntries_arr_; ++i)
238  {
239  tag_q_[i] = -99;
240  tag_pt_[i] = -99.; tag_eta_[i] = -99.; tag_phi_[i] = -99.;
241  tag_rescPt_[i] = -99.; tag_rescEta_[i] = -99.; tag_rescPhi_[i] = -99.;
242  tag_trckIso_[i] = -99.; tag_ecalIso_[i] = -99.; tag_hcalIso_[i] = -99.;
243  tag_sIhIh_[i] = -99.; tag_dPhiIn_[i] = -99.; tag_dEtaIn_[i] = -99.;
244  tag_e5x5_[i] = -99.; tag_e2x5Max_[i] = -99.; tag_e1x5Max_[i] = -99.;
245  tag_hoe_[i] = -99.; tag_eop_[i] = -99.; tag_pin_[i] = -99.; tag_pout_[i] = -99.;
246 
247  probe_q_[i] = -99;
248  probe_pt_[i] = -99.; probe_eta_[i] = -99.; probe_phi_[i] = -99.;
249  probe_rescPt_[i] = -99.; probe_rescEta_[i] = -99.; probe_rescPhi_[i] = -99.;
250  probe_trckIso_[i] = -99.; probe_ecalIso_[i] = -99.; probe_hcalIso_[i] = -99.;
251  probe_sIhIh_[i] = -99.; probe_dPhiIn_[i] = -99.; probe_dEtaIn_[i] = -99.;
252  probe_e5x5_[i] = -99.; probe_e2x5Max_[i] = -99.; probe_e1x5Max_[i] = -99.;
253  probe_hoe_[i] = -99.; probe_eop_[i] = -99.; probe_pin_[i] = -99.; probe_pout_[i] = -99.;
254 
255  Z_pt_[i] = -99.; Z_y_[i] = -99.; Z_eta_[i] = -99.; Z_phi_[i] = -99.; Z_m_[i] = -99.;
256  Z_rescPt_[i] = -99.; Z_rescY_[i] = -99.; Z_rescEta_[i] = -99.; Z_rescPhi_[i] = -99.; Z_rescM_[i] = -99.; Z_probe_dPhi_[i] = -99.;
257 
258  ErsatzV1_Mesc_[i] = -99.; ErsatzV1_rescMesc_[i] = -99.;
259  ErsatzV2_Mesc_[i] = -99.; ErsatzV2_rescMesc_[i] = -99.;
260  ErsatzV3_Mesc_[i] = -99.; ErsatzV3_rescMesc_[i] = -99.;
261  ErsatzV4_Mesc_[i] = -99.; ErsatzV4_rescMesc_[i] = -99.;
262  ErsatzV1CaloMEt_[i] = -99.; ErsatzV1CaloMt_[i] = -99.; ErsatzV1CaloMEtPhi_[i] = -99.;
263  ErsatzV2CaloMEt_[i] = -99.; ErsatzV2CaloMt_[i] = -99.; ErsatzV2CaloMEtPhi_[i] = -99.;
264  ErsatzV3CaloMEt_[i] = -99.; ErsatzV3CaloMt_[i] = -99.; ErsatzV3CaloMEtPhi_[i] = -99.;
265  ErsatzV4CaloMEt_[i] = -99.; ErsatzV4CaloMt_[i] = -99.; ErsatzV4CaloMEtPhi_[i] = -99.;
266  ErsatzV1T1MEt_[i] = -99.; ErsatzV1T1Mt_[i] = -99.; ErsatzV1T1MEtPhi_[i] = -99.;
267  ErsatzV1PfMEt_[i] = -99.; ErsatzV1PfMt_[i] = -99.; ErsatzV1PfMEtPhi_[i] = -99.;
268  ErsatzV1TcMEt_[i] = -99.; ErsatzV1TcMt_[i] = -99.; ErsatzV1TcMEtPhi_[i] = -99.;
269 
270  probe_sc_pt_[i] = -99.; probe_sc_eta_[i] = -99.; probe_sc_phi_[i] = -99.;
271  probe_sc_E_[i] = -99.; probe_sc_rawE_[i] = -99.;
272  probe_scV2_E_[i] = -99.;
273  probe_scV3_E_[i] = -99.;
274  probe_scV4_E_[i] = -99.;
275 
276  if(Zevent_)
277  {
278  McElec_pt_[i] = -99.; McElec_eta_[i] = -99.; McElec_phi_[i] = -99.;
279  McElec_rescPt_[i] = -99.; McElec_rescEta_[i] = -99.; McElec_rescPhi_[i] = -99.;
280  McProbe_pt_[i] = -99.; McProbe_eta_[i] = -99.; McProbe_phi_[i] = -99.;
281  McProbe_rescPt_[i] = -99.; McProbe_rescEta_[i] = -99.; McProbe_rescPhi_[i] = -99.;
282  McElecProbe_dPhi_[i] = -99.; McElecProbe_dEta_[i] = -99.; McElecProbe_dR_[i] = -99.;
283  }
284 
285  edm::LogDebug_("","",180)<<"Initialisation of array index "<< i <<" completed.";
286  }
287  //Get Collections
289  try
290  {
291  evt.getByLabel(MCTruthCollection_, pGenPart);
292  }catch(cms::Exception &ex)
293  {
294  edm::LogError("analyze") <<"Can't get collection with label "<< MCTruthCollection_.label();
295  }
297  try
298  {
299  evt.getByLabel(ElectronCollection_, pElectrons);
300  }catch(cms::Exception &ex)
301  {
302  edm::LogError("analyze") <<"Can't get collection with label "<< ElectronCollection_.label();
303  }
305  try
306  {
307  evt.getByLabel(HybridScCollection_, pHybrid);
308  }catch(cms::Exception &ex)
309  {
310  edm::LogError("analyze") <<"Can't get collection with label "<< HybridScCollection_.label();
311  }
313  try
314  {
315  evt.getByLabel(M5x5ScCollection_, pM5x5);
316  }catch(cms::Exception &ex)
317  {
318  edm::LogError("analyze") <<"Can't get collection with label "<< M5x5ScCollection_.label();
319  }
321  try
322  {
323  evt.getByLabel(CaloMEtCollection_, pCaloMEt);
324  }catch(cms::Exception &ex)
325  {
326  edm::LogError("analyze")<<"Can't get collection with label "<< CaloMEtCollection_.label();
327  }
329 // try
330 // {
331 // evt.getByLabel(T1MEtCollection_, pT1MEt);
332 // }catch(cms::Exception &ex)
333 // {
334 // edm::LogError("analyze")<<"Can't get collection with label "<< T1MEtCollection_.label();
335 // }
337  try
338  {
339  evt.getByLabel(PfMEtCollection_, pPfMEt);
340  }catch(cms::Exception &ex)
341  {
342  edm::LogError("analyze")<<"Can't get collection with label "<< PfMEtCollection_.label();
343  }
345  try
346  {
347  evt.getByLabel(TcMEtCollection_, pTcMEt);
348  }catch(cms::Exception &ex)
349  {
350  edm::LogError("analyze")<<"Can't get collection with label "<< TcMEtCollection_.label();
351  }
353  try
354  {
355  evt.getByLabel(GenMEtCollection_, pGenMEt);
356  }catch(cms::Exception &ex)
357  {
358  edm::LogError("analyze")<<"Can't get collection with label "<< GenMEtCollection_.label();
359  }
360  edm::Handle<edm::TriggerResults> pTriggerResults;
361  try
362  {
363  evt.getByLabel(TriggerResults_, pTriggerResults);
364  }catch(cms::Exception &ex)
365  {
366  edm::LogError("analyze")<<"Cant get collection with label "<< TriggerResults_.label();
367  }
369  try
370  {
371  evt.getByLabel(TriggerEvent_, pHLT);
372  }catch(cms::Exception &ex)
373  {
374  edm::LogError("analyze")<<"Can't get collection with label "<< TriggerEvent_.label();
375  }
376 
377  std::vector<math::XYZTLorentzVector>McElecs,McElecsFinalState;
378  std::vector<math::XYZTLorentzVector> McElecsResc;
379  if(Zevent_)
380  {
381  edm::LogDebug_("","",289)<<"Analysing MC properties.";
382  const reco::GenParticleCollection *McCand = pGenPart.product();
383  math::XYZTLorentzVector Zboson, RescZboson, McElec1, McElec2;
384  for(reco::GenParticleCollection::const_iterator McP = McCand->begin(); McP != McCand->end(); ++McP)
385  {
386  const reco::Candidate* mum = McP->mother();
387  if(abs(McP->pdgId())==11 && abs(mum->pdgId()) == 23)
388  {
389  McElecs.push_back(McP->p4());
390  if(abs(mum->pdgId() == 23)) Zboson = mum->p4();
391 
392  std::cout <<"Found electron, ID = "<< McP->pdgId() <<"\t status = "<< McP->status()<<std::endl;
393  if(McP->status() != 1)
394  {
395  const reco::Candidate* McPD = McP->daughter(0);
396  McPD = McPD->mother();
397  while(McPD->status() != 1)
398  {
399  int n = McPD->numberOfDaughters();
400  std::cout<< McPD->pdgId() << " : status = "<<McPD->status()
401  <<"\tNumber of Daughters = "<< n <<std::endl;
402  for(int j = 0; j < n; ++ j)
403  {
404  const reco::Candidate *d = McPD->daughter( j );
405  std::cout <<"Daughter "<< j <<"\t id = "<< d->pdgId() << std::endl;
406  if(abs(d->pdgId()) == 11)
407  {
408  McPD = d;
409  break;
410  }
411  }
412  }
413  std::cout<< McPD->pdgId() << " : status = "<<McPD->status()<<"\tAdding to vector!"<<std::endl;
414  McElecsFinalState.push_back(McPD->p4());
415  }else McElecsFinalState.push_back(McP->p4());
416  }
417  }
418  McZ_m_ = Zboson.M(); McZ_pt_ = Zboson.Pt(); McZ_phi_ = Zboson.Phi(); McZ_eta_ = Zboson.Eta(); McZ_y_ = Zboson.Rapidity();
419  McElec_nZmum_ =McElecs.size();
420  McElec_nFinal_ =McElecsFinalState.size();
421  edm::LogDebug_("","",309)<<"MC electrons with Z mother = "<< McElec_nZmum_
422  <<"\tFinal state MC electrons = "<< McElec_nFinal_;
423 
424  McElecsResc.resize(2);
425 // RescZboson.SetCoordinates(Zboson.Px(), Zboson.Py(), Zboson.Pz(), sqrt(Zboson.P2()+(mW_*mW_*Zboson.M2())/(mZ_*mZ_)));
426  RescZboson.SetCoordinates(Zboson.Px()*mW_/mZ_, Zboson.Py()*mW_/mZ_, Zboson.Pz()*mW_/mZ_, Zboson.E()*mW_/mZ_);
427  McZ_rescM_ = RescZboson.M(); McZ_rescPt_ = RescZboson.Pt(); McZ_rescEta_ = RescZboson.Eta(); McZ_rescPhi_ = RescZboson.Phi();
428  McZ_rescY_ = RescZboson.Rapidity();
429  ROOT::Math::Boost CoMBoost(Zboson.BoostToCM());
430 
431  math::XYZTLorentzVector RescMcElec0 = CoMBoost(McElecsFinalState[0]);
432  math::XYZTLorentzVector RescMcElec1 = CoMBoost(McElecsFinalState[1]);
433  RescMcElec0 *= mW_/mZ_;
434  RescMcElec1 *= mW_/mZ_;
435 
436  double E_W = RescZboson.E();
437  ROOT::Math::Boost BackToLab(RescZboson.Px()/E_W, RescZboson.Py()/E_W, RescZboson.Pz()/E_W);
438 
439  RescMcElec0 = BackToLab(RescMcElec0);
440 // RndmMcElec_Rescaled_pt_ = RescMcElec0.Pt();
441 // RndmMcElec_Rescaled_eta_ = RescMcElec0.Eta();
442 // RndmMcElec_Rescaled_phi_ = RescMcElec0.Phi();
443 
444  RescMcElec1 = BackToLab(RescMcElec1);
445 // OthrMcElec_Rescaled_pt_ = RescMcElec1.Pt();
446 // OthrMcElec_Rescaled_eta_ = RescMcElec1.Eta();
447 // OthrMcElec_Rescaled_phi_ = RescMcElec1.Phi();
448  McElecsResc[0] = RescMcElec0;
449  McElecsResc[1] = RescMcElec1;
450  math::XYZTLorentzVector sum = RescMcElec1+RescMcElec0;
451  edm::LogDebug_("","", 307)<<"McElecsResc[0] + McElecsResc[1] = ("<<sum.Px()<<", "<<sum.Py()<<", "
452  <<sum.Pz()<<", "<<sum.E()<<")";
453  }
454 
455  const edm::TriggerResults* HltRes = pTriggerResults.product();
456  const edm::TriggerNames & triggerNames = evt.triggerNames(*HltRes);
457  if(HLTPathCheck_)
458  {
459  for(unsigned int itrig = 0; itrig < HltRes->size(); ++itrig)
460  {
461  std::string nom = triggerNames.triggerName(itrig);
462  edm::LogInfo("")<< itrig <<" : Name = "<< nom <<"\t Accepted = "<< HltRes->accept(itrig);
463  }
464  }
465  if(HltRes->accept(34) ==0) edm::LogError("")<<"Event did not pass "<< triggerNames.triggerName(34)<<"!";
466  if(HltRes->accept(34) !=0)
467  {
468  std::vector<reco::GsfElectronRef> UniqueElectrons;
469  UniqueElectrons = uniqueElectronFinder(pElectrons);
470  edm::LogDebug_("","ErsatzMEt",192)<<"Unique electron size = "<<UniqueElectrons.size();
471  std::vector<reco::GsfElectronRef> SelectedElectrons;
472  const unsigned int fId = pHLT->filterIndex(TriggerPath_);
473  std::cout << "Filter Id = " << fId << std::endl;
474  SelectedElectrons = electronSelector(UniqueElectrons, pHLT, fId, CutVector_);
475  nTags_ = SelectedElectrons.size();
476  edm::LogDebug_("","ErsatzMEt",197)<<"Selected electron size = "<<nTags_;
477 
478  iComb_ = 0;
479  if(Zevent_)
480  {
481  //Match MC electrons to the selected electrons and store some of their properties in the tree.
482  //The properties of the other MC electron (i.e. that not selected) are also stored.
483  for(std::vector<reco::GsfElectronRef>::const_iterator elec = SelectedElectrons.begin();
484  elec != SelectedElectrons.end(); ++elec)
485  {
486  for(int m = 0; m < 2; ++m)
487  {
488  double dRLimit = 99.;
489  double dR = reco::deltaR(McElecs[m], *(*elec));
490  if(dR < dRLimit)
491  {
492  dRLimit = dR;
493  McElec_pt_[iComb_] = McElecs[m].pt();
494  McElec_eta_[iComb_] = McElecs[m].eta();
495  McElec_rescPt_[iComb_] = McElecsResc[m].pt();
496  McElec_rescEta_[iComb_] = McElecsResc[m].eta();
497  }
498  }
499  }
500  }
501 
502  std::map<reco::GsfElectronRef, reco::GsfElectronRef> TagProbePairs;
503  TagProbePairs = probeFinder(SelectedElectrons, pElectrons);
504  nProbes_ = TagProbePairs.size();
505  edm::LogDebug_("", "ErsatzMEt", 209)<<"Number of tag-probe pairs = "<< TagProbePairs.size();
506 
507  if(!TagProbePairs.empty())
508  {
509  const reco::CaloMETCollection* caloMEtCollection = pCaloMEt.product();
510  const reco::MET calomet = *(caloMEtCollection->begin());
511  CaloMEt_ = calomet.pt();
512  CaloMEtphi_ = calomet.phi();
513 
514  //const reco::METCollection* t1MEtCollection = pT1MEt.product();
515  //const reco::MET t1met = *(t1MEtCollection->begin());
516  //T1MEt_ = t1met.pt();
517  //T1MEtphi_ = t1met.phi();
518 
519  const reco::PFMETCollection* pfMEtCollection = pPfMEt.product();
520  const reco::MET pfmet = *(pfMEtCollection->begin());
521  PfMEt_ = pfmet.pt();
522  PfMEtphi_ = pfmet.phi();
523 
524  const reco::METCollection* tcMEtCollection = pTcMEt.product();
525  const reco::MET tcmet = *(tcMEtCollection->begin());
526  TcMEt_ = tcmet.pt();
527  TcMEtphi_ = tcmet.phi();
528 
529  reco::MET ersatzMEt;
530 
531  for(std::map<reco::GsfElectronRef, reco::GsfElectronRef>::const_iterator it = TagProbePairs.begin();
532  it != TagProbePairs.end(); ++it)
533  {
534  edm::LogDebug_("","DelendumLoop", 293)<<"iComb_ = "<< iComb_;
535  tag_q_[iComb_] = it->first->charge();
536  edm::LogDebug_("","",360)<<"tag charge = "<< tag_q_[iComb_];
537  tag_pt_[iComb_] = it->first->pt();
538  tag_eta_[iComb_] = it->first->eta();
539  tag_phi_[iComb_] = it->first->phi();
540  edm::LogDebug_("","ErsatzMEt", 364)<<"tag pt = "<< tag_pt_[iComb_]
541  <<"\teta = "<< tag_eta_[iComb_]<<"\tphi = "<< tag_phi_[iComb_];
542  tag_trckIso_[iComb_] = it->first->isolationVariables03().tkSumPt;
543  tag_ecalIso_[iComb_] = it->first->isolationVariables04().ecalRecHitSumEt;
544  tag_hcalIso_[iComb_] = it->first->isolationVariables04().hcalDepth1TowerSumEt
545  + it->first->isolationVariables04().hcalDepth2TowerSumEt;
546  edm::LogDebug_("","ErsatzMEt", 370)<<"tag trackiso = "<< tag_trckIso_[iComb_]
547  <<"\tecaliso = "<< tag_ecalIso_[iComb_]<<"\thcaliso = "<< tag_hcalIso_[iComb_];
548  tag_sIhIh_[iComb_] = it->first->scSigmaIEtaIEta();
549  tag_dPhiIn_[iComb_] = it->first->deltaPhiSuperClusterTrackAtVtx();
550  tag_dEtaIn_[iComb_] = it->first->deltaEtaSuperClusterTrackAtVtx();
551  edm::LogDebug_("","ErsatzMEt", 245)<<"tag sIhIh = "<< tag_sIhIh_[iComb_]
552  <<"\tdPhiIn = "<< tag_dPhiIn_[iComb_]<<"\tdEtaIn = "<< tag_dEtaIn_[iComb_];
553  tag_e5x5_[iComb_] = it->first->scE5x5();
554  tag_e2x5Max_[iComb_] = it->first->scE2x5Max();
555  tag_e2x5Max_[iComb_] = it->first->scE1x5();
556  edm::LogDebug_("","ErsatzMEt", 245)<<"tag e5x5 = "<< tag_e5x5_[iComb_]
557  <<"\te2x5Max = "<< tag_e2x5Max_[iComb_]<<"\te1x5Max = "<< tag_e1x5Max_[iComb_];
558  tag_hoe_[iComb_] = it->first->hadronicOverEm();
559  tag_eop_[iComb_] = it->first->eSuperClusterOverP();
560  tag_pin_[iComb_] = it->first->trackMomentumAtVtx().R();
561  tag_pout_[iComb_] = it->first->trackMomentumOut().R();
562  edm::LogDebug_("","ErsatzMEt", 245)<<"tag hoe = "<<tag_hoe_[iComb_]<<"\tpoe = "<<tag_eop_[iComb_]
563  <<"\tpin = "<< tag_pin_[iComb_]<<"\tpout = "<< tag_pout_[iComb_];
564  probe_q_[iComb_] = it->first->charge();
565  edm::LogDebug_("","",360)<<"probe charge = "<< probe_q_[iComb_];
566  probe_pt_[iComb_] = it->second->pt();
567  probe_eta_[iComb_] = it->second->eta();
568  probe_phi_[iComb_] = it->second->phi();
569  edm::LogDebug_("","ErsatzMEt", 245)<<"probe pt = "<< probe_pt_[iComb_]
570  <<"\teta = "<< probe_eta_[iComb_]<<"\tphi = "<< probe_phi_[iComb_];
571  probe_trckIso_[iComb_] = it->second->isolationVariables03().tkSumPt;
572  probe_ecalIso_[iComb_] = it->second->isolationVariables04().ecalRecHitSumEt;
573  probe_hcalIso_[iComb_] = it->second->isolationVariables04().hcalDepth1TowerSumEt
574  + it->second->isolationVariables04().hcalDepth2TowerSumEt;
575  edm::LogDebug_("","ErsatzMEt", 245)<<"probe trackiso = "<< probe_trckIso_[iComb_]
576  <<"\tecaliso = "<< probe_ecalIso_[iComb_]<<"\thcaliso = "<< probe_phi_[iComb_];
577  probe_sIhIh_[iComb_] = it->second->scSigmaIEtaIEta();
578  probe_dPhiIn_[iComb_] = it->second->deltaPhiSuperClusterTrackAtVtx();
579  probe_dEtaIn_[iComb_] = it->second->deltaEtaSuperClusterTrackAtVtx();
580  edm::LogDebug_("","ErsatzMEt", 245)<<"probe sIhIh = "<< probe_sIhIh_[iComb_]
581  <<"\tdPhiIn = "<< probe_dPhiIn_[iComb_]<<"\tdEtaIn = "<< probe_dEtaIn_[iComb_];
582  probe_e5x5_[iComb_] = it->second->scE5x5();
583  probe_e2x5Max_[iComb_] = it->second->scE2x5Max();
584  probe_e2x5Max_[iComb_] = it->second->scE1x5();
585  edm::LogDebug_("","ErsatzMEt", 245)<<"probe e5x5 = "<< probe_e5x5_[iComb_]
586  <<"\te2x5Max = "<< probe_e2x5Max_[iComb_]<<"\te1x5Max = "<< probe_e1x5Max_[iComb_];
587  probe_hoe_[iComb_] = it->second->hadronicOverEm();
588  probe_eop_[iComb_] = it->second->eSuperClusterOverP();
589  probe_pin_[iComb_] = it->second->trackMomentumAtVtx().R();
590  probe_pout_[iComb_] = it->second->trackMomentumOut().R();
591  edm::LogDebug_("","ErsatzMEt", 245)<<"probe hoe = "<<probe_hoe_[iComb_]<<"\tpoe = "<<probe_eop_[iComb_]
592  <<"\tpin = "<< probe_pin_[iComb_]<<"\tpout = "<< probe_pout_[iComb_];
593 
594  double dRLimit = 0.2;
595  for(unsigned int mcEId = 0; mcEId < McElecs.size(); ++mcEId)
596  {
597 // double dR = reco::deltaR((*(*mcEl)), probeVec);
598  double dR = reco::deltaR(McElecs[mcEId], it->second->p4());
599  if(dR < dRLimit)
600  {
601  dRLimit = dR;
602  McProbe_pt_[iComb_] = McElecs[mcEId].pt();
603  McProbe_eta_[iComb_] = McElecs[mcEId].eta();
604  McProbe_phi_[iComb_] = McElecs[mcEId].phi();
605  McProbe_rescPt_[iComb_] = McElecsResc[mcEId].pt();
606  McProbe_rescEta_[iComb_] = McElecsResc[mcEId].eta();
607  McProbe_rescPhi_[iComb_] = McElecsResc[mcEId].phi();
608  probe_d_MCE_SCE_[iComb_] = McElecs[mcEId].energy() - it->second->superCluster()->rawEnergy();
609  McElecProbe_dPhi_[iComb_] = reco::deltaPhi(McElecs[mcEId].phi(), McElecs[(mcEId+1)%2].phi());
610  McElecProbe_dEta_[iComb_] = fabs(McElecs[mcEId].eta() - McElecs[(mcEId+1)%2].eta());
611  McElecProbe_dR_[iComb_] = reco::deltaR(McElecs[mcEId], McElecs[(mcEId+1)%2]);
612  }
613  }
614 
615  // Uncorrected supercluster V1
616  reco::SuperCluster scV1 = *(it->second->superCluster());
617  math::XYZTLorentzVector probe_scV1_detVec = DetectorVector(scV1);
618  probe_sc_pt_[iComb_] = probe_scV1_detVec.pt();
619  probe_sc_eta_[iComb_] = scV1.eta();
620  probe_sc_phi_[iComb_] = scV1.phi();
622  probe_sc_E_[iComb_] = scV1.energy();
623  probe_sc_rawE_[iComb_] = scV1.rawEnergy();
624 
625  ersatzMEt = ersatzFabrik(it->first, scV1, calomet, 1);
626  ErsatzV1CaloMEt_[iComb_] = ersatzMEt.pt();
627  ErsatzV1CaloMEtPhi_[iComb_] = ersatzMEt.phi();
628  //ersatzMEt = ersatzFabrik(it->first, it->second, t1met);
629  //ErsatzV1T1MEt_[iComb_] = ersatzMEt.pt();
630  //ErsatzV1T1MEtPhi_[iComb_] = ersatzMEt.phi();
631  ersatzMEt = ersatzFabrik(it->first, it->second, pfmet);
632  ErsatzV1PfMEt_[iComb_] = ersatzMEt.pt();
633  ErsatzV1PfMEtPhi_[iComb_] = ersatzMEt.phi();
634  ersatzMEt = ersatzFabrik(it->first, it->second, tcmet);
635  ErsatzV1TcMEt_[iComb_] = ersatzMEt.pt();
636  ErsatzV1TcMEtPhi_[iComb_] = ersatzMEt.phi();
637 
638  // fEta corrected supercluster V2
639  reco::SuperCluster scV2;
640  if(fabs(probe_sc_eta_[iComb_]) < 1.479)
641  {
642  scV2 = fEtaScCorr(scV1);
643  }else{
644  scV2 = scV1;
645  }
646  math::XYZTLorentzVector probe_scV2_detVec = DetectorVector(scV2);
647  probe_scV2_E_[iComb_] = scV2.energy();
648  ersatzMEt = ersatzFabrik(it->first, scV2, calomet, 2);
649  ErsatzV2CaloMEt_[iComb_] = ersatzMEt.pt();
650  ErsatzV2CaloMEtPhi_[iComb_] = ersatzMEt.phi();
651 
652  // fBrem corrected supercluster V3
653  reco::SuperCluster scV3;
654  if(fabs(probe_sc_eta_[iComb_]) < 1.479)
655  {
656  scV3 = fBremScCorr(scV1, hyb_fCorrPSet_);
657  }else{
658  scV3 = fBremScCorr(scV1, m5x5_fCorrPSet_);
659  }
660  math::XYZTLorentzVector probe_scV3_detVec = DetectorVector(scV3);
661  probe_scV3_E_[iComb_] = scV3.energy();
662  ersatzMEt = ersatzFabrik(it->first, scV3, calomet, 3);
663  ErsatzV3CaloMEt_[iComb_] = ersatzMEt.pt();
664  ErsatzV3CaloMEtPhi_[iComb_] = ersatzMEt.phi();
665 
666  // Fully corrected supercluster V4
667  reco::SuperCluster scV4;
668  if(fabs(probe_sc_eta_[iComb_]) < 1.479)
669  {
670  scV4 = fBremScCorr(scV1, hyb_fCorrPSet_);
671  }else{
672  scV4 = fBremScCorr(scV1, m5x5_fCorrPSet_);
673  }
674  math::XYZTLorentzVector probe_scV4_detVec = DetectorVector(scV4);
675  probe_scV4_E_[iComb_] = scV4.energy();
676  ersatzMEt = ersatzFabrik(it->first, scV4, calomet, 4);
677  ErsatzV4CaloMEt_[iComb_] = ersatzMEt.pt();
678  ErsatzV4CaloMEtPhi_[iComb_] = ersatzMEt.phi();
679 
680  ++iComb_;
681  }
682  t_->Fill();
683  }
684  }
685 }
686 
687 std::map<reco::GsfElectronRef, reco::GsfElectronRef> ErsatzMEt::probeFinder(const std::vector<reco::GsfElectronRef>& tags,
689 {
690  const reco::GsfElectronCollection *probeCands = pElectrons.product();
691  std::map<reco::GsfElectronRef, reco::GsfElectronRef> TagProbes;
692  for(std::vector<reco::GsfElectronRef>::const_iterator tagelec = tags.begin(); tagelec != tags.end(); ++tagelec)
693  {
694  reco::GsfElectronRef tag = *tagelec;
695  std::pair<reco::GsfElectronRef, reco::GsfElectronRef> TagProbePair;
696  int nProbesPerTag = 0;
697  int index = 0;
698  for(reco::GsfElectronCollection::const_iterator probeelec = probeCands->begin(); probeelec != probeCands->end(); ++probeelec)
699  {
700  reco::GsfElectronRef probe(pElectrons, index);
701  double probeScEta = probe->superCluster()->eta();
702  if(probe->superCluster() != tag->superCluster() && fabs(probeScEta) < 2.5)
703  {
704  if(fabs(probeScEta) < 1.4442 || fabs(probeScEta) > 1.560)
705  {
706  double invmass = ROOT::Math::VectorUtil::InvariantMass(tag->p4(), probe->p4());
707  if(mTPmin_ <= invmass && invmass <= mTPmax_)
708  {
709  TagProbePair = std::make_pair(tag, probe);
710  ++nProbesPerTag;
711  }
712  }
713  }
714  ++index;
715  }
716  //nGsfElectrons_ = index;
717  if(nProbesPerTag == 1) TagProbes.insert(TagProbePair);
718  }
719  return TagProbes;
720 }
721 
723  const reco::SuperCluster& sc,
724  const reco::MET& met,
725  const int corr)
726 {
727  const math::XYZPoint ZVertex(elec->TrackPositionAtVtx().X(), elec->TrackPositionAtVtx().Y(),elec->TrackPositionAtVtx().Z());
728 
729  math::XYZTLorentzVector nu, boost_nu, ele, boost_ele;
730  reco::SuperCluster elecSc = *(elec->superCluster());
731  nu = PhysicsVectorRaw(met.vertex(), sc);
732  boost_nu = PhysicsVectorRaw(ZVertex, sc);
733  ele = PhysicsVectorRaw(met.vertex(), elecSc);
734  boost_ele = ele;
735 
736  //Should use reco vertex for best Z->ee measurement.
737  edm::LogDebug_("ersatzFabrikV1", "", 569)<<"elec = ("<< elec->p4().Px() << ", "<< elec->p4().Py()<< ", "<< elec->p4().Pz() << ", "<< elec->p4().E()<<")";
738  math::XYZTLorentzVector Zboson = boost_nu + elec->p4();
739  edm::LogDebug_("ersatzFabrikV1", "", 569)<<"Z pt = "<< Zboson.Pt() << "Z boson mass = " << Zboson.M();
740  edm::LogDebug_("ersatzFabrikV1","", 570)<<"Z boson in lab frame = ("<<Zboson.Px()<<", "<<Zboson.Py()<<", "
741  <<Zboson.Pz()<<", "<<Zboson.E()<<")";
742  math::XYZTLorentzVector RescZboson(Zboson.Px(), Zboson.Py(), Zboson.Pz(), sqrt(Zboson.P2()+(mW_*mW_*Zboson.M2())/(mZ_*mZ_)));
743  edm::LogDebug_("ersatzFabrikV1","", 573)<<"W boson in lab frame = ("<<RescZboson.Px()<<", "<<RescZboson.Py()<<", "
744  <<RescZboson.Pz()<<", "<<RescZboson.E()<<")";
745  ROOT::Math::Boost BoostToZRestFrame(Zboson.BoostToCM());
746  edm::LogDebug_("ersatzFabrikV1","", 576)<<"Electron in lab frame = ("<< boost_ele.Px()<<", "<< boost_ele.Py()<<", "
747  << boost_ele.Pz()<<", "<< boost_ele.E()<<")";
748  edm::LogDebug_("ersatzFabrikV1","", 578)<<"Ersatz Neutrino in lab frame = ("<< boost_nu.Px()<<", "<< boost_nu.Py()<<", "
749  << boost_nu.Pz()<<", "<< boost_nu.E()<<")";
750  boost_ele = BoostToZRestFrame(boost_ele);
751  boost_nu = BoostToZRestFrame(boost_nu);
752  edm::LogDebug_("ersatzFabrikV1","", 582)<<"Electron in Z rest frame = ("<<boost_ele.Px()<<", "<<boost_ele.Py()<<", "
753  <<boost_ele.Pz()<<", "<<boost_ele.E()<<")";
754  edm::LogDebug_("ersatzFabrikV1","", 584)<<"Ersatz Neutrino in Z rest frame = ("<<boost_nu.Px()<<", "<<boost_nu.Py()<<", "
755  <<boost_nu.Pz()<<", "<<boost_nu.E()<<")";
756  boost_ele *= mW_/mZ_;
757  boost_nu *= mW_/mZ_;
758 
759  double E_W = RescZboson.E();
760  ROOT::Math::Boost BackToLab(RescZboson.Px()/E_W, RescZboson.Py()/E_W, RescZboson.Pz()/E_W);
761  math::XYZTLorentzVector metVec(-99999., -99999., -99., -99999.);
762  boost_ele = BackToLab(boost_ele);
763 
764  boost_nu = BackToLab(boost_nu);
765  math::XYZTLorentzVector sum = boost_nu+boost_ele;
766  edm::LogDebug_("ersatzFabrikV1","", 597)<<"Electron back in lab frame = ("<<boost_ele.Px()<<", "<<boost_ele.Py()<<", "
767  <<boost_ele.Pz()<<", "<<boost_ele.E()<<")";
768  edm::LogDebug_("ersatzFabrikV1","", 599)<<"Ersatz Neutrino back in lab frame = ("<<boost_nu.Px()<<", "<<boost_nu.Py()<<", "
769  <<boost_nu.Pz()<<", "<<boost_nu.E()<<")";
770  edm::LogDebug_("ersatzFabrikV1","", 601)<<"boost_ele + boost_nu = ("<<sum.Px()<<", "<<sum.Py()<<", "
771  <<sum.Pz()<<", "<<sum.E()<<")";
772 
773  nu.SetXYZT(nu.X(), nu.Y(), 0., nu.T());
774  ele.SetXYZT(ele.X(), ele.Y(), 0., ele.T());
775  boost_ele.SetXYZT(boost_ele.X(), boost_ele.Y(), 0., boost_ele.T());
776  metVec = met.p4() + nu + ele - boost_ele;
777 
778  reco::MET ersatzMEt(metVec, met.vertex());
779  if (corr == 1)
780  {
781  //Z_caloV1_m_[iComb_] = Zboson.M();
782  //Z_caloV1_pt_[iComb_] = Zboson.Pt();
783  //Z_caloV1_y_[iComb_] = Zboson.Y();
784  //Z_caloV1_eta_[iComb_] = Zboson.Eta();
785  //Z_caloV1_phi_[iComb_] = Zboson.Phi();
786  //Z_caloV1_rescM_[iComb_] = RescZboson.M();
787  //Z_caloV1_rescPt_[iComb_] = RescZboson.Pt();
788  //Z_caloV1_rescY_[iComb_] = RescZboson.Y();
789  //Z_caloV1_rescEta_[iComb_] = RescZboson.Eta();
790  //Z_caloV1_rescPhi_[iComb_] = RescZboson.Phi();
791  //Z_caloV1_probe_dPhi_[iComb_] = reco::deltaPhi(Zboson.Phi(), elec->phi());
792  //tag_caloV1_rescPt_[iComb_] = boost_ele.Pt();
793  //tag_caloV1_rescEta_[iComb_] = boost_ele.Eta();
794  //tag_caloV1_rescPhi_[iComb_] = boost_ele.Phi();
795  //probe_caloV1_rescPt_[iComb_] = boost_nu.Pt();
796  //probe_caloV1_rescEta_[iComb_] = boost_nu.Eta();
797  //probe_caloV1_rescPhi_[iComb_] = boost_nu.Phi();
800  ErsatzV1CaloMt_[iComb_] = sqrt(2.*boost_ele.Pt()*ersatzMEt.pt()*
801  (1-cos(reco::deltaPhi(boost_ele.Phi(), ersatzMEt.phi()))));
802  }
803  if (corr == 2)
804  {
805  //Z_caloV2_m_[iComb_] = Zboson.M();
806  //Z_caloV2_pt_[iComb_] = Zboson.Pt();
807  //Z_caloV2_y_[iComb_] = Zboson.Y();
808  //Z_caloV2_eta_[iComb_] = Zboson.Eta();
809  //Z_caloV2_phi_[iComb_] = Zboson.Phi();
810  //Z_caloV2_rescM_[iComb_] = RescZboson.M();
811  //Z_caloV2_rescPt_[iComb_] = RescZboson.Pt();
812  //Z_caloV2_rescY_[iComb_] = RescZboson.Y();
813  //Z_caloV2_rescEta_[iComb_] = RescZboson.Eta();
814  //Z_caloV2_rescPhi_[iComb_] = RescZboson.Phi();
815  //Z_caloV2_probe_dPhi_[iComb_] = reco::deltaPhi(Zboson.Phi(), boost_elec->phi());
816  //tag_caloV2_rescPt_[iComb_] = boost_ele.Pt();
817  //tag_caloV2_rescEta_[iComb_] = boost_ele.Eta();
818  //tag_caloV2_rescPhi_[iComb_] = boost_ele.Phi();
819  //probe_caloV2_rescPt_[iComb_] = boost_nu.Pt();
820  //probe_caloV2_rescEta_[iComb_] = boost_nu.Eta();
821  //probe_caloV2_rescPhi_[iComb_] = boost_nu.Phi();
824  ErsatzV2CaloMt_[iComb_] = sqrt(2.*boost_ele.Pt()*ersatzMEt.pt()*
825  (1-cos(reco::deltaPhi(boost_ele.Phi(), ersatzMEt.phi()))));
826  }
827  if (corr == 3)
828  {
829  //Z_caloV3_m_[iComb_] = Zboson.M();
830  //Z_caloV3_pt_[iComb_] = Zboson.Pt();
831  //Z_caloV3_y_[iComb_] = Zboson.Y();
832  //Z_caloV3_eta_[iComb_] = Zboson.Eta();
833  //Z_caloV3_phi_[iComb_] = Zboson.Phi();
834  //Z_caloV3_rescM_[iComb_] = RescZboson.M();
835  //Z_caloV3_rescPt_[iComb_] = RescZboson.Pt();
836  //Z_caloV3_rescY_[iComb_] = RescZboson.Y();
837  //Z_caloV3_rescEta_[iComb_] = RescZboson.Eta();
838  //Z_caloV3_rescPhi_[iComb_] = RescZboson.Phi();
839  //Z_caloV3_probe_dPhi_[iComb_] = reco::deltaPhi(Zboson.Phi(), boost_elec->phi());
840  //tag_caloV3_rescPt_[iComb_] = boost_ele.Pt();
841  //tag_caloV3_rescEta_[iComb_] = boost_ele.Eta();
842  //tag_caloV3_rescPhi_[iComb_] = boost_ele.Phi();
843  //probe_caloV3_rescPt_[iComb_] = boost_nu.Pt();
844  //probe_caloV3_rescEta_[iComb_] = boost_nu.Eta();
845  //probe_caloV3_rescPhi_[iComb_] = boost_nu.Phi();
848  ErsatzV3CaloMt_[iComb_] = sqrt(2.*boost_ele.Pt()*ersatzMEt.pt()*
849  (1-cos(reco::deltaPhi(boost_ele.Phi(), ersatzMEt.phi()))));
850  }
851  if (corr == 4)
852  {
853  //Z_caloV4_m_[iComb_] = Zboson.M();
854  //Z_caloV4_pt_[iComb_] = Zboson.Pt();
855  //Z_caloV4_y_[iComb_] = Zboson.Y();
856  //Z_caloV4_eta_[iComb_] = Zboson.Eta();
857  //Z_caloV4_phi_[iComb_] = Zboson.Phi();
858  //Z_caloV4_rescM_[iComb_] = RescZboson.M();
859  //Z_caloV4_rescPt_[iComb_] = RescZboson.Pt();
860  //Z_caloV4_rescY_[iComb_] = RescZboson.Y();
861  //Z_caloV4_rescEta_[iComb_] = RescZboson.Eta();
862  //Z_caloV4_rescPhi_[iComb_] = RescZboson.Phi();
863  //Z_caloV4_probe_dPhi_[iComb_] = reco::deltaPhi(Zboson.Phi(), boost_elec->phi());
864  //tag_caloV4_rescPt_[iComb_] = boost_ele.Pt();
865  //tag_caloV4_rescEta_[iComb_] = boost_ele.Eta();
866  //tag_caloV4_rescPhi_[iComb_] = boost_ele.Phi();
867  //probe_caloV4_rescPt_[iComb_] = boost_nu.Pt();
868  //probe_caloV4_rescEta_[iComb_] = boost_nu.Eta();
869  //probe_caloV4_rescPhi_[iComb_] = boost_nu.Phi();
872  ErsatzV4CaloMt_[iComb_] = sqrt(2.*boost_ele.Pt()*ersatzMEt.pt()*
873  (1-cos(reco::deltaPhi(boost_ele.Phi(), ersatzMEt.phi()))));
874  }
875  return ersatzMEt;
876 }
877 
879  const reco::GsfElectronRef& probe,
880  const reco::MET& met)
881 {
882  math::XYZTLorentzVector elec, nu, boost_elec, boost_nu;
883  boost_elec = tag->p4();
884  edm::LogDebug_("ersatzFabrikV1", "", 858)<<"boost_elec = ("<< boost_elec.Px() << ", "<< boost_elec.Py()<< ", "<< boost_elec.Pz() << ", "<< boost_elec.E()<<")";
885  boost_nu = probe->p4();
886  edm::LogDebug_("ersatzFabrikV1", "", 860)<<"boost_nu = ("<< boost_nu.Px() << ", "<< boost_nu.Py()<< ", "<< boost_nu.Pz() << ", "<< boost_nu.E()<<")";
887  math::XYZTLorentzVector Zboson = boost_elec + boost_nu;
888  edm::LogDebug_("ersatzFabrikV1", "", 862)<<"Zboson = ("<< Zboson.Px() << ", "<< Zboson.Py()<< ", "<< Zboson.Pz() << ", "<< Zboson.E()<<")";
889  math::XYZTLorentzVector RescZboson(Zboson.Px(), Zboson.Py(), Zboson.Pz(), sqrt(Zboson.P2()+(mW_*mW_*Zboson.M2())/(mZ_*mZ_)));
890  edm::LogDebug_("ersatzFabrikV1", "", 864)<<"RescZboson = ("<< RescZboson.Px() << ", "<< RescZboson.Py()<< ", "<< RescZboson.Pz() << ", "<< RescZboson.E()<<")";
891  ROOT::Math::Boost BoostToZRestFrame(Zboson.BoostToCM());
892  elec = BoostToZRestFrame(boost_elec);
893  edm::LogDebug_("ersatzFabrikV1", "", 867)<<"boost_elec (in Z rest frame) = ("<< elec.Px() << ", "<< elec.Py()<< ", "<< elec.Pz() << ", "<< elec.E()<<")";
894  nu = BoostToZRestFrame(boost_nu);
895  edm::LogDebug_("ersatzFabrikV1", "", 869)<<"boost_nu (in Z rest frame) = ("<< nu.Px() << ", "<< nu.Py()<< ", "<< nu.Pz() << ", "<< nu.E()<<")";
896  elec *= mW_/mZ_;
897  edm::LogDebug_("ersatzFabrikV1", "", 871)<<"elec (in Z rest frame) = ("<< elec.Px() << ", "<< elec.Py()<< ", "<< elec.Pz() << ", "<< elec.E()<<")";
898  nu *= mW_/mZ_;
899  edm::LogDebug_("ersatzFabrikV1", "", 873)<<"nu (in Z rest frame) = ("<< nu.Px() << ", "<< nu.Py()<< ", "<< nu.Pz() << ", "<< nu.E()<<")";
900  ROOT::Math::Boost BoostBackToLab(RescZboson.Px()/RescZboson.E(), RescZboson.Py()/RescZboson.E(), RescZboson.Pz()/RescZboson.E());
901  math::XYZTLorentzVector metVec(-99999., -99999., -99., -99999.);
902  elec = BoostBackToLab(elec);
903  edm::LogDebug_("ersatzFabrikV1", "", 877)<<"elec = ("<< elec.Px() << ", "<< elec.Py()<< ", "<< elec.Pz() << ", "<< elec.E()<<")";
904  nu = BoostBackToLab(nu);
905  edm::LogDebug_("ersatzFabrikV1", "", 879)<<"nu = ("<< nu.Px() << ", "<< nu.Py()<< ", "<< nu.Pz() << ", "<< nu.E()<<")";
906  Z_m_[iComb_] = Zboson.M();
907  Z_pt_[iComb_] = Zboson.Pt();
908  Z_y_[iComb_] = Zboson.Y();
909  Z_eta_[iComb_] = Zboson.Eta();
910  Z_phi_[iComb_] = Zboson.Phi();
911  Z_rescM_[iComb_] = RescZboson.M();
912  Z_rescPt_[iComb_] = RescZboson.Pt();
913  Z_rescY_[iComb_] = RescZboson.Y();
914  Z_rescEta_[iComb_] = RescZboson.Eta();
915  Z_rescPhi_[iComb_] = RescZboson.Phi();
916  Z_probe_dPhi_[iComb_] = reco::deltaPhi(Zboson.Phi(), boost_elec.phi());
917  tag_rescPt_[iComb_] = elec.Pt();
918  tag_rescEta_[iComb_] = elec.Eta();
919  tag_rescPhi_[iComb_] = elec.Phi();
920  probe_rescPt_[iComb_] = nu.Pt();
921  probe_rescEta_[iComb_] = nu.Eta();
922  probe_rescPhi_[iComb_] = nu.Phi();
923  elec.SetXYZT(elec.X(), elec.Y(), 0., elec.T());
924  nu.SetXYZT(nu.X(), nu.Y(), 0., nu.T());
925  boost_elec.SetXYZT(boost_elec.X(), boost_elec.Y(), 0., boost_elec.T());
926  metVec = met.p4() + nu + elec - boost_elec;
927  reco::MET ersatzMEt(metVec, met.vertex());
928  return ersatzMEt;
929 }
930 
932 {
933  return (fabs(eta) < BarrelEtaMax_);
934 }
935 
937 {
938  return (fabs(eta) < EndCapEtaMax_ && fabs(eta) > EndCapEtaMin_);
939 }
940 
942 {
943  return isInBarrel(eta) || isInEndCap(eta);
944 }
945 
946 // ------------ method called once each job just after ending the event loop ------------
948 }
949 //define this as a plug-in
951 
double tag_ecalIso_[nEntries_arr_]
Definition: ErsatzMEt.h:158
double McProbe_eta_[nEntries_arr_]
Definition: ErsatzMEt.h:185
double probe_sIhIh_[nEntries_arr_]
Definition: ErsatzMEt.h:164
double McProbe_rescEta_[nEntries_arr_]
Definition: ErsatzMEt.h:186
double McElec_rescEta_[nEntries_arr_]
Definition: ErsatzMEt.h:184
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
double tag_rescEta_[nEntries_arr_]
Definition: ErsatzMEt.h:156
std::vector< double > CutVector_
Definition: ErsatzMEt.h:131
T getParameter(std::string const &) const
double tag_dPhiIn_[nEntries_arr_]
Definition: ErsatzMEt.h:157
double ErsatzV3CaloMt_[nEntries_arr_]
Definition: ErsatzMEt.h:173
ErsatzMEt(const edm::ParameterSet &)
Definition: ErsatzMEt.cc:4
double probe_trckIso_[nEntries_arr_]
Definition: ErsatzMEt.h:165
double mZ_
Definition: ErsatzMEt.h:125
int i
Definition: DBlmapReader.cc:9
double probe_sc_nClus_[nEntries_arr_]
Definition: ErsatzMEt.h:191
double McZ_pt_
Definition: ErsatzMEt.h:146
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:208
double ErsatzV1TcMt_[nEntries_arr_]
Definition: ErsatzMEt.h:177
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
edm::InputTag TriggerEvent_
Definition: ErsatzMEt.h:122
std::vector< reco::GsfElectronRef > uniqueElectronFinder(edm::Handle< reco::GsfElectronCollection > &pElectrons)
double probe_ecalIso_[nEntries_arr_]
Definition: ErsatzMEt.h:165
double McElec_rescPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:184
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
double probe_eta_[nEntries_arr_]
Definition: ErsatzMEt.h:162
bool HLTPathCheck_
Definition: ErsatzMEt.h:134
std::vector< TagProbePair > TagProbePairs
edm::ParameterSet hyb_fCorrPSet_
Definition: ErsatzMEt.h:124
double ErsatzV2CaloMEt_[nEntries_arr_]
Definition: ErsatzMEt.h:172
double ErsatzV1CaloMt_[nEntries_arr_]
Definition: ErsatzMEt.h:171
double ErsatzV4CaloMEtPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:174
double ErsatzV4CaloMt_[nEntries_arr_]
Definition: ErsatzMEt.h:174
virtual const Point & vertex() const
vertex position
edm::InputTag TriggerResults_
Definition: ErsatzMEt.h:122
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
double probe_sc_eta_[nEntries_arr_]
Definition: ErsatzMEt.h:190
edm::InputTag M5x5ScCollection_
Definition: ErsatzMEt.h:118
virtual int status() const =0
status word
double McElec_pt_[nEntries_arr_]
Definition: ErsatzMEt.h:183
double BarrelEtaMax_
Definition: ErsatzMEt.h:126
double probe_hoe_[nEntries_arr_]
Definition: ErsatzMEt.h:167
bool accept() const
Has at least one path accepted the event?
double probe_hcalIso_[nEntries_arr_]
Definition: ErsatzMEt.h:165
edm::InputTag TriggerPath_
Definition: ErsatzMEt.h:122
double ErsatzV4_Mesc_[nEntries_arr_]
Definition: ErsatzMEt.h:181
double tag_e2x5Max_[nEntries_arr_]
Definition: ErsatzMEt.h:159
double McProbe_pt_[nEntries_arr_]
Definition: ErsatzMEt.h:185
math::XYZTLorentzVector DetectorVector(const reco::SuperClusterRef &sc)
Definition: CaloVectors.h:3
reco::SuperCluster fEtaScCorr(const reco::SuperCluster &sc)
#define abs(x)
Definition: mlp_lapack.h:159
double probe_pt_[nEntries_arr_]
Definition: ErsatzMEt.h:162
double McElecProbe_dR_[nEntries_arr_]
Definition: ErsatzMEt.h:187
double Z_pt_[nEntries_arr_]
Definition: ErsatzMEt.h:168
double ErsatzV1T1MEtPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:175
double Z_m_[nEntries_arr_]
Definition: ErsatzMEt.h:168
edm::InputTag GenMEtCollection_
Definition: ErsatzMEt.h:120
bool Zevent_
Definition: ErsatzMEt.h:134
double McZ_rescY_
Definition: ErsatzMEt.h:147
double tag_hcalIso_[nEntries_arr_]
Definition: ErsatzMEt.h:158
~ErsatzMEt()
Definition: ErsatzMEt.cc:68
T eta() const
double ErsatzV1_rescMesc_[nEntries_arr_]
Definition: ErsatzMEt.h:178
edm::InputTag MCTruthCollection_
Definition: ErsatzMEt.h:117
double probe_eop_[nEntries_arr_]
Definition: ErsatzMEt.h:167
double Z_rescM_[nEntries_arr_]
Definition: ErsatzMEt.h:169
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:23
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
double mTPmin_
Definition: ErsatzMEt.h:125
double probe_e2x5Max_[nEntries_arr_]
Definition: ErsatzMEt.h:166
double tag_trckIso_[nEntries_arr_]
Definition: ErsatzMEt.h:158
double ErsatzV2_rescMesc_[nEntries_arr_]
Definition: ErsatzMEt.h:179
double T1MEt_
Definition: ErsatzMEt.h:143
double ErsatzV1_Mesc_[nEntries_arr_]
Definition: ErsatzMEt.h:178
double probe_pin_[nEntries_arr_]
Definition: ErsatzMEt.h:167
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:160
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
double probe_sc_pt_[nEntries_arr_]
Definition: ErsatzMEt.h:190
double TcMEt_
Definition: ErsatzMEt.h:143
double Z_rescY_[nEntries_arr_]
Definition: ErsatzMEt.h:169
double ErsatzV1T1Mt_[nEntries_arr_]
Definition: ErsatzMEt.h:175
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
double tag_hoe_[nEntries_arr_]
Definition: ErsatzMEt.h:160
double McElec_rescPt_[nEntries_arr_]
Definition: ErsatzMEt.h:184
edm::InputTag CaloMEtCollection_
Definition: ErsatzMEt.h:120
double Z_y_[nEntries_arr_]
Definition: ErsatzMEt.h:168
double mTPmax_
Definition: ErsatzMEt.h:125
virtual size_type numberOfDaughters() const =0
number of daughters
double probe_scV3_E_[nEntries_arr_]
Definition: ErsatzMEt.h:193
int McElec_nZmum_
Definition: ErsatzMEt.h:145
double EndCapEtaMin_
Definition: ErsatzMEt.h:126
int nProbes_
Definition: ErsatzMEt.h:142
double probe_e5x5_[nEntries_arr_]
Definition: ErsatzMEt.h:166
double McZ_y_
Definition: ErsatzMEt.h:146
double T1MEtphi_
Definition: ErsatzMEt.h:144
edm::ParameterSet m5x5_fCorrPSet_
Definition: ErsatzMEt.h:124
double PfMEt_
Definition: ErsatzMEt.h:143
int tag_q_[nEntries_arr_]
Definition: ErsatzMEt.h:150
double probe_sc_rawE_[nEntries_arr_]
Definition: ErsatzMEt.h:191
double ErsatzV3CaloMEt_[nEntries_arr_]
Definition: ErsatzMEt.h:173
Definition: MET.h:32
double ErsatzV1PfMt_[nEntries_arr_]
Definition: ErsatzMEt.h:176
int nTags_
Definition: ErsatzMEt.h:142
double Z_rescEta_[nEntries_arr_]
Definition: ErsatzMEt.h:169
T sqrt(T t)
Definition: SSEVec.h:28
unsigned int size() const
Get number of paths stored.
double McZ_rescEta_
Definition: ErsatzMEt.h:147
double ErsatzV3CaloMEtPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:173
reco::SuperCluster fBremScCorr(const reco::SuperCluster &sc, const edm::ParameterSet &ps)
double PfMEtphi_
Definition: ErsatzMEt.h:144
double McElec_phi_[nEntries_arr_]
Definition: ErsatzMEt.h:183
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double probe_e1x5Max_[nEntries_arr_]
Definition: ErsatzMEt.h:166
double ErsatzV3_rescMesc_[nEntries_arr_]
Definition: ErsatzMEt.h:180
double Z_phi_[nEntries_arr_]
Definition: ErsatzMEt.h:168
int j
Definition: DBlmapReader.cc:9
double probe_rescPt_[nEntries_arr_]
Definition: ErsatzMEt.h:163
virtual void beginJob()
Definition: ErsatzMEt.cc:73
double energy() const
cluster energy
Definition: CaloCluster.h:120
edm::InputTag HybridScCollection_
Definition: ErsatzMEt.h:118
double ErsatzV1T1MEt_[nEntries_arr_]
Definition: ErsatzMEt.h:175
double McZ_rescM_
Definition: ErsatzMEt.h:147
double McProbe_rescPt_[nEntries_arr_]
Definition: ErsatzMEt.h:186
double McZ_rescPhi_
Definition: ErsatzMEt.h:147
double probe_d_MCE_SCE_[nEntries_arr_]
Definition: ErsatzMEt.h:189
double CaloMEtphi_
Definition: ErsatzMEt.h:144
double ErsatzV1CaloMEtPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:171
double McElec_eta_[nEntries_arr_]
Definition: ErsatzMEt.h:183
double probe_dPhiIn_[nEntries_arr_]
Definition: ErsatzMEt.h:164
double ErsatzV2_Mesc_[nEntries_arr_]
Definition: ErsatzMEt.h:179
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
edm::InputTag PfMEtCollection_
Definition: ErsatzMEt.h:120
math::XYZTLorentzVector PhysicsVectorRaw(const math::XYZPoint &vertex, const reco::SuperCluster &sc)
Definition: CaloVectors.h:34
JetCorrectorParameters corr
Definition: classes.h:9
double probe_phi_[nEntries_arr_]
Definition: ErsatzMEt.h:162
double probe_scV2_E_[nEntries_arr_]
Definition: ErsatzMEt.h:192
double probe_rescPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:163
double McZ_phi_
Definition: ErsatzMEt.h:146
double tag_rescPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:156
tuple tags
Definition: o2o.py:248
edm::ESHandle< CaloGeometry > geoHandle_
Definition: ErsatzMEt.h:138
virtual int pdgId() const =0
PDG identifier.
double tag_dEtaIn_[nEntries_arr_]
Definition: ErsatzMEt.h:157
double ErsatzV1CaloMEt_[nEntries_arr_]
Definition: ErsatzMEt.h:171
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
#define nEntries_arr_
double McZ_eta_
Definition: ErsatzMEt.h:146
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:47
bool isInFiducial(double)
Definition: ErsatzMEt.cc:941
double ErsatzV3_Mesc_[nEntries_arr_]
Definition: ErsatzMEt.h:180
bool isInBarrel(double)
Definition: ErsatzMEt.cc:931
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
double ErsatzV1PfMEtPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:176
double tag_phi_[nEntries_arr_]
Definition: ErsatzMEt.h:151
double tag_sIhIh_[nEntries_arr_]
Definition: ErsatzMEt.h:157
std::vector< reco::GsfElectronRef > electronSelector(const std::vector< reco::GsfElectronRef > &electrons, const edm::Handle< trigger::TriggerEvent > &pHLT, const int filterId, const std::vector< double > &Cuts)
double probe_dEtaIn_[nEntries_arr_]
Definition: ErsatzMEt.h:164
virtual double pt() const
transverse momentum
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
double tag_rescPt_[nEntries_arr_]
Definition: ErsatzMEt.h:156
double tag_pt_[nEntries_arr_]
Definition: ErsatzMEt.h:151
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
size_t clustersSize() const
number of BasicCluster constituents
Definition: SuperCluster.h:77
const T & get() const
Definition: EventSetup.h:55
double Z_eta_[nEntries_arr_]
Definition: ErsatzMEt.h:168
double McProbe_rescPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:186
int iComb_
Definition: ErsatzMEt.h:196
virtual void endJob()
Definition: ErsatzMEt.cc:947
double ErsatzV1TcMEt_[nEntries_arr_]
Definition: ErsatzMEt.h:177
double probe_sc_E_[nEntries_arr_]
Definition: ErsatzMEt.h:191
T const * product() const
Definition: Handle.h:74
int McElec_nFinal_
Definition: ErsatzMEt.h:145
edm::InputTag TcMEtCollection_
Definition: ErsatzMEt.h:120
std::string const & label() const
Definition: InputTag.h:25
double ErsatzV4_rescMesc_[nEntries_arr_]
Definition: ErsatzMEt.h:181
double ErsatzV1PfMEt_[nEntries_arr_]
Definition: ErsatzMEt.h:176
int probe_q_[nEntries_arr_]
Definition: ErsatzMEt.h:161
double tag_pin_[nEntries_arr_]
Definition: ErsatzMEt.h:160
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
double McZ_rescPt_
Definition: ErsatzMEt.h:147
double McZ_m_
Definition: ErsatzMEt.h:146
double Z_rescPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:169
T * make() const
make new ROOT object
double ErsatzV1TcMEtPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:177
double ErsatzV2CaloMt_[nEntries_arr_]
Definition: ErsatzMEt.h:172
double EndCapEtaMax_
Definition: ErsatzMEt.h:126
reco::MET ersatzFabrik(const reco::GsfElectronRef &, const reco::SuperCluster &, const reco::MET &, const int)
Definition: ErsatzMEt.cc:722
double probe_sc_phi_[nEntries_arr_]
Definition: ErsatzMEt.h:190
double McElecProbe_dEta_[nEntries_arr_]
Definition: ErsatzMEt.h:187
tuple cout
Definition: gather_cfg.py:41
double tag_e5x5_[nEntries_arr_]
Definition: ErsatzMEt.h:159
double probe_pout_[nEntries_arr_]
Definition: ErsatzMEt.h:167
edm::InputTag ElectronCollection_
Definition: ErsatzMEt.h:118
double ErsatzV4CaloMEt_[nEntries_arr_]
Definition: ErsatzMEt.h:174
double tag_eop_[nEntries_arr_]
Definition: ErsatzMEt.h:160
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: ErsatzMEt.cc:218
bool isInEndCap(double)
Definition: ErsatzMEt.cc:936
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:163
std::map< reco::GsfElectronRef, reco::GsfElectronRef > probeFinder(const std::vector< reco::GsfElectronRef > &, const edm::Handle< reco::GsfElectronCollection >)
Definition: ErsatzMEt.cc:687
TTree * t_
Definition: ErsatzMEt.h:141
double Z_rescPt_[nEntries_arr_]
Definition: ErsatzMEt.h:169
double tag_eta_[nEntries_arr_]
Definition: ErsatzMEt.h:151
double Z_probe_dPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:170
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
double McProbe_phi_[nEntries_arr_]
Definition: ErsatzMEt.h:185
double probe_rescEta_[nEntries_arr_]
Definition: ErsatzMEt.h:163
double mW_
Definition: ErsatzMEt.h:125
double CaloMEt_
Definition: ErsatzMEt.h:143
edm::ESHandle< CaloTopology > pTopology_
Definition: ErsatzMEt.h:139
double ErsatzV2CaloMEtPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:172
std::string TriggerName_
Definition: ErsatzMEt.h:123
double McElecProbe_dPhi_[nEntries_arr_]
Definition: ErsatzMEt.h:187
double probe_scV4_E_[nEntries_arr_]
Definition: ErsatzMEt.h:194
double tag_pout_[nEntries_arr_]
Definition: ErsatzMEt.h:160
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
double TcMEtphi_
Definition: ErsatzMEt.h:144
Definition: DDAxes.h:10
double tag_e1x5Max_[nEntries_arr_]
Definition: ErsatzMEt.h:159