CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1FastTrackingJetProducer Class Reference
Inheritance diagram for L1FastTrackingJetProducer:
edm::stream::EDProducer<>

Public Types

typedef std::vector< L1TTTrackTypeL1TTTrackCollectionType
 
typedef TTTrack< Ref_Phase2TrackerDigi_L1TTTrackType
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 L1FastTrackingJetProducer (const edm::ParameterSet &)
 
 ~L1FastTrackingJetProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const double coneSize_
 
const double deltaZ0Cut_
 
const bool displaced_
 
const bool doTightChi2_
 
const edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > genToken_
 
edm::EDGetTokenT< std::vector< l1t::Vertex > > pvToken_
 
bool selectTrkMatchGenLoose_
 
bool selectTrkMatchGenOrPU_
 
bool selectTrkMatchGenTight_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtGeomToken_
 
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
 
const double trkBendChi2Max_
 
const float trkChi2dofMax_
 
const float trkChi2dofTightChi2_
 
const float trkEtaMax_
 
const int trkNPSStubMin_
 
const int trkNStubMin_
 
const float trkPtMin_
 
const float trkPtTightChi2_
 
const float trkZMax_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Detailed Description

Definition at line 56 of file L1FastTrackingJetProducer.cc.

Member Typedef Documentation

◆ L1TTTrackCollectionType

Definition at line 59 of file L1FastTrackingJetProducer.cc.

◆ L1TTTrackType

Definition at line 58 of file L1FastTrackingJetProducer.cc.

Constructor & Destructor Documentation

◆ L1FastTrackingJetProducer()

L1FastTrackingJetProducer::L1FastTrackingJetProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 97 of file L1FastTrackingJetProducer.cc.

References displaced_.

