CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalIsoTrkAnalyzer Class Reference

#include <Calibration/HcalCalibAlgos/src/HcalIsoTrkAnalyzer.cc>

Inheritance diagram for HcalIsoTrkAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 HcalIsoTrkAnalyzer (const edm::ParameterSet &)
 
 ~HcalIsoTrkAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

bool allowMissingInputs_
 
double associationConeSize_
 
string AxB_
 
double calibrationConeSize_
 
UInt_t cell
 
Float_t cellEnergy
 
TClonesArray * cells
 
TRefArray * cells3x3
 
TRefArray * cellsPF
 
double EcalCone
 
double EcalConeOuter
 
InputTag eLabel_
 
Float_t emEnergy
 
Float_t emRingEnergy
 
double energyECALmip
 
double energyMaxIso
 
double energyMinIso
 
Float_t etVetoJet
 
UInt_t eventNumber
 
float eventWeight
 
const CaloGeometrygeo
 
InputTag hbheLabel_
 
InputTag hoLabel_
 
double hottestHitDistance
 
Int_t iEtaHit
 
ofstream input_to_L3
 
UInt_t iPhiHit
 
std::string m_ebInstance
 
std::string m_ecalLabel
 
std::string m_eeInstance
 
std::string m_hcalLabel
 
int m_histoFlag
 
std::string m_inputTrackLabel
 
double maxPNear
 
int MinNTECHitsEndcap
 
int MinNTrackHitsBarrel
 
int nIterations
 
UInt_t numberOfCells
 
string outputFileName_
 
TrackAssociatorParameters parameters_
 
Float_t probeJetEmFrac
 
TLorentzVector * probeJetP4
 
Float_t PxTrkHcal
 
Float_t PyTrkHcal
 
Float_t PzTrkHcal
 
TFile * rootFile
 
UInt_t runNumber
 
double rvert
 
Float_t tagJetEmFrac
 
TLorentzVector * tagJetP4
 
Float_t targetE
 
TrackDetectorAssociator trackAssociator_
 
double trackEta
 
InputTag trackLabel1_
 
InputTag trackLabel_
 
double trackPhi
 
TTree * tree
 
Float_t xTrkEcal
 
Float_t xTrkHcal
 
Float_t yTrkEcal
 
Float_t yTrkHcal
 
Float_t zTrkEcal
 
Float_t zTrkHcal
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: see twiki for details: https://twiki.cern.ch/twiki/bin/view/CMS/IsoTrackAnalyzer

Implementation: <Notes on="" implementation>="">

Definition at line 93 of file HcalIsoTrkAnalyzer.cc.

Constructor & Destructor Documentation

HcalIsoTrkAnalyzer::HcalIsoTrkAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 169 of file HcalIsoTrkAnalyzer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), Parameters::parameters, and AlCaHLTBitMon_QueryRunRegistry::string.

