Skip to content

Commit

Permalink
Merge pull request cms-sw#78 from cerminar/L1PF_eg_sort_v0
Browse files Browse the repository at this point in the history
Integration of Stage-2 EG simulation
  • Loading branch information
gpetruc committed Dec 10, 2021
2 parents 4c21907 + 45ec716 commit 7a2628b
Show file tree
Hide file tree
Showing 22 changed files with 1,263 additions and 71 deletions.
3 changes: 3 additions & 0 deletions DataFormats/L1TCorrelator/interface/TkElectronFwd.h
Expand Up @@ -10,6 +10,7 @@
#include <vector>
#include "DataFormats/Common/interface/Ref.h"
#include "DataFormats/Common/interface/RefVector.h"
#include "DataFormats/L1TParticleFlow/interface/RegionalOutput.h"

namespace l1t {
class TkElectron;
Expand All @@ -19,5 +20,7 @@ namespace l1t {
typedef edm::Ref<TkElectronCollection> TkElectronRef;
typedef edm::RefVector<TkElectronCollection> TkElectronRefVector;
typedef std::vector<TkElectronRef> TkElectronVectorRef;
typedef l1t::RegionalOutput<l1t::TkElectronCollection> TkElectronRegionalOutput;

} // namespace l1t
#endif
17 changes: 17 additions & 0 deletions DataFormats/L1TCorrelator/interface/TkEm.h
Expand Up @@ -13,6 +13,7 @@
#include "DataFormats/L1Trigger/interface/EGamma.h"

#include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
#include <ap_int.h>

namespace l1t {

Expand Down Expand Up @@ -54,6 +55,18 @@ namespace l1t {
void setPuppiIsolPV(float puppiIsolPV) { puppiIsolPV_ = puppiIsolPV; }
void setEGRef(const edm::Ref<EGammaBxCollection>& egRef) { egRef_ = egRef; }

template<int N>
void setEgBinaryWord(ap_uint<N> word) {
egBinaryWord0_ = word;
egBinaryWord1_ = (word >> 32);
egBinaryWord2_ = (word >> 64);
}

template<int N>
ap_uint<N> egBinaryWord() const {
return ap_uint<N>(egBinaryWord0_) | (ap_uint<N>(egBinaryWord1_) << 32) | (ap_uint<N>(egBinaryWord2_) << 64);
}

private:
edm::Ref<EGammaBxCollection> egRef_;
float trkIsol_;
Expand All @@ -62,6 +75,10 @@ namespace l1t {
float pfIsolPV_;
float puppiIsol_;
float puppiIsolPV_;
uint32_t egBinaryWord0_;
uint32_t egBinaryWord1_;
uint32_t egBinaryWord2_;

};
} // namespace l1t

Expand Down
3 changes: 3 additions & 0 deletions DataFormats/L1TCorrelator/interface/TkEmFwd.h
Expand Up @@ -10,6 +10,7 @@
#include <vector>
#include "DataFormats/Common/interface/Ref.h"
#include "DataFormats/Common/interface/RefVector.h"
#include "DataFormats/L1TParticleFlow/interface/RegionalOutput.h"

namespace l1t {

Expand All @@ -20,6 +21,8 @@ namespace l1t {
typedef edm::Ref<TkEmCollection> TkEmRef;
typedef edm::RefVector<TkEmCollection> TkEmRefVector;
typedef std::vector<TkEmRef> TkEmVectorRef;
typedef l1t::RegionalOutput<l1t::TkEmCollection> TkEmRegionalOutput;

} // namespace l1t

#endif
5 changes: 4 additions & 1 deletion DataFormats/L1TCorrelator/src/TkEm.cc
Expand Up @@ -21,4 +21,7 @@ TkEm::TkEm(const LorentzVector& p4, const edm::Ref<EGammaBxCollection>& egRef, f
pfIsol_(-999),
pfIsolPV_(-999),
puppiIsol_(-999),
puppiIsolPV_(-999) {}
puppiIsolPV_(-999),
egBinaryWord0_(0),
egBinaryWord1_(0),
egBinaryWord2_(0) {}
13 changes: 10 additions & 3 deletions DataFormats/L1TCorrelator/src/classes_def.xml
Expand Up @@ -17,14 +17,18 @@
<class name="edm::Wrapper<l1t::TkEtMiss>"/>
<class name="edm::Wrapper<std::vector<l1t::TkEtMiss> >"/>

<class name="l1t::TkEm" ClassVersion="4">
<class name="l1t::TkEm" ClassVersion="5">
<version ClassVersion="5" checksum="2211175625"/>
<version ClassVersion="4" checksum="1043577432"/>
<version ClassVersion="3" checksum="2161257944"/>
</class>
<class name="std::vector<l1t::TkEm>"/>
<class name="edm::Wrapper<std::vector<l1t::TkEm> >"/>
<class name="edm::Ref<std::vector<l1t::TkEm>,l1t::TkEm,edm::refhelper::FindUsingAdvance<std::vector<l1t::TkEm>,l1t::TkEm> >"/>
<class name="std::vector<edm::Ref<std::vector<l1t::TkEm>,l1t::TkEm,edm::refhelper::FindUsingAdvance<std::vector<l1t::TkEm>,l1t::TkEm> > >"/>
<class name="edm::RefProd<l1t::TkEmCollection>" />
<class name="l1t::RegionalOutput<l1t::TkEmCollection>" />
<class name="edm::Wrapper<l1t::RegionalOutput<l1t::TkEmCollection>>" />

<class name="l1t::TkEGTau" ClassVersion="3">
<version ClassVersion="3" checksum="3759113668"/>
Expand All @@ -47,14 +51,18 @@
<class name="edm::Wrapper<std::vector<l1t::L1CaloTkTau> >"/>
<class name="edm::Ref<std::vector<l1t::L1CaloTkTau>,l1t::L1CaloTkTau,edm::refhelper::FindUsingAdvance<std::vector<l1t::L1CaloTkTau>,l1t::L1CaloTkTau> >"/>

<class name="l1t::TkElectron" ClassVersion="4">
<class name="l1t::TkElectron" ClassVersion="5">
<version ClassVersion="5" checksum="965807884"/>
<version ClassVersion="4" checksum="3922083203"/>
<version ClassVersion="3" checksum="3970647299"/>
</class>
<class name="std::vector<l1t::TkElectron>"/>
<class name="edm::Wrapper<std::vector<l1t::TkElectron> >"/>
<class name="edm::Ref<std::vector<l1t::TkElectron>,l1t::TkElectron,edm::refhelper::FindUsingAdvance<std::vector<l1t::TkElectron>,l1t::TkElectron> >"/>
<class name="std::vector<edm::Ref<std::vector<l1t::TkElectron>,l1t::TkElectron,edm::refhelper::FindUsingAdvance<std::vector<l1t::TkElectron>,l1t::TkElectron> > >"/>
<class name="edm::RefProd<l1t::TkElectronCollection>" />
<class name="l1t::RegionalOutput<l1t::TkElectronCollection>" />
<class name="edm::Wrapper<l1t::RegionalOutput<l1t::TkElectronCollection>>" />

<class name="l1t::TkJet" ClassVersion="3">
<version ClassVersion="3" checksum="3336007399"/>
Expand Down Expand Up @@ -112,4 +120,3 @@
<class name="edm::Ref<std::vector<l1t::TkBsCandidate>, l1t::TkBsCandidate, edm::refhelper::FindUsingAdvance<std::vector<l1t::TkBsCandidate>, l1t::TkBsCandidate>>" />

</lcgdict>

1 change: 1 addition & 0 deletions L1Trigger/Phase2L1ParticleFlow/BuildFile.xml
Expand Up @@ -12,6 +12,7 @@
<use name="CommonTools/Utils"/>
<use name="CommonTools/MVAUtils"/>
<use name="PhysicsTools/TensorFlow"/>
<use name="L1Trigger/DemonstratorTools"/>
<use name="tensorflow"/>
<use name="roottmva"/>
<use name="hls"/>
Expand Down

0 comments on commit 7a2628b

Please sign in to comment.