CMS 3D CMS Logo

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< L1TTTrackTypeL1TTTrackCollectionType
 
typedef edm::RefVector< L1TTTrackCollectionTypeL1TTTrackRefCollectionType
 
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

const double coneSize_
 
const bool displaced_
 
const EDGetTokenT< L1TTTrackRefCollectionTypetrackToken_
 

Detailed Description

Definition at line 54 of file L1TrackFastJetProducer.cc.

Member Typedef Documentation

◆ L1TTTrackCollectionType

Definition at line 57 of file L1TrackFastJetProducer.cc.

◆ L1TTTrackRefCollectionType

Definition at line 58 of file L1TrackFastJetProducer.cc.

◆ L1TTTrackType

Definition at line 56 of file L1TrackFastJetProducer.cc.

Constructor & Destructor Documentation

◆ L1TrackFastJetProducer()

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

Definition at line 76 of file L1TrackFastJetProducer.cc.

References displaced_.

77  : coneSize_((float)iConfig.getParameter<double>("coneSize")),
78  displaced_(iConfig.getParameter<bool>("displaced")),
79  trackToken_(consumes<L1TTTrackRefCollectionType>(iConfig.getParameter<InputTag>("L1TrackInputTag"))) {
80  if (displaced_)
81  produces<TkJetCollection>("L1TrackFastJetsExtended");
82  else
83  produces<TkJetCollection>("L1TrackFastJets");
84 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const EDGetTokenT< L1TTTrackRefCollectionType > trackToken_

◆ ~L1TrackFastJetProducer()

L1TrackFastJetProducer::~L1TrackFastJetProducer ( )
override

Definition at line 87 of file L1TrackFastJetProducer.cc.

87 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 142 of file L1TrackFastJetProducer.cc.

References submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

142  {
143  //The following says we do not know what parameters are allowed so do no validation
145  desc.add<edm::InputTag>(
146  "L1PVertexInputTag",
147  edm::InputTag("l1tTrackVertexAssociationProducerForJets", "Level1TTTracksSelectedAssociated"));
148  desc.add<double>("coneSize", 0.5);
149  desc.add<bool>("displaced", false);
150 }

◆ produce()

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

Definition at line 90 of file L1TrackFastJetProducer.cc.

References coneSize_, callgraph::cs, displaced_, mps_fire::i, iEvent, PV3DBase< T, PVType, FrameType >::mag(), TTTrack< T >::momentum(), eostools::move(), PV3DBase< T, PVType, FrameType >::perp(), multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, edm::RefVector< C, T, F >::size(), trackToken_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and TTTrack< T >::z0().

90  {
91  std::unique_ptr<TkJetCollection> L1TrackFastJets(new TkJetCollection);
92 
93  // L1 tracks
95  iEvent.getByToken(trackToken_, TTTrackHandle);
96 
97  fastjet::JetDefinition jet_def(fastjet::antikt_algorithm, coneSize_);
98  std::vector<fastjet::PseudoJet> JetInputs;
99 
100  for (unsigned int this_l1track = 0; this_l1track < TTTrackHandle->size(); this_l1track++) {
101  edm::Ptr<L1TTTrackType> iterL1Track(TTTrackHandle, this_l1track);
102 
103  fastjet::PseudoJet psuedoJet(iterL1Track->momentum().x(),
104  iterL1Track->momentum().y(),
105  iterL1Track->momentum().z(),
106  iterL1Track->momentum().mag());
107  JetInputs.push_back(psuedoJet); // input tracks for clustering
108  JetInputs.back().set_user_index(this_l1track); // save track index in the collection
109  } // end loop over tracks
110 
111  fastjet::ClusterSequence cs(JetInputs, jet_def); // define the output jet collection
112  std::vector<fastjet::PseudoJet> JetOutputs =
113  fastjet::sorted_by_pt(cs.inclusive_jets(0)); // output jet collection, pT-ordered
114 
115  for (unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
117  JetOutputs[ijet].px(), JetOutputs[ijet].py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
118  float sumpt = 0;
119  float avgZ = 0;
120  std::vector<edm::Ptr<L1TTTrackType> > L1TrackPtrs;
121  std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(cs.constituents(JetOutputs[ijet]));
122 
123  for (unsigned int i = 0; i < fjConstituents.size(); ++i) {
124  auto index = fjConstituents[i].user_index();
125  edm::Ptr<L1TTTrackType> trkPtr(TTTrackHandle, index);
126  L1TrackPtrs.push_back(trkPtr); // L1Tracks in the jet
127  sumpt = sumpt + trkPtr->momentum().perp();
128  avgZ = avgZ + trkPtr->momentum().perp() * trkPtr->z0();
129  }
130  avgZ = avgZ / sumpt;
132  TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
133  L1TrackFastJets->push_back(trkJet);
134  } //end loop over Jet Outputs
135 
136  if (displaced_)
137  iEvent.put(std::move(L1TrackFastJets), "L1TrackFastJetsExtended");
138  else
139  iEvent.put(std::move(L1TrackFastJets), "L1TrackFastJets");
140 }
const EDGetTokenT< L1TTTrackRefCollectionType > trackToken_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:224
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
std::vector< TkJet > TkJetCollection
Definition: TkJetFwd.h:20
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ coneSize_

const double L1TrackFastJetProducer::coneSize_
private

Definition at line 69 of file L1TrackFastJetProducer.cc.

Referenced by produce().

◆ displaced_

const bool L1TrackFastJetProducer::displaced_
private

Definition at line 70 of file L1TrackFastJetProducer.cc.

Referenced by L1TrackFastJetProducer(), and produce().

◆ trackToken_

const EDGetTokenT<L1TTTrackRefCollectionType> L1TrackFastJetProducer::trackToken_
private

Definition at line 72 of file L1TrackFastJetProducer.cc.

Referenced by produce().