CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TrackFastJetProducer Class Reference
Inheritance diagram for L1TrackFastJetProducer:
edm::stream::EDProducer<>

Public Types

typedef std::vector
< L1TTTrackType
L1TTTrackCollectionType
 
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

 L1TrackFastJetProducer (const edm::ParameterSet &)
 
 ~L1TrackFastJetProducer () 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

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

Private Attributes

double coneSize_
 
double deltaZ0Cut_
 
bool displaced_
 
bool doTightChi2_
 
edm::EDGetTokenT
< TkPrimaryVertexCollection
pvToken_
 
const edm::EDGetTokenT
< std::vector< TTTrack
< Ref_Phase2TrackerDigi_ > > > 
trackToken_
 
double trkBendChi2Max_
 
float trkChi2dofMax_
 
float trkChi2dofTightChi2_
 
float trkEtaMax_
 
int trkNPSStubMin_
 
int trkNStubMin_
 
float trkPtMin_
 
float trkPtTightChi2_
 
float trkZMax_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 

Detailed Description

Definition at line 52 of file L1TrackFastJetProducer.cc.

Member Typedef Documentation

Definition at line 55 of file L1TrackFastJetProducer.cc.

Definition at line 54 of file L1TrackFastJetProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 88 of file L1TrackFastJetProducer.cc.

References coneSize_, deltaZ0Cut_, displaced_, doTightChi2_, edm::ParameterSet::getParameter(), trkBendChi2Max_, trkChi2dofMax_, trkChi2dofTightChi2_, trkEtaMax_, trkNPSStubMin_, trkNStubMin_, trkPtMin_, trkPtTightChi2_, and trkZMax_.

