CMS 3D CMS Logo

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

#include <TCTauAlgorithm.h>

Public Types

enum  TCAlgo {
  TCAlgoUndetermined, TCAlgoMomentum, TCAlgoTrackProblem, TCAlgoMomentumECAL,
  TCAlgoCaloJet, TCAlgoHadronicJet
}
 

Public Member Functions

int allTauCandidates () const
 
double efficiency () const
 
void eventSetup (const edm::Event &, const edm::EventSetup &)
 
void inputConfig (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
math::XYZTLorentzVector recalculateEnergy (const reco::CaloTau &, TCAlgo &) const
 
math::XYZTLorentzVector recalculateEnergy (const reco::CaloTau &tau) const
 
math::XYZTLorentzVector recalculateEnergy (const reco::CaloJet &, const reco::TrackRef &, const reco::TrackRefVector &, TCAlgo &) const
 
int statistics () const
 
 TCTauAlgorithm ()
 
 TCTauAlgorithm (const edm::ParameterSet &, edm::ConsumesCollector &&)
 
 ~TCTauAlgorithm ()
 

Private Member Functions

math::XYZVector getCellMomentum (const CaloCellGeometry *, double &) const
 
std::pair< math::XYZVector,
math::XYZVector
getClusterEnergy (const reco::CaloJet &, math::XYZVector &, double) const
 
void init ()
 
math::XYZVector trackEcalHitPoint (const reco::TransientTrack &, const reco::CaloJet &) const
 
math::XYZVector trackEcalHitPoint (const reco::Track &) const
 

Private Attributes

std::atomic< int > all
 
bool dropCaloJets
 
bool dropRejected
 
const CaloSubdetectorGeometryEB
 
edm::Handle< EBRecHitCollectionEBRecHits
 
double ecalCone
 
edm::InputTag EcalRecHitsEB_input
 
edm::InputTag EcalRecHitsEE_input
 
const CaloSubdetectorGeometryEE
 
edm::Handle< EERecHitCollectionEERecHits
 
double etCaloOverTrackMax
 
double etCaloOverTrackMin
 
double etHcalOverTrackMax
 
double etHcalOverTrackMin
 
const edm::Eventevent
 
const CaloSubdetectorGeometryHB
 
edm::Handle< HBHERecHitCollectionHBHERecHits
 
edm::InputTag HBHERecHits_input
 
const CaloSubdetectorGeometryHE
 
const CaloSubdetectorGeometryHF
 
edm::Handle< HFRecHitCollectionHFRecHits
 
edm::InputTag HFRecHits_input
 
const CaloSubdetectorGeometryHO
 
edm::Handle< HORecHitCollectionHORecHits
 
edm::InputTag HORecHits_input
 
std::atomic< int > passed
 
int prongs
 
const edm::EventSetupsetup
 
double signalCone
 
TrackDetectorAssociatortrackAssociator
 
TrackAssociatorParameters trackAssociatorParameters
 
const TransientTrackBuildertransientTrackBuilder
 

Detailed Description

Definition at line 45 of file TCTauAlgorithm.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

TCTauAlgorithm::TCTauAlgorithm ( )

Definition at line 15 of file TCTauAlgorithm.cc.

References init.

15  {
16  init();
17 }
TCTauAlgorithm::TCTauAlgorithm ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 19 of file TCTauAlgorithm.cc.

References init.

19  {
20  init();
21  inputConfig(iConfig, iC);
22 }
void inputConfig(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
TCTauAlgorithm::~TCTauAlgorithm ( )

Definition at line 24 of file TCTauAlgorithm.cc.

24 {}

Member Function Documentation

int TCTauAlgorithm::allTauCandidates ( ) const

Definition at line 71 of file TCTauAlgorithm.cc.

References cond::ecalcond::all.

Referenced by TCTauCorrector::allTauCandidates().

71  {
72  return all;
73 }
std::atomic< int > all
double TCTauAlgorithm::efficiency ( ) const

Definition at line 63 of file TCTauAlgorithm.cc.

References cond::ecalcond::all.

Referenced by TCTauCorrector::efficiency().

63  {
64  return double(passed)/all;
65 }
std::atomic< int > passed
std::atomic< int > all
void TCTauAlgorithm::eventSetup ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 75 of file TCTauAlgorithm.cc.

References egHLT::errCodes::EBRecHits, DetId::Ecal, EcalBarrel, EcalEndcap, HWWFunctions::EE, egHLT::errCodes::EERecHits, geometry, edm::EventSetup::get(), edm::Event::getByLabel(), egHLT::errCodes::HBHERecHits, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HF, egHLT::errCodes::HFRecHits, iEvent, edm::ESHandle< class >::product(), and HcalObjRepresent::setup().

Referenced by TCTauCorrector::eventSetup().

75  {
76 
77  event = &iEvent;
78  setup = &iSetup;
79 
81  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
82  transientTrackBuilder = builder.product();
83 
84  // geometry initialization
86  iSetup.get<CaloGeometryRecord>().get(geometry);
87 
88 
89  EB = geometry->getSubdetectorGeometry(DetId::Ecal,EcalBarrel);
90  EE = geometry->getSubdetectorGeometry(DetId::Ecal,EcalEndcap);
91  HB = geometry->getSubdetectorGeometry(DetId::Hcal,HcalBarrel);
92  HE = geometry->getSubdetectorGeometry(DetId::Hcal,HcalEndcap);
93  HO = geometry->getSubdetectorGeometry(DetId::Hcal,HcalOuter);
94  HF = geometry->getSubdetectorGeometry(DetId::Hcal,HcalForward);
95 
96  //hits
99 
103 }
edm::Handle< HORecHitCollection > HORecHits
const edm::EventSetup * setup
const CaloSubdetectorGeometry * HO
const CaloSubdetectorGeometry * HE
const CaloSubdetectorGeometry * EB
int iEvent
Definition: GenABIO.cc:230
edm::InputTag EcalRecHitsEB_input
edm::Handle< HBHERecHitCollection > HBHERecHits
const CaloSubdetectorGeometry * HF
const CaloSubdetectorGeometry * EE
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
edm::InputTag HBHERecHits_input
edm::Handle< EERecHitCollection > EERecHits
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
const TransientTrackBuilder * transientTrackBuilder
edm::InputTag HORecHits_input
ESHandle< TrackerGeometry > geometry
edm::Handle< HFRecHitCollection > HFRecHits
edm::InputTag EcalRecHitsEE_input
edm::InputTag HFRecHits_input
edm::Handle< EBRecHitCollection > EBRecHits
const CaloSubdetectorGeometry * HB
XYZVector TCTauAlgorithm::getCellMomentum ( const CaloCellGeometry cell,
double &  energy 
) const
private

Definition at line 347 of file TCTauAlgorithm.cc.

References funct::cos(), CaloCellGeometry::getPosition(), phi, PV3DBase< T, PVType, FrameType >::phi(), funct::sin(), PV3DBase< T, PVType, FrameType >::theta(), and theta().

347  {
348  XYZVector momentum(0,0,0);
349  if(cell){
350  GlobalPoint hitPosition = cell->getPosition();
351 
352  double phi = hitPosition.phi();
353  double theta = hitPosition.theta();
354  if(theta > 3.14159) theta = 2*3.14159 - theta;
355  double px = energy * sin(theta)*cos(phi);
356  double py = energy * sin(theta)*sin(phi);
357  double pz = energy * cos(theta);
358 
359  momentum = XYZVector(px,py,pz);
360  }
361  return momentum;
362 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Geom::Theta< T > theta() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: DDAxes.h:10
std::pair< XYZVector, XYZVector > TCTauAlgorithm::getClusterEnergy ( const reco::CaloJet ,
math::XYZVector ,
double   
) const
private

Definition at line 247 of file TCTauAlgorithm.cc.

References DetId::det(), egHLT::errCodes::EBRecHits, DetId::Ecal, ecaldqm::ecalID(), HWWFunctions::EE, egHLT::errCodes::EERecHits, relval_parameters_module::energy, reco::CaloJet::getCaloConstituents(), egHLT::errCodes::HBHERecHits, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HF, egHLT::errCodes::HFRecHits, i, j, and DetId::subdetId().

247  {
248 
249  XYZVector ecalCluster(0,0,0);
250  XYZVector hcalCluster(0,0,0);
251 
252  std::vector<CaloTowerPtr> towers = caloJet.getCaloConstituents();
253 
254  for(std::vector<CaloTowerPtr>::const_iterator iTower = towers.begin();
255  iTower!= towers.end(); ++iTower){
256  std::vector<XYZVector> ECALCells;
257  std::vector<XYZVector> HCALCells;
258 
259  size_t numRecHits = (**iTower).constituentsSize();
260 
261  // access CaloRecHits
262  for(size_t j = 0; j < numRecHits; j++) {
263  DetId recHitDetID = (**iTower).constituent(j);
264  //DetId::Detector detNum=recHitDetID.det();
265  if( recHitDetID.det() == DetId::Ecal ){
266  if( recHitDetID.subdetId() == 1 ){ // Ecal Barrel
267  EBDetId ecalID = recHitDetID;
268  EBRecHitCollection::const_iterator theRecHit = EBRecHits->find(ecalID);
269  if(theRecHit != EBRecHits->end()){
270  DetId id = theRecHit->detid();
271  const CaloCellGeometry* this_cell = EB->getGeometry(id);
272  double energy = theRecHit->energy();
273  ECALCells.push_back(getCellMomentum(this_cell,energy));
274  }
275  }
276  if( recHitDetID.subdetId() == 2 ){ // Ecal Endcap
277  EEDetId ecalID = recHitDetID;
278  EERecHitCollection::const_iterator theRecHit = EERecHits->find(ecalID);
279  if(theRecHit != EERecHits->end()){
280  DetId id = theRecHit->detid();
281  const CaloCellGeometry* this_cell = EE->getGeometry(id);
282  double energy = theRecHit->energy();
283  ECALCells.push_back(getCellMomentum(this_cell,energy));
284  }
285  }
286  }
287  if( recHitDetID.det() == DetId::Hcal ){
288  HcalDetId hcalID = recHitDetID;
289  if( recHitDetID.subdetId() == HcalBarrel ){
290  //int depth = hcalID.depth();
291  //if (depth==1){
292  HBHERecHitCollection::const_iterator theRecHit=HBHERecHits->find(hcalID);
293  if(theRecHit != HBHERecHits->end()){
294  DetId id = theRecHit->detid();
295  const CaloCellGeometry* this_cell = HB->getGeometry(id);
296  double energy = theRecHit->energy();
297  HCALCells.push_back(getCellMomentum(this_cell,energy));
298  }
299  //}
300  }
301  if( recHitDetID.subdetId() == HcalEndcap ){
302  //int depth = hcalID.depth();
303  //if (depth==1){
304  HBHERecHitCollection::const_iterator theRecHit=HBHERecHits->find(hcalID);
305  if(theRecHit != HBHERecHits->end()){
306  DetId id = theRecHit->detid();
307  const CaloCellGeometry* this_cell = HE->getGeometry(id);
308  double energy = theRecHit->energy();
309  HCALCells.push_back(getCellMomentum(this_cell,energy));
310  }
311  //}
312  }
313  if( recHitDetID.subdetId() == HcalOuter ){
314  HORecHitCollection::const_iterator theRecHit=HORecHits->find(hcalID);
315  if(theRecHit != HORecHits->end()){
316  DetId id = theRecHit->detid();
317  const CaloCellGeometry* this_cell = HO->getGeometry(id);
318  double energy = theRecHit->energy();
319  HCALCells.push_back(getCellMomentum(this_cell,energy));
320  }
321  }
322  if( recHitDetID.subdetId() == HcalForward ){
323  HFRecHitCollection::const_iterator theRecHit=HFRecHits->find(hcalID);
324  if(theRecHit != HFRecHits->end()){
325  DetId id = theRecHit->detid();
326  const CaloCellGeometry* this_cell = HF->getGeometry(id);
327  double energy = theRecHit->energy();
328  HCALCells.push_back(getCellMomentum(this_cell,energy));
329  }
330  }
331  }
332  }
333 
334  std::vector<XYZVector>::const_iterator i;
335  for(i = ECALCells.begin(); i != ECALCells.end(); ++i) {
336  double DR = ROOT::Math::VectorUtil::DeltaR(trackEcalHitPoint,*i);
337  if( DR < cone ) ecalCluster += *i;
338  }
339  for(i = HCALCells.begin(); i != HCALCells.end(); ++i) {
340  double DR = ROOT::Math::VectorUtil::DeltaR(trackEcalHitPoint,*i);
341  if( DR < cone ) hcalCluster += *i;
342  }
343  }
344  return std::pair<XYZVector,XYZVector> (ecalCluster,hcalCluster);
345 }
int i
Definition: DBlmapReader.cc:9
edm::Handle< HORecHitCollection > HORecHits
std::vector< EcalRecHit >::const_iterator const_iterator
const CaloSubdetectorGeometry * HO
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const CaloSubdetectorGeometry * HE
const CaloSubdetectorGeometry * EB
edm::Handle< HBHERecHitCollection > HBHERecHits
int j
Definition: DBlmapReader.cc:9
const CaloSubdetectorGeometry * HF
const CaloSubdetectorGeometry * EE
math::XYZVector trackEcalHitPoint(const reco::TransientTrack &, const reco::CaloJet &) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
EcalLogicID ecalID()
Definition: DetId.h:18
edm::Handle< EERecHitCollection > EERecHits
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
math::XYZVector getCellMomentum(const CaloCellGeometry *, double &) const
edm::Handle< HFRecHitCollection > HFRecHits
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
edm::Handle< EBRecHitCollection > EBRecHits
const CaloSubdetectorGeometry * HB
void TCTauAlgorithm::init ( void  )
private

Definition at line 26 of file TCTauAlgorithm.cc.

References cond::ecalcond::all, and HcalObjRepresent::setup().

26  {
27 
28  event = nullptr;
29  setup = nullptr;
30 
33 
34  all = 0;
35  passed = 0;
36  prongs = -1;
37 }
std::atomic< int > passed
const edm::EventSetup * setup
void useDefaultPropagator()
use the default propagator
std::atomic< int > all
TrackDetectorAssociator * trackAssociator
void TCTauAlgorithm::inputConfig ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

Definition at line 39 of file TCTauAlgorithm.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

Referenced by TCTauCorrector::inputConfig().

39  {
40 
41  etCaloOverTrackMin = iConfig.getParameter<double>("EtCaloOverTrackMin");
42  etCaloOverTrackMax = iConfig.getParameter<double>("EtCaloOverTrackMax");
43  etHcalOverTrackMin = iConfig.getParameter<double>("EtHcalOverTrackMin");
44  etHcalOverTrackMax = iConfig.getParameter<double>("EtHcalOverTrackMax");
45 
46  signalCone = iConfig.getParameter<double>("SignalConeSize");
47  ecalCone = iConfig.getParameter<double>("EcalConeSize");
48 
49  EcalRecHitsEB_input= iConfig.getParameter<edm::InputTag>("EBRecHitCollection");
50  EcalRecHitsEE_input= iConfig.getParameter<edm::InputTag>("EERecHitCollection");
51  HBHERecHits_input = iConfig.getParameter<edm::InputTag>("HBHERecHitCollection");
52  HORecHits_input = iConfig.getParameter<edm::InputTag>("HORecHitCollection");
53  HFRecHits_input = iConfig.getParameter<edm::InputTag>("HFRecHitCollection");
54 
55  edm::ParameterSet pset = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
57 
58  dropCaloJets = iConfig.getUntrackedParameter<bool>("DropCaloJets",false);
59  dropRejected = iConfig.getUntrackedParameter<bool>("DropRejectedJets",true);
60 }
double etCaloOverTrackMax
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double etHcalOverTrackMin
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
double etHcalOverTrackMax
double etCaloOverTrackMin
edm::InputTag EcalRecHitsEB_input
edm::InputTag HBHERecHits_input
edm::InputTag HORecHits_input
edm::InputTag EcalRecHitsEE_input
edm::InputTag HFRecHits_input
TrackAssociatorParameters trackAssociatorParameters
math::XYZTLorentzVector TCTauAlgorithm::recalculateEnergy ( const reco::CaloTau jet,
TCAlgo algoComponentUsed 
) const

Definition at line 106 of file TCTauAlgorithm.cc.

References reco::CaloTau::caloTauTagInfoRef(), edm::Ref< C, T, F >::get(), reco::BaseTau::leadTrack(), reco::LeafCandidate::p4(), and reco::LeafCandidate::setP4().

Referenced by TCTauCorrector::correctedP4(), TCTauCorrector::correction(), and recalculateEnergy().

106  {
107 
108  const TrackRef& leadTk = jet.leadTrack();
109 
110  const TrackRefVector associatedTracks = jet.caloTauTagInfoRef()->Tracks();
111 
112  const CaloJet* cJet = jet.caloTauTagInfoRef()->calojetRef().get();
113  CaloJet caloJet = *cJet;
114  caloJet.setP4(jet.p4());
115 
116  return recalculateEnergy(caloJet,leadTk,associatedTracks,algoComponentUsed);
117 }
virtual reco::TrackRef leadTrack() const
Definition: BaseTau.cc:26
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual void setP4(const LorentzVector &p4)
set 4-momentum
math::XYZTLorentzVector recalculateEnergy(const reco::CaloTau &, TCAlgo &) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
const CaloTauTagInfoRef & caloTauTagInfoRef() const
Definition: CaloTau.cc:29
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
math::XYZTLorentzVector TCTauAlgorithm::recalculateEnergy ( const reco::CaloTau tau) const
inline

Definition at line 60 of file TCTauAlgorithm.h.

References recalculateEnergy(), and TCAlgoUndetermined.

60  {
61  TCAlgo dummy = TCAlgoUndetermined;
62  return recalculateEnergy(tau,dummy);
63  }
math::XYZTLorentzVector recalculateEnergy(const reco::CaloTau &, TCAlgo &) const
math::XYZTLorentzVector TCTauAlgorithm::recalculateEnergy ( const reco::CaloJet caloJet,
const reco::TrackRef leadTk,
const reco::TrackRefVector associatedTracks,
TCAlgo algoComponentUsed 
) const

Definition at line 119 of file TCTauAlgorithm.cc.

References cond::ecalcond::all, edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), reco::LeafCandidate::energy(), edm::Ref< C, T, F >::isNull(), p4, reco::LeafCandidate::p4(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::LeafCandidate::pz().

119  {
120 
121  all++;
122 
123  math::XYZTLorentzVector p4(0,0,0,0);
124  algoComponentUsed = TCAlgoUndetermined;
125 
126  //if(!dropRejected)
127  p4 = caloJet.p4();
128 
129  if(leadTk.isNull()) return p4;
130 
131  XYZVector momentum(0,0,0);
132  int prongCounter = 0;
134  for(iTrack = associatedTracks.begin(); iTrack!= associatedTracks.end(); ++iTrack){
135  double DR = ROOT::Math::VectorUtil::DeltaR(leadTk->momentum(),(*iTrack)->momentum());
136  if(DR < signalCone) {
137  momentum+=(*iTrack)->momentum();
138  prongCounter++;
139  }
140  }
141  if(momentum.Rho() == 0) return p4;
142 
143  XYZVector ltrackEcalHitPoint = trackEcalHitPoint(*leadTk);
144 
145  if(! (ltrackEcalHitPoint.Rho() > 0 && ltrackEcalHitPoint.Rho() < 9999) ) return p4;
146 
147  std::pair<XYZVector,XYZVector> caloClusters = getClusterEnergy(caloJet,ltrackEcalHitPoint,signalCone);
148  XYZVector EcalCluster = caloClusters.first;
149  XYZVector HcalCluster = caloClusters.second;
150 
151  double eCaloOverTrack = (EcalCluster.R()+HcalCluster.R()-momentum.R())/momentum.R();
152 
153  std::pair<XYZVector,XYZVector> caloClustersPhoton = getClusterEnergy(caloJet,ltrackEcalHitPoint,ecalCone);
154  XYZVector EcalClusterPhoton = caloClustersPhoton.first;
155 
156  math::XYZTLorentzVector p4photons(0,0,0,EcalClusterPhoton.R() - EcalCluster.R());
157 
158  if( eCaloOverTrack > etCaloOverTrackMin && eCaloOverTrack < etCaloOverTrackMax ) {
159 
160  double eHcalOverTrack = (HcalCluster.R()-momentum.R())/momentum.R();
161 
162  if ( eHcalOverTrack > etHcalOverTrackMin && eHcalOverTrack < etHcalOverTrackMax ) {
163  p4.SetXYZT(EcalCluster.X() + momentum.X(),
164  EcalCluster.Y() + momentum.Y(),
165  EcalCluster.Z() + momentum.Z(),
166  EcalCluster.R() + momentum.R());
167  p4 += p4photons;
168  algoComponentUsed = TCAlgoMomentumECAL;
169  }else{
170  p4.SetXYZT(momentum.X(),
171  momentum.Y(),
172  momentum.Z(),
173  momentum.R());
174  algoComponentUsed = TCAlgoMomentum;
175  }
176  }
177  if( eCaloOverTrack > etCaloOverTrackMax ) {
178  double eHcalOverTrack = (HcalCluster.R()-momentum.R())/momentum.R();
179 
180  if ( eHcalOverTrack > etHcalOverTrackMin && eHcalOverTrack < etHcalOverTrackMax ) {
181  p4.SetXYZT(EcalCluster.X() + momentum.X(),
182  EcalCluster.Y() + momentum.Y(),
183  EcalCluster.Z() + momentum.Z(),
184  EcalCluster.R() + momentum.R());
185  p4 += p4photons;
186  algoComponentUsed = TCAlgoMomentumECAL;
187  }
188  if ( eHcalOverTrack < etHcalOverTrackMin ) {
189  if(!dropCaloJets) p4.SetXYZT(caloJet.px(),caloJet.py(),caloJet.pz(),caloJet.energy());
190  else p4.SetXYZT(0,0,0,0);
191  algoComponentUsed = TCAlgoCaloJet;
192  }
193  if ( eHcalOverTrack > etHcalOverTrackMax ) {
194  algoComponentUsed = TCAlgoHadronicJet; // reject
195  if(!dropRejected) p4.SetXYZT(caloJet.px(),caloJet.py(),caloJet.pz(),caloJet.energy());
196  else p4.SetXYZT(0,0,0,0);
197  }
198  }
199  if( eCaloOverTrack < etCaloOverTrackMin ) {
200  algoComponentUsed = TCAlgoTrackProblem; // reject
201  if(!dropRejected) p4.SetXYZT(caloJet.px(),caloJet.py(),caloJet.pz(),caloJet.energy());
202  }
203 
204  if(p4.Et() > 0) passed++;
205 
206  return p4;
207 }
double etCaloOverTrackMax
double etHcalOverTrackMin
std::atomic< int > passed
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
double etHcalOverTrackMax
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
std::atomic< int > all
double etCaloOverTrackMin
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual double energy() const
energy
double p4[4]
Definition: TauolaWrapper.h:92
std::pair< math::XYZVector, math::XYZVector > getClusterEnergy(const reco::CaloJet &, math::XYZVector &, double) const
math::XYZVector trackEcalHitPoint(const reco::TransientTrack &, const reco::CaloJet &) const
bool isNull() const
Checks for null.
Definition: Ref.h:247
virtual double px() const
x coordinate of momentum vector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
virtual double pz() const
z coordinate of momentum vector
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
virtual double py() const
y coordinate of momentum vector
int TCTauAlgorithm::statistics ( ) const

Definition at line 67 of file TCTauAlgorithm.cc.

Referenced by TCTauCorrector::statistics().

67  {
68  return passed;
69 }
std::atomic< int > passed
XYZVector TCTauAlgorithm::trackEcalHitPoint ( const reco::TransientTrack transientTrack,
const reco::CaloJet caloJet 
) const
private

Definition at line 210 of file TCTauAlgorithm.cc.

References reco::CaloJet::getCaloConstituents(), TrajectoryStateOnSurface::globalPosition(), reco::TransientTrack::stateOnSurface(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

210  {
211 
212 
213  GlobalPoint ecalHitPosition(0,0,0);
214 
215  double maxTowerEt = 0;
216  std::vector<CaloTowerPtr> towers = caloJet.getCaloConstituents();
217  for(std::vector<CaloTowerPtr>::const_iterator iTower = towers.begin();
218  iTower!= towers.end(); ++iTower){
219  if((*iTower)->et() > maxTowerEt){
220  maxTowerEt = (*iTower)->et();
221  ecalHitPosition = (*iTower)->emPosition();
222  }
223  }
224 
225 
226  XYZVector ecalHitPoint(0,0,0);
227 
228  GlobalPoint trackEcalHitPoint = transientTrack.stateOnSurface(ecalHitPosition).globalPosition();
229 
230  ecalHitPoint.SetXYZ(trackEcalHitPoint.x(),
231  trackEcalHitPoint.y(),
232  trackEcalHitPoint.z());
233 
234  return ecalHitPoint;
235 }
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
Definition: CaloJet.cc:93
T z() const
Definition: PV3DBase.h:64
math::XYZVector trackEcalHitPoint(const reco::TransientTrack &, const reco::CaloJet &) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
TrajectoryStateOnSurface stateOnSurface(const GlobalPoint &point) const
T x() const
Definition: PV3DBase.h:62
XYZVector TCTauAlgorithm::trackEcalHitPoint ( const reco::Track track) const
private

Definition at line 237 of file TCTauAlgorithm.cc.

References event(), info(), TrackDetMatchInfo::isGoodEcal, HcalObjRepresent::setup(), and TrackDetMatchInfo::trkGlobPosAtEcal.

237  {
238 
241  if( info.isGoodEcal != 0 ) {
242  return XYZVector(info.trkGlobPosAtEcal.x(),info.trkGlobPosAtEcal.y(),info.trkGlobPosAtEcal.z());
243  }
244  return XYZVector(0,0,0);
245 }
static const TGPicture * info(bool iBackgroundIsBlack)
const edm::EventSetup * setup
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
const edm::Event * event
TrackDetectorAssociator * trackAssociator
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
TrackAssociatorParameters trackAssociatorParameters

Member Data Documentation

std::atomic<int> TCTauAlgorithm::all
mutableprivate

Definition at line 90 of file TCTauAlgorithm.h.

bool TCTauAlgorithm::dropCaloJets
private

Definition at line 95 of file TCTauAlgorithm.h.

bool TCTauAlgorithm::dropRejected
private

Definition at line 96 of file TCTauAlgorithm.h.

const CaloSubdetectorGeometry* TCTauAlgorithm::EB
private

Definition at line 114 of file TCTauAlgorithm.h.

edm::Handle<EBRecHitCollection> TCTauAlgorithm::EBRecHits
private

Definition at line 121 of file TCTauAlgorithm.h.

double TCTauAlgorithm::ecalCone
private

Definition at line 101 of file TCTauAlgorithm.h.

edm::InputTag TCTauAlgorithm::EcalRecHitsEB_input
private

Definition at line 108 of file TCTauAlgorithm.h.

edm::InputTag TCTauAlgorithm::EcalRecHitsEE_input
private

Definition at line 109 of file TCTauAlgorithm.h.

const CaloSubdetectorGeometry* TCTauAlgorithm::EE
private

Definition at line 115 of file TCTauAlgorithm.h.

edm::Handle<EERecHitCollection> TCTauAlgorithm::EERecHits
private

Definition at line 122 of file TCTauAlgorithm.h.

double TCTauAlgorithm::etCaloOverTrackMax
private

Definition at line 103 of file TCTauAlgorithm.h.

double TCTauAlgorithm::etCaloOverTrackMin
private

Definition at line 103 of file TCTauAlgorithm.h.

double TCTauAlgorithm::etHcalOverTrackMax
private

Definition at line 103 of file TCTauAlgorithm.h.

double TCTauAlgorithm::etHcalOverTrackMin
private

Definition at line 103 of file TCTauAlgorithm.h.

const edm::Event* TCTauAlgorithm::event
private

Definition at line 75 of file TCTauAlgorithm.h.

Referenced by Types.EventID::cppID().

const CaloSubdetectorGeometry* TCTauAlgorithm::HB
private

Definition at line 116 of file TCTauAlgorithm.h.

edm::Handle<HBHERecHitCollection> TCTauAlgorithm::HBHERecHits
private

Definition at line 124 of file TCTauAlgorithm.h.

edm::InputTag TCTauAlgorithm::HBHERecHits_input
private

Definition at line 110 of file TCTauAlgorithm.h.

const CaloSubdetectorGeometry* TCTauAlgorithm::HE
private

Definition at line 117 of file TCTauAlgorithm.h.

const CaloSubdetectorGeometry* TCTauAlgorithm::HF
private

Definition at line 119 of file TCTauAlgorithm.h.

edm::Handle<HFRecHitCollection> TCTauAlgorithm::HFRecHits
private

Definition at line 126 of file TCTauAlgorithm.h.

edm::InputTag TCTauAlgorithm::HFRecHits_input
private

Definition at line 112 of file TCTauAlgorithm.h.

const CaloSubdetectorGeometry* TCTauAlgorithm::HO
private

Definition at line 118 of file TCTauAlgorithm.h.

edm::Handle<HORecHitCollection> TCTauAlgorithm::HORecHits
private

Definition at line 125 of file TCTauAlgorithm.h.

edm::InputTag TCTauAlgorithm::HORecHits_input
private

Definition at line 111 of file TCTauAlgorithm.h.

std::atomic<int> TCTauAlgorithm::passed
mutableprivate

Definition at line 90 of file TCTauAlgorithm.h.

int TCTauAlgorithm::prongs
private

Definition at line 93 of file TCTauAlgorithm.h.

const edm::EventSetup* TCTauAlgorithm::setup
private

Definition at line 76 of file TCTauAlgorithm.h.

double TCTauAlgorithm::signalCone
private

Definition at line 100 of file TCTauAlgorithm.h.

TrackDetectorAssociator* TCTauAlgorithm::trackAssociator
private

Definition at line 78 of file TCTauAlgorithm.h.

TrackAssociatorParameters TCTauAlgorithm::trackAssociatorParameters
private

Definition at line 77 of file TCTauAlgorithm.h.

const TransientTrackBuilder* TCTauAlgorithm::transientTrackBuilder
private

Definition at line 98 of file TCTauAlgorithm.h.