98  : trkZMax_((float)iConfig.getParameter<double>("trk_zMax")),
99  trkChi2dofMax_((float)iConfig.getParameter<double>("trk_chi2dofMax")),
100  trkBendChi2Max_(iConfig.getParameter<double>("trk_bendChi2Max")),
101  trkPtMin_((float)iConfig.getParameter<double>("trk_ptMin")),
102  trkEtaMax_((float)iConfig.getParameter<double>("trk_etaMax")),
103  trkNStubMin_((int)iConfig.getParameter<int>("trk_nStubMin")),
104  trkNPSStubMin_((int)iConfig.getParameter<int>("trk_nPSStubMin")),
105  deltaZ0Cut_((float)iConfig.getParameter<double>("deltaZ0Cut")),
106  coneSize_((float)iConfig.getParameter<double>("coneSize")),
107  doTightChi2_(iConfig.getParameter<bool>("doTightChi2")),
108  trkPtTightChi2_((float)iConfig.getParameter<double>("trk_ptTightChi2")),
109  trkChi2dofTightChi2_((float)iConfig.getParameter<double>("trk_chi2dofTightChi2")),
110  displaced_(iConfig.getParameter<bool>("displaced")),
111  selectTrkMatchGenTight_(iConfig.getParameter<bool>("selectTrkMatchGenTight")),
112  selectTrkMatchGenLoose_(iConfig.getParameter<bool>("selectTrkMatchGenLoose")),
113  selectTrkMatchGenOrPU_(iConfig.getParameter<bool>("selectTrkMatchGenOrPU")),
115  iConfig.getParameter<edm::InputTag>("L1TrackInputTag"))),
116  pvToken_(consumes<std::vector<l1t::Vertex>>(iConfig.getParameter<edm::InputTag>("L1PrimaryVertexTag"))),
117  genToken_(
119  tTopoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>(edm::ESInputTag("", ""))),
120  tGeomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>(edm::ESInputTag("", ""))) {
121  if (displaced_)
122  produces<TkJetCollection>("L1FastTrackingJetsExtended");
123  else
124  produces<TkJetCollection>("L1FastTrackingJets");
125 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > genToken_
edm::EDGetTokenT< std::vector< l1t::Vertex > > pvToken_
Stores association of Truth Particles (TP) to L1 Track-Trigger Tracks.
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29

◆ ~L1FastTrackingJetProducer()

L1FastTrackingJetProducer::~L1FastTrackingJetProducer ( )
override

Definition at line 128 of file L1FastTrackingJetProducer.cc.

128 {}

Member Function Documentation

◆ beginJob()

void L1FastTrackingJetProducer::beginJob ( void  )
privatevirtual

Definition at line 251 of file L1FastTrackingJetProducer.cc.

251 {}

◆ endJob()

void L1FastTrackingJetProducer::endJob ( void  )
privatevirtual

Definition at line 253 of file L1FastTrackingJetProducer.cc.

253 {}

◆ fillDescriptions()

void L1FastTrackingJetProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 255 of file L1FastTrackingJetProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_2022v15_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

255  {
256  {
257  // L1FastTrackingJets
259  desc.add<edm::InputTag>("L1TrackInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"));
260  desc.add<std::string>("L1PrimaryVertexTag", "l1vertices");
261  desc.add<edm::InputTag>("GenInfo", edm::InputTag("TTTrackAssociatorFromPixelDigis", "Level1TTTracks"));
262  desc.add<double>("trk_zMax", 15.0);
263  desc.add<double>("trk_chi2dofMax", 10.0);
264  desc.add<double>("trk_bendChi2Max", 2.2);
265  desc.add<double>("trk_ptMin", 2.0);
266  desc.add<double>("trk_etaMax", 2.5);
267  desc.add<int>("trk_nStubMin", 4);
268  desc.add<int>("trk_nPSStubMin", -1);
269  desc.add<double>("deltaZ0Cut", 0.5);
270  desc.add<bool>("doTightChi2", true);
271  desc.add<double>("trk_ptTightChi2", 20.0);
272  desc.add<double>("trk_chi2dofTightChi2", 5.0);
273  desc.add<double>("coneSize", 0.4);
274  desc.add<bool>("displaced", false);
275  desc.add<bool>("selectTrkMatchGenTight", true);
276  desc.add<bool>("selectTrkMatchGenLoose", false);
277  desc.add<bool>("selectTrkMatchGenOrPU", false);
278  descriptions.add("L1FastTrackingJets", desc);
279  // or use the following to generate the label from the module's C++ type
280  //descriptions.addWithDefaultLabel(desc);
281  }
282  /*{
283  // L1FastTrackingJetsExtended
284  desc.add<double>("trk_bendChi2Max", 2.4);
285  desc.add<double>("trk_ptMin", 3.0);
286  desc.add<double>("trk_etaMax", 2.5);
287  desc.add<int>("trk_nStubMin", 4);
288  desc.add<int>("trk_nPSStubMin", -1);
289  desc.add<double>("deltaZ0Cut", 3.0);
290  desc.add<bool>("doTightChi2", true);
291  desc.add<double>("trk_ptTightChi2", 20.0);
292  desc.add<double>("trk_chi2dofTightChi2", 5.0);
293  desc.add<double>("coneSize", 0.4);
294  desc.add<bool>("displaced", true);
295  desc.add<bool>("selectTrkMatchGenTight", true);
296  desc.add<bool>("selectTrkMatchGenLoose", false);
297  desc.add<bool>("selectTrkMatchGenOrPU", false);
298  descriptions.add("L1FastTrackingJetsExtended", desc);
299  // or use the following to generate the label from the module's C++ type
300  //descriptions.addWithDefaultLabel(desc);
301  }*/
302 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void L1FastTrackingJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 131 of file L1FastTrackingJetProducer.cc.

References funct::abs(), coneSize_, callgraph::cs, deltaZ0Cut_, displaced_, doTightChi2_, genToken_, edm::EventSetup::getData(), mps_fire::i, iEvent, createfilelist::int, TTTrack< T >::momentum(), eostools::move(), PV3DBase< T, PVType, FrameType >::perp(), pvToken_, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, selectTrkMatchGenLoose_, selectTrkMatchGenOrPU_, selectTrkMatchGenTight_, StripSubdetector::TID, TrackerTopology::tidRing(), StripSubdetector::TOB, TrackerTopology::tobLayer(), align::Tracker, trackToken_, trkBendChi2Max_, trkChi2dofMax_, trkChi2dofTightChi2_, trkEtaMax_, trkNPSStubMin_, trkNStubMin_, trkPtMin_, trkPtTightChi2_, trkZMax_, tTopoToken_, and TTTrack< T >::z0().

131  {
132  std::unique_ptr<TkJetCollection> L1FastTrackingJets(new TkJetCollection);
133 
134  // L1 tracks
136  iEvent.getByToken(trackToken_, TTTrackHandle);
137  std::vector<TTTrack<Ref_Phase2TrackerDigi_>>::const_iterator iterL1Track;
138 
139  // Gen
141  if (!iEvent.isRealData())
142  iEvent.getByToken(genToken_, MCTrkAssociation);
143 
144  // Tracker Topology
145  const TrackerTopology& tTopo = iSetup.getData(tTopoToken_);
146  //const TrackerGeometry& tGeom = iSetup.getData(tGeomToken_);
147 
148  edm::Handle<std::vector<l1t::Vertex>> L1VertexHandle;
149  iEvent.getByToken(pvToken_, L1VertexHandle);
150 
151  fastjet::JetDefinition jet_def(fastjet::antikt_algorithm, coneSize_);
152  std::vector<fastjet::PseudoJet> JetInputs;
153 
154  float recoVtx = L1VertexHandle->begin()->z0();
155  unsigned int this_l1track = 0;
156  for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
157  this_l1track++;
158  float trk_pt = iterL1Track->momentum().perp();
159  float trk_z0 = iterL1Track->z0();
160  float trk_chi2dof = iterL1Track->chi2Red();
161  float trk_bendchi2 = iterL1Track->stubPtConsistency();
162  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
163  theStubs = iterL1Track->getStubRefs();
164  int trk_nstub = (int)theStubs.size();
165 
166  if (std::abs(trk_z0) > trkZMax_)
167  continue;
168  if (std::abs(iterL1Track->momentum().eta()) > trkEtaMax_)
169  continue;
170  if (trk_pt < trkPtMin_)
171  continue;
172  if (trk_nstub < trkNStubMin_)
173  continue;
174  if (trk_chi2dof > trkChi2dofMax_)
175  continue;
176  if (trk_bendchi2 > trkBendChi2Max_)
177  continue;
178  if (doTightChi2_ && (trk_pt > trkPtTightChi2_ && trk_chi2dof > trkChi2dofTightChi2_))
179  continue;
180 
181  int trk_nPS = 0;
182  for (int istub = 0; istub < trk_nstub; istub++) {
183  DetId detId(theStubs.at(istub)->getDetId());
184  bool tmp_isPS = false;
185  if (detId.det() == DetId::Detector::Tracker) {
186  if (detId.subdetId() == StripSubdetector::TOB && tTopo.tobLayer(detId) <= 3)
187  tmp_isPS = true;
188  else if (detId.subdetId() == StripSubdetector::TID && tTopo.tidRing(detId) <= 9)
189  tmp_isPS = true;
190  }
191  if (tmp_isPS)
192  trk_nPS++;
193  }
194  if (trk_nPS < trkNPSStubMin_)
195  continue;
196  if (std::abs(recoVtx - trk_z0) > deltaZ0Cut_)
197  continue;
198  if (!iEvent.isRealData()) {
199  edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_>> trk_ptr(TTTrackHandle, this_l1track);
200 
201  if (!(MCTrkAssociation->isGenuine(trk_ptr)) && selectTrkMatchGenTight_)
202  continue;
203  if (!(MCTrkAssociation->isLooselyGenuine(trk_ptr) || MCTrkAssociation->isGenuine(trk_ptr)) &&
205  continue;
206  if (!(MCTrkAssociation->isLooselyGenuine(trk_ptr) || MCTrkAssociation->isGenuine(trk_ptr) ||
207  MCTrkAssociation->isCombinatoric(trk_ptr)) &&
209  continue;
210  }
211 
212  fastjet::PseudoJet psuedoJet(iterL1Track->momentum().x(),
213  iterL1Track->momentum().y(),
214  iterL1Track->momentum().z(),
215  iterL1Track->momentum().mag());
216  JetInputs.push_back(psuedoJet); // input tracks for clustering
217  JetInputs.back().set_user_index(this_l1track - 1); // save track index in the collection
218  } // end loop over tracks
219 
220  fastjet::ClusterSequence cs(JetInputs, jet_def); // define the output jet collection
221  std::vector<fastjet::PseudoJet> JetOutputs =
222  fastjet::sorted_by_pt(cs.inclusive_jets(0)); // output jet collection, pT-ordered
223 
224  for (unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
226  JetOutputs[ijet].px(), JetOutputs[ijet].py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
227  float sumpt = 0;
228  float avgZ = 0;
229  std::vector<edm::Ptr<L1TTTrackType>> L1TrackPtrs;
230  std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(cs.constituents(JetOutputs[ijet]));
231 
232  for (unsigned int i = 0; i < fjConstituents.size(); ++i) {
233  auto index = fjConstituents[i].user_index();
234  edm::Ptr<L1TTTrackType> trkPtr(TTTrackHandle, index);
235  L1TrackPtrs.push_back(trkPtr); // L1Tracks in the jet
236  sumpt = sumpt + trkPtr->momentum().perp();
237  avgZ = avgZ + trkPtr->momentum().perp() * trkPtr->z0();
238  }
239  avgZ = avgZ / sumpt;
241  TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
242  L1FastTrackingJets->push_back(trkJet);
243  } //end loop over Jet Outputs
244 
245  if (displaced_)
246  iEvent.put(std::move(L1FastTrackingJets), "L1FastTrackingJetsExtended");
247  else
248  iEvent.put(std::move(L1FastTrackingJets), "L1FastTrackingJets");
249 }
unsigned int tobLayer(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > genToken_
edm::EDGetTokenT< std::vector< l1t::Vertex > > pvToken_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:224
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool getData(T &iHolder) const
Definition: EventSetup.h:122
static constexpr auto TOB
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
Definition: DetId.h:17
unsigned int tidRing(const DetId &id) const
std::vector< TkJet > TkJetCollection
Definition: TkJetFwd.h:20
static constexpr auto TID
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ coneSize_

const double L1FastTrackingJetProducer::coneSize_
private

Definition at line 80 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ deltaZ0Cut_

const double L1FastTrackingJetProducer::deltaZ0Cut_
private

Definition at line 79 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ displaced_

const bool L1FastTrackingJetProducer::displaced_
private

Definition at line 84 of file L1FastTrackingJetProducer.cc.

Referenced by L1FastTrackingJetProducer(), and produce().

◆ doTightChi2_

const bool L1FastTrackingJetProducer::doTightChi2_
private

Definition at line 81 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ genToken_

const edm::EDGetTokenT<TTTrackAssociationMap<Ref_Phase2TrackerDigi_> > L1FastTrackingJetProducer::genToken_
private

Definition at line 91 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ pvToken_

edm::EDGetTokenT<std::vector<l1t::Vertex> > L1FastTrackingJetProducer::pvToken_
private

Definition at line 90 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ selectTrkMatchGenLoose_

bool L1FastTrackingJetProducer::selectTrkMatchGenLoose_
private

Definition at line 86 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ selectTrkMatchGenOrPU_

bool L1FastTrackingJetProducer::selectTrkMatchGenOrPU_
private

Definition at line 87 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ selectTrkMatchGenTight_

bool L1FastTrackingJetProducer::selectTrkMatchGenTight_
private

Definition at line 85 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ tGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> L1FastTrackingJetProducer::tGeomToken_
private

Definition at line 93 of file L1FastTrackingJetProducer.cc.

◆ trackToken_

const edm::EDGetTokenT<std::vector<TTTrack<Ref_Phase2TrackerDigi_> > > L1FastTrackingJetProducer::trackToken_
private

Definition at line 89 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkBendChi2Max_

const double L1FastTrackingJetProducer::trkBendChi2Max_
private

Definition at line 74 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkChi2dofMax_

const float L1FastTrackingJetProducer::trkChi2dofMax_
private

Definition at line 73 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkChi2dofTightChi2_

const float L1FastTrackingJetProducer::trkChi2dofTightChi2_
private

Definition at line 83 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkEtaMax_

const float L1FastTrackingJetProducer::trkEtaMax_
private

Definition at line 76 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkNPSStubMin_

const int L1FastTrackingJetProducer::trkNPSStubMin_
private

Definition at line 78 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkNStubMin_

const int L1FastTrackingJetProducer::trkNStubMin_
private

Definition at line 77 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkPtMin_

const float L1FastTrackingJetProducer::trkPtMin_
private

Definition at line 75 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkPtTightChi2_

const float L1FastTrackingJetProducer::trkPtTightChi2_
private

Definition at line 82 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ trkZMax_

const float L1FastTrackingJetProducer::trkZMax_
private

Definition at line 72 of file L1FastTrackingJetProducer.cc.

Referenced by produce().

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> L1FastTrackingJetProducer::tTopoToken_
private

Definition at line 92 of file L1FastTrackingJetProducer.cc.

Referenced by produce().