CMS 3D CMS Logo

CaloTowerFromL1TCreatorForTauHLT.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 
12 // Math
13 #include "Math/GenVector/VectorUtil.h"
14 #include <cmath>
15 
16 using namespace edm;
17 using namespace reco;
18 using namespace std;
19 
21  : mBX(p.getParameter<int>("BX")),
22  mVerbose(p.getUntrackedParameter<int>("verbose", 0)),
23  mtowers_token(consumes<CaloTowerCollection>(p.getParameter<InputTag>("towers"))),
24  mCone(p.getParameter<double>("UseTowersInCone")),
25  mTauTrigger_token(consumes<l1t::TauBxCollection>(p.getParameter<InputTag>("TauTrigger"))),
26  mEtThreshold(p.getParameter<double>("minimumEt")),
27  mEThreshold(p.getParameter<double>("minimumE")),
28  mTauId(p.getParameter<int>("TauId")) {
29  produces<CaloTowerCollection>();
30 }
31 
33 
37 
38  // imitate L1 seeds
40  evt.getByToken(mTauTrigger_token, jetsgen);
41 
42  std::unique_ptr<CaloTowerCollection> cands(new CaloTowerCollection);
43  cands->reserve(caloTowers->size());
44 
45  int idTau = 0;
46  if (jetsgen.isValid()) {
47  for (auto myL1Jet = jetsgen->begin(mBX); myL1Jet != jetsgen->end(mBX); myL1Jet++) {
48  if (idTau == mTauId) {
49  double Sum08 = 0.;
50  unsigned idx = 0;
51  for (; idx < caloTowers->size(); idx++) {
52  const CaloTower* cal = &((*caloTowers)[idx]);
53  bool isAccepted = false;
54  if (mVerbose == 2) {
55  edm::LogInfo("JetDebugInfo") << "CaloTowerFromL1TCreatorForTauHLT::produce-> " << idx
56  << " tower et/eta/phi/e: " << cal->et() << '/' << cal->eta() << '/'
57  << cal->phi() << '/' << cal->energy() << " is...";
58  }
59  if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold) {
60  math::PtEtaPhiELorentzVector p(cal->et(), cal->eta(), cal->phi(), cal->energy());
61  double delta = ROOT::Math::VectorUtil::DeltaR((*myL1Jet).p4().Vect(), p);
62  if (delta < mCone) {
63  isAccepted = true;
64  Sum08 += cal->et();
65  cands->push_back(*cal);
66  }
67  }
68  if (mVerbose == 2) {
69  if (isAccepted)
70  edm::LogInfo("JetDebugInfo") << "accepted \n";
71  else
72  edm::LogInfo("JetDebugInfo") << "rejected \n";
73  }
74  }
75  }
76  idTau++;
77  }
78  } else {
79  edm::LogWarning("MissingProduct") << "L1Upgrade jet bx collection not found." << std::endl;
80  }
81 
82  evt.put(std::move(cands));
83 }
84 
87 
88  aDesc.add<edm::InputTag>("TauTrigger", edm::InputTag("caloStage2Digis"))->setComment("L1 Tau collection for seeding");
89  aDesc.add<edm::InputTag>("towers", edm::InputTag("towerMaker"))->setComment("Input tower collection");
90  aDesc.add<int>("TauId", 0)->setComment("Item from L1 Tau collection used for seeding. From 0 to 11");
91  aDesc.add<double>("UseTowersInCone", 0.8)->setComment("Radius of cone around seed");
92  aDesc.add<double>("minimumE", 0.8)->setComment("Minimum tower energy");
93  aDesc.add<double>("minimumEt", 0.5)->setComment("Minimum tower ET");
94  aDesc.add<int>("BX", 0)->setComment("Set bunch crossing; 0 = in time, -1 = previous, 1 = following");
95  aDesc.addUntracked<int>("verbose", 0)->setComment("Verbosity level; 0=silent");
96 
97  desc.add("CaloTowerFromL1TCreatorForTauHLT", aDesc);
98  desc.setComment("Produce tower collection around L1 particle seed.");
99 }
edm::StreamID
Definition: StreamID.h:30
Handle.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MessageLogger.h
CaloTowerFromL1TCreatorForTauHLT::mCone
const double mCone
use only towers in cone mCone around L1 candidate for regional jet reco
Definition: CaloTowerFromL1TCreatorForTauHLT.h:51
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
math::PtEtaPhiELorentzVector
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:27
edm::SortedCollection< CaloTower >
CaloTowerFromL1TCreatorForTauHLT::mtowers_token
const edm::EDGetTokenT< CaloTowerCollection > mtowers_token
label of source collection
Definition: CaloTowerFromL1TCreatorForTauHLT.h:49
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CaloTowerFromL1TCreatorForTauHLT::mTauId
const int mTauId
Definition: CaloTowerFromL1TCreatorForTauHLT.h:61
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
CaloTowerFromL1TCreatorForTauHLT::mEtThreshold
const double mEtThreshold
imitator of L1 seeds
Definition: CaloTowerFromL1TCreatorForTauHLT.h:57
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
BXVector::begin
const_iterator begin(int bx) const
CaloTowerFromL1TCreatorForTauHLT.h
CaloTowerFromL1TCreatorForTauHLT::~CaloTowerFromL1TCreatorForTauHLT
~CaloTowerFromL1TCreatorForTauHLT() override
destructor
Definition: CaloTowerFromL1TCreatorForTauHLT.cc:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
CaloTowerFromL1TCreatorForTauHLT::CaloTowerFromL1TCreatorForTauHLT
CaloTowerFromL1TCreatorForTauHLT(const edm::ParameterSet &)
constructor from parameter set
Definition: CaloTowerFromL1TCreatorForTauHLT.cc:20
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15161
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
BXVector::end
const_iterator end(int bx) const
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Event.h
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
eleHcalExtractorBlocks_cff.caloTowers
caloTowers
Definition: eleHcalExtractorBlocks_cff.py:15
l1t
delete x;
Definition: CaloConfig.h:22
CaloTowerFromL1TCreatorForTauHLT::produce
void produce(edm::StreamID sid, edm::Event &evt, const edm::EventSetup &stp) const override
process one event
Definition: CaloTowerFromL1TCreatorForTauHLT.cc:34
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
CaloTowerFromL1TCreatorForTauHLT::mBX
const int mBX
bunch crossing
Definition: CaloTowerFromL1TCreatorForTauHLT.h:45
l1t::TauBxCollection
BXVector< Tau > TauBxCollection
Definition: Tau.h:10
CaloTowerFromL1TCreatorForTauHLT::mEThreshold
const double mEThreshold
E threshold.
Definition: CaloTowerFromL1TCreatorForTauHLT.h:59
createfilelist.int
int
Definition: createfilelist.py:10
CaloTower
Definition: CaloTower.h:26
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
CaloTower::et
double et(double vtxZ) const
Definition: CaloTower.h:150
edm::EventSetup
Definition: EventSetup.h:58
CaloTowerFromL1TCreatorForTauHLT::mTauTrigger_token
const edm::EDGetTokenT< l1t::TauBxCollection > mTauTrigger_token
label of tau trigger type analysis
Definition: CaloTowerFromL1TCreatorForTauHLT.h:53
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
CaloTowerFromL1TCreatorForTauHLT::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &desc)
Definition: CaloTowerFromL1TCreatorForTauHLT.cc:85
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
CaloTowerFromL1TCreatorForTauHLT::mVerbose
const int mVerbose
verbosity
Definition: CaloTowerFromL1TCreatorForTauHLT.h:47
ParameterSet.h
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
RecoCaloTowerCandidate.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
cmsswSequenceInfo.stp
stp
Definition: cmsswSequenceInfo.py:18