CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloTowerCreatorForTauHLT.cc
Go to the documentation of this file.
1 // makes CaloTowerCandidates from CaloTowers
2 // original author: L.Lista INFN, modifyed by: F.Ratnikov UMd
3 // Author for regionality A. Nikitenko
4 // Modified by S. Gennai
5 #include <cmath>
14 // Math
15 #include "Math/GenVector/VectorUtil.h"
16 #include <cmath>
17 
18 using namespace edm;
19 using namespace reco;
20 using namespace std;
21 using namespace l1extra ;
22 
24  :
25  mVerbose (p.getUntrackedParameter<int> ("verbose", 0)),
26  mtowers (p.getParameter<InputTag> ("towers")),
27  mCone (p.getParameter<double> ("UseTowersInCone")),
28  mTauTrigger (p.getParameter<InputTag> ("TauTrigger")),
29 // ml1seeds (p.getParameter<InputTag> ("l1seeds")),
30  mEtThreshold (p.getParameter<double> ("minimumEt")),
31  mEThreshold (p.getParameter<double> ("minimumE")),
32  mTauId (p.getParameter<int> ("TauId"))
33 {
34  produces<CaloTowerCollection>();
35 }
36 
38 }
39 
42  evt.getByLabel( mtowers, caloTowers );
43 
44  // imitate L1 seeds
46  evt.getByLabel(mTauTrigger, jetsgen);
47  std::auto_ptr<CaloTowerCollection> cands( new CaloTowerCollection );
48  cands->reserve( caloTowers->size() );
49 
50  int idTau =0;
51  L1JetParticleCollection::const_iterator myL1Jet = jetsgen->begin();
52  for(;myL1Jet != jetsgen->end();myL1Jet++)
53  {
54  if(idTau == mTauId)
55  {
56  double Sum08 = 0.;
57 
58  unsigned idx = 0;
59  for (; idx < caloTowers->size(); idx++) {
60  const CaloTower* cal = &((*caloTowers) [idx]);
61  if (mVerbose == 2) {
62  std::cout << "CaloTowerCreatorForTauHLT::produce-> " << idx << " tower et/eta/phi/e: "
63  << cal->et() << '/' << cal->eta() << '/' << cal->phi() << '/' << cal->energy() << " is...";
64  }
65  if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold ) {
66  math::PtEtaPhiELorentzVector p( cal->et(), cal->eta(), cal->phi(), cal->energy() );
67  double delta = ROOT::Math::VectorUtil::DeltaR((*myL1Jet).p4().Vect(), p);
68 
69  if(delta < mCone) {
70  Sum08 += cal->et();
71  cands->push_back( *cal );
72  }
73  }
74  else {
75  if (mVerbose == 2) std::cout << "rejected " << std::endl;
76  }
77  }
78 
79  }
80  idTau++;
81  }
82 
83  evt.put( cands );
84 
85 }
dbl * delta
Definition: mlp_gen.cc:36
virtual double eta() const
momentum pseudorapidity
virtual double energy() const
energy
double mCone
use only towers in cone mCone around L1 candidate for regional jet reco
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag mTauTrigger
label of tau trigger type analysis
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:28
edm::InputTag mtowers
label of source collection
CaloTowerCreatorForTauHLT(const edm::ParameterSet &)
constructor from parameter set
tuple cout
Definition: gather_cfg.py:121
double et(double vtxZ) const
Definition: CaloTower.h:101
virtual double phi() const
momentum azimuthal angle
void produce(edm::Event &e, const edm::EventSetup &)
process one event