170 {
171 
172  m_ecalLabel = iConfig.getUntrackedParameter<std::string> ("ecalRecHitsLabel","ecalRecHit");
173  m_ebInstance = iConfig.getUntrackedParameter<std::string> ("ebRecHitsInstance","EcalRecHitsEB");
174  m_eeInstance = iConfig.getUntrackedParameter<std::string> ("eeRecHitsInstance","EcalRecHitsEE");
175  m_hcalLabel = iConfig.getUntrackedParameter<std::string> ("hcalRecHitsLabel","hbhereco");
176 
177  hbheLabel_= iConfig.getParameter<edm::InputTag>("hbheInput");
178  hoLabel_=iConfig.getParameter<edm::InputTag>("hoInput");
179  eLabel_=iConfig.getParameter<edm::InputTag>("eInput");
180  trackLabel_ = iConfig.getParameter<edm::InputTag>("HcalIsolTrackInput");
181  trackLabel1_ = iConfig.getParameter<edm::InputTag>("trackInput");
182  associationConeSize_=iConfig.getParameter<double>("associationConeSize");
183  allowMissingInputs_=iConfig.getUntrackedParameter<bool>("allowMissingInputs",true);
184  outputFileName_=iConfig.getParameter<std::string>("outputFileName");
185 
186  AxB_=iConfig.getParameter<std::string>("AxB");
187  calibrationConeSize_=iConfig.getParameter<double>("calibrationConeSize");
188 
189  nIterations = iConfig.getParameter<int>("noOfIterations");
190  eventWeight = iConfig.getParameter<double>("eventWeight");
191  energyMinIso = iConfig.getParameter<double>("energyMinIso");
192  energyMaxIso = iConfig.getParameter<double>("energyMaxIso");
193  energyECALmip = iConfig.getParameter<double>("energyECALmip");
194  maxPNear = iConfig.getParameter<double>("maxPNear");
195  MinNTrackHitsBarrel = iConfig.getParameter<int>("MinNTrackHitsBarrel");
196  MinNTECHitsEndcap = iConfig.getParameter<int>("MinNTECHitsEndcap");
197  hottestHitDistance = iConfig.getParameter<double>("hottestHitDistance");
198  EcalCone = iConfig.getParameter<double>("EcalCone");
199  EcalConeOuter = iConfig.getParameter<double>("EcalConeOuter");
200 
201  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
202  parameters_.loadParameters( parameters );
204 
205 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
dictionary parameters
Definition: Parameters.py:2
void useDefaultPropagator()
use the default propagator
TrackDetectorAssociator trackAssociator_
TrackAssociatorParameters parameters_
void loadParameters(const edm::ParameterSet &)
HcalIsoTrkAnalyzer::~HcalIsoTrkAnalyzer ( )

Definition at line 207 of file HcalIsoTrkAnalyzer.cc.

208 {
209 }

Member Function Documentation

void HcalIsoTrkAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 213 of file HcalIsoTrkAnalyzer.cc.

References abs, edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, MaxHit_struct::depthhit, MaxHit_struct::dr, alignCSCRings::e, patCandidatesForDimuonsSequences_cff::ecal, ecalEnergyInCone(), edm::SortedCollection< T, SORT >::end(), edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), getDistInPlaneTrackDir(), DetId::Hcal, HcalBarrel, MaxHit_struct::hitenergy, i, edm::EventBase::id(), HcalDetId::ieta(), MaxHit_struct::ietahitm, info, HcalDetId::iphi(), MaxHit_struct::iphihitm, pos, MaxHit_struct::posMax, edm::Handle< T >::product(), edm::EventID::run(), convertSQLiteXML::runNumber, mathSSE::sqrt(), reco::btau::trackEta, reco::btau::trackPhi, diffTreeTool::tree, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

