Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Package - ParticleFlow Phase2 #30256

Closed
wants to merge 13 commits into from
17 changes: 17 additions & 0 deletions L1Trigger/Phase2L1ParticleFlow/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="DataFormats/L1TParticleFlow"/>
<use name="CommonTools/BaseParticlePropagator"/>
<use name="FastSimulation/Particle"/>
<use name="DataFormats/ParticleFlowReco"/>

<use name="L1Trigger/L1THGCal"/>
<use name="CommonTools/Utils"/>
<use name="CommonTools/MVAUtils"/>
<use name="roottmva"/>
<use name="hls"/>
<export>
<lib name="1"/>
</export>
<flags ADD_SUBDIR="1"/>
37 changes: 37 additions & 0 deletions L1Trigger/Phase2L1ParticleFlow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
1) Basic Instructions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not belong in the official repository

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's forbidden I can remove it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an irrelevant private recipe. The official repository does not host those.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like what is an "irrelevant private recipe" and what is useful for CMS developers is a very personal opinion.

Is having it in the repository useful for the ongoing and future developments ?
(though it would probably need to be updated)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The majority of this file constitutes outdated (and technically questionable) private recipes. Nobody using the official software needs or wants this information.

The single line instruction how to run the test config is fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, no: you don't care about this recipe - which is fine - but you don't know who cares about it and why.

So, if you want to leave a comment like

This recipe looks out of date; is it still needed ? does it make sense to have it in CMSSW ?

it's perfectly fine.

On the other hand, a comment like

It is an irrelevant private recipe. The official repository does not host those.

is at the very least rude, possibly offensive, and - as I said - reflects only your personal opinion, not a fact.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the grand scheme of things, "rude" is trying to push O(100K) lines of code written with no attempt to follow the official code rules (or, in many cases, even basic best practices) at the last minute and then asking for a "quick" review and approval.

We cannot possibly maintain this repository if we're expected to care about what every developer may or may not have in their personal forks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot possibly maintain this repository if we're expected to care about what every developer may or may not have in their personal forks.

I don't think we've made such a terrible job over the pas 15 years ?

IMHO the point of a repository is to host the "code" that people will use - not just the workflow that the "central production" cares about.
And, as with everything, there are various degrees to what makes more or less sense to include...

As I already agreed: if the recipe is not useful, out of date, etc. - sure, let's drop it. But "forbidden" is a very strong word.


```
cmsrel CMSSW_10_1_0_pre3
cd CMSSW_10_1_0_pre3/src
cmsenv
git cms-init
git remote add cms-l1t-offline git@github.com:cms-l1t-offline/cmssw.git
git fetch cms-l1t-offline phase2-l1t-integration-CMSSW_10_1_0_pre3
git cms-merge-topic -u cms-l1t-offline:l1t-phase2-v2.7

#
# Tracklet Tracks
#
git remote add rekovic git@github.com:rekovic/cmssw.git
git fetch rekovic Tracklet-10_1_0_pre3
git cms-merge-topic -u rekovic:Tracklet-10_1_0_pre3-from-skinnari

# Remove tracklets from history
git reset --soft cms-l1t-offline/l1t-phase2-v2.7
git reset HEAD L1Trigger

# Get L1PF_CMSSW
git remote add p2l1pfp git@github.com:p2l1pfp/cmssw.git
git fetch p2l1pfp L1PF_CMSSW
echo -e '/DataFormats/L1TParticleFlow/\n/L1Trigger/Phase2L1ParticleFlow/' >> .git/info/sparse-checkout
git read-tree -mu HEAD
git checkout -b L1PF_CMSSW p2l1pfp/L1PF_CMSSW

scram b -j8
```

2) Ntuple for jets, jet HT and MET studies

```
cmsRun test/l1pfJetMetTreeProducer.py
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions L1Trigger/Phase2L1ParticleFlow/interface/BitwisePFAlgo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef L1Trigger_Phase2L1ParticleFlow_BitwisePFAlgo_h
#define L1Trigger_Phase2L1ParticleFlow_BitwisePFAlgo_h

#include "L1Trigger/Phase2L1ParticleFlow/interface/PFAlgoBase.h"

struct pfalgo_config;

namespace l1tpf_impl {
class BitwisePFAlgo : public PFAlgoBase {
public:
BitwisePFAlgo(const edm::ParameterSet&);
~BitwisePFAlgo() override;
void runPF(Region& r) const override;

protected:
enum AlgoChoice { algo3, algo2hgc } algo_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use enum class

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

pfalgo_config* config_;
};

} // namespace l1tpf_impl

#endif
43 changes: 43 additions & 0 deletions L1Trigger/Phase2L1ParticleFlow/interface/COEFile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef L1Trigger_Phase2L1ParticleFlow_CoeFile_h
#define L1Trigger_Phase2L1ParticleFlow_CoeFile_h

// system include files
#include <vector>
#include <string>
#include <numeric>
#include <boost/dynamic_bitset.hpp>
#include <boost/multiprecision/cpp_int.hpp>

// user include files
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/L1TParticleFlow/interface/PFCandidate.h"
#include "L1Trigger/Phase2L1ParticleFlow/interface/DiscretePFInputs.h"
#include "L1Trigger/Phase2L1ParticleFlow/interface/Region.h"

namespace l1tpf_impl {
class COEFile {
public:
COEFile(const edm::ParameterSet&);
~COEFile();

void close() { fclose(file); }
template <typename T>
bool getBit(T value, unsigned bit) {
return (value >> bit) & 1;
}
bool is_open() { return (file != nullptr); }
void writeHeaderToFile();
void writeTracksToFile(const std::vector<Region>& regions, bool print = false);

protected:
FILE* file;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should have #include <cstdio> if you're going to use this
(but maybe better to use something more modern like fstream)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plain FILE objects have been used for some of these dumpers because the dumps have to be read from other software where plain C is easier/safer.
I'll add the include

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to point out fstream-written files can be read with plain C.

std::string coeFileName, bset_string_;
unsigned int ntracksmax, phiSlices;
static constexpr unsigned int tracksize = 96;
boost::dynamic_bitset<> bset_;
const std::vector<uint32_t> track_word_block_sizes = {14, 1, 12, 16, 12, 13, 4, 3, 7, 14};
int debug_;
};
} // namespace l1tpf_impl

#endif
Loading