CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IsolatedTracksHcalScale.cc
Go to the documentation of this file.
1 
5 
16 
18 
19  //now do what ever initialization is needed
20  doMC = iConfig.getUntrackedParameter<bool>("DoMC", false);
21  myverbose = iConfig.getUntrackedParameter<int>("Verbosity", 5 );
22  theTrackQuality = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
24  selectionParameters.minPt = iConfig.getUntrackedParameter<double>("MinTrackPt", 10.0);
25  selectionParameters.minQuality = trackQuality_;
26  selectionParameters.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.2);
27  selectionParameters.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 5.0);
28  selectionParameters.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
29  selectionParameters.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
30  selectionParameters.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
31  selectionParameters.minLayerCrossed = iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
32  selectionParameters.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
33  selectionParameters.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
34  a_coneR = iConfig.getUntrackedParameter<double>("ConeRadius",34.98);
35  a_charIsoR = a_coneR + 28.9;
36  a_neutIsoR = a_charIsoR*0.726;
37  a_mipR = iConfig.getUntrackedParameter<double>("ConeRadiusMIP",14.0);
38  tMinE_ = iConfig.getUntrackedParameter<double>("TimeMinCutECAL", -500.);
39  tMaxE_ = iConfig.getUntrackedParameter<double>("TimeMaxCutECAL", 500.);
40 
41  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
42  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
43  tok_bs_ = consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
44  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEB"));
45  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEE"));
46  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
47  tok_simTk_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
48  tok_simVtx_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
49  tok_caloEB_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEB"));
50  tok_caloEE_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEE"));
51  tok_caloHH_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits"));
52 
53  if (myverbose>=0) {
54  std::cout <<"Parameters read from config file \n"
55  <<" doMC " << doMC
56  <<"\t myverbose " << myverbose
57  <<"\t minPt " << selectionParameters.minPt
58  <<"\t theTrackQuality " << theTrackQuality
59  <<"\t minQuality " << selectionParameters.minQuality
60  <<"\t maxDxyPV " << selectionParameters.maxDxyPV
61  <<"\t maxDzPV " << selectionParameters.maxDzPV
62  <<"\t maxChi2 " << selectionParameters.maxChi2
63  <<"\t maxDpOverP " << selectionParameters.maxDpOverP
64  <<"\t minOuterHit " << selectionParameters.minOuterHit
65  <<"\t minLayerCrossed " << selectionParameters.minLayerCrossed
66  <<"\t maxInMiss " << selectionParameters.maxInMiss
67  <<"\t maxOutMiss " << selectionParameters.maxOutMiss
68  <<"\t a_coneR " << a_coneR
69  <<"\t a_charIsoR " << a_charIsoR
70  <<"\t a_neutIsoR " << a_neutIsoR
71  <<"\t a_mipR " << a_mipR
72  <<"\t time Range (" << tMinE_ << ":" << tMaxE_ << ")"
73  << std::endl;
74  }
75  initL1 = false;
76 
77 }
78 
80 
82 
84  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
85  bField = bFieldH.product();
86 
87  // get handles to calogeometry and calotopology
89  iSetup.get<CaloGeometryRecord>().get(pG);
90  const CaloGeometry* geo = pG.product();
91 
92  edm::ESHandle<CaloTopology> theCaloTopology;
93  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
94  const CaloTopology *caloTopology = theCaloTopology.product();
95 
96  // Retrieve the good/bad ECAL channels from the DB
98  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
99  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
100 
102 
103  nEventProc++;
104 
105  t_RunNo = iEvent.id().run();
106  t_EvtNo = iEvent.id().event();
107  t_Lumi = iEvent.luminosityBlock();
108  t_Bunch = iEvent.bunchCrossing();
109  if (myverbose>0) std::cout << nEventProc << " Run " << t_RunNo << " Event " << t_EvtNo << " Lumi " << t_Lumi << " Bunch " << t_Bunch << std::endl;
110 
112  iEvent.getByToken(tok_genTrack_, trkCollection);
113 
115  iEvent.getByToken(tok_recVtx_,recVtxs);
116 
117  // Get the beamspot
118  edm::Handle<reco::BeamSpot> beamSpotH;
119  iEvent.getByToken(tok_bs_, beamSpotH);
120 
121  math::XYZPoint leadPV(0,0,0);
122  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
123  leadPV = math::XYZPoint( (*recVtxs)[0].x(),(*recVtxs)[0].y(), (*recVtxs)[0].z() );
124  } else if (beamSpotH.isValid()) {
125  leadPV = beamSpotH->position();
126  }
127 
128  if (myverbose>0) {
129  std::cout << "Primary Vertex " << leadPV;
130  if (beamSpotH.isValid()) std::cout << " Beam Spot " << beamSpotH->position();
131  std::cout << std::endl;
132  }
133 
134  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
135  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality, trkCaloDirections, (myverbose>2));
136  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
137 
138  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
139  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
140  iEvent.getByToken(tok_EB_,barrelRecHitsHandle);
141  iEvent.getByToken(tok_EE_,endcapRecHitsHandle);
142 
144  iEvent.getByToken(tok_hbhe_, hbhe);
145  const HBHERecHitCollection Hithbhe = *(hbhe.product());
146 
147  //get Handles to SimTracks and SimHits
149  edm::SimTrackContainer::const_iterator simTrkItr;
151 
152  //get Handles to PCaloHitContainers of eb/ee/hbhe
156 
157  //associates tracker rechits/simhits to a track
158  TrackerHitAssociator* associate=0;
159 
160  if (doMC) {
161  iEvent.getByToken(tok_simTk_,SimTk);
162  iEvent.getByToken(tok_simVtx_,SimVtx);
163  iEvent.getByToken(tok_caloEB_, pcaloeb);
164  iEvent.getByToken(tok_caloEE_, pcaloee);
165  iEvent.getByToken(tok_caloHH_, pcalohh);
166  associate = new TrackerHitAssociator(iEvent);
167  }
168 
169  unsigned int nTracks=0;
170  for (trkDetItr = trkCaloDirections.begin(),nTracks=0; trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++){
171  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
172  if (spr::goodTrack(pTrack,leadPV,selectionParameters,(myverbose>2)) && trkDetItr->okECAL && trkDetItr->okHCAL) {
173  int nRH_eMipDR=0, nRH_eDR=0, nNearTRKs=0, nRecHitsCone=-99;
174  double distFromHotCell=-99.0, distFromHotCell2=-99.0;
175  int ietaHotCell=-99, iphiHotCell=-99;
176  int ietaHotCell2=-99, iphiHotCell2=-99;
177  GlobalPoint gposHotCell(0.,0.,0.), gposHotCell2(0.,0.,0.);
178  std::vector<DetId> coneRecHitDetIds, coneRecHitDetIds2;
179  std::pair<double, bool> e11x11_20SigP, e15x15_20SigP;
180  double hCone = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
181  trkDetItr->pointECAL,
182  a_coneR, trkDetItr->directionHCAL,
183  nRecHitsCone, coneRecHitDetIds,
184  distFromHotCell, ietaHotCell, iphiHotCell,
185  gposHotCell, -1);
186  double hConeHB = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
187  trkDetItr->pointECAL,
188  a_coneR, trkDetItr->directionHCAL,
189  nRecHitsCone, coneRecHitDetIds,
190  distFromHotCell, ietaHotCell,
191  iphiHotCell, gposHotCell,
192  (int)(HcalBarrel));
193  double eHCALDR = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
194  trkDetItr->pointECAL, a_charIsoR,
195  trkDetItr->directionHCAL, nRecHitsCone,
196  coneRecHitDetIds2, distFromHotCell2,
197  ietaHotCell2, iphiHotCell2, gposHotCell2,
198  -1);
199  double eHCALDRHB = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
200  trkDetItr->pointECAL, a_charIsoR,
201  trkDetItr->directionHCAL, nRecHitsCone,
202  coneRecHitDetIds2, distFromHotCell2,
203  ietaHotCell2, iphiHotCell2,
204  gposHotCell2, (int)(HcalBarrel));
205 
206  double conehmaxNearP = spr::chargeIsolationCone(nTracks, trkCaloDirections, a_charIsoR, nNearTRKs, (myverbose>3));
207 
208  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
209  endcapRecHitsHandle,trkDetItr->pointHCAL,
210  trkDetItr->pointECAL, a_mipR,
211  trkDetItr->directionECAL, nRH_eMipDR);
212  double eECALDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
213  endcapRecHitsHandle,trkDetItr->pointHCAL,
214  trkDetItr->pointECAL, a_neutIsoR,
215  trkDetItr->directionECAL, nRH_eDR);
216  double eMipDR_1= spr::eCone_ecal(geo, barrelRecHitsHandle,
217  endcapRecHitsHandle,trkDetItr->pointHCAL,
218  trkDetItr->pointECAL, a_mipR,
219  trkDetItr->directionECAL, nRH_eMipDR,
220  0.030, 0.150);
221  double eECALDR_1=spr::eCone_ecal(geo, barrelRecHitsHandle,
222  endcapRecHitsHandle,trkDetItr->pointHCAL,
223  trkDetItr->pointECAL, a_neutIsoR,
224  trkDetItr->directionECAL, nRH_eDR,
225  0.030, 0.150);
226  double eMipDR_2= spr::eCone_ecal(geo, barrelRecHitsHandle,
227  endcapRecHitsHandle,trkDetItr->pointHCAL,
228  trkDetItr->pointECAL, a_mipR,
229  trkDetItr->directionECAL, nRH_eMipDR,
230  0.060, 0.300);
231  double eECALDR_2=spr::eCone_ecal(geo, barrelRecHitsHandle,
232  endcapRecHitsHandle,trkDetItr->pointHCAL,
233  trkDetItr->pointECAL, a_neutIsoR,
234  trkDetItr->directionECAL, nRH_eDR,
235  0.060, 0.300);
236 
237  HcalDetId closestCell = (HcalDetId)(trkDetItr->detIdHCAL);
238 
240  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
241 
242  e11x11_20SigP = spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.060, 0.300, tMinE_,tMaxE_);
243  e15x15_20SigP = spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.060, 0.300, tMinE_,tMaxE_);
244 
245  // Fill the tree Branches here
246  t_trackP ->push_back( pTrack->p() );
247  t_trackPt ->push_back( pTrack->pt() );
248  t_trackEta ->push_back( pTrack->momentum().eta() );
249  t_trackPhi ->push_back( pTrack->momentum().phi() );
250  t_trackHcalEta ->push_back( closestCell.ieta() );
251  t_trackHcalPhi ->push_back( closestCell.iphi() );
252  t_hCone ->push_back( hCone);
253  t_conehmaxNearP ->push_back( conehmaxNearP);
254  t_eMipDR ->push_back( eMipDR);
255  t_eECALDR ->push_back( eECALDR);
256  t_eHCALDR ->push_back( eHCALDR);
257  t_e11x11_20Sig ->push_back( e11x11_20SigP.first );
258  t_e15x15_20Sig ->push_back( e15x15_20SigP.first );
259  t_eMipDR_1 ->push_back( eMipDR_1);
260  t_eECALDR_1 ->push_back( eECALDR_1);
261  t_eMipDR_2 ->push_back( eMipDR_2);
262  t_eECALDR_2 ->push_back( eECALDR_2);
263  t_hConeHB ->push_back( hConeHB);
264  t_eHCALDRHB ->push_back( eHCALDRHB);
265 
266  if (myverbose > 0) {
267  std::cout << "Track p " << pTrack->p() << " pt " << pTrack->pt()
268  << " eta " << pTrack->momentum().eta() << " phi "
269  << pTrack->momentum().phi() << " ieta/iphi ("
270  << closestCell.ieta() << ", " << closestCell.iphi()
271  << ") Energy in cone " << hCone << " Charge Isolation "
272  << conehmaxNearP << " eMIP (" << eMipDR << ", "
273  << eMipDR_1 << ", " << eMipDR_2 << ")"
274  << " Neutral isolation (ECAL) (" << eECALDR-eMipDR << ", "
275  << eECALDR_1-eMipDR_1 << ", " << eECALDR_2-eMipDR_2 << ")"
276  << " (ECAL NxN) " << e15x15_20SigP.first-e11x11_20SigP.first
277  << " (HCAL) " << eHCALDR-hCone << std::endl;
278  }
279 
280  if (doMC) {
281  int nSimHits = -999;
282  double hsim;
283  std::map<std::string, double> hsimInfo;
284  std::vector<int> multiplicity;
285  hsim = spr::eCone_hcal(geo, pcalohh, trkDetItr->pointHCAL,
286  trkDetItr->pointECAL, a_coneR,
287  trkDetItr->directionHCAL, nSimHits);
288  hsimInfo = spr::eHCALSimInfoCone(iEvent, pcalohh, SimTk, SimVtx,
289  pTrack, *associate, geo,
290  trkDetItr->pointHCAL,
291  trkDetItr->pointECAL, a_coneR,
292  trkDetItr->directionHCAL,
293  multiplicity);
294 
295  t_hsimInfoMatched ->push_back(hsimInfo["eMatched" ]);
296  t_hsimInfoRest ->push_back(hsimInfo["eRest" ]);
297  t_hsimInfoPhoton ->push_back(hsimInfo["eGamma" ]);
298  t_hsimInfoNeutHad ->push_back(hsimInfo["eNeutralHad"]);
299  t_hsimInfoCharHad ->push_back(hsimInfo["eChargedHad"]);
300  t_hsimInfoPdgMatched->push_back(hsimInfo["pdgMatched" ]);
301  t_hsimInfoTotal ->push_back(hsimInfo["eTotal" ]);
302 
303  t_hsimInfoNMatched ->push_back(multiplicity.at(0));
304  t_hsimInfoNTotal ->push_back(multiplicity.at(1));
305  t_hsimInfoNNeutHad ->push_back(multiplicity.at(2));
306  t_hsimInfoNCharHad ->push_back(multiplicity.at(3));
307  t_hsimInfoNPhoton ->push_back(multiplicity.at(4));
308  t_hsimInfoNRest ->push_back(multiplicity.at(5));
309 
310  t_hsim ->push_back(hsim );
311  t_nSimHits ->push_back(nSimHits );
312 
313  if (myverbose > 0) {
314  std::cout << "Matched (E) " << hsimInfo["eMatched"] << " (N) "
315  << multiplicity.at(0) << " Rest (E) " << hsimInfo["eRest"]
316  << " (N) " << multiplicity.at(1) << " Gamma (E) "
317  << hsimInfo["eGamma"] << " (N) " << multiplicity.at(2)
318  << " Neutral Had (E) " << hsimInfo["eNeutralHad"]
319  << " (N) " << multiplicity.at(3) << " Charged Had (E) "
320  << hsimInfo["eChargedHad"] << " (N) " << multiplicity.at(4)
321  << " Total (E) " << hsimInfo["eTotal"] << " (N) "
322  << multiplicity.at(5) << " PDG " << hsimInfo["pdgMatched"]
323  << " Total E " << hsim << " NHit " << nSimHits <<std::endl;
324  }
325  }
326  }
327  }
328 
329  // delete associate;
330  if (associate) delete associate;
331  tree->Fill();
332 }
333 
335 
336  nEventProc=0;
337 
338 
340  tree = fs->make<TTree>("tree", "tree");
341  tree->SetAutoSave(10000);
342 
343  tree->Branch("t_RunNo" ,&t_RunNo ,"t_RunNo/I");
344  tree->Branch("t_Lumi" ,&t_Lumi ,"t_Lumi/I");
345  tree->Branch("t_Bunch" ,&t_Bunch ,"t_Bunch/I");
346 
347  t_trackP = new std::vector<double>();
348  t_trackPt = new std::vector<double>();
349  t_trackEta = new std::vector<double>();
350  t_trackPhi = new std::vector<double>();
351  t_trackHcalEta = new std::vector<double>();
352  t_trackHcalPhi = new std::vector<double>();
353  t_hCone = new std::vector<double>();
354  t_conehmaxNearP = new std::vector<double>();
355  t_eMipDR = new std::vector<double>();
356  t_eECALDR = new std::vector<double>();
357  t_eHCALDR = new std::vector<double>();
358  t_e11x11_20Sig = new std::vector<double>();
359  t_e15x15_20Sig = new std::vector<double>();
360  t_eMipDR_1 = new std::vector<double>();
361  t_eECALDR_1 = new std::vector<double>();
362  t_eMipDR_2 = new std::vector<double>();
363  t_eECALDR_2 = new std::vector<double>();
364  t_hConeHB = new std::vector<double>();
365  t_eHCALDRHB = new std::vector<double>();
366 
367  tree->Branch("t_trackP", "vector<double>", &t_trackP );
368  tree->Branch("t_trackPt", "vector<double>", &t_trackPt );
369  tree->Branch("t_trackEta", "vector<double>", &t_trackEta );
370  tree->Branch("t_trackPhi", "vector<double>", &t_trackPhi );
371  tree->Branch("t_trackHcalEta", "vector<double>", &t_trackHcalEta );
372  tree->Branch("t_trackHcalPhi", "vector<double>", &t_trackHcalPhi );
373  tree->Branch("t_hCone", "vector<double>", &t_hCone );
374  tree->Branch("t_conehmaxNearP", "vector<double>", &t_conehmaxNearP );
375  tree->Branch("t_eMipDR", "vector<double>", &t_eMipDR );
376  tree->Branch("t_eECALDR", "vector<double>", &t_eECALDR );
377  tree->Branch("t_eHCALDR", "vector<double>", &t_eHCALDR );
378  tree->Branch("t_e11x11_20Sig", "vector<double>", &t_e11x11_20Sig );
379  tree->Branch("t_e15x15_20Sig", "vector<double>", &t_e15x15_20Sig );
380  tree->Branch("t_eMipDR_1", "vector<double>", &t_eMipDR_1 );
381  tree->Branch("t_eECALDR_1", "vector<double>", &t_eECALDR_1 );
382  tree->Branch("t_eMipDR_2", "vector<double>", &t_eMipDR_2 );
383  tree->Branch("t_eECALDR_2", "vector<double>", &t_eECALDR_2 );
384  tree->Branch("t_hConeHB", "vector<double>", &t_hConeHB );
385  tree->Branch("t_eHCALDRHB", "vector<double>", &t_eHCALDRHB );
386 
387  if (doMC) {
388  t_hsimInfoMatched = new std::vector<double>();
389  t_hsimInfoRest = new std::vector<double>();
390  t_hsimInfoPhoton = new std::vector<double>();
391  t_hsimInfoNeutHad = new std::vector<double>();
392  t_hsimInfoCharHad = new std::vector<double>();
393  t_hsimInfoPdgMatched = new std::vector<double>();
394  t_hsimInfoTotal = new std::vector<double>();
395  t_hsimInfoNMatched = new std::vector<int>();
396  t_hsimInfoNTotal = new std::vector<int>();
397  t_hsimInfoNNeutHad = new std::vector<int>();
398  t_hsimInfoNCharHad = new std::vector<int>();
399  t_hsimInfoNPhoton = new std::vector<int>();
400  t_hsimInfoNRest = new std::vector<int>();
401  t_hsim = new std::vector<double>();
402  t_nSimHits = new std::vector<int>();
403 
404  tree->Branch("t_hsimInfoMatched", "vector<double>", &t_hsimInfoMatched );
405  tree->Branch("t_hsimInfoRest", "vector<double>", &t_hsimInfoRest );
406  tree->Branch("t_hsimInfoPhoton", "vector<double>", &t_hsimInfoPhoton );
407  tree->Branch("t_hsimInfoNeutHad", "vector<double>", &t_hsimInfoNeutHad );
408  tree->Branch("t_hsimInfoCharHad", "vector<double>", &t_hsimInfoCharHad );
409  tree->Branch("t_hsimInfoPdgMatched", "vector<double>", &t_hsimInfoPdgMatched );
410  tree->Branch("t_hsimInfoTotal", "vector<double>", &t_hsimInfoTotal );
411  tree->Branch("t_hsimInfoNMatched", "vector<int>", &t_hsimInfoNMatched );
412  tree->Branch("t_hsimInfoNTotal", "vector<int>", &t_hsimInfoNTotal );
413  tree->Branch("t_hsimInfoNNeutHad", "vector<int>", &t_hsimInfoNNeutHad );
414  tree->Branch("t_hsimInfoNCharHad", "vector<int>", &t_hsimInfoNCharHad );
415  tree->Branch("t_hsimInfoNPhoton", "vector<int>", &t_hsimInfoNPhoton );
416  tree->Branch("t_hsimInfoNRest", "vector<int>", &t_hsimInfoNRest );
417  tree->Branch("t_hsim", "vector<double>", &t_hsim );
418  tree->Branch("t_nSimHits", "vector<int>", &t_nSimHits );
419  }
420 }
421 
423 
424  std::cout << "Number of Events Processed " << nEventProc << std::endl;
425 }
426 
428 
429  t_trackP ->clear();
430  t_trackPt ->clear();
431  t_trackEta ->clear();
432  t_trackPhi ->clear();
433  t_trackHcalEta ->clear();
434  t_trackHcalPhi ->clear();
435  t_hCone ->clear();
436  t_conehmaxNearP ->clear();
437  t_eMipDR ->clear();
438  t_eECALDR ->clear();
439  t_eHCALDR ->clear();
440  t_e11x11_20Sig ->clear();
441  t_e15x15_20Sig ->clear();
442  t_eMipDR_1 ->clear();
443  t_eECALDR_1 ->clear();
444  t_eMipDR_2 ->clear();
445  t_eECALDR_2 ->clear();
446  t_hConeHB ->clear();
447  t_eHCALDRHB ->clear();
448 
449  if (doMC) {
450  t_hsimInfoMatched ->clear();
451  t_hsimInfoRest ->clear();
452  t_hsimInfoPhoton ->clear();
453  t_hsimInfoNeutHad ->clear();
454  t_hsimInfoCharHad ->clear();
455  t_hsimInfoPdgMatched ->clear();
456  t_hsimInfoTotal ->clear();
457  t_hsimInfoNMatched ->clear();
458  t_hsimInfoNTotal ->clear();
459  t_hsimInfoNNeutHad ->clear();
460  t_hsimInfoNCharHad ->clear();
461  t_hsimInfoNPhoton ->clear();
462  t_hsimInfoNRest ->clear();
463  t_hsim ->clear();
464  t_nSimHits ->clear();
465  }
466 }
467 
468 
469 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:39
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
std::vector< double > * t_hsimInfoMatched
edm::Service< TFileService > fs
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > * t_eHCALDR
std::vector< int > * t_hsimInfoNRest
std::vector< double > * t_hCone
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
IsolatedTracksHcalScale(const edm::ParameterSet &)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< int > * t_hsimInfoNTotal
std::vector< int > * t_hsimInfoNCharHad
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
std::vector< int > * t_hsimInfoNMatched
TrackQuality
track quality
Definition: TrackBase.h:133
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< double > * t_hsim
int bunchCrossing() const
Definition: EventBase.h:62
std::vector< double > * t_hsimInfoNeutHad
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::vector< double > * t_eMipDR_2
std::vector< int > * t_hsimInfoNPhoton
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:723
float float float z
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< double > * t_e11x11_20Sig
std::vector< int > * t_hsimInfoNNeutHad
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
double pt() const
track transverse momentum
Definition: TrackBase.h:669
void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
std::vector< double > * t_trackEta
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
std::vector< double > * t_eECALDR_2
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
std::vector< double > * t_eECALDR
spr::trackSelectionParameters selectionParameters
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
bool isValid() const
Definition: HandleBase.h:76
std::vector< double > * t_eMipDR_1
int iphi() const
get the cell iphi
Definition: HcalDetId.h:38
std::vector< double > * t_trackPt
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
const MagneticField * bField
T const * product() const
Definition: Handle.h:81
std::vector< double > * t_trackHcalEta
std::vector< double > * t_trackP
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool debug=false)
std::vector< double > * t_eECALDR_1
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const T & get() const
Definition: EventSetup.h:55
std::vector< double > * t_trackHcalPhi
T const * product() const
Definition: ESHandle.h:86
std::vector< double > * t_hsimInfoPhoton
std::vector< double > * t_hsimInfoTotal
edm::EventID id() const
Definition: EventBase.h:56
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
std::vector< double > * t_hsimInfoCharHad
reco::TrackBase::TrackQuality minQuality
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
std::vector< double > * t_trackPhi
tuple cout
Definition: gather_cfg.py:121
std::vector< double > * t_eHCALDRHB
std::vector< double > * t_hsimInfoPdgMatched
Definition: DDAxes.h:10
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
std::vector< int > * t_nSimHits
std::vector< double > * t_hConeHB
std::vector< double > * t_hsimInfoRest
std::vector< double > * t_conehmaxNearP
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_eMipDR
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)