178 auto trackCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
181 std::vector<reco::TrackRef> pixelTrackRefs;
183 for (
unsigned int iPix = 0; iPix <
toks_pix_.size(); iPix++) {
185 for (reco::TrackCollection::const_iterator pit = iPixCol->begin(); pit != iPixCol->end(); pit++) {
186 pixelTrackRefs.push_back(
reco::TrackRef(iPixCol, pit - iPixCol->begin()));
194 double ptTriggered = -10;
195 double etaTriggered = -100;
196 double phiTriggered = -100;
200 std::vector<edm::Ref<l1t::TauBxCollection> > l1tauobjref;
201 std::vector<edm::Ref<l1t::JetBxCollection> > l1jetobjref;
208 for (
const auto&
p : l1tauobjref) {
209 if (
p->pt() > ptTriggered) {
210 ptTriggered =
p->pt();
211 phiTriggered =
p->phi();
212 etaTriggered =
p->eta();
215 for (
const auto&
p : l1jetobjref) {
216 if (
p->pt() > ptTriggered) {
217 ptTriggered =
p->pt();
218 phiTriggered =
p->phi();
219 etaTriggered =
p->eta();
223 edm::LogVerbatim(
"IsoTrack") <<
"Sizes " << l1tauobjref.size() <<
":" << l1jetobjref.size() <<
" Trig " << ptTriggered
224 <<
":" << etaTriggered <<
":" << phiTriggered;
228 std::vector<seedAtEC> VecSeedsatEC;
230 for (
unsigned iS = 0; iS < pixelTrackRefs.size(); iS++) {
231 bool vtxMatch =
false;
233 reco::VertexCollection::const_iterator vitSel;
236 for (reco::VertexCollection::const_iterator vit = pVert->begin(); vit != pVert->end(); vit++) {
237 if (
std::abs(pixelTrackRefs[iS]->
dz(vit->position())) < minDZ) {
238 minDZ =
std::abs(pixelTrackRefs[iS]->
dz(vit->position()));
254 double R =
reco::deltaR(etaTriggered, phiTriggered, pixelTrackRefs[iS]->
eta(), pixelTrackRefs[iS]->
phi());
267 pixelTrackRefs[iS]->momentum().
phi(),
268 tj->momentum().eta(),
269 tj->momentum().phi()) > drMaxL1Track_)
278 std::pair<double, double> seedCooAtEC;
282 pixelTrackRefs[iS]->
phi(),
283 pixelTrackRefs[iS]->
pt(),
284 pixelTrackRefs[iS]->
charge(),
289 pixelTrackRefs[iS]->
phi(),
290 pixelTrackRefs[iS]->
pt(),
291 pixelTrackRefs[iS]->
charge(),
293 seedAtEC
seed(iS, (tmatch || vtxMatch), seedCooAtEC.first, seedCooAtEC.second);
294 VecSeedsatEC.push_back(
seed);
296 edm::LogVerbatim(
"IsoTrack") <<
"Seed " << seedCooAtEC.first << seedCooAtEC.second;
299 for (
unsigned int i = 0;
i < VecSeedsatEC.size();
i++) {
300 unsigned int iSeed = VecSeedsatEC[
i].index;
301 if (!VecSeedsatEC[
i].
ok)
308 pixelTrackRefs[iSeed]->momentum().
phi(),
309 tj->momentum().eta(),
310 tj->momentum().phi()) > drMaxL1Track_)
316 for (
unsigned int j = 0;
j < VecSeedsatEC.size();
j++) {
319 unsigned int iSurr = VecSeedsatEC[
j].index;
322 pixelTrackRefs[iSeed]->
phi(),
323 pixelTrackRefs[iSurr]->
eta(),
328 reco::VertexCollection::const_iterator vitSel2;
329 for (reco::VertexCollection::const_iterator vit = pVert->begin(); vit != pVert->end(); vit++) {
330 if (
std::abs(pixelTrackRefs[iSurr]->
dz(vit->position())) < minDZ2) {
331 minDZ2 =
std::abs(pixelTrackRefs[iSurr]->
dz(vit->position()));
342 sumP += pixelTrackRefs[iSurr]->p();
343 if (pixelTrackRefs[iSurr]->
p() >
maxP)
344 maxP = pixelTrackRefs[iSurr]->p();
350 newCandidate.setEtaPhiEcal(VecSeedsatEC[
i].
eta, VecSeedsatEC[
i].
phi);
Log< level::Info, true > LogVerbatim
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
const double maxPForIsolationValue_
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
const double pixelIsolationConeSizeAtEC_
const double minPTrackValue_
const edm::EDGetTokenT< reco::VertexCollection > tok_vert_
const_iterator begin(int bx) const
std::vector< T >::const_iterator const_iterator
const edm::EDGetTokenT< l1t::TauBxCollection > tok_l1_
const std::vector< edm::EDGetTokenT< reco::TrackCollection > > toks_pix_
const double tauUnbiasCone_
Abs< T >::type abs(const T &t)
std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const double tauAssocCone_
const_iterator end(int bx) const
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_