CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IsolatedTracksNxN.cc
Go to the documentation of this file.
1 // -*- C++ -*
2 //
3 // Package: IsolatedTracksNxN
4 // Class: IsolatedTracksNxN
5 //
13 //
14 // Original Author: Seema Sharma
15 // Created: Mon Aug 10 15:30:40 CST 2009
16 //
17 //
18 
21 
34 
36 
37  //now do what ever initialization is needed
38  doMC = iConfig.getUntrackedParameter<bool> ("DoMC", false);
39  writeAllTracks = iConfig.getUntrackedParameter<bool> ("WriteAllTracks", false );
40  myverbose_ = iConfig.getUntrackedParameter<int> ("Verbosity", 5 );
41  pvTracksPtMin_ = iConfig.getUntrackedParameter<double>("PVTracksPtMin", 1.0 );
42  debugTrks_ = iConfig.getUntrackedParameter<int> ("DebugTracks" );
43  printTrkHitPattern_ = iConfig.getUntrackedParameter<bool> ("PrintTrkHitPattern" );
44  minTrackP_ = iConfig.getUntrackedParameter<double>("minTrackP", 1.0 );
45  maxTrackEta_ = iConfig.getUntrackedParameter<double>("maxTrackEta", 5.0 );
46  debugL1Info_ = iConfig.getUntrackedParameter<bool> ("DebugL1Info", false );
47  L1TriggerAlgoInfo_ = iConfig.getUntrackedParameter<bool> ("L1TriggerAlgoInfo");
48  L1extraTauJetSource_ = iConfig.getParameter<edm::InputTag> ("L1extraTauJetSource" );
49  L1extraCenJetSource_ = iConfig.getParameter<edm::InputTag> ("L1extraCenJetSource" );
50  L1extraFwdJetSource_ = iConfig.getParameter<edm::InputTag> ("L1extraFwdJetSource" );
51  L1extraMuonSource_ = iConfig.getParameter<edm::InputTag> ("L1extraMuonSource" );
52  L1extraIsoEmSource_ = iConfig.getParameter<edm::InputTag> ("L1extraIsoEmSource" );
53  L1extraNonIsoEmSource_ = iConfig.getParameter<edm::InputTag> ("L1extraNonIsoEmSource" );
54  L1GTReadoutRcdSource_ = iConfig.getParameter<edm::InputTag> ("L1GTReadoutRcdSource" );
55  L1GTObjectMapRcdSource_= iConfig.getParameter<edm::InputTag> ("L1GTObjectMapRcdSource");
56  JetSrc_ = iConfig.getParameter<edm::InputTag> ("JetSource");
57  JetExtender_ = iConfig.getParameter<edm::InputTag> ("JetExtender");
58  HBHERecHitSource_ = iConfig.getParameter<edm::InputTag> ("HBHERecHitSource");
59  tMinE_ = iConfig.getUntrackedParameter<double>("TimeMinCutECAL", -500.);
60  tMaxE_ = iConfig.getUntrackedParameter<double>("TimeMaxCutECAL", 500.);
61  tMinH_ = iConfig.getUntrackedParameter<double>("TimeMinCutHCAL", -500.);
62  tMaxH_ = iConfig.getUntrackedParameter<double>("TimeMaxCutHCAL", 500.);
63  nbad = 0;
64 
65  if(myverbose_>=0) {
66  std::cout <<"Parameters read from config file \n"
67  <<" doMC " << doMC
68  <<"\t myverbose_ " << myverbose_
69  <<"\t minTrackP_ " << minTrackP_
70  << "\t maxTrackEta_ " << maxTrackEta_
71  << "\t tMinE_ " << tMinE_
72  << "\t tMaxE_ " << tMaxE_
73  << "\t tMinH_ " << tMinH_
74  << "\t tMaxH_ " << tMaxH_
75  << "\n debugL1Info_ " << debugL1Info_
76  << "\t L1TriggerAlgoInfo_ " << L1TriggerAlgoInfo_
77  << "\t L1extraTauJetSource_ " << L1extraTauJetSource_
78  << "\t L1extraCenJetSource_ " << L1extraCenJetSource_
79  << "\t L1extraFwdJetSource_ " << L1extraFwdJetSource_
80  << "\t L1extraMuonSource_ " << L1extraMuonSource_
81  << "\t L1extraIsoEmSource_ " << L1extraIsoEmSource_
82  << "\t L1extraNonIsoEmSource_ " << L1extraNonIsoEmSource_
83  << "\t L1GTReadoutRcdSource_ " << L1GTReadoutRcdSource_
84  << "\t L1GTObjectMapRcdSource_ " << L1GTObjectMapRcdSource_
85  << "\t JetSrc_ " << JetSrc_
86  << "\t JetExtender_ " << JetExtender_
87  << "\t HBHERecHitSource_ " << HBHERecHitSource_
88  << "\n" << std::endl;
89  }
90 
91  initL1 = false;
92 
93 }
94 
96 }
97 
99 
100  bool haveIsoTrack=false;
101 
103  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
104  bField = bFieldH.product();
105 
107 
108  t_RunNo = iEvent.id().run();
109  t_EvtNo = iEvent.id().event();
110  t_Lumi = iEvent.luminosityBlock();
111  t_Bunch = iEvent.bunchCrossing();
112 
113  nEventProc++;
114 
116  iEvent.getByLabel("generalTracks", trkCollection);
117  reco::TrackCollection::const_iterator trkItr;
118  if(debugTrks_>1){
119  std::cout << "Track Collection: " << std::endl;
120  std::cout << "Number of Tracks " << trkCollection->size() << std::endl;
121  }
122  std::string theTrackQuality = "highPurity";
123  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
124 
125  //===================== save L1 Trigger information =======================
126  if( L1TriggerAlgoInfo_ ) {
127 
128  bool useL1EventSetup = true;
129  bool useL1GtTriggerMenuLite = true;
130 
131  m_l1GtUtils.getL1GtRunCache(iEvent, iSetup, useL1EventSetup, useL1GtTriggerMenuLite);
132 
133  int iErrorCode = -1;
134  int l1ConfCode = -1;
135  const bool l1Conf = m_l1GtUtils.availableL1Configuration(iErrorCode, l1ConfCode);
136  if( !l1Conf) {
137  std::cout << "\nL1 configuration code:" << l1ConfCode
138  << "\nNo valid L1 trigger configuration available."
139  << "\nSee text above for error code interpretation"
140  << "\nNo return here, in order to test each method, protected against configuration error."
141  << std::endl;
142  }
143 
144  const L1GtTriggerMenu* m_l1GtMenu = m_l1GtUtils.ptrL1TriggerMenuEventSetup(iErrorCode);
145  const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();
146  const std::string& menuName = m_l1GtMenu->gtTriggerMenuName();
147 
148  if (!initL1) {
149  initL1=true;
150  std::cout << "menuName " << menuName << std::endl;
151  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
152  std::string algName = itAlgo->first;
153  int algBitNumber = ( itAlgo->second ).algoBitNumber();
154  l1AlgoMap.insert( std::pair<std::pair<unsigned int,std::string>,int>( std::pair<unsigned int,std::string>(algBitNumber, algName) , 0) ) ;
155  }
156  std::map< std::pair<unsigned int,std::string>, int>::iterator itr;
157  for(itr=l1AlgoMap.begin(); itr!=l1AlgoMap.end(); itr++) {
158  std::cout << " ********** " << (itr->first).first <<" "<<(itr->first).second <<" "<<itr->second << std::endl;
159  }
160  }
161 
162  std::vector<int> algbits;
163  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
164  std::string algName = itAlgo->first;
165  int algBitNumber = ( itAlgo->second ).algoBitNumber();
166  //bool algResultBeforeMask = m_l1GtUtils.decisionBeforeMask(iEvent, itAlgo->first, iErrorCode);
167  //bool algResultAfterMask = m_l1GtUtils.decisionAfterMask (iEvent, itAlgo->first, iErrorCode);
168  //int triggerMask = m_l1GtUtils.triggerMask (iEvent, itAlgo->first, iErrorCode);
169  bool decision = m_l1GtUtils.decision (iEvent, itAlgo->first, iErrorCode);
170  int preScale = m_l1GtUtils.prescaleFactor (iEvent, itAlgo->first, iErrorCode);
171 
172  // save the algo names which fired
173  if( decision ){
174  l1AlgoMap[std::pair<unsigned int,std::string>(algBitNumber, algName)] += 1;
175  h_L1AlgoNames->Fill( algBitNumber );
176  t_L1AlgoNames->push_back(itAlgo->first);
177  t_L1PreScale->push_back(preScale);
178  t_L1Decision[algBitNumber] = 1;
179  algbits.push_back(algBitNumber);
180  }
181  }
182 
183  if(debugL1Info_) {
184  for(unsigned int ii=0; ii<t_L1AlgoNames->size(); ii++){
185  std::cout<<ii<<" "<<(*t_L1AlgoNames)[ii]<<" "<<(*t_L1PreScale)[ii]<<" "<<algbits[ii]<<std::endl;
186  }
187  std::cout << "L1Decision: ";
188  for (int i=0; i<128; ++i) {
189  std::cout << " " << i << ":" << t_L1Decision[i];
190  if ((i+1)%32 == 0) std::cout << std::endl;
191  }
192  }
193 
194  // L1Taus
196  iEvent.getByLabel(L1extraTauJetSource_,l1TauHandle);
197  l1extra::L1JetParticleCollection::const_iterator itr;
198  int iL1Obj=0;
199  for(itr = l1TauHandle->begin(),iL1Obj=0; itr != l1TauHandle->end(); ++itr,iL1Obj++) {
200  if(iL1Obj<1) {
201  t_L1TauJetPt ->push_back( itr->pt() );
202  t_L1TauJetEta ->push_back( itr->eta() );
203  t_L1TauJetPhi ->push_back( itr->phi() );
204  }
205  if(debugL1Info_) {
206  std::cout << "tauJ p/pt " << itr->momentum() << " " << itr->pt()
207  << " eta/phi " << itr->eta() << " " << itr->phi()
208  << std::endl;
209  }
210  }
211 
212  // L1 Central Jets
214  iEvent.getByLabel(L1extraCenJetSource_,l1CenJetHandle);
215  for( itr = l1CenJetHandle->begin(),iL1Obj=0; itr != l1CenJetHandle->end(); ++itr,iL1Obj++ ) {
216  if(iL1Obj<1) {
217  t_L1CenJetPt ->push_back( itr->pt() );
218  t_L1CenJetEta ->push_back( itr->eta() );
219  t_L1CenJetPhi ->push_back( itr->phi() );
220  }
221  if(debugL1Info_) {
222  std::cout << "cenJ p/pt " << itr->momentum() << " " << itr->pt()
223  << " eta/phi " << itr->eta() << " " << itr->phi()
224  << std::endl;
225  }
226  }
227 
228  // L1 Forward Jets
230  iEvent.getByLabel(L1extraFwdJetSource_,l1FwdJetHandle);
231  for( itr = l1FwdJetHandle->begin(),iL1Obj=0; itr != l1FwdJetHandle->end(); ++itr,iL1Obj++ ) {
232  if(iL1Obj<1) {
233  t_L1FwdJetPt ->push_back( itr->pt() );
234  t_L1FwdJetEta ->push_back( itr->eta() );
235  t_L1FwdJetPhi ->push_back( itr->phi() );
236  }
237  if(debugL1Info_) {
238  std::cout << "fwdJ p/pt " << itr->momentum() << " " << itr->pt()
239  << " eta/phi " << itr->eta() << " " << itr->phi()
240  << std::endl;
241  }
242  }
243 
244  // L1 Isolated EM onjects
245  l1extra::L1EmParticleCollection::const_iterator itrEm;
247  iEvent.getByLabel(L1extraIsoEmSource_, l1IsoEmHandle);
248  for( itrEm = l1IsoEmHandle->begin(),iL1Obj=0; itrEm != l1IsoEmHandle->end(); ++itrEm,iL1Obj++ ) {
249  if(iL1Obj<1) {
250  t_L1IsoEMPt ->push_back( itrEm->pt() );
251  t_L1IsoEMEta ->push_back( itrEm->eta() );
252  t_L1IsoEMPhi ->push_back( itrEm->phi() );
253  }
254  if(debugL1Info_) {
255  std::cout << "isoEm p/pt " << itrEm->momentum() << " " << itrEm->pt()
256  << " eta/phi " << itrEm->eta() << " " << itrEm->phi()
257  << std::endl;
258  }
259  }
260 
261  // L1 Non-Isolated EM onjects
263  iEvent.getByLabel(L1extraNonIsoEmSource_, l1NonIsoEmHandle);
264  for( itrEm = l1NonIsoEmHandle->begin(),iL1Obj=0; itrEm != l1NonIsoEmHandle->end(); ++itrEm,iL1Obj++ ) {
265  if(iL1Obj<1) {
266  t_L1NonIsoEMPt ->push_back( itrEm->pt() );
267  t_L1NonIsoEMEta ->push_back( itrEm->eta() );
268  t_L1NonIsoEMPhi ->push_back( itrEm->phi() );
269  }
270  if(debugL1Info_) {
271  std::cout << "nonIsoEm p/pt " << itrEm->momentum() << " " << itrEm->pt()
272  << " eta/phi " << itrEm->eta() << " " << itrEm->phi()
273  << std::endl;
274  }
275  }
276 
277  // L1 Muons
278  l1extra::L1MuonParticleCollection::const_iterator itrMu;
280  iEvent.getByLabel(L1extraMuonSource_, l1MuHandle);
281  for( itrMu = l1MuHandle->begin(),iL1Obj=0; itrMu != l1MuHandle->end(); ++itrMu,iL1Obj++ ) {
282  if(iL1Obj<1) {
283  t_L1MuonPt ->push_back( itrMu->pt() );
284  t_L1MuonEta ->push_back( itrMu->eta() );
285  t_L1MuonPhi ->push_back( itrMu->phi() );
286  }
287  if(debugL1Info_) {
288  std::cout << "l1muon p/pt " << itrMu->momentum() << " " << itrMu->pt()
289  << " eta/phi " << itrMu->eta() << " " << itrMu->phi()
290  << std::endl;
291  }
292  }
293  }
294 
295  //============== store the information about all the Non-Fake vertices ===============
296 
298  iEvent.getByLabel("offlinePrimaryVertices",recVtxs);
299 
300  std::vector<reco::Track> svTracks;
301  math::XYZPoint leadPV(0,0,0);
302  double sumPtMax = -1.0;
303  for(unsigned int ind=0;ind<recVtxs->size();ind++) {
304 
305  if ( !((*recVtxs)[ind].isFake()) ) {
306  double vtxTrkSumPt=0.0, vtxTrkSumPtWt=0.0;
307  int vtxTrkNWt =0;
308  double vtxTrkSumPtHP=0.0, vtxTrkSumPtHPWt=0.0;
309  int vtxTrkNHP =0, vtxTrkNHPWt =0;
310 
311  reco::Vertex::trackRef_iterator vtxTrack = (*recVtxs)[ind].tracks_begin();
312 
313  for (vtxTrack = (*recVtxs)[ind].tracks_begin(); vtxTrack!=(*recVtxs)[ind].tracks_end(); vtxTrack++) {
314 
315  if((*vtxTrack)->pt()<pvTracksPtMin_) continue;
316 
317  bool trkQuality = (*vtxTrack)->quality(trackQuality_);
318 
319  vtxTrkSumPt += (*vtxTrack)->pt();
320 
321  vtxTrkSumPt += (*vtxTrack)->pt();
322  if( trkQuality ) {
323  vtxTrkSumPtHP += (*vtxTrack)->pt();
324  vtxTrkNHP++;
325  }
326 
327  double weight = (*recVtxs)[ind].trackWeight(*vtxTrack);
328  h_PVTracksWt ->Fill(weight);
329  if( weight>0.5) {
330  vtxTrkSumPtWt += (*vtxTrack)->pt();
331  vtxTrkNWt++;
332  if( trkQuality ) {
333  vtxTrkSumPtHPWt += (*vtxTrack)->pt();
334  vtxTrkNHPWt++;
335  }
336  }
337  }
338 
339  if(vtxTrkSumPt>sumPtMax) {
340  sumPtMax = vtxTrkSumPt;
341  leadPV = math::XYZPoint( (*recVtxs)[ind].x(),(*recVtxs)[ind].y(), (*recVtxs)[ind].z() );
342  }
343 
344  t_PVx ->push_back( (*recVtxs)[ind].x() );
345  t_PVy ->push_back( (*recVtxs)[ind].y() );
346  t_PVz ->push_back( (*recVtxs)[ind].z() );
347  t_PVisValid ->push_back( (*recVtxs)[ind].isValid() );
348  t_PVNTracks ->push_back( (*recVtxs)[ind].tracksSize() );
349  t_PVndof ->push_back( (*recVtxs)[ind].ndof() );
350  t_PVNTracksWt ->push_back( vtxTrkNWt );
351  t_PVTracksSumPt ->push_back( vtxTrkSumPt );
352  t_PVTracksSumPtWt->push_back( vtxTrkSumPtWt );
353 
354  t_PVNTracksHP ->push_back( vtxTrkNHP );
355  t_PVNTracksHPWt ->push_back( vtxTrkNHPWt );
356  t_PVTracksSumPtHP ->push_back( vtxTrkSumPtHP );
357  t_PVTracksSumPtHPWt->push_back( vtxTrkSumPtHPWt );
358 
359  if(myverbose_==4) {
360  std::cout<<"PV "<<ind<<" isValid "<<(*recVtxs)[ind].isValid()<<" isFake "<<(*recVtxs)[ind].isFake()
361  <<" hasRefittedTracks() "<<ind<<" "<<(*recVtxs)[ind].hasRefittedTracks()
362  <<" refittedTrksSize "<<(*recVtxs)[ind].refittedTracks().size()
363  <<" tracksSize() "<<(*recVtxs)[ind].tracksSize()<<" sumPt "<<vtxTrkSumPt
364  <<std::endl;
365  }
366  } // if vtx is not Fake
367  } // loop over PVs
368  //===================================================================================
369 
370  // Get the beamspot
371  edm::Handle<reco::BeamSpot> beamSpotH;
372  iEvent.getByLabel("offlineBeamSpot", beamSpotH);
373  math::XYZPoint bspot;
374  bspot = ( beamSpotH.isValid() ) ? beamSpotH->position() : math::XYZPoint(0, 0, 0);
375 
376  //=====================================================================
377 
379  iEvent.getByLabel(JetSrc_,jets);
380  // edm::Handle<reco::JetExtendedAssociation::Container> jetExtender;
381  // iEvent.getByLabel(JetExtender_,jetExtender);
382 
383  for(unsigned int ijet=0;ijet<(*jets).size();ijet++) {
384  t_jetPt ->push_back( (*jets)[ijet].pt() );
385  t_jetEta ->push_back( (*jets)[ijet].eta() );
386  t_jetPhi ->push_back( (*jets)[ijet].phi() );
387  t_nTrksJetVtx ->push_back( -1.0);
388  t_nTrksJetCalo->push_back( -1.0);
389  }
390 
391  //===================================================================================
392 
393  // get handles to calogeometry and calotopology
395  iSetup.get<CaloGeometryRecord>().get(pG);
396  const CaloGeometry* geo = pG.product();
397 
398  edm::ESHandle<CaloTopology> theCaloTopology;
399  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
400  const CaloTopology *caloTopology = theCaloTopology.product();
401 
403  iSetup.get<IdealGeometryRecord>().get(htopo);
404  const HcalTopology* theHBHETopology = htopo.product();
405 
406  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
407  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
408  iEvent.getByLabel("ecalRecHit","EcalRecHitsEB",barrelRecHitsHandle);
409  iEvent.getByLabel("ecalRecHit","EcalRecHitsEE",endcapRecHitsHandle);
410 
411  // Retrieve the good/bad ECAL channels from the DB
413  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
414  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
415 
416  // Retrieve trigger tower map
418  iSetup.get<IdealGeometryRecord>().get(hTtmap);
419  const EcalTrigTowerConstituentsMap& ttMap = *hTtmap;
420 
422  iEvent.getByLabel(HBHERecHitSource_, hbhe);
423  if (!hbhe.isValid()) {
424  nbad++;
425  if (nbad < 10) std::cout << "No HBHE rechit collection\n";
426  return;
427  }
428  const HBHERecHitCollection Hithbhe = *(hbhe.product());
429 
430  //get Handles to SimTracks and SimHits
432  if (doMC) iEvent.getByLabel("g4SimHits",SimTk);
433  edm::SimTrackContainer::const_iterator simTrkItr;
434 
436  if (doMC) iEvent.getByLabel("g4SimHits",SimVtx);
437 
438  //get Handles to PCaloHitContainers of eb/ee/hbhe
440  if (doMC) iEvent.getByLabel("g4SimHits", "EcalHitsEB", pcaloeb);
441 
443  if (doMC) iEvent.getByLabel("g4SimHits", "EcalHitsEE", pcaloee);
444 
446  if (doMC) iEvent.getByLabel("g4SimHits", "HcalHits", pcalohh);
447 
448  //associates tracker rechits/simhits to a track
449  TrackerHitAssociator* associate=0;
450  if (doMC) associate = new TrackerHitAssociator(iEvent);
451 
452  //===================================================================================
453 
454  h_nTracks->Fill(trkCollection->size());
455 
456  int nTracks = 0;
457 
458  t_nTracks = trkCollection->size();
459 
460  // get the list of DetIds closest to the impact point of track on surface calorimeters
461  std::vector<spr::propagatedTrackID> trkCaloDets;
462  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality, trkCaloDets, false);
463  std::vector<spr::propagatedTrackID>::const_iterator trkDetItr;
464 
465  if(myverbose_>2) {
466  for(trkDetItr = trkCaloDets.begin(); trkDetItr != trkCaloDets.end(); trkDetItr++){
467  std::cout<<trkDetItr->trkItr->p()<<" "<<trkDetItr->trkItr->eta()<<" "<<trkDetItr->okECAL<<" ";
468  if(trkDetItr->detIdECAL.subdetId() == EcalBarrel) std::cout << (EBDetId)trkDetItr->detIdECAL <<" ";
469  else std::cout << (EEDetId)trkDetItr->detIdECAL <<" ";
470  std::cout<<trkDetItr->okHCAL<<" ";
471  if(trkDetItr->okHCAL) std::cout<<(HcalDetId)trkDetItr->detIdHCAL;
472  std::cout << std::endl;
473  }
474  }
475 
476  int nvtxTracks=0;
477  for(trkDetItr = trkCaloDets.begin(),nTracks=0; trkDetItr != trkCaloDets.end(); trkDetItr++,nTracks++){
478 
479  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
480 
481  // find vertex index the track is associated with
482  int pVtxTkId = -1;
483  for(unsigned int ind=0; ind<recVtxs->size(); ind++) {
484  if (!((*recVtxs)[ind].isFake())) {
485  reco::Vertex::trackRef_iterator vtxTrack = (*recVtxs)[ind].tracks_begin();
486  for (vtxTrack = (*recVtxs)[ind].tracks_begin(); vtxTrack!=(*recVtxs)[ind].tracks_end(); vtxTrack++) {
487 
488  const edm::RefToBase<reco::Track> pvtxTrack = (*vtxTrack);
489  if ( pTrack == pvtxTrack.get() ) {
490  pVtxTkId = ind;
491  break;
492  if(myverbose_>2) {
493  if( pTrack->pt()>1.0) {
494  std::cout<<"Debug the track association with vertex "<<std::endl;
495  std::cout<< pTrack << " "<< pvtxTrack.get() << std::endl;
496  std::cout<<" trkVtxIndex "<<nvtxTracks<<" vtx "<<ind<<" pt "<<pTrack->pt()
497  <<" eta "<<pTrack->eta()<<" "<<pTrack->pt()-pvtxTrack->pt()
498  <<" "<< pTrack->eta()-pvtxTrack->eta()
499  << std::endl;
500  nvtxTracks++;
501  }
502  }
503  }
504  }
505  }
506  }
507 
508  const reco::HitPattern& hitp = pTrack->hitPattern();
509  const reco::HitPattern& hitpIn = pTrack->trackerExpectedHitsInner();
510  const reco::HitPattern& hitpOut = pTrack->trackerExpectedHitsOuter();
511 
512  int nLayersCrossed = hitp.trackerLayersWithMeasurement() ;
513  int nOuterHits = hitp.stripTOBLayersWithMeasurement()+hitp.stripTECLayersWithMeasurement() ;
514 
515  bool ifGood = pTrack->quality(trackQuality_);
516  double pt1 = pTrack->pt();
517  double p1 = pTrack->p();
518  double eta1 = pTrack->momentum().eta();
519  double phi1 = pTrack->momentum().phi();
520  double etaEcal1 = trkDetItr->etaECAL;
521  double phiEcal1 = trkDetItr->phiECAL;
522  double etaHcal1 = trkDetItr->etaHCAL;
523  double phiHcal1 = trkDetItr->phiHCAL;
524  double dxy1 = pTrack->dxy();
525  double dz1 = pTrack->dz();
526  double chisq1 = pTrack->normalizedChi2();
527  double dxybs1 = beamSpotH.isValid() ? pTrack->dxy(bspot) : pTrack->dxy();
528  double dzbs1 = beamSpotH.isValid() ? pTrack->dz(bspot) : pTrack->dz();
529  double dxypv1 = pTrack->dxy();
530  double dzpv1 = pTrack->dz();
531  if(pVtxTkId>=0) {
532  math::XYZPoint thisTkPV = math::XYZPoint( (*recVtxs)[pVtxTkId].x(),(*recVtxs)[pVtxTkId].y(), (*recVtxs)[pVtxTkId].z() );
533  dxypv1 = pTrack->dxy(thisTkPV);
534  dzpv1 = pTrack->dz (thisTkPV);
535  }
536 
537  h_recEtaPt_0->Fill(eta1, pt1);
538  h_recEtaP_0 ->Fill(eta1, p1);
539  h_recPt_0 ->Fill(pt1);
540  h_recP_0 ->Fill(p1);
541  h_recEta_0 ->Fill(eta1);
542  h_recPhi_0 ->Fill(phi1);
543 
544  if(ifGood && nLayersCrossed>7 ) {
545  h_recEtaPt_1->Fill(eta1, pt1);
546  h_recEtaP_1 ->Fill(eta1, p1);
547  h_recPt_1 ->Fill(pt1);
548  h_recP_1 ->Fill(p1);
549  h_recEta_1 ->Fill(eta1);
550  h_recPhi_1 ->Fill(phi1);
551  }
552 
553  if( ! ifGood ) continue;
554 
555  if( writeAllTracks && p1>2.0 && nLayersCrossed>7) {
556  t_trackPAll ->push_back( p1 );
557  t_trackEtaAll ->push_back( eta1 );
558  t_trackPhiAll ->push_back( phi1 );
559  t_trackPtAll ->push_back( pt1 );
560  t_trackDxyAll ->push_back( dxy1 );
561  t_trackDzAll ->push_back( dz1 );
562  t_trackDxyPVAll ->push_back( dxypv1 );
563  t_trackDzPVAll ->push_back( dzpv1 );
564  t_trackChiSqAll ->push_back( chisq1 );
565  }
566  if (doMC) {
567  edm::SimTrackContainer::const_iterator matchedSimTrkAll = spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack, *associate, false);
568  if( writeAllTracks && matchedSimTrkAll != SimTk->end()) t_trackPdgIdAll->push_back( matchedSimTrkAll->type() );
569  }
570 
571  if( pt1>minTrackP_ && std::abs(eta1)<maxTrackEta_ && trkDetItr->okECAL) {
572 
573  double maxNearP31x31=999.0, maxNearP25x25=999.0, maxNearP21x21=999.0, maxNearP15x15=999.0;
574  maxNearP31x31 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 15,15);
575  maxNearP25x25 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 12,12);
576  maxNearP21x21 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 10,10);
577  maxNearP15x15 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 7, 7);
578 
579  int iTrkEtaBin=-1, iTrkMomBin=-1;
580  for(unsigned int ieta=0; ieta<NEtaBins; ieta++) {
581  if(std::abs(eta1)>genPartEtaBins[ieta] && std::abs(eta1)<genPartEtaBins[ieta+1] ) iTrkEtaBin = ieta;
582  }
583  for(unsigned int ipt=0; ipt<NPBins; ipt++) {
584  if( p1>genPartPBins[ipt] && p1<genPartPBins[ipt+1] ) iTrkMomBin = ipt;
585  }
586  if( iTrkMomBin>=0 && iTrkEtaBin>=0 ) {
587  h_maxNearP31x31[iTrkMomBin][iTrkEtaBin]->Fill( maxNearP31x31 );
588  h_maxNearP25x25[iTrkMomBin][iTrkEtaBin]->Fill( maxNearP25x25 );
589  h_maxNearP21x21[iTrkMomBin][iTrkEtaBin]->Fill( maxNearP21x21 );
590  h_maxNearP15x15[iTrkMomBin][iTrkEtaBin]->Fill( maxNearP15x15 );
591  }
592  if( maxNearP31x31<0.0 && nLayersCrossed>7 && nOuterHits>4) {
593  h_recEtaPt_2->Fill(eta1, pt1);
594  h_recEtaP_2 ->Fill(eta1, p1);
595  h_recPt_2 ->Fill(pt1);
596  h_recP_2 ->Fill(p1);
597  h_recEta_2 ->Fill(eta1);
598  h_recPhi_2 ->Fill(phi1);
599  }
600 
601  // if charge isolated in ECAL, store the further quantities
602  if( maxNearP31x31<1.0) {
603 
604  haveIsoTrack = true;
605 
606  // get the matching simTrack
607  double simTrackP = -1;
608  if (doMC) {
609  edm::SimTrackContainer::const_iterator matchedSimTrk = spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack, *associate, false);
610  if( matchedSimTrk != SimTk->end() )simTrackP = matchedSimTrk->momentum().P();
611  }
612 
614  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
615 
616  // get ECal Tranverse Profile
617  std::pair<double, bool> e7x7P, e9x9P, e11x11P, e15x15P;
618  std::pair<double, bool> e7x7_10SigP, e9x9_10SigP, e11x11_10SigP, e15x15_10SigP;
619  std::pair<double, bool> e7x7_15SigP, e9x9_15SigP, e11x11_15SigP, e15x15_15SigP;
620  std::pair<double, bool> e7x7_20SigP, e9x9_20SigP, e11x11_20SigP, e15x15_20SigP;
621  std::pair<double, bool> e7x7_25SigP, e9x9_25SigP, e11x11_25SigP, e15x15_25SigP;
622  std::pair<double, bool> e7x7_30SigP, e9x9_30SigP, e11x11_30SigP, e15x15_30SigP;
623 
624  spr::caloSimInfo simInfo3x3, simInfo5x5, simInfo7x7, simInfo9x9;
625  spr::caloSimInfo simInfo11x11, simInfo13x13, simInfo15x15, simInfo21x21, simInfo25x25, simInfo31x31;
626  double trkEcalEne=0;
627 
628  const DetId isoCell = trkDetItr->detIdECAL;
629  e7x7P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),3,3, -100.0, -100.0, tMinE_,tMaxE_);
630  e9x9P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),4,4, -100.0, -100.0, tMinE_,tMaxE_);
631  e11x11P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, -100.0, -100.0, tMinE_,tMaxE_);
632  e15x15P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, -100.0, -100.0, tMinE_,tMaxE_);
633 
634  e7x7_10SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),3,3, 0.030, 0.150, tMinE_,tMaxE_);
635  e9x9_10SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),4,4, 0.030, 0.150, tMinE_,tMaxE_);
636  e11x11_10SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.030, 0.150, tMinE_,tMaxE_);
637  e15x15_10SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.030, 0.150, tMinE_,tMaxE_);
638 
639  e7x7_15SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology, sevlv.product(),ttMap, 3,3, 0.20,0.45, tMinE_,tMaxE_);
640  e9x9_15SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology, sevlv.product(),ttMap, 4,4, 0.20,0.45, tMinE_,tMaxE_);
641  e11x11_15SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(), ttMap, 5,5, 0.20,0.45, tMinE_,tMaxE_);
642  e15x15_15SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology, sevlv.product(),ttMap, 7,7, 0.20,0.45, tMinE_,tMaxE_, false);
643 
644  e7x7_20SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),3,3, 0.060, 0.300, tMinE_,tMaxE_);
645  e9x9_20SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),4,4, 0.060, 0.300, tMinE_,tMaxE_);
646  e11x11_20SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.060, 0.300, tMinE_,tMaxE_);
647  e15x15_20SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.060, 0.300, tMinE_,tMaxE_);
648 
649  e7x7_25SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),3,3, 0.075, 0.375, tMinE_,tMaxE_);
650  e9x9_25SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),4,4, 0.075, 0.375, tMinE_,tMaxE_);
651  e11x11_25SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.075, 0.375, tMinE_,tMaxE_);
652  e15x15_25SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.075, 0.375, tMinE_,tMaxE_);
653 
654  e7x7_30SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),3,3, 0.090, 0.450, tMinE_,tMaxE_);
655  e9x9_30SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),4,4, 0.090, 0.450, tMinE_,tMaxE_);
656  e11x11_30SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.090, 0.450, tMinE_,tMaxE_);
657  e15x15_30SigP = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.090, 0.450, tMinE_,tMaxE_);
658  if(myverbose_ == 2) {
659  std::cout << "clean ecal rechit " << std::endl;
660  std::cout<<"e7x7 "<<e7x7P.first<<" e9x9 "<<e9x9P.first<<" e11x11 " << e11x11P.first << " e15x15 "<<e15x15P.first<<std::endl;
661  std::cout<<"e7x7_10Sig "<<e7x7_10SigP.first<<" e11x11_10Sig "<<e11x11_10SigP.first<<" e15x15_10Sig "<<e15x15_10SigP.first<<std::endl;
662  }
663 
664  if (doMC) {
665  // check the energy from SimHits
666  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 1,1, simInfo3x3);
667  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 2,2, simInfo5x5);
668  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 3,3, simInfo7x7);
669  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 4,4, simInfo9x9);
670  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 5,5, simInfo11x11);
671  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 6,6, simInfo13x13);
672  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 7,7, simInfo15x15, 150.0,false);
673  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 10,10, simInfo21x21);
674  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 12,12, simInfo25x25);
675  spr::eECALSimInfo(iEvent,isoCell,geo,caloTopology,pcaloeb,pcaloee,SimTk,SimVtx,pTrack, *associate, 15,15, simInfo31x31);
676 
677  trkEcalEne = spr::eCaloSimInfo(iEvent, geo, pcaloeb,pcaloee, SimTk, SimVtx, pTrack, *associate);
678  if(myverbose_ == 1) {
679  std::cout << "Track momentum " << pt1 << std::endl;
680 
681  std::cout << "ecal siminfo " << std::endl;
682  std::cout << "simInfo3x3: " << "eTotal " << simInfo3x3.eTotal << " eMatched " << simInfo3x3.eMatched << " eRest " << simInfo3x3.eRest << " eGamma "<<simInfo3x3.eGamma << " eNeutralHad " << simInfo3x3.eNeutralHad << " eChargedHad " << simInfo3x3.eChargedHad << std::endl;
683  std::cout << "simInfo5x5: " << "eTotal " << simInfo5x5.eTotal << " eMatched " << simInfo5x5.eMatched << " eRest " << simInfo5x5.eRest << " eGamma "<<simInfo5x5.eGamma << " eNeutralHad " << simInfo5x5.eNeutralHad << " eChargedHad " << simInfo5x5.eChargedHad << std::endl;
684  std::cout << "simInfo7x7: " << "eTotal " << simInfo7x7.eTotal << " eMatched " << simInfo7x7.eMatched << " eRest " << simInfo7x7.eRest << " eGamma "<<simInfo7x7.eGamma << " eNeutralHad " << simInfo7x7.eNeutralHad << " eChargedHad " << simInfo7x7.eChargedHad << std::endl;
685  std::cout << "simInfo9x9: " << "eTotal " << simInfo9x9.eTotal << " eMatched " << simInfo9x9.eMatched << " eRest " << simInfo9x9.eRest << " eGamma "<<simInfo9x9.eGamma << " eNeutralHad " << simInfo9x9.eNeutralHad << " eChargedHad " << simInfo9x9.eChargedHad << std::endl;
686  std::cout << "simInfo11x11: " << "eTotal " << simInfo11x11.eTotal << " eMatched " << simInfo11x11.eMatched << " eRest " << simInfo11x11.eRest << " eGamma "<<simInfo11x11.eGamma << " eNeutralHad " << simInfo11x11.eNeutralHad << " eChargedHad " << simInfo11x11.eChargedHad << std::endl;
687  std::cout << "simInfo15x15: " << "eTotal " << simInfo15x15.eTotal << " eMatched " << simInfo15x15.eMatched << " eRest " << simInfo15x15.eRest << " eGamma "<<simInfo15x15.eGamma << " eNeutralHad " << simInfo15x15.eNeutralHad << " eChargedHad " << simInfo15x15.eChargedHad << std::endl;
688  std::cout << "simInfo31x31: " << "eTotal " << simInfo31x31.eTotal << " eMatched " << simInfo31x31.eMatched << " eRest " << simInfo31x31.eRest << " eGamma "<<simInfo31x31.eGamma << " eNeutralHad " << simInfo31x31.eNeutralHad << " eChargedHad " << simInfo31x31.eChargedHad << std::endl;
689  std::cout << "trkEcalEne" << trkEcalEne << std::endl;
690  }
691  }
692 
693  // ======= Get HCAL information
694  double hcalScale=1.0;
695  if( std::abs(pTrack->eta())<1.4 ) {
696  hcalScale=120.0;
697  } else {
698  hcalScale=135.0;
699  }
700 
701  double maxNearHcalP3x3=-1, maxNearHcalP5x5=-1, maxNearHcalP7x7=-1;
702  maxNearHcalP3x3 = spr::chargeIsolationHcal(nTracks, trkCaloDets, theHBHETopology, 1,1);
703  maxNearHcalP5x5 = spr::chargeIsolationHcal(nTracks, trkCaloDets, theHBHETopology, 2,2);
704  maxNearHcalP7x7 = spr::chargeIsolationHcal(nTracks, trkCaloDets, theHBHETopology, 3,3);
705 
706  double h3x3=0, h5x5=0, h7x7=0;
707  double h3x3Sig=0, h5x5Sig=0, h7x7Sig=0;
708  double trkHcalEne = 0;
709  spr::caloSimInfo hsimInfo3x3, hsimInfo5x5, hsimInfo7x7;
710 
711  if(trkDetItr->okHCAL) {
712  const DetId ClosestCell(trkDetItr->detIdHCAL);
713  // bool includeHO=false, bool algoNew=true, bool debug=false
714  h3x3 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,1,1, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_,tMaxH_);
715  h5x5 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,2,2, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_,tMaxH_);
716  h7x7 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,3,3, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_,tMaxH_);
717  h3x3Sig = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,1,1, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_);
718  h5x5Sig = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,2,2, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_);
719  h7x7Sig = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,3,3, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_);
720 
721  if(myverbose_==2) {
722  std::cout << "HCAL 3x3 " << h3x3 << " " << h3x3Sig << " 5x5 " << h5x5 << " " << h5x5Sig << " 7x7 " << h7x7 << " " << h7x7Sig << std::endl;
723  }
724 
725  if (doMC) {
726  spr::eHCALSimInfo(iEvent, theHBHETopology, ClosestCell, geo,pcalohh, SimTk, SimVtx, pTrack, *associate, 1,1, hsimInfo3x3);
727  spr::eHCALSimInfo(iEvent, theHBHETopology, ClosestCell, geo,pcalohh, SimTk, SimVtx, pTrack, *associate, 2,2, hsimInfo5x5);
728  spr::eHCALSimInfo(iEvent, theHBHETopology, ClosestCell, geo,pcalohh, SimTk, SimVtx, pTrack, *associate, 3,3, hsimInfo7x7, 150.0, false,false);
729  trkHcalEne = spr::eCaloSimInfo(iEvent, geo,pcalohh, SimTk, SimVtx, pTrack, *associate);
730  if(myverbose_ == 1) {
731  std::cout << "Hcal siminfo " << std::endl;
732  std::cout << "hsimInfo3x3: " << "eTotal " << hsimInfo3x3.eTotal << " eMatched " << hsimInfo3x3.eMatched << " eRest " << hsimInfo3x3.eRest << " eGamma "<<hsimInfo3x3.eGamma << " eNeutralHad " << hsimInfo3x3.eNeutralHad << " eChargedHad " << hsimInfo3x3.eChargedHad << std::endl;
733  std::cout << "hsimInfo5x5: " << "eTotal " << hsimInfo5x5.eTotal << " eMatched " << hsimInfo5x5.eMatched << " eRest " << hsimInfo5x5.eRest << " eGamma "<<hsimInfo5x5.eGamma << " eNeutralHad " << hsimInfo5x5.eNeutralHad << " eChargedHad " << hsimInfo5x5.eChargedHad << std::endl;
734  std::cout << "hsimInfo7x7: " << "eTotal " << hsimInfo7x7.eTotal << " eMatched " << hsimInfo7x7.eMatched << " eRest " << hsimInfo7x7.eRest << " eGamma "<<hsimInfo7x7.eGamma << " eNeutralHad " << hsimInfo7x7.eNeutralHad << " eChargedHad " << hsimInfo7x7.eChargedHad << std::endl;
735  std::cout << "trkHcalEne " << trkHcalEne << std::endl;
736  }
737  }
738 
739  // debug the ecal and hcal matrix
740  if(myverbose_==4) {
741  std::cout<<"Run "<<iEvent.id().run()<<" Event "<<iEvent.id().event()<<std::endl;
742  std::vector<std::pair<DetId,double> > v7x7 = spr::eHCALmatrixCell(theHBHETopology, ClosestCell, hbhe,3,3, false, false);
743  double sumv=0.0;
744 
745  for(unsigned int iv=0; iv<v7x7.size(); iv++) {
746  sumv += v7x7[iv].second;
747  }
748  std::cout<<"h7x7 "<<h7x7<<" v7x7 "<<sumv << " in " << v7x7.size() <<std::endl;
749  for(unsigned int iv=0; iv<v7x7.size(); iv++) {
750  HcalDetId id = v7x7[iv].first;
751  std::cout << " Cell " << iv << " 0x" << std::hex << v7x7[iv].first() << std::dec << " " << id << " Energy " << v7x7[iv].second << std::endl;
752  }
753  }
754 
755  }
756  if (doMC) {
757  trkHcalEne = spr::eCaloSimInfo(iEvent, geo,pcalohh, SimTk, SimVtx, pTrack, *associate);
758  }
759 
760  // ====================================================================================================
761  // get diff between track outermost hit position and the propagation point at outermost surface of tracker
762  std::pair<math::XYZPoint,double> point2_TK0 = spr::propagateTrackerEnd( pTrack, bField, false);
763  math::XYZPoint diff(pTrack->outerPosition().X()-point2_TK0.first.X(),
764  pTrack->outerPosition().Y()-point2_TK0.first.Y(),
765  pTrack->outerPosition().Z()-point2_TK0.first.Z() );
766  double trackOutPosOutHitDr = diff.R();
767  double trackL = point2_TK0.second;
768  if (myverbose_==5) {
769  std::cout<<" propagted "<<point2_TK0.first<<" "<< point2_TK0.first.eta()<<" "<<point2_TK0.first.phi()<<std::endl;
770  std::cout<<" outerPosition() "<< pTrack->outerPosition() << " "<< pTrack->outerPosition().eta()<< " " << pTrack->outerPosition().phi()<< std::endl;
771  std::cout<<"diff " << diff << " diffR " <<diff.R()<<" diffR/L "<<diff.R()/point2_TK0.second <<std::endl;
772  }
773 
774  for(unsigned int ind=0;ind<recVtxs->size();ind++) {
775  if (!((*recVtxs)[ind].isFake())) {
776  reco::Vertex::trackRef_iterator vtxTrack = (*recVtxs)[ind].tracks_begin();
777  if( DeltaR(eta1,phi1, (*vtxTrack)->eta(),(*vtxTrack)->phi()) < 0.01 ) t_trackPVIdx ->push_back( ind );
778  else t_trackPVIdx ->push_back( -1 );
779  }
780  }
781 
782  // Fill the tree Branches here
783  t_trackPVIdx ->push_back( pVtxTkId );
784  t_trackP ->push_back( p1 );
785  t_trackPt ->push_back( pt1 );
786  t_trackEta ->push_back( eta1 );
787  t_trackPhi ->push_back( phi1 );
788  t_trackEcalEta ->push_back( etaEcal1 );
789  t_trackEcalPhi ->push_back( phiEcal1 );
790  t_trackHcalEta ->push_back( etaHcal1 );
791  t_trackHcalPhi ->push_back( phiHcal1 );
792  t_trackDxy ->push_back( dxy1 );
793  t_trackDz ->push_back( dz1 );
794  t_trackDxyBS ->push_back( dxybs1 );
795  t_trackDzBS ->push_back( dzbs1 );
796  t_trackDxyPV ->push_back( dxypv1 );
797  t_trackDzPV ->push_back( dzpv1 );
798  t_trackChiSq ->push_back( chisq1 );
799  t_trackNOuterHits ->push_back( nOuterHits );
800  t_NLayersCrossed ->push_back( nLayersCrossed );
801 
802  t_trackHitsTOB ->push_back( hitp.stripTOBLayersWithMeasurement() );
803  t_trackHitsTEC ->push_back( hitp.stripTECLayersWithMeasurement() );
804  t_trackHitInMissTOB ->push_back( hitpIn.stripTOBLayersWithoutMeasurement() );
805  t_trackHitInMissTEC ->push_back( hitpIn.stripTECLayersWithoutMeasurement() );
806  t_trackHitInMissTIB ->push_back( hitpIn.stripTIBLayersWithoutMeasurement() );
809 
811  t_trackHitOutMissTEC ->push_back( hitpOut.stripTECLayersWithoutMeasurement() );
815 
816  t_trackHitInMeasTOB ->push_back( hitpIn.stripTOBLayersWithMeasurement() );
817  t_trackHitInMeasTEC ->push_back( hitpIn.stripTECLayersWithMeasurement() );
818  t_trackHitInMeasTIB ->push_back( hitpIn.stripTIBLayersWithMeasurement() );
819  t_trackHitInMeasTID ->push_back( hitpIn.stripTIDLayersWithMeasurement() );
820  t_trackHitOutMeasTOB ->push_back( hitpOut.stripTOBLayersWithMeasurement() );
821  t_trackHitOutMeasTEC ->push_back( hitpOut.stripTECLayersWithMeasurement() );
822  t_trackHitOutMeasTIB ->push_back( hitpOut.stripTIBLayersWithMeasurement() );
823  t_trackHitOutMeasTID ->push_back( hitpOut.stripTIDLayersWithMeasurement() );
824  t_trackOutPosOutHitDr ->push_back( trackOutPosOutHitDr );
825  t_trackL ->push_back( trackL );
826 
827  t_maxNearP31x31 ->push_back( maxNearP31x31 );
828  t_maxNearP21x21 ->push_back( maxNearP21x21 );
829 
830  t_ecalSpike11x11 ->push_back( e11x11P.second );
831  t_e7x7 ->push_back( e7x7P.first );
832  t_e9x9 ->push_back( e9x9P.first );
833  t_e11x11 ->push_back( e11x11P.first );
834  t_e15x15 ->push_back( e15x15P.first );
835 
836  t_e7x7_10Sig ->push_back( e7x7_10SigP.first );
837  t_e9x9_10Sig ->push_back( e9x9_10SigP.first );
838  t_e11x11_10Sig ->push_back( e11x11_10SigP.first );
839  t_e15x15_10Sig ->push_back( e15x15_10SigP.first );
840  t_e7x7_15Sig ->push_back( e7x7_15SigP.first );
841  t_e9x9_15Sig ->push_back( e9x9_15SigP.first );
842  t_e11x11_15Sig ->push_back( e11x11_15SigP.first );
843  t_e15x15_15Sig ->push_back( e15x15_15SigP.first );
844  t_e7x7_20Sig ->push_back( e7x7_20SigP.first );
845  t_e9x9_20Sig ->push_back( e9x9_20SigP.first );
846  t_e11x11_20Sig ->push_back( e11x11_20SigP.first );
847  t_e15x15_20Sig ->push_back( e15x15_20SigP.first );
848  t_e7x7_25Sig ->push_back( e7x7_25SigP.first );
849  t_e9x9_25Sig ->push_back( e9x9_25SigP.first );
850  t_e11x11_25Sig ->push_back( e11x11_25SigP.first );
851  t_e15x15_25Sig ->push_back( e15x15_25SigP.first );
852  t_e7x7_30Sig ->push_back( e7x7_30SigP.first );
853  t_e9x9_30Sig ->push_back( e9x9_30SigP.first );
854  t_e11x11_30Sig ->push_back( e11x11_30SigP.first );
855  t_e15x15_30Sig ->push_back( e15x15_30SigP.first );
856 
857  if (doMC) {
858  t_esim7x7 ->push_back( simInfo7x7.eTotal );
859  t_esim9x9 ->push_back( simInfo9x9.eTotal );
860  t_esim11x11 ->push_back( simInfo11x11.eTotal );
861  t_esim15x15 ->push_back( simInfo15x15.eTotal );
862 
863  t_esim7x7Matched ->push_back( simInfo7x7.eMatched );
864  t_esim9x9Matched ->push_back( simInfo9x9.eMatched );
865  t_esim11x11Matched ->push_back( simInfo11x11.eMatched );
866  t_esim15x15Matched ->push_back( simInfo15x15.eMatched );
867 
868  t_esim7x7Rest ->push_back( simInfo7x7.eRest );
869  t_esim9x9Rest ->push_back( simInfo9x9.eRest );
870  t_esim11x11Rest ->push_back( simInfo11x11.eRest );
871  t_esim15x15Rest ->push_back( simInfo15x15.eRest );
872 
873  t_esim7x7Photon ->push_back( simInfo7x7.eGamma );
874  t_esim9x9Photon ->push_back( simInfo9x9.eGamma );
875  t_esim11x11Photon ->push_back( simInfo11x11.eGamma );
876  t_esim15x15Photon ->push_back( simInfo15x15.eGamma );
877 
878  t_esim7x7NeutHad ->push_back( simInfo7x7.eNeutralHad );
879  t_esim9x9NeutHad ->push_back( simInfo9x9.eNeutralHad );
880  t_esim11x11NeutHad ->push_back( simInfo11x11.eNeutralHad );
881  t_esim15x15NeutHad ->push_back( simInfo15x15.eNeutralHad );
882 
883  t_esim7x7CharHad ->push_back( simInfo7x7.eChargedHad );
884  t_esim9x9CharHad ->push_back( simInfo9x9.eChargedHad );
885  t_esim11x11CharHad ->push_back( simInfo11x11.eChargedHad );
886  t_esim15x15CharHad ->push_back( simInfo15x15.eChargedHad );
887 
888  t_trkEcalEne ->push_back( trkEcalEne );
889  t_simTrackP ->push_back( simTrackP );
890  t_esimPdgId ->push_back( simInfo11x11.pdgMatched );
891  }
892 
893  t_maxNearHcalP3x3 ->push_back( maxNearHcalP3x3 );
894  t_maxNearHcalP5x5 ->push_back( maxNearHcalP5x5 );
895  t_maxNearHcalP7x7 ->push_back( maxNearHcalP7x7 );
896 
897  t_h3x3 ->push_back( h3x3 );
898  t_h5x5 ->push_back( h5x5 );
899  t_h7x7 ->push_back( h7x7 );
900  t_h3x3Sig ->push_back( h3x3Sig );
901  t_h5x5Sig ->push_back( h5x5Sig );
902  t_h7x7Sig ->push_back( h7x7Sig );
903 
904  t_infoHcal ->push_back( trkDetItr->okHCAL );
905  if (doMC) {
906  t_trkHcalEne ->push_back( hcalScale*trkHcalEne );
907 
908  t_hsim3x3 ->push_back( hcalScale*hsimInfo3x3.eTotal );
909  t_hsim5x5 ->push_back( hcalScale*hsimInfo5x5.eTotal );
910  t_hsim7x7 ->push_back( hcalScale*hsimInfo7x7.eTotal );
911 
912  t_hsim3x3Matched ->push_back( hcalScale*hsimInfo3x3.eMatched );
913  t_hsim5x5Matched ->push_back( hcalScale*hsimInfo5x5.eMatched );
914  t_hsim7x7Matched ->push_back( hcalScale*hsimInfo7x7.eMatched );
915 
916  t_hsim3x3Rest ->push_back( hcalScale*hsimInfo3x3.eRest );
917  t_hsim5x5Rest ->push_back( hcalScale*hsimInfo5x5.eRest );
918  t_hsim7x7Rest ->push_back( hcalScale*hsimInfo7x7.eRest );
919 
920  t_hsim3x3Photon ->push_back( hcalScale*hsimInfo3x3.eGamma );
921  t_hsim5x5Photon ->push_back( hcalScale*hsimInfo5x5.eGamma );
922  t_hsim7x7Photon ->push_back( hcalScale*hsimInfo7x7.eGamma );
923 
924  t_hsim3x3NeutHad ->push_back( hcalScale*hsimInfo3x3.eNeutralHad );
925  t_hsim5x5NeutHad ->push_back( hcalScale*hsimInfo5x5.eNeutralHad );
926  t_hsim7x7NeutHad ->push_back( hcalScale*hsimInfo7x7.eNeutralHad );
927 
928  t_hsim3x3CharHad ->push_back( hcalScale*hsimInfo3x3.eChargedHad );
929  t_hsim5x5CharHad ->push_back( hcalScale*hsimInfo5x5.eChargedHad );
930  t_hsim7x7CharHad ->push_back( hcalScale*hsimInfo7x7.eChargedHad );
931  }
932  /*
933  if(hcalScale*hsimInfo3x3["eTotal"] > 50.0) {
934 
935  std::cout << "Loosely Iso Track : eta " << eta1 << " Rec Mom " << p1 << " SimMom " << simTrackP << " h3x3 " << h3x3 << std::endl;
936 
937  std::cout <<"Closest cell Hcal (atHCAL) " << (HcalDetId)ClosestCell << std::endl;
938 
939  std::cout <<"trkHcalEne, etotal, matched, rest " <<hcalScale*trkHcalEne<<std::setw(15)<<hcalScale*hsimInfo3x3["eTotal"]
940  <<std::setw(15)<<hcalScale*hsimInfo3x3["eMatched"]<<std::setw(15)<<hcalScale*hsimInfo3x3["eRest"]
941  <<std::endl;
942  unsigned int nn = t_trkHcalEne->size();
943  std::cout <<"in Tree " << (*t_trkHcalEne)[nn-1] <<std::setw(15)<< (*t_hsim3x3)[nn-1]
944  <<std::setw(15)<< (*t_hsim3x3Matched)[nn-1] <<std::setw(15)<< (*t_hsim3x3Rest)[nn-1]
945  << std::endl;
946 
947  std::cout << "debug output \n" << std::endl;
948  std::map<std::string, double> hsimInfo3x3_debug = spr::eHCALSimInfo(iEvent, theHBHETopology, ClosestCell, geo,pcalohh, SimTk, SimVtx, pTrack, *associate, 1,1, 150.0, true);
949 
950  }
951  */
952 
953 
954  } // if loosely isolated track
955  } // check p1/eta
956  } // loop over track collection
957 
958  if(haveIsoTrack) tree->Fill();
959 }
960 
961 // ----- method called once each job just before starting event loop ----
963 
964  nEventProc=0;
965 
966  // double tempgen_TH[21] = { 1.0, 2.0, 3.0, 4.0, 5.0,
967  double tempgen_TH[16] = { 0.0, 1.0, 2.0, 3.0, 4.0,
968  5.0, 6.0, 7.0, 9.0, 11.0,
969  15.0, 20.0, 30.0, 50.0, 75.0, 100.0};
970 
971  for(int i=0; i<16; i++) genPartPBins[i] = tempgen_TH[i];
972 
973  double tempgen_Eta[4] = {0.0, 1.131, 1.653, 2.172};
974 
975  for(int i=0; i<4; i++) genPartEtaBins[i] = tempgen_Eta[i];
976 
977  BookHistograms();
978 }
979 
980 // ----- method called once each job just after ending the event loop ----
982 
983  if(L1TriggerAlgoInfo_) {
984  std::map< std::pair<unsigned int,std::string>, int>::iterator itr;
985  for(itr=l1AlgoMap.begin(); itr!=l1AlgoMap.end(); itr++) {
986  std::cout << " ****endjob**** " << (itr->first).first <<" "
987  <<(itr->first).second <<" "<<itr->second
988  << std::endl;
989  int ibin = (itr->first).first;
990  TString name( (itr->first).second );
991  h_L1AlgoNames->GetXaxis()->SetBinLabel(ibin+1,name);
992  }
993  std::cout << "Number of Events Processed " << nEventProc << std::endl;
994  }
995 
996 }
997 
998 //========================================================================================================
999 
1001 
1002  t_PVx ->clear();
1003  t_PVy ->clear();
1004  t_PVz ->clear();
1005  t_PVisValid ->clear();
1006  t_PVndof ->clear();
1007  t_PVNTracks ->clear();
1008  t_PVNTracksWt ->clear();
1009  t_PVTracksSumPt ->clear();
1010  t_PVTracksSumPtWt ->clear();
1011  t_PVNTracksHP ->clear();
1012  t_PVNTracksHPWt ->clear();
1013  t_PVTracksSumPtHP ->clear();
1014  t_PVTracksSumPtHPWt ->clear();
1015 
1016  for(int i=0; i<128; i++) t_L1Decision[i]=0;
1017  t_L1AlgoNames ->clear();
1018  t_L1PreScale ->clear();
1019 
1020  t_L1CenJetPt ->clear();
1021  t_L1CenJetEta ->clear();
1022  t_L1CenJetPhi ->clear();
1023  t_L1FwdJetPt ->clear();
1024  t_L1FwdJetEta ->clear();
1025  t_L1FwdJetPhi ->clear();
1026  t_L1TauJetPt ->clear();
1027  t_L1TauJetEta ->clear();
1028  t_L1TauJetPhi ->clear();
1029  t_L1MuonPt ->clear();
1030  t_L1MuonEta ->clear();
1031  t_L1MuonPhi ->clear();
1032  t_L1IsoEMPt ->clear();
1033  t_L1IsoEMEta ->clear();
1034  t_L1IsoEMPhi ->clear();
1035  t_L1NonIsoEMPt ->clear();
1036  t_L1NonIsoEMEta ->clear();
1037  t_L1NonIsoEMPhi ->clear();
1038  t_L1METPt ->clear();
1039  t_L1METEta ->clear();
1040  t_L1METPhi ->clear();
1041 
1042  t_jetPt ->clear();
1043  t_jetEta ->clear();
1044  t_jetPhi ->clear();
1045  t_nTrksJetCalo ->clear();
1046  t_nTrksJetVtx ->clear();
1047 
1048  t_trackPAll ->clear();
1049  t_trackEtaAll ->clear();
1050  t_trackPhiAll ->clear();
1051  t_trackPdgIdAll ->clear();
1052  t_trackPtAll ->clear();
1053  t_trackDxyAll ->clear();
1054  t_trackDzAll ->clear();
1055  t_trackDxyPVAll ->clear();
1056  t_trackDzPVAll ->clear();
1057  t_trackChiSqAll ->clear();
1058 
1059  t_trackP ->clear();
1060  t_trackPt ->clear();
1061  t_trackEta ->clear();
1062  t_trackPhi ->clear();
1063  t_trackEcalEta ->clear();
1064  t_trackEcalPhi ->clear();
1065  t_trackHcalEta ->clear();
1066  t_trackHcalPhi ->clear();
1067  t_NLayersCrossed ->clear();
1068  t_trackNOuterHits ->clear();
1069  t_trackDxy ->clear();
1070  t_trackDxyBS ->clear();
1071  t_trackDz ->clear();
1072  t_trackDzBS ->clear();
1073  t_trackDxyPV ->clear();
1074  t_trackDzPV ->clear();
1075  t_trackChiSq ->clear();
1076  t_trackPVIdx ->clear();
1077  t_trackHitsTOB ->clear();
1078  t_trackHitsTEC ->clear();
1079  t_trackHitInMissTOB ->clear();
1080  t_trackHitInMissTEC ->clear();
1081  t_trackHitInMissTIB ->clear();
1082  t_trackHitInMissTID ->clear();
1083  t_trackHitInMissTIBTID ->clear();
1084  t_trackHitOutMissTOB ->clear();
1085  t_trackHitOutMissTEC ->clear();
1086  t_trackHitOutMissTIB ->clear();
1087  t_trackHitOutMissTID ->clear();
1088  t_trackHitOutMissTOBTEC ->clear();
1089  t_trackHitInMeasTOB ->clear();
1090  t_trackHitInMeasTEC ->clear();
1091  t_trackHitInMeasTIB ->clear();
1092  t_trackHitInMeasTID ->clear();
1093  t_trackHitOutMeasTOB ->clear();
1094  t_trackHitOutMeasTEC ->clear();
1095  t_trackHitOutMeasTIB ->clear();
1096  t_trackHitOutMeasTID ->clear();
1097  t_trackOutPosOutHitDr ->clear();
1098  t_trackL ->clear();
1099 
1100  t_maxNearP31x31 ->clear();
1101  t_maxNearP21x21 ->clear();
1102 
1103  t_ecalSpike11x11 ->clear();
1104  t_e7x7 ->clear();
1105  t_e9x9 ->clear();
1106  t_e11x11 ->clear();
1107  t_e15x15 ->clear();
1108 
1109  t_e7x7_10Sig ->clear();
1110  t_e9x9_10Sig ->clear();
1111  t_e11x11_10Sig ->clear();
1112  t_e15x15_10Sig ->clear();
1113  t_e7x7_15Sig ->clear();
1114  t_e9x9_15Sig ->clear();
1115  t_e11x11_15Sig ->clear();
1116  t_e15x15_15Sig ->clear();
1117  t_e7x7_20Sig ->clear();
1118  t_e9x9_20Sig ->clear();
1119  t_e11x11_20Sig ->clear();
1120  t_e15x15_20Sig ->clear();
1121  t_e7x7_25Sig ->clear();
1122  t_e9x9_25Sig ->clear();
1123  t_e11x11_25Sig ->clear();
1124  t_e15x15_25Sig ->clear();
1125  t_e7x7_30Sig ->clear();
1126  t_e9x9_30Sig ->clear();
1127  t_e11x11_30Sig ->clear();
1128  t_e15x15_30Sig ->clear();
1129 
1130  if (doMC) {
1131  t_simTrackP ->clear();
1132  t_esimPdgId ->clear();
1133  t_trkEcalEne ->clear();
1134 
1135  t_esim7x7 ->clear();
1136  t_esim9x9 ->clear();
1137  t_esim11x11 ->clear();
1138  t_esim15x15 ->clear();
1139 
1140  t_esim7x7Matched ->clear();
1141  t_esim9x9Matched ->clear();
1142  t_esim11x11Matched ->clear();
1143  t_esim15x15Matched ->clear();
1144 
1145  t_esim7x7Rest ->clear();
1146  t_esim9x9Rest ->clear();
1147  t_esim11x11Rest ->clear();
1148  t_esim15x15Rest ->clear();
1149 
1150  t_esim7x7Photon ->clear();
1151  t_esim9x9Photon ->clear();
1152  t_esim11x11Photon ->clear();
1153  t_esim15x15Photon ->clear();
1154 
1155  t_esim7x7NeutHad ->clear();
1156  t_esim9x9NeutHad ->clear();
1157  t_esim11x11NeutHad ->clear();
1158  t_esim15x15NeutHad ->clear();
1159 
1160  t_esim7x7CharHad ->clear();
1161  t_esim9x9CharHad ->clear();
1162  t_esim11x11CharHad ->clear();
1163  t_esim15x15CharHad ->clear();
1164  }
1165 
1166  t_maxNearHcalP3x3 ->clear();
1167  t_maxNearHcalP5x5 ->clear();
1168  t_maxNearHcalP7x7 ->clear();
1169 
1170  t_h3x3 ->clear();
1171  t_h5x5 ->clear();
1172  t_h7x7 ->clear();
1173  t_h3x3Sig ->clear();
1174  t_h5x5Sig ->clear();
1175  t_h7x7Sig ->clear();
1176 
1177  t_infoHcal ->clear();
1178 
1179  if (doMC) {
1180  t_trkHcalEne ->clear();
1181 
1182  t_hsim3x3 ->clear();
1183  t_hsim5x5 ->clear();
1184  t_hsim7x7 ->clear();
1185  t_hsim3x3Matched ->clear();
1186  t_hsim5x5Matched ->clear();
1187  t_hsim7x7Matched ->clear();
1188  t_hsim3x3Rest ->clear();
1189  t_hsim5x5Rest ->clear();
1190  t_hsim7x7Rest ->clear();
1191  t_hsim3x3Photon ->clear();
1192  t_hsim5x5Photon ->clear();
1193  t_hsim7x7Photon ->clear();
1194  t_hsim3x3NeutHad ->clear();
1195  t_hsim5x5NeutHad ->clear();
1196  t_hsim7x7NeutHad ->clear();
1197  t_hsim3x3CharHad ->clear();
1198  t_hsim5x5CharHad ->clear();
1199  t_hsim7x7CharHad ->clear();
1200  }
1201 }
1202 
1204 
1205  char hname[100], htit[100];
1206 
1207  TFileDirectory dir = fs->mkdir("nearMaxTrackP");
1208 
1209  for(unsigned int ieta=0; ieta<NEtaBins; ieta++) {
1210  double lowEta=-5.0, highEta= 5.0;
1211  lowEta = genPartEtaBins[ieta];
1212  highEta = genPartEtaBins[ieta+1];
1213 
1214  for(unsigned int ipt=0; ipt<NPBins; ipt++) {
1215  double lowP=0.0, highP=300.0;
1216  lowP = genPartPBins[ipt];
1217  highP = genPartPBins[ipt+1];
1218  sprintf(hname, "h_maxNearP31x31_ptBin%i_etaBin%i",ipt, ieta);
1219  sprintf(htit, "maxNearP in 31x31 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP );
1220  h_maxNearP31x31[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
1221  h_maxNearP31x31[ipt][ieta] ->Sumw2();
1222  sprintf(hname, "h_maxNearP25x25_ptBin%i_etaBin%i",ipt, ieta);
1223  sprintf(htit, "maxNearP in 25x25 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP );
1224  h_maxNearP25x25[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
1225  h_maxNearP25x25[ipt][ieta] ->Sumw2();
1226  sprintf(hname, "h_maxNearP21x21_ptBin%i_etaBin%i",ipt, ieta);
1227  sprintf(htit, "maxNearP in 21x21 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP );
1228  h_maxNearP21x21[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
1229  h_maxNearP21x21[ipt][ieta] ->Sumw2();
1230  sprintf(hname, "h_maxNearP15x15_ptBin%i_etaBin%i",ipt, ieta);
1231  sprintf(htit, "maxNearP in 15x15 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP );
1232  h_maxNearP15x15[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
1233  h_maxNearP15x15[ipt][ieta] ->Sumw2();
1234  }
1235  }
1236 
1237  h_L1AlgoNames = fs->make<TH1I>("h_L1AlgoNames", "h_L1AlgoNames:Bin Labels", 128, -0.5, 127.5);
1238 
1239  // Reconstructed Tracks
1240 
1241  h_PVTracksWt = fs->make<TH1F>("h_PVTracksWt", "h_PVTracksWt", 600, -0.1, 1.1);
1242 
1243  h_nTracks = fs->make<TH1F>("h_nTracks", "h_nTracks", 1000, -0.5, 999.5);
1244 
1245  sprintf(hname, "h_recEtaPt_0");
1246  sprintf(htit, "h_recEtaPt (all tracks Eta vs pT)");
1247  h_recEtaPt_0 = fs->make<TH2F>(hname, htit, 30, -3.0,3.0, 15, genPartPBins);
1248 
1249  sprintf(hname, "h_recEtaP_0");
1250  sprintf(htit, "h_recEtaP (all tracks Eta vs pT)");
1251  h_recEtaP_0 = fs->make<TH2F>(hname, htit, 30, -3.0,3.0, 15, genPartPBins);
1252 
1253  h_recPt_0 = fs->make<TH1F>("h_recPt_0", "Pt (all tracks)", 15, genPartPBins);
1254  h_recP_0 = fs->make<TH1F>("h_recP_0", "P (all tracks)", 15, genPartPBins);
1255  h_recEta_0 = fs->make<TH1F>("h_recEta_0", "Eta (all tracks)", 60, -3.0, 3.0);
1256  h_recPhi_0 = fs->make<TH1F>("h_recPhi_0", "Phi (all tracks)", 100, -3.2, 3.2);
1257  //-------------------------
1258  sprintf(hname, "h_recEtaPt_1");
1259  sprintf(htit, "h_recEtaPt (all good tracks Eta vs pT)");
1260  h_recEtaPt_1 = fs->make<TH2F>(hname, htit, 30, -3.0,3.0, 15, genPartPBins);
1261 
1262  sprintf(hname, "h_recEtaP_1");
1263  sprintf(htit, "h_recEtaP (all good tracks Eta vs pT)");
1264  h_recEtaP_1 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
1265 
1266  h_recPt_1 = fs->make<TH1F>("h_recPt_1", "Pt (all good tracks)", 15, genPartPBins);
1267  h_recP_1 = fs->make<TH1F>("h_recP_1", "P (all good tracks)", 15, genPartPBins);
1268  h_recEta_1 = fs->make<TH1F>("h_recEta_1", "Eta (all good tracks)", 60, -3.0, 3.0);
1269  h_recPhi_1 = fs->make<TH1F>("h_recPhi_1", "Phi (all good tracks)", 100, -3.2, 3.2);
1270  //-------------------------
1271  sprintf(hname, "h_recEtaPt_2");
1272  sprintf(htit, "h_recEtaPt (charge isolation Eta vs pT)");
1273  h_recEtaPt_2 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
1274 
1275  sprintf(hname, "h_recEtaP_2");
1276  sprintf(htit, "h_recEtaP (charge isolation Eta vs pT)");
1277  h_recEtaP_2 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
1278 
1279  h_recPt_2 = fs->make<TH1F>("h_recPt_2", "Pt (charge isolation)", 15, genPartPBins);
1280  h_recP_2 = fs->make<TH1F>("h_recP_2", "P (charge isolation)", 15, genPartPBins);
1281  h_recEta_2 = fs->make<TH1F>("h_recEta_2", "Eta (charge isolation)", 60, -3.0, 3.0);
1282  h_recPhi_2 = fs->make<TH1F>("h_recPhi_2", "Phi (charge isolation)", 100, -3.2, 3.2);
1283 
1284 
1285  tree = fs->make<TTree>("tree", "tree");
1286  tree->SetAutoSave(10000);
1287 
1288 
1289  tree->Branch("t_EvtNo" ,&t_EvtNo ,"t_EvtNo/I");
1290  tree->Branch("t_RunNo" ,&t_RunNo ,"t_RunNo/I");
1291  tree->Branch("t_Lumi" ,&t_Lumi ,"t_Lumi/I");
1292  tree->Branch("t_Bunch" ,&t_Bunch ,"t_Bunch/I");
1293 
1294 
1295  t_PVx = new std::vector<double>();
1296  t_PVy = new std::vector<double>();
1297  t_PVz = new std::vector<double>();
1298  t_PVisValid = new std::vector<int>();
1299  t_PVndof = new std::vector<int>();
1300  t_PVNTracks = new std::vector<int>();
1301  t_PVNTracksWt = new std::vector<int>();
1302  t_PVTracksSumPt = new std::vector<double>();
1303  t_PVTracksSumPtWt = new std::vector<double>();
1304  t_PVNTracksHP = new std::vector<int>();
1305  t_PVNTracksHPWt = new std::vector<int>();
1306  t_PVTracksSumPtHP = new std::vector<double>();
1307  t_PVTracksSumPtHPWt = new std::vector<double>();
1308 
1309  tree->Branch("PVx" ,"vector<double>" ,&t_PVx);
1310  tree->Branch("PVy" ,"vector<double>" ,&t_PVy);
1311  tree->Branch("PVz" ,"vector<double>" ,&t_PVz);
1312  tree->Branch("PVisValid" ,"vector<int>" ,&t_PVisValid);
1313  tree->Branch("PVndof" ,"vector<int>" ,&t_PVndof);
1314  tree->Branch("PVNTracks" ,"vector<int>" ,&t_PVNTracks);
1315  tree->Branch("PVNTracksWt" ,"vector<int>" ,&t_PVNTracksWt);
1316  tree->Branch("t_PVTracksSumPt" ,"vector<double>" ,&t_PVTracksSumPt);
1317  tree->Branch("t_PVTracksSumPtWt" ,"vector<double>" ,&t_PVTracksSumPtWt);
1318  tree->Branch("PVNTracksHP" ,"vector<int>" ,&t_PVNTracksHP);
1319  tree->Branch("PVNTracksHPWt" ,"vector<int>" ,&t_PVNTracksHPWt);
1320  tree->Branch("t_PVTracksSumPtHP" ,"vector<double>" ,&t_PVTracksSumPtHP);
1321  tree->Branch("t_PVTracksSumPtHPWt" ,"vector<double>" ,&t_PVTracksSumPtHPWt);
1322 
1323  //----- L1Trigger information
1324  for(int i=0; i<128; i++) t_L1Decision[i]=0;
1325  t_L1AlgoNames = new std::vector<std::string>();
1326  t_L1PreScale = new std::vector<int>();
1327  t_L1CenJetPt = new std::vector<double>();
1328  t_L1CenJetEta = new std::vector<double>();
1329  t_L1CenJetPhi = new std::vector<double>();
1330  t_L1FwdJetPt = new std::vector<double>();
1331  t_L1FwdJetEta = new std::vector<double>();
1332  t_L1FwdJetPhi = new std::vector<double>();
1333  t_L1TauJetPt = new std::vector<double>();
1334  t_L1TauJetEta = new std::vector<double>();
1335  t_L1TauJetPhi = new std::vector<double>();
1336  t_L1MuonPt = new std::vector<double>();
1337  t_L1MuonEta = new std::vector<double>();
1338  t_L1MuonPhi = new std::vector<double>();
1339  t_L1IsoEMPt = new std::vector<double>();
1340  t_L1IsoEMEta = new std::vector<double>();
1341  t_L1IsoEMPhi = new std::vector<double>();
1342  t_L1NonIsoEMPt = new std::vector<double>();
1343  t_L1NonIsoEMEta = new std::vector<double>();
1344  t_L1NonIsoEMPhi = new std::vector<double>();
1345  t_L1METPt = new std::vector<double>();
1346  t_L1METEta = new std::vector<double>();
1347  t_L1METPhi = new std::vector<double>();
1348 
1349  tree->Branch("t_L1Decision", t_L1Decision, "t_L1Decision[128]/I");
1350  tree->Branch("t_L1AlgoNames", "vector<string>", &t_L1AlgoNames);
1351  tree->Branch("t_L1PreScale", "vector<int>", &t_L1PreScale);
1352  tree->Branch("t_L1CenJetPt", "vector<double>", &t_L1CenJetPt);
1353  tree->Branch("t_L1CenJetEta", "vector<double>", &t_L1CenJetEta);
1354  tree->Branch("t_L1CenJetPhi", "vector<double>", &t_L1CenJetPhi);
1355  tree->Branch("t_L1FwdJetPt", "vector<double>", &t_L1FwdJetPt);
1356  tree->Branch("t_L1FwdJetEta", "vector<double>", &t_L1FwdJetEta);
1357  tree->Branch("t_L1FwdJetPhi", "vector<double>", &t_L1FwdJetPhi);
1358  tree->Branch("t_L1TauJetPt", "vector<double>", &t_L1TauJetPt);
1359  tree->Branch("t_L1TauJetEta", "vector<double>", &t_L1TauJetEta);
1360  tree->Branch("t_L1TauJetPhi", "vector<double>", &t_L1TauJetPhi);
1361  tree->Branch("t_L1MuonPt", "vector<double>", &t_L1MuonPt);
1362  tree->Branch("t_L1MuonEta", "vector<double>", &t_L1MuonEta);
1363  tree->Branch("t_L1MuonPhi", "vector<double>", &t_L1MuonPhi);
1364  tree->Branch("t_L1IsoEMPt", "vector<double>", &t_L1IsoEMPt);
1365  tree->Branch("t_L1IsoEMEta", "vector<double>", &t_L1IsoEMEta);
1366  tree->Branch("t_L1IsoEMPhi", "vector<double>", &t_L1IsoEMPhi);
1367  tree->Branch("t_L1NonIsoEMPt", "vector<double>", &t_L1NonIsoEMPt);
1368  tree->Branch("t_L1NonIsoEMEta", "vector<double>", &t_L1NonIsoEMEta);
1369  tree->Branch("t_L1NonIsoEMPhi", "vector<double>", &t_L1NonIsoEMPhi);
1370  tree->Branch("t_L1METPt", "vector<double>", &t_L1METPt);
1371  tree->Branch("t_L1METEta", "vector<double>", &t_L1METEta);
1372  tree->Branch("t_L1METPhi", "vector<double>", &t_L1METPhi);
1373 
1374  t_jetPt = new std::vector<double>();
1375  t_jetEta = new std::vector<double>();
1376  t_jetPhi = new std::vector<double>();
1377  t_nTrksJetCalo = new std::vector<double>();
1378  t_nTrksJetVtx = new std::vector<double>();
1379  tree->Branch("t_jetPt", "vector<double>",&t_jetPt);
1380  tree->Branch("t_jetEta", "vector<double>",&t_jetEta);
1381  tree->Branch("t_jetPhi", "vector<double>",&t_jetPhi);
1382  tree->Branch("t_nTrksJetCalo", "vector<double>",&t_nTrksJetCalo);
1383  tree->Branch("t_nTrksJetVtx", "vector<double>",&t_nTrksJetVtx);
1384 
1385  t_trackPAll = new std::vector<double>();
1386  t_trackEtaAll = new std::vector<double>();
1387  t_trackPhiAll = new std::vector<double>();
1388  t_trackPdgIdAll = new std::vector<double>();
1389  t_trackPtAll = new std::vector<double>();
1390  t_trackDxyAll = new std::vector<double>();
1391  t_trackDzAll = new std::vector<double>();
1392  t_trackDxyPVAll = new std::vector<double>();
1393  t_trackDzPVAll = new std::vector<double>();
1394  t_trackChiSqAll = new std::vector<double>();
1395  tree->Branch("t_trackPAll", "vector<double>", &t_trackPAll );
1396  tree->Branch("t_trackPhiAll", "vector<double>", &t_trackPhiAll );
1397  tree->Branch("t_trackEtaAll", "vector<double>", &t_trackEtaAll );
1398  tree->Branch("t_trackPtAll", "vector<double>", &t_trackPtAll );
1399  tree->Branch("t_trackDxyAll", "vector<double>", &t_trackDxyAll );
1400  tree->Branch("t_trackDzAll", "vector<double>", &t_trackDzAll );
1401  tree->Branch("t_trackDxyPVAll", "vector<double>", &t_trackDxyPVAll );
1402  tree->Branch("t_trackDzPVAll", "vector<double>", &t_trackDzPVAll );
1403  tree->Branch("t_trackChiSqAll", "vector<double>", &t_trackChiSqAll );
1404  //tree->Branch("t_trackPdgIdAll", "vector<double>", &t_trackPdgIdAll);
1405 
1406  t_trackP = new std::vector<double>();
1407  t_trackPt = new std::vector<double>();
1408  t_trackEta = new std::vector<double>();
1409  t_trackPhi = new std::vector<double>();
1410  t_trackEcalEta = new std::vector<double>();
1411  t_trackEcalPhi = new std::vector<double>();
1412  t_trackHcalEta = new std::vector<double>();
1413  t_trackHcalPhi = new std::vector<double>();
1414  t_trackNOuterHits = new std::vector<int>();
1415  t_NLayersCrossed = new std::vector<int>();
1416  t_trackDxy = new std::vector<double>();
1417  t_trackDxyBS = new std::vector<double>();
1418  t_trackDz = new std::vector<double>();
1419  t_trackDzBS = new std::vector<double>();
1420  t_trackDxyPV = new std::vector<double>();
1421  t_trackDzPV = new std::vector<double>();
1422  t_trackPVIdx = new std::vector<int>();
1423  t_trackChiSq = new std::vector<double>();
1424  t_trackHitsTOB = new std::vector<int>();
1425  t_trackHitsTEC = new std::vector<int>();
1426  t_trackHitInMissTOB = new std::vector<int>();
1427  t_trackHitInMissTEC = new std::vector<int>();
1428  t_trackHitInMissTIB = new std::vector<int>();
1429  t_trackHitInMissTID = new std::vector<int>();
1430  t_trackHitOutMissTOB = new std::vector<int>();
1431  t_trackHitOutMissTEC = new std::vector<int>();
1432  t_trackHitOutMissTIB = new std::vector<int>();
1433  t_trackHitOutMissTID = new std::vector<int>();
1434  t_trackHitInMissTIBTID = new std::vector<int>();
1435  t_trackHitOutMissTOB = new std::vector<int>();
1436  t_trackHitOutMissTEC = new std::vector<int>();
1437  t_trackHitOutMissTIB = new std::vector<int>();
1438  t_trackHitOutMissTID = new std::vector<int>();
1439  t_trackHitOutMissTOBTEC= new std::vector<int>();
1440  t_trackHitInMeasTOB = new std::vector<int>();
1441  t_trackHitInMeasTEC = new std::vector<int>();
1442  t_trackHitInMeasTIB = new std::vector<int>();
1443  t_trackHitInMeasTID = new std::vector<int>();
1444  t_trackHitOutMeasTOB = new std::vector<int>();
1445  t_trackHitOutMeasTEC = new std::vector<int>();
1446  t_trackHitOutMeasTIB = new std::vector<int>();
1447  t_trackHitOutMeasTID = new std::vector<int>();
1448  t_trackOutPosOutHitDr = new std::vector<double>();
1449  t_trackL = new std::vector<double>();
1450 
1451  tree->Branch("t_trackP", "vector<double>", &t_trackP );
1452  tree->Branch("t_trackPt", "vector<double>", &t_trackPt );
1453  tree->Branch("t_trackEta", "vector<double>", &t_trackEta );
1454  tree->Branch("t_trackPhi", "vector<double>", &t_trackPhi );
1455  tree->Branch("t_trackEcalEta", "vector<double>", &t_trackEcalEta );
1456  tree->Branch("t_trackEcalPhi", "vector<double>", &t_trackEcalPhi );
1457  tree->Branch("t_trackHcalEta", "vector<double>", &t_trackHcalEta );
1458  tree->Branch("t_trackHcalPhi", "vector<double>", &t_trackHcalPhi );
1459 
1460  tree->Branch("t_trackNOuterHits", "vector<int>", &t_trackNOuterHits );
1461  tree->Branch("t_NLayersCrossed", "vector<int>", &t_NLayersCrossed );
1462  tree->Branch("t_trackHitsTOB", "vector<int>", &t_trackHitsTOB );
1463  tree->Branch("t_trackHitsTEC", "vector<int>", &t_trackHitsTEC );
1464  tree->Branch("t_trackHitInMissTOB", "vector<int>", &t_trackHitInMissTOB );
1465  tree->Branch("t_trackHitInMissTEC", "vector<int>", &t_trackHitInMissTEC );
1466  tree->Branch("t_trackHitInMissTIB", "vector<int>", &t_trackHitInMissTIB );
1467  tree->Branch("t_trackHitInMissTID", "vector<int>", &t_trackHitInMissTID );
1468  tree->Branch("t_trackHitInMissTIBTID", "vector<int>", &t_trackHitInMissTIBTID );
1469  tree->Branch("t_trackHitOutMissTOB", "vector<int>", &t_trackHitOutMissTOB);
1470  tree->Branch("t_trackHitOutMissTEC", "vector<int>", &t_trackHitOutMissTEC);
1471  tree->Branch("t_trackHitOutMissTIB", "vector<int>", &t_trackHitOutMissTIB);
1472  tree->Branch("t_trackHitOutMissTID", "vector<int>", &t_trackHitOutMissTID);
1473  tree->Branch("t_trackHitOutMissTOBTEC","vector<int>", &t_trackHitOutMissTOBTEC);
1474  tree->Branch("t_trackHitInMeasTOB", "vector<int>", &t_trackHitInMeasTOB );
1475  tree->Branch("t_trackHitInMeasTEC", "vector<int>", &t_trackHitInMeasTEC );
1476  tree->Branch("t_trackHitInMeasTIB", "vector<int>", &t_trackHitInMeasTIB );
1477  tree->Branch("t_trackHitInMeasTID", "vector<int>", &t_trackHitInMeasTID );
1478  tree->Branch("t_trackHitOutMeasTOB", "vector<int>", &t_trackHitOutMeasTOB);
1479  tree->Branch("t_trackHitOutMeasTEC", "vector<int>", &t_trackHitOutMeasTEC);
1480  tree->Branch("t_trackHitOutMeasTIB", "vector<int>", &t_trackHitOutMeasTIB);
1481  tree->Branch("t_trackHitOutMeasTID", "vector<int>", &t_trackHitOutMeasTID);
1482  tree->Branch("t_trackOutPosOutHitDr", "vector<double>", &t_trackOutPosOutHitDr);
1483  tree->Branch("t_trackL", "vector<double>", &t_trackL);
1484 
1485  tree->Branch("t_trackDxy", "vector<double>", &t_trackDxy );
1486  tree->Branch("t_trackDxyBS", "vector<double>", &t_trackDxyBS );
1487  tree->Branch("t_trackDz", "vector<double>", &t_trackDz );
1488  tree->Branch("t_trackDzBS", "vector<double>", &t_trackDzBS );
1489  tree->Branch("t_trackDxyPV", "vector<double>", &t_trackDxyPV );
1490  tree->Branch("t_trackDzPV", "vector<double>", &t_trackDzPV );
1491  tree->Branch("t_trackChiSq", "vector<double>", &t_trackChiSq );
1492  tree->Branch("t_trackPVIdx", "vector<int>", &t_trackPVIdx );
1493 
1494  t_maxNearP31x31 = new std::vector<double>();
1495  t_maxNearP21x21 = new std::vector<double>();
1496 
1497  tree->Branch("t_maxNearP31x31", "vector<double>", &t_maxNearP31x31);
1498  tree->Branch("t_maxNearP21x21", "vector<double>", &t_maxNearP21x21);
1499 
1500  t_ecalSpike11x11 = new std::vector<int>();
1501  t_e7x7 = new std::vector<double>();
1502  t_e9x9 = new std::vector<double>();
1503  t_e11x11 = new std::vector<double>();
1504  t_e15x15 = new std::vector<double>();
1505 
1506  tree->Branch("t_ecalSpike11x11", "vector<int>", &t_ecalSpike11x11);
1507  tree->Branch("t_e7x7", "vector<double>", &t_e7x7);
1508  tree->Branch("t_e9x9", "vector<double>", &t_e9x9);
1509  tree->Branch("t_e11x11", "vector<double>", &t_e11x11);
1510  tree->Branch("t_e15x15", "vector<double>", &t_e15x15);
1511 
1512  t_e7x7_10Sig = new std::vector<double>();
1513  t_e9x9_10Sig = new std::vector<double>();
1514  t_e11x11_10Sig = new std::vector<double>();
1515  t_e15x15_10Sig = new std::vector<double>();
1516  t_e7x7_15Sig = new std::vector<double>();
1517  t_e9x9_15Sig = new std::vector<double>();
1518  t_e11x11_15Sig = new std::vector<double>();
1519  t_e15x15_15Sig = new std::vector<double>();
1520  t_e7x7_20Sig = new std::vector<double>();
1521  t_e9x9_20Sig = new std::vector<double>();
1522  t_e11x11_20Sig = new std::vector<double>();
1523  t_e15x15_20Sig = new std::vector<double>();
1524  t_e7x7_25Sig = new std::vector<double>();
1525  t_e9x9_25Sig = new std::vector<double>();
1526  t_e11x11_25Sig = new std::vector<double>();
1527  t_e15x15_25Sig = new std::vector<double>();
1528  t_e7x7_30Sig = new std::vector<double>();
1529  t_e9x9_30Sig = new std::vector<double>();
1530  t_e11x11_30Sig = new std::vector<double>();
1531  t_e15x15_30Sig = new std::vector<double>();
1532 
1533  tree->Branch("t_e7x7_10Sig" ,"vector<double>", &t_e7x7_10Sig);
1534  tree->Branch("t_e9x9_10Sig" ,"vector<double>", &t_e9x9_10Sig);
1535  tree->Branch("t_e11x11_10Sig" ,"vector<double>", &t_e11x11_10Sig);
1536  tree->Branch("t_e15x15_10Sig" ,"vector<double>", &t_e15x15_10Sig);
1537  tree->Branch("t_e7x7_15Sig" ,"vector<double>", &t_e7x7_15Sig);
1538  tree->Branch("t_e9x9_15Sig" ,"vector<double>", &t_e9x9_15Sig);
1539  tree->Branch("t_e11x11_15Sig" ,"vector<double>", &t_e11x11_15Sig);
1540  tree->Branch("t_e15x15_15Sig" ,"vector<double>", &t_e15x15_15Sig);
1541  tree->Branch("t_e7x7_20Sig" ,"vector<double>", &t_e7x7_20Sig);
1542  tree->Branch("t_e9x9_20Sig" ,"vector<double>", &t_e9x9_20Sig);
1543  tree->Branch("t_e11x11_20Sig" ,"vector<double>", &t_e11x11_20Sig);
1544  tree->Branch("t_e15x15_20Sig" ,"vector<double>", &t_e15x15_20Sig);
1545  tree->Branch("t_e7x7_25Sig" ,"vector<double>", &t_e7x7_25Sig);
1546  tree->Branch("t_e9x9_25Sig" ,"vector<double>", &t_e9x9_25Sig);
1547  tree->Branch("t_e11x11_25Sig" ,"vector<double>", &t_e11x11_25Sig);
1548  tree->Branch("t_e15x15_25Sig" ,"vector<double>", &t_e15x15_25Sig);
1549  tree->Branch("t_e7x7_30Sig" ,"vector<double>", &t_e7x7_30Sig);
1550  tree->Branch("t_e9x9_30Sig" ,"vector<double>", &t_e9x9_30Sig);
1551  tree->Branch("t_e11x11_30Sig" ,"vector<double>", &t_e11x11_30Sig);
1552  tree->Branch("t_e15x15_30Sig" ,"vector<double>", &t_e15x15_30Sig);
1553 
1554  if (doMC) {
1555  t_esim7x7 = new std::vector<double>();
1556  t_esim9x9 = new std::vector<double>();
1557  t_esim11x11 = new std::vector<double>();
1558  t_esim15x15 = new std::vector<double>();
1559 
1560  t_esim7x7Matched = new std::vector<double>();
1561  t_esim9x9Matched = new std::vector<double>();
1562  t_esim11x11Matched = new std::vector<double>();
1563  t_esim15x15Matched = new std::vector<double>();
1564 
1565  t_esim7x7Rest = new std::vector<double>();
1566  t_esim9x9Rest = new std::vector<double>();
1567  t_esim11x11Rest = new std::vector<double>();
1568  t_esim15x15Rest = new std::vector<double>();
1569 
1570  t_esim7x7Photon = new std::vector<double>();
1571  t_esim9x9Photon = new std::vector<double>();
1572  t_esim11x11Photon = new std::vector<double>();
1573  t_esim15x15Photon = new std::vector<double>();
1574 
1575  t_esim7x7NeutHad = new std::vector<double>();
1576  t_esim9x9NeutHad = new std::vector<double>();
1577  t_esim11x11NeutHad = new std::vector<double>();
1578  t_esim15x15NeutHad = new std::vector<double>();
1579 
1580  t_esim7x7CharHad = new std::vector<double>();
1581  t_esim9x9CharHad = new std::vector<double>();
1582  t_esim11x11CharHad = new std::vector<double>();
1583  t_esim15x15CharHad = new std::vector<double>();
1584 
1585  t_trkEcalEne = new std::vector<double>();
1586  t_simTrackP = new std::vector<double>();
1587  t_esimPdgId = new std::vector<double>();
1588 
1589  tree->Branch("t_esim7x7", "vector<double>", &t_esim7x7);
1590  tree->Branch("t_esim9x9", "vector<double>", &t_esim9x9);
1591  tree->Branch("t_esim11x11", "vector<double>", &t_esim11x11);
1592  tree->Branch("t_esim15x15", "vector<double>", &t_esim15x15);
1593 
1594  tree->Branch("t_esim7x7Matched", "vector<double>", &t_esim7x7Matched);
1595  tree->Branch("t_esim9x9Matched", "vector<double>", &t_esim9x9Matched);
1596  tree->Branch("t_esim11x11Matched", "vector<double>", &t_esim11x11Matched);
1597  tree->Branch("t_esim15x15Matched", "vector<double>", &t_esim15x15Matched);
1598 
1599  tree->Branch("t_esim7x7Rest", "vector<double>", &t_esim7x7Rest);
1600  tree->Branch("t_esim9x9Rest", "vector<double>", &t_esim9x9Rest);
1601  tree->Branch("t_esim11x11Rest", "vector<double>", &t_esim11x11Rest);
1602  tree->Branch("t_esim15x15Rest", "vector<double>", &t_esim15x15Rest);
1603 
1604  tree->Branch("t_esim7x7Photon", "vector<double>", &t_esim7x7Photon);
1605  tree->Branch("t_esim9x9Photon", "vector<double>", &t_esim9x9Photon);
1606  tree->Branch("t_esim11x11Photon", "vector<double>", &t_esim11x11Photon);
1607  tree->Branch("t_esim15x15Photon", "vector<double>", &t_esim15x15Photon);
1608 
1609 ;
1610  tree->Branch("t_esim7x7NeutHad", "vector<double>", &t_esim7x7NeutHad);
1611  tree->Branch("t_esim9x9NeutHad", "vector<double>", &t_esim9x9NeutHad);
1612  tree->Branch("t_esim11x11NeutHad", "vector<double>", &t_esim11x11NeutHad);
1613  tree->Branch("t_esim15x15NeutHad", "vector<double>", &t_esim15x15NeutHad);
1614 
1615  tree->Branch("t_esim7x7CharHad", "vector<double>", &t_esim7x7CharHad);
1616  tree->Branch("t_esim9x9CharHad", "vector<double>", &t_esim9x9CharHad);
1617  tree->Branch("t_esim11x11CharHad", "vector<double>", &t_esim11x11CharHad);
1618  tree->Branch("t_esim15x15CharHad", "vector<double>", &t_esim15x15CharHad);
1619 
1620  tree->Branch("t_trkEcalEne", "vector<double>", &t_trkEcalEne);
1621  tree->Branch("t_simTrackP", "vector<double>", &t_simTrackP);
1622  tree->Branch("t_esimPdgId", "vector<double>", &t_esimPdgId);
1623  }
1624 
1625  t_maxNearHcalP3x3 = new std::vector<double>();
1626  t_maxNearHcalP5x5 = new std::vector<double>();
1627  t_maxNearHcalP7x7 = new std::vector<double>();
1628  t_h3x3 = new std::vector<double>();
1629  t_h5x5 = new std::vector<double>();
1630  t_h7x7 = new std::vector<double>();
1631  t_h3x3Sig = new std::vector<double>();
1632  t_h5x5Sig = new std::vector<double>();
1633  t_h7x7Sig = new std::vector<double>();
1634  t_infoHcal = new std::vector<int>();
1635 
1636  if (doMC) {
1637  t_trkHcalEne = new std::vector<double>();
1638  t_hsim3x3 = new std::vector<double>();
1639  t_hsim5x5 = new std::vector<double>();
1640  t_hsim7x7 = new std::vector<double>();
1641  t_hsim3x3Matched = new std::vector<double>();
1642  t_hsim5x5Matched = new std::vector<double>();
1643  t_hsim7x7Matched = new std::vector<double>();
1644  t_hsim3x3Rest = new std::vector<double>();
1645  t_hsim5x5Rest = new std::vector<double>();
1646  t_hsim7x7Rest = new std::vector<double>();
1647  t_hsim3x3Photon = new std::vector<double>();
1648  t_hsim5x5Photon = new std::vector<double>();
1649  t_hsim7x7Photon = new std::vector<double>();
1650  t_hsim3x3NeutHad = new std::vector<double>();
1651  t_hsim5x5NeutHad = new std::vector<double>();
1652  t_hsim7x7NeutHad = new std::vector<double>();
1653  t_hsim3x3CharHad = new std::vector<double>();
1654  t_hsim5x5CharHad = new std::vector<double>();
1655  t_hsim7x7CharHad = new std::vector<double>();
1656  }
1657 
1658  tree->Branch("t_maxNearHcalP3x3", "vector<double>", &t_maxNearHcalP3x3);
1659  tree->Branch("t_maxNearHcalP5x5", "vector<double>", &t_maxNearHcalP5x5);
1660  tree->Branch("t_maxNearHcalP7x7", "vector<double>", &t_maxNearHcalP7x7);
1661  tree->Branch("t_h3x3", "vector<double>", &t_h3x3);
1662  tree->Branch("t_h5x5", "vector<double>", &t_h5x5);
1663  tree->Branch("t_h7x7", "vector<double>", &t_h7x7);
1664  tree->Branch("t_h3x3Sig", "vector<double>", &t_h3x3Sig);
1665  tree->Branch("t_h5x5Sig", "vector<double>", &t_h5x5Sig);
1666  tree->Branch("t_h7x7Sig", "vector<double>", &t_h7x7Sig);
1667  tree->Branch("t_infoHcal", "vector<int>", &t_infoHcal);
1668 
1669  if (doMC) {
1670  tree->Branch("t_trkHcalEne", "vector<double>", &t_trkHcalEne);
1671  tree->Branch("t_hsim3x3", "vector<double>", &t_hsim3x3);
1672  tree->Branch("t_hsim5x5", "vector<double>", &t_hsim5x5);
1673  tree->Branch("t_hsim7x7", "vector<double>", &t_hsim7x7);
1674  tree->Branch("t_hsim3x3Matched", "vector<double>", &t_hsim3x3Matched);
1675  tree->Branch("t_hsim5x5Matched", "vector<double>", &t_hsim5x5Matched);
1676  tree->Branch("t_hsim7x7Matched", "vector<double>", &t_hsim7x7Matched);
1677  tree->Branch("t_hsim3x3Rest", "vector<double>", &t_hsim3x3Rest);
1678  tree->Branch("t_hsim5x5Rest", "vector<double>", &t_hsim5x5Rest);
1679  tree->Branch("t_hsim7x7Rest", "vector<double>", &t_hsim7x7Rest);
1680  tree->Branch("t_hsim3x3Photon", "vector<double>", &t_hsim3x3Photon);
1681  tree->Branch("t_hsim5x5Photon", "vector<double>", &t_hsim5x5Photon);
1682  tree->Branch("t_hsim7x7Photon", "vector<double>", &t_hsim7x7Photon);
1683  tree->Branch("t_hsim3x3NeutHad", "vector<double>", &t_hsim3x3NeutHad);
1684  tree->Branch("t_hsim5x5NeutHad", "vector<double>", &t_hsim5x5NeutHad);
1685  tree->Branch("t_hsim7x7NeutHad", "vector<double>", &t_hsim7x7NeutHad);
1686  tree->Branch("t_hsim3x3CharHad", "vector<double>", &t_hsim3x3CharHad);
1687  tree->Branch("t_hsim5x5CharHad", "vector<double>", &t_hsim5x5CharHad);
1688  tree->Branch("t_hsim7x7CharHad", "vector<double>", &t_hsim7x7CharHad);
1689  }
1690  tree->Branch("t_nTracks", &t_nTracks, "t_nTracks/I");
1691 
1692 }
1693 
1694 
1695 double IsolatedTracksNxN::DeltaPhi(double v1, double v2) {
1696  // Computes the correctly normalized phi difference
1697  // v1, v2 = phi of object 1 and 2
1698 
1699  double pi = 3.141592654;
1700  double twopi = 6.283185307;
1701 
1702  double diff = std::abs(v2 - v1);
1703  double corr = twopi - diff;
1704  if (diff < pi){ return diff;} else { return corr;}
1705 }
1706 
1707 double IsolatedTracksNxN::DeltaR(double eta1, double phi1, double eta2, double phi2) {
1708  double deta = eta1 - eta2;
1709  double dphi = DeltaPhi(phi1, phi2);
1710  return std::sqrt(deta*deta + dphi*dphi);
1711 }
1712 
1714 
1715  std::string theTrackQuality = "highPurity";
1716  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
1717 
1718  std::cout << " Reference Point " << pTrack->referencePoint() <<"\n"
1719  << " TrackMmentum " << pTrack->momentum()
1720  << " (pt,eta,phi)(" << pTrack->pt()<<","<<pTrack->eta()<<","<<pTrack->phi()<<")"
1721  << " p " << pTrack->p() << "\n"
1722  << " Normalized chi2 " << pTrack->normalizedChi2() <<" charge " << pTrack->charge()
1723  << " qoverp() " << pTrack->qoverp() <<"+-" << pTrack->qoverpError()
1724  << " d0 " << pTrack->d0() << "\n"
1725  << " NValidHits " << pTrack->numberOfValidHits() << " NLostHits " << pTrack->numberOfLostHits()
1726  << " TrackQuality " << pTrack->qualityName(trackQuality_) << " " << pTrack->quality(trackQuality_)
1727  << std::endl;
1728 
1729  if( printTrkHitPattern_ ) {
1730  const reco::HitPattern& p = pTrack->hitPattern();
1731  const reco::HitPattern& p1 = pTrack->trackerExpectedHitsInner();
1732  const reco::HitPattern& p2 = pTrack->trackerExpectedHitsOuter();
1733 
1734  std::cout<<"default " << std::endl;
1735  for (int i=0; i<p.numberOfHits(); i++) {
1737  }
1738  std::cout<<"trackerExpectedHitsInner() " << std::endl;
1739  for (int i=0; i<p1.numberOfHits(); i++) {
1741  }
1742  std::cout<<"trackerExpectedHitsOuter() " << std::endl;
1743  for (int i=0; i<p2.numberOfHits(); i++) {
1745  }
1746 
1747 
1748  std::cout << "\n \t trackerLayersWithMeasurement() " << p.trackerLayersWithMeasurement()
1749  << "\n \t pixelLayersWithMeasurement() " << p.pixelLayersWithMeasurement()
1750  << "\n \t stripLayersWithMeasurement() " << p.stripLayersWithMeasurement()
1751  << "\n \t pixelBarrelLayersWithMeasurement() " << p.pixelBarrelLayersWithMeasurement()
1752  << "\n \t pixelEndcapLayersWithMeasurement() " << p.pixelEndcapLayersWithMeasurement()
1753  << "\n \t stripTIBLayersWithMeasurement() " << p.stripTIBLayersWithMeasurement()
1754  << "\n \t stripTIDLayersWithMeasurement() " << p.stripTIDLayersWithMeasurement()
1755  << "\n \t stripTOBLayersWithMeasurement() " << p.stripTOBLayersWithMeasurement()
1756  << "\n \t stripTECLayersWithMeasurement() " << p.stripTECLayersWithMeasurement()
1757  << std::endl;
1758 
1759  }
1760 }
1761 
1762 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:42
std::vector< double > * t_hsim7x7CharHad
double qoverp() const
q/p
Definition: TrackBase.h:115
double DeltaPhi(double v1, double v2)
double p() const
momentum vector magnitude
Definition: TrackBase.h:129
std::vector< double > * t_hsim3x3Matched
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:375
std::vector< double > * t_esim7x7CharHad
const std::string & gtTriggerMenuName() const
std::vector< double > * t_e15x15
std::vector< double > * t_nTrksJetCalo
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
std::vector< double > * t_maxNearHcalP7x7
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > * t_trackPt
int i
Definition: DBlmapReader.cc:9
std::vector< double > * t_trackPAll
std::vector< double > * t_e7x7
std::vector< double > * t_trackHcalPhi
std::vector< double > * t_trackDxyPVAll
static std::string qualityName(TrackQuality)
Definition: TrackBase.h:406
std::vector< int > * t_trackHitOutMeasTEC
std::vector< double > * t_trackPdgIdAll
edm::InputTag JetExtender_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
void eCaloSimInfo(std::vector< DetId > vdets, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool debug=false)
edm::InputTag L1extraCenJetSource_
std::vector< double > * t_trackOutPosOutHitDr
static const bool useL1GtTriggerMenuLite(false)
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:150
std::vector< double > * t_maxNearHcalP5x5
std::vector< double > * t_L1NonIsoEMPt
std::vector< int > * t_trackHitOutMeasTIB
std::vector< double > * t_esim7x7
std::vector< int > * t_trackHitInMissTOB
std::vector< double > * t_trackDz
double d0() const
dxy parameter in perigee convention (d0 = - dxy)
Definition: TrackBase.h:123
std::map< std::string, double > eHCALSimInfo(const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false)
std::vector< double > * t_trackEcalEta
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:357
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:111
std::vector< double > * t_trackEtaAll
std::vector< double > * t_esim11x11Matched
std::vector< double > * t_L1IsoEMEta
std::vector< double > * t_PVTracksSumPt
std::vector< double > * t_e9x9_10Sig
TH1F * h_maxNearP25x25[NPBins][NEtaBins]
TrackQuality
track quality
Definition: TrackBase.h:95
std::vector< double > * t_hsim3x3CharHad
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< int > * t_PVndof
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
std::vector< double > * t_hsim7x7Rest
std::vector< double > * t_L1TauJetPhi
std::vector< double > * t_PVTracksSumPtWt
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2295
std::vector< int > * t_infoHcal
std::vector< double > * t_e11x11_15Sig
static const size_t NEtaBins
std::vector< double > * t_L1TauJetPt
std::vector< int > * t_PVNTracksWt
std::vector< double > * t_trackEcalPhi
std::vector< double > * t_esim11x11NeutHad
std::vector< double > * t_L1TauJetEta
std::vector< double > * t_e15x15_15Sig
std::vector< double > * t_L1MuonEta
std::vector< double > * t_L1MuonPt
int pixelLayersWithMeasurement() const
Definition: HitPattern.h:726
int bunchCrossing() const
Definition: EventBase.h:62
std::vector< double > * t_h3x3
#define abs(x)
Definition: mlp_lapack.h:159
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
std::vector< double > * t_L1MuonPhi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:234
int stripTIDLayersWithoutMeasurement() const
Definition: HitPattern.cc:423
std::vector< double > * t_trackDxyAll
std::vector< double > * t_maxNearHcalP3x3
edm::InputTag L1extraIsoEmSource_
IsolatedTracksNxN(const edm::ParameterSet &)
std::vector< double > * t_hsim3x3Photon
T eta() const
int ii
Definition: cuy.py:588
std::vector< double > * t_PVTracksSumPtHP
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:47
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:153
std::vector< double > * t_esim11x11Rest
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:347
edm::InputTag L1GTReadoutRcdSource_
float float float z
std::vector< int > * t_trackNOuterHits
std::vector< double > * t_h7x7Sig
std::vector< double > * t_e15x15_30Sig
std::vector< double > * t_trackPhiAll
std::vector< double > * t_e7x7_25Sig
std::vector< double > * t_trkHcalEne
edm::InputTag L1extraFwdJetSource_
std::vector< double > * t_e7x7_20Sig
std::vector< double > * t_e11x11_10Sig
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::vector< double > * t_trackPtAll
std::vector< double > * t_h3x3Sig
edm::Service< TFileService > fs
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
std::vector< double > * t_esimPdgId
double eNeutralHad
Definition: CaloSimInfo.h:47
double eChargedHad
Definition: CaloSimInfo.h:48
std::vector< double > * t_e11x11_20Sig
std::vector< double > * t_jetEta
std::map< std::pair< unsigned int, std::string >, int > l1AlgoMap
std::vector< double > * t_maxNearP31x31
std::vector< int > * t_trackHitInMissTEC
double chargeIsolationEcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
int iEvent
Definition: GenABIO.cc:243
std::vector< double > * t_trackEta
const HitPattern & trackerExpectedHitsOuter() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers after the last...
Definition: TrackBase.h:227
const bool decision(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
Definition: L1GtUtils.cc:1450
std::vector< double > * t_esim9x9Photon
std::vector< int > * t_trackHitInMeasTID
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
std::vector< double > * t_hsim5x5Rest
std::vector< double > * t_e11x11
std::vector< double > * t_esim15x15
std::vector< double > * t_L1CenJetPt
std::vector< double > * t_trackChiSqAll
edm::InputTag L1extraTauJetSource_
std::vector< double > * t_e15x15_25Sig
std::vector< int > * t_trackHitOutMissTIB
std::vector< double > * t_esim15x15Rest
std::vector< double > * t_esim11x11
std::vector< double > * t_hsim7x7
std::vector< int > * t_PVNTracksHPWt
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:366
int trackerLayersWithMeasurement() const
Definition: HitPattern.h:721
T sqrt(T t)
Definition: SSEVec.h:48
std::vector< int > * t_trackHitOutMissTID
std::vector< int > * t_trackHitOutMissTOBTEC
vector< PseudoJet > jets
double pt() const
track transverse momentum
Definition: TrackBase.h:131
edm::InputTag HBHERecHitSource_
std::vector< int > * t_trackHitsTEC
std::vector< double > * t_e9x9_30Sig
const MagneticField * bField
std::vector< double > * t_L1CenJetPhi
std::vector< double > * t_L1FwdJetEta
std::vector< double > * t_h7x7
std::vector< int > * t_ecalSpike11x11
int numberOfHits() const
Definition: HitPattern.cc:213
std::vector< double > * t_esim15x15NeutHad
int stripTIBLayersWithoutMeasurement() const
Definition: HitPattern.cc:414
std::vector< double > * t_e9x9_20Sig
std::vector< int > * t_trackHitOutMeasTOB
std::vector< int > * t_trackHitInMeasTIB
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
Definition: TrackBase.h:225
edm::SimTrackContainer::const_iterator matchedSimTrack(const edm::Event &iEvent, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, bool debug=false)
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:232
std::vector< double > * t_trackDzPV
std::vector< int > * t_PVNTracksHP
std::vector< double > * t_L1FwdJetPhi
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
static const bool useL1EventSetup(true)
std::vector< double > * t_nTrksJetVtx
bool first
Definition: L1TdeRCT.cc:94
bool isValid() const
Definition: HandleBase.h:76
double p2[4]
Definition: TauolaWrapper.h:90
std::vector< double > * t_esim7x7NeutHad
std::vector< double > * t_hsim3x3NeutHad
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::vector< double > * t_L1NonIsoEMPhi
std::vector< double > * t_trackDzBS
void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< int > * t_trackHitOutMissTOB
std::vector< double > * t_L1CenJetEta
std::vector< double > * t_trackDzPVAll
JetCorrectorParameters corr
Definition: classes.h:11
std::vector< double > * t_esim7x7Matched
std::vector< double > * t_esim9x9
std::vector< double > * t_hsim5x5
std::vector< double > * t_h5x5
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:192
std::vector< double > * t_trackDxyPV
std::vector< double > * t_hsim5x5NeutHad
std::vector< double > * t_trackChiSq
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:127
std::vector< double > * t_hsim5x5Photon
std::vector< double > * t_PVy
std::vector< int > * t_L1PreScale
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
get all the run-constant quantities for L1 trigger and cache them
Definition: L1GtUtils.cc:313
std::vector< double > * t_hsim3x3Rest
Definition: DetId.h:20
edm::InputTag L1extraNonIsoEmSource_
std::vector< int > * t_PVisValid
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
std::vector< double > * t_L1METPhi
std::vector< double > * t_esim9x9Rest
std::vector< int > * t_trackHitInMissTIB
std::vector< double > * t_e9x9_15Sig
std::vector< double > * t_e7x7_15Sig
std::vector< double > * t_trackPhi
std::vector< double > * t_e7x7_10Sig
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< double > * t_trkEcalEne
std::vector< double > * t_trackDzAll
TH1F * h_maxNearP31x31[NPBins][NEtaBins]
std::vector< double > * t_esim11x11CharHad
const T & get() const
Definition: EventSetup.h:55
int stripLayersWithMeasurement() const
Definition: HitPattern.h:731
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:337
T const * product() const
Definition: ESHandle.h:62
TH1F * h_maxNearP15x15[NPBins][NEtaBins]
std::vector< double > * t_e9x9_25Sig
void eECALSimInfo(const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool debug=false)
std::vector< double > * t_esim7x7Photon
std::vector< double > * t_esim9x9NeutHad
std::vector< double > * t_L1FwdJetPt
std::vector< double > * t_simTrackP
std::vector< double > * t_hsim7x7Matched
T const * product() const
Definition: Handle.h:74
std::vector< int > * t_trackPVIdx
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:377
std::vector< int > * t_trackHitsTOB
std::vector< double > * t_esim9x9Matched
std::vector< double > * t_hsim7x7NeutHad
std::vector< double > * t_L1IsoEMPhi
std::vector< int > * t_PVNTracks
std::vector< double > * t_maxNearP21x21
edm::EventID id() const
Definition: EventBase.h:56
std::vector< double > * t_L1NonIsoEMEta
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< double > * t_PVz
std::pair< math::XYZPoint, double > propagateTrackerEnd(const reco::Track *, const MagneticField *, bool debug=false)
void printTrack(const reco::Track *pTrack)
int stripTECLayersWithoutMeasurement() const
Definition: HitPattern.cc:441
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_PVTracksSumPtHPWt
std::vector< double > * t_trackDxy
std::vector< std::string > * t_L1AlgoNames
std::vector< double > * t_hsim5x5CharHad
std::vector< double > * t_e15x15_10Sig
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:384
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
TH1F * h_maxNearP21x21[NPBins][NEtaBins]
T * make() const
make new ROOT object
int stripTOBLayersWithoutMeasurement() const
Definition: HitPattern.cc:432
std::vector< double > * t_jetPhi
std::vector< double > * t_trackL
std::vector< double > * t_esim7x7Rest
std::vector< double > * t_trackDxyBS
tuple cout
Definition: gather_cfg.py:121
int charge() const
track electric charge
Definition: TrackBase.h:113
std::vector< double > * t_trackHcalEta
std::vector< double > * t_L1METPt
void printHitPattern(int position, std::ostream &stream) const
Definition: HitPattern.cc:564
edm::InputTag L1extraMuonSource_
dbl *** dir
Definition: mlp_gen.cc:35
std::vector< int > * t_NLayersCrossed
double pi
Definition: DDAxes.h:10
double DeltaR(double eta1, double phi1, double eta2, double phi2)
edm::InputTag JetSrc_
std::vector< std::pair< DetId, double > > eHCALmatrixCell(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
int weight
Definition: histoStyle.py:50
std::vector< int > * t_trackHitInMeasTOB
std::vector< double > * t_PVx
std::vector< int > * t_trackHitInMeasTEC
std::vector< double > * t_esim15x15Photon
std::vector< double > * t_e9x9
std::vector< double > * t_hsim5x5Matched
const L1GtTriggerMenu * ptrL1TriggerMenuEventSetup(int &errorCode)
return a pointer to the L1 trigger menu from event setup
Definition: L1GtUtils.cc:2230
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1487
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:121
std::vector< double > * t_esim15x15Matched
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
std::vector< int > * t_trackHitOutMeasTID
std::vector< double > * t_L1METEta
std::vector< double > * t_e7x7_30Sig
std::vector< int > * t_trackHitOutMissTEC
value_type const * get() const
Definition: RefToBase.h:212
std::vector< double > * t_e11x11_25Sig
std::vector< double > * t_hsim3x3
std::vector< double > * t_trackP
static const size_t NPBins
std::vector< double > * t_hsim7x7Photon
std::vector< double > * t_jetPt
std::vector< double > * t_L1IsoEMPt
std::vector< double > * t_esim11x11Photon
edm::InputTag L1GTObjectMapRcdSource_
std::vector< double > * t_h5x5Sig
std::vector< int > * t_trackHitInMissTID
std::vector< double > * t_e11x11_30Sig
std::vector< int > * t_trackHitInMissTIBTID
std::vector< double > * t_esim9x9CharHad
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)
Definition: DDAxes.h:10
std::vector< double > * t_esim15x15CharHad