CMS 3D CMS Logo

CaloTowerFromL1TSeededCreatorForTauHLT.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 + T. Strebler
5 
13 // Math
14 #include "Math/GenVector/VectorUtil.h"
15 #include <cmath>
16 
17 using namespace edm;
18 using namespace reco;
19 using namespace std;
20 
22  : m_verbose(p.getUntrackedParameter<int>("verbose", 0)),
23  m_towers_token(consumes<CaloTowerCollection>(p.getParameter<InputTag>("towers"))),
24  m_cone(p.getParameter<double>("UseTowersInCone")),
25  m_tauTrigger_token(consumes<trigger::TriggerFilterObjectWithRefs>(p.getParameter<InputTag>("TauTrigger"))),
26  m_EtThreshold(p.getParameter<double>("minimumEt")),
27  m_EThreshold(p.getParameter<double>("minimumE")) {
28  produces<CaloTowerCollection>();
29 }
30 
32 
36 
37  double m_cone2 = m_cone * m_cone;
38 
39  // L1 seeds
41  evt.getByToken(m_tauTrigger_token, l1TriggeredTaus);
42 
43  auto cands = std::make_unique<CaloTowerCollection>();
44  cands->reserve(caloTowers->size());
45 
46  l1t::TauVectorRef tauCandRefVec;
47  l1TriggeredTaus->getObjects(trigger::TriggerL1Tau, tauCandRefVec);
48 
49  for (auto const& tauCandRef : tauCandRefVec) {
50  for (auto const& cal : *caloTowers) {
51  bool isAccepted = false;
52  if (m_verbose == 2) {
53  edm::LogInfo("JetDebugInfo") << "CaloTowerFromL1TSeededCreatorForTauHLT::produce-> tower et/eta/phi/e: "
54  << cal.et() << '/' << cal.eta() << '/' << cal.phi() << '/' << cal.energy()
55  << " is...";
56  }
57  if (cal.et() >= m_EtThreshold && cal.energy() >= m_EThreshold) {
58  math::PtEtaPhiELorentzVector p(cal.et(), cal.eta(), cal.phi(), cal.energy());
59  double delta2 = deltaR2((tauCandRef->p4()).Vect(), p);
60  if (delta2 < m_cone2) {
61  isAccepted = true;
62  cands->push_back(cal);
63  }
64  }
65 
66  if (m_verbose == 2) {
67  if (isAccepted)
68  edm::LogInfo("JetDebugInfo") << "accepted \n";
69  else
70  edm::LogInfo("JetDebugInfo") << "rejected \n";
71  }
72  }
73  }
74 
75  evt.put(std::move(cands));
76 }
77 
80 
81  aDesc.add<edm::InputTag>("TauTrigger", edm::InputTag("hltL1sDoubleIsoTau40er"))
82  ->setComment("Name of trigger filter for L1 seeds");
83  aDesc.add<edm::InputTag>("towers", edm::InputTag("towerMaker"))->setComment("Input tower collection");
84  aDesc.add<double>("UseTowersInCone", 0.8)->setComment("Radius of cone around seed");
85  aDesc.add<double>("minimumE", 0.8)->setComment("Minimum tower energy");
86  aDesc.add<double>("minimumEt", 0.5)->setComment("Minimum tower ET");
87  aDesc.addUntracked<int>("verbose", 0)->setComment("Verbosity level; 0=silent");
88 
89  desc.add("CaloTowerFromL1TSeededCreatorForTauHLT", aDesc);
90  desc.setComment("Produce tower collection around L1 particle seed.");
91 }
edm::StreamID
Definition: StreamID.h:30
Handle.h
CaloTowerFromL1TSeededCreatorForTauHLT::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &desc)
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.cc:78
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MessageLogger.h
edm
HLT enums.
Definition: AlignableModifier.h:19
CaloTowerFromL1TSeededCreatorForTauHLT::~CaloTowerFromL1TSeededCreatorForTauHLT
~CaloTowerFromL1TSeededCreatorForTauHLT() override
destructor
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CaloTowerFromL1TSeededCreatorForTauHLT::m_towers_token
const edm::EDGetTokenT< CaloTowerCollection > m_towers_token
label of source collection
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.h:42
math::PtEtaPhiELorentzVector
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:27
edm::SortedCollection< CaloTower >
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:593
CaloTowerFromL1TSeededCreatorForTauHLT::m_verbose
const int m_verbose
verbosity
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.h:40
CaloTowerFromL1TSeededCreatorForTauHLT::CaloTowerFromL1TSeededCreatorForTauHLT
CaloTowerFromL1TSeededCreatorForTauHLT(const edm::ParameterSet &)
constructor from parameter set
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.cc:21
deltaR.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
CaloTowerFromL1TSeededCreatorForTauHLT::m_EtThreshold
const double m_EtThreshold
imitator of L1 seeds
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.h:50
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
eleHcalExtractorBlocks_cff.caloTowers
caloTowers
Definition: eleHcalExtractorBlocks_cff.py:15
trigger::TriggerL1Tau
Definition: TriggerTypeDefs.h:49
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
createfilelist.int
int
Definition: createfilelist.py:10
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
CaloTowerFromL1TSeededCreatorForTauHLT::m_tauTrigger_token
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_tauTrigger_token
label of tau trigger type analysis
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.h:46
edm::EventSetup
Definition: EventSetup.h:57
CaloTowerFromL1TSeededCreatorForTauHLT.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
CaloTowerFromL1TSeededCreatorForTauHLT::m_EThreshold
const double m_EThreshold
E threshold.
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.h:52
HLTMuonOfflineAnalyzer_cfi.deltaR2
deltaR2
Definition: HLTMuonOfflineAnalyzer_cfi.py:105
HLT_2018_cff.cands
cands
Definition: HLT_2018_cff.py:13762
CaloTowerFromL1TSeededCreatorForTauHLT::m_cone
const double m_cone
use only towers in cone mCone around L1 candidate for regional jet reco
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.h:44
l1t::TauVectorRef
std::vector< TauRef > TauVectorRef
Definition: Tau.h:14
trigger
Definition: HLTPrescaleTableCond.h:8
ParameterSet.h
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
RecoCaloTowerCandidate.h
CaloTowerFromL1TSeededCreatorForTauHLT::produce
void produce(edm::StreamID sid, edm::Event &evt, const edm::EventSetup &stp) const override
process one event
Definition: CaloTowerFromL1TSeededCreatorForTauHLT.cc:33
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
cmsswSequenceInfo.stp
stp
Definition: cmsswSequenceInfo.py:18