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