90  iConfig.getParameter<edm::InputTag>("L1TrackInputTag"))),
91  pvToken_(consumes<TkPrimaryVertexCollection>(iConfig.getParameter<edm::InputTag>("L1PrimaryVertexTag"))),
92  tTopoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>(edm::ESInputTag("", ""))) {
93  trkZMax_ = (float)iConfig.getParameter<double>("trk_zMax");
94  trkChi2dofMax_ = (float)iConfig.getParameter<double>("trk_chi2dofMax");
95  trkBendChi2Max_ = iConfig.getParameter<double>("trk_bendChi2Max");
96  trkPtMin_ = (float)iConfig.getParameter<double>("trk_ptMin");
97  trkEtaMax_ = (float)iConfig.getParameter<double>("trk_etaMax");
98  trkNStubMin_ = (int)iConfig.getParameter<int>("trk_nStubMin");
99  trkNPSStubMin_ = (int)iConfig.getParameter<int>("trk_nPSStubMin");
100  deltaZ0Cut_ = (float)iConfig.getParameter<double>("deltaZ0Cut");
101  coneSize_ = (float)iConfig.getParameter<double>("coneSize");
102  doTightChi2_ = iConfig.getParameter<bool>("doTightChi2");
103  trkPtTightChi2_ = (float)iConfig.getParameter<double>("trk_ptTightChi2");
104  trkChi2dofTightChi2_ = (float)iConfig.getParameter<double>("trk_chi2dofTightChi2");
105  displaced_ = iConfig.getParameter<bool>("displaced");
106  if (displaced_)
107  produces<TkJetCollection>("L1TrackFastJetsExtended");
108  else
109  produces<TkJetCollection>("L1TrackFastJets");
110 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< TkPrimaryVertexCollection > pvToken_
L1TrackFastJetProducer::~L1TrackFastJetProducer ( )
override

Definition at line 113 of file L1TrackFastJetProducer.cc.

113 {}

Member Function Documentation

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

Definition at line 221 of file L1TrackFastJetProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and edm::ParameterSetDescription::setUnknown().

221  {
222  //The following says we do not know what parameters are allowed so do no validation
223  // Please change this to state exactly what you do use, even if it is no parameters
225  desc.setUnknown();
226  descriptions.addDefault(desc);
227 }
void addDefault(ParameterSetDescription const &psetDescription)
void L1TrackFastJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 116 of file L1TrackFastJetProducer.cc.

References coneSize_, fwrapper::cs, deltaZ0Cut_, displaced_, doTightChi2_, edm::Event::getByToken(), edm::EventSetup::getData(), mps_fire::i, fwrapper::jet_def, L1TrackFastJetProducer_cfi::L1TrackFastJets, eostools::move(), edm::Event::put(), pvToken_, StripSubdetector::TID, TrackerTopology::tidRing(), StripSubdetector::TOB, TrackerTopology::tobLayer(), align::Tracker, trackToken_, trkBendChi2Max_, trkChi2dofMax_, trkChi2dofTightChi2_, trkEtaMax_, trkNPSStubMin_, trkNStubMin_, trkPtMin_, trkPtTightChi2_, trkZMax_, and tTopoToken_.

116  {
117  std::unique_ptr<TkJetCollection> L1TrackFastJets(new TkJetCollection);
118 
119  // L1 tracks
121  iEvent.getByToken(trackToken_, TTTrackHandle);
122  std::vector<TTTrack<Ref_Phase2TrackerDigi_> >::const_iterator iterL1Track;
123 
124  // Tracker Topology
125  const TrackerTopology& tTopo = iSetup.getData(tTopoToken_);
126 
127  edm::Handle<TkPrimaryVertexCollection> TkPrimaryVertexHandle;
128  iEvent.getByToken(pvToken_, TkPrimaryVertexHandle);
129 
130  fastjet::JetDefinition jet_def(fastjet::antikt_algorithm, coneSize_);
131  std::vector<fastjet::PseudoJet> JetInputs;
132 
133  float recoVtx = TkPrimaryVertexHandle->begin()->zvertex();
134  unsigned int this_l1track = 0;
135  for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
136  this_l1track++;
137  float trk_pt = iterL1Track->momentum().perp();
138  float trk_z0 = iterL1Track->z0();
139  float trk_chi2dof = iterL1Track->chi2Red();
140  float trk_bendchi2 = iterL1Track->stubPtConsistency();
141  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
142  theStubs = iterL1Track->getStubRefs();
143  int trk_nstub = (int)theStubs.size();
144 
145  if (fabs(trk_z0) > trkZMax_)
146  continue;
147  if (fabs(iterL1Track->momentum().eta()) > trkEtaMax_)
148  continue;
149  if (trk_pt < trkPtMin_)
150  continue;
151  if (trk_nstub < trkNStubMin_)
152  continue;
153  if (trk_chi2dof > trkChi2dofMax_)
154  continue;
155  if (trk_bendchi2 > trkBendChi2Max_)
156  continue;
157  if (doTightChi2_ && (trk_pt > trkPtTightChi2_ && trk_chi2dof > trkChi2dofTightChi2_))
158  continue;
159 
160  int trk_nPS = 0;
161  for (int istub = 0; istub < trk_nstub; istub++) {
162  DetId detId(theStubs.at(istub)->getDetId());
163  bool tmp_isPS = false;
164  if (detId.det() == DetId::Detector::Tracker) {
165  if (detId.subdetId() == StripSubdetector::TOB && tTopo.tobLayer(detId) <= 3)
166  tmp_isPS = true;
167  else if (detId.subdetId() == StripSubdetector::TID && tTopo.tidRing(detId) <= 9)
168  tmp_isPS = true;
169  }
170  if (tmp_isPS)
171  trk_nPS++;
172  }
173  if (trk_nPS < trkNPSStubMin_)
174  continue;
175  if (fabs(recoVtx - trk_z0) > deltaZ0Cut_)
176  continue;
177 
178  fastjet::PseudoJet psuedoJet(iterL1Track->momentum().x(),
179  iterL1Track->momentum().y(),
180  iterL1Track->momentum().z(),
181  iterL1Track->momentum().mag());
182  JetInputs.push_back(psuedoJet); // input tracks for clustering
183  JetInputs.back().set_user_index(this_l1track - 1); // save track index in the collection
184  } // end loop over tracks
185 
186  fastjet::ClusterSequence cs(JetInputs, jet_def); // define the output jet collection
187  std::vector<fastjet::PseudoJet> JetOutputs =
188  fastjet::sorted_by_pt(cs.inclusive_jets(0)); // output jet collection, pT-ordered
189 
190  for (unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
192  JetOutputs[ijet].px(), JetOutputs[ijet].py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
193  float sumpt = 0;
194  float avgZ = 0;
195  std::vector<edm::Ptr<L1TTTrackType> > L1TrackPtrs;
196  std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(cs.constituents(JetOutputs[ijet]));
197 
198  for (unsigned int i = 0; i < fjConstituents.size(); ++i) {
199  auto index = fjConstituents[i].user_index();
200  edm::Ptr<L1TTTrackType> trkPtr(TTTrackHandle, index);
201  L1TrackPtrs.push_back(trkPtr); // L1Tracks in the jet
202  sumpt = sumpt + trkPtr->momentum().perp();
203  avgZ = avgZ + trkPtr->momentum().perp() * trkPtr->z0();
204  }
205  avgZ = avgZ / sumpt;
207  TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
208  L1TrackFastJets->push_back(trkJet);
209  } //end loop over Jet Outputs
210 
211  if (displaced_)
212  iEvent.put(std::move(L1TrackFastJets), "L1TrackFastJetsExtended");
213  else
214  iEvent.put(std::move(L1TrackFastJets), "L1TrackFastJets");
215 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
unsigned int tidRing(const DetId &id) const
JetDefinition jet_def
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
unique_ptr< ClusterSequence > cs
bool getData(T &iHolder) const
Definition: EventSetup.h:128
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
def move
Definition: eostools.py:511
static constexpr auto TOB
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
Definition: DetId.h:17
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
std::vector< TkJet > TkJetCollection
Definition: TkJetFwd.h:20
edm::EDGetTokenT< TkPrimaryVertexCollection > pvToken_
static constexpr auto TID
unsigned int tobLayer(const DetId &id) const

Member Data Documentation

double L1TrackFastJetProducer::coneSize_
private

Definition at line 76 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

double L1TrackFastJetProducer::deltaZ0Cut_
private

Definition at line 75 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

bool L1TrackFastJetProducer::displaced_
private

Definition at line 80 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

bool L1TrackFastJetProducer::doTightChi2_
private

Definition at line 77 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

edm::EDGetTokenT<TkPrimaryVertexCollection> L1TrackFastJetProducer::pvToken_
private

Definition at line 83 of file L1TrackFastJetProducer.cc.

Referenced by produce().

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

Definition at line 82 of file L1TrackFastJetProducer.cc.

Referenced by produce().

double L1TrackFastJetProducer::trkBendChi2Max_
private

Definition at line 70 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

float L1TrackFastJetProducer::trkChi2dofMax_
private

Definition at line 69 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

float L1TrackFastJetProducer::trkChi2dofTightChi2_
private

Definition at line 79 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

float L1TrackFastJetProducer::trkEtaMax_
private

Definition at line 72 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

int L1TrackFastJetProducer::trkNPSStubMin_
private

Definition at line 74 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

int L1TrackFastJetProducer::trkNStubMin_
private

Definition at line 73 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

float L1TrackFastJetProducer::trkPtMin_
private

Definition at line 71 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

float L1TrackFastJetProducer::trkPtTightChi2_
private

Definition at line 78 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

float L1TrackFastJetProducer::trkZMax_
private

Definition at line 68 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

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

Definition at line 84 of file L1TrackFastJetProducer.cc.

Referenced by produce().