214 {
215  using namespace edm;
216  using namespace std;
217 
218  vector<float> rawEnergyVec;
219  vector<int> detiphi;
220  vector<int> detieta;
221  vector<int> i3i5;
222  vector<HcalDetId> detidvec;
223  float calEnergy;
224 
226  iEvent.getByLabel(trackLabel1_,isoProdTracks);
227 
229  iEvent.getByLabel(trackLabel_,isoPixelTracks);
230 
232  iEvent.getByLabel(eLabel_,ecal);
233  const EcalRecHitCollection Hitecal = *(ecal.product());
234 
236  iEvent.getByLabel(hbheLabel_,hbhe);
237  const HBHERecHitCollection Hithbhe = *(hbhe.product());
238 
240  iSetup.get<CaloGeometryRecord>().get(pG);
241  geo = pG.product();
242 
244  //Note: even though it says HcalBarrel, we actually get the whole Hcal detector geometry!
245 
246 
247 // rof 16.05.2008 start: include the possibility for recalibration (use "recalibrate" label for safety)
248 /*
249  edm::ESHandle <HcalRespCorrs> recalibCorrs;
250  iSetup.get<HcalRespCorrsRcd>().get("recalibrate",recalibCorrs);
251  const HcalRespCorrs* myRecalib = recalibCorrs.product();
252 */
253 // rof end
254 
255  parameters_.useEcal = true;
256  parameters_.useHcal = true;
257  parameters_.useCalo = false;
258  parameters_.useMuon = false;
259  parameters_.dREcal = 0.5;
260  parameters_.dRHcal = 0.6;
261 
262  if (isoPixelTracks->size()==0) return;
263 
264  for (reco::TrackCollection::const_iterator trit=isoProdTracks->begin(); trit!=isoProdTracks->end(); trit++)
265  {
266  reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched=isoPixelTracks->begin();
267  bool matched=false;
268 
269  //Note: this part needs to be changed: obtain isoPixelTracks from isoProdTracks (should be a way)
270  for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin(); it!=isoPixelTracks->end(); it++)
271  {
272 
273  if (abs((trit->pt() - it->pt())/it->pt()) < 0.005 && abs(trit->eta() - it->eta()) < 0.01)
274  {
275  isoMatched=it;
276  matched=true;
277  break;
278  }
279  }
280  if (!matched) continue;
281 
282  if (trit->hitPattern().numberOfValidHits()<MinNTrackHitsBarrel) continue;
283  if (fabs(trit->eta())>1.47&&trit->hitPattern().numberOfValidStripTECHits()<MinNTECHitsEndcap) continue;
284 
285 
286  calEnergy = sqrt(trit->px()*trit->px()+trit->py()*trit->py()+trit->pz()*trit->pz()+0.14*0.14);
287 
288  trackEta = trit->eta();
289  trackPhi = trit->phi();
290 
291  double corrHCAL = 1.; //another possibility for correction. - why?
292 
293  // cout << endl << " ISO TRACK E = "<< calEnergy << " ETA = " << trackEta<< " PHI = " << trackPhi << " Correction " << corrHCAL<< endl;
294 
295  rvert = sqrt(trit->vx()*trit->vx()+trit->vy()*trit->vy()+trit->vz()*trit->vz());
296 
297  //Associate track with a calorimeter
299 
300 
301  xTrkHcal=info.trkGlobPosAtHcal.x();
302  yTrkHcal=info.trkGlobPosAtHcal.y();
303  zTrkHcal=info.trkGlobPosAtHcal.z();
304 
305  xTrkEcal=info.trkGlobPosAtEcal.x();
306  yTrkEcal=info.trkGlobPosAtEcal.y();
307  zTrkEcal=info.trkGlobPosAtEcal.z();
308 
309  if (xTrkEcal==0 && yTrkEcal==0&& zTrkEcal==0) {cout<<"zero point at Ecal"<<endl; continue;}
310  if (xTrkHcal==0 && yTrkHcal==0&& zTrkHcal==0) {cout<<"zero point at Hcal"<<endl; continue;}
311 
312  GlobalVector trackMomAtHcal = info.trkMomAtHcal;
313 
314  PxTrkHcal = trackMomAtHcal.x();
315  PyTrkHcal = trackMomAtHcal.y();
316  PzTrkHcal = trackMomAtHcal.z();
317 
318  //PxTrkHcal=0;
319  //PyTrkHcal=0;
320  //PzTrkHcal=0;
321 
324 
325  // emEnergy = isoMatched->energyIn();
326  emEnergy = ecalEnergyInCone(gPointEcal, EcalCone, Hitecal, geo);
327 
328  emRingEnergy = ecalEnergyInCone(gPointEcal, EcalConeOuter, Hitecal, geo) - ecalEnergyInCone(gPointEcal, EcalCone, Hitecal, geo);
329 
330 
331  int iphitrue = -10;
332  int ietatrue = 100;
333 
334  const HcalDetId tempId = gHcal->getClosestCell(gPointHcal);
335  ietatrue = tempId.ieta();
336  iphitrue = tempId.iphi();
337 
338 
339  //container for used recHits
340  std::vector<DetId> usedHits;
341  //
342  //clear usedHits
343  usedHits.clear();
344 
345 
346  // Find Hcal RecHit with maximum energy and collect other information
347  MaxHit_struct MaxHit;
348  MaxHit.hitenergy=-100;
349 
350 
351  for (HBHERecHitCollection::const_iterator hhit=Hithbhe.begin(); hhit!=Hithbhe.end(); hhit++)
352  {
353 
354  //check that this hit was not considered before and push it into usedHits
355  bool hitIsUsed=false;
356  DetId hitId=hhit->id();
357  for (uint32_t i=0; i<usedHits.size(); i++)
358  {
359  if (usedHits[i]==hitId) hitIsUsed=true;
360  }
361  if (hitIsUsed) continue;
362  usedHits.push_back(hitId);
363  //
364 
365  // rof 16.05.2008 start: include the possibility for recalibration
366  float recal = 1;
367  // rof end
368 
369  GlobalPoint pos = geo->getPosition(hhit->detid());
370 
371  int iphihitm = (hhit->id()).iphi();
372  int ietahitm = (hhit->id()).ieta();
373  int depthhit = (hhit->id()).depth();
374  double enehit = hhit->energy() * recal;
375 
376  if (depthhit!=1) continue;
377 
378 
379  double distAtHcal = getDistInPlaneTrackDir(gPointHcal, trackMomAtHcal, pos);
380  //double distAtHcal = getDistInPlaneSimple(gPointHcal, pos);
381 
382  //if(dr<associationConeSize_)
383  if(distAtHcal < associationConeSize_)
384  {
385  for (HBHERecHitCollection::const_iterator hhit2=Hithbhe.begin(); hhit2!=Hithbhe.end(); hhit2++)
386  {
387  int iphihitm2 = (hhit2->id()).iphi();
388  int ietahitm2 = (hhit2->id()).ieta();
389  int depthhit2 = (hhit2->id()).depth();
390  double enehit2 = hhit2->energy() * recal;
391 
392  if ( iphihitm==iphihitm2 && ietahitm==ietahitm2 && depthhit!=depthhit2){
393 
394  enehit = enehit+enehit2;
395  }
396  }
397 
398  if(enehit > MaxHit.hitenergy)
399  {
400  MaxHit.hitenergy = enehit;
401  MaxHit.ietahitm = (hhit->id()).ieta();
402  MaxHit.iphihitm = (hhit->id()).iphi();
403  MaxHit.depthhit = (hhit->id()).depth();
404  MaxHit.dr = distAtHcal;
405 
406  MaxHit.posMax = geo->getPosition(hhit->detid());
407 
408  }
409  }
410  }
411 
412 
413  Bool_t passCuts = kFALSE;
414  if(calEnergy > energyMinIso && calEnergy < energyMaxIso && emEnergy < energyECALmip &&
415  isoMatched->maxPtPxl() < maxPNear && abs(MaxHit.ietahitm)<30 && MaxHit.hitenergy > 0. &&
416  MaxHit.dr < hottestHitDistance && emRingEnergy<8.){ passCuts = kTRUE; }
417 
418 
419  if(AxB_=="5x5" || AxB_=="3x3" || AxB_=="7x7"|| AxB_=="Cone")
420  {
421 
422  //clear usedHits
423  usedHits.clear();
424  //
425 
426  for (HBHERecHitCollection::const_iterator hhit=Hithbhe.begin(); hhit!=Hithbhe.end(); hhit++)
427  {
428 
429  //check that this hit was not considered before and push it into usedHits
430  bool hitIsUsed=false;
431  DetId hitId=hhit->id();
432  for (uint32_t i=0; i<usedHits.size(); i++)
433  {
434  if (usedHits[i]==hitId) hitIsUsed=true;
435  }
436  if (hitIsUsed)
437  {
438  //cout<<"Hit is Used! ieta: "<< (hhit->id()).ieta()<<" iphi: "<<(hhit->id()).iphi()<<" depth: "<<(hhit->id()).depth()<<" hashed_index: "<<hitHashedIndex<<endl;
439  continue;}
440 
441  usedHits.push_back(hitId);
442  //
443 
444  int DIETA = 100;
445  if(MaxHit.ietahitm*(hhit->id()).ieta()>0)
446  {
447  DIETA = MaxHit.ietahitm - (hhit->id()).ieta();
448  }
449  if(MaxHit.ietahitm*(hhit->id()).ieta()<0)
450  {
451  DIETA = MaxHit.ietahitm - (hhit->id()).ieta();
452  DIETA = DIETA>0 ? DIETA-1 : DIETA+1;
453  }
454 
455  int DIPHI = abs(MaxHit.iphihitm - (hhit->id()).iphi());
456  DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
457  /*AP DIPHI = DIPHI<-36 ? 72+DIPHI : DIPHI; */
458 
459  int numbercell=0;
460  if(AxB_=="3x3") numbercell = 1;
461  if(AxB_=="5x5") numbercell = 2;
462  if(AxB_=="7x7") numbercell = 3;
463  if(AxB_=="Cone") numbercell = 1000;
464 
465  if( abs(DIETA)<=numbercell && (abs(DIPHI)<=numbercell || ( abs(MaxHit.ietahitm)>=20 && abs(DIPHI)<=numbercell+1)) ) {
466 
467  // rof 16.05.2008 start: include the possibility for recalibration
468  float recal = 1;
469 
470  int iii3i5 = 0;
471 
472  const GlobalPoint pos2 = geo->getPosition(hhit->detid());
473 
474  if(passCuts){
475 
476  if(AxB_=="5x5" || AxB_=="3x3" || AxB_=="7x7") {
477 
478  rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
479  detidvec.push_back(hhit->id());
480  detiphi.push_back((hhit->id()).iphi());
481  detieta.push_back((hhit->id()).ieta());
482  i3i5.push_back(iii3i5);
483 
484  }
485 
486  if (AxB_=="Cone" && getDistInPlaneTrackDir(gPointHcal, trackMomAtHcal, pos2) < calibrationConeSize_) {
487  //if (AxB_=="Cone" && getDistInPlaneSimple(gPointHcal,pos2) < calibrationConeSize_) {
488 
489  rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
490  detidvec.push_back(hhit->id());
491  detiphi.push_back((hhit->id()).iphi());
492  detieta.push_back((hhit->id()).ieta());
493  i3i5.push_back(iii3i5);
494 
495  }
496 
497  }
498  }
499  }
500  }
501 
502  if(AxB_!="3x3" && AxB_!="5x5" && AxB_!="7x7" && AxB_!="Cone") LogWarning(" AxB ")<<" Not supported: "<< AxB_;
503 
504  if(passCuts){
505 
506  input_to_L3 << rawEnergyVec.size() << " " << calEnergy;
507 
508 
509  for (unsigned int i=0; i<rawEnergyVec.size(); i++)
510  {
511  input_to_L3 << " " << rawEnergyVec.at(i) << " " << detidvec.at(i).rawId() ;
512 
513  }
514  input_to_L3 <<endl;
515 
516  eventNumber = iEvent.id().event();
517  runNumber = iEvent.id().run();
518  iEtaHit = ietatrue;
519  iPhiHit = iphitrue;
520 
521  numberOfCells=rawEnergyVec.size();
522  targetE = calEnergy;
523 
524  for (unsigned int ia=0; ia<numberOfCells; ++ia) {
525  cellEnergy = rawEnergyVec.at(ia);
526  cell = detidvec.at(ia).rawId();
527 
528  new((*cells)[ia]) TCell(cell, cellEnergy);
529 
530 
531  }
532 
533  tree->Fill();
534 
535  cells->Clear();
536 
537  }
538 
539  rawEnergyVec.clear();
540  detidvec.clear();
541  detiphi.clear();
542  detieta.clear();
543  i3i5.clear();
544 
545  try {
547  iEvent.getByLabel(hoLabel_,ho);
548  const HORecHitCollection Hitho = *(ho.product());
549 
550  //clear usedHits
551  usedHits.clear();
552  //
553 
554  for(HORecHitCollection::const_iterator hoItr=Hitho.begin(); hoItr!=Hitho.end(); hoItr++)
555  {
556 
557  //check that this hit was not considered before and push it into usedHits
558  bool hitIsUsed=false;
559  DetId hitId=hoItr->id();
560  for (uint32_t i=0; i<usedHits.size(); i++)
561  {
562  if (usedHits[i]==hitId) hitIsUsed=true;
563  }
564  if (hitIsUsed) continue;
565 
566  usedHits.push_back(hitId);
567 
568  /*AP
569  GlobalPoint pos = geo->getPosition(hoItr->detid());
570  double phihit = pos.phi();
571  double etahit = pos.eta();
572 
573  int iphihitm = (hoItr->id()).iphi();
574  int ietahitm = (hoItr->id()).ieta();
575  int depthhit = (hoItr->id()).depth();
576 
577  double dphi = fabs(trackPhi - phihit);
578  if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
579  double deta = fabs(trackEta - etahit);
580  double dr = sqrt(dphi*dphi + deta*deta);
581  */
582 
583  }
584  } catch (cms::Exception& e) { // can't find it!
585  if (!allowMissingInputs_) throw e;
586  }
587  }
588 }
RunNumber_t run() const
Definition: EventID.h:42
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
GlobalPoint posMax
double ecalEnergyInCone(const GlobalPoint center, double radius, const EcalRecHitCollection ecalCol, const CaloGeometry *geo)
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
double getDistInPlaneTrackDir(const GlobalPoint caloPoint, const GlobalVector caloVector, const GlobalPoint rechitPoint)
std::vector< T >::const_iterator const_iterator
T y() const
Definition: PV3DBase.h:63
#define abs(x)
Definition: mlp_lapack.h:159
Definition: TCell.h:15
TrackDetectorAssociator trackAssociator_
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
const CaloGeometry * geo
const_iterator end() const
TrackAssociatorParameters parameters_
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
Definition: DetId.h:20
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: Handle.h:74
edm::EventID id() const
Definition: EventBase.h:56
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:62
const_iterator begin() const
void HcalIsoTrkAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 594 of file HcalIsoTrkAnalyzer.cc.

