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;
230 std::vector<seedAtEC> VecSeedsatEC;
232 for (
unsigned iS = 0; iS < pixelTrackRefs.size(); iS++) {
233 bool vtxMatch =
false;
235 reco::VertexCollection::const_iterator vitSel;
238 for (reco::VertexCollection::const_iterator vit = pVert->begin(); vit != pVert->end(); vit++) {
239 if (
std::abs(pixelTrackRefs[iS]->
dz(vit->position())) < minDZ) {
240 minDZ =
std::abs(pixelTrackRefs[iS]->
dz(vit->position()));
256 double R =
reco::deltaR(etaTriggered, phiTriggered, pixelTrackRefs[iS]->
eta(), pixelTrackRefs[iS]->
phi());
269 pixelTrackRefs[iS]->momentum().
phi(),
270 tj->momentum().eta(),
271 tj->momentum().phi()) > drMaxL1Track_)
280 std::pair<double, double> seedCooAtEC;
284 pixelTrackRefs[iS]->
phi(),
285 pixelTrackRefs[iS]->
pt(),
286 pixelTrackRefs[iS]->
charge(),
291 pixelTrackRefs[iS]->
phi(),
292 pixelTrackRefs[iS]->
pt(),
293 pixelTrackRefs[iS]->
charge(),
295 seedAtEC
seed(iS, (tmatch || vtxMatch), seedCooAtEC.first, seedCooAtEC.second);
296 VecSeedsatEC.push_back(
seed);
298 edm::LogVerbatim(
"IsoTrack") <<
"Seed " << seedCooAtEC.first << seedCooAtEC.second;
301 for (
unsigned int i = 0;
i < VecSeedsatEC.size();
i++) {
302 unsigned int iSeed = VecSeedsatEC[
i].index;
303 if (!VecSeedsatEC[
i].
ok)
310 pixelTrackRefs[iSeed]->momentum().
phi(),
311 tj->momentum().eta(),
312 tj->momentum().phi()) > drMaxL1Track_)
318 for (
unsigned int j = 0;
j < VecSeedsatEC.size();
j++) {
321 unsigned int iSurr = VecSeedsatEC[
j].index;
324 pixelTrackRefs[iSeed]->
phi(),
325 pixelTrackRefs[iSurr]->
eta(),
330 reco::VertexCollection::const_iterator vitSel2;
331 for (reco::VertexCollection::const_iterator vit = pVert->begin(); vit != pVert->end(); vit++) {
332 if (
std::abs(pixelTrackRefs[iSurr]->
dz(vit->position())) < minDZ2) {
333 minDZ2 =
std::abs(pixelTrackRefs[iSurr]->
dz(vit->position()));
344 sumP += pixelTrackRefs[iSurr]->p();
345 if (pixelTrackRefs[iSurr]->
p() >
maxP)
346 maxP = pixelTrackRefs[iSurr]->p();
352 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_