36 srcTag_ (iConfig.getParameter<
edm::
InputTag>(
"Src")),
38 previousCandTag_(iConfig.getParameter<
edm::
InputTag>(
"PreviousCandTag")),
40 maxEta_ (iConfig.getParameter<double>(
"MaxEta")),
41 minPt_ (iConfig.getParameter<double>(
"MinPt")),
42 minPtPair_ (iConfig.getParameter<double>(
"MinPtPair")),
43 minInvMass_ (iConfig.getParameter<double>(
"MinInvMass")),
44 maxInvMass_ (iConfig.getParameter<double>(
"MaxInvMass")),
45 massParticle1_ (iConfig.getParameter<double>(
"massParticle1")),
46 massParticle2_ (iConfig.getParameter<double>(
"massParticle2")),
47 chargeOpt_ (iConfig.getParameter<
int>(
"ChargeOpt")),
48 triggerTypeDaughters_(iConfig.getParameter<
int>(
"triggerTypeDaughters"))
51 produces<VertexCollection>();
62 desc.
add<
double>(
"MaxEta",2.5);
63 desc.
add<
double>(
"MinPt",0.0);
64 desc.
add<
double>(
"MinPtPair",0.0);
65 desc.
add<
double>(
"MinInvMass",1.0);
66 desc.
add<
double>(
"MaxInvMass",20.0);
67 desc.
add<
double>(
"massParticle1",0.1396);
68 desc.
add<
double>(
"massParticle2",0.4937);
69 desc.
add<
int>(
"ChargeOpt",-1);
70 desc.
add<
int>(
"triggerTypeDaughters",0);
72 descriptions.
add(
"hltDisplacedtktkVtxProducer", desc);
91 double const firstTrackMass2 = firstTrackMass*firstTrackMass;
93 double const secondTrackMass2 = secondTrackMass*secondTrackMass;
109 RecoChargedCandidateCollection::const_iterator cand1;
110 RecoChargedCandidateCollection::const_iterator cand2;
116 vector<RecoChargedCandidateRef> vPrevCands;
119 for (cand1=trackcands->begin(); cand1!=trackcands->end(); cand1++) {
121 LogDebug(
"HLTDisplacedtktkVtxProducer") <<
" 1st track in loop: q*pt= " << cand1->charge()*cand1->pt() <<
", eta= " << cand1->eta() <<
", hits= " << tk1->numberOfValidHits();
128 if (cand1->pt() <
minPt_)
continue;
131 cand2=trackcands->begin();
134 for (; cand2!=trackcands->end(); cand2++) {
137 if(tk1==tk2)
continue;
140 LogDebug(
"HLTDisplacedtktkVtxProducer") <<
" 2nd track in loop: q*pt= " << cand2->charge()*cand2->pt() <<
", eta= " << cand2->eta() <<
", hits= " << tk2->numberOfValidHits() <<
", d0= " << tk2->d0();
146 if (cand2->pt() <
minPt_)
continue;
150 if (cand1->charge()*cand2->charge()>0)
continue;
152 if (cand1->charge()*cand2->charge()<0)
continue;
156 e1 =
sqrt(cand1->momentum().Mag2()+firstTrackMass2);
157 e2 =
sqrt(cand2->momentum().Mag2()+secondTrackMass2);
165 double invmass =
abs(p.mass());
166 LogDebug(
"HLTDisplacedtktkVtxProducer") <<
" ... 1-2 invmass= " << invmass;
172 vector<TransientTrack> t_tks;
175 t_tks.push_back(ttkp1);
176 t_tks.push_back(ttkp2);
179 if (t_tks.size()!=2)
continue;
189 vertexCollection->push_back(vertex);
199 for (
auto &
i : refVect) {
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
~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
collection of Vertex objects
bool checkPreviousCand(const reco::TrackRef &trackref, std::vector< reco::RecoChargedCandidateRef > &ref2)
const double massParticle2_
Abs< T >::type abs(const T &t)
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
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_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
math::PtEtaPhiELorentzVectorF LorentzVector