References convertSQLiteXML::runNumber, and diffTreeTool::tree.

595 {
596 
597  // MyL3Algo = new MinL3AlgoUniv<HcalDetId>(eventWeight);
598 
599  input_to_L3.open("input_to_l3.txt");
600 
601  rootFile = new TFile("rootFile.root", "RECREATE");
602  tree = new TTree("hcalCalibTree", "Tree for IsoTrack Calibration");
603  cells = new TClonesArray("TCell", 10000);
604 // cells3x3 = new TRefArray;
605 // cellsPF = new TRefArray;
606 // exampleP4 = new TLorentzVector();
607  tagJetP4 = new TLorentzVector(); // dijet
608  probeJetP4 = new TLorentzVector(); // dijet
609 
610  tree->Branch("cells", &cells, 64000, 0);
611  tree->Branch("targetE", &targetE, "targetE/F");
612  tree->Branch("emEnergy", &emEnergy, "emEnergy/F");
613 
614  tree->Branch("PxTrkHcal", &PxTrkHcal, "PxTrkHcal/F");
615  tree->Branch("PyTrkHcal", &PyTrkHcal, "PyTrkHcal/F");
616  tree->Branch("PzTrkHcal", &PzTrkHcal, "PzTrkHcal/F");
617 
618 
619  tree->Branch("xTrkHcal", &xTrkHcal, "xTrkHcal/F");
620  tree->Branch("yTrkHcal", &yTrkHcal, "yTrkHcal/F");
621  tree->Branch("zTrkHcal", &zTrkHcal, "zTrkHcal/F");
622 
623  tree->Branch("iEtaHit", &iEtaHit, "iEtaHit/I");
624  tree->Branch("iPhiHit", &iPhiHit, "iPhiHit/i");
625  tree->Branch("eventNumber", &eventNumber, "eventNumber/i");
626  tree->Branch("runNumber", &runNumber, "runNumber/i");
627 
628  tree->Branch("tagJetP4", "TLorentzVector", &tagJetP4); // dijet
629  tree->Branch("probeJetP4", "TLorentzVector", &probeJetP4); // dijet
630  tree->Branch("etVetoJet", &etVetoJet, "etVetoJet/F"); // dijet
631  tree->Branch("tagJetEmFrac", &tagJetEmFrac,"tagJetEmFrac/F"); // dijet
632  tree->Branch("probeJetEmFrac", &probeJetEmFrac,"probeJetEmFrac/F"); // dijet
633 
634 }
TLorentzVector * probeJetP4
TLorentzVector * tagJetP4
void HcalIsoTrkAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 638 of file HcalIsoTrkAnalyzer.cc.

638  {
639 
640  input_to_L3.close();
641 
642  rootFile->Write();
643  rootFile->Close();
644 
645  if (cells) delete cells;
646 // if (cells3x3) delete cells3x3;
647 // if (cellsPF) delete cellsPF;
648 // if (exampleP4) delete exampleP4;
649  if (tagJetP4) delete tagJetP4; // dijet
650  if (probeJetP4) delete probeJetP4; // dijet
651 
652 }
TLorentzVector * probeJetP4
TLorentzVector * tagJetP4

Member Data Documentation

bool HcalIsoTrkAnalyzer::allowMissingInputs_
private

Definition at line 123 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::associationConeSize_
private

Definition at line 121 of file HcalIsoTrkAnalyzer.cc.

string HcalIsoTrkAnalyzer::AxB_
private

Definition at line 122 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::calibrationConeSize_
private

Definition at line 121 of file HcalIsoTrkAnalyzer.cc.

UInt_t HcalIsoTrkAnalyzer::cell
private

Definition at line 140 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::cellEnergy
private

Definition at line 141 of file HcalIsoTrkAnalyzer.cc.

TClonesArray* HcalIsoTrkAnalyzer::cells
private

Definition at line 143 of file HcalIsoTrkAnalyzer.cc.

TRefArray* HcalIsoTrkAnalyzer::cells3x3
private

Definition at line 144 of file HcalIsoTrkAnalyzer.cc.

TRefArray* HcalIsoTrkAnalyzer::cellsPF
private

Definition at line 145 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::EcalCone
private

Definition at line 134 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::EcalConeOuter
private

Definition at line 134 of file HcalIsoTrkAnalyzer.cc.

InputTag HcalIsoTrkAnalyzer::eLabel_
private

Definition at line 112 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::emEnergy
private

Definition at line 155 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::emRingEnergy
private

Definition at line 155 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::energyECALmip
private

Definition at line 133 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::energyMaxIso
private

Definition at line 132 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::energyMinIso
private

Definition at line 132 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::etVetoJet
private

Definition at line 160 of file HcalIsoTrkAnalyzer.cc.

UInt_t HcalIsoTrkAnalyzer::eventNumber
private
float HcalIsoTrkAnalyzer::eventWeight
private

Definition at line 131 of file HcalIsoTrkAnalyzer.cc.

const CaloGeometry* HcalIsoTrkAnalyzer::geo
private

Definition at line 111 of file HcalIsoTrkAnalyzer.cc.

InputTag HcalIsoTrkAnalyzer::hbheLabel_
private

Definition at line 112 of file HcalIsoTrkAnalyzer.cc.

InputTag HcalIsoTrkAnalyzer::hoLabel_
private

Definition at line 112 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::hottestHitDistance
private

Definition at line 134 of file HcalIsoTrkAnalyzer.cc.

Int_t HcalIsoTrkAnalyzer::iEtaHit
private

Definition at line 148 of file HcalIsoTrkAnalyzer.cc.

ofstream HcalIsoTrkAnalyzer::input_to_L3
private

Definition at line 164 of file HcalIsoTrkAnalyzer.cc.

UInt_t HcalIsoTrkAnalyzer::iPhiHit
private

Definition at line 149 of file HcalIsoTrkAnalyzer.cc.

std::string HcalIsoTrkAnalyzer::m_ebInstance
private

Definition at line 116 of file HcalIsoTrkAnalyzer.cc.

std::string HcalIsoTrkAnalyzer::m_ecalLabel
private

Definition at line 115 of file HcalIsoTrkAnalyzer.cc.

std::string HcalIsoTrkAnalyzer::m_eeInstance
private

Definition at line 117 of file HcalIsoTrkAnalyzer.cc.

std::string HcalIsoTrkAnalyzer::m_hcalLabel
private

Definition at line 118 of file HcalIsoTrkAnalyzer.cc.

int HcalIsoTrkAnalyzer::m_histoFlag
private

Definition at line 119 of file HcalIsoTrkAnalyzer.cc.

std::string HcalIsoTrkAnalyzer::m_inputTrackLabel
private

Definition at line 114 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::maxPNear
private

Definition at line 133 of file HcalIsoTrkAnalyzer.cc.

int HcalIsoTrkAnalyzer::MinNTECHitsEndcap
private

Definition at line 130 of file HcalIsoTrkAnalyzer.cc.

int HcalIsoTrkAnalyzer::MinNTrackHitsBarrel
private

Definition at line 130 of file HcalIsoTrkAnalyzer.cc.

int HcalIsoTrkAnalyzer::nIterations
private

Definition at line 130 of file HcalIsoTrkAnalyzer.cc.

UInt_t HcalIsoTrkAnalyzer::numberOfCells
private

Definition at line 139 of file HcalIsoTrkAnalyzer.cc.

string HcalIsoTrkAnalyzer::outputFileName_
private

Definition at line 124 of file HcalIsoTrkAnalyzer.cc.

TrackAssociatorParameters HcalIsoTrkAnalyzer::parameters_
private
Float_t HcalIsoTrkAnalyzer::probeJetEmFrac
private

Definition at line 162 of file HcalIsoTrkAnalyzer.cc.

TLorentzVector* HcalIsoTrkAnalyzer::probeJetP4
private

Definition at line 159 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::PxTrkHcal
private

Definition at line 153 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::PyTrkHcal
private

Definition at line 153 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::PzTrkHcal
private

Definition at line 153 of file HcalIsoTrkAnalyzer.cc.

TFile* HcalIsoTrkAnalyzer::rootFile
private

Definition at line 136 of file HcalIsoTrkAnalyzer.cc.

UInt_t HcalIsoTrkAnalyzer::runNumber
private

Definition at line 147 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::rvert
private

Definition at line 127 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::tagJetEmFrac
private

Definition at line 161 of file HcalIsoTrkAnalyzer.cc.

TLorentzVector* HcalIsoTrkAnalyzer::tagJetP4
private

Definition at line 158 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::targetE
private

Definition at line 138 of file HcalIsoTrkAnalyzer.cc.

TrackDetectorAssociator HcalIsoTrkAnalyzer::trackAssociator_
private

Definition at line 108 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::trackEta
private

Definition at line 126 of file HcalIsoTrkAnalyzer.cc.

InputTag HcalIsoTrkAnalyzer::trackLabel1_
private

Definition at line 112 of file HcalIsoTrkAnalyzer.cc.

InputTag HcalIsoTrkAnalyzer::trackLabel_
private

Definition at line 112 of file HcalIsoTrkAnalyzer.cc.

double HcalIsoTrkAnalyzer::trackPhi
private

Definition at line 126 of file HcalIsoTrkAnalyzer.cc.

TTree* HcalIsoTrkAnalyzer::tree
private
Float_t HcalIsoTrkAnalyzer::xTrkEcal
private

Definition at line 151 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::xTrkHcal
private

Definition at line 152 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::yTrkEcal
private

Definition at line 151 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::yTrkHcal
private

Definition at line 152 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::zTrkEcal
private

Definition at line 151 of file HcalIsoTrkAnalyzer.cc.

Float_t HcalIsoTrkAnalyzer::zTrkHcal
private

Definition at line 152 of file HcalIsoTrkAnalyzer.cc.