24 using namespace trigger;
30 srcTag_(iConfig.getParameter<edm::
InputTag>(
"Src")),
32 previousCandTag_(iConfig.getParameter<edm::
InputTag>(
"PreviousCandTag")),
34 maxEta_(iConfig.getParameter<double>(
"MaxEta")),
35 minPt_(iConfig.getParameter<double>(
"MinPt")),
36 minPtPair_(iConfig.getParameter<double>(
"MinPtPair")),
37 minInvMass_(iConfig.getParameter<double>(
"MinInvMass")),
38 maxInvMass_(iConfig.getParameter<double>(
"MaxInvMass")),
39 massParticle1_(iConfig.getParameter<double>(
"massParticle1")),
40 massParticle2_(iConfig.getParameter<double>(
"massParticle2")),
41 chargeOpt_(iConfig.getParameter<int>(
"ChargeOpt")),
42 triggerTypeDaughters_(iConfig.getParameter<int>(
"triggerTypeDaughters")) {
43 produces<VertexCollection>();
52 desc.
add<
double>(
"MaxEta", 2.5);
53 desc.
add<
double>(
"MinPt", 0.0);
54 desc.
add<
double>(
"MinPtPair", 0.0);
55 desc.
add<
double>(
"MinInvMass", 1.0);
56 desc.
add<
double>(
"MaxInvMass", 20.0);
57 desc.
add<
double>(
"massParticle1", 0.1396);
58 desc.
add<
double>(
"massParticle2", 0.4937);
59 desc.
add<
int>(
"ChargeOpt", -1);
60 desc.
add<
int>(
"triggerTypeDaughters", 0);
62 descriptions.
add(
"hltDisplacedtktkVtxProducer", desc);
68 double const firstTrackMass2 = firstTrackMass * firstTrackMass;
70 double const secondTrackMass2 = secondTrackMass * secondTrackMass;
85 RecoChargedCandidateCollection::const_iterator cand1;
86 RecoChargedCandidateCollection::const_iterator cand2;
92 vector<RecoChargedCandidateRef> vPrevCands;
95 std::vector<bool> candComp;
96 for (cand1 = trackcands->begin(); cand1 != trackcands->end(); cand1++)
99 for (cand1 = trackcands->begin(); cand1 != trackcands->end(); cand1++) {
101 LogDebug(
"HLTDisplacedtktkVtxProducer") <<
" 1st track in loop: q*pt= " << cand1->charge() * cand1->pt()
102 <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
105 if (!candComp[cand1 - trackcands->begin()])
115 cand2 = trackcands->begin();
120 for (; cand2 != trackcands->end(); cand2++) {
126 LogDebug(
"HLTDisplacedtktkVtxProducer")
127 <<
" 2nd track in loop: q*pt= " << cand2->charge() * cand2->pt() <<
", eta= " << cand2->eta()
128 <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
130 if (!candComp[cand2 - trackcands->begin()])
142 if (cand1->charge() * cand2->charge() > 0)
145 if (cand1->charge() * cand2->charge() < 0)
150 e1 =
sqrt(cand1->momentum().Mag2() + firstTrackMass2);
151 e2 =
sqrt(cand2->momentum().Mag2() + secondTrackMass2);
159 double invmass =
abs(p.mass());
160 LogDebug(
"HLTDisplacedtktkVtxProducer") <<
" ... 1-2 invmass= " << invmass;
168 vector<TransientTrack> t_tks;
171 t_tks.push_back(ttkp1);
172 t_tks.push_back(ttkp2);
174 if (t_tks.size() != 2)
186 vertexCollection->push_back(vertex);
193 const vector<RecoChargedCandidateRef>& refVect)
const {
195 for (
auto&
i : refVect) {
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
~HLTDisplacedtktkVtxProducer() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const int triggerTypeDaughters_
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< Vertex > VertexCollection
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
const double massParticle2_
Abs< T >::type abs(const T &t)
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const double massParticle1_
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLTDisplacedtktkVtxProducer(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
math::PtEtaPhiELorentzVectorF LorentzVector