CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
AlCaIsoTracksProducer.cc File Reference
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "Calibration/HcalAlCaRecoProducers/interface/AlCaIsoTracksProducer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "DataFormats/GeometrySurface/interface/Cylinder.h"
#include "DataFormats/GeometrySurface/interface/Plane.h"
#include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
#include "MagneticField/Engine/interface/MagneticField.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixPropagator.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "Geometry/CaloTopology/interface/EcalPreshowerTopology.h"
#include "DataFormats/TrackReco/interface/TrackExtra.h"
#include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
#include "RecoTracker/TrackProducer/interface/TrackProducerBase.h"
#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h"
#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h"
#include "DataFormats/HLTReco/interface/TriggerEvent.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "Math/GenVector/VectorUtil.h"
#include "Math/GenVector/PxPyPzE4D.h"
#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
#include "DataFormats/L1Trigger/interface/L1JetParticle.h"
#include "DataFormats/Provenance/interface/ProductID.h"
#include "Calibration/HcalAlCaRecoProducers/plugins/ConeDefinition.h"
#include <boost/regex.hpp>

Go to the source code of this file.

Functions

bool checkHLTMatch (edm::Event &iEvent, edm::InputTag hltEventTag_, std::vector< std::string > hltFilterTag_, double eta, double phi, double hltMatchingCone_)
 
double getDist (double eta1, double phi1, double eta2, double phi2)
 
double getDistInCM (double eta1, double phi1, double eta2, double phi2)
 
std::pair< double, double > getL1triggerDirection (edm::Event &iEvent, edm::InputTag hltEventTag_, std::string l1FilterTag_)
 

Function Documentation

bool checkHLTMatch ( edm::Event iEvent,
edm::InputTag  hltEventTag_,
std::vector< std::string >  hltFilterTag_,
double  eta,
double  phi,
double  hltMatchingCone_ 
)

Definition at line 74 of file AlCaIsoTracksProducer.cc.

References trigger::TriggerObject::eta(), eta(), edm::Event::getByLabel(), getDist(), prof2calltree::l, match(), phi, and trigger::TriggerObject::phi().

Referenced by AlCaIsoTracksProducer::produce().

75 {
76  bool match =false;
77  double minDDD=1000;
78 
80  iEvent.getByLabel(hltEventTag_,trEv);
81  const trigger::TriggerObjectCollection& TOCol(trEv->getObjects());
82 
83  trigger::Keys KEYS;
84  const trigger::size_type nFilt(trEv->sizeFilters());
85  for (trigger::size_type iFilt=0; iFilt!=nFilt; iFilt++)
86  {
87  for (unsigned l=0; l<hltFilterTag_.size(); l++)
88  {
89  if ((trEv->filterTag(iFilt).label()).substr(0,27)==hltFilterTag_[l])
90  {
91  KEYS=trEv->filterKeys(iFilt);
92  }
93  }
94  }
95  trigger::size_type nReg=KEYS.size();
96  for (trigger::size_type iReg=0; iReg<nReg; iReg++)
97  {
98  const trigger::TriggerObject& TObj(TOCol[KEYS[iReg]]);
99  double dHit=getDist(TObj.eta(),TObj.phi(),eta,phi);
100  if (dHit<minDDD) minDDD=dHit;
101  }
102  if (minDDD>hltMatchingCone_) match=false;
103  else match=true;
104 
105  return match;
106 }
double getDist(double eta1, double phi1, double eta2, double phi2)
T eta() const
uint16_t size_type
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
std::vector< size_type > Keys
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
Definition: DDAxes.h:10
double getDist ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)

Definition at line 66 of file AlCaIsoTracksProducer.cc.

References funct::pow(), and mathSSE::sqrt().

Referenced by checkHLTMatch().

67 {
68  double dphi = fabs(phi1 - phi2);
69  if(dphi>acos(-1)) dphi = 2*acos(-1)-dphi;
70  double dr = sqrt(dphi*dphi + std::pow(eta1-eta2,2));
71  return dr;
72 }
T sqrt(T t)
Definition: SSEVec.h:28
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double getDistInCM ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)

Definition at line 48 of file AlCaIsoTracksProducer.cc.

References angle(), funct::cos(), funct::exp(), funct::sin(), and funct::tan().

49 {
50  double dR, Rec;
51  double theta1=2*atan(exp(-eta1));
52  double theta2=2*atan(exp(-eta2));
53  if (fabs(eta1)<1.479) Rec=129; //radius of ECAL barrel
54  else Rec=tan(theta1)*317; //distance from IP to ECAL endcap
55 
56  //|vect| times tg of acos(scalar product)
57  double angle=acos((sin(theta1)*sin(theta2)*(sin(phi1)*sin(phi2)+cos(phi1)*cos(phi2))+cos(theta1)*cos(theta2)));
58  if (angle<acos(-1)/2)
59  {
60  dR=fabs((Rec/sin(theta1))*tan(angle));
61  return dR;
62  }
63  else return 1000;
64 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
std::pair<double,double> getL1triggerDirection ( edm::Event iEvent,
edm::InputTag  hltEventTag_,
std::string  l1FilterTag_ 
)

Definition at line 108 of file AlCaIsoTracksProducer.cc.

References trigger::TriggerObject::eta(), edm::Event::getByLabel(), trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), and jptDQMConfig_cff::ptMax.

Referenced by AlCaIsoTracksProducer::produce().

109 {
111  iEvent.getByLabel(hltEventTag_,trEv);
112  const trigger::TriggerObjectCollection& TOCol(trEv->getObjects());
113 
114  trigger::Keys KEYS;
115  const trigger::size_type nFilt(trEv->sizeFilters());
116  for (trigger::size_type iFilt=0; iFilt!=nFilt; iFilt++)
117  {
118  if ((trEv->filterTag(iFilt).label()).substr(0,14)==l1FilterTag_) KEYS=trEv->filterKeys(iFilt);
119  }
120  trigger::size_type nReg=KEYS.size();
121  double etaTrig=-10000;
122  double phiTrig=-10000;
123  double ptMax=0;
124  for (trigger::size_type iReg=0; iReg<nReg; iReg++)
125  {
126  const trigger::TriggerObject& TObj(TOCol[KEYS[iReg]]);
127  if (TObj.pt()>ptMax)
128  {
129  etaTrig=TObj.eta();
130  phiTrig=TObj.phi();
131  ptMax=TObj.pt();
132  }
133  }
134  return std::pair<double,double>(etaTrig,phiTrig);
135 }
uint16_t size_type
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
std::vector< size_